ysy пре 1 година
родитељ
комит
c2ddc5dc1b

+ 12 - 2
src/views/inspectionPoint/components/newEdit.vue

@@ -46,7 +46,10 @@
         </el-col>
       </el-row>
       <el-row>
-        <inspectionProjectList @openAdd="openAdd"></inspectionProjectList>
+        <inspectionProjectList
+          @openAdd="openAdd"
+          :inspectList="inspectList"
+        ></inspectionProjectList>
       </el-row>
     </el-form>
     <template v-slot:footer>
@@ -64,6 +67,7 @@
 
     <EquipmentDialog
       v-if="showEquipment"
+      @chooseModal="chooseModal"
       @closeDialog="closeDialog"
     ></EquipmentDialog>
   </el-dialog>
@@ -106,7 +110,8 @@
         visible: true,
         loading: false,
 
-        showEquipment: false
+        showEquipment: false,
+        inspectList: []
       };
     },
 
@@ -149,6 +154,11 @@
 
       closeDialog() {
         this.showEquipment = false;
+      },
+
+      chooseModal(list) {
+        this.inspectList = list || [];
+        
       }
     }
   };

+ 20 - 8
src/views/inspectionPoint/components/newEquipmentDialog.vue

@@ -31,6 +31,7 @@
             ref="table"
             :columns="columns"
             :datasource="datasource"
+            :selection.sync="selection"
             height="calc(100vh - 385px)"
             full-height="calc(100vh - 116px)"
             tool-class="ele-toolbar-form"
@@ -127,6 +128,7 @@
         visibleDialog: true,
         rootId: '12',
         categoryLevelId: null,
+        selection: [],
 
         columns: [
           {
@@ -140,14 +142,13 @@
           {
             prop: 'itemVO.inspectionCode',
             label: '参数编码',
-            showOverflowTooltip: true,
             align: 'center',
             minWidth: 110
           },
           {
             prop: 'itemVO.inspectionName',
             label: '参数名称',
-            showOverflowTooltip: true,
+
             align: 'center',
             minWidth: 110
           },
@@ -263,10 +264,6 @@
         });
       },
 
-      selectionChange(selection) {
-        console.log(selection);
-      },
-
       onDone() {
         this.$nextTick(() => {
           this.$refs.equiTable.setSelectedRowKeys(this.ids);
@@ -276,7 +273,22 @@
         this.$emit('closeDialog');
       },
 
-      selected() {}
+      selected() {
+        let _arr = [];
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+
+        _arr = this.selection.map((m) => {
+          return {
+            ...m.itemVO
+          };
+        });
+
+        this.$emit('chooseModal', _arr);
+        this.handleClose();
+      }
     }
   };
 </script>
@@ -284,7 +296,7 @@
 <style lang="scss" scoped>
   .layout {
     min-height: 50vh;
-    max-height: 70vh;
+    max-height: 75vh;
     overflow-y: scroll;
   }
 

+ 42 - 23
src/views/inspectionPoint/components/newInspectionProjectList.vue

@@ -25,34 +25,34 @@
 
       <template v-slot:textType="{ row }">
         {{
-          row.itemVO.textType == 1
+          row.textType == 1
             ? '数值'
-            : row.itemVO.textType == 2
+            : row.textType == 2
             ? '选择'
-            : row.itemVO.textType == 3
+            : row.textType == 3
             ? '上下限'
-            : row.itemVO.textType == 4
+            : row.textType == 4
             ? '规格'
-            : row.itemVO.textType == 5
+            : row.textType == 5
             ? '时间'
-            : row.itemVO.textType == 6
+            : row.textType == 6
             ? '范围'
             : ''
         }}
       </template>
 
       <template v-slot:type="{ row }">
-        {{ getDictValue('质检标准类型', row.itemVO.type) }}
+        {{ getDictValue('质检标准类型', row.type) }}
       </template>
 
       <template v-slot:toolList="{ row }">
         <div
           style="display: inline-block"
-          v-for="(item, idx) in row.itemVO.toolList"
+          v-for="(item, idx) in row.toolList"
           :key="idx"
           >{{ item.name }}
           <span
-            v-if="row.itemVO.toolList && idx != row.itemVO.toolList.length - 1"
+            v-if="row.toolList && idx != row.toolList.length - 1"
             >,
           </span></div
         >
@@ -76,22 +76,41 @@
 </template>
 
 <script>
+  import dictMixins from '@/mixins/dictMixins';
   export default {
-    components: {},
-    props: {},
+    mixins: [dictMixins],
+
+    props: {
+      inspectList: {
+        type: Array,
+        default() {
+          return [];
+        }
+      }
+    },
+
+    watch: {
+      inspectList: {
+        handler(list) {
+
+            this.$refs.table.setData([...list]);
+        },
+        immediate: true,
+        deep: true
+      }
+    },
 
     data() {
       return {
         columns: [
           {
-            prop: 'itemVO.inspectionCode',
+            prop: 'inspectionCode',
             label: '参数编码',
-            showOverflowTooltip: true,
             align: 'center',
             minWidth: 110
           },
           {
-            prop: 'itemVO.inspectionName',
+            prop: 'inspectionName',
             label: '参数名称',
             showOverflowTooltip: true,
             align: 'center',
@@ -99,7 +118,7 @@
           },
 
           {
-            prop: 'itemVO.textType',
+            prop: 'textType',
             label: '参数类型',
             showOverflowTooltip: true,
             align: 'center',
@@ -108,41 +127,41 @@
           },
 
           {
-            prop: 'itemVO.maxValue',
+            prop: 'maxValue',
             label: '参数上限',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'itemVO.minValue',
+            prop: 'minValue',
             label: '参数下限',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'itemVO.defaultValue',
+            prop: 'defaultValue',
             label: '默认值',
             align: 'center',
             showOverflowTooltip: true
           },
           {
             label: '工艺要求',
-            prop: 'itemVO.inspectionStandard',
+            prop: 'inspectionStandard',
             formatter: (row, column, cellValue) => {
               return (
-                row.itemVO.symbol + ' ' + cellValue + ' ' + row.itemVO.unit
+                row.symbol + ' ' + cellValue + ' ' + row.unit
               );
             },
             minWidth: 150
           },
           {
             label: '标准类型',
-            prop: 'itemVO.type',
+            prop: 'type',
             slot: 'type'
           },
 
           {
-            prop: 'itemVO.qualityStandardName',
+            prop: 'qualityStandardName',
             label: '标准名称',
             align: 'center',
             minWidth: 110
@@ -157,7 +176,7 @@
           },
 
           {
-            prop: 'itemVO.toolList',
+            prop: 'toolList',
             slot: 'toolList',
             label: '设备名称',
             align: 'center',