isv-robot 2 年之前
父节点
当前提交
c5c246efc8

+ 1 - 1
src/views/dashboard-screen/jryl/index.vue

@@ -271,7 +271,7 @@ export default {
               //   console.log('evt', evt)
               // }
               formatter: (evt) => {
-                return data[0][0] > 0 ? evt.value : ' '
+                return data[0][0] > 0 ? evt?.value : ' '
               }
             },
             data: data[0]

+ 8 - 8
src/views/dashboard-screen/screen/screenSbxjdxqk/indexColumns.js

@@ -48,14 +48,14 @@ function columns(vm) {
     {
       title: '设备',
       align: 'center',
-      dataIndex: 'qj',
-      key: 'qj'
+      dataIndex: 'sbmc',
+      key: 'sbmc'
     },
     {
       title: '总数',
       align: 'center',
-      dataIndex: 'zs',
-      key: 'zs'
+      dataIndex: 'total',
+      key: 'total'
     },
     {
       title: '月份',
@@ -66,14 +66,14 @@ function columns(vm) {
         {
           title: '计划',
           align: 'center',
-          dataIndex: 'jh',
-          key: 'jh'
+          dataIndex: 'plan',
+          key: 'plan'
         },
         {
           title: '完成',
           align: 'center',
-          dataIndex: 'wc',
-          key: 'wc'
+          dataIndex: 'actual',
+          key: 'actual'
         },
         {
           title: '兑现',

+ 27 - 8
src/views/dashboard-screen/screen/screenSbxjdxqk/screenSbxjdxqk.vue

@@ -7,7 +7,7 @@
         row-key="id"
         :columns="columns"
         :data-source="dataSource"
-        :pagination="ipagination"
+        :pagination="false"
         :loading="loading"
         @change="handleTableChange"
       />
@@ -42,15 +42,34 @@ export default {
     }
   },
   created() {
-    this.loadTree()
+    this.getData()
   },
+
   methods: {
-    loadTree() {
-      this.treeData = []
-      getAction(this.url.tree).then((res) => {
-        if (res.code === 200) {
-          this.treeData = res.data
-        }
+    getData() {
+      this.columns[this.columns.length - 1].title = dayjs().format('M') + '月'
+      getAction(this.url.list).then((res) => {
+        const basicDataSource = res.data || []
+        const typeArr = []
+        basicDataSource.forEach(itemRow => {
+          const find = typeArr
+            .find(typeItem => typeItem.deptName === itemRow.deptName && typeItem.teamName === itemRow.teamName)
+          if (!find) {
+            const newTypeItem = {
+              deptName: itemRow.deptName,
+              teamName: itemRow.teamName,
+              children: [itemRow]
+            }
+            typeArr.push(newTypeItem)
+          } else {
+            find.children.push(itemRow)
+          }
+        })
+        const newList = typeArr.reduce((arr, cur) => {
+          arr = arr.concat(cur.children)
+          return arr
+        }, [])
+        this.dataSource = newList || basicDataSource
       })
     }
   }