|
|
@@ -16,70 +16,6 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="款项类型" prop="fundType">
|
|
|
- <el-select
|
|
|
- v-model="fundType"
|
|
|
- placeholder="请选择"
|
|
|
- class="ele-block"
|
|
|
- :disabled="isView"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in paymentTypeOp"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="交易方式" prop="transactionMethod">
|
|
|
- <el-select
|
|
|
- v-model="transactionMethod"
|
|
|
- placeholder="请选择"
|
|
|
- class="ele-block"
|
|
|
- :disabled="isView"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in transactionMethodsOp"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="收款条件" prop="collectionTerms">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="paymentConditionName"
|
|
|
- @click.native="openReceiveTerms"
|
|
|
- placeholder="请选择"
|
|
|
- readonly
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <!-- <el-col :span="8" v-if="isView">
|
|
|
- <el-form-item label="收款状态">
|
|
|
- <el-select
|
|
|
- v-model="receiptStatus"
|
|
|
- placeholder="请选择"
|
|
|
- class="ele-block"
|
|
|
- disabled
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in paymentStatusOp"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col> -->
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -104,9 +40,56 @@
|
|
|
cache-key="account-receivable-table"
|
|
|
class="time-form"
|
|
|
>
|
|
|
- <template v-slot:currentConfirmAmount="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-option
|
|
|
+ v-for="item in paymentTypeOp"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <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-option
|
|
|
+ v-for="item in transactionMethodsOp"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:paymentCondition="scope">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :value="scope.row.paymentConditionName"
|
|
|
+ @click.native="openReceiveTerms(scope.$index)"
|
|
|
+ :placeholder="isView ? '' : '请选择'"
|
|
|
+ :disabled="isView"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:statementAdvanceConfirmAmount="scope">
|
|
|
<el-form-item
|
|
|
- :prop="'receivableList.' + scope.$index + '.currentConfirmAmount'"
|
|
|
+ :prop="'receivableList.' + scope.$index + '.statementAdvanceConfirmAmount'"
|
|
|
:rules="{
|
|
|
validator: (rule, value, cb) =>
|
|
|
validateConfirmAmount(rule, value, cb, scope.row),
|
|
|
@@ -114,7 +97,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="scope.row.currentConfirmAmount"
|
|
|
+ v-model="scope.row.statementAdvanceConfirmAmount"
|
|
|
type="number"
|
|
|
:disabled="isView"
|
|
|
@input="handleConfirmAmountChange(scope.row, scope.$index)"
|
|
|
@@ -135,7 +118,11 @@
|
|
|
</ele-pro-table>
|
|
|
</el-form>
|
|
|
<!-- 收款条件 -->
|
|
|
- <receiveTermsDialog ref="receiveTermsDialogRef" conditionType="rules" @changeParent="changeReceiveTerms"></receiveTermsDialog>
|
|
|
+ <receiveTermsDialog
|
|
|
+ ref="receiveTermsDialogRef"
|
|
|
+ conditionType="rules"
|
|
|
+ @changeParent="changeReceiveTerms"
|
|
|
+ ></receiveTermsDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -171,30 +158,7 @@
|
|
|
paymentTypeOp,
|
|
|
transactionMethodsOp,
|
|
|
paymentStatusOp: paymentStatus,
|
|
|
- // 收款条件下拉,建议后续从主数据接口获取
|
|
|
- collectionTermsOptions: [
|
|
|
- { label: '货到付款', value: '货到付款' },
|
|
|
- { label: '款到发货', value: '款到发货' },
|
|
|
- { label: '月结', value: '月结' },
|
|
|
- { label: '季度结', value: '季度结' }
|
|
|
- ],
|
|
|
- rules: {
|
|
|
- fundType: {
|
|
|
- required: true,
|
|
|
- message: '请选择款项类型',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- transactionMethod: {
|
|
|
- required: true,
|
|
|
- message: '请选择交易方式',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- collectionTerms: {
|
|
|
- required: true,
|
|
|
- message: '请选择收款条件',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
- },
|
|
|
+ rules: {},
|
|
|
columns: [
|
|
|
{
|
|
|
width: 60,
|
|
|
@@ -206,38 +170,49 @@
|
|
|
},
|
|
|
{
|
|
|
minWidth: 140,
|
|
|
- prop: 'saleOrderNo',
|
|
|
+ prop: 'salesCode',
|
|
|
label: '销售订单编码',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
minWidth: 140,
|
|
|
- prop: 'advanceReceiptCode',
|
|
|
+ prop: 'advanceCode',
|
|
|
label: '预收编码',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
- minWidth: 100,
|
|
|
- prop: 'fundTypeName',
|
|
|
+ minWidth: 140,
|
|
|
label: '款项类型',
|
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
+ slot: 'fundType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 140,
|
|
|
+ label: '交易方式',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'transactionMode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 160,
|
|
|
+ label: '收款条件',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'paymentCondition'
|
|
|
},
|
|
|
{
|
|
|
minWidth: 140,
|
|
|
- prop: 'unConfirmAmount',
|
|
|
+ prop: 'unreconciledAdvanceConfirmAmount',
|
|
|
label: '未对账预收款确收金额',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
minWidth: 160,
|
|
|
- prop: 'currentConfirmAmount',
|
|
|
+ prop: 'statementAdvanceConfirmAmount',
|
|
|
label: '本次对账预收款确收金额',
|
|
|
align: 'center',
|
|
|
- slot: 'currentConfirmAmount'
|
|
|
+ slot: 'statementAdvanceConfirmAmount'
|
|
|
},
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
@@ -268,61 +243,11 @@
|
|
|
isView() {
|
|
|
return this.dialogType === 'view';
|
|
|
},
|
|
|
- // dataForm 通过 .sync 传入,下面 4 个字段用 computed 代理,
|
|
|
- // set 时整体 emit 新的 dataForm,避免直接修改 prop(满足 vue/no-mutating-props)
|
|
|
- fundType: {
|
|
|
- get() {
|
|
|
- return this.dataForm.fundType;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('fundType', val);
|
|
|
- }
|
|
|
- },
|
|
|
- transactionMethod: {
|
|
|
- get() {
|
|
|
- return this.dataForm.transactionMethod;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('transactionMethod', val);
|
|
|
- }
|
|
|
- },
|
|
|
- collectionTerms: {
|
|
|
- get() {
|
|
|
- return this.dataForm.collectionTerms;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('collectionTerms', val);
|
|
|
- }
|
|
|
- },
|
|
|
- paymentConditionId: {
|
|
|
- get() {
|
|
|
- return this.dataForm.paymentConditionId;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('paymentConditionId', val);
|
|
|
- }
|
|
|
- },
|
|
|
- paymentConditionName: {
|
|
|
- get() {
|
|
|
- return this.dataForm.paymentConditionName;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('paymentConditionName', val);
|
|
|
- }
|
|
|
- },
|
|
|
- receiptStatus: {
|
|
|
- get() {
|
|
|
- return this.dataForm.receiptStatus;
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.emitDataForm('receiptStatus', val);
|
|
|
- }
|
|
|
- },
|
|
|
totalAdvanceConfirmAmount() {
|
|
|
return (
|
|
|
this.receivableList.reduce(
|
|
|
(pre, cur) =>
|
|
|
- pre + Math.round((+cur.currentConfirmAmount || 0) * 100),
|
|
|
+ pre + Math.round((+cur.statementAdvanceConfirmAmount || 0) * 100),
|
|
|
0
|
|
|
) / 100
|
|
|
);
|
|
|
@@ -347,17 +272,22 @@
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
- openReceiveTerms() {
|
|
|
+ openReceiveTerms(index) {
|
|
|
+ this.currentRowIndex = index;
|
|
|
this.$refs.receiveTermsDialogRef.open();
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
changeReceiveTerms(row, index) {
|
|
|
- this.emitDataForm('paymentConditionId', row.id);
|
|
|
- this.emitDataForm('paymentConditionName', row.name);
|
|
|
+ const targetIndex = index != null ? index : this.currentRowIndex;
|
|
|
+ if (targetIndex == null) return;
|
|
|
+ this.updateRowField(targetIndex, 'paymentConditionId', row.id);
|
|
|
+ this.updateRowField(targetIndex, 'paymentConditionName', row.name);
|
|
|
},
|
|
|
- // dataForm 为 .sync prop,整体替换以避免直接 mutation
|
|
|
- emitDataForm(key, val) {
|
|
|
- this.$emit('update:dataForm', { ...this.dataForm, [key]: val });
|
|
|
+ // 行内字段修改:通过 .sync 回写 receivableList
|
|
|
+ updateRowField(index, key, val) {
|
|
|
+ const list = [...this.receivableList];
|
|
|
+ list[index] = { ...list[index], [key]: val };
|
|
|
+ this.$emit('update:receivableList', list);
|
|
|
},
|
|
|
// 新增一行预收款(实际应从预收款管理选择器带出)
|
|
|
addAdvanceReceipt() {
|
|
|
@@ -370,14 +300,14 @@
|
|
|
},
|
|
|
handleConfirmAmountChange(row, index) {
|
|
|
// 限制本次确收金额不能超过未对账金额和本次对账金额
|
|
|
- let val = +row.currentConfirmAmount || 0;
|
|
|
+ let val = +row.statementAdvanceConfirmAmount || 0;
|
|
|
const max = Math.min(
|
|
|
- +row.unConfirmAmount || 0,
|
|
|
+ +row.unreconciledAdvanceConfirmAmount || 0,
|
|
|
+row.statementAmount || 0
|
|
|
);
|
|
|
if (val > max) {
|
|
|
val = max;
|
|
|
- this.$set(row, 'currentConfirmAmount', val);
|
|
|
+ this.$set(row, 'statementAdvanceConfirmAmount', val);
|
|
|
this.$message.warning(
|
|
|
'本次对账预收款确收金额不能超过未对账金额和本次对账金额'
|
|
|
);
|
|
|
@@ -390,12 +320,12 @@
|
|
|
recalcAllRows() {
|
|
|
this.receivableList.forEach((row) => {
|
|
|
const max = Math.min(
|
|
|
- +row.unConfirmAmount || 0,
|
|
|
+ +row.unreconciledAdvanceConfirmAmount || 0,
|
|
|
+row.statementAmount || 0
|
|
|
);
|
|
|
- let val = +row.currentConfirmAmount || 0;
|
|
|
+ let val = +row.statementAdvanceConfirmAmount || 0;
|
|
|
if (val > max) val = max;
|
|
|
- this.$set(row, 'currentConfirmAmount', val);
|
|
|
+ this.$set(row, 'statementAdvanceConfirmAmount', val);
|
|
|
this.$set(
|
|
|
row,
|
|
|
'currentReceivableAmount',
|
|
|
@@ -406,7 +336,7 @@
|
|
|
validateConfirmAmount(rule, value, callback, row) {
|
|
|
const val = +value || 0;
|
|
|
const max = Math.min(
|
|
|
- +row.unConfirmAmount || 0,
|
|
|
+ +row.unreconciledAdvanceConfirmAmount || 0,
|
|
|
+row.statementAmount || 0
|
|
|
);
|
|
|
if (val < 0) {
|