| | |
| | | <el-tab-pane label="检验项目"> |
| | | <el-row> |
| | | <el-col v-if="resultVal == null" :span="24" class="inspectionProject_span" style="text-align: right;"> |
| | | <el-button size="small" |
| | | type="primary" |
| | | v-if="inspectionItems&&inspectionItems.length>0" |
| | | @click="saveTable()">保存</el-button> |
| | | <el-button size="mini" @click="clickAddInspectionColumn()">添加检测值列</el-button> |
| | | <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检测值列</el-button> |
| | | </el-col> |
| | |
| | | queryById, |
| | | updateDeviceBypppId, |
| | | updateProcessInsProduct, |
| | | updateProcessInsProduct2, |
| | | updateProcessInspectsById, |
| | | } from '@/api/quality/processInspect' |
| | | import { |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | saveTable(){ |
| | | let processInsProduct = []; |
| | | this.inspectionItems.forEach((item) => { |
| | | if(item.children&&item.children.length>0){ |
| | | item.children.forEach((child)=>{ |
| | | let obj = {} |
| | | obj.id = child.iid; |
| | | obj.eId = child.ieId; |
| | | obj.note = child.inote; |
| | | obj.inspectionValue = child.empiricalValueAddss.join(','); |
| | | obj.required = child.required; |
| | | processInsProduct.push(obj) |
| | | }) |
| | | } |
| | | }) |
| | | if(processInsProduct.length>0){ |
| | | updateProcessInsProduct2(processInsProduct).then(res => { |
| | | if (res.data.code == 0) { |
| | | this.$message.success("更新成功") |
| | | } else { |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | } |
| | | }, |
| | | delProcessConfigFile(row) { |
| | | this.$confirm('是否删除该附件', '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | return |
| | | } |
| | | } |
| | | if (row.iid != null && row.iid != '') { |
| | | let str = "" |
| | | row.empiricalValueAddss.forEach(e => { |
| | | str += e + "," |
| | | }) |
| | | str = str.slice(0, -1); |
| | | if (str === undefined || str === '' || str === null) { |
| | | return |
| | | } |
| | | let obj = { |
| | | devideId: row.eId, |
| | | ppid: row.iid, |
| | | inspectionValue: str, |
| | | note : row.inote |
| | | } |
| | | updateProcessInsProduct(obj).then(res => { |
| | | if (res.data.code == 0) { |
| | | this.$message.success("更新成功") |
| | | } else { |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | } |
| | | // if (row.iid != null && row.iid != '') { |
| | | // let str = "" |
| | | // row.empiricalValueAddss.forEach(e => { |
| | | // str += e + "," |
| | | // }) |
| | | // str = str.slice(0, -1); |
| | | // if (str === undefined || str === '' || str === null) { |
| | | // return |
| | | // } |
| | | // let obj = { |
| | | // devideId: row.eId, |
| | | // ppid: row.iid, |
| | | // inspectionValue: str, |
| | | // note : row.inote |
| | | // } |
| | | // updateProcessInsProduct(obj).then(res => { |
| | | // if (res.data.code == 0) { |
| | | // this.$message.success("更新成功") |
| | | // } else { |
| | | // this.$message.error("更新失败") |
| | | // } |
| | | // this.init() |
| | | // }) |
| | | // } |
| | | }, |
| | | addTestProject() { |
| | | let val = this.processInspectVo |