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

fix:大订单时间选择优化

刘恒 2 лет назад
Родитель
Сommit
4e5eea81da
1 измененных файлов с 12 добавлено и 4 удалено
  1. 12 4
      src/pages/quote/quote.vue

+ 12 - 4
src/pages/quote/quote.vue

@@ -49,9 +49,9 @@
             <span>时间筛选</span>
             <span>时间筛选</span>
             <a-range-picker
             <a-range-picker
               ref="rangePicker"
               ref="rangePicker"
-              v-model="formState.year"
+              v-model="formState.time"
               @calendarChange="onCalendarChange"
               @calendarChange="onCalendarChange"
-              :allowClear="false"
+              allowClear
               :disabledDate="disabledDate"
               :disabledDate="disabledDate"
               style="margin-left: 10px"
               style="margin-left: 10px"
               valueFormat="YYYY-MM-DD"
               valueFormat="YYYY-MM-DD"
@@ -240,7 +240,7 @@ export default {
         mobile: "",
         mobile: "",
         frameno: "",
         frameno: "",
         userId: "",
         userId: "",
-        year: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
+        time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
       },
       },
       backLinePersonnel: {},
       backLinePersonnel: {},
       columns: columns,
       columns: columns,
@@ -295,6 +295,13 @@ export default {
       // if (!this.startDate) {
       // if (!this.startDate) {
       //   return false;
       //   return false;
       // }
       // }
+
+      if (this.formState.beginDate) {
+        return !(
+          moment(this.formState.beginDate).subtract(12, "month") < current &&
+          current < moment(this.formState.beginDate).add(12, "month")
+        );
+      }
       if (this.startTime) {
       if (this.startTime) {
         return !(
         return !(
           moment(this.startTime).subtract(12, "month") < current &&
           moment(this.startTime).subtract(12, "month") < current &&
@@ -322,6 +329,7 @@ export default {
       this.getVerification();
       this.getVerification();
     },
     },
     exportExcel() {
     exportExcel() {
+      // delete this.formState.year;
       this.$API.quote
       this.$API.quote
         .exportList({
         .exportList({
           // pageNum: this.pagination.current,
           // pageNum: this.pagination.current,
@@ -366,7 +374,7 @@ export default {
 
 
     async getVerification() {
     async getVerification() {
       this.loading = true;
       this.loading = true;
-
+      // delete this.formState.year;
       this.$API.quote
       this.$API.quote
         .getBigOrderList({
         .getBigOrderList({
           pageNum: this.pagination.current,
           pageNum: this.pagination.current,