qingyiay
2023-09-18 e96eb325b42b25ecd83c065c4abd8ce9999cd468
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -207,7 +207,7 @@
               <view class="suffix">{{ weighList.orderSurplus ||""  }}</view>
               <text style="color: #ff6363;font-weight: bold;font-size: 26rpx;"
                  class="error-tip"
                  v-show="isweigh">* 订单余量不足</text>
                  v-show="orderSurplusLess">* 订单余量不足</text>
            </view>
         </view>
      </view>
@@ -218,11 +218,12 @@
            plain
            @click="evacuation"
            throttleTime="500"
            :disabled="!isEvacuation"></u-button>
            :disabled="!isEvacuation"
            v-if='weighList.skin||weighList.hair'></u-button>
         <!-- 外销订单称皮时,返回加减吨按钮置灰。称毛时可用.外购订单,不出现返回加减吨的按钮 -->
         <u-button type="primary"
            text="确定称重"
            :disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh || !isInputOrigin"
            :disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh || !isInputOrigin||!mergeState"
            :loading="isConfirmWeighLoading"
            loadingText="确认"
            @click="confirmWeigh"
@@ -252,11 +253,14 @@
            @cancel="abnormalCancel"
            confirmText="提交">
            <view class="slot-content">
               <u--form labelPosition="top">
                  <u-form-item>
                     <u-textarea v-model="abnormalContent"
               <u--form labelPosition="top"
                  :model='abnormalForm'
                  :rules="rules"
                  ref="uForm">
                  <u-form-item prop="abnormalContent">
                     <u-textarea v-model="abnormalForm.abnormalContent"
                        confirmType="done"
                        placeholder="请输入异常原因"
                        placeholder="请输入异常原因(字数不少于5个字)"
                        height='140'
                        count
                        border="surround"
@@ -265,6 +269,14 @@
               </u--form>
            </view>
         </u-modal>
      </view>
      <view class="mergeState">
         <u-modal :show="mergeStateShow"
            title="合卡确认"
            content="是否确认合卡"
            :showCancelButton="true"
            @confirm="mergeConfirm"
            @cancel="mergeCancel"></u-modal>
      </view>
   </view>
</template>
@@ -312,7 +324,8 @@
               sceneInOut: '',
               coalContactClean: 0,
               coalContactHair: 0,
               coalContactSkin: 0
               coalContactSkin: 0,
               isMerge: 0 //1是 0不是  默认0  是否合卡
            },
            // 是否填写原发信息
            isInputOrigin: false,
@@ -340,6 +353,7 @@
            primaryClean: null,
            // 判断称重按钮是否可用
            isweigh: false,
            orderSurplusLess: false,
            // 外购类型称重填写毛,皮,
            firstHairCustomernameShow: false,
            coalContactHair: '',
@@ -350,7 +364,9 @@
            // 外购第一次称毛重不需要加减吨
            outBuy: true,
            // 皮重异常相关
            abnormalContent: '',
            abnormalForm: {
               abnormalContent: '',
            },
            avgSkin: '', // 平均皮重
            isAbnormalAvgSkin: true, //平均皮重是否异常
            tmTaskCoalList: [],
@@ -359,7 +375,27 @@
            historyShow: false,
            // 是否在称皮重,点击确定称重判断是否异常
            isSkinWeigh: false,
            errorTipShow: false
            errorTipShow: false,
            rules: {
               abnormalContent: [{
                     required: true,
                     message: "请填写异常原因",
                     trigger: ['blur', 'change'],
                     type: 'string'
                  },
                  {
                     validator: (rule, value, callback) => {
                        if (value.length < 5) {
                           callback(new Error('原因不可少于5个字'))
                        } else {
                           callback()
                        }
                     }
                  },
               ]
            },
            mergeState: true, //合卡状态
            mergeStateShow: false, //合卡弹窗
         };
      },
      watch: {
@@ -385,6 +421,8 @@
                     this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this
                        .temporaryWeighObj
                        .clean < 0;
                     this.orderSurplusLess = this.temporaryWeighObj.clean > this.weighList.orderSurplus
                     this.mergeStateShow = this.weighList.source !== 0 && this.orderSurplusLess
                  }
               } else if (this.weighList.orderType == '外购' || this.weighList.orderType == '内购' || this.weighList
                  .orderType == '转入') {
@@ -402,6 +440,8 @@
                     this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this
                        .temporaryWeighObj
                        .clean < 0;
                     this.orderSurplusLess = this.temporaryWeighObj.clean > this.weighList.orderSurplus
                     this.mergeStateShow = this.weighList.source !== 0 && this.orderSurplusLess
                  }
               }
            }
@@ -425,13 +465,11 @@
         isEvacuation() {
            if (this.weighList.orderType == '外销' || this.weighList.orderType == '内销' || this.weighList.orderType ==
               '转出') {
               return (this.weighList.skin === 0 ? this.temporaryWeighObj.skin : this.weighList.skin) == this
                  .temporaryWeighObj.hair;
               return this.weighList.skin == this.temporaryWeighObj.hair;
            }
            if (this.weighList.orderType == '外购' || this.weighList.orderType == '内购' || this.weighList.orderType ==
               '转入') {
               return (this.weighList.hair === 0 ? this.temporaryWeighObj.skin : this.weighList.hair) == this
                  .temporaryWeighObj.hair;
               return this.weighList.hair == this.temporaryWeighObj.skin;
            }
         },
         sideline() {
@@ -457,6 +495,7 @@
                  this.weighData.filedId = res.data.filedId;
                  this.weighData.coalContactHair = res.data.hairTwo ? res.data.hairTwo : 0;
                  this.weighData.coalContactSkin = res.data.skinTwo ? res.data.skinTwo : 0;
                  this.weighList.source = res.data.source
                  if (this.weighList.orderType == '外购') {
                     this.firstHairCustomernameShow = true;
                     if (this.weighList.hair > 0) {
@@ -524,7 +563,7 @@
                        this.isConfirmWeighLoading = false;
                     }, 1000);
                  } else {
                     this.$u.toast('称重失败,请稍后重试');
                     this.$u.toast(res.msg ? res.msg : '称重失败,请稍后重试');
                     this.isConfirmWeighLoading = false
                  }
               })
@@ -541,7 +580,8 @@
               carNo: this.weighData.carNo,
               tmId: this.weighData.tmId,
               filedId: this.weighData.filedId,
               equipmentCode: this.weighData.equipmentCode
               equipmentCode: this.weighData.equipmentCode,
               weigh: this.weighData.weigh
            }, 'json').then(res => {
               if (res.code == 0) {
                  this.$u.toast('操作成功,即将返回上一页');
@@ -564,7 +604,12 @@
            this.$reqPost('getTwoEvacuation', this.weighData, 'json').then(res => {
               console.log(res, '第二次放空');
               if (res.code == 0) {
                  this.$u.toast('操作成功');
                  this.$u.toast('操作成功,即将返回上一页');
                  setTimeout(() => {
                     uni.navigateBack({
                        delta: 1
                     });
                  }, 1000);
                  this.evacuationModalShow = false;
               } else {
                  this.$u.toast(res.msg ? res.msg : '操作失败');
@@ -629,7 +674,21 @@
            this.$reqPost('skinAbnormal', { sceneId: this.weighData.sceneId }, 'params').then(() => {
               this.abnormalModalShow = false
            })
         }
         },
         mergeConfirm() {
            this.mergeStateShow = false
            this.weighData.isMerge = 1
            this.MergeState = true
            this.isweigh = false
            this.orderSurplusLess = false
         },
         mergeCancel() {
            this.mergeStateShow = false
            this.weighData.isMerge = 0
            this.MergeState = false
            this.isweigh = true
            this.orderSurplusLess = true
         },
      }
   };
</script>