From 26c4f7ae79ad5ad2300876b94f96f19e4f93d53a Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期一, 18 十二月 2023 16:02:12 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before --- src/views/quality/processInspect/processInspect-form.vue | 126 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 110 insertions(+), 16 deletions(-) diff --git a/src/views/quality/processInspect/processInspect-form.vue b/src/views/quality/processInspect/processInspect-form.vue index 31f055e..505338e 100644 --- a/src/views/quality/processInspect/processInspect-form.vue +++ b/src/views/quality/processInspect/processInspect-form.vue @@ -137,11 +137,17 @@ <span v-if="resultVal != null && scope.row.iname != null" v-text="scope.row.ename"></span> <div v-else> - <el-select style="width:100%" v-model="scope.row.eId" v-if="scope.row.iname != null" + <el-select style="width:80%" v-model="scope.row.eId" v-if="scope.row.iname != null" filterable @change="updateDevice(scope.row, scope.$index)"> <el-option v-for="(item, index) in deviceList" :key="index" :value="item.id" :label="item.code + '-' + item.name"></el-option> </el-select> + <el-button + size="small" + slot="append" + icon="el-icon-full-screen" + v-if="scope.row.iname != null" + @click="codeDevice(scope.row,scope.$index)"></el-button> </div> </template> </el-table-column> @@ -202,6 +208,18 @@ </el-row> </div> </div> + <el-dialog + title="璁惧鎵弿" + :visible.sync="deviceCode" + width="60%"> + <div style="height: 100vh;width: 100%;"> + <qr-code-app ref="codeDeviceCompont" @ok="getDeviceResultInfo" @cancelCodeDialog="cancelDeviceCodeDialog"></qr-code-app> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="deviceCode = false">鍙� 娑�</el-button> + <el-button type="primary" @click="deviceCode = false">纭� 瀹�</el-button> + </span> +</el-dialog> </div> </template> @@ -215,9 +233,16 @@ updateProcessInspectsById, } from '@/api/quality/processInspect' import { selectDevice } from '@/api/quality/processInspect' +import qrCodeApp from '@/views/common/qrCodeApp' export default { + components:{ + qrCodeApp + }, data() { return { + row: null, + proIndex: 0, + deviceCode: false, rules: { orderNumber: [{required:true,message:'璁㈠崟鍙蜂笉鑳戒负绌�',trigger:'blur'}] }, @@ -264,14 +289,42 @@ 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: { + cancelDeviceCodeDialog(){ + this.deviceCode = false + }, + getDeviceResultInfo(val){ + console.log("鎵弿鍚庢暟鎹�",val); + let id=val.split("id@")[1] + if(id!=undefined&&id!=''&&id!=null){ + let filterData=this.deviceList.filter(item=>{ + return item.id==id + })[0] + console.log(filterData); + this.row.eId=Number(id) + this.updateDevice(this.row) + }else{ + this.$message({ + message: '鏈瘑鍒嚭浜屼綅鐮佽閲忓櫒鍏蜂俊鎭紒', + type: 'warning' + }); + } + }, + codeDevice(row,index){ + this.row=row + console.log("row",row); + this.deviceCode =true + this.$refs.codeDeviceCompont.openCamera() + this.proIndex=index + }, submitSave() { let pro = 0 this.inspectionItems.forEach(item => { @@ -282,6 +335,11 @@ pro += arr.length } }) + let obj = { + id: this.processInspectVo.id, + number: 0, + result: this.inspectionResultForm[0].result + } if (pro > 0) { this.$prompt('璇疯緭鍏ヤ笉鍚堟牸鏁伴噺', '涓嶅悎鏍兼暟閲�', { confirmButtonText: '纭畾', @@ -289,11 +347,8 @@ 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) { @@ -307,7 +362,7 @@ }); }).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) { @@ -373,11 +428,21 @@ } }) 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) @@ -418,7 +483,6 @@ this.technologyList = sample.children }, changeState(row,isChecked) { - console.log(row); const _than = this if(isChecked){ let isNumber = true @@ -443,7 +507,6 @@ if (str === undefined || str === '' || str === null) { return } - let obj = { devideId: row.eId, ppid: row.iid, @@ -510,14 +573,45 @@ } }) }, + 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); + }) + } }); } } -- Gitblit v1.9.3