Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng 10 месяцев назад
Родитель
Сommit
bc18a00417

+ 4 - 1
src/views/material/BOMmanage/components/detailedList.vue

@@ -207,7 +207,10 @@
           >
           >
           </el-input>
           </el-input>
           <!--  -->
           <!--  -->
-          <el-button type="primary" @click="factoriesFn(row.code)"
+          <el-button
+            type="primary"
+            @click="factoriesFn(row.code)"
+            v-if="row.approvalStatus != 2 && row.approvalStatus != 1"
             >选择</el-button
             >选择</el-button
           >
           >
           <!-- <el-select v-model="row.factories" size="mini" clearable class="ele-block" filterable placeholder="请选择生产厂家">
           <!-- <el-select v-model="row.factories" size="mini" clearable class="ele-block" filterable placeholder="请选择生产厂家">

+ 14 - 3
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -1253,7 +1253,6 @@
         );
         );
       },
       },
       determineChoose(title, row, idx) {
       determineChoose(title, row, idx) {
-        console.log('111111111111111');
         let type = '';
         let type = '';
         if (this.activeName === '材料定额') {
         if (this.activeName === '材料定额') {
           type = 'materialQuota';
           type = 'materialQuota';
@@ -1262,6 +1261,7 @@
         }
         }
 
 
         if (title == '选择物料') {
         if (title == '选择物料') {
+          console.log(row, 'row');
           this.$set(
           this.$set(
             this.tableData.taskParam[this.currentIndex][type][idx],
             this.tableData.taskParam[this.currentIndex][type][idx],
             'categoryName',
             'categoryName',
@@ -1302,6 +1302,17 @@
             'rootCategoryLevelId',
             'rootCategoryLevelId',
             row.categoryLevelPathIdParent
             row.categoryLevelPathIdParent
           );
           );
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'specification',
+            row.specification
+          );
+
+          this.$set(
+            this.tableData.taskParam[this.currentIndex][type][idx],
+            'id',
+            row.id
+          );
         }
         }
       },
       },
       uploadedSuccess(data, row) {
       uploadedSuccess(data, row) {
@@ -1481,8 +1492,8 @@
           unit: '',
           unit: '',
           rootCategoryLevelId: '',
           rootCategoryLevelId: '',
           categoryCode: '',
           categoryCode: '',
-          id: '',
-          specification: ''
+          specification: '',
+          id: ''
         });
         });
       },
       },
       /* 表格数据源 */
       /* 表格数据源 */

+ 5 - 1
src/views/material/BOMmanage/qualityTesting/inspectionTemplate.vue

@@ -2,6 +2,7 @@
   <ele-modal
   <ele-modal
     title="选择"
     title="选择"
     :visible.sync="visible"
     :visible.sync="visible"
+    v-if="visible"
     :before-close="handleClose"
     :before-close="handleClose"
     :close-on-click-modal="false"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     :close-on-press-escape="false"
@@ -238,7 +239,10 @@
         this.visible = false;
         this.visible = false;
       },
       },
       changeSel() {
       changeSel() {
-        this.$emit('changeSel', this.current);
+        if (this.current) {
+          this.$emit('changeSel', this.current);
+        }
+
         this.handleClose();
         this.handleClose();
       },
       },
       handleCurrentChange(row) {
       handleCurrentChange(row) {

+ 71 - 4
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -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;
+          // });
         });
         });
       }
       }
     }
     }