zouyu
2023-09-15 5d681a5c48d6b09b7bc053795760fa8030f5f1cf
src/components/view/rawInsDetail.vue
@@ -194,6 +194,7 @@
          <template slot-scope="scope">
            <el-input
              :disabled="detailId != null"
              @blur="assertTest(scope.row)"
              v-model="scope.row.required"
              placeholder="请输入标准值"
            ></el-input>
@@ -202,6 +203,7 @@
        <el-table-column prop="internal" label="内控值" min-width="150">
          <template slot-scope="scope">
            <el-input
              @blur="assertTest(scope.row)"
              :disabled="detailId != null"
              v-model="scope.row.internal"
              placeholder="请输入内控值"
@@ -424,6 +426,23 @@
    }
  },
  methods: {
    assertTest(row){
      let fuArr=['>', '<', '=']
      if(!fuArr.includes(row.required[0])){
        this.$message({
                    message: "标准值["+row.required+"]格式首位应包含>,<或者=",
                    type: 'warning'
                });
                return
      }
      if(!fuArr.includes(row.internal[0])){
        this.$message({
                    message: "内控值["+row.internal+"]格式首位应包含>,<或者=",
                    type: 'warning'
                });
                return
      }
    },
    // 设备树过滤搜索
    filterNode(value, data) {
      if (!value) return true;
@@ -456,6 +475,20 @@
    },
    // 新增检验单
    async addNewRawInspect() {
      //TODO:
      console.log(this.projectTable);
      if(this.projectTable.length>0){
        let filterTable= this.projectTable.filter(item=>{
        return item.required===''||item.internal===''||item.required===null||item.internal===null
        })
        if(filterTable.length>0) {
          this.$message({
                    message: "标准值和内控值不能为空!",
                    type: 'warning'
                });
          return
        }
      }
      this.projectTable.forEach(i => {
        // 将列表转换为字符串
        i.testValue = i.testValueList.join(",");
@@ -474,19 +507,6 @@
    // 修改项目的检测值改变结论
    async changeState(row, index) {
      let val=row.testValueList.filter(item=>{
        return item!=''&&item!=null
      })
      let eq=val.filter(item=>{
        return /^[^><=]/.test(item)
      })
      if(eq.length>0){
        this.$message({
                    message: "输入值["+eq+"]格式首位应包含>,<或者=",
                    type: 'warning'
                });
      return
      }
      if (this.detailId !== null) {
        const res = await this.$axios.post(this.$api.url.updaterawInsProduct, {
          DevId: row.deviceId,