|
@@ -9,6 +9,7 @@
|
|
|
cache-key="inspectionClassify"
|
|
cache-key="inspectionClassify"
|
|
|
row-key="qualityLevelId"
|
|
row-key="qualityLevelId"
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
<el-button @click="handAdd" size="mini" type="primary" v-if="!isView"
|
|
<el-button @click="handAdd" size="mini" type="primary" v-if="!isView"
|
|
@@ -17,6 +18,13 @@
|
|
|
<el-button @click="handSelect" size="mini" type="primary" v-if="!isView"
|
|
<el-button @click="handSelect" size="mini" type="primary" v-if="!isView"
|
|
|
>选择质检方案</el-button
|
|
>选择质检方案</el-button
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ @click="batchDelete"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ v-if="!isView"
|
|
|
|
|
+ >批量删除</el-button
|
|
|
|
|
+ >
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:textType="{ row }">
|
|
<template v-slot:textType="{ row }">
|
|
@@ -92,7 +100,7 @@
|
|
|
dictName="工艺参数单位"
|
|
dictName="工艺参数单位"
|
|
|
clearable
|
|
clearable
|
|
|
filterable
|
|
filterable
|
|
|
- v-model="row.unit"
|
|
|
|
|
|
|
+ v-model="row.unitName"
|
|
|
>
|
|
>
|
|
|
</DictSelection>
|
|
</DictSelection>
|
|
|
<!-- <el-input v-model="row.unit" :disabled="isView"> </el-input> -->
|
|
<!-- <el-input v-model="row.unit" :disabled="isView"> </el-input> -->
|
|
@@ -171,6 +179,13 @@
|
|
|
// align: 'center',
|
|
// align: 'center',
|
|
|
|
|
|
|
|
// },
|
|
// },
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: true
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
prop: 'categoryLevelClassName',
|
|
prop: 'categoryLevelClassName',
|
|
|
label: '质检类型',
|
|
label: '质检类型',
|
|
@@ -258,6 +273,50 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ handleSelectionChange() {},
|
|
|
|
|
+
|
|
|
|
|
+ batchDelete() {
|
|
|
|
|
+ if (this.selection.length == 0) {
|
|
|
|
|
+ this.$message.warning('请选择需要删除的质检项');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // console.log(this.list, 'this.List');
|
|
|
|
|
+ // console.log(this.selection, 'this.selection');
|
|
|
|
|
+
|
|
|
|
|
+ let indexList = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (this.selection.length == this.list.length) {
|
|
|
|
|
+ this.list = [];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ for (let i = 0; i < this.selection.length; i++) {
|
|
|
|
|
+ for (let j = 0; j < this.list.length; j++) {
|
|
|
|
|
+ if (this.selection[i].id == this.list[j].id) {
|
|
|
|
|
+ indexList.push(j);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (indexList.length != 0) {
|
|
|
|
|
+ indexList.forEach((it) => {
|
|
|
|
|
+ this.list.splice(it, 1);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // this.selection.forEach((item) => {
|
|
|
|
|
+ // const index = this.list.findIndex((it) => (it.id = item.id));
|
|
|
|
|
+
|
|
|
|
|
+ // console.log('1111111111111111111');
|
|
|
|
|
+ // if (index) {
|
|
|
|
|
+ // indexList.push(index);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+
|
|
|
|
|
+ console.log(indexList, 'indexList');
|
|
|
|
|
+ // this.selection = [];
|
|
|
|
|
+ // this.$forceUpdate();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
getDate() {
|
|
getDate() {
|
|
|
return this.list;
|
|
return this.list;
|
|
|
},
|
|
},
|
|
@@ -268,12 +327,20 @@
|
|
|
handSelect() {
|
|
handSelect() {
|
|
|
this.$refs.inspectionTemplateRef.open();
|
|
this.$refs.inspectionTemplateRef.open();
|
|
|
},
|
|
},
|
|
|
- changeSel(list) {
|
|
|
|
|
- console.log(list, 'list');
|
|
|
|
|
|
|
+ async changeSel(list) {
|
|
|
// let ids = list.map((item) => item.id).toString();
|
|
// let ids = list.map((item) => item.id).toString();
|
|
|
// console.log(ids, 'ids')
|
|
// console.log(ids, 'ids')
|
|
|
- getTemplateById(list.id).then(({ data }) => {
|
|
|
|
|
|
|
+ await getTemplateById(list.id).then(({ data }) => {
|
|
|
|
|
+ data.inspectionItemVOList.forEach((item) => {
|
|
|
|
|
+ item.qualitySchemeTemplateCode = data.qualitySchemeTemplateCode;
|
|
|
|
|
+ item.qualitySchemeTemplateName = data.qualitySchemeTemplateName;
|
|
|
|
|
+ });
|
|
|
this.list = [...this.list, ...(data.inspectionItemVOList || [])];
|
|
this.list = [...this.list, ...(data.inspectionItemVOList || [])];
|
|
|
|
|
+
|
|
|
|
|
+ // this.list.forEach((item) => {
|
|
|
|
|
+ // item.qualitySchemeTemplateCode = data.qualitySchemeTemplateCode;
|
|
|
|
|
+ // item.qualitySchemeTemplateName = data.qualitySchemeTemplateName;
|
|
|
|
|
+ // });
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|