Просмотр исходного кода

fix:大订单时间筛选修改

刘恒 2 лет назад
Родитель
Сommit
68763a387c
3 измененных файлов с 42 добавлено и 186 удалено
  1. 39 18
      src/pages/quote/quote.vue
  2. 2 2
      src/pages/task/agent.vue
  3. 1 166
      src/router/config.js

+ 39 - 18
src/pages/quote/quote.vue

@@ -47,17 +47,16 @@
           <h2>总报价</h2>
           <div>
             <span>时间筛选</span>
-            <a-date-picker
+            <a-range-picker
+              ref="rangePicker"
               v-model="formState.year"
-              value-format="YYYY"
-              format="YYYY"
+              @calendarChange="onCalendarChange"
+              :allowClear="false"
+              :disabledDate="disabledDate"
               style="margin-left: 10px"
-              mode="year"
-              @openChange="openChange"
-              @panelChange="panelChange"
+              valueFormat="YYYY-MM-DD"
             >
-              <a-icon slot="suffixIcon" type="calendar" />
-            </a-date-picker>
+            </a-range-picker>
             <a-radio-group
               default-value="0"
               button-style="solid"
@@ -234,14 +233,14 @@ export default {
       formState: {
         dateType: undefined,
         // time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
-        // beginDate: moment().format("YYYY-MM-DD"),
-        // endDate: moment().format("YYYY-MM-DD"),
+        beginDate: moment().format("YYYY-MM-DD"),
+        endDate: moment().format("YYYY-MM-DD"),
         licenseno: "",
         userName: "",
         mobile: "",
         frameno: "",
         userId: "",
-        year: moment().format("YYYY"),
+        year: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
       },
       backLinePersonnel: {},
       columns: columns,
@@ -272,6 +271,7 @@ export default {
       deptId: undefined,
       yearOpen: false,
       process: process.env.VUE_APP_API_BASE_URL,
+      startTime: "",
     };
   },
   mounted() {
@@ -280,15 +280,36 @@ export default {
     // }, 1000);
   },
   methods: {
-    openChange(status) {
-      if (status) {
-        this.yearOpen = true;
+    onCalendarChange(values) {
+      this.startTime = values[0];
+      let startTime = moment(values[0]);
+      let endTime = moment(values[1]);
+      this.formState.beginDate = values[0];
+      this.formState.endDate = values[1];
+      if (endTime.diff(startTime, "years") > 1) {
+        this.$message.error("选择范围不能超过一年!");
       }
     },
-    panelChange(value) {
-      this.formState.year = value;
-      this.yearOpen = false;
-      this.getVerification();
+    disabledDate(current) {
+      // console.log(current);
+      // if (!this.startDate) {
+      //   return false;
+      // }
+      if (this.startTime) {
+        return !(
+          moment(this.startTime).subtract(12, "month") < current &&
+          current < moment(this.startTime).add(12, "month")
+        );
+      } else {
+        return null;
+      }
+    },
+    isMoreThanOneYear(date) {
+      console.log(date);
+      return (
+        date.diff(moment()) > 365 ||
+        date.isBefore(moment().subtract(1, "years"))
+      );
     },
 
     chooseTree(val) {

+ 2 - 2
src/pages/task/agent.vue

@@ -530,9 +530,9 @@ export default {
       this.$message.info("您清空了勾选的所有行");
     },
 
-    onChange(pagination, filters, sorter, { currentDataSource }) {
+    onChange(pagination) {
       // this.$message.info('表格状态改变了')
-      console.log(pagination, filters, sorter, { currentDataSource });
+
       this.pagination = {
         current: pagination.current,
         defaultPageSize: pagination.pageSize,

+ 1 - 166
src/router/config.js

@@ -126,172 +126,6 @@ const router = new Router({
           name: '保费详情',
           component: () => import('@/pages/business/message'),
         },
-        // {
-
-
-        //   path: '/copartner',
-        //   name: '合伙人',
-        //   component: PageView,
-        //   children: [
-        //     {
-
-        //       path: '/copartner/index',
-        //       name: '合伙人',
-        //       component: () => import('@/pages/copartner/index'),
-        //     }
-        //   ]
-
-        // }
-
-
-        // {
-        //   path: 'task',
-        //   name: '任务统计',
-        //   meta: {
-        //     icon: 'profile'
-        //   },
-        //   component: PageView,
-        //   children: [
-        //     {
-        //       path: 'channel',
-        //       name: '渠道',
-        //       component: () => import('@/pages/task/channel')
-        //     },
-        //     {
-        //       path: 'insurance',
-        //       name: '保险公司',
-        //       component: () => import('@/pages/task/insurance'),
-        //     },
-        //     {
-        //       path: 'agent',
-        //       name: '代理人',
-        //       component: () => import('@/pages/task/agent'),
-        //     },
-
-        //   ]
-        // },
-        // {
-        //   path: 'financial',
-        //   name: '财务中心',
-        //   meta: {
-        //     icon: 'check-circle-o',
-        //   },
-        //   component: PageView,
-        //   children: [
-
-        //     {
-        //       path: 'verification',
-        //       name: '费用校验',
-        //       component: () => import('@/pages/financial/verification')
-        //     }, {
-        //       path: 'receivables',
-        //       name: '财务应收',
-        //       component: { render(c) { return c('router-view') } },
-        //       redirect: "shou",
-        //       children: [
-
-        //         {
-        //           path: 'msg',
-        //           name: '每月详情',
-        //           meta: { invisible: true },
-        //           component: () => import('@/pages/financial/receivablesMessage')
-        //         }
-        //       ]
-        //     }, {
-        //       path: 'carInsurance',
-        //       name: '车险应收',
-        //       component: () => import('@/pages/financial/carInsurance')
-        //     }, {
-        //       path: 'noCarInsurance',
-        //       name: '非车险应收',
-        //       component: PageView,
-        //       children: [
-        //         {
-        //           path: 'carInsurance',
-        //           name: '驾意应收',
-        //           component: () => import('@/pages/financial/noCarInsurance')
-        //         }
-
-        //       ]
-        //     },
-        //     {
-        //       path: 'shou',
-        //       name: '财务应收',
-        //       component: () => import('@/pages/financial/receivables'),
-        //       meta: { invisible: true },
-
-        //     },
-        //   ]
-        // },
-        // {
-        //   path: 'quote',
-        //   name: '报价次数',
-        //   meta: {
-        //     icon: 'check-circle-o',
-        //   },
-        //   component: PageView,
-        //   children: [
-        //     {
-        //       path: 'quote',
-        //       name: '总报价',
-        //       component: () => import('@/pages/quote/quote')
-        //     },
-        //     {
-        //       path: 'agent',
-        //       name: '代理人报价',
-        //       component: () => import('@/pages/quote/agent'),
-        //     },
-        //     {
-        //       path: 'channel',
-        //       name: '渠道报价',
-        //       component: () => import('@/pages/quote/channel'),
-        //     },
-
-        //   ]
-        //   // component: () => import('@/pages/quote/quote')
-        //   // component: PageView,quote
-        // },
-        // {
-        //   path: 'profit',
-        //   name: '利润分析',
-        //   meta: {
-        //     icon: 'check-circle-o',
-        //   },
-        //   // component: PageView,
-        //   component: () => import('@/pages/profit/profit')
-        // },
-        // {
-        //   path: 'business',
-        //   name: '业务数据',
-        //   meta: {
-        //     icon: 'check-circle-o',
-        //   },
-        //   // component: PageView,
-        //   component: () => import('@/pages/business/business')
-        // },
-        // {
-        //   path: 'sys',
-        //   name: '系统管理',
-        //   meta: {
-        //     icon: 'check-circle-o',
-        //   },
-        //   component: PageView,
-        //   children: [
-
-        //     {
-        //       path: 'menu',
-        //       name: '菜单管理',
-        //       component: () => import('@/pages/sys/menu'),
-        //     },
-
-
-
-
-        //   ]
-
-        // },
-
-
 
 
       ]
@@ -301,6 +135,7 @@ const router = new Router({
       name: '首页',
       component: () => import('@/pages/index/index')
     },
+
     {
       path: '/login',
       name: '登录页',