浏览代码

no message

linwenxin 5 月之前
父节点
当前提交
d33ea36d3b
共有 1 个文件被更改,包括 36 次插入12 次删除
  1. 36 12
      src/views/workOrder/workOrderPool/index.vue

+ 36 - 12
src/views/workOrder/workOrderPool/index.vue

@@ -203,7 +203,32 @@ export default {
       workOrderType: 1,
       cloneWorkOrder: null,
       value1: new Date(),
-      showTableBool: true
+      showTableBool: true,
+      fuhezhuangtai: {
+        DSHPG: [
+          'DSHPG',
+          'CJ',
+          'YPD',
+          'DXSPD',
+          'DZBPG',
+          'DWDSPGP',
+          'DXSSPGP',
+          'DTJXSSPGP',
+          'DZBSPGP',
+          'DFZXPD',
+          'DFZXSPGP',
+          'XSBH',
+          'TJXSBH',
+          'ZBBH',
+          'FZXBH',
+          'FL'
+        ],
+        DWDPG: ['DWDPG', 'DWDPD', 'WDBH'],
+        FWZ: ['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'],
+        YWG: ['YWG', 'GCSZX', 'WDWG', 'YWGO'],
+        YJS: ['YJS', 'LRCD'],
+        YQX: ['YQX', 'FWZT', 'YCGB', 'FWQX']
+      }
     }
   },
   watch: {
@@ -513,7 +538,7 @@ export default {
           },
           {
             label: '已完工',
-            value: 'YWGO'
+            value: 'YWG'
           },
           {
             label: '已结算',
@@ -536,15 +561,14 @@ export default {
             value: 'PJYQX'
           }
         ].map(item => {
-          var data = res.data.find(val => val.orderStatus == item.value)
-          if (item.value == 'YWGO') {
-            var data_ = res.data.find(val => val.orderStatus == 'YWG')
-            var data_2 = res.data.find(val => val.orderStatus == 'GCSZX')
-            var data_3 = res.data.find(val => val.orderStatus == 'YJS')
-            item.label = `${item.label}(${
-              (data?.total || 0) + (data_?.total || 0) + (data_2?.total || 0) + (data_3?.total || 0)
-            })`
+          if (this.fuhezhuangtai[item.value]) {
+            var num = 0
+            this.fuhezhuangtai[item.value].map(status => {
+              num += res.data.find(val => val.orderStatus == status)?.total || 0
+            })
+            item.label = `${item.label}(${num || 0})`
           } else {
+            var data = res.data.find(val => val.orderStatus == item.value)
             item.label = `${item.label}(${data?.total || 0})`
           }
           return item
@@ -557,8 +581,8 @@ export default {
       var pam = JSON.parse(JSON.stringify(p))
       try {
         if (pam.orderStatus) {
-          if (pam.orderStatus === 'YWGO') {
-            pam.params.push({ param: 'a.order_status', compare: '=', value: ['YWG', 'YWGO', 'YJS', 'GCSZX'] })
+          if (this.fuhezhuangtai[pam.orderStatus]) {
+            pam.params.push({ param: 'a.order_status', compare: '=', value: this.fuhezhuangtai[pam.orderStatus] })
             pam.orderStatus = ''
           } else {
             pam.params.push({ param: 'a.order_status', compare: '=', value: pam.orderStatus })