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 |  257 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 229 insertions(+), 28 deletions(-)

diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 5bacd28..a93abdf 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -29,17 +29,27 @@
 								size="50"></u-icon></view>
 					</view>
 				</view>
-				<view class="filter-condition"></view>
+				<view class="filter-condition">
+				
+			
+				</view>
 				<view class="date-information">
 					<u-empty mode="data"
 						icon="http://cdn.uviewui.com/uview/empty/data.png"
 						textSize="30"
 						iconSize="1000"
+						text="鏆傛棤鏁版嵁"
 						v-if="filterList.length == 0"></u-empty>
+						<scroll-view
+						scroll-y
+						class="scroll-box"
+						:throttle="false"
+						@scrolltolower="handleScrolltolower">
 					<view class="statistics-card"
-						v-for="(item, index) in filterList"
+						v-for="(item, index) in  pageList"
 						:key="index">
-						<view class="card-top">
+						<statisticsItem :item="item"></statisticsItem>
+						<!-- <view class="card-top">
 							<view class="left"><combined-title :title="item.condition"></combined-title></view>
 							<view class="card-top_num">
 								{{ item.taskCoalList.length }}杞�
@@ -49,8 +59,8 @@
                                             return prev + cur.clean;
                                         }, 0)).toFixed(2)}}鍚�
 							</view>
-						</view>
-						<view class="card-main"
+						</view> -->
+						<!-- <view class="card-main"
 							v-for="(value, i) in item.taskCoalList"
 							:key="i"
 							@click="faYunDetail(value.id)">
@@ -85,12 +95,10 @@
 									<view class="coal-type"
 										v-if="value.orderType">{{ value.orderType }}</view>
 								</view>
-								<!-- <view class="black-block"><view class="black-bar"></view></view>
-								<view class="coal-type">{{ value.orderType }}</view> -->
 							</view>
 							<view class="third-line">
 								<view class="carnum-icon">
-									<image src="https://mx.jzeg.cn:9095/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>
@@ -101,8 +109,9 @@
 										size="28"></u-icon></view>
 								<view class="send-date">{{ value.sendDate }}</view>
 							</view>
-						</view>
+						</view> -->
 					</view>
+				</scroll-view>
 				</view>
 			</view>
 			<u-popup :show="conditinonShow"
@@ -264,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"
@@ -279,6 +291,7 @@
 
 <script>
 	import BigNumber from "bignumber.js"
+	import { BaseUrl } from '@/api/publicInterface.js'
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
 	export default {
 		components: {
@@ -293,6 +306,13 @@
 				forwarderList: [],
 				fleetList: [],
 				filedList: [],
+				btndisbled:false,
+				page:{
+					size:5,
+					current:1,
+					total:1,
+
+				},
 				carNoList: [],
 				isactive: false,
 				info: {
@@ -309,11 +329,23 @@
 				filterList: [],
 				totalLength: 0,
 				totalTon: 0,
+				pageFlag:false, // 鏄惁闇�瑕佸垎椤�
 				// 绛涢�夊脊鍑哄眰
 				conditinonShow: false,
 				// 瓒呰繃涓よ鑷姩闅愯棌
 				coalShow: 3,
 				typeShow: 3,
+				filterParams:{
+					coalName:'',//鐓ょ
+					xsUserIdTwo:'',//璐т唬
+					fleetId:'', // 杞﹂槦
+					deptId:'',//鍗曚綅
+					customerId:'' ,// 瀹㈡埛
+					carNo:'',//杞︾墝
+					startTime:'',//璧峰鏃堕棿
+					endTime:'',//缁撴潫鏃堕棿
+
+				},
 				customerShow: 3,
 				forwarderShow: 3,
 				fleetShow: 3,
@@ -326,11 +358,12 @@
 				fleetToggeleState: false,
 				filedToggeleState: false,
 				carNoToggeleState: false,
+				pageList:[],
 				// 鐐瑰嚮鍙崇澶磋鎯呭脊绐�
 				faYunDetailobj: {},
 				modalShow: false,
 				coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
-					'杩涘叆鍦洪櫌'
+					'杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓'
 				]
 			};
 		},
@@ -422,11 +455,31 @@
 			},
 			// 鑾峰彇鏁版嵁
 			getTmTaskCoalData() {
+				this.page.current = 1; //杩樺師鍒嗛〉
+				this.filterList =  [],this.pageList = [];
 				uni.showLoading({
 					title: '鍔犺浇涓�'
 				});
 				this.$reqGet('getTmTaskCoalData', { startTime: this.first, endTime: this.last }).then(res => {
-					this.filterList = this.taskList = res.data;
+					 this.taskList = res.data;
+					// 婊氬姩鍔犺浇  鍒嗛〉
+					if(res.data.length <=5){
+						this.filterList = res.data;
+						this.pageList = res.data;
+						this.pageFlag = false
+					}else{
+						//澶т簬绛変簬 5 鐨勬儏鍐靛氨寰楀垎椤�
+						this.pageFlag = true;
+						this.filterList = res.data;
+						this.loadMorePage();
+						//   // 鍒嗛〉鐨勮捣濮嬩笅鏍�
+						//  const startIndex = (this.page.current - 1) * this.page.size;
+						// // 鍒嗛〉鐨勬湯灏句笅鏍�
+						// const endIndex = startIndex + this.page.size;
+						// // 杩斿洖鍒囧壊鍚庣殑鏁版嵁
+						// this.filterList =  this.filterList.concat(this.filterList.slice(startIndex, endIndex)) 
+						// this.page.total =  Math.ceil(this.filterList.length / this.page.size);
+					}
 					if (this.filterList.length != 0) {
 						this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
 						this.totalTon = this.filterList.map(v =>
@@ -486,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)
 				};
 
@@ -496,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 => {
@@ -508,6 +561,8 @@
 							mapping[key](v, conditionMapping[key])))
 					};
 				});
+				this.pageList = this.filterList;//璧嬪�肩粰鍒嗛〉鏁扮粍
+				this.pageFlag = false;
 				if (this.filterList.length != 0) {
 					this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
 					this.totalTon = this.filterList.map(v =>
@@ -553,15 +608,54 @@
 				this.filedList.forEach(v => {
 					v.active = false;
 				});
+        this.getTmTaskCoalData()
 			},
 			confirm(e) {
 				console.log(e, '鏃ユ湡閫夋嫨');
 				this.first = e.range.before;
 				this.last = e.range.after;
-				this.conditinonShow = false;
+        this.$nextTick(() => {
+          this.$refs.calendar.close()
+        })
 			},
 			opencalendar() {
 				this.$refs.calendar.open();
+			},
+			loadMorePage(){
+				  // 鍒嗛〉鐨勮捣濮嬩笅鏍�
+						 const startIndex = (this.page.current - 1) * this.page.size;
+						// 鍒嗛〉鐨勬湯灏句笅鏍�
+						const endIndex = startIndex + this.page.size;
+						// 杩斿洖鍒囧壊鍚庣殑鏁版嵁
+						this.pageList.push(...this.filterList.slice(startIndex, endIndex)) 
+						this.page.total =  Math.ceil(this.filterList.length / this.page.size);
+
+			},
+			handleScrolltolower(){
+				console.log('鍒板簳浜�')
+					uni.showLoading({
+					title: '鍔犺浇涓�'
+				});
+				
+				if(this.pageFlag){	
+					if(this.page.current  < this.page.total){
+						 this.page.current = this.page.current + 1;
+						 this.loadMorePage();
+						 console.log( this.page.current + 1,this.page.total,' this.page.current+1;')
+					}else {
+						uni.showToast({
+						title: '宸茬粡鍒板簳鍟�',
+					     duration: 1000
+					});
+					}
+				
+					// this.getTmTaskCoalData()
+				}
+				setTimeout(() => {
+					uni.hideLoading();	
+				}, 0);
+				
+
 			},
 			// 鐐瑰嚮鏌ョ湅鏇村
 			toggle(value) {
@@ -644,6 +738,81 @@
 			// 鍏抽棴绛涢�夋潯浠跺脊绐�
 			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(){
+				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();
+
+								}
+					})
+							}
+							uni.hideLoading();
+						
+						}else{
+							uni.hideLoading();
+							uni.showToast({
+								icon: 'none',
+								title: '鎵�閫夋潯浠舵殏鏃犳暟鎹�'
+							})
+							
+						}
+					
+					}).catch((err) => {
+						uni.hideLoading();
+					})
+			
 			}
 		},
 		computed: {
@@ -685,6 +854,7 @@
 					this.first = newV.slice(0, 10);
 					this.last = newV.slice(11);
 					this.getTmTaskCoalData();
+					this.getShipping();
 				}
 			}
 		}
@@ -710,7 +880,9 @@
 	::v-deep .toggle-button .u-button {
 		width: vww(40);
 	}
-
+    .scroll-box{
+		height: 1500rpx;
+	}
 	.scroll-Y {
 		height: 1000rpx;
 		position: relative;
@@ -718,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 {
@@ -739,7 +912,7 @@
 		}
 
 		/deep/ .u-button {
-			width: 279rpx;
+			width: 220rpx;
 			height: 60rpx;
 			font-size: 28rpx;
 		}
@@ -854,7 +1027,16 @@
 				height: 54rpx;
 				background: #f5f5f5;
 				@include flex;
+				justify-content: end;
 				margin-top: vww(15);
+				position: relative;
+				.f-button{
+					width: auto !important;
+					height: 30rpx!important;
+					font-size: 25rpx!important;
+				
+
+				}
 			}
 
 			.date-information {
@@ -863,13 +1045,13 @@
 				border-radius: 20rpx;
 
 				.statistics-card {
-					width: 100%;
-					min-height: vww(120);
-					@include flex;
-					flex-direction: column;
-					margin-top: vww(5);
-					margin-bottom: vww(5);
-					overflow: hidden;
+					// width: 100%;
+					// min-height: vww(120);
+					// @include flex;
+					// flex-direction: column;
+					// margin-top: vww(5);
+					// margin-bottom: vww(5);
+					// overflow: hidden; // 鑷畾涔夌粍浠� 宸叉湁璇ユ牱寮忥紝璇ユ牱寮忎細瀵艰嚧鏍峰紡娣蜂贡
 
 					&:last-child {
 						.card-main {
@@ -904,7 +1086,8 @@
 						margin-left: vww(20);
 						padding-bottom: vww(12);
 						position: relative;
-						@include flex flex-direction: column;
+						@include flex;
+						flex-direction: column;
 						align-items: flex-start;
 
 						.first-line {
@@ -927,12 +1110,19 @@
 									height: vww(28);
 									line-height: vww(28);
 									text-align: center;
-									background: url('https://mx.jzeg.cn:9095/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;
 									color: #ffffff;
 									margin-right: vww(20);
+								}
+
+								.filedname {
+									white-space: nowrap;
+									overflow: hidden;
+									text-overflow: ellipsis;
+									flex: 1;
 								}
 							}
 
@@ -960,6 +1150,7 @@
 						.first-extra {
 							@include firstLine;
 							height: vww(32);
+							align-items: center;
 
 							.main-information {
 								width: 100%;
@@ -973,12 +1164,22 @@
 									height: vww(28);
 									line-height: vww(28);
 									text-align: center;
-									background: url('https://mx.jzeg.cn:9095/appimg/image/banner/redblock.png') no-repeat;
+									// display: flex;
+									// justify-content: center;
+									// align-items: center;
+									background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/redblock.png') no-repeat;
 									background-size: contain;
 									font-size: 30rpx;
 									font-weight: 400;
 									color: #ffffff;
 									margin-right: vww(20);
+								}
+
+								.filedname {
+									white-space: nowrap;
+									overflow: hidden;
+									text-overflow: ellipsis;
+									flex: 1;
 								}
 							}
 						}
@@ -1180,4 +1381,4 @@
 		// 	}
 		// }
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1