| | |
| | | <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" |
| | | @click="saveTable()">保存</el-button> |
| | | <el-button size="mini" @click="clickAddInspectionColumn()">添加检测值列</el-button> |
| | | <el-button size="mini" @click="clickDeleteInspectionColumn()">删除检测值列</el-button> |
| | | </el-col> |
| | |
| | | queryById, |
| | | updateDeviceById, |
| | | updateFinishedInsProduct, |
| | | updateFinishedInsProduct2, |
| | | updateFinishedInspectById, |
| | | selectDeviceAPI, |
| | | updateLocationIdById, |
| | |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | saveTable(){ |
| | | let finishedInsProducts = []; |
| | | if(this.inspectionItems.length>0){ |
| | | this.inspectionItems.forEach(item=>{ |
| | | if(item.children!=null&&item.children.length>0){ |
| | | item.children.forEach(item2=>{ |
| | | let obj = {}; |
| | | obj.id = item2.iid; |
| | | obj.note = item2.inote; |
| | | obj.required = item2.required; |
| | | obj.inspectionValue = item2.empiricalValueAddss.join(','); |
| | | obj.deviceId = item2.eId; |
| | | finishedInsProducts.push(obj); |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if(finishedInsProducts.length>0){ |
| | | updateFinishedInsProduct2(finishedInsProducts).then(res=>{ |
| | | if(res.data.code == 0){ |
| | | this.$message.success("更新成功") |
| | | }else{ |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | } |
| | | }, |
| | | delProcessConfigFile(row) { |
| | | this.$confirm('是否删除该附件', '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | if (str === undefined || str === '' || str === null ) { |
| | | return |
| | | } |
| | | let obj = { |
| | | deviceId: row.eId, |
| | | fpid: row.iid, |
| | | inspectionValue: str, |
| | | note : row.inote |
| | | } |
| | | updateFinishedInsProduct(obj).then(res=>{ |
| | | if(res.data.code == 0){ |
| | | this.$message.success("更新成功") |
| | | }else{ |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | }) |
| | | // let obj = { |
| | | // deviceId: row.eId, |
| | | // fpid: row.iid, |
| | | // inspectionValue: str, |
| | | // note : row.inote |
| | | // } |
| | | // updateFinishedInsProduct(obj).then(res=>{ |
| | | // if(res.data.code == 0){ |
| | | // this.$message.success("更新成功") |
| | | // }else{ |
| | | // this.$message.error("更新失败") |
| | | // } |
| | | // this.init() |
| | | // }) |
| | | } |
| | | }, |
| | | addTestProject() { |
| | |
| | | } else { |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.changeRowResult() |
| | | // this.changeRowResult() |
| | | this.saveTable() |
| | | this.inspectionItems.forEach(i => { |
| | | i.empiricalValueAddss.splice(this.empiricalValueAdd, 1); |
| | | }); |