| | |
| | | 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 |
| | |
| | | } else { |
| | | this.$message.error("更新失败") |
| | | } |
| | | this.init() |
| | | this.init(this.dataForm.id) |
| | | }) |
| | | } |
| | | }) |
| | |
| | | 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=>{ |