PDA核磅录入页面创建时客户名称选择逻辑修改,至少选择一个客户,解决叉车工选择弹框不能滚动问题
已修改2个文件
79 ■■■■ 文件已修改
pages/wareHouse/nuclearScale/createwriteoffform.vue 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -98,7 +98,7 @@
        :border-bottom="false"
        prop="shippingNoticeNo1"
        style="font-size: small"
        :label-width="245"
        :label-width="245"
      >
        <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
      </u-form-item>
@@ -141,7 +141,7 @@
        :border-bottom="false"
        prop="shippingNoticeNo2"
        style="font-size: small"
        :label-width="245"
        :label-width="245"
      >
        <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
      </u-form-item>
@@ -247,22 +247,25 @@
      @confirm="confirmSelection"
      @cancel="cancel"
    >
    <scroll-view scroll-y="true" style="height: 100%; transform: translateZ(0); -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;"></scroll-view>
      <view class="popup-content">
        <view class="popup-header">
          <checkbox-group @change="checkboxChange">
            <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>
          </checkbox-group>
        </view>
      <view class="popup-content" style="padding: 20rpx">
        <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"
              >
                <checkbox :value="item.value" :checked="item.checked" />
                <text class="label">{{ item.label }}</text>
              </label>
            </checkbox-group>
          </view>
        </scroll-view>
      </view>
    <scroll-view/>
    </u-modal>
  </div>
</template>
@@ -564,21 +567,21 @@
      const selectedIndex = e.target.value;
      const selectedCustomer = storage[selectedIndex];
      // 检查是否选择了相同的客户
      if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
        uni.showToast({
          title: "不能选择相同的客户",
          icon: "none",
        });
        return;
      }
      if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
        uni.showToast({
          title: "不能选择相同的客户",
          icon: "none",
        });
        return;
      }
      // // 检查是否选择了相同的客户
      // if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
      //   uni.showToast({
      //     title: "不能选择相同的客户",
      //     icon: "none",
      //   });
      //   return;
      // }
      // if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
      //   uni.showToast({
      //     title: "不能选择相同的客户",
      //     icon: "none",
      //   });
      //   return;
      // }
      if (code === "customerName2") {
        this.selClientIndex2 = selectedIndex;
@@ -658,7 +661,7 @@
      try {
        // 统一表单验证
        if (!(await this.validateForm())) return;
        // 移除冗余的验证代码
        // 构建提交数据
        const submitData = this.buildSubmitData().customerList;
        console.log("提交的数据", submitData);
@@ -705,9 +708,9 @@
        return false;
      }
      // 客户名称验证
      if (!this.form.customerName1 || !this.form.customerName2) {
        throw { type: "validation", message: "请先选择客户名称" };
      // 客户名称验证 - 修改为至少有一个有值
      if (!this.form.customerName1 && !this.form.customerName2) {
        throw { type: "validation", message: "请至少选择一个客户名称" };
      }
      return true;
pages/wareHouse/nuclearScale/index.vue
@@ -417,9 +417,9 @@
        .then((res) => {
          this.$u.toast("提交成功");
        })
        .catch(() => {
        .catch((err) => {
          uni.hideLoading();
          this.$u.toast("网络异常,请重试");
          this.$u.toast(err.message || "网络异常,请重试");
        });
    },