linwenxin il y a 1 mois
Parent
commit
5bb4213a45
2 fichiers modifiés avec 25 ajouts et 7 suppressions
  1. 2 2
      src/api/workOrder/orderHome.js
  2. 23 5
      src/views/workOrder/orderHome/index.vue

+ 2 - 2
src/api/workOrder/orderHome.js

@@ -1,10 +1,10 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
 // 获取工单状态统计
-export function getCount(data) {
+export function getCount(params) {
   return request({
     url: `/order/base/count/status/count`,
     method: 'post',
-    data
+    params
   })
 }

+ 23 - 5
src/views/workOrder/orderHome/index.vue

@@ -1,8 +1,17 @@
 <template>
   <div class="dashboard_container">
-    <div class="refresh" @click="refreshData">
-      <span style="color: #1d82ff">刷新数据</span>
-      <i class="el-icon-refresh-left" style="color: #1d82ff"></i>
+    <div class="refresh">
+      <el-date-picker
+        style="width: 130px"
+        v-model="value1"
+        format="yyyy"
+        size="mini"
+        type="year"
+        placeholder="选择日期"
+      >
+      </el-date-picker>
+      <span style="color: #1d82ff; margin-left: 20px" @click="refreshData">刷新数据</span>
+      <i class="el-icon-refresh-left" style="color: #1d82ff" @click="refreshData"></i>
     </div>
     <div class="container_top">
       <div class="tab" v-for="(item, index) in tabs" :key="index" @click="openOrder(item.type, item.title)">
@@ -55,7 +64,13 @@ export default {
       ],
       qtsm: [],
       qtddqs: {},
-      wglxfb: {}
+      wglxfb: {},
+      value1: new Date()
+    }
+  },
+  watch: {
+    value1(newVal) {
+      this.getCount()
     }
   },
   computed: {
@@ -135,7 +150,10 @@ export default {
       }
     },
     getCount() {
-      getCount().then(res => {
+      getCount({
+        startTime: `${new Date(this.value1).getFullYear()}-01-01 00:00:00`,
+        endTime: `${new Date(this.value1).getFullYear()}-12-31 23:59:59`
+      }).then(res => {
         this.tabs[0].num = res.data.dpg || 0
         this.tabs[1].num = res.data.dyy || 0
         this.tabs[2].num = res.data.dqd || 0