|
|
@@ -186,7 +186,6 @@
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.purchaseUnitId'"
|
|
|
-
|
|
|
>
|
|
|
<el-select
|
|
|
v-model="scope.row.purchaseUnitId"
|
|
|
@@ -367,7 +366,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
{
|
|
|
minWidth: 150,
|
|
|
prop: 'supplierMark',
|
|
|
@@ -678,8 +676,6 @@
|
|
|
},
|
|
|
methods: {
|
|
|
async warehouseChange(index, row, item) {
|
|
|
- console.log(item, 'row');
|
|
|
-
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
'warehouseName',
|
|
|
@@ -841,6 +837,14 @@
|
|
|
categoryId: item.id
|
|
|
})
|
|
|
);
|
|
|
+ if (parasm?.warehouseList?.length) {
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'warehouseId',
|
|
|
+ parasm.warehouseList[0].warehouseId
|
|
|
+ );
|
|
|
+ await this.warehouseChange(index, parasm, parasm?.warehouseList[0]);
|
|
|
+ }
|
|
|
this.$set(
|
|
|
parasm,
|
|
|
'packingSpecification',
|
|
|
@@ -887,19 +891,7 @@
|
|
|
row.produceRoutingId
|
|
|
);
|
|
|
},
|
|
|
- validateTotalCount(row) {
|
|
|
- return (rule, value, callback) => {
|
|
|
- if (isNaN(value) || Number(value) <= 0) {
|
|
|
- this.$message.error('请输入大于0的数');
|
|
|
- callback(new Error('请输入大于0的数字'));
|
|
|
- } else if (Number(value) > row.orderTotalCount) {
|
|
|
- this.$message.error('输入的数字不能大于最大发货值');
|
|
|
- callback(new Error('输入的数字不能大于最大发货值'));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
+
|
|
|
// 返回列表数据
|
|
|
getTableValue() {
|
|
|
let comitDatasource = this.form.datasource;
|
|
|
@@ -927,6 +919,13 @@
|
|
|
if (data) {
|
|
|
this.form.datasource = data;
|
|
|
data.forEach(async (item, index) => {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseList',
|
|
|
+ await getIdWarehouseList({
|
|
|
+ categoryId: item.productId
|
|
|
+ })
|
|
|
+ );
|
|
|
if (item.warehouseId) {
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
@@ -936,15 +935,18 @@
|
|
|
code: item.productCode
|
|
|
})
|
|
|
);
|
|
|
+ } else if (this.form.datasource[index]?.warehouseList?.length) {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseId',
|
|
|
+ this.form.datasource[index]?.warehouseList[0].warehouseId
|
|
|
+ );
|
|
|
+ await this.warehouseChange(
|
|
|
+ index,
|
|
|
+ this.form.datasource[index],
|
|
|
+ this.form.datasource[index]?.warehouseList[0]
|
|
|
+ );
|
|
|
}
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseList',
|
|
|
- await getIdWarehouseList({
|
|
|
- categoryId: item.productId
|
|
|
- })
|
|
|
- );
|
|
|
- // if (!item.sendTotalWeight)
|
|
|
this.$set(
|
|
|
item,
|
|
|
'sendTotalWeight',
|