|
@@ -1025,12 +1025,22 @@
|
|
|
pendingReplaceTableConfirm(list) {
|
|
pendingReplaceTableConfirm(list) {
|
|
|
console.log('confirm', list)
|
|
console.log('confirm', list)
|
|
|
list.forEach((item) => {
|
|
list.forEach((item) => {
|
|
|
- item.warehouseList =[{
|
|
|
|
|
|
|
+ // item.warehouseList = item.warehouseList.map( i => {
|
|
|
|
|
+ // return {
|
|
|
|
|
+ // warehouseName: i.warehouse_name,
|
|
|
|
|
+ // warehouseId: i.warehouse_id,
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ item.warehouseList = [{
|
|
|
warehouseName: item.warehouseName,
|
|
warehouseName: item.warehouseName,
|
|
|
warehouseId: item.warehouseId,
|
|
warehouseId: item.warehouseId,
|
|
|
}]
|
|
}]
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // if(list[0].warehouseList.length == 1) {
|
|
|
|
|
+ // this.$set(this.current, 'warehouseId', list[0].warehouseId)
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
this.$set(this.current, 'warehouseList', list[0].warehouseList)
|
|
this.$set(this.current, 'warehouseList', list[0].warehouseList)
|
|
|
this.$set(this.current, 'warehouseId', list[0].warehouseId)
|
|
this.$set(this.current, 'warehouseId', list[0].warehouseId)
|
|
|
this.$set(this.current, 'warehouseNum', list[0].measureQuantity)
|
|
this.$set(this.current, 'warehouseNum', list[0].measureQuantity)
|
|
@@ -1126,6 +1136,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async warehouseChange(index, row, isReset = false) {
|
|
async warehouseChange(index, row, isReset = false) {
|
|
|
|
|
+ console.log('warehouseChange', index, row.isSuspend, isReset);
|
|
|
const data = row.warehouseList.find(
|
|
const data = row.warehouseList.find(
|
|
|
(item) => item.warehouseId == row.warehouseId
|
|
(item) => item.warehouseId == row.warehouseId
|
|
|
);
|
|
);
|
|
@@ -1140,17 +1151,8 @@
|
|
|
'warehouseCode',
|
|
'warehouseCode',
|
|
|
data.warehouseCode
|
|
data.warehouseCode
|
|
|
);
|
|
);
|
|
|
- const warehouseOutStock = await getWarehouseOutStock({
|
|
|
|
|
- warehouseId: data.warehouseId,
|
|
|
|
|
- code: row.productCode
|
|
|
|
|
- });
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.form.datasource[index],
|
|
|
|
|
- 'warehouseNum',
|
|
|
|
|
- warehouseOutStock || 0
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- if(isReset) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(isReset && row.isSuspend != 1) {
|
|
|
this.$set(this.form.datasource[index], 'batchStockId', '');
|
|
this.$set(this.form.datasource[index], 'batchStockId', '');
|
|
|
this.$set(this.form.datasource[index], 'batchNo', '');
|
|
this.$set(this.form.datasource[index], 'batchNo', '');
|
|
|
}
|
|
}
|
|
@@ -2012,11 +2014,11 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 检查挂起产品库存
|
|
|
|
|
- if (this.isSuspendedProductOverstock(item)) {
|
|
|
|
|
|
|
+ // 检查产品库存
|
|
|
|
|
+ if (this.isProductOverstock(item)) {
|
|
|
errors.push({
|
|
errors.push({
|
|
|
type: 'suspend',
|
|
type: 'suspend',
|
|
|
- message: `挂起产品[${productInfo.name}]的发货数量${item.totalCount}不能大于库存${item.warehouseNum}`,
|
|
|
|
|
|
|
+ message: `产品[${productInfo.name}]的发货数量${item.totalCount}不能大于库存${item.warehouseNum}`,
|
|
|
stopValidation: true,
|
|
stopValidation: true,
|
|
|
item: item
|
|
item: item
|
|
|
});
|
|
});
|
|
@@ -2067,8 +2069,8 @@
|
|
|
* @param {Object} item 数据项
|
|
* @param {Object} item 数据项
|
|
|
* @returns {boolean} 是否超过
|
|
* @returns {boolean} 是否超过
|
|
|
*/
|
|
*/
|
|
|
- isSuspendedProductOverstock(item) {
|
|
|
|
|
- return item.isSuspend == 1 && Number(item.totalCount) > item.warehouseNum;
|
|
|
|
|
|
|
+ isProductOverstock(item) {
|
|
|
|
|
+ return Number(item.totalCount) > item.warehouseNum;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|