yyb
2025-11-24 6fdf1bc4b692b7466c57bfc08bfc56735e96286b
pages/wareHouse/nuclearScale/saveForm.vue
@@ -12,7 +12,7 @@
      <scroll-view scroll-y="true" style="height: 100%">
        <view class="packing-registration-param-view">
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">批次号</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -23,18 +23,18 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">产品描述</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -45,18 +45,18 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">零件位</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -67,18 +67,18 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">毛重</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -89,18 +89,18 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">盘重</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -111,18 +111,18 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">净重</text>
            </view>
            <view class="packing-registration-param-item-right">
@@ -133,50 +133,54 @@
                                              :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">核磅重量</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.verificationWeight"
              <u-input
                class="item-one item-two"
                v-model="form.verificationWeight"
                                            :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
               />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view style=" min-width: 80px;">
            <view style="min-width: 80px">
              <text style="font-size:16px">叉车重量</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.forkliftWeight"
              <u-input
                class="item-one item-two"
                v-model="form.forkliftWeight"
                                            :custom-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
              :input-style="{
                fontSize: '16px',
                height: '40px',
                lineHeight: '40px'
                  lineHeight: '40px',
              }"
               />
            </view>
@@ -216,7 +220,7 @@
    return {
      show: false,
      form: {
        forkliftWeight: '0',
        forkliftWeight: "0",
      },
    };
  },
@@ -254,10 +258,31 @@
      //磅差计算:核榜-叉车盘-毛重
      Number(this.form.h);
      const magnetic =
        Number(this.form.verificationWeight) - Number(this.form.forkliftWeight) - Number(this.form.grossWeight);
        Number(this.form.verificationWeight) -
        Number(this.form.forkliftWeight) -
        Number(this.form.grossWeight);
      let productType = this.operationTaskList.productType;
      let workshop = this.operationTaskList.workshop;
        let formList = this.form;
        let self = this; // 保存组件实例引用
      if (workshop == "ZF01") {
        uni.showModal({
          title: "提示",
          content: "磅差为:" + magnetic,
          showCancel: false,
          success: function () {
            switch (workshop) {
              case "ZF01":
                if (magnetic >= -1 && magnetic <= 1) {
                  self.verifySubmission(formList);
                } else {
                  self.$u.toast("磅差:" + magnetic + ",请车间核查");
                }
                break;
            }
          },
        });
      } else {
      uni.showModal({
        title: "提示",
        content: "磅差为:" + magnetic,
@@ -346,7 +371,7 @@
                self.verifySubmission(formList);
              }
              if (magnetic > 10) {
                self.$u.toast('磅差:' + magnetic + ',请车间核查');
                  self.$u.toast("磅差:" + magnetic + ",请车间核查");
              }
              break;
            // case "导体":
@@ -366,6 +391,7 @@
          }
        },
      });
      }
    },
    // 校验后提交
    verifySubmission(Obj) {
@@ -379,7 +405,8 @@
      this.show = true;
    this.form = {
      ...val, 
      forkliftWeight: val.forkliftWeight !== undefined ? val.forkliftWeight : 0
        forkliftWeight:
          val.forkliftWeight !== undefined ? val.forkliftWeight : 0,
    };
    },
  },