From 62691f7fd5a5a495c38f4f17befa053bf61192b1 Mon Sep 17 00:00:00 2001 From: 86134 <aa> Date: 星期四, 09 十一月 2023 09:52:41 +0800 Subject: [PATCH] 11 --- src/views/quality/finishedProductInspection/finishedProduct-form.vue | 138 ++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 122 insertions(+), 16 deletions(-) diff --git a/src/views/quality/finishedProductInspection/finishedProduct-form.vue b/src/views/quality/finishedProductInspection/finishedProduct-form.vue index 46c7e91..03d109d 100644 --- a/src/views/quality/finishedProductInspection/finishedProduct-form.vue +++ b/src/views/quality/finishedProductInspection/finishedProduct-form.vue @@ -75,8 +75,13 @@ </div> </el-form> </div> - <div class="finishedProduct-detail"> + + + + + <div class="finishedProduct-detail" v-if="resultVal!=null && processInspectVo.id!=null" > <el-row style="width:100%;z-index: 10;height:30px;"> + <el-col :span="12" class="inspectionProject_span" @click="increase">娣诲姞</el-col> <el-col :span="12" class="inspectionProject_span">妫�楠岄」鐩�</el-col> <el-col v-if="resultVal==null" :span="12" class="inspectionProject_span" style="text-align: right;"> <el-button size="mini" @click="clickAddInspectionColumn()">娣诲姞妫�娴嬪�煎垪</el-button> @@ -96,28 +101,74 @@ <el-table-column prop="required" label="鏍囧噯鍊�" width="240" ></el-table-column> <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" label="妫�娴嬪��" width="240" style="text-align: center;"> + <template slot-scope="scope"> - <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null" - class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" - placement="top-start"> - <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" - @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> - <span v-if="resultVal != null" v-text="scope.row.empiricalValueAddss[index]"></span> + <el-col v-if="scope.row.itype === '1'"> + <el-tooltip v-if="scope.row.iname!=null" :disabled="scope.row.eId != null" + class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" + placement="top-start"> + <el-input :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" + @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> + <span v-if="resultVal != null" v-text="scope.row.empiricalValueAddss[index]"></span> </el-tooltip> + </el-col> + <el-col v-else> + <el-tooltip v-if="scope.row.iname != null" :disabled="scope.row.eId != null" + class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> + <el-select style="width: 100%;" @change="changeState(scope.row, index)" :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" placeholder="璇烽�夋嫨"> + <el-option v-for="item in dataVal" :key="item.value" :label="item.label" + :value="item.value"> + </el-option> + </el-select> + <span v-if="resultVal != null && processInspectVo.id != null" + v-text="scope.row.empiricalValueAddss[index]"></span> + </el-tooltip> + </el-col> </template> </el-table-column> <el-table-column prop="deviceName" label="璇曢獙璁惧" min-width="250"> <template slot-scope="scope"> <span v-if="resultVal!=null && processInspectVo.id!=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" filterable @change="updateDevice(scope.row)"> + <el-input v-model="scope.row.eId" v-if="scope.row.iname != null" placeholder="璇疯緭鍏ヨ澶囧彿"></el-input> + <!-- <el-select style="width:100%" 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.number +'-'+ item.name"></el-option> - </el-select> + </el-select> --> </div> </template> </el-table-column> + <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" + label="妫�楠屾弿杩�" width="240" style="text-align: center;"> + <template slot-scope="scope"> + <el-col v-if="scope.row.itype === '1'"> + <el-tooltip v-if="scope.row.iname != null" :disabled="scope.row.eId != null" + class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> + <el-input :disabled="scope.row.eId == null" + v-model="scope.row.inote" + @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ楠屾弿杩�"></el-input> + <span v-if="resultVal != null && processInspectVo.id != null" + v-text="scope.row.inote"></span> + </el-tooltip> + </el-col> + <el-col v-else> + <el-tooltip v-if="scope.row.iname != null" :disabled="scope.row.eId != null" + class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> + <!-- <el-input :disabled="scope.row.eId == null" + v-model="scope.row.empiricalValueAddss[index]" + @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> --> + <el-select style="width: 100%;" @change="changeState(scope.row, index)" :disabled="scope.row.eId == null" v-model="scope.row.inote" placeholder="璇烽�夋嫨"> + <el-option v-for="item in dataVal" :key="item.value" :label="item.label" + :value="item.value"> + </el-option> + </el-select> + <span v-if="resultVal != null && processInspectVo.id != null" + v-text="scope.row.inote"></span> + </el-tooltip> + </el-col> + </template> + </el-table-column> <el-table-column label="缁撹" fixed="right" min-width="100"> <template slot-scope="scope"> <div v-if="scope.row.iname!=null"> @@ -131,6 +182,40 @@ </el-col> </el-row> </div> + <div v-else> + + </div> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <div class="finishedProduct-result"> <el-row style="width:100%"> <el-col :span="24">妫�娴嬬粨鏋�</el-col> @@ -175,6 +260,13 @@ export default { data() { return { + dataVal: [{ + label: '鏄�', + value: '鏄�' + }, { + label: '鍚�', + value: '鍚�' + }], resultVal: null, deviceList: [], hasChildren: true, @@ -214,12 +306,13 @@ this.processInspectVo.id = this.$route.query.id this.resultVal = this.$route.query.resultVal if(this.resultVal == null){ - let val = sessionStorage.getItem("finished-resultVal"); + let val = sessionStorage.getItem("finished-resultVal-"+this.processInspectVo.id); val == undefined ? this.resultVal=null : this.resultVal = val } this.init() }, methods: { + submitSave(){ let pro = 0 this.inspectionItems.forEach(item => { @@ -227,7 +320,6 @@ let arr = item.children.filter(obj=>{ return obj.iresult == 0; }) - console.log("aaa--",arr,arr.length) pro+=arr.length } }) @@ -276,7 +368,7 @@ }) this.resultVal = resultVal this.inspectionResultForm[0].result = resultVal - sessionStorage.setItem("finished-resultVal",resultVal) + sessionStorage.setItem("finished-resultVal-"+this.processInspectVo.id,resultVal) }, init(){ let id = this.processInspectVo.id @@ -304,6 +396,9 @@ arr = obj.inspectionValue.split(",") } obj.empiricalValueAddss = arr + if(obj.note){ + snote=obj.inote + } if(arr.length > this.empiricalValueAdd){ this.empiricalValueAdd = arr.length } @@ -324,11 +419,21 @@ }, getDeviceList(){ selectDevice(null).then(res=>{ - this.deviceList = res.data.data + // this.deviceList = res.data.data + console.log(res); }) }, - updateDevice(row){ + updateDevice(row,index){ updateDeviceById({equiomentId:row.eId,fpid:row.iId}).then(res=>{ + this.inspectionItems.forEach(obj=>{ + if(obj.children){ + obj.children[index-1].inspectionValue = '' + obj.children[index-1].iresult = null + obj.children[index-1].empiricalValueAddss = [] + obj.children[index-1].inote='' + + } + }) }).catch(error=>{ console.log(error) }) @@ -356,7 +461,8 @@ let obj = { equiomentId: row.eId, fpid: row.iid, - inspectionValue: str + inspectionValue: str, + note : row.inote } updateFinishedInsProduct(obj).then(res=>{ if(res.data.code == 0){ -- Gitblit v1.9.3