fcx
5 天以前 6ca81c89d606b5be26c8b8526b191ae8e773167b
解决1、一致性核对,没有维护的情况下不要求必填

2、检验项目维护之后,点击保存结果,会跳转第二项检验,此时显示的内容是第一项内容
已修改4个文件
47 ■■■■ 文件已修改
pages/QC/SJ/Add.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/ScanCode.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/detail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/yzxFrom.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/Add.vue
@@ -253,22 +253,44 @@
    },
    submit() {
      // 检查是否已完成一致性核对
      // 检查是否需要一致性核对
      if (this.current && !this.formData.yzxChecked) {
        // 先检查该物料是否维护了一致性核对项目
        this.$post({
          url: "/SJ/getYzxItem",
          data: {
            id: this.formData.id
          }
        }).then(res => {
          // 如果维护了一致性核对项目(components.length > 0),则要求完成核对
          if (res.data && res.data.length > 0) {
        uni.showModal({
          title: "提示",
          content: "请先完成一致性核对后再提交检验",
          confirmText: "去核对",
          cancelText: "取消",
          success: (res) => {
            if (res.confirm) {
              success: (modalRes) => {
                if (modalRes.confirm) {
              this.toYzxSubmitFrom(this.formData.billNo);
            }
          }
        });
          } else {
            // 未维护一致性核对项目,允许直接提交
            this.submitInspection();
          }
        }).catch(() => {
          // 接口异常,允许提交
          this.submitInspection();
        });
        return;
      }
      
      // 已完成一致性核对或不需要核对,直接提交
      this.submitInspection();
    },
    submitInspection() {
      this.$post({
        url: "/SJ/SJQaSubmit",
        data: {
@@ -299,7 +321,7 @@
        }
      }).catch(err => {
        console.log("提交出错:", err);
        this.$showMessage("提交失败,请重试");
        this.$showMessage("提交失败,请重试");
      })
    },
@@ -601,7 +623,8 @@
  },
  onShow() {
    //每次进入页面都会执行的方法
    this.init();
    // 注释掉init()调用,避免覆盖一致性核对状态
    // this.init();
  }
};
</script>
pages/QC/SJ/ScanCode.vue
@@ -118,7 +118,10 @@
      // #ifdef APP-PLUS
      uni.scanCode({
        scanType: ['barCode'],  // 新增这一行
        autoDecodeCharset: true, // 自动解码字符集
        success(res) {
            console.log(res)
          self.scanItems[index].snNo = res.result;
        },
      });
pages/QC/SJ/detail.vue
@@ -245,6 +245,13 @@
              return 0;
            }
          });
          // 排序后自动跳转到第一个标签
          this.currentTab = 0;
          if (this.tabs.length > 0) {
            this.id = this.tabs[0].id;
            this.refreshResult();
          }
        } else {
          // 没有项目时至少添加当前项目到标签
          this.tabs = [{id: this.id, projName: this.formData.projName || '当前项目'}];
pages/QC/SJ/yzxFrom.vue
@@ -168,6 +168,10 @@
                    prevPage.$vm.formData.yzxChecked = true;
                  }
                }
                // 自动返回上一页  增加的
                setTimeout(() => {
                  uni.navigateBack();
                }, 1500);
            }else{
                uni.showModal({
                    title: "提示",