| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="数量" prop="number"> |
| | | <el-input v-model="dataForm.number" /> |
| | | <el-input v-model="dataForm.number" :disabled="resultVal!=null" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | |
| | | <template slot-scope="scope"> |
| | | <el-tooltip :disabled="scope.row.equipmentId != null" class="item" effect="dark" content="请先选择设备!" |
| | | placement="top-start"> |
| | | <el-input :disabled="scope.row.equipmentId == null || dataForm.id!=null" v-model="scope.row.testValueList[index]" |
| | | @blur="updateTestValue(scope.row)" placeholder="请输入检测值"></el-input> |
| | | <el-input :disabled="scope.row.equipmentId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" |
| | | @blur="updateTestValue(scope.row,index)" placeholder="请输入检测值"></el-input> |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceName" label="试验设备" min-width="260"> |
| | | <template slot-scope="scope"> |
| | | <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%" v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row)"> |
| | | <el-select :disabled="resultVal!=null && dataForm.id!=null" style="width:100%" |
| | | v-model="scope.row.equipmentId" filterable @change="updateDevice(scope.row,scope.$index)"> |
| | | <el-option v-for="(item,index) in deviceList" |
| | | :key="index" :value="item.id" :label="item.number +'-'+ item.name"></el-option> |
| | | </el-select> |
| | |
| | | <el-dialog |
| | | title="上报" |
| | | :visible.sync="dialogVisible" |
| | | width="30%"> |
| | | width="30%" class="l-mes"> |
| | | <el-row> |
| | | <el-col> |
| | | <span>不合格数量:</span> |
| | |
| | | this.dataForm.id = this.$route.query.id |
| | | this.resultVal = this.$route.query.resultVal |
| | | if(this.resultVal == null){ |
| | | let val = sessionStorage.getItem("raw-resultVal") |
| | | let val = sessionStorage.getItem("raw-resultVal-"+this.dataForm.id) |
| | | val == undefined ? null : this.resultVal=val |
| | | } |
| | | this.init() |
| | | this.getDeviceList() |
| | | }, |
| | | watch:{ |
| | | |
| | | dialogVisible(newVal){ |
| | | if(newVal){ |
| | | this.unqualifiedNum = null |
| | | this.fiedNum = null |
| | | } |
| | | } |
| | | }, |
| | | methods:{ |
| | | changeName(index,row){ |
| | |
| | | } |
| | | this.showPart = true |
| | | }, |
| | | updateDevice(row){ |
| | | updateDevice(row,index){ |
| | | if(this.dataForm.id != null){ |
| | | updateDeviceById({equiomentId:row.equipmentId,rpId:row.rpId}).then(res=>{ |
| | | this.list[index].testValue = '' |
| | | this.list[index].testState = null |
| | | this.list[index].testValueList = [] |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | } |
| | | }, |
| | | showDialog(){ |
| | | this.dialogVisible = true |
| | | }, |
| | | submitSave(){ |
| | | let pro = this.list.filter(item => { |
| | | return item.testState == 0; |
| | | }) |
| | | if (pro.length > 0) { |
| | | let data = { |
| | | id: this.dataForm.id, |
| | | number: this.unqualifiedNum, |
| | | toLocationNo: this.fiedNum |
| | | } |
| | | updateRawInspectsById(data).then(res => { |
| | | if(res.data.code == 0){ |
| | | sessionStorage.setItem("raw-resultVal",data.judgeState) |
| | | this.$message.success("上报成功"); |
| | | } |
| | | }); |
| | | this.dialogVisible = true |
| | | }else{ |
| | | updateRawInspectsById({id:this.dataForm.id,number:0}).then(res => { |
| | | if(res.data.code == 0){ |
| | | sessionStorage.setItem("raw-resultVal",res) |
| | | this.$message.success("上报成功"); |
| | | } |
| | | }); |
| | | this.submitSave() |
| | | } |
| | | }, |
| | | //上报 |
| | | submitSave(){ |
| | | let data = { |
| | | id: this.dataForm.id, |
| | | number: this.unqualifiedNum, |
| | | toLocationNo: this.fiedNum |
| | | } |
| | | updateRawInspectsById(data).then(res => { |
| | | if(res.data.code == 0){ |
| | | sessionStorage.setItem("raw-resultVal-"+this.dataForm.id,res.data.data) |
| | | this.$message.success("上报成功"); |
| | | this.dialogVisible = false |
| | | } |
| | | }); |
| | | this.init() |
| | | }, |
| | | addTeatValueColumn(){ |
| | |
| | | } |
| | | } |
| | | }, |
| | | updateTestValue(row){ |
| | | if(row.rpId == null){ |
| | | updateTestValue(row,index){ |
| | | console.log(row,index) |
| | | if(row.rpId == null || row.testValueList[index]==null){ |
| | | return |
| | | } |
| | | let obj = { |
| | |
| | | let arr = [] |
| | | if(item.testValue != undefined ){ |
| | | arr = item.testValue.split(",") |
| | | this.empiricalValueAdd = arr.length |
| | | }else{ |
| | | this.empiricalValueAdd = 1 |
| | | if(arr.length > this.empiricalValueAdd){ |
| | | this.empiricalValueAdd = arr.length |
| | | } |
| | | } |
| | | this.list.push({ |
| | | equipmentId: item.equiomentId, |
| | |
| | | code: data.code, |
| | | name: data.name, |
| | | userName: Array.from(new Set(userNameList)).join(','), |
| | | judgeState: data.judgeState |
| | | judgeState: this.resultVal==null?null:this.resultVal |
| | | }] |
| | | }).catch(error=>{ |
| | | this.$message.error("获取失败",error) |
| | |
| | | }) |
| | | addRawInspects(data).then(res=>{ |
| | | this.$message.success("保存成功") |
| | | this.$router.go(-1) |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
| | | }) |