|
|
@@ -14,7 +14,7 @@
|
|
|
<!-- 来料列表表格 -->
|
|
|
<ele-pro-table ref="table12" :columns="tableColumns" :datasource="datasource"
|
|
|
@selection-change="handleSelectionChange" :initLoad="false">
|
|
|
- <template v-slot:toolbar v-if="this.baseForm.qualityMode == 2">
|
|
|
+ <template v-slot:toolbar v-if="this.baseForm.qualityMode == 2 && btnType != 'detail'">
|
|
|
<el-dropdown trigger="click" @command="handleSampleNumber">
|
|
|
<el-link type="primary" icon="el-icon-plus">取样</el-link>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
@@ -575,8 +575,7 @@ export default {
|
|
|
},
|
|
|
//获取样品编码
|
|
|
async getSampleCode() {
|
|
|
- const code = await getCode('sample_code');
|
|
|
- this.sampleListCode = code;
|
|
|
+ return await getCode('sample_code');
|
|
|
},
|
|
|
async aaa() {
|
|
|
console.log('aaa')
|
|
|
@@ -584,7 +583,7 @@ export default {
|
|
|
|
|
|
if (this.baseForm.qualityMode == 1) {
|
|
|
this.sampleList = [];
|
|
|
-
|
|
|
+ console.log('是否拆包', this.baseForm.isUnpack)
|
|
|
if (this.baseForm.isUnpack != null && this.baseForm.isUnpack != undefined && this.baseForm.isUnpack != '') {
|
|
|
if (this.baseForm.isUnpack == 2) {
|
|
|
const num = Number(this.baseForm.productNumber || 0);
|
|
|
@@ -593,14 +592,13 @@ export default {
|
|
|
}
|
|
|
} else if (this.baseForm.isUnpack == 1) {
|
|
|
if (this.baseForm.qualityMode == 1) {
|
|
|
- this.sampleList = packingList;
|
|
|
- this.samplePagination.currentPage = 1;
|
|
|
- this.samplePagination.total = packingList.length;
|
|
|
+ await this.updatePackingList(packingList);
|
|
|
} else {
|
|
|
this.sampleList = [];
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ console.log('isCheck', this.isCheck)
|
|
|
if (!this.isCheck) {
|
|
|
const num = Number(this.baseForm.productNumber || 0);
|
|
|
if (num) {
|
|
|
@@ -608,10 +606,9 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
if (this.baseForm.qualityMode == 1) {
|
|
|
- this.sampleList = packingList;
|
|
|
- console.log(this.sampleList, 'this.sampleList222')
|
|
|
- this.samplePagination.currentPage = 1;
|
|
|
- this.samplePagination.total = packingList.length;
|
|
|
+
|
|
|
+ await this.updatePackingList(packingList);
|
|
|
+
|
|
|
} else {
|
|
|
this.sampleList = [];
|
|
|
}
|
|
|
@@ -622,7 +619,16 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- getUnpackSamList(list, num) {
|
|
|
+ async updatePackingList(list) {
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ list[i].sampleCode = await this.getSampleCode();
|
|
|
+ }
|
|
|
+ this.sampleList = list;
|
|
|
+ console.log(this.sampleList, 'this.sampleList222')
|
|
|
+ this.samplePagination.currentPage = 1;
|
|
|
+ this.samplePagination.total = list.length;
|
|
|
+ },
|
|
|
+ async getUnpackSamList(list, num) {
|
|
|
console.log('拆包getUnpackSamList')
|
|
|
let data = [];
|
|
|
list.forEach(oldItem => {
|
|
|
@@ -641,10 +647,7 @@ export default {
|
|
|
});
|
|
|
|
|
|
console.log(data, 'datadatadatadatadatadata', num)
|
|
|
-
|
|
|
- this.sampleList = data;
|
|
|
- this.samplePagination.currentPage = 1;
|
|
|
- this.samplePagination.total = data.length;
|
|
|
+ await this.updatePackingList(data);
|
|
|
|
|
|
},
|
|
|
async getQualityTemplate(productCode, ids) {
|