yangan
2024-03-22 22bf89749751bf2204ca1d1d30bda9ce7fde3e5b
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -189,8 +189,8 @@
      </view>
      <view v-show="isExceedOrigin"
         style="color: #ff6363;width: auto;margin: 0 auto;">
         <text v-if="weighList.orderType == '外购'">超出原发毛重,磅房人员确认中,请勿离开此页面</text>
         <text v-else>超出最大毛重,磅房人员确认中,请勿离开此页面</text>
         <text v-if="weighList.orderType == '外购'">超出原发{{avgFalse ? '皮重' :'毛重'}} ,磅房人员确认中,请勿离开此页面</text>
         <text v-else>超出最大 {{avgFalse ? '皮重' :'毛重'}},磅房人员确认中,请勿离开此页面</text>
      </view>
      <view v-show="afterEvacuationStatus"
         style="color: #ff6363;width: auto;margin: 0 auto;">
@@ -242,6 +242,7 @@
<script>
   import { webSocketUrl } from '@/api/request.js';
   import { mapState, mapMutations } from 'vuex';
   import { BaseUrl } from '@/api/publicInterface.js'
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import BigNumber from "bignumber.js"
   export default {
@@ -254,12 +255,14 @@
         this.weighHouseCode = params.weighHouseCode;
         this.primarySkin = params.primarySkin;
         this.primaryHair = params.primaryHair;
         this.deptId = params.deptId;
         this.primaryClean = params.primaryClean;
         if (params.overTmWaixiao !== 'null') {
            this.weighData.overTmWaixiao = 1
         }
         this.changeweighHouseCode(params.weighHouseCode);
         this.init();
         this.getDept();
         this.changeWeigh('')
         this.realTimeWeigh = 0
      },
@@ -288,6 +291,7 @@
      },
      data() {
         return {
            avgFalse:false, // 是否皮重异常
            weighData: {
               //确认称重接口参数
               deptId: '',
@@ -296,6 +300,7 @@
               carNo: '',
               gateCameraId: '',
               equipmentCode: '',
               avgSkin:'',
               weigh: 0,
               tmCode: '',
               sceneInOut: '',
@@ -307,15 +312,17 @@
               abnormalText: ''
            },
            takeCoalId: null,
            deptId:'',
            weightReal:0, // 称重浮动数据
            weighHouseCode: '',
            isConfirmWeighLoading: false, //确定称重按钮
            realTimeWeigh: 0,
            weighList: {},
            // 临时称重对象
            temporaryWeighObj: {
               skin: 0,
               hair: 0,
               clean: 0
               skin: 0,  //皮
               hair: 0,  //毛
               clean: 0  //净重
            },
            infraredStatus: false, // 红外状态,
            // 放空控制
@@ -364,7 +371,7 @@
                  },
               ]
            },
            mergeState: true, //合卡状态
            mergeState: true, //合卡状态
            // mergeStateShow: false, //合卡弹窗
            checkboxValue1: [],
            isExceedOrigin: false, //是否超出毛重
@@ -391,7 +398,7 @@
                     this.temporaryWeighObj.skin = newV;
                     let xx = new BigNumber(this.avgSkin)
                     let yy = new BigNumber(newV)
                     this.errorTipShow = (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) &&
                     this.errorTipShow = (xx.minus(yy).toNumber() < -this.weightReal || xx.minus(yy).toNumber() > this.weightReal) &&
                        this.avgSkin !== 0
                  } else {
                     this.isSkinWeigh = false;
@@ -415,7 +422,7 @@
                     this.temporaryWeighObj.skin = newV;
                     let xx = new BigNumber(this.avgSkin)
                     let yy = new BigNumber(newV)
                     this.errorTipShow = (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) &&
                     this.errorTipShow = (xx.minus(yy).toNumber() < -this.weightReal || xx.minus(yy).toNumber() > this.weightReal) &&
                        this.avgSkin !== 0;
                     let x = new BigNumber(this.weighList.hair)
                     let y = new BigNumber(this.temporaryWeighObj.skin)
@@ -515,7 +522,7 @@
                  } else {
                     let xx = new BigNumber(this.avgSkin)
                     let yy = new BigNumber(this.globalweigh)
                     if (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) {
                     if (xx.minus(yy).toNumber() < -this.weightReal || xx.minus(yy).toNumber() > this.weightReal) {
                        this.abnormalModalShow = true
                        this.skinAbnormal()
                     } else {
@@ -546,7 +553,14 @@
                        this.isConfirmWeighLoading = false;
                     }, 1000);
                  } else if (res.code === 3) {
                     this.isExceedOrigin = true
                     if(/皮重/.test(res.msg)){
                        this.avgFalse = true;
                        this.isExceedOrigin = true;
                     }else{
                        this.avgFalse = false;
                        this.isExceedOrigin = true;
                     }
                  } else {
                     this.$u.toast(res.msg ? res.msg : '称重失败,请稍后重试');
                     this.isConfirmWeighLoading = false
@@ -639,7 +653,8 @@
            this.$reqGet('getAvgSkin', { xsUserId1: this.weighList.xsUserId1 }).then(res => {
               if (res.code === 0) {
                  uni.hideLoading()
                  this.avgSkin = res.data.avgSkin
                  this.avgSkin = res.data.avgSkin;
                  this.weighData.avgSkin = res.data.avgSkin;
                  this.tmTaskCoalList = res.data.tmTaskCoalList
                  /**
                   * @description true的话是第一次称, false就不是,没有历史,平均皮重为0是第一次也是正常 */
@@ -676,6 +691,20 @@
                     delta: 1
                  })
            }, 800)
         },
         //获取重量阈值
         getDept(){
            uni.request({
               url: `${BaseUrl}/admin/dept/${this.deptId}`,
               method: 'GET',
               header: {
                  'content-type': 'application/x-www-form-urlencoded'
               },
               success: (res) => {
                  console.log(res.data.data,'res.datra')
                  res.data.data.skinSafeValue ?    this.weightReal = res.data.data.skinSafeValue : this.weightReal = '';
               }
            })
         }
      }
   };
@@ -1050,4 +1079,4 @@
         justify-content: space-between;
      }
   }
</style>
</style>