From 4bb06192ef938fdaa6d7d7e8f039d9b0f54d604d Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 09 十二月 2024 16:11:56 +0800
Subject: [PATCH] feat:预约,邀请司机去除姓名

---
 pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue |  148 ++++++++++++++++++++++++++++++------------------
 1 files changed, 92 insertions(+), 56 deletions(-)

diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 3b23989..a93abdf 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -30,9 +30,7 @@
 					</view>
 				</view>
 				<view class="filter-condition">
-					<!-- <view class="f-button">
-						<u-button type="primary" :size="'mini'"    @click="download" text="瀵煎嚭璇︽儏"></u-button>
-					</view> -->
+				
 			
 				</view>
 				<view class="date-information">
@@ -100,7 +98,7 @@
 							</view>
 							<view class="third-line">
 								<view class="carnum-icon">
-									<image src="https://mx.jzeg.cn:9096/appimg/image/banner/carNO.png"
+									<image src="https://mr1.res.jzeg.cn:9096/appimg/image/banner/carNO.png"
 										mode="widthFix"></image>
 								</view>
 								<view class="carnum-text">{{ value.carNo || '' }}</view>
@@ -275,6 +273,9 @@
 							:plain="true"
 							shape="circle"
 							@click="resetCondition"></u-button></view>
+							<view class="f-button">
+						<u-button type="primary" :size="'mini'" shape="circle"    @click="download" text="瀵煎嚭璇︽儏"></u-button>
+					</view>
 					<view class="confirm-button"><u-button type="primary"
 							text="纭畾"
 							:plain="true"
@@ -305,6 +306,7 @@
 				forwarderList: [],
 				fleetList: [],
 				filedList: [],
+				btndisbled:false,
 				page:{
 					size:5,
 					current:1,
@@ -333,6 +335,17 @@
 				// 瓒呰繃涓よ鑷姩闅愯棌
 				coalShow: 3,
 				typeShow: 3,
+				filterParams:{
+					coalName:'',//鐓ょ
+					xsUserIdTwo:'',//璐т唬
+					fleetId:'', // 杞﹂槦
+					deptId:'',//鍗曚綅
+					customerId:'' ,// 瀹㈡埛
+					carNo:'',//杞︾墝
+					startTime:'',//璧峰鏃堕棿
+					endTime:'',//缁撴潫鏃堕棿
+
+				},
 				customerShow: 3,
 				forwarderShow: 3,
 				fleetShow: 3,
@@ -526,7 +539,7 @@
 					customerName: this.customerList.filter(v => v.active == true).map(item => item.condition),
 					xsUser2Name: this.forwarderList.filter(v => v.active == true).map(item => item.condition),
 					fleetName: this.fleetList.filter(v => v.active == true).map(item => item.condition),
-					filedName: this.filedList.filter(v => v.active == true).map(item => item.condition),
+					deptName: this.filedList.filter(v => v.active == true).map(item => item.condition),
 					carNo: this.carNoList.filter(v => v.active == true).map(item => item.condition)
 				};
 
@@ -536,7 +549,7 @@
 					customerName: validateFn('customerName'),
 					xsUser2Name: validateFn('xsUser2Name'),
 					fleetName: validateFn('fleetName'),
-					filedName: validateFn('filedName'),
+					deptName: validateFn('deptName'),
 					carNo: validateFn('carNo')
 				};
 				this.filterList = this.taskList.map(val => {
@@ -726,53 +739,79 @@
 			conditinonclose() {
 				this.conditinonShow = false;
 			},
+			//鑾峰彇褰撳墠鏃ユ湡鍑芥暟
+			getNowFormatDate() {
+			let date = new Date(),
+				year = date.getFullYear(), //鑾峰彇瀹屾暣鐨勫勾浠�(4浣�)
+				month = date.getMonth() + 1, //鑾峰彇褰撳墠鏈堜唤(0-11,0浠h〃1鏈�)
+				strDate = date.getDate() // 鑾峰彇褰撳墠鏃�(1-31)
+			if (month < 10) month = `0${month}` // 濡傛灉鏈堜唤鏄釜浣嶆暟锛屽湪鍓嶉潰琛�0
+			if (strDate < 10) strDate = `0${strDate}` // 濡傛灉鏃ユ槸涓綅鏁帮紝鍦ㄥ墠闈㈣ˉ0
+			
+			return `${year}-${month}-${strDate}`
+			},
 			download(){
-				wx.showLoading({
+				let conditionMapping = {
+					coalName: this.coalList.filter(v => v.active == true).map(item => item.condition).join(','), //鐓ょ
+					customerId: this.customerList.filter(v => v.active == true).map(item => item.conditionId).join(','), //  瀹㈡埛
+					xsUserIdTwo: this.forwarderList.filter(v => v.active == true).map(item => item.conditionId).join(','), //璐т唬
+					fleetId: this.fleetList.filter(v => v.active == true).map(item => item.conditionId).join(','),  //杞﹂槦
+					deptId: this.filedList.filter(v => v.active == true).map(item => item.conditionId).join(','), //鐭垮満
+					carNo: this.carNoList.filter(v => v.active == true).map(item => item.condition).join(','), //杞︾墝
+					startTime: this.first ? (this.first + ' ' + '00:00:00') :this.getNowFormatDate() + ' ' + '00:00:00',
+					endTime:  this.last ?  (this.last + ' ' + '23:59:59') : this.getNowFormatDate()  + ' ' + '23:59:59'
+
+				};
+				//濡傛灉璇锋眰鍙傛暟娌″�硷紝鍒欏幓闄�
+				Object.keys(conditionMapping).forEach(item=>{
+					if(!conditionMapping[item]){
+						delete conditionMapping[item]
+					}
+				})
+				uni.showLoading({
 					title: '鍔犺浇涓�',
+					mask:true,
+					});
+					this.$reqGet('downloadExcel',conditionMapping).then(res=>{
+						if(res.data){
+							const hostUrl = res.data.excelAddress.split("/")[res.data.excelAddress.split("/").length - 1]
+							// const hostUrl = res.data.excelAddress;
+							console.log(res.data,hostUrl,'res.data');
+							if(hostUrl){
+								wx.downloadFile({
+								url: `${BaseUrl}/admin/sys-file/getAppTmExcel/${hostUrl}`,
+								filePath:wx.env.USER_DATA_PATH+`/${hostUrl}`,
+								header: {
+									Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
+									CLIENT_TOC: 'Y'
+								},
+								success(res){
+									console.log(res)
+									let data = res.filePath;
+									wx.openDocument({
+									filePath: data,
+									fileType: 'xlsx',
+									showMenu: true  //琛ㄧず鍙充笂瑙掓槸鍚︽湁杞彂鎸夐挳
+									})
+									uni.hideLoading();
+
+								}
 					})
-				    wx.downloadFile({
-						url: `${BaseUrl}/wrzs/tmtaskcoal/tmAppStatisticsExcel`,
-						filePath:wx.env.USER_DATA_PATH+'/test.xlsx',
-						header: {
-							'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app
-							'content-type': 'application/json',
-							'CLIENT_TOC': 'Y',
-							'isToken': 'false'
-						},
-						success(res){
-							console.log(res)
-							let data = res.filePath;
-							wx.openDocument({
-							filePath: data,
-							fileType: 'xlsx',
-							showMenu: true  //琛ㄧず鍙充笂瑙掓槸鍚︽湁杞彂鎸夐挳
+							}
+							uni.hideLoading();
+						
+						}else{
+							uni.hideLoading();
+							uni.showToast({
+								icon: 'none',
+								title: '鎵�閫夋潯浠舵殏鏃犳暟鎹�'
 							})
+							
 						}
-					})
-			// 		console.log(res,'res');
-			        
-
-
-			// 		const fs = wx.getFileSystemManager(); //鍏ㄥ眬鍞竴鐨勬枃浠剁鐞嗗櫒
-			// 		fs.writeFile({
-			// 		filePath: wx.env.USER_DATA_PATH + "/xxx.excel",   //杩欓噷濉枃浠剁殑鍚嶅瓧
-			// 		data: res,
-			// 		encoding: "binary",
-			// 		success(res) {
-			// 			wx.openDocument({  
-			// 				showMenu: true,
-			// 				filePath: wx.env.USER_DATA_PATH + "/xxx.excel",
-			// 				success: function(res) {
-			// 				console.log('鎵撳紑鏂囨。鎴愬姛');
-			// 				}
-			// 			});
-			// 		},
-			// 		fail(res) {
-			// 			console.error(res)
-			// 		}
 					
-            //   })
-
+					}).catch((err) => {
+						uni.hideLoading();
+					})
 			
 			}
 		},
@@ -815,6 +854,7 @@
 					this.first = newV.slice(0, 10);
 					this.last = newV.slice(11);
 					this.getTmTaskCoalData();
+					this.getShipping();
 				}
 			}
 		}
@@ -850,10 +890,11 @@
 	}
 
 	.utils-button {
-		width: 94%;
+		width: 100%;
 		height: vww(30);
 		margin: vww(50) auto;
 		@include flex;
+		justify-content: space-around;
 
 		.reset-button {
 			/deep/ .u-button {
@@ -871,7 +912,7 @@
 		}
 
 		/deep/ .u-button {
-			width: 279rpx;
+			width: 220rpx;
 			height: 60rpx;
 			font-size: 28rpx;
 		}
@@ -993,11 +1034,6 @@
 					width: auto !important;
 					height: 30rpx!important;
 					font-size: 25rpx!important;
-					position: absolute;
-					right: 35rpx;
-					background: #3c9cff;;
-					color: #fff;
-					text-align: center;
 				
 
 				}
@@ -1074,7 +1110,7 @@
 									height: vww(28);
 									line-height: vww(28);
 									text-align: center;
-									background: url('https://mx.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
+									background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/blueblock.png') no-repeat;
 									background-size: contain;
 									font-size: 30rpx;
 									font-weight: 400;
@@ -1131,7 +1167,7 @@
 									// display: flex;
 									// justify-content: center;
 									// align-items: center;
-									background: url('https://mx.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
+									background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
 									background-size: contain;
 									font-size: 30rpx;
 									font-weight: 400;

--
Gitblit v1.9.1