|
@@ -31,37 +31,47 @@
|
|
|
class="time-form"
|
|
class="time-form"
|
|
|
>
|
|
>
|
|
|
<template v-slot:fundType="scope">
|
|
<template v-slot:fundType="scope">
|
|
|
- <el-select
|
|
|
|
|
- v-model="scope.row.fundType"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- class="ele-block"
|
|
|
|
|
- :disabled="isView"
|
|
|
|
|
- @change="(val) => updateRowField(scope.$index, 'fundType', val)"
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="'payablesList.' + scope.$index + '.fundType'"
|
|
|
|
|
+ label-width="0"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in paymentTypeOp"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.fundType"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ class="ele-block"
|
|
|
|
|
+ :disabled="isView"
|
|
|
|
|
+ @change="(val) => updateRowField(scope.$index, 'fundType', val)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in paymentTypeOp"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:transactionMode="scope">
|
|
<template v-slot:transactionMode="scope">
|
|
|
- <el-select
|
|
|
|
|
- v-model="scope.row.transactionMode"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- class="ele-block"
|
|
|
|
|
- :disabled="isView"
|
|
|
|
|
- @change="(val) => updateRowField(scope.$index, 'transactionMode', val)"
|
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="'payablesList.' + scope.$index + '.transactionMode'"
|
|
|
|
|
+ label-width="0"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in transactionMethodsOp"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.transactionMode"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ class="ele-block"
|
|
|
|
|
+ :disabled="isView"
|
|
|
|
|
+ @change="(val) => updateRowField(scope.$index, 'transactionMode', val)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in transactionMethodsOp"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:paymentConditionName="scope">
|
|
<template v-slot:paymentConditionName="scope">
|
|
@@ -103,6 +113,10 @@
|
|
|
>删除</el-link
|
|
>删除</el-link
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-slot:columnRequired="{ column }">
|
|
|
|
|
+ <span class="is-required">{{ column.label }}</span>
|
|
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<!-- 付款条件 -->
|
|
<!-- 付款条件 -->
|
|
@@ -177,14 +191,16 @@
|
|
|
minWidth: 140,
|
|
minWidth: 140,
|
|
|
label: '款项类型',
|
|
label: '款项类型',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- slot: 'fundType'
|
|
|
|
|
|
|
+ slot: 'fundType',
|
|
|
|
|
+ headerSlot: 'columnRequired'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'transactionMode',
|
|
prop: 'transactionMode',
|
|
|
minWidth: 140,
|
|
minWidth: 140,
|
|
|
label: '交易方式',
|
|
label: '交易方式',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- slot: 'transactionMode'
|
|
|
|
|
|
|
+ slot: 'transactionMode',
|
|
|
|
|
+ headerSlot: 'columnRequired'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'paymentConditionName',
|
|
prop: 'paymentConditionName',
|
|
@@ -225,6 +241,20 @@
|
|
|
// align: 'center',
|
|
// align: 'center',
|
|
|
// // slot: 'statementAdvanceConfirmAmount'
|
|
// // slot: 'statementAdvanceConfirmAmount'
|
|
|
// },
|
|
// },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 190,
|
|
|
|
|
+ headerSlot: 'columnRequired',
|
|
|
|
|
+ prop: 'statementAdvanceConfirmAmount',
|
|
|
|
|
+ label: '本次对账预付款确收金额',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'statementAdvanceConfirmAmount'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'lastPayableAmt',
|
|
|
|
|
+ label: '上期累计应付金额',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
minWidth: 120,
|
|
minWidth: 120,
|
|
|
prop: 'statementAmount',
|
|
prop: 'statementAmount',
|
|
@@ -238,6 +268,13 @@
|
|
|
label: '本次应付金额',
|
|
label: '本次应付金额',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'payableAmt',
|
|
|
|
|
+ label: '累计应付金额',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
@@ -293,11 +330,12 @@
|
|
|
this.updateRowField(targetIndex, 'collectionConditionName', row.name);
|
|
this.updateRowField(targetIndex, 'collectionConditionName', row.name);
|
|
|
},
|
|
},
|
|
|
// 行内字段修改:仅更新本地副本
|
|
// 行内字段修改:仅更新本地副本
|
|
|
|
|
+ // 注意:必须用 $set 直接修改原对象属性,保持引用不变,
|
|
|
|
|
+ // 否则 ele-pro-table 内部缓存的 tableData 仍引用旧对象,导致表格不更新
|
|
|
updateRowField(index, key, val) {
|
|
updateRowField(index, key, val) {
|
|
|
const item = this.localList[index];
|
|
const item = this.localList[index];
|
|
|
if (!item) return;
|
|
if (!item) return;
|
|
|
- this.localList[index] = { ...item, [key]: val };
|
|
|
|
|
- this.recalcRow(item);
|
|
|
|
|
|
|
+ this.$set(item, key, val);
|
|
|
},
|
|
},
|
|
|
// 新增一行空白预付
|
|
// 新增一行空白预付
|
|
|
addRow() {
|
|
addRow() {
|
|
@@ -311,8 +349,10 @@
|
|
|
paymentConditionName: '',
|
|
paymentConditionName: '',
|
|
|
unreconciledAdvanceConfirmAmount: 0,
|
|
unreconciledAdvanceConfirmAmount: 0,
|
|
|
statementAdvanceConfirmAmount: 0,
|
|
statementAdvanceConfirmAmount: 0,
|
|
|
|
|
+ lastPayableAmt: 0,
|
|
|
statementAmount: 0,
|
|
statementAmount: 0,
|
|
|
- payablePrice: 0
|
|
|
|
|
|
|
+ payablePrice: 0,
|
|
|
|
|
+ payableAmt: 0
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 由父组件预付款选择器回调调用:追加一行已映射好的应付明细(本地维护)
|
|
// 由父组件预付款选择器回调调用:追加一行已映射好的应付明细(本地维护)
|
|
@@ -343,18 +383,32 @@
|
|
|
}
|
|
}
|
|
|
this.recalcRow(row);
|
|
this.recalcRow(row);
|
|
|
},
|
|
},
|
|
|
- // 根据本次对账金额重算单行:确收金额 = min(未对账预付款确收金额, 本次对账金额);应付金额 = 本次对账金额 - 确收金额
|
|
|
|
|
|
|
+ // 根据本次对账金额重算单行:
|
|
|
|
|
+ // 确收金额 = min(未对账预付款确收金额, 本次对账金额)
|
|
|
|
|
+ // 本次应付金额 = 本次对账金额 - 确收金额
|
|
|
|
|
+ // 累计应付金额 = 本次对账金额 - 累计预付确付金额 + 上期累计应付金额
|
|
|
recalcRow(row) {
|
|
recalcRow(row) {
|
|
|
const statementAmount = +row.statementAmount || 0;
|
|
const statementAmount = +row.statementAmount || 0;
|
|
|
let val = +row.statementAdvanceConfirmAmount || 0;
|
|
let val = +row.statementAdvanceConfirmAmount || 0;
|
|
|
const max = this.getMaxConfirmAmount(row);
|
|
const max = this.getMaxConfirmAmount(row);
|
|
|
if (val > max) val = max;
|
|
if (val > max) val = max;
|
|
|
this.$set(row, 'statementAdvanceConfirmAmount', val);
|
|
this.$set(row, 'statementAdvanceConfirmAmount', val);
|
|
|
|
|
+ // 本次应付金额 = 本次对账金额 - 确收金额
|
|
|
this.$set(
|
|
this.$set(
|
|
|
row,
|
|
row,
|
|
|
'payablePrice',
|
|
'payablePrice',
|
|
|
Math.round((statementAmount - val) * 100) / 100
|
|
Math.round((statementAmount - val) * 100) / 100
|
|
|
);
|
|
);
|
|
|
|
|
+ // 累计应付金额=本次对账金额-累计预付确付金额+上期累计应付金额
|
|
|
|
|
+ const totalPayableAmount =
|
|
|
|
|
+ statementAmount -
|
|
|
|
|
+ (+row.confirmedPrepayAmt || 0) +
|
|
|
|
|
+ (+row.lastPayableAmt || 0);
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ row,
|
|
|
|
|
+ 'payableAmt',
|
|
|
|
|
+ Math.round(totalPayableAmount * 100) / 100
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
// 明细表按采购单号汇总本次对账金额后,同步到对应采购单号的应付行
|
|
// 明细表按采购单号汇总本次对账金额后,同步到对应采购单号的应付行
|
|
|
syncStatementAmount(summaryMap) {
|
|
syncStatementAmount(summaryMap) {
|
|
@@ -413,5 +467,13 @@
|
|
|
justify-content: flex-end;
|
|
justify-content: flex-end;
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .el-form-item {
|
|
|
|
|
+ margin-bottom: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ::v-deep .is-required::before {
|
|
|
|
|
+ content: '*';
|
|
|
|
|
+ color: #f56c6c;
|
|
|
|
|
+ margin-right: 4px;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|