Prechádzať zdrojové kódy

优化质检模板对话框和搜索组件,调整类型参数传递方式

yusheng 9 mesiacov pred
rodič
commit
95bdcc3a19

+ 7 - 2
src/views/inspectionTemplate/components/inspectionTemplateDialog.vue

@@ -18,6 +18,7 @@
       row-key="qualityLevelId"
       v-if="equipmentdialog"
       :selection.sync="selection"
+      :initLoad="false"
     >
       <template v-slot:status="{ row }">
         {{ row.status ? '启用' : '停用' }}
@@ -104,13 +105,17 @@
         return getList({
           ...where,
           pageNum: page,
-          size: limit,
-          type: this.type
+          size: limit
+          // type: this.type
         });
       },
       open(type) {
         this.type = type;
         this.equipmentdialog = true;
+        this.$nextTick(() => {
+          this.$refs.search.setWhere(type);
+          this.$refs.search.search();
+        });
       },
       handleClose() {
         this.equipmentdialog = false;

+ 14 - 1
src/views/inspectionTemplate/components/search.vue

@@ -40,6 +40,15 @@
           </el-select>
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 10 } : { span: 6 }">
+        <el-form-item label="质检方案类型:">
+          <DictSelection
+            dictName="质检计划类型"
+            v-model="where.type"
+          ></DictSelection>
+        </el-form-item>
+      </el-col>
+
       <el-col
         style="display: flex; justify-content: flex-end"
         v-bind="styleResponsive ? { lg: 6, md: 18 } : { span: 6 }"
@@ -67,7 +76,8 @@
       const defaultWhere = {
         name: '',
         standardCode: '',
-        status: ''
+        status: '',
+        type:''
       };
       return {
         defaultWhere,
@@ -82,6 +92,9 @@
       }
     },
     methods: {
+      setWhere(type){
+         this.where.type = type
+      },
       /* 搜索 */
       search() {
         this.$emit('search', this.where);