From a8cf1ec3eb69af71833a59c7b0f8adf5c4f5ad48 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期二, 02 七月 2024 16:02:45 +0800
Subject: [PATCH] fix:称重修改bug

---
 pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue |  104 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 99 insertions(+), 5 deletions(-)

diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 96497f4..7c1b748 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -29,7 +29,10 @@
 								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"
@@ -270,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"
@@ -285,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: {
@@ -299,6 +306,7 @@
 				forwarderList: [],
 				fleetList: [],
 				filedList: [],
+				btndisbled:false,
 				page:{
 					size:5,
 					current:1,
@@ -327,6 +335,17 @@
 				// 瓒呰繃涓よ鑷姩闅愯棌
 				coalShow: 3,
 				typeShow: 3,
+				filterParams:{
+					coalName:'',//鐓ょ
+					xsUserIdTwo:'',//璐т唬
+					fleetId:'', // 杞﹂槦
+					deptId:'',//鍗曚綅
+					customerId:'' ,// 瀹㈡埛
+					carNo:'',//杞︾墝
+					startTime:'',//璧峰鏃堕棿
+					endTime:'',//缁撴潫鏃堕棿
+
+				},
 				customerShow: 3,
 				forwarderShow: 3,
 				fleetShow: 3,
@@ -520,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)
 				};
 
@@ -530,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 => {
@@ -719,6 +738,70 @@
 			// 鍏抽棴绛涢�夋潯浠跺脊绐�
 			conditinonclose() {
 				this.conditinonShow = false;
+			},
+			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 + ' ' + '00:00:00',
+					endTime:this.last + ' ' + '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/local/${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: {
@@ -760,6 +843,7 @@
 					this.first = newV.slice(0, 10);
 					this.last = newV.slice(11);
 					this.getTmTaskCoalData();
+					this.getShipping();
 				}
 			}
 		}
@@ -795,10 +879,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 {
@@ -816,7 +901,7 @@
 		}
 
 		/deep/ .u-button {
-			width: 279rpx;
+			width: 220rpx;
 			height: 60rpx;
 			font-size: 28rpx;
 		}
@@ -931,7 +1016,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 {

--
Gitblit v1.9.1