diff --git a/src/views/payment/invoice-receipt-form.vue b/src/views/payment/invoice-receipt-form.vue
index 2a6b5d0..b798e98 100644
--- a/src/views/payment/invoice-receipt-form.vue
+++ b/src/views/payment/invoice-receipt-form.vue
@@ -16,13 +16,22 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -32,7 +41,16 @@
-
+
+
+
+
+
@@ -64,23 +82,54 @@
-
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -89,7 +138,12 @@
-
+
{{ row.formalSettlementNo }}
@@ -187,12 +241,27 @@
@selection-change="settlementDialog.selection = $event"
>
-
-
-
-
-
-
+
+
+
+
+
+
{{ formatMoney(row.settlementAmount) }}
@@ -637,6 +706,15 @@ export default {
.receipt-form-page__form :deep(.el-input-number) {
width: 100%;
}
+.receipt-form-page__overflow-trigger {
+ display: block;
+ width: 100%;
+ min-width: 0;
+}
+.receipt-form-page__form :deep(.el-tooltip__trigger:not(.el-select__wrapper)) {
+ display: block;
+ width: 100%;
+}
.receipt-form-page__remark :deep(.el-form-item__content) {
margin-left: 0 !important;
}
diff --git a/src/views/payment/payment-application-form.vue b/src/views/payment/payment-application-form.vue
index 4c4d340..eb13204 100644
--- a/src/views/payment/payment-application-form.vue
+++ b/src/views/payment/payment-application-form.vue
@@ -121,7 +121,7 @@
>
1) {
+ // 多结算单:行内比例/金额独立维护,不回落到表头比例(表头与结算信息不关联)
return this.referenceRows.map(item => {
- const paymentRatio = item.paymentRatio ?? this.form.paymentRatio;
+ const paymentRatio =
+ item.paymentRatio === undefined || item.paymentRatio === null || item.paymentRatio === ''
+ ? 0
+ : Number(item.paymentRatio);
const appliedAmount = Number(item.appliedAmount || 0);
return {
...item,
@@ -1098,7 +1102,8 @@ export default {
},
'form.paymentRatio'(value) {
this.checkContractPaymentRatio(value);
- if (this.amountSyncing || this.multipleSettlementRows || !this.paymentAmountBase) return;
+ // 上方比例仅用于反算申请付款金额,不联动结算信息列表
+ if (this.amountSyncing || !this.paymentAmountBase) return;
this.amountSyncing = true;
this.form.appliedAmount = Number(
((this.paymentAmountBase * Number(value || 0)) / 100).toFixed(2)
@@ -1108,7 +1113,8 @@ export default {
});
},
'form.appliedAmount'(value) {
- if (this.amountSyncing || this.multipleSettlementRows || !this.paymentAmountBase) return;
+ // 上方申请付款金额反算比例,不联动结算信息列表
+ if (this.amountSyncing || !this.paymentAmountBase) return;
this.amountSyncing = true;
this.form.paymentRatio = Number(
((Number(value || 0) / this.paymentAmountBase) * 100).toFixed(2)
@@ -1121,11 +1127,11 @@ export default {
if (
this.amountSyncing ||
this.form.paymentType === 'project_advance' ||
- this.multipleSettlementRows ||
!this.paymentAmountBase
) {
return;
}
+ // 结算金额变化时按上方比例重算申请付款金额,仍不联动结算信息明细
this.amountSyncing = true;
this.form.appliedAmount = Number(
((this.paymentAmountBase * Number(this.form.paymentRatio || 0)) / 100).toFixed(2)
@@ -1547,13 +1553,27 @@ export default {
(total, item) => total + Number(item.payableAmount || 0),
0
);
- const appliedAmount = referenceRows.reduce(
+ const multiple = referenceRows.length > 1;
+ // 多结算单:表头比例/申请金额独立;单结算单:沿用行金额或按比例计算
+ const paymentRatio = Number(this.form.paymentRatio || 0);
+ const rowsAppliedTotal = referenceRows.reduce(
(total, item) => total + Number(item.appliedAmount || 0),
0
);
- const paymentRatio = settlementAmount
- ? Number(((appliedAmount / settlementAmount) * 100).toFixed(2))
- : 0;
+ const headerAppliedAmount = multiple
+ ? Number(((settlementAmount * paymentRatio) / 100).toFixed(2))
+ : Number(
+ (
+ rowsAppliedTotal > 0
+ ? rowsAppliedTotal
+ : (payableAmount * paymentRatio) / 100
+ ).toFixed(2)
+ );
+ const headerPaymentRatio = multiple
+ ? paymentRatio
+ : settlementAmount
+ ? Number(((headerAppliedAmount / settlementAmount) * 100).toFixed(2))
+ : paymentRatio;
const settlementIds = rows.map(item => item.settlementId || item.id).filter(Boolean);
this.amountSyncing = true;
this.referenceRows = referenceRows;
@@ -1580,8 +1600,8 @@ export default {
settlementAmount: Number(settlementAmount.toFixed(2)),
payableAmount: Number(payableAmount.toFixed(2)),
billType: '',
- paymentRatio,
- appliedAmount: Number(appliedAmount.toFixed(2)),
+ paymentRatio: headerPaymentRatio,
+ appliedAmount: headerAppliedAmount,
invoices: rows.flatMap(item =>
this.createInvoiceRows(item.invoices || [], item.formalSettlementNo || item.settlementNo)
),
@@ -1838,19 +1858,21 @@ export default {
(total, item) => total + Number(item.payableAmount || 0),
0
);
- const appliedAmount = this.referenceRows.reduce(
+ const multiple = this.referenceRows.length > 1;
+ const paymentRatio = Number(this.form.paymentRatio || 0);
+ const rowsAppliedTotal = this.referenceRows.reduce(
(total, item) => total + Number(item.appliedAmount || 0),
0
);
- const multiple = this.referenceRows.length > 1;
- const paymentRatio = multiple
- ? settlementAmount
- ? Number(((appliedAmount / settlementAmount) * 100).toFixed(2))
- : 0
- : Number(this.form.paymentRatio || 0);
+ // 多结算单:表头申请金额只由上方比例计算;单结算单仍按可付款金额×比例
const headerAppliedAmount = multiple
- ? Number(appliedAmount.toFixed(2))
+ ? Number(((settlementAmount * paymentRatio) / 100).toFixed(2))
: Number(((payableAmount * paymentRatio) / 100).toFixed(2));
+ const headerPaymentRatio = multiple
+ ? paymentRatio
+ : settlementAmount && rowsAppliedTotal > 0
+ ? Number(((rowsAppliedTotal / settlementAmount) * 100).toFixed(2))
+ : paymentRatio;
// 尾款付款场景下选择预付结算单时保留尾款付款类型,不强制改为进度预付
this.amountSyncing = true;
Object.assign(this.form, {
@@ -1876,7 +1898,7 @@ export default {
settlementAmount: Number(settlementAmount.toFixed(2)),
payableAmount: Number(payableAmount.toFixed(2)),
billType: '',
- paymentRatio,
+ paymentRatio: headerPaymentRatio,
appliedAmount: headerAppliedAmount,
});
this.rememberSettlementParties(first.payerName, first.payeeName);
@@ -3074,19 +3096,16 @@ export default {
if (settlementAmount <= 0) return 100;
return Number(Math.min(100, (payableAmount / settlementAmount) * 100).toFixed(2));
},
+ /**
+ * 多结算单行金额规范化:仅在行内反算比例,不使用表头比例灌入(表头与结算信息不关联)。
+ */
seedMultipleRowPayments(rows = []) {
if (rows.length <= 1) return;
- const ratio = Number(this.form.paymentRatio || 0);
rows.forEach(item => {
const settlementAmount = Number(item.settlementAmount || 0);
const payableAmount = Number(item.payableAmount || 0);
- const hasRatio =
- item.paymentRatio !== null && item.paymentRatio !== undefined && item.paymentRatio !== '';
- if (hasRatio) return;
let applied = Number(item.appliedAmount || 0);
- if (applied <= 0 && ratio > 0) {
- applied = Number(((settlementAmount * ratio) / 100).toFixed(2));
- }
+ if (!Number.isFinite(applied) || applied < 0) applied = 0;
if (applied > payableAmount) applied = Number(payableAmount.toFixed(2));
item.appliedAmount = Number(applied.toFixed(2));
item.paymentRatio = settlementAmount
@@ -3102,6 +3121,25 @@ export default {
item.settlementNo === row.settlementNo
);
},
+ /** 结算信息付款金额合计 */
+ settlementRowsAppliedTotal(rows = this.referenceRows) {
+ return (rows || []).reduce((total, item) => total + Number(item.appliedAmount || 0), 0);
+ },
+ /** 结算信息合计不得超过上方申请付款金额 */
+ ensureSettlementAppliedWithinHeader(showWarning = true) {
+ if (!this.multipleSettlementRows) return true;
+ const headerApplied = Number(this.form.appliedAmount || 0);
+ const rowsTotal = Number(this.settlementRowsAppliedTotal().toFixed(2));
+ if (rowsTotal - headerApplied > 1e-8) {
+ if (showWarning) {
+ this.$message.warning(
+ `结算信息付款金额合计(${rowsTotal.toFixed(2)})不能大于申请付款金额(${headerApplied.toFixed(2)})`
+ );
+ }
+ return false;
+ }
+ return true;
+ },
handleRowPaymentRatioChange(row, value) {
const target = this.findReferenceRow(row);
if (!target) return;
@@ -3114,7 +3152,9 @@ export default {
target.paymentRatio = settlementAmount
? Number(((applied / settlementAmount) * 100).toFixed(2))
: Number(ratio.toFixed(2));
- this.syncHeaderPaymentFromRows();
+ // 仅刷新结算金额/可付款金额合计,不回写表头申请金额与比例
+ this.syncHeaderSettlementTotalsFromRows();
+ this.ensureSettlementAppliedWithinHeader(true);
},
handleRowAppliedAmountChange(row, value) {
const target = this.findReferenceRow(row);
@@ -3128,9 +3168,11 @@ export default {
target.paymentRatio = settlementAmount
? Number(((target.appliedAmount / settlementAmount) * 100).toFixed(2))
: 0;
- this.syncHeaderPaymentFromRows();
+ this.syncHeaderSettlementTotalsFromRows();
+ this.ensureSettlementAppliedWithinHeader(true);
},
- syncHeaderPaymentFromRows() {
+ /** 多结算单时仅同步结算金额/可付款金额合计,申请付款金额与比例由上方独立维护 */
+ syncHeaderSettlementTotalsFromRows() {
if (this.referenceRows.length <= 1) return;
const settlementAmount = this.referenceRows.reduce(
(total, item) => total + Number(item.settlementAmount || 0),
@@ -3140,22 +3182,18 @@ export default {
(total, item) => total + Number(item.payableAmount || 0),
0
);
- const appliedAmount = this.referenceRows.reduce(
- (total, item) => total + Number(item.appliedAmount || 0),
- 0
- );
this.amountSyncing = true;
this.form.settlementAmount = Number(settlementAmount.toFixed(2));
this.form.payableAmount = Number(payableAmount.toFixed(2));
- this.form.appliedAmount = Number(appliedAmount.toFixed(2));
- this.form.paymentRatio = settlementAmount
- ? Number(((appliedAmount / settlementAmount) * 100).toFixed(2))
- : 0;
this.$nextTick(() => {
this.amountSyncing = false;
- this.$refs.formRef?.validateField?.(['settlementAmount', 'paymentRatio', 'appliedAmount']);
+ this.$refs.formRef?.validateField?.(['settlementAmount', 'appliedAmount']);
});
},
+ /** @deprecated 兼容旧调用名,行为见 syncHeaderSettlementTotalsFromRows */
+ syncHeaderPaymentFromRows() {
+ this.syncHeaderSettlementTotalsFromRows();
+ },
payload() {
// 驳回重提前再清一次:避免历史误存的正式结算单 ID 盖过预结算引用
this.clearFormalReferenceWhenPreOnly();
@@ -3311,6 +3349,14 @@ export default {
ElMessage.warning(`${invalidRow.settlementNo || '结算单'}付款金额不能超过可付款金额`);
return false;
}
+ const rowsTotal = Number(this.settlementRowsAppliedTotal().toFixed(2));
+ if (rowsTotal - appliedAmount > 1e-8) {
+ this.clearMessages();
+ ElMessage.warning(
+ `结算信息付款金额合计(${rowsTotal.toFixed(2)})不能大于申请付款金额(${appliedAmount.toFixed(2)})`
+ );
+ return false;
+ }
}
if (this.form.paymentType === 'project_advance' && !this.form.projectId) {
this.clearMessages();
diff --git a/src/views/settlement/receivable-payable-detail.vue b/src/views/settlement/receivable-payable-detail.vue
index e67a546..75603cd 100644
--- a/src/views/settlement/receivable-payable-detail.vue
+++ b/src/views/settlement/receivable-payable-detail.vue
@@ -451,42 +451,42 @@
:model="updateFeeForm"
:rules="updateFeeRules"
label-position="right"
- label-width="auto"
+ label-width="120px"
class="settlement-detail-page__dialog-form"
>
-
-
+
-
- 选择
-
-
-
+
+
+
+ 选择
+
+
+
+
+
-
+
-
+
@@ -3213,7 +3213,9 @@ export default {
min-width: 0;
}
- :deep(.el-tooltip__trigger) {
+ // 仅作用于外层 tooltip 触发器,排除 el-select 内部下拉用的 .el-select__wrapper
+ // (后者也带 el-tooltip__trigger;若设为 block 会打断 flex,导致「请选择」与箭头叠在左上角)
+ :deep(.el-tooltip__trigger:not(.el-select__wrapper)) {
display: block;
width: 100%;
}
@@ -3223,8 +3225,19 @@ export default {
}
}
+.settlement-detail-page__update-fee-field,
+.settlement-detail-page__update-fee-trigger {
+ display: block;
+ width: 100%;
+ min-width: 0;
+}
+
.settlement-detail-page__update-fee-control {
width: 100%;
+
+ :deep(.el-input-group) {
+ width: 100%;
+ }
}
.settlement-detail-page__adjust-input {