| | |
| | | }, |
| | | first: '', |
| | | last: '', |
| | | dateParams:{ |
| | | startTime:'', |
| | | endTime:"", |
| | | |
| | | }, |
| | | firstFilter: '', |
| | | lastFilter: '', |
| | | taskList: [], |
| | |
| | | this.getTmTaskCoalData(); |
| | | }, |
| | | onLoad() { |
| | | this.firstDate(); |
| | | this.lastDate(); |
| | | |
| | | }, |
| | | onPullDownRefresh () { |
| | | //调用获取数据方法 |
| | | this.getTmTaskCoalData(); |
| | | //结束下拉刷新 |
| | | this.$nextTick(()=>{ |
| | | uni.stopPullDownRefresh(); |
| | | }) |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | firstDate() { |
| | | let y = new Date().getFullYear(); //获取年份 |
| | | let m = new Date().getMonth() + 1; //获取月份 |
| | | let d = '01'; |
| | | m = m < 10 ? '0' + m : m; //月份补 0 |
| | | this.first = [y, m, d].join('-'); |
| | | this.firstFilter = [y, m, d].join('-'); |
| | | let d = new Date().getDate(); //获取当天日期 |
| | | m = m < 10 ? '0' + m : m; //月份补 0 |
| | | this.first = [y, m, d].join('-') + ' ' + '00:00:00'; |
| | | this.dateParams.startTime = [y, m, d].join('-') ; |
| | | this.firstFilter = [y, m, d].join('-') |
| | | }, |
| | | lastDate() { |
| | | let y = new Date().getFullYear(); //获取年份 |
| | | let m = new Date().getMonth() + 1; //获取月份 |
| | | let d = new Date(y, m, 0).getDate(); //获取当月最后一日 |
| | | let d = new Date().getDate(); //获取当月最后一日 |
| | | m = m < 10 ? '0' + m : m; //月份补 0 |
| | | d = d < 10 ? '0' + d : d; //日数补 0 |
| | | this.last = [y, m, d].join('-'); |
| | | this.last = [y, m, d].join('-') +' ' + '23:59:59'; |
| | | this.dateParams.endTime = [y, m, d].join('-') ; |
| | | this.lastFilter = [y, m, d].join('-'); |
| | | }, |
| | | // 筛选条件 |
| | |
| | | uni.showLoading({ |
| | | title: '加载中' |
| | | }); |
| | | this.$reqGet('getHistoryTaskCoalList', { startTime: this.first, endTime: this.last,bunkerIds:this.bunkerIds,productIds:uni.getStorageSync('productIds') }).then(res => { |
| | | this.$reqGet('getHistoryTaskCoalList', { startTime: this.first , endTime:this.last ,bunkerIds:this.bunkerIds,productIds:uni.getStorageSync('productIds') }).then(res => { |
| | | console.log(res.data,'res.data'); |
| | | this.filterList = this.taskList = res.data.map(item=>{ |
| | | if(!item.carNum){ |
| | |
| | | }, |
| | | confirm(e) { |
| | | console.log(e, '日期选择'); |
| | | this.first = e.range.before; |
| | | this.last = e.range.after; |
| | | this.first = e.range.before + ' ' + '00:00:00'; |
| | | this.dateParams.startTime = e.range.before; |
| | | this.last = e.range.after + ' ' + '23:59:59' ; |
| | | this.dateParams.endTime = e.range.after; |
| | | this.getTmTaskCoalData(); |
| | | this.$nextTick(() => { |
| | | this.$refs.calendar.close() |
| | | }) |
| | |
| | | // 关闭筛选条件弹窗 |
| | | conditinonclose() { |
| | | this.conditinonShow = false; |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | computed: { |
| | | roleType() { |
| | | return uni.getStorageSync('roleType'); |
| | |
| | | return `${this.firstFilter}至${this.lastFilter}`; |
| | | }, |
| | | dateselect() { |
| | | return `${this.first}至${this.last}`; |
| | | return `${this.dateParams.startTime}至${this.dateParams.endTime}`; |
| | | }, |
| | | coalTotal() { |
| | | return this.coalList.length; |
| | |
| | | // } |
| | | }, |
| | | watch: { |
| | | dateselect(newV, old) { |
| | | let tempDate = `${this.first}至${this.last}`; |
| | | if (newV != old && old != '至') { |
| | | this.first = newV.slice(0, 10); |
| | | this.last = newV.slice(11); |
| | | this.getTmTaskCoalData(); |
| | | } |
| | | } |
| | | // dateselect(newV, old) { |
| | | // console.log(newV,'old') |
| | | // let tempDate = `${this.first}至${this.last}`; |
| | | // if (newV != old && old != '至') { |
| | | // this.first = newV.slice(0, 10); |
| | | // this.last = newV.slice(11); |
| | | // // this.getTmTaskCoalData(); |
| | | // } |
| | | // }, |
| | | } |
| | | }; |
| | | </script> |