| | |
| | | }, |
| | | methods: { |
| | | assertTest(row){ |
| | | if(!/^[^><=]/.test(row.required)){ |
| | | let fuArr=['>', '<', '='] |
| | | if(!fuArr.includes(row.required[0])){ |
| | | this.$message({ |
| | | message: "标准值["+row.required+"]格式首位应包含>,<或者=", |
| | | type: 'warning' |
| | | }); |
| | | return |
| | | } |
| | | if(!/^[^><=]/.test(row.internal)){ |
| | | if(!fuArr.includes(row.internal[0])){ |
| | | this.$message({ |
| | | message: "内控值["+row.internal+"]格式首位应包含>,<或者=", |
| | | type: 'warning' |
| | |
| | | }, |
| | | // 新增检验单 |
| | | 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||item.name==='' |
| | | }) |
| | | if(filterTable.length>0) { |
| | | this.$message({ |
| | | message: "项目名称,标准值和内控值不能为空!", |
| | | type: 'warning' |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | this.projectTable.forEach(i => { |
| | | // 将列表转换为字符串 |
| | | i.testValue = i.testValueList.join(","); |
| | | }); |
| | | this.detailInfo.rawInsProducts = this.projectTable; |
| | | const res = await this.$axios.post( |
| | | this.$axios.post( |
| | | this.$api.url.addRawInspects, |
| | | { ...this.detailInfo }, |
| | | { headers: { "Content-Type": "application/json" } } |
| | | ); |
| | | this.detailId = res.data; |
| | | this.getDetailInfo(); |
| | | this.$message.success(res.message); |
| | | this.goBack(); |
| | | ).then(res=>{ |
| | | console.log(res); |
| | | if(res.code=="201"){ |
| | | this.$message({ |
| | | message: res.message, |
| | | type: 'warning' |
| | | }); |
| | | return |
| | | }else{ |
| | | // this.detailId = res.data; |
| | | // this.getDetailInfo(); |
| | | // // this.$message.success(res.message); |
| | | // this.goBack(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 修改项目的检测值改变结论 |