| | |
| | | :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" |
| | | v-model="scope.row.testValueList[index]" |
| | | placeholder="请输入或选择检测值" |
| | | allow-create |
| | | default-first-option |
| | | @change="changeState(scope.row,scope.$index)" |
| | | @blur="selectBlur" |
| | | > |
| | |
| | | let val = sessionStorage.getItem("raw-resultVal-"+this.dataForm.id) |
| | | val == undefined ? null : this.resultVal=val |
| | | } |
| | | this.init() |
| | | this.init(this.dataForm.id) |
| | | this.getDeviceList() |
| | | }, |
| | | watch:{ |
| | |
| | | } |
| | | updateRawInsProduct(obj).then(res=>{ |
| | | if(res.data.code === 0){ |
| | | this.init() |
| | | this.init(this.dataForm.id) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | init(){ |
| | | if(this.dataForm.id){ |
| | | getObj(this.dataForm.id).then(res=>{ |
| | | init(id){ |
| | | if(id){ |
| | | getObj(id).then(res=>{ |
| | | let data = res.data.data |
| | | this.dataForm.rawInsNo = data.rawInsNo |
| | | this.dataForm.name = data.name |
| | |
| | | } |
| | | }, |
| | | selectBlur(e){ |
| | | console.log(e); |
| | | console.log(e,e.target.tabIndex); |
| | | console.log(e.target.value); |
| | | }, |
| | | changeState(row, index) { |
| | | console.log(row.testValueList); |
| | | return |
| | | this.$nextTick(()=>{ |
| | | if(row){ |
| | | let isTrue = true |
| | |
| | | if (val === undefined || val === '' || val === null) { |
| | | return |
| | | } |
| | | console.log(val); |
| | | console.log(...row.testValueList); |
| | | let obj = { |
| | | deviceId: row.deviceId, |
| | | rpId: row.rpId, |
| | | testValue: val, |
| | | note: row.note |
| | | } |
| | | console.log(obj); |
| | | return |
| | | updateRawInsProduct(obj).then(res => { |
| | | if (res.data.code == 0) { |
| | | this.$message.success("更新成功") |
| | | } else { |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | this.init(this.dataForm.id) |
| | | }) |
| | | } |
| | | }) |
| | |
| | | let childrenIndex = this.list[i].children.findIndex(el =>{ |
| | | return el.iid == row.iid |
| | | }) |
| | | this.list[i].children.splice(childrenIndex,1) |
| | | if(this.list[i].children.length<2){ |
| | | this.list.splice(i,1) |
| | | }else{ |
| | | this.list[i].children.splice(childrenIndex,1) |
| | | } |
| | | } |
| | | }, |
| | | //添加子项目 |
| | |
| | | row.children.push(obj) |
| | | }, |
| | | save(){ |
| | | const _than = this |
| | | let data = this.dataForm |
| | | this.list.forEach(item=>{ |
| | | item.children.forEach(c=>{ |
| | |
| | | data.rawInsProducts = this.list |
| | | addRawInspects(data).then(res=>{ |
| | | this.$message.success("保存成功") |
| | | this.$router.go(-1) |
| | | // this.$router.go(-1) |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
| | | }) |
| | | _than.$nextTick(()=>{ |
| | | _than.init(Number(res.data.msg)) |
| | | }) |
| | | }, |
| | | getDeviceList(){ |
| | | selectDevice().then(res=>{ |