|
@@ -203,6 +203,14 @@
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template v-slot:toolbar>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="addInspection"
|
|
|
|
|
+ v-if="form.items.length == 0"
|
|
|
|
|
+ >选择质检方案</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
<template v-slot:status="{ row }">
|
|
<template v-slot:status="{ row }">
|
|
|
<el-tag v-if="row.status == 0">待自检</el-tag>
|
|
<el-tag v-if="row.status == 0">待自检</el-tag>
|
|
|
<el-tag v-if="row.status == 1">请托中</el-tag>
|
|
<el-tag v-if="row.status == 1">请托中</el-tag>
|
|
@@ -341,6 +349,11 @@
|
|
|
<el-button type="primary" @click="saveSelf(1)">提交</el-button>
|
|
<el-button type="primary" @click="saveSelf(1)">提交</el-button>
|
|
|
<el-button type="primary" @click="saveSelf(2)">保存</el-button>
|
|
<el-button type="primary" @click="saveSelf(2)">保存</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+
|
|
|
|
|
+ <inspectionTemplatePop
|
|
|
|
|
+ ref="inspectionTemplateRef"
|
|
|
|
|
+ @changeSel="changeSel"
|
|
|
|
|
+ ></inspectionTemplatePop>
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -348,11 +361,14 @@
|
|
|
import {
|
|
import {
|
|
|
getDetail,
|
|
getDetail,
|
|
|
selfInspectionReport,
|
|
selfInspectionReport,
|
|
|
- specialInspectionReport
|
|
|
|
|
|
|
+ specialInspectionReport,
|
|
|
|
|
+ addInspectionsTerm
|
|
|
} from '@/api/produce/qualityInspection.js';
|
|
} from '@/api/produce/qualityInspection.js';
|
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
|
|
+ import inspectionTemplatePop from '@/views/produce/components/bom/qualityTesting/inspectionTemplate.vue';
|
|
|
|
|
+ import { getTemplateById } from '@/api/produce/bom.js';
|
|
|
export default {
|
|
export default {
|
|
|
- components: { deptSelect },
|
|
|
|
|
|
|
+ components: { deptSelect, inspectionTemplatePop },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
@@ -364,7 +380,8 @@
|
|
|
toolingQualifiedValid: 1,
|
|
toolingQualifiedValid: 1,
|
|
|
measuringToolValid: 1,
|
|
measuringToolValid: 1,
|
|
|
ncProgramValid: 1,
|
|
ncProgramValid: 1,
|
|
|
- materialSemiFinishedValid: 1
|
|
|
|
|
|
|
+ materialSemiFinishedValid: 1,
|
|
|
|
|
+ items: []
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
firstArticleCode: [
|
|
firstArticleCode: [
|
|
@@ -539,23 +556,6 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // applyStatus(actionType) {
|
|
|
|
|
- // if (actionType !== 1) return;
|
|
|
|
|
-
|
|
|
|
|
- // const statusMap = {
|
|
|
|
|
- // 1: { form: 2, item: 2 },
|
|
|
|
|
- // 2: { form: 3, item: 3 }
|
|
|
|
|
- // };
|
|
|
|
|
-
|
|
|
|
|
- // const config = statusMap[this.type];
|
|
|
|
|
- // if (!config) return;
|
|
|
|
|
-
|
|
|
|
|
- // this.form.status = config.form;
|
|
|
|
|
- // this.form.items.forEach((item) => {
|
|
|
|
|
- // item.status = config.item;
|
|
|
|
|
- // });
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
applyStatus(actionType) {
|
|
applyStatus(actionType) {
|
|
|
if (actionType !== 1) return;
|
|
if (actionType !== 1) return;
|
|
|
|
|
|
|
@@ -577,37 +577,60 @@
|
|
|
|
|
|
|
|
const { resultField, itemStatus, formStatus } = config;
|
|
const { resultField, itemStatus, formStatus } = config;
|
|
|
|
|
|
|
|
|
|
+ const allPass = this.form.items.every((item) => item[resultField] == 1);
|
|
|
|
|
+
|
|
|
|
|
+ if (!allPass) return;
|
|
|
|
|
+
|
|
|
this.form.items.forEach((item) => {
|
|
this.form.items.forEach((item) => {
|
|
|
- if (item[resultField] === 1) {
|
|
|
|
|
- item.status = itemStatus;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ item.status = itemStatus;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const allPass = this.form.items.every(
|
|
|
|
|
- (item) => item[resultField] === 1
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this.form.status = formStatus;
|
|
|
|
|
|
|
|
- if (allPass) {
|
|
|
|
|
- this.form.status = formStatus;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // this.form.items.forEach((item) => {
|
|
|
|
|
+ // if (item[resultField] == 1) {
|
|
|
|
|
+ // item.status = itemStatus;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ // const allPass = this.form.items.every(
|
|
|
|
|
+ // (item) => item[resultField] == 1
|
|
|
|
|
+ // );
|
|
|
|
|
+
|
|
|
|
|
+ // if (allPass) {
|
|
|
|
|
+ // this.form.status = formStatus;
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ addInspection() {
|
|
|
|
|
+ this.$refs.inspectionTemplateRef.open('first');
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ async changeSel({ id }) {
|
|
|
|
|
+ const { data } = await getTemplateById(id);
|
|
|
|
|
+
|
|
|
|
|
+ data.inspectionItemVOList.forEach((item) => {
|
|
|
|
|
+ item.qualitySchemeTemplateCode = data.qualitySchemeTemplateCode;
|
|
|
|
|
+ item.qualitySchemeTemplateName = data.qualitySchemeTemplateName;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ this.isAdd = true;
|
|
|
|
|
+ await this.addInspectionsTerm(data.inspectionItemVOList);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // validateCheckResult() {
|
|
|
|
|
- // const map = {
|
|
|
|
|
- // 1: ['selfCheckResult', '请填写完整自检结果后再提交'],
|
|
|
|
|
- // 2: ['specialCheckResult', '请填写完整专检结果后再提交']
|
|
|
|
|
- // };
|
|
|
|
|
|
|
+ async addInspectionsTerm(items) {
|
|
|
|
|
+ const payload = this.buildInspectionPayload(items);
|
|
|
|
|
+ const res = await addInspectionsTerm(payload);
|
|
|
|
|
|
|
|
- // const config = map[this.type];
|
|
|
|
|
- // if (!config) return true;
|
|
|
|
|
|
|
+ this.form = res;
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- // const [field, msg] = config;
|
|
|
|
|
- // if (this.form.items.some((item) => !item[field])) {
|
|
|
|
|
- // this.$message.warning(msg);
|
|
|
|
|
- // return false;
|
|
|
|
|
- // }
|
|
|
|
|
- // return true;
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ buildInspectionPayload(items) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...this.item,
|
|
|
|
|
+ items
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
validateCheckResult() {
|
|
validateCheckResult() {
|
|
|
const map = {
|
|
const map = {
|
|
@@ -669,7 +692,12 @@
|
|
|
data[item.key] = 1;
|
|
data[item.key] = 1;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- this.form = { ...data };
|
|
|
|
|
|
|
+ // this.form = { ...data };
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ ...data,
|
|
|
|
|
+ items: data.items || []
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|