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

优化发布规则组件并添加字典请求功能

yusheng 6 месяцев назад
Родитель
Сommit
109ec11419

+ 9 - 2
src/components/releaseRules/index.vue

@@ -286,7 +286,13 @@
         ];
       }
     },
-    created() {},
+    created() {
+      this.requestDict('行业类别');
+      this.requestDict('业务类型');
+      this.requestDict('记录规则报工类型');
+      this.requestDict('记录规则类型');
+      this.requestDict('记录表模板样式');
+    },
     methods: {
       open(type) {
         this.visible = true;
@@ -455,7 +461,8 @@
           size: limit,
           ...where,
           ...typeWhere,
-          enable: 1
+          enable: 1,
+          publishStatus:1
         });
       },
       // 单击获取id

+ 38 - 38
src/components/releaseRules/search.vue

@@ -39,44 +39,44 @@
             planList: this.typeList
           },
 
-          {
-            label: '状态:',
-            value: 'publishStatus',
-            type: 'select',
-            placeholder: '状态',
-            // 0-草稿,1-已发布,2-已撤销
-            planList: [
-              {
-                label: '草稿',
-                value: '0'
-              },
-              {
-                label: '已发布',
-                value: '1'
-              },
-              {
-                label: '已撤销',
-                value: '2'
-              }
-            ]
-          },
-          {
-            label: '是否启用:',
-            value: 'enable',
-            type: 'select',
-            placeholder: '是否启用',
-            // 0-草稿,1-已发布,2-已撤销
-            planList: [
-              {
-                label: '启用',
-                value: '1'
-              },
-              {
-                label: '停用',
-                value: '0'
-              }
-            ]
-          }
+          // {
+          //   label: '状态:',
+          //   value: 'publishStatus',
+          //   type: 'select',
+          //   placeholder: '状态',
+          //   // 0-草稿,1-已发布,2-已撤销
+          //   planList: [
+          //     {
+          //       label: '草稿',
+          //       value: '0'
+          //     },
+          //     {
+          //       label: '已发布',
+          //       value: '1'
+          //     },
+          //     {
+          //       label: '已撤销',
+          //       value: '2'
+          //     }
+          //   ]
+          // },
+          // {
+          //   label: '是否启用:',
+          //   value: 'enable',
+          //   type: 'select',
+          //   placeholder: '是否启用',
+          //   // 0-草稿,1-已发布,2-已撤销
+          //   planList: [
+          //     {
+          //       label: '启用',
+          //       value: '1'
+          //     },
+          //     {
+          //       label: '停用',
+          //       value: '0'
+          //     }
+          //   ]
+          // }
         ];
       }
     },

+ 8 - 3
src/enum/dict.js

@@ -24,9 +24,9 @@ export default {
   业务类型: 'business_type',
   行业类别: 'industry_type',
   记录表模板样式: 'record_template_style',
+  记录规则类型: 'record_sheet',
   放行类型: 'checklist_type',
-  记录规则报工类型: 'record_rules_report_work_type',
-
+  记录规则报工类型: 'record_rules_report_work_type'
 };
 
 export const numberList = [
@@ -40,7 +40,12 @@ export const numberList = [
   'inspection_plan_type',
   'dispose_status',
   'inspection_plan_status',
-  'inspection_scheme'
+  'inspection_scheme',
+  'industry_type',
+  'business_type',
+  'record_template_style',
+  'checklist_type',
+  'record_rules_report_work_type','record_sheet'
 ];
 
 //审核状态

+ 3 - 1
src/store/getters.js

@@ -13,6 +13,8 @@ export default {
     ) || {},
   // 根据字典enumName  和 dictCode 获取字典 值(名称
   getDictValue: (state) => (enumName, dictCode) => {
+
+
     const obj = (state.dict[dictEnum[enumName]] || []).find((item) => {
       return item.dictCode === dictCode;
     });
@@ -22,7 +24,7 @@ export default {
   getDictName: (state) => (enumName, dictCode) => {
     const arr = state.dict[dictEnum[enumName]] || [];
     return arr.find((item) => item.dictCode === dictCode)?.dictValue || '';
-  },
+  }
   // getDictList: (state) => (enumName) => {
   //   if (!state.dict[dictEnum[enumName]].length) return [];
   //   return state.dict[dictEnum[enumName]].map((item) => {