Parcourir la source

修改基础资料的时间筛选

caojunjie il y a 3 ans
Parent
commit
ac99b424e1

+ 4 - 3
src/views/basicData/basicFeesType/configuration/mainList.json

@@ -29,10 +29,11 @@
     },
     {
       "label": "创建时间",
-      "prop": "createTime",
+      "prop": "createTimeA",
       "type": "date",
-      "format": "yyyy-MM-dd hh:mm:ss",
-      "valueFormat": "yyyy-MM-dd hh:mm:ss",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "searchRange":true,
       "search": true,
       "editDisplay":false,
       "index": 2,

+ 19 - 4
src/views/basicData/basicFeesType/index.vue

@@ -46,7 +46,8 @@ export default {
         pageSize: 10,
         pagerCount: 5,
         total: 0,
-      }
+      },
+      query:{}
     }
   },
   created() {
@@ -136,6 +137,7 @@ export default {
     //点击搜索按钮触发
     searchChange(params, done) {
       this.page.currentPage = 1;
+      this.query = params;
       params.parentId = 0
       this.onLoad(this.page, params);
       done()
@@ -155,9 +157,22 @@ export default {
     refreshChange() {
       console.log('1')
     },
-    onLoad(page, params = {parentId:0}) {
-      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage})
-      customerList(queryParams).then(res => {
+    onLoad(page, params = {}) {
+      const {createTimeA} = this.query;
+      let values = {
+        ...params,
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + ' 00:00:00',
+          endTime: createTimeA[1] + ' 23:59:59',
+          ...this.query
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0
+      customerList(values).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
       })

+ 4 - 3
src/views/basicData/commodityCategory/configuration/mainList.json

@@ -29,11 +29,12 @@
     },
     {
       "label": "创建时间",
-      "prop": "createTime",
+      "prop": "createTimeA",
       "type": "date",
-      "format": "yyyy-MM-dd hh:mm:ss",
-      "valueFormat": "yyyy-MM-dd hh:mm:ss",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
       "search": true,
+      "searchRange":true,
       "editDisplay":false,
       "index": 2,
       "width": 100,

+ 20 - 4
src/views/basicData/commodityCategory/index.vue

@@ -46,7 +46,8 @@ export default {
         pageSize: 10,
         pagerCount: 5,
         total: 0,
-      }
+      },
+      query:{}
     }
   },
   created() {
@@ -133,6 +134,7 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
+      this.query = params;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done()
@@ -152,9 +154,23 @@ export default {
     refreshChange() {
       console.log('1')
     },
-    onLoad(page, params = {parentId:0}) {
-      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,parentId:0})
-      customerList(queryParams).then(res => {
+    onLoad(page, params = {}) {
+
+      const {createTimeA} = this.query;
+      let values = {
+        ...params,
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + ' 00:00:00',
+          endTime: createTimeA[1] + ' 23:59:59',
+          ...this.query
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0
+      customerList(values).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
       })

+ 5 - 1
src/views/basicData/customerCategory/configuration/mainList.json

@@ -29,10 +29,14 @@
     },
     {
       "label": "创建时间",
-      "prop": "createTime",
+      "prop": "createTimeA",
       "type": "date",
       "format": "yyyy-MM-dd",
       "valueFormat": "yyyy-MM-dd",
+      "searchRange":true,
+      "hide": true,
+      "addDisplay": false,
+      "viewDisplay": false,
       "search": true,
       "editDisplay":false,
       "index": 2,

+ 20 - 4
src/views/basicData/customerCategory/index.vue

@@ -46,7 +46,8 @@ export default {
         pageSize: 10,
         pagerCount: 5,
         total: 0,
-      }
+      },
+      query:{}
     }
   },
   created() {
@@ -131,6 +132,7 @@ export default {
     },
     //点击搜索按钮触发
     searchChange(params, done) {
+      this.query = params;
       this.page.currentPage = 1;
       params.parentId = 0
       this.onLoad(this.page, params);
@@ -151,9 +153,23 @@ export default {
     refreshChange() {
       console.log('1')
     },
-    onLoad(page, params = {parentId:0}) {
-      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage})
-      customerList(queryParams).then(res => {
+    onLoad(page, params = {}) {
+      const {createTimeA} = this.query;
+      let values = {
+        ...params,
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + ' 00:00:00',
+          endTime: createTimeA[1] + ' 23:59:59',
+          ...this.query
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0
+      console.log(values)
+      customerList(values).then(res => {
         console.log(res.data.data.records)
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total