modified: src/api/quality/finishedProduct.js
modified: src/api/quality/processInspect.js
modified: src/api/quality/rawMaterial.js
modified: src/views/product/workbench/taskinfo-pane.vue
modified: src/views/quality/Packaging_ledger/pack-from.vue
modified: src/views/quality/finishedProductInspection/finishedProduct-form.vue
modified: src/views/quality/packageinspect/packageInspect-form.vue
modified: src/views/quality/processInspect/index.vue
modified: src/views/quality/processInspect/processInspect-form.vue
modified: src/views/quality/rawMaterial/rawMaterial-form.vue
| | |
| | | |
| | | export function updateFinishedInspectById(obj) { |
| | | return request({ |
| | | url: '/mes/qualityFinishedInspect/updateFinishedInspectById', |
| | | url: '/mes/qualityFinishedInspect/updateFinishedInspectById2', |
| | | method: 'post', |
| | | params: obj |
| | | }) |
| | |
| | | |
| | | export function updateProcessInspectsById(query) { |
| | | return request({ |
| | | url: '/mes/qualityProcessInspect/updateProcessInspectsById', |
| | | url: '/mes/qualityProcessInspect/updateProcessInspectsById2', |
| | | method: 'post', |
| | | params: query |
| | | }) |
| | |
| | | |
| | | export function updateRawInspectsById(data) { |
| | | return request({ |
| | | url: '/mes/rawInspect/updateRawInspectsById/'+data.id, |
| | | url: '/mes/rawInspect/updateRawInspectsById2/'+data.id, |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | |
| | | currOperateTask: { |
| | | handler(newValue, oldValue) { |
| | | if (newValue.id) { |
| | | console.log( |
| | | 'currOperateTask', |
| | | this.currOperateTask.routingOperationRemark |
| | | ) |
| | | this.opTask.statusDesc = newValue.statusDesc |
| | | // 查询paramDatas |
| | | this.getTechnologyRoutingParam(newValue) |
| | |
| | | // ...mapGetters(['permissions']) |
| | | }, |
| | | created() { |
| | | this.getParamType() |
| | | // this.getParamType() |
| | | }, |
| | | 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 |
| | | } |
| | | updateFinishedInspectById(data).then(res => { |
| | | obj.number = value |
| | | updateFinishedInspectById(obj).then(res => { |
| | | if(res.data.data.indexOf("成功") > 0){ |
| | | this.$message.success("上报成功"); |
| | | this.checkTestState() |
| | |
| | | }); |
| | | }).catch(() => {}); |
| | | }else{ |
| | | updateFinishedInspectById({id:this.processInspectVo.id,number:0}).then(res => { |
| | | updateFinishedInspectById(obj).then(res => { |
| | | if(res.data.data.indexOf("成功") > 0){ |
| | | this.$message.success("上报成功"); |
| | | this.checkTestState() |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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, |
| | | fpid: row.iid, |
| | | inspectionValue: arr.join(","), |
| | | note : i.inote |
| | | } |
| | | updateFinishedInsProduct(obj).then(res => { |
| | | if (res.data.code == 0) { |
| | | this.init() |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 删除检验值列 |
| | | clickDeleteInspectionColumn() { |
| | | if (this.empiricalValueAdd - 1 === 0) { |
| | | } else { |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.changeRowResult() |
| | | this.inspectionItems.forEach(i => { |
| | | i.empiricalValueAddss.splice(this.empiricalValueAdd, 1); |
| | | }); |
| | |
| | | _than.confirmSubmit(_than.submitData,true) |
| | | } |
| | | }).catch(error=>{ |
| | | console.log("输入行号"); |
| | | _than.dialogVisible = true |
| | | }) |
| | | |
| | |
| | | }) |
| | | this.list[i].children.splice(childrenIndex,1) |
| | | } |
| | | this.changeResult() |
| | | }, |
| | | //保存检查项 |
| | | savePackIns(){ |
| | |
| | | updatePackageInsProduct(dataList).then(res=>{ |
| | | if(res.status===200){ |
| | | this.$message.success("保存成功") |
| | | this.init() |
| | | } |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | |
| | | addOrUpdateHandle(row) { |
| | | this.$router.push({ |
| | | name: 'processInspectForm', |
| | | query: { id: row == null ? null : row.id,resultVal : row == null ? null : row.result }, |
| | | }) |
| | | query: { id: row == null ? null : row.id }, |
| | | params: { resultVal : row == null ? null : row.result } |
| | | }) |
| | | }, |
| | | formatResult(row, column, cellValue){ |
| | | if(cellValue != undefined || cellValue != null){ |
| | |
| | | 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); |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | <template slot-scope="scope"> |
| | | <div v-if="!scope.row.children"> |
| | | <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="请先选择设备!" placement="top-start"> |
| | | <el-select @blur="changeState(scope.row, index)" style="width:100%" allow-create filterable default-first-option |
| | | <el-select style="width:100%" allow-create filterable default-first-option |
| | | :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" |
| | | v-model="scope.row.testValueList[index]" |
| | | placeholder="请输入或选择检测值" @change="updateTestValue(scope.row,scope.$index)"> |
| | | placeholder="请输入或选择检测值" |
| | | @change="changeState(scope.row,scope.$index)"> |
| | | <el-option label="是" value="是"/> |
| | | <el-option label="否" value="否"/> |
| | | </el-select> |
| | |
| | | let data = { |
| | | id: this.dataForm.id, |
| | | number: this.unqualifiedNum, |
| | | result: this.conclusionTable[0].testState |
| | | } |
| | | updateRawInspectsById(data).then(res => { |
| | | if(res.data.code == 0 && (res.data.data=='1'|| res.data.data=='0')){ |
| | |
| | | } |
| | | |
| | | }, |
| | | changeRowResult(){ |
| | | if(this.list){ |
| | | this.list.forEach(e=>{ |
| | | if(e.children){ |
| | | e.children.forEach(i=>{ |
| | | if(i.testValueList.length>1){ |
| | | let arr = i.testValue.split(",") |
| | | arr.splice((arr.length-1),1) |
| | | let obj = { |
| | | deviceId: i.deviceId, |
| | | rpId: i.rpId, |
| | | testValue: arr.join(","), |
| | | note: i.note |
| | | } |
| | | updateRawInsProduct(obj).then(res=>{ |
| | | if(res.data.code === 0){ |
| | | this.init() |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | delTeatValueColumn(){ |
| | | if (this.empiricalValueAdd - 1 > 0) { |
| | | if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) { |
| | | this.empiricalValueAdd = this.empiricalValueAdd - 1; |
| | | this.changeRowResult() |
| | | this.list.forEach(i => { |
| | | i.testValueList.splice(this.empiricalValueAdd, 1); |
| | | if(i.children){ |
| | | i.children.forEach(ele=>{ |
| | | ele.testValueList.splice(this.empiricalValueAdd, 1); |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | updateTestValue(row,index){ |
| | | if(row.rpId == null){ |
| | | return |
| | | } |
| | | let val = row.testValueList.join(","); |
| | | let obj = { |
| | | deviceId: row.deviceId, |
| | | rpId: row.rpId, |
| | | testValue: val, |
| | | note: row.note |
| | | } |
| | | updateRawInsProduct(obj).then(res=>{ |
| | | if(res.data.code === 0){ |
| | | this.$message.success("更新成功") |
| | | this.init() |
| | | }else{ |
| | | this.$message.success("更新失败") |
| | | } |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
| | | }) |
| | | }, |
| | | init(){ |
| | | if(this.dataForm.id){ |
| | |
| | | this.list.push(ele) |
| | | }} |
| | | }) |
| | | let rVal = '1' |
| | | this.list.forEach(item=>{ |
| | | if(item.children){ |
| | | item.children.forEach(ele=>{ |
| | | if(ele.testState == 0){ |
| | | rVal = '0' |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.conclusionTable = [{ |
| | | code: data.code, |
| | | name: data.name, |
| | | userName: Array.from(new Set(userNameList)).join(','), |
| | | testState: this.resultVal==null?null:this.resultVal |
| | | testState: this.resultVal==null?rVal:this.resultVal |
| | | }] |
| | | }).catch(error=>{ |
| | | this.$message.error("获取失败",error) |
| | |
| | | } |
| | | }, |
| | | changeState(row, index) { |
| | | if(row){ |
| | | let isTrue = true |
| | | for(var i=0;i<row.testValueList.length;i++){ |
| | | let val = row.testValueList[i] |
| | | let reg = /^[0-9]*[1-9][0-9]*$/ |
| | | console.log(['是','否'].includes(val)); |
| | | if(!reg.test(val) && !['是','否'].includes(val)){ |
| | | this.$message.error("请输入数字或选择是否") |
| | | row.testValueList[i] = null |
| | | isTrue = false |
| | | } |
| | | } |
| | | if(!isTrue){ |
| | | return |
| | | } |
| | | } |
| | | if (row.rpId != null && row.rpId != '') { |
| | | let val = row.testValueList.join(",") |
| | | if (val === undefined || val === '' || val === null) { |