|
|
@@ -128,7 +128,7 @@
|
|
|
@change="(val) => typeChange(val, scope.$index)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in paymentTypeOp"
|
|
|
+ v-for="item in showPaymentTypeOp"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
|
@@ -316,6 +316,10 @@
|
|
|
!['1', '2'].includes(this.info?.settlementMode) && this.type != 'view'
|
|
|
);
|
|
|
},
|
|
|
+ // 任何一行款项类型是『预付款』(value=1) 时才显示子类型列
|
|
|
+ showSubTypeColumn() {
|
|
|
+ return this.form.datasource.some((item) => item.type == 1);
|
|
|
+ },
|
|
|
columns() {
|
|
|
return [
|
|
|
{
|
|
|
@@ -346,7 +350,9 @@
|
|
|
prop: 'subType',
|
|
|
label: '款项子类型',
|
|
|
slot: 'subType',
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ // 没有任何一行的 type 为预付款(value=1)时,整列隐藏
|
|
|
+ show: this.showSubTypeColumn
|
|
|
},
|
|
|
{
|
|
|
prop: 'moneyName',
|
|
|
@@ -399,6 +405,15 @@
|
|
|
}
|
|
|
];
|
|
|
},
|
|
|
+ showPaymentTypeOp() {
|
|
|
+ // 阶段付款(settlementMode === 9)展示全部款项类型;
|
|
|
+ // 其他方式只允许"交货款"(value=2)。始终返回数组,v-for 才能正常渲染。
|
|
|
+ const isStage = this.info?.settlementMode == 9;
|
|
|
+ if (isStage) {
|
|
|
+ return this.paymentTypeOp;
|
|
|
+ }
|
|
|
+ return this.paymentTypeOp.filter((item) => item.value == 2);
|
|
|
+ },
|
|
|
allRatio() {
|
|
|
return formatPrice(
|
|
|
this.form.datasource.reduce((acc, cur) => acc + Number(cur.ratio), 0)
|