From a28a8c233b57c7f23be8e92a1d021578baba4415 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Mon, 17 May 2021 21:01:26 +0800 Subject: [PATCH] no message --- pages/process/index/index.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pages/process/index/index.js b/pages/process/index/index.js index a5003bf..fd3270e 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -35,6 +35,11 @@ Component({ availableCreditLine: 0, usedCreditLine: 0 }, + form: { + type: 3, + startTime: '', + endTime: '', + }, vdate: [], vdateString: '', factoryId: '12313K78978KK', @@ -70,6 +75,8 @@ Component({ today.setHours(0, 0, 0) var vdate = [today.getTime(), maxDate] var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') + this.data.form.startTime = util.formatDate(today, 'Y-M-D') + ' 00:00:00' + this.data.form.endTime = util.formatDate(max, 'Y-M-D') + ' 00:00:00' var height = app.globalData.safeFragmentHeight - 100 var customBar = app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60) if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){ @@ -119,8 +126,7 @@ Component({ } }, fetchStatisticsInfo: function(vdate, loading){ - var param = {startTime: util.formatTime(new Date(vdate[0]), 'Y-M-D'), endTime: util.formatTime(new Date(vdate[1]), 'Y-M-D')} - getStatisticsInfo(param).then(result => { + getStatisticsInfo(this.data.form).then(result => { if(Number(result.data.priceOrderNum) > 0){ this.data.tabList[0].badge = Number(result.data.priceOrderNum) } else { @@ -184,8 +190,13 @@ Component({ this.trigEvent(9) }, onSelect: function({detail}) { - const [start, end] = detail - this.onClose() + var start = new Date(detail[0]) + var end = new Date(detail[1]) + var vdateString = util.formatDate(start, 'Y-M-D') + '至' + util.formatDate(end, 'Y-M-D') + this.data.form.startTime = util.formatDate(start, 'Y-M-D') + ' 00:00:00' + this.data.form.endTime = util.formatDate(end, 'Y-M-D') + ' 00:00:00' + this.setData({ show: false, vdateString }) + this.trigEvent(9) this.fetchStatisticsInfo([start.getTime(), end.getTime()]) }, toAuths: function(){ @@ -223,7 +234,8 @@ Component({ }, onAction: function({detail}){ this.setData({ sheetStr: detail.name }) - + this.data.form.type = detail.id + this.fetchStatisticsInfo() } } }) \ No newline at end of file