|
|
@@ -22,6 +22,8 @@
|
|
|
@changeModel="changeModel"
|
|
|
@getList="getList"
|
|
|
@table2="table2"
|
|
|
+ @changeType="changeType"
|
|
|
+ @changeSource="changeSource"
|
|
|
@getInspectionStandards="getInspectionStandards"
|
|
|
:packingLists="packingList"
|
|
|
@getCategoryInfo="getCategoryInfo"
|
|
|
@@ -54,7 +56,8 @@
|
|
|
:datasource="datasource"
|
|
|
:needPage="
|
|
|
btnType == 'add' ||
|
|
|
- (btnType == 'edit' && !isFormNumber && !isOrder)
|
|
|
+ (btnType == 'edit' && !isPackingList) ||
|
|
|
+ !isSampleList
|
|
|
? false
|
|
|
: true
|
|
|
"
|
|
|
@@ -509,7 +512,10 @@
|
|
|
isChangeNumber: true,
|
|
|
isChangeType: true,
|
|
|
isOnce: true,
|
|
|
- dimensionType: ''
|
|
|
+ dimensionType: '',
|
|
|
+ isSampleList: true,
|
|
|
+ isPackingList: true,
|
|
|
+ isSchemeList: true
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -643,6 +649,7 @@
|
|
|
return this.schemeList.slice(start, end);
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
created() {},
|
|
|
methods: {
|
|
|
//成品检验类型,计划来源主数据,修改数量生成来源清单
|
|
|
@@ -697,6 +704,7 @@
|
|
|
// }
|
|
|
console.log('数据33333');
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
this.isOrder = false;
|
|
|
let nums = Number(num);
|
|
|
let p = this.productItem;
|
|
|
@@ -731,6 +739,7 @@
|
|
|
console.log('数据22222');
|
|
|
console.log(this.isOrder);
|
|
|
this.$refs.table12.setData(list);
|
|
|
+ this.packingList = list;
|
|
|
|
|
|
// *** 如果检验方式是全量的话 还需要同步样品清单数据
|
|
|
if (
|
|
|
@@ -745,15 +754,17 @@
|
|
|
},
|
|
|
|
|
|
//成品类型检验类型,计划来源库存台账, 生成来源清单
|
|
|
- changesStokledgerNumberModal(val, dimension) {
|
|
|
- console.log(val, dimension, '获取成品检验订单数据');
|
|
|
+ changesStokledgerNumberModal(val, dimension, type) {
|
|
|
+ console.log(val, dimension, '获取成品检验订单数据', type);
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
if (dimension) this.dimensionType = dimension;
|
|
|
if (dimension == 3) {
|
|
|
this.$refs.table12.setData(val);
|
|
|
- if (this.baseForm.qualityMode == '1') {
|
|
|
+ this.packingList = val;
|
|
|
+ if (this.baseForm.qualityMode == '1' || type) {
|
|
|
this.handleUnpackCase(val);
|
|
|
- } else if (this.baseForm.qualityMode == '2') {
|
|
|
+ } else if (this.baseForm.qualityMode == '2' || type) {
|
|
|
this.sampleList = [];
|
|
|
}
|
|
|
return;
|
|
|
@@ -789,9 +800,10 @@
|
|
|
// });
|
|
|
console.log(list, 'for循环成品检验订单数据');
|
|
|
this.$refs.table12.setData(list);
|
|
|
- if (this.baseForm.qualityMode == '1') {
|
|
|
+ this.packingList = list;
|
|
|
+ if (this.baseForm.qualityMode == '1' || type) {
|
|
|
this.handleUnpackCase(list);
|
|
|
- } else if (this.baseForm.qualityMode == '2') {
|
|
|
+ } else if (this.baseForm.qualityMode == '2' || type) {
|
|
|
this.sampleList = [];
|
|
|
}
|
|
|
},
|
|
|
@@ -838,15 +850,22 @@
|
|
|
this.isOnce = false;
|
|
|
},
|
|
|
async datasource({ page, limit, where }) {
|
|
|
- console.log(this.btnType);
|
|
|
- console.log(this.isScheme, this.isOrder);
|
|
|
- const res = await getInventoryListByPlanId({
|
|
|
+ // console.log(this.btnType);
|
|
|
+ // console.log(this.isScheme, this.isOrder);
|
|
|
+ // const res = await getInventoryListByPlanId({
|
|
|
+ // ...where,
|
|
|
+ // pageNum: page,
|
|
|
+ // size: limit
|
|
|
+ // });
|
|
|
+ // console.log(res.list);
|
|
|
+ // this.packingList = res.list;
|
|
|
+ // return res;
|
|
|
+
|
|
|
+ return await getInventoryListByPlanId({
|
|
|
...where,
|
|
|
pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
- this.packingList = res.list;
|
|
|
- return res;
|
|
|
},
|
|
|
// 切换质检内容
|
|
|
handleClick(tab) {
|
|
|
@@ -896,8 +915,6 @@
|
|
|
qualityMode: row.qualityMode
|
|
|
};
|
|
|
|
|
|
- console.log('baseInfo:' + this.baseForm);
|
|
|
-
|
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.baseInfoRefs) {
|
|
|
// 获取人员
|
|
|
@@ -908,13 +925,13 @@
|
|
|
}
|
|
|
//根据类型获取计划来源
|
|
|
if (this.baseForm.type) {
|
|
|
- this.$refs.baseInfoRefs.typeChange(this.baseForm.type);
|
|
|
+ this.$refs.baseInfoRefs.typeChange(this.baseForm.type, '1111');
|
|
|
+ }
|
|
|
+ if (this.baseForm.productId) {
|
|
|
+ this.$refs.baseInfoRefs.getProductDetails(
|
|
|
+ this.baseForm.productId
|
|
|
+ );
|
|
|
}
|
|
|
- // if (this.baseForm.productId) {
|
|
|
- // this.$refs.baseInfoRefs.getProductDetails(
|
|
|
- // this.baseForm.productId
|
|
|
- // );
|
|
|
- // }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -1015,6 +1032,7 @@
|
|
|
) {
|
|
|
console.log('数据1-1-1-1-1');
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
|
|
|
console.log(999999);
|
|
|
let res;
|
|
|
@@ -1070,6 +1088,7 @@
|
|
|
this.packingList = _arr1;
|
|
|
console.log('数据1010101010');
|
|
|
this.$refs.table12.setData(_arr1); //赋值
|
|
|
+ this.packingList = _arr1;
|
|
|
const _arr2 = this.$refs.table12.getData();
|
|
|
if (_arr2.length > 1) {
|
|
|
this.baseForm.productNumber = _arr2.length;
|
|
|
@@ -1078,10 +1097,12 @@
|
|
|
}
|
|
|
//处理样品清单
|
|
|
console.log('+++++++++3');
|
|
|
- await this.handleSampleList();
|
|
|
+ // await this.handleSampleList();
|
|
|
+ await this.updatePackingList(_arr1);
|
|
|
} else {
|
|
|
console.log('数据99999');
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
}
|
|
|
},
|
|
|
async handleSampleList() {
|
|
|
@@ -1114,6 +1135,7 @@
|
|
|
}
|
|
|
if (list.length > 0 && list[0].categoryCode) {
|
|
|
this.$refs.table12.setData(list);
|
|
|
+ this.packingList = list;
|
|
|
let packList = this.$refs.table12.getData();
|
|
|
this.getFullInspectionWeight(packList);
|
|
|
}
|
|
|
@@ -1167,6 +1189,7 @@
|
|
|
console.log('数据777777');
|
|
|
if (this.$refs.table12) {
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
let nums = Number(this.baseForm.productNumber);
|
|
|
let p = this.productItem;
|
|
|
let list = [];
|
|
|
@@ -1186,6 +1209,7 @@
|
|
|
}
|
|
|
console.log('数据666666');
|
|
|
this.$refs.table12.setData(list);
|
|
|
+ this.packingList = list;
|
|
|
let packList = this.$refs.table12.getData();
|
|
|
await this.handleUnpackCase(packList);
|
|
|
|
|
|
@@ -1273,6 +1297,7 @@
|
|
|
console.log(list);
|
|
|
if (list.length > 0 && list[0].categoryCode) {
|
|
|
this.$refs.table12.setData(list);
|
|
|
+ this.packingList = list;
|
|
|
let packList = this.$refs.table12.getData();
|
|
|
this.getFullInspectionWeight(packList);
|
|
|
}
|
|
|
@@ -1348,7 +1373,7 @@
|
|
|
for (let i = 0; i < roundedQuantity; i++) {
|
|
|
data.push({
|
|
|
...oldItem,
|
|
|
- measureQuantity: 1,
|
|
|
+ // measureQuantity: 1,
|
|
|
weight: this.netWeight || 0
|
|
|
// weight:
|
|
|
// num - index >= 1
|
|
|
@@ -1849,6 +1874,7 @@
|
|
|
},
|
|
|
table1() {
|
|
|
this.$refs.table12.setData([]);
|
|
|
+ this.packingList = [];
|
|
|
this.schemeList = [];
|
|
|
},
|
|
|
table2() {
|
|
|
@@ -1936,6 +1962,8 @@
|
|
|
this.isChangeType = true;
|
|
|
this.isOnce = true;
|
|
|
this.dimensionType = '';
|
|
|
+ this.isPackingList = true;
|
|
|
+ this.isSampleList = true;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -1951,12 +1979,40 @@
|
|
|
this.baseForm.isUnpack = this.isCheck ? 1 : 2;
|
|
|
}
|
|
|
this.baseForm.conditionType = this.conditionType;
|
|
|
+ // isSampleList: true,
|
|
|
+ // isPackingList: true,
|
|
|
+
|
|
|
+ console.log(this.isSampleList);
|
|
|
+ console.log(this.isPackingList);
|
|
|
+
|
|
|
+ const qualityListData =
|
|
|
+ this.btnType == 'add'
|
|
|
+ ? this.$refs.table12.getData()
|
|
|
+ : this.btnType == 'edit' &&
|
|
|
+ this.isPackingList &&
|
|
|
+ this.isSampleList
|
|
|
+ ? []
|
|
|
+ : this.$refs.table12.getData();
|
|
|
+ const sampleListData =
|
|
|
+ this.btnType == 'add'
|
|
|
+ ? this.sampleList
|
|
|
+ : this.btnType == 'edit' && this.isSampleList
|
|
|
+ ? []
|
|
|
+ : this.sampleList;
|
|
|
+
|
|
|
+ // let params = {
|
|
|
+ // ...this.baseForm,
|
|
|
+ // qualityInventoryList: this.$refs.table12.getData(),
|
|
|
+ // sampleList: this.sampleList,
|
|
|
+ // planTemplateList: this.schemeList
|
|
|
+ // };
|
|
|
let params = {
|
|
|
...this.baseForm,
|
|
|
- qualityInventoryList: this.$refs.table12.getData(),
|
|
|
- sampleList: this.sampleList,
|
|
|
+ qualityInventoryList: qualityListData,
|
|
|
+ sampleList: sampleListData,
|
|
|
planTemplateList: this.schemeList
|
|
|
};
|
|
|
+
|
|
|
console.log(params, 'params');
|
|
|
|
|
|
if (this.btnType == 'issued' && this.schemeList.length < 1) {
|
|
|
@@ -2057,6 +2113,7 @@
|
|
|
changeModel(val) {
|
|
|
console.log('更改检验方式');
|
|
|
this.baseForm.qualityMode = val;
|
|
|
+ this.isSampleList = false;
|
|
|
if (this.btnType != 'issued') {
|
|
|
this.baseForm.sampleNumber = '';
|
|
|
}
|
|
|
@@ -2069,7 +2126,24 @@
|
|
|
if (this.$refs.table12 && this.dimensionType) {
|
|
|
const listData = this.$refs.table12.getData();
|
|
|
console.log(listData, '成品检验订单数据');
|
|
|
- this.changesStokledgerNumberModal(listData, this.dimensionType);
|
|
|
+ this.changesStokledgerNumberModal(
|
|
|
+ listData,
|
|
|
+ this.dimensionType,
|
|
|
+ 'type'
|
|
|
+ );
|
|
|
+ // if (this.dimensionType == 3) {
|
|
|
+ // if (this.baseForm.qualityMode == '1') {
|
|
|
+ // this.handleUnpackCase(val);
|
|
|
+ // } else if (this.baseForm.qualityMode == '2') {
|
|
|
+ // this.sampleList = [];
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (this.baseForm.qualityMode == '1') {
|
|
|
+ // this.handleUnpackCase(listData);
|
|
|
+ // } else if (this.baseForm.qualityMode == '2') {
|
|
|
+ // this.sampleList = [];
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
@@ -2082,6 +2156,14 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ changeType() {
|
|
|
+ this.isPackingList = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ changeSource() {
|
|
|
+ this.isSampleList = false;
|
|
|
+ },
|
|
|
+
|
|
|
//确定按钮
|
|
|
handleExtractFull() {
|
|
|
this.$refs.ruleForm.validate(async (valid) => {
|