zouyu
5 天以前 0f102473c642142976d537af4c505b8a7161d6c5
src/views/business/inspectionTask/inspection.vue
@@ -546,8 +546,8 @@
  delfile,
  inspectionOrderDetailsTaskSwitching
} from "@/api/business/inspectionTask.js";
import InspectionWorker from '@/workers/InspectionWorker.worker';
import DataWorker from '../../../workers/DataWorker.worker';
import InspectionWorker from '@/workers/InspectionWorker.worker.js';
import DataWorker from '@/workers/DataWorker.worker.js';
import html2canvas from "html2canvas";
import { mapGetters } from "vuex";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
@@ -735,7 +735,6 @@
        size: 10,
        current: 0,
      },
      tableLoading: false,
      // 文件列表相关--结束
      // 任务切换列表--开始
      tableData0: [],
@@ -770,6 +769,7 @@
      },
      tableLoading0: false,
      // 任务切换列表--结束
      isSplit: 0, // 是否是拆单过来的
    };
  },
  // 用于上传文件的信息
@@ -780,7 +780,7 @@
    },
  },
  created() {
    let { sonLaboratory, orderId, state, inspectorList, typeSource } =
    let { sonLaboratory, orderId, state, inspectorList, typeSource,isSplit } =
      this.$route.query;
    this.sonLaboratory = sonLaboratory;
    this.orderId = orderId;
@@ -788,6 +788,7 @@
    this.state = state;
    this.inspectorList = inspectorList;
    this.typeSource = typeSource;
    this.isSplit = isSplit;
  },
  mounted() {
    this.getTypeDicts(); // 获取紧急程度下拉框选项
@@ -2553,6 +2554,26 @@
    openAddVerifyDia() {
      this.addVerifyDia = true;
    },
    confirmSubmit(registerInsResults){
      submitPlan({
        orderId: this.orderId,
        laboratory: this.sonLaboratory,
        verifyUser: this.verifyUser,
        entrustCode: this.insOrder.entrustCode,
        registerInsResults: registerInsResults
      }).then((res) => {
        if (res.code === 200) {
          this.$message.success("操作成功");
          this.goback();
          this.submitLoading = false;
          this.addVerifyDia = false;
        }
      })
        .catch((error) => {
          console.error(error);
          this.submitLoading = false;
        });
    },
    submit() {
      if (this.verifyUser === null || this.verifyUser === "") {
        this.$message.error("请指定复核人员");
@@ -2572,25 +2593,24 @@
        laboratory: this.sonLaboratory,
      }).then((res) => {
        if (res.code === 200) {
          if (!res.data || res.data.length == 0) {
          if (!res.data || res.data.errorMsg.length == 0) {
            this.submitLoading = true;
            submitPlan({
              orderId: this.orderId,
              laboratory: this.sonLaboratory,
              verifyUser: this.verifyUser,
              entrustCode: this.insOrder.entrustCode,
            }).then((res) => {
              if (res.code === 200) {
                this.$message.success("操作成功");
                this.goback();
                this.submitLoading = false;
                this.addVerifyDia = false;
              }
            })
              .catch((error) => {
                console.error(error);
                this.submitLoading = false;
            //检验类型为原材料
            if(this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){
              const htmlStr = "是否登记IFS采购检验结果并移库?该操作会登记<span style='color:#ff4949'>同一零件同一订单的所有拆分批次</span>,请谨慎选择。"
              this.$confirm(htmlStr, '提示', {
                confirmButtonText: '是',
                cancelButtonText: '否',
                type: 'warning',
                dangerouslyUseHTMLString: true
              }).then(() => {
                this.confirmSubmit(true)
              }).catch(() => {
                this.confirmSubmit(false)
              });
            }else{
              this.confirmSubmit(false)
            }
          } else {
            let newData = [];
            const h = this.$createElement;
@@ -2626,22 +2646,23 @@
            })
              .then(() => {
                this.submitLoading = true;
                submitPlan({
                  orderId: this.orderId,
                  laboratory: this.sonLaboratory,
                  verifyUser: this.verifyUser,
                }).then((res) => {
                  if (res.code === 200) {
                    this.$message.success("操作成功");
                    this.addVerifyDia = false;
                    this.goback();
                  }
                  this.submitLoading = false;
                })
                  .catch((error) => {
                    console.error(error);
                    this.submitLoading = false;
                  });
                this.confirmSubmit(false)
                // submitPlan({
                //   orderId: this.orderId,
                //   laboratory: this.sonLaboratory,
                //   verifyUser: this.verifyUser,
                // }).then((res) => {
                //   if (res.code === 200) {
                //     this.$message.success("操作成功");
                //     this.addVerifyDia = false;
                //     this.goback();
                //   }
                //   this.submitLoading = false;
                // })
                //   .catch((error) => {
                //     console.error(error);
                //     this.submitLoading = false;
                //   });
              })
              .catch(() => { });
          }
@@ -2663,12 +2684,23 @@
          } else {
            param = this.param;
          }
          let isNoTestValue = ''
          for (let key in param) {
            if (param[key]) {
              if (param[key].insValue?.length === 0) {
                isNoTestValue = 1
              } else {
                isNoTestValue = ''
              }
            }
          }
          saveInsContext({
            param: JSON.stringify(param),
            currentTable: this.currentTable,
            sampleId: this.currentSample.id,
            orderId: this.orderId,
            sonLaboratory: this.sonLaboratory
            sonLaboratory: this.sonLaboratory,
            isNoTestValue: isNoTestValue
          }).then((res) => {
            this.$message.success("已保存");
          });