From 3a57b78e4de42dbb934d3ecf12006c47f1ff52de Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期一, 30 十二月 2024 10:36:18 +0800 Subject: [PATCH] feat:临时司机填原发限制&分配吨数输入框修改类型 --- pages/loadUnload-page/historyOrder/index.vue | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pages/loadUnload-page/historyOrder/index.vue b/pages/loadUnload-page/historyOrder/index.vue index 8d562a7..dc63a64 100644 --- a/pages/loadUnload-page/historyOrder/index.vue +++ b/pages/loadUnload-page/historyOrder/index.vue @@ -330,6 +330,7 @@ let m = new Date().getMonth() + 1; //鑾峰彇鏈堜唤 let d = new Date().getDate(); //鑾峰彇褰撳ぉ鏃ユ湡 m = m < 10 ? '0' + m : m; //鏈堜唤琛� 0 + d = d < 10 ? '0' + d : d; //鏃ユ暟琛� 0 this.first = [y, m, d].join('-') + ' ' + '00:00:00'; this.dateParams.startTime = [y, m, d].join('-') ; this.firstFilter = [y, m, d].join('-') @@ -411,7 +412,7 @@ 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: decodeURIComponent(this.first) , endTime:decodeURIComponent(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){ @@ -552,6 +553,7 @@ customerName: this.customerList.filter(v => v.active == true).map(item => item.name), bunkerName:this.bunnkerList.filter(v => v.active == true).map(item => item.name), }; + console.log(this.coalList,this.bunnkerList,this.customerList,'list') const mapping = { productName: validateFn('productName'), @@ -580,9 +582,9 @@ return item; }) console.log(tempArr,'temp') - this.totalLength = tempArr.reduce((x, y) => x + y.carNum,0); - this.totalTon = tempArr.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2); - this.tmNum = tempArr.reduce((x, y) => x + y.number,0); + // this.totalLength = tempArr.reduce((x, y) => x + y.carNum,0); + // this.totalTon = tempArr.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2); + // this.tmNum = tempArr.reduce((x, y) => x + y.number,0); // this.totalTon = this.filterList.map(v => // v.taskCoalList.reduce((prev, cur) => { @@ -590,6 +592,12 @@ // return cleanvalue + prev // }, 0) // ); + this.totalLength = this.filterList.map(v => v.tmTaskCoalList.length).reduce((x, y) => x + y); // 杞︽暟 + const tonList = this.filterList.map(item=>item.tmTaskCoalList.filter(item=>item.isWeight === 1)).flat(1); + const tmNumList = this.filterList.map(item=>item.tmTaskCoalList.filter(item=>item.isWeight !== 1)).flat(1); + this.totalTon = tonList.reduce((x,y)=>new BigNumber(x).plus(new BigNumber(y.clean)).toFixed(2),0) + this.tmNum = tmNumList.reduce((x,y)=>new BigNumber(x).plus(new BigNumber(y.productQuantity)),0) + console.log(this.filterList,this.totalTon,'totalTon') // this.totalTon = this.filterList.map(item=>) // this.totalTon = this.filterList.map(v=>v.tmTaskCoalList.filter(item=>item.isWeight === 1).reduce((x,y)=>x.weight + y.weight)); -- Gitblit v1.9.1