yyb
2025-11-24 6fdf1bc4b692b7466c57bfc08bfc56735e96286b
核磅录入增加直发类型得选择和磅差计算
已修改3个文件
415 ■■■■ 文件已修改
pages/wareHouse/nuclearScale/createwriteoffform.vue 325 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/index.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/saveForm.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -2,15 +2,38 @@
    <!-- 核磅录入 -->
    <div class="page">
        <view class="packing-registration-bg" />
        <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000" />
        <u-form :model="form" ref="uForm" :label-width="235" labelAlign="left" :rules="rules" :error-type="['toast']"
            class="uForm">
            <u-form-item label="产品类型:" :border-bottom="false" prop="productType" style="font-size: 16px; height: 40px">
                <u-radio-group v-model="form.productType" @change="handleProductTypeChange" class="radio-group-large">
    <u-navbar
      title="核磅录入"
      :background="background"
      :border-bottom="false"
      :title-bold="true"
      title-color="#000"
      back-icon-color="#000"
    />
    <u-form
      :model="form"
      ref="uForm"
      :label-width="235"
      labelAlign="left"
      :rules="rules"
      :error-type="['toast']"
      class="uForm"
    >
      <u-form-item
        label="产品类型:"
        :border-bottom="false"
        prop="productType"
        style="font-size: 16px; height: 40px"
      >
        <u-radio-group
          v-model="form.productType"
          @change="handleProductTypeChange"
          class="radio-group-large"
        >
                    <u-radio name="DT01" class="radio-large">导体</u-radio>
                    <u-radio name="TG01" class="radio-large">铜杆</u-radio>
                    <u-radio name="DT02" class="radio-large">导体2.6</u-radio>
          <!-- <u-radio name="ZF01" class="radio-large">直发</u-radio> -->
                </u-radio-group>
            </u-form-item>
            <!-- <u-form-item
@@ -24,132 +47,267 @@
          <u-radio name="0">否</u-radio>
        </u-radio-group>
      </u-form-item> -->
            <u-form-item label="车牌号:" :border-bottom="false" prop="licensePlate" style="font-size: 16px; height: 40px">
                <u-input v-model="form.licensePlate" type="select" placeholder="请输入车牌号" @click="lpn" :custom-style="{
      <u-form-item
        label="车牌号:"
        :border-bottom="false"
        prop="licensePlate"
        style="font-size: 16px; height: 40px"
      >
        <u-input
          v-model="form.licensePlate"
          type="select"
          placeholder="请输入车牌号"
          @click="lpn"
          :custom-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" :input-style="{
          }"
          :input-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" />
          }"
        />
            </u-form-item>
            <u-form-item label="客户名称1:" :border-bottom="false" prop="customerName1"
                style="font-size: 16px; height: 40px">
                <picker class="item-one item-two" style="width: 100%; font-size: 16px; text-align: right"
                    @change="selClientChange($event, selClientList, 'customerName1')" :value="selClientIndex1"
                    :range="selClientList" range-key="label">
      <u-form-item
        label="客户名称1:"
        :border-bottom="false"
        prop="customerName1"
        style="font-size: 16px; height: 40px"
      >
        <picker
          class="item-one item-two"
          style="width: 100%; font-size: 16px; text-align: right"
          @change="selClientChange($event, selClientList, 'customerName1')"
          :value="selClientIndex1"
          :range="selClientList"
          range-key="label"
        >
                    <view>
                        <text :style="{
            <text
              :style="{
                color: selClientIndex1 == null ? '#a5abb4' : '#0c0c0c',
              }">{{
              }"
              >{{
                selClientIndex1 == null
                  ? "请选择"
                  : selClientList[selClientIndex1].label
              }}</text>
              }}</text
            >
                    </view>
                </picker>
                <u-icon v-if="selClientIndex1 == null" name="arrow-right" color="#687792" size="28"></u-icon>
        <u-icon
          v-if="selClientIndex1 == null"
          name="arrow-right"
          color="#687792"
          size="28"
        ></u-icon>
            </u-form-item>
            <u-form-item label="发货通知单号:" :border-bottom="false" prop="shippingNoticeNo1"
                style="font-size: 16px; height: 40px" :label-width="300">
                <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled :custom-style="{
      <u-form-item
        label="发货通知单号:"
        :border-bottom="false"
        prop="shippingNoticeNo1"
        style="font-size: 16px; height: 40px"
        :label-width="300"
      >
        <u-input
          v-model="form.shippingNoticeNo1"
          placeholder=""
          disabled
          :custom-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" :input-style="{
          }"
          :input-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" />
          }"
        />
            </u-form-item>
            <u-form-item label="客户名称2:" :border-bottom="false" prop="customerName2"
                style="font-size: 16px; height: 40px">
                <picker class="item-one item-two" style="width: 100%; font-size: 16px; text-align: right"
                    @change="selClientChange($event, selClientList, 'customerName2')" :value="selClientIndex2"
                    :range="selClientList" range-key="label">
      <u-form-item
        label="客户名称2:"
        :border-bottom="false"
        prop="customerName2"
        style="font-size: 16px; height: 40px"
      >
        <picker
          class="item-one item-two"
          style="width: 100%; font-size: 16px; text-align: right"
          @change="selClientChange($event, selClientList, 'customerName2')"
          :value="selClientIndex2"
          :range="selClientList"
          range-key="label"
        >
                    <view>
                        <text :style="{
            <text
              :style="{
                color: selClientIndex2 == null ? '#a5abb4' : '#0c0c0c',
              }">{{
              }"
              >{{
                selClientIndex2 == null
                  ? "请选择"
                  : selClientList[selClientIndex2].label
              }}</text>
              }}</text
            >
                    </view>
                </picker>
                <u-icon v-if="selClientIndex2 == null" name="arrow-right" color="#687792" size="28"></u-icon>
        <u-icon
          v-if="selClientIndex2 == null"
          name="arrow-right"
          color="#687792"
          size="28"
        ></u-icon>
            </u-form-item>
            <u-form-item label="发货通知单号:" :border-bottom="false" prop="shippingNoticeNo2"
                style="font-size: 16px; height: 40px" :label-width="300">
                <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled :custom-style="{
      <u-form-item
        label="发货通知单号:"
        :border-bottom="false"
        prop="shippingNoticeNo2"
        style="font-size: 16px; height: 40px"
        :label-width="300"
      >
        <u-input
          v-model="form.shippingNoticeNo2"
          placeholder=""
          disabled
          :custom-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" :input-style="{
          }"
          :input-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" />
          }"
        />
            </u-form-item>
            <u-form-item label="生产车间:" :border-bottom="false" prop="workshop" style="font-size: 16px; height: 40px">
                <picker class="item-one item-two" style="width: 100%; text-align: right; font-size: 16px"
                    @change="workshopChange($event, workshopList)" :value="workshopIndex" :range="workshopList"
                    range-key="label" :disabled="!form.productType">
      <u-form-item
        label="生产车间:"
        :border-bottom="false"
        prop="workshop"
        style="font-size: 16px; height: 40px"
      >
        <picker
          class="item-one item-two"
          style="width: 100%; text-align: right; font-size: 16px"
          @change="workshopChange($event, workshopList)"
          :value="workshopIndex"
          :range="workshopList"
          range-key="label"
          :disabled="!form.productType"
        >
                    <view>
                        <text :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
            <text
              :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }"
              >{{
                workshopIndex == null
                  ? "请选择"
                  : workshopList[workshopIndex].label
              }}</text>
              }}</text
            >
                    </view>
                </picker>
                <u-icon v-if="workshopIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
        <u-icon
          v-if="workshopIndex == null"
          name="arrow-right"
          color="#687792"
          size="28"
        ></u-icon>
            </u-form-item>
            <u-form-item label="司磅员:" :border-bottom="false" prop="weighingOperator"
                style="font-size: 16px; height: 40px">
                <picker class="item-one item-two" style="width: 100%; text-align: right; font-size: 16px"
                    @change="weighmanChange($event, weighmanList)" :value="weighmanIndex" :range="weighmanList"
                    range-key="label">
      <u-form-item
        label="司磅员:"
        :border-bottom="false"
        prop="weighingOperator"
        style="font-size: 16px; height: 40px"
      >
        <picker
          class="item-one item-two"
          style="width: 100%; text-align: right; font-size: 16px"
          @change="weighmanChange($event, weighmanList)"
          :value="weighmanIndex"
          :range="weighmanList"
          range-key="label"
        >
                    <view>
                        <text :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
            <text
              :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }"
              >{{
                weighmanIndex == null
                  ? "请选择"
                  : weighmanList[weighmanIndex].label
              }}</text>
              }}</text
            >
                    </view>
                </picker>
                <u-icon v-if="weighmanIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
        <u-icon
          v-if="weighmanIndex == null"
          name="arrow-right"
          color="#687792"
          size="28"
        ></u-icon>
            </u-form-item>
            <u-form-item label="叉车工:" :border-bottom="false" prop="forkliftOperator"
                style="font-size: 16px; height: 40px">
                <u-input v-model="form.forkliftOperator" type="select" placeholder="请选择" :custom-style="{
      <u-form-item
        label="叉车工:"
        :border-bottom="false"
        prop="forkliftOperator"
        style="font-size: 16px; height: 40px"
      >
        <u-input
          v-model="form.forkliftOperator"
          type="select"
          placeholder="请选择"
          :custom-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" :input-style="{
          }"
          :input-style="{
            fontSize: '16px',
            height: '40px',
            lineHeight: '40px',
          }" @click="openForkliftDriverList" />
          }"
          @click="openForkliftDriverList"
        />
            </u-form-item>
        </u-form>
        <u-button type="primary" class="bottom-button1" @click="submit">创建</u-button>
    <u-button type="primary" class="bottom-button1" @click="submit"
      >创建</u-button
    >
        <!--车牌号 -->
        <modalBg ref="modalBg" :confirm="confirm">
            <u-field v-model="form.licensePlate" label="车牌号:" placeholder="请输入" :border-bottom="false">
      <u-field
        v-model="form.licensePlate"
        label="车牌号:"
        placeholder="请输入"
        :border-bottom="false"
      >
            </u-field>
        </modalBg>
        <!-- 叉车工 -->
        <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true"
            @confirm="confirmSelection" @cancel="cancel">
    <u-modal
      v-model="showModal"
      title=""
      :show-cancel-button="true"
      :show-confirm-button="true"
      @confirm="confirmSelection"
      @cancel="cancel"
    >
            <view class="popup-content" style="padding: 20rpx">
                <scroll-view scroll-y="true" style="height: 400rpx; transform: translateZ(0)">
        <scroll-view
          scroll-y="true"
          style="height: 400rpx; transform: translateZ(0)"
        >
                    <view class="popup-header">
                        <checkbox-group @change="checkboxChange">
                            <label class="checkbox-item" v-for="(item, index) in checkboxList" :key="index">
              <label
                class="checkbox-item"
                v-for="(item, index) in checkboxList"
                :key="index"
              >
                                <checkbox :value="item.value" :checked="item.checked" />
                                <text class="label">{{ item.label }}</text>
                            </label>
@@ -192,11 +350,13 @@
                    forkliftOperator: "",
                },
                rules: {
                    productType: [{
        productType: [
          {
                        required: true,
                        message: "请选择产品类型",
                        trigger: ["change"],
                    }, ],
          },
        ],
                    // replace: [
                    //   {
                    //     required: true,
@@ -204,27 +364,35 @@
                    //     trigger: ["change", "blur"],
                    //   },
                    // ],
                    licensePlate: [{
        licensePlate: [
          {
                        required: true,
                        message: "请输入车牌号",
                        trigger: ["change", "blur"],
                    }, ],
                    workshop: [{
          },
        ],
        workshop: [
          {
                        required: true,
                        message: "请选择生产车间",
                        trigger: ["change"],
                    }, ],
                    weighingOperator: [{
          },
        ],
        weighingOperator: [
          {
                        required: true,
                        message: "请选择司磅员",
                        trigger: ["change"],
                    }, ],
                    forkliftOperator: [{
          },
        ],
        forkliftOperator: [
          {
                        type: "string",
                        required: true,
                        message: "请至少选择一个叉车工",
                        trigger: ["change"],
                    }, ],
          },
        ],
                },
                // 客户名称
                selClientList: [],
@@ -564,7 +732,14 @@
                        return;
                    }
                }
      if (selectedWorkshop.label.includes("直发") && productType !== "DT02") {
        uni.showModal({
          title: "提示",
          content: "直发产品只能选择导体2.6车间",
          showCancel: false,
        });
        return;
      }
                this.workshopIndex = e.target.value;
                this.form.workshop = selectedWorkshop.value;
            },
pages/wareHouse/nuclearScale/index.vue
@@ -355,6 +355,9 @@
        if (that.form.productType == "TG01") {
          that.$refs.saveForm.open(ScanCodeRecordList);
        } else {
          if (that.form.workshop == "ZF01") {
            that.$refs.saveForm.open(ScanCodeRecordList);
          }
          that.queryCustomName(codeInfo, ScanCodeRecordList);
        }
      }
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,
    };
    },
  },