From f3288edb3b2f0e0e89cc28d719a1f83462459f33 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 26 七月 2023 17:22:16 +0800
Subject: [PATCH] 修改发运统计错误

---
 pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index 4050d30..546ebb2 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -10,7 +10,7 @@
 							<view class="content-num">鍙戣繍杞︽暟</view>
 						</view>
 						<view class="content-text">
-							<view class="content-container">{{ totalTon.toFixed(2) }}</view>
+							<view class="content-container">{{totalTon}}</view>
 							<view class="content-num">鍙戣繍鍚ㄦ暟</view>
 						</view>
 					</view>
@@ -42,13 +42,12 @@
 						<view class="card-top">
 							<view class="left"><combined-title :title="item.condition"></combined-title></view>
 							<view class="card-top_num">
-								{{ item.taskCoalList.length }}杞{
-									item.taskCoalList
+								{{ item.taskCoalList.length }}杞�
+								{{Number(item.taskCoalList
 										.reduce((prev, cur) => {
+											cur.clean=cur.clean||0
 											return prev + cur.clean;
-										}, 0)
-										.toFixed(2)
-								}}鍚�
+										}, 0)).toFixed(2)}}鍚�
 							</view>
 						</view>
 						<view class="card-main"
@@ -66,7 +65,7 @@
 									</view>
 								</view>
 								<view class="main-divider"></view>
-								<view class="point-number">{{ value.clean.toFixed(2) || 0 }}</view>
+								<view class="point-number">{{ Number(value.clean).toFixed(2) || 0 }}</view>
 							</view>
 							<view class="first-extra">
 								<view class="main-information">
@@ -91,7 +90,7 @@
 							</view>
 							<view class="third-line">
 								<view class="carnum-icon">
-									<image src="https://mx.jzeg.cn:9095/appimg/image/banner/carNO.png"
+									<image :src="`${onlineurl}/appimg/image/banner/carNO.png`"
 										mode="widthFix"></image>
 								</view>
 								<view class="carnum-text">{{ value.carNo || '' }}</view>
@@ -134,7 +133,7 @@
 							</view>
 						</view>
 						<view class="filter-body">
-							<view class="condition-name">鐓ょ</view>
+							<view class="condition-name">鍝佺</view>
 							<view class="filter-name">
 								<view class="filter-button"
 									v-for="(item, index) in coalList"
@@ -224,7 +223,7 @@
 							</view>
 						</view>
 						<view class="filter-body">
-							<view class="condition-name">鐭垮満</view>
+							<view class="condition-name">浠撳簱</view>
 							<view class="filter-name">
 								<view class="filter-button"
 									v-for="(item, index) in filedList"
@@ -272,14 +271,16 @@
 							@click="confirmCondition"></u-button></view>
 				</view>
 			</u-popup>
-			<tab-bar :current="1"></tab-bar>
+			<tab-bar :current="roleType===4?2:1"></tab-bar>
 		</view>
 		<view class="white-block"></view>
 	</view>
 </template>
 
 <script>
+	import BigNumber from "bignumber.js"
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
+	import { onlineurl } from '@/api/request.js'
 	export default {
 		components: {
 			combinedTitle
@@ -329,7 +330,8 @@
 				// 鐐瑰嚮鍙崇澶磋鎯呭脊绐�
 				faYunDetailobj: {},
 				modalShow: false,
-				coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚']
+				coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚', '楠岃川瀹屾垚'],
+				onlineurl,
 			};
 		},
 		onShow() {
@@ -429,10 +431,15 @@
 						this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
 						this.totalTon = this.filterList.map(v =>
 							v.taskCoalList.reduce((prev, cur) => {
-								return cur.clean + prev;
+								const cleanvalue = cur.clean || 0
+								return cleanvalue + prev
 							}, 0)
 						);
-						this.totalTon = this.totalTon.reduce((x, y) => x + y);
+						this.totalTon = this.totalTon.reduce((x, y) => {
+							let xx = new BigNumber(x)
+							let yy = new BigNumber(y)
+							return xx.plus(yy).toNumber().toFixed(2)
+						}, new BigNumber(0));
 					} else {
 						this.totalLength = 0;
 						this.totalTon = 0;
@@ -505,10 +512,15 @@
 					this.totalLength = this.filterList.map(v => v.taskCoalList.length).reduce((x, y) => x + y);
 					this.totalTon = this.filterList.map(v =>
 						v.taskCoalList.reduce((prev, cur) => {
-							return cur.clean + prev;
+							const cleanvalue = cur.clean || 0
+							return cleanvalue + prev
 						}, 0)
 					);
-					this.totalTon = this.totalTon.reduce((x, y) => x + y);
+					this.totalTon = this.totalTon.reduce((x, y) => {
+						let xx = new BigNumber(x)
+						let yy = new BigNumber(y)
+						return xx.plus(yy).toNumber().toFixed(2)
+					}, new BigNumber(0));
 				} else {
 					this.totalLength = 0;
 					this.totalTon = 0;

--
Gitblit v1.9.1