|
|
@@ -781,17 +781,25 @@ export default {
|
|
|
// 表头表体列表
|
|
|
const raw1 = await getIqcInspectionDetail_2(params);
|
|
|
const raw2 = await getIqcInspectionDetail_1(params);
|
|
|
- const list = [...raw2.data.data, ...raw1.data.data];
|
|
|
+ // 添加安全检查,确保data数组存在
|
|
|
+ const data1 = raw1.data || [];
|
|
|
+ const data2 = raw2.data || [];
|
|
|
+ const list = [...data2, ...data1];
|
|
|
// page查询
|
|
|
const rawData = await getMaterialItemPage(this.queryParams);
|
|
|
- this.ifModify = rawData.data.ifModify;
|
|
|
- this.$refs.updateInspection.queryObj = rawData.data.masterData;
|
|
|
+ // 添加安全检查,防止rawData.data为undefined
|
|
|
+ const rawDataContent = rawData.data || {};
|
|
|
+ this.ifModify = rawDataContent.ifModify;
|
|
|
+ this.$refs.updateInspection.queryObj = rawDataContent.masterData || {};
|
|
|
|
|
|
- const rawValueList = rawData.data.list;
|
|
|
- const maxAdditional = rawData.data.maxMaterialAdditional;
|
|
|
- this.wmsMaterialAdditionalId = maxAdditional.id;
|
|
|
- this.wmsMaterialItemMasterId = maxAdditional.wmsMaterialItemMasterId;
|
|
|
- this.updateInspectStatus = maxAdditional.status;
|
|
|
+ // 添加安全检查,确保list数组存在
|
|
|
+ const rawValueList = rawDataContent.list || [];
|
|
|
+ // 添加安全检查,确保maxMaterialAdditional对象存在
|
|
|
+ const maxAdditional = rawDataContent.maxMaterialAdditional || {};
|
|
|
+ this.wmsMaterialAdditionalId = maxAdditional.id || "";
|
|
|
+ this.wmsMaterialItemMasterId =
|
|
|
+ maxAdditional.wmsMaterialItemMasterId || "";
|
|
|
+ this.updateInspectStatus = maxAdditional.status || "";
|
|
|
|
|
|
const valueList = rawValueList.map((item) => {
|
|
|
const { maxValue, minValue, standValue, id, badId } = item;
|
|
|
@@ -838,8 +846,10 @@ export default {
|
|
|
// 执行查询
|
|
|
try {
|
|
|
const { data } = await getLabelPrintDataDetail(this.choiceParams);
|
|
|
- this.choiceList = data.list;
|
|
|
- this.total = data.total;
|
|
|
+ // 添加安全检查,确保data对象存在
|
|
|
+ const choiceData = data || {};
|
|
|
+ this.choiceList = choiceData.list || [];
|
|
|
+ this.total = choiceData.total || 0;
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
} finally {
|
|
|
@@ -853,7 +863,9 @@ export default {
|
|
|
processNo: "PURCHASE",
|
|
|
};
|
|
|
getiqcInspectionHead(params).then((res) => {
|
|
|
- this.formParams = res.data.data[0] || {};
|
|
|
+ // 添加安全检查,确保res.data存在且为数组
|
|
|
+ const headData = res.data || [];
|
|
|
+ this.formParams = headData[0] || {};
|
|
|
const { title, noPassType, inspector, manage, produceDate } =
|
|
|
this.formParams;
|
|
|
this.formParams.checkName = title;
|
|
|
@@ -1341,7 +1353,8 @@ export default {
|
|
|
materialLots,
|
|
|
};
|
|
|
getSupplierFileByMaterialLots(params).then((res) => {
|
|
|
- this.$refs.inspectFileUpload.fileList = res.data;
|
|
|
+ // 添加安全检查,确保res.data存在
|
|
|
+ this.$refs.inspectFileUpload.fileList = res.data || [];
|
|
|
this.$refs.inspectFileUpload.isUploadShow = 9;
|
|
|
this.$refs.inspectFileUpload.visible = true;
|
|
|
});
|