From 6cb6a76d779335f8bc9f1e2a3431b2903558a075 Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期三, 20 十二月 2023 09:50:28 +0800 Subject: [PATCH] 验质扣罚金额bugFix --- pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue | 55 ++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 36 insertions(+), 19 deletions(-) diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue index 17f7386..23d8de2 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> @@ -35,6 +35,7 @@ icon="http://cdn.uviewui.com/uview/empty/data.png" textSize="30" iconSize="1000" + text="鏆傛棤鏁版嵁" v-if="filterList.length == 0"></u-empty> <view class="statistics-card" v-for="(item, index) in filterList" @@ -42,13 +43,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 +66,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"> @@ -88,6 +88,10 @@ </view> <!-- <view class="black-block"><view class="black-bar"></view></view> <view class="coal-type">{{ value.orderType }}</view> --> + </view> + <view class="third-line"> + <text class="carnum-text" style="font-size: 28rpx;">鍒涘缓鏃堕棿锛�</text> + <view class="carnum-text">{{ value.createTime || '' }}</view> </view> <view class="third-line"> <view class="carnum-icon"> @@ -207,7 +211,7 @@ </view> </view> <view class="filter-body" - v-if="roleType != 3"> + v-if="roleType === 2||roleType === 1"> <view class="condition-name">杞﹂槦</view> <view class="filter-name"> <view class="filter-button" @@ -223,7 +227,8 @@ </view> --> </view> </view> - <view class="filter-body"> + <view class="filter-body" + v-if="roleType != 4"> <view class="condition-name">浠撳簱</view> <view class="filter-name"> <view class="filter-button" @@ -240,7 +245,7 @@ </view> </view> <view class="filter-body" - v-if="roleType == 2"> + v-if="roleType == 2||roleType == 4"> <view class="condition-name">杞︾墝鍙�</view> <view class="filter-name"> <view class="filter-button" @@ -272,13 +277,14 @@ @click="confirmCondition"></u-button></view> </view> </u-popup> - <tab-bar :current="roleType===4?2:1"></tab-bar> + <tab-bar :current="roleType===4?1: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 { @@ -330,11 +336,11 @@ // 鐐瑰嚮鍙崇澶磋鎯呭脊绐� faYunDetailobj: {}, modalShow: false, - coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚', '楠岃川瀹屾垚'], + coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚', '澶勭悊瀹屾垚'], onlineurl, }; }, - onShow() { + onLoad() { this.firstDate(); this.lastDate(); this.getShipping(); @@ -431,10 +437,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; @@ -507,10 +518,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; @@ -624,7 +640,7 @@ // 璺宠浆鍙戣繍璇︽儏 faYunDetail(takeCoalId) { uni.navigateTo({ - url: `/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails?id=${takeCoalId}` + url: `/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail?orderPlanId=${takeCoalId}&flag=${true}` }); }, // 鎵撳紑绛涢�夋潯浠跺脊绐� @@ -675,6 +691,7 @@ this.first = newV.slice(0, 10); this.last = newV.slice(11); this.getTmTaskCoalData(); + this.getShipping(); } } } @@ -1010,7 +1027,7 @@ } .third-line { - width: 40%; + width: 80%; min-height: vww(15); display: flex; justify-content: flex-start; -- Gitblit v1.9.1