From da15c79ba9a9c3baba16209a50f7d0fe00028e7b Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期二, 12 十一月 2024 14:15:18 +0800
Subject: [PATCH] feat:库管历史收发单时间参数加转译

---
 pages/loadUnload-page/historyOrder/index.vue |   81 +++++++++++++++++++++++++++++-----------
 1 files changed, 58 insertions(+), 23 deletions(-)

diff --git a/pages/loadUnload-page/historyOrder/index.vue b/pages/loadUnload-page/historyOrder/index.vue
index 2291e0b..fcfefd2 100644
--- a/pages/loadUnload-page/historyOrder/index.vue
+++ b/pages/loadUnload-page/historyOrder/index.vue
@@ -118,7 +118,7 @@
 										<text>璁″垝閲忥細{{ value.planMeasure  ?value.planMeasure  :'鏆傛棤'}}</text>
 										</view>
 										<view class="productName">
-										<text>瀹為檯閲忥細{{value.realityMeasure ? value.realityMeasure  : '鏆傛棤'}}</text>
+										<text>瀹為檯閲忥細{{value.productQuantity ? value.productQuantity  : '鏆傛棤'}}</text>
 										</view>
 									</view>
 							</view>
@@ -248,7 +248,7 @@
 			return {
 				conditionList: [],
 				coalList: [],
-				proType:['鏁h','娑叉埃鐡惰','缃愯','PVC25','PVC80','PVC1150','PVc1200'],
+				proType:['鏁h','娑叉隘鐡惰','缃愯','PVC25','PVC80','PVC1150','PVc1200'],
 				bunnkerList:[],
 				typeList: [],
 				customerList: [],
@@ -266,6 +266,11 @@
 				},
 				first: '',
 				last: '',
+				dateParams:{
+					startTime:'',
+					endTime:"",
+
+				},
 				firstFilter: '',
 				lastFilter: '',
 				taskList: [],
@@ -305,24 +310,38 @@
 			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('-');
 			},
 			// 绛涢�夋潯浠�
@@ -392,13 +411,25 @@
 				uni.showLoading({
 					title: '鍔犺浇涓�'
 				});
-				this.$reqGet('getHistoryTaskCoalList', { startTime: this.first, endTime: this.last,bunkerIds:this.bunkerIds,userId:this.userId }).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;
+					this.filterList = this.taskList = res.data.map(item=>{
+						if(!item.carNum){
+							item.carNum = 0;
+						}
+						if(!item.weight){
+							item.weight = 0;
+						}
+						if(!item.number){
+							item.number = 0;
+						}
+						return item;
+					});
 					// this.totalLength = res.data.carNum;
 					// this.totalTon = res.data.weight;
 					// this.tmNum =  res.data.number;
 					if (this.filterList.length != 0) {
+						console.log(this.filterList,'fis')
 						this.totalLength = 	this.filterList.reduce((x, y) => x + y.carNum,0);
 						this.totalTon = this.filterList.reduce((x, y) => new BigNumber(x).plus( y.weight),0).toFixed(2);
 						this.tmNum = this.filterList.reduce((x, y) => x + y.number,0);
@@ -604,8 +635,11 @@
 			},
 			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()
         })
@@ -706,8 +740,8 @@
 			// 鍏抽棴绛涢�夋潯浠跺脊绐�
 			conditinonclose() {
 				this.conditinonShow = false;
-			}
-		},
+			},
+					},
 		computed: {
 			roleType() {
 				return uni.getStorageSync('roleType');
@@ -716,7 +750,7 @@
 				return `${this.firstFilter}鑷�${this.lastFilter}`;
 			},
 			dateselect() {
-				return `${this.first}鑷�${this.last}`;
+				return `${this.dateParams.startTime}鑷�${this.dateParams.endTime}`;
 			},
 			coalTotal() {
 				return this.coalList.length;
@@ -769,14 +803,15 @@
 			// }
 		},
 		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>

--
Gitblit v1.9.1