Преглед изворни кода

报告检索栏位的选项

zhuliu пре 1 година
родитељ
комит
35b874aeeb
1 измењених фајлова са 65 додато и 49 уклоњено
  1. 65 49
      src/views/report/components/index.vue

+ 65 - 49
src/views/report/components/index.vue

@@ -173,22 +173,22 @@ export default {
           }
         })
       }
-      if (a.REPORT_TYPE) {
-        // 报告类型
-        this.searchFiled[1].options = a.REPORT_TYPE.map(item => {
-          return {
-            value: item.value,
-            label: item.label
-          }
-        })
-        // 报告状态
-        this.searchFiled[2].options = a.REPORT_STATE.map(item => {
-          return {
-            value: item.value,
-            label: item.label
-          }
-        })
-      }
+      // if (a.REPORT_TYPE) {
+      //   // 报告类型
+      //   this.searchFiled[1].options = a.REPORT_TYPE.map(item => {
+      //     return {
+      //       value: item.value,
+      //       label: item.label
+      //     }
+      //   })
+      //   // 报告状态
+      //   this.searchFiled[2].options = a.REPORT_STATE.map(item => {
+      //     return {
+      //       value: item.value,
+      //       label: item.label
+      //     }
+      //   })
+      // }
 
       return a
     },
@@ -278,42 +278,42 @@ export default {
             type: 'type',
           })
           //先获取报告类型,报告状态,相关事件,再为报告类型,报告状态,相关事件添加选项
-          let arr = ['报告类型', '报告状态', '核心结论']
+          let arr = ['reportType', 'status', 'cronNames','scenarioNames','matterNames']
           arr.forEach(item => {
             let obj = this.searchFiled.find(item2 => {
-              return item2.label == item
+              return item2.value == item
             })
             if (obj) {
               this.handleSearchArray(obj)
             }
           })
           //为应用场景添加选项
-          var obj = this.searchFiled.find(item => { return item.label == '应用场景' })
-          if (obj) {
-            obj.options = this.scene.map(item => {
-              return {
-                label: item.name,
-                value: item.id
-              }
-            })
-          }
-          var obj = this.searchFiled.find(item => { return item.label == '调查类型' })
-          if (obj) {
-            obj.options = this.matter.map(item => {
-              return {
-                label: item.name,
-                value: item.id
-              }
-            })
-          }
+          // var obj = this.searchFiled.find(item => { return item.value == 'scenarioNames' })
+          // if (obj) {
+          //   obj.options = this.scene.map(item => {
+          //     return {
+          //       label: item.name,
+          //       value: item.id
+          //     }
+          //   })
+          // }
+          // var obj = this.searchFiled.find(item => { return item.value == 'matterNames' })
+          // if (obj) {
+          //   obj.options = this.matter.map(item => {
+          //     return {
+          //       label: item.name,
+          //       value: item.id
+          //     }
+          //   })
+          // }
         }
       })
       this.showViews()
     },
     // 处理检索字段为array类型的问题
     handleSearchArray(obj) {
-      switch (obj.label) {
-        case '报告类型':
+      switch (obj.value) {
+        case 'reportType':
           if (this.dictMessage.REPORT_TYPE && this.dictMessage.REPORT_TYPE.length > 0) {
             let dict = this.dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.value))
             obj.options = dict.map(item => {
@@ -325,24 +325,40 @@ export default {
           }
 
           break;
-        case '报告状态':
-          obj.options = [
-            { value: 0, label: '开卷审核' },
-            { value: 1, label: '创建中' },
-            { value: 2, label: '处理中' },
-            { value: 3, label: '完成' },
-            { value: 4, label: '取消开卷' },
-            { value: 5, label: '补资料中' },
-          ]
+        case 'status':
+          if (this.dictMessage.REPORT_STATE && this.dictMessage.REPORT_STATE.length > 0) {
+            let dict = this.dictMessage.REPORT_STATE
+            obj.options = dict.map(item => {
+              return {
+                label: item.label,
+                value: item.value,
+              }
+            })
+          }
           break;
-        case '核心结论':
+        case 'cronNames':
           this.$api.queryCrons().then(res => {
             if (res.code == 200) {
               obj.options = res.data.data
             }
           })
           break;
-
+        case 'scenarioNames':
+            obj.options = this.scene.map(item => {
+              return {
+                label: item.name,
+                value: item.id
+              }
+            })
+          break;
+        case 'matterNames':
+            obj.options = this.matter.map(item => {
+              return {
+                label: item.name,
+                value: item.id
+              }
+            })
+          break;
         default:
           break;
       }