Răsfoiți Sursa

移除记录规则分类搜索项,优化分类参数传递逻辑

yusheng 4 luni în urmă
părinte
comite
5a98dda804

+ 1 - 1
package.json

@@ -81,4 +81,4 @@
     "vue-template-compiler": "^2.7.10",
     "vue-template-compiler": "^2.7.10",
     "webpack": "^5.74.0"
     "webpack": "^5.74.0"
   }
   }
-}
+}

+ 7 - 7
src/components/selectReleaseRules/search.vue

@@ -31,13 +31,13 @@
             type: 'input',
             type: 'input',
             placeholder: '规则名称'
             placeholder: '规则名称'
           },
           },
-          {
-            label: '记录规则分类:',
-            value: 'classify',
-            type: 'select',
-            placeholder: '记录规则分类',
-            planList: this.typeList
-          }
+          // {
+          //   label: '记录规则分类:',
+          //   value: 'classify',
+          //   type: 'select',
+          //   placeholder: '记录规则分类',
+          //   planList: this.typeList
+          // }
           //,
           //,
           // {
           // {
           //   label: '状态:',
           //   label: '状态:',

+ 6 - 2
src/components/selectReleaseRules/select-release-rules.vue

@@ -56,6 +56,10 @@
         type: Boolean,
         type: Boolean,
         default: false
         default: false
       },
       },
+      classify: {
+        type: String,
+        default: ''
+      },
       // 是否多选
       // 是否多选
       multiple: {
       multiple: {
         type: Boolean,
         type: Boolean,
@@ -276,7 +280,6 @@
       this.requestDict('行业类别');
       this.requestDict('行业类别');
       this.requestDict('业务类型');
       this.requestDict('业务类型');
       this.requestDict('记录规则报工类型');
       this.requestDict('记录规则报工类型');
-      this.requestDict('记录规则类型');
       this.requestDict('记录表模板样式');
       this.requestDict('记录表模板样式');
     },
     },
     methods: {
     methods: {
@@ -310,7 +313,8 @@
           enable: 1,
           enable: 1,
           ...where,
           ...where,
           reportWorkType: this.reportWorkType,
           reportWorkType: this.reportWorkType,
-          produceTaskId: this.produceTaskId
+          produceTaskId: this.produceTaskId,
+          classify: this.classify
         });
         });
       },
       },
       /* 刷新表格 */
       /* 刷新表格 */

+ 1 - 1
src/mixins/dictMixins.js

@@ -8,7 +8,7 @@ export default {
     };
     };
   },
   },
   computed: {
   computed: {
-    ...mapGetters(['getDictValue', 'dict', 'getDict'])
+    ...mapGetters(['getDictValue', 'getDictCode','dict', 'getDict'])
   },
   },
   methods: {
   methods: {
     ...mapActions('dict', ['requestDict'])
     ...mapActions('dict', ['requestDict'])

+ 6 - 0
src/store/getters.js

@@ -18,5 +18,11 @@ export default {
       return item.dictCode == dictCode;
       return item.dictCode == dictCode;
     });
     });
     return obj && obj.dictValue;
     return obj && obj.dictValue;
+  },
+  getDictCode: (state) => (enumName, dictValue) => {
+    const obj = (state.dict[dictEnum[enumName]] || []).find((item) => {
+      return item.dictValue == dictValue;
+    });
+    return obj && obj.dictCode;
   }
   }
 };
 };

+ 16 - 4
src/views/recordComponents/plan.vue

@@ -267,7 +267,7 @@
         ],
         ],
         cacheKeyUrl: `pcs-2511241029-${this.pageName + ''}-plan`,
         cacheKeyUrl: `pcs-2511241029-${this.pageName + ''}-plan`,
         teamList: [],
         teamList: [],
-        productLineList:[]
+        productLineList: []
       };
       };
     },
     },
     computed: {
     computed: {
@@ -319,6 +319,7 @@
       }
       }
     },
     },
     created() {
     created() {
+      this.requestDict('记录规则类型');
       getteampage({
       getteampage({
         pageNum: 1,
         pageNum: 1,
         size: -1
         size: -1
@@ -335,9 +336,9 @@
       getFactoryarea({
       getFactoryarea({
         pageNum: 1,
         pageNum: 1,
         size: 999,
         size: 999,
-        type: 4 
+        type: 4
       }).then((res) => {
       }).then((res) => {
-        console.log(res,'res')
+        console.log(res, 'res');
         this.productLineList =
         this.productLineList =
           res.list.map((item) => {
           res.list.map((item) => {
             return {
             return {
@@ -382,7 +383,18 @@
         this.reload(where);
         this.reload(where);
       },
       },
       openEdit(type, row = null) {
       openEdit(type, row = null) {
-        this.$refs.programRulesDialogRef.open(type, row);
+        this.$refs.programRulesDialogRef.open(
+          type,
+          row,
+          this.getDictCode(
+            '记录规则类型',
+            this.pageName == 'productionRecords'
+              ? '生产记录'
+              : this.pageName == 'steamInjectionInspectionRecord'
+              ? '注汽检查记录'
+              : '固废记录'
+          )
+        );
       },
       },
       async deleteRow(id) {
       async deleteRow(id) {
         await recordrulesplanDelete([id]);
         await recordrulesplanDelete([id]);

+ 4 - 1
src/views/recordComponents/programRulesDialog.vue

@@ -578,6 +578,7 @@
     <selectReleaseRules
     <selectReleaseRules
       ref="selectReleaseRulesRef"
       ref="selectReleaseRulesRef"
       @chooseRules="chooseRules"
       @chooseRules="chooseRules"
+      :classify="classify"
     ></selectReleaseRules>
     ></selectReleaseRules>
 
 
     <selectWorkshop
     <selectWorkshop
@@ -675,6 +676,7 @@
         visible: false,
         visible: false,
         title: '新增记录计划配置',
         title: '新增记录计划配置',
         activeIndex: 0,
         activeIndex: 0,
+        classify:'',
         addForm: JSON.parse(JSON.stringify(formBaseData)),
         addForm: JSON.parse(JSON.stringify(formBaseData)),
         rules: {
         rules: {
           name: [
           name: [
@@ -911,8 +913,9 @@
     },
     },
     methods: {
     methods: {
       // 外部调用,打开弹窗
       // 外部调用,打开弹窗
-      async open(type, data) {
+      async open(type, data,classify) {
         console.log('type data', type, data);
         console.log('type data', type, data);
+        this.classify = classify;
         this.type = type;
         this.type = type;
         await this.getAllTeamList();
         await this.getAllTeamList();
         if (type == 'add') {
         if (type == 'add') {