qingyiay
2023-08-03 1dcbea6b70505d7dff0398e50b1ddc286d9b6fe3
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('加载失败')