|
@@ -89,12 +89,13 @@
|
|
|
import baseInfo from './baseInfo.vue';
|
|
import baseInfo from './baseInfo.vue';
|
|
|
|
|
|
|
|
import { getCode } from '@/api/login';
|
|
import { getCode } from '@/api/login';
|
|
|
-import { save, update, planIssued } from '@/api/inspectionPlan';
|
|
|
|
|
|
|
+import {save, update, planIssued, } from '@/api/inspectionPlan';
|
|
|
import {
|
|
import {
|
|
|
getPurchaseWarehouseGoods,
|
|
getPurchaseWarehouseGoods,
|
|
|
getQualityTemplateList,
|
|
getQualityTemplateList,
|
|
|
getTemplateListByPlanId,
|
|
getTemplateListByPlanId,
|
|
|
- getSampleListByPlanId
|
|
|
|
|
|
|
+ getSampleListByPlanId,
|
|
|
|
|
+ getInventoryListByPlanId
|
|
|
} from '@/api/inspectionPlan/index.js';
|
|
} from '@/api/inspectionPlan/index.js';
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -280,15 +281,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
// 如果是编辑或者详情,则查询物料清单、质检方案和样品列表
|
|
// 如果是编辑或者详情,则查询物料清单、质检方案和样品列表
|
|
|
if (row.id) {
|
|
if (row.id) {
|
|
|
- this.getGoodsList(
|
|
|
|
|
- this.baseForm?.planSourceCode,
|
|
|
|
|
- this.baseForm?.productCode,
|
|
|
|
|
- row?.id
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ // this.getGoodsList(
|
|
|
|
|
+ // this.baseForm?.planSourceCode,
|
|
|
|
|
+ // this.baseForm?.productCode,
|
|
|
|
|
+ // row?.id
|
|
|
|
|
+ // );
|
|
|
//操作行点击时查询质检
|
|
//操作行点击时查询质检
|
|
|
this.getTemplateList(row?.id);
|
|
this.getTemplateList(row?.id);
|
|
|
//操作行点击时查询样品
|
|
//操作行点击时查询样品
|
|
|
this.getSampleList(row?.id);
|
|
this.getSampleList(row?.id);
|
|
|
|
|
+ //操作行点击时查询清单
|
|
|
|
|
+ this.getInventoryList(row?.id);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
const code = await getCode('qms_plan_code');
|
|
const code = await getCode('qms_plan_code');
|
|
@@ -296,11 +299,22 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ async getInventoryList(id) {
|
|
|
|
|
+ let res = await getInventoryListByPlanId({
|
|
|
|
|
+ planId: id
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(res.list, 'yyyyyyyyyyyyyy清单----------------------------');
|
|
|
|
|
+
|
|
|
|
|
+ this.packingList = res?.list || [];
|
|
|
|
|
+ this.pagination.currentPage = 1;
|
|
|
|
|
+ this.pagination.total = this.packingList.length;
|
|
|
|
|
+ },
|
|
|
async getSampleList(id) {
|
|
async getSampleList(id) {
|
|
|
let res = await getSampleListByPlanId({
|
|
let res = await getSampleListByPlanId({
|
|
|
planId: id
|
|
planId: id
|
|
|
});
|
|
});
|
|
|
console.log(res.list, 'yyyyyyyyyyyyyy样品----------------------------');
|
|
console.log(res.list, 'yyyyyyyyyyyyyy样品----------------------------');
|
|
|
|
|
+
|
|
|
this.sampleList = res?.list || [];
|
|
this.sampleList = res?.list || [];
|
|
|
this.samplePagination.currentPage = 1;
|
|
this.samplePagination.currentPage = 1;
|
|
|
this.samplePagination.total = this.sampleList.length;
|
|
this.samplePagination.total = this.sampleList.length;
|
|
@@ -333,10 +347,9 @@ export default {
|
|
|
categoryCode: productCode,
|
|
categoryCode: productCode,
|
|
|
qualityQlanId: ids
|
|
qualityQlanId: ids
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ console.log(res, '来料清单');
|
|
|
if (Array.isArray(res?.list)) {
|
|
if (Array.isArray(res?.list)) {
|
|
|
let _arr1 = [];
|
|
let _arr1 = [];
|
|
|
-
|
|
|
|
|
_arr1 = res.list.map((m) => {
|
|
_arr1 = res.list.map((m) => {
|
|
|
m.sourceId = m.id;
|
|
m.sourceId = m.id;
|
|
|
m.productCategoryId = productCategoryId;
|
|
m.productCategoryId = productCategoryId;
|
|
@@ -507,14 +520,12 @@ export default {
|
|
|
sampleList: this.sampleList,
|
|
sampleList: this.sampleList,
|
|
|
planTemplateList: this.schemeList,
|
|
planTemplateList: this.schemeList,
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
console.log(params, 'params');
|
|
console.log(params, 'params');
|
|
|
|
|
|
|
|
if (this.btnType == 'issued' && this.schemeList.length < 1) {
|
|
if (this.btnType == 'issued' && this.schemeList.length < 1) {
|
|
|
this.$message.warning('质检方案不能为空!');
|
|
this.$message.warning('质检方案不能为空!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
let URL =
|
|
let URL =
|
|
|
this.btnType == 'add' ? save : this.btnType == 'edit' ? update : '';
|
|
this.btnType == 'add' ? save : this.btnType == 'edit' ? update : '';
|
|
|
URL(params)
|
|
URL(params)
|
|
@@ -540,11 +551,11 @@ export default {
|
|
|
if (this.baseForm.qualityMode) {
|
|
if (this.baseForm.qualityMode) {
|
|
|
this.updateSampleList();
|
|
this.updateSampleList();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
let params = {
|
|
let params = {
|
|
|
...this.baseForm,
|
|
...this.baseForm,
|
|
|
|
|
+ qualityInventoryList: this.packingList,
|
|
|
sampleList: this.sampleList,
|
|
sampleList: this.sampleList,
|
|
|
- planTemplateList: this.schemeList
|
|
|
|
|
|
|
+ planTemplateList: this.schemeList,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
console.log(params, 'params');
|
|
console.log(params, 'params');
|
|
@@ -554,16 +565,16 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- planIssued(params)
|
|
|
|
|
- .then((msg) => {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- this.$message.success(msg);
|
|
|
|
|
- this.handleClose();
|
|
|
|
|
- this.$emit('done');
|
|
|
|
|
- })
|
|
|
|
|
- .catch((e) => {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // planIssued(params)
|
|
|
|
|
+ // .then((msg) => {
|
|
|
|
|
+ // this.loading = false;
|
|
|
|
|
+ // this.$message.success(msg);
|
|
|
|
|
+ // this.handleClose();
|
|
|
|
|
+ // this.$emit('done');
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch((e) => {
|
|
|
|
|
+ // this.loading = false;
|
|
|
|
|
+ // });
|
|
|
});
|
|
});
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
}
|
|
}
|