From 1dcbea6b70505d7dff0398e50b1ddc286d9b6fe3 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期四, 03 八月 2023 17:31:04 +0800 Subject: [PATCH] 称重修改错误 --- pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue index fc51194..7a5cade 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue @@ -176,7 +176,7 @@ :loading="isConfirmWeighLoading" loadingText="纭" @click="confirmWeigh" - v-show="!historyBtn"></u-button> + v-if="!historyBtn"></u-button> <u-button type="primary" text="杩斿洖鍔犲噺鍚�" :disabled="addAndSubtractCoalDisabled" @@ -185,7 +185,7 @@ v-if="outBuy"></u-button> </view> <view style="width: 200rpx;margin: auto;position: relative;" - v-if="!historyBtn"><u-button type="primary" + v-if="historyBtn"><u-button type="primary" text="鏄剧ず鍘嗗彶鐨噸" @click.stop="displayHistory"></u-button></view> <Transition name="slide-fade"> @@ -247,6 +247,7 @@ import { webSocketUrl } from '@/api/request.js'; import { mapState, mapMutations } from 'vuex'; import combinedTitle from '@/components/combined-title/combined-title.vue'; + import BigNumber from "bignumber.js" export default { onLoad(params) { this.takeCoalId = params.takeCoalId; @@ -341,11 +342,7 @@ '杞嚭') { if (this.weighList.skin == 0) { this.temporaryWeighObj.skin = newV; - this.getAverageSkin() - if (this.avgSkin < newV) { - this.abnormalModalShow = true - this.historyBtn = true - } + this.getAverageSkin(newV) } else { this.temporaryWeighObj.hair = newV; this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed( @@ -360,11 +357,7 @@ this.temporaryWeighObj.hair = newV; } else { this.temporaryWeighObj.skin = newV; - this.getAverageSkin() - if (this.avgSkin < newV) { - this.abnormalModalShow = true - this.historyBtn = true - } + this.getAverageSkin(newV) this.temporaryWeighObj.clean = (this.weighList.hair - this.temporaryWeighObj.skin).toFixed( 2); this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this @@ -555,7 +548,7 @@ this.isInputOrigin = true; } }, - getAverageSkin() { + getAverageSkin(weigh) { uni.showLoading({ title: "鍔犺浇涓�" }) @@ -564,6 +557,13 @@ uni.hideLoading() this.avgSkin = res.data.avgSkin this.tmTaskCoalList = res.data.tmTaskCoalList + let xx = new BigNumber(this.avgSkin) + let yy = new BigNumber(weigh) + console.log(weigh, this.avgSkin, yy.minus(xx).toNumber()); + if (xx.minus(yy).toNumber() <= 0.2) { + this.abnormalModalShow = true + this.historyBtn = true + } } else { uni.hideLoading() this.$u.toast('鍔犺浇澶辫触') -- Gitblit v1.9.1