Prechádzať zdrojové kódy

新增安保履职统计页面

jingyuanchao 1 rok pred
rodič
commit
2896751ca0
1 zmenil súbory, kde vykonal 15 pridanie a 21 odobranie
  1. 15 21
      src/views/menu/resumptionStatistics/index.vue

+ 15 - 21
src/views/menu/resumptionStatistics/index.vue

@@ -26,11 +26,11 @@
               v-model="startDate"
               show-toolbar
               @cancel="onCancel"
-              type="day"
+              type="date"
               @confirm="onDateConfirm"
               confirm-button-text="确定"
               title="统计日期"
-              :formatter="monthFormatter"
+              :formatter="formatter"
             />
           </van-popup>
         </van-col>
@@ -46,7 +46,7 @@
               @confirm="onMonthConfirm"
               confirm-button-text="确定"
               title="统计月份"
-              :formatter="monthFormatter"
+              :formatter="formatter"
             />
           </van-popup>
         </van-col>
@@ -71,17 +71,14 @@
 <script>
 import NavBar from '@/components/NavBar'
 import OrgTree from '@/components/orgTree'
-import dateCell from '@/components/dateCell'
 import selectCell from '@/components/selectCell'
 import dayjs from "dayjs";
-import {Toast} from 'vant'
 import {selectResumptionReport} from "views/menu/resumption/api";
 
 export default {
   components: {
     NavBar,
     OrgTree,
-    dateCell,
     selectCell
   },
   data() {
@@ -120,20 +117,21 @@ export default {
       dataList: []
     }
   },
-  created() {},
+  created() {
+  },
   mounted() {
     this.initData()
   },
   computed: {},
   methods: {
     dayjs,
-    monthFormatter(type, val) {
-      if (type === 'day') {
-        return `${val}`;
+    formatter(type, val) {
+      if (type === 'year') {
+        return `${val}`;
       } else if (type === 'month') {
         return `${val}月`;
-      } else if (type === 'year') {
-        return `${val}`;
+      } else if (type === 'day') {
+        return `${val}`;
       }
       return val;
     },
@@ -144,12 +142,11 @@ export default {
       return dayjs(date).format(format);
     },
     initDate() {
-      return new Date()
+      return this.getDayStr(new Date())
     },
     //机构搜索
     getOrgDataList(val) {
       this.orgId = val
-
       this.getDataList()
     },
     getDataList() {
@@ -158,7 +155,6 @@ export default {
         cycle: this.selectType,
         searchTime: this.showSelectTimeText
       }
-      console.log("getDataList....", data)
       selectResumptionReport(data).then(res => {
         this.dataList = res.data
       })
@@ -170,21 +166,20 @@ export default {
       this.showSelectType = false;
       // 只有在用户选择了日期类型后,才显示日期选择器
       if (this.selectType === 1) {
-
         this.showDate = true;
-      }else {
-
+        this.showMonth = false;
+      } else {
         this.showMonth = true;
+        this.showDate = false;
       }
     },
-
     onCancel() {
       this.showSelectType = false;
       this.showDate = false;
+      this.showMonth = false;
     },
     //日期选中触发
     onDateConfirm(val) {
-      console.log('onDateConfirm...', val)
       this.showSelectTimeText = this.getDayStr(val);
       this.startDate = val;
       this.showDate = false;
@@ -192,7 +187,6 @@ export default {
     },
     //月份选中触发
     onMonthConfirm(val) {
-      console.log('onMonthConfirm...', val)
       this.showSelectTimeText = this.getDayStr(val, 'YYYY-MM')
       this.startDate = val;
       this.showDate = false;