| | |
| | | >提 交</el-button |
| | | > |
| | | <el-button |
| | | icon="el-icon-download" |
| | | icon="el-icon-back" |
| | | @click=" |
| | | () => { |
| | | goBack(); |
| | |
| | | <template slot-scope="scope"> |
| | | <el-input |
| | | :disabled="detailId != null" |
| | | @blur="assertTest(scope.row)" |
| | | v-model="scope.row.required" |
| | | placeholder="请输入标准值" |
| | | ></el-input> |
| | |
| | | <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="请输入内控值" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { triggerRef } from "vue"; |
| | | import RawIns from "./raw-ins.vue"; |
| | | export default { |
| | | components: { RawIns }, |
| | |
| | | } else { |
| | | conclusion.testState = 1; |
| | | } |
| | | console.log([conclusion]); |
| | | return [conclusion]; |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | 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; |
| | |
| | | }, |
| | | // 新增检验单 |
| | | 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); |
| | | ).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(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 修改项目的检测值改变结论 |
| | |
| | | async submitSave() { |
| | | const res = await this.$axios.post( |
| | | this.$api.url.updateRawInspectsById + `${this.detailId}` |
| | | ); |
| | | this.$message.success("提交成功"); |
| | | this.getDetailInfo(); |
| | | ).then(res=>{ |
| | | this.$message.success("提交成功"); |
| | | this.getDetailInfo(); |
| | | this.goBack() |
| | | }); |
| | | }, |
| | | // 获取设备树内容 |
| | | getOptions() { |
| | |
| | | name: "", |
| | | required: "", |
| | | textValue: "", |
| | | testState:null, |
| | | testValueList: [], |
| | | unit: "" |
| | | }; |