| | |
| | | mounted() { |
| | | this.getDeviceList() |
| | | this.processInspectVo.id = this.$route.query.id |
| | | this.resultVal = this.$route.query.resultVal |
| | | this.resultVal = this.$route.params.resultVal |
| | | if (this.resultVal == null) { |
| | | let val = sessionStorage.getItem("process-resultVal-" + this.processInspectVo.id); |
| | | val == undefined ? this.resultVal = null : this.resultVal = val |
| | | } |
| | | console.log(this.resultVal); |
| | | this.init() |
| | | }, |
| | | methods: { |
| | |
| | | pro += arr.length |
| | | } |
| | | }) |
| | | let obj = { |
| | | id: this.processInspectVo.id, |
| | | number: 0, |
| | | result: this.inspectionResultForm[0].result |
| | | } |
| | | if (pro > 0) { |
| | | this.$prompt('请输入不合格数量', '不合格数量', { |
| | | confirmButtonText: '确定', |
| | |
| | | inputPattern: /^\d+$/, |
| | | inputErrorMessage: '请输入正确数字格式' |
| | | }).then(({ value }) => { |
| | | let data = { |
| | | id: this.processInspectVo.id, |
| | | number: value |
| | | } |
| | | updateProcessInspectsById(data).then(res => { |
| | | obj.number = value |
| | | updateProcessInspectsById(obj).then(res => { |
| | | let data = res.data.data |
| | | if (data) { |
| | | if (data.indexOf("成功") > 0) { |
| | |
| | | }); |
| | | }).catch(() => { }); |
| | | } else { |
| | | updateProcessInspectsById({ id: this.processInspectVo.id, number: 0 }).then(res => { |
| | | updateProcessInspectsById(obj).then(res => { |
| | | let data = res.data.data |
| | | if (data) { |
| | | if (data.indexOf("成功") > 0) { |
| | |
| | | } |
| | | }) |
| | | this.inspectionItems = result.children |
| | | let rVal = '1' |
| | | this.inspectionItems.forEach(item => { |
| | | if (item.children) { |
| | | item.children.forEach(obj => { |
| | | if (obj.iresult == 0) { |
| | | rVal = '0' |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.inspectionResultForm = [{ |
| | | materialCode: result.materialCode, |
| | | material: result.material, |
| | | userName: Array.from(new Set(userList)).join(","), |
| | | result: this.resultVal == null ? '' : this.resultVal, |
| | | result: this.resultVal == null ? rVal : this.resultVal, |
| | | }] |
| | | }).catch(error => { |
| | | console.log(error) |
| | |
| | | this.technologyList = sample.children |
| | | }, |
| | | changeState(row,isChecked) { |
| | | console.log(row); |
| | | const _than = this |
| | | if(isChecked){ |
| | | let isNumber = true |
| | |
| | | if (str === undefined || str === '' || str === null) { |
| | | return |
| | | } |
| | | |
| | | let obj = { |
| | | devideId: row.eId, |
| | | ppid: row.iid, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | changeRowResult(){ |
| | | if(this.inspectionItems){ |
| | | this.inspectionItems.forEach(e=>{ |
| | | if(e.children){ |
| | | e.children.forEach(i=>{ |
| | | if(i.empiricalValueAddss.length>1){ |
| | | let arr = i.inspectionValue.split(",") |
| | | arr.splice((arr.length-1),1) |
| | | let obj = { |
| | | devideId: i.eId, |
| | | ppid: i.iid, |
| | | inspectionValue: arr.join(","), |
| | | note : i.inote |
| | | } |
| | | updateProcessInsProduct(obj).then(res => { |
| | | if (res.data.code == 0) { |
| | | this.init() |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 删除检验值列 |
| | | clickDeleteInspectionColumn() { |
| | | if (this.empiricalValueAdd - 1 === 0) { |
| | | const _than = this |
| | | if (_than.empiricalValueAdd - 1 === 0) { |
| | | } else { |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.inspectionItems.forEach(i => { |
| | | i.empiricalValueAddss.splice(this.empiricalValueAdd, 1); |
| | | if (_than.empiricalValueAddMaxNumber != _than.empiricalValueAdd - 1) { |
| | | _than.empiricalValueAdd = _than.empiricalValueAdd - 1; |
| | | _than.changeRowResult() |
| | | _than.inspectionItems.forEach(i => { |
| | | if(i.children){ |
| | | i.children.forEach(ele=>{ |
| | | ele.empiricalValueAddss.splice(_than.empiricalValueAdd, 1); |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | } |