调整收付款问题

This commit is contained in:
2026-09-01 11:52:22 +08:00
parent a9b4ab069b
commit f858eb2bcd
4 changed files with 97 additions and 50 deletions
@@ -1300,18 +1300,41 @@ export default {
};
this.appliedDetailQuery = { ...this.detailQuery };
},
async openAdjustDialog(row, readonly) {
if (!row.id || row.id === row.sourceDetailId) {
this.$message.warning('请先保存预结算单');
return;
async persistDetailForAdjustment(row) {
const sourceDetailId = row.sourceDetailId || row.id;
const isPersistedDetail =
row.id && sourceDetailId && String(row.id) !== String(sourceDetailId);
if (isPersistedDetail) return row;
await this.$refs.formRef?.validate();
this.loading = true;
try {
const { data } = await save(this.buildSavePayload());
this.form.id = data?.data || this.form.id;
await this.loadDetail();
const savedRow = this.details.find(
item => String(item.sourceDetailId || '') === String(sourceDetailId || '')
);
if (!savedRow) {
this.$message.warning('结算明细保存失败,请重试');
return null;
}
this.$emit('success', this.form.id);
return savedRow;
} finally {
this.loading = false;
}
},
async openAdjustDialog(row, readonly) {
const detailRow = await this.persistDetailForAdjustment(row);
if (!detailRow) return;
this.adjustDialog.visible = true;
this.adjustDialog.loading = true;
this.adjustDialog.readonly = readonly;
this.adjustDialog.detailId = row.id;
this.adjustDialog.detailId = detailRow.id;
this.adjustDialog.reason = '';
try {
const { data } = await getDetailFees(row.id);
const { data } = await getDetailFees(detailRow.id);
this.adjustRows = (data?.data || []).map(item => ({
...item,
feeItems: this.parseFeeItems(item.feeItemsJson),
@@ -1545,6 +1568,7 @@ export default {
&--page &__content {
max-height: none;
padding-bottom: 72px;
overflow: visible;
}