Browse Source

no message

feature/v1.5
xpz2018 4 years ago
parent
commit
a28a8c233b
1 changed files with 17 additions and 5 deletions
  1. 22
      pages/process/index/index.js

22
pages/process/index/index.js

@ -35,6 +35,11 @@ Component({
availableCreditLine: 0, availableCreditLine: 0,
usedCreditLine: 0 usedCreditLine: 0
}, },
form: {
type: 3,
startTime: '',
endTime: '',
},
vdate: [], vdate: [],
vdateString: '', vdateString: '',
factoryId: '12313K78978KK', factoryId: '12313K78978KK',
@ -70,6 +75,8 @@ Component({
today.setHours(0, 0, 0) today.setHours(0, 0, 0)
var vdate = [today.getTime(), maxDate] var vdate = [today.getTime(), maxDate]
var vdateString = util.formatDate(new Date(), 'Y-M-D') + '至' + util.formatDate(max, 'Y-M-D') 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 height = app.globalData.safeFragmentHeight - 100
var customBar = app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60) var customBar = app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60)
if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){ if(app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0){
@ -119,8 +126,7 @@ Component({
} }
}, },
fetchStatisticsInfo: function(vdate, loading){ 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){ if(Number(result.data.priceOrderNum) > 0){
this.data.tabList[0].badge = Number(result.data.priceOrderNum) this.data.tabList[0].badge = Number(result.data.priceOrderNum)
} else { } else {
@ -184,8 +190,13 @@ Component({
this.trigEvent(9) this.trigEvent(9)
}, },
onSelect: function({detail}) { 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()]) this.fetchStatisticsInfo([start.getTime(), end.getTime()])
}, },
toAuths: function(){ toAuths: function(){
@ -223,7 +234,8 @@ Component({
}, },
onAction: function({detail}){ onAction: function({detail}){
this.setData({ sheetStr: detail.name }) this.setData({ sheetStr: detail.name })
this.data.form.type = detail.id
this.fetchStatisticsInfo()
} }
} }
}) })
Loading…
Cancel
Save