|
|
@@ -189,7 +189,6 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.guaranteePeriod'"
|
|
|
:rules="{
|
|
|
-
|
|
|
pattern: numberReg,
|
|
|
message: '请输入质保期',
|
|
|
trigger: 'blur'
|
|
|
@@ -323,7 +322,6 @@
|
|
|
<DictSelection
|
|
|
dictName="产地"
|
|
|
clearable
|
|
|
-
|
|
|
v-model="scope.row.provenance"
|
|
|
multiple
|
|
|
>
|
|
|
@@ -396,7 +394,9 @@
|
|
|
<el-date-picker
|
|
|
style="width: 140px"
|
|
|
v-model="scope.row.produceDeliveryDeadline"
|
|
|
- @change="setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')"
|
|
|
+ @change="
|
|
|
+ setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
|
|
|
+ "
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
>
|
|
|
@@ -419,7 +419,9 @@
|
|
|
style="width: 140px"
|
|
|
:disabled="isContractId"
|
|
|
v-model="scope.row.customerExpectDeliveryDeadline"
|
|
|
- @change="setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')"
|
|
|
+ @change="
|
|
|
+ setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
|
|
|
+ "
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
>
|
|
|
@@ -755,7 +757,7 @@
|
|
|
slot: 'provenance',
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 200,
|
|
|
+ minWidth: 200
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
@@ -996,7 +998,11 @@
|
|
|
this.form.datasource[i],
|
|
|
'guaranteePeriodDeadline',
|
|
|
guaranteePeriodUnitName != 'second'
|
|
|
- ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName,item)
|
|
|
+ ? this.setDay(
|
|
|
+ item.guaranteePeriod,
|
|
|
+ guaranteePeriodUnitName,
|
|
|
+ item
|
|
|
+ )
|
|
|
: ''
|
|
|
);
|
|
|
// }
|
|
|
@@ -1012,7 +1018,7 @@
|
|
|
this.form.datasource[index],
|
|
|
'guaranteePeriodDeadline',
|
|
|
guaranteePeriodUnitName != 'second'
|
|
|
- ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName,row)
|
|
|
+ ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName, row)
|
|
|
: ''
|
|
|
);
|
|
|
}
|
|
|
@@ -1026,9 +1032,12 @@
|
|
|
? 'year'
|
|
|
: 'second';
|
|
|
},
|
|
|
- setDay(addDay, dateType = 'day',item) {
|
|
|
- let tiem= this.contractBookType==1? item.produceDeliveryDeadline:item.customerExpectDeliveryDeadline;
|
|
|
- return dayjs( tiem|| new Date())
|
|
|
+ setDay(addDay, dateType = 'day', item) {
|
|
|
+ let tiem =
|
|
|
+ this.contractBookType == 1
|
|
|
+ ? item.produceDeliveryDeadline
|
|
|
+ : item.customerExpectDeliveryDeadline;
|
|
|
+ return dayjs(tiem || new Date())
|
|
|
.add(addDay, dateType)
|
|
|
.format('YYYY-MM-DD');
|
|
|
},
|
|
|
@@ -1089,7 +1098,11 @@
|
|
|
item['guaranteePeriodDeadline'] =
|
|
|
item['guaranteePeriodDeadline'] ||
|
|
|
guaranteePeriodUnitName != 'second'
|
|
|
- ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName,item)
|
|
|
+ ? this.setDay(
|
|
|
+ item.guaranteePeriod,
|
|
|
+ guaranteePeriodUnitName,
|
|
|
+ item
|
|
|
+ )
|
|
|
: '';
|
|
|
}
|
|
|
});
|
|
|
@@ -1105,15 +1118,25 @@
|
|
|
data.payAmount || data?.contractVO?.discountTotalPrice;
|
|
|
}
|
|
|
|
|
|
- let codeList = this.form.datasource.filter(item=>item.productCode).map((item) => item.productCode);
|
|
|
+ let codeList = this.form.datasource
|
|
|
+ .filter((item) => item.productCode)
|
|
|
+ .map((item) => item.productCode);
|
|
|
//获取仓库库存
|
|
|
let inventoryTotalList = await getInventoryTotalAPI(codeList);
|
|
|
- this.form.datasource.filter(item=>item.productCode).forEach((item) => {
|
|
|
- let find =
|
|
|
- inventoryTotalList.find((key) => key.code == item.productCode) ||
|
|
|
- {};
|
|
|
- item.availableCountBase = find.availableCountBase;
|
|
|
- });
|
|
|
+ this.form.datasource
|
|
|
+ .filter((item) => item.productCode)
|
|
|
+ .forEach((item, index) => {
|
|
|
+ let find =
|
|
|
+ inventoryTotalList.find(
|
|
|
+ (key) => key.code == item.productCode
|
|
|
+ ) || {};
|
|
|
+ this.form.datasource;
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'availableCountBase',
|
|
|
+ find.availableCountBase
|
|
|
+ );
|
|
|
+ });
|
|
|
this.$refs.table.reload();
|
|
|
}
|
|
|
},
|
|
|
@@ -1170,8 +1193,8 @@
|
|
|
item.extField.packingSpecification
|
|
|
);
|
|
|
this.$set(parasm, 'customerMark', this.customerMark);
|
|
|
- if(item.purchaseOrigins?.length>0){
|
|
|
- item.purchaseOrigins=item.purchaseOrigins.map(val=>val+'')
|
|
|
+ if (item.purchaseOrigins?.length > 0) {
|
|
|
+ item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
|
|
|
}
|
|
|
this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
if (idx == -1) {
|