From 677d8205512324f338fd0b9ee800fff721a8e7ef Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期六, 09 十二月 2023 17:16:13 +0800 Subject: [PATCH] 产品检验修改 --- src/views/quality/finishedProductInspection/finishedProduct-form.vue | 81 +++++++++++++++++++++++++++------------- 1 files changed, 55 insertions(+), 26 deletions(-) diff --git a/src/views/quality/finishedProductInspection/finishedProduct-form.vue b/src/views/quality/finishedProductInspection/finishedProduct-form.vue index b7c19e2..54f4123 100644 --- a/src/views/quality/finishedProductInspection/finishedProduct-form.vue +++ b/src/views/quality/finishedProductInspection/finishedProduct-form.vue @@ -8,17 +8,23 @@ <h2 v-else>缂栬緫-浜у搧妫�楠屽崟</h2> </div> <div class="btn-group header-right"> - <el-button @click="addTestProject" type="primary" v-if="processInspectVo.id==null">鐢熸垚妫�楠岄」鐩�</el-button> + <el-button @click="addTestProject" v-if="processInspectVo.id==null">鐢熸垚妫�楠岄」鐩�</el-button> </div> </div> <div class="page-main"> <div class="finishedProduct-basic"> <el-form :model="processInspectVo" ref="addInspectionform" class="l-mes" - label-position="right" label-width="120px" style="width: 100%" size="small"> + label-position="right" label-width="120px" style="width: 100%" size="small"> <div class="formwrapper"> <el-row> <el-col :span="6"> - <el-form-item label="璁㈠崟鍙凤細"> + <el-form-item label="浜у搧妫�楠岀紪鍙凤細"> + <el-input @blur="selectInfoByOrderId" disabled + v-model="processInspectVo.finInsNo" autocomplete="off" /> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="鎶ュ伐鍗曞彿锛�"> <el-input @blur="selectInfoByOrderId" :disabled="processInspectVo.id != null" v-model="processInspectVo.orderNumber" placeholder="璇疯緭鍏ヨ鍗曞彿" autocomplete="off" /> </el-form-item> @@ -35,6 +41,8 @@ placeholder="璇疯緭鍏ュ伐绋嬪悕绉�" autocomplete="off" /> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="6"> <el-form-item label="浜у搧鍚嶇О锛�"> <el-select style="width: 100%" @change="changeOptionsSamplename" :disabled="processInspectVo.id != null" @@ -45,8 +53,6 @@ </el-select> </el-form-item> </el-col> - </el-row> - <el-row> <el-col :span="6"> <el-form-item label="浜у搧缂栫爜锛�"> <el-input disabled v-model="processInspectVo.mcode" @@ -65,6 +71,8 @@ placeholder="璇疯緭鍏ュ崟浣�" autocomplete="off" /> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="6"> <el-form-item label="鏁伴噺锛�"> <el-input v-model="processInspectVo.quantity" placeholder="璇疯緭鍏ユ暟閲�" @@ -96,21 +104,22 @@ <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-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, scope.$index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> + @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, scope.$index)" :disabled="scope.row.eId == null" v-model="scope.row.empiricalValueAddss[index]" placeholder="璇烽�夋嫨"> - <el-option v-for="(item,i) in dataVal" :key="i" :label="item.label" + <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> @@ -133,7 +142,7 @@ </div> </template> </el-table-column> - <el-table-column prop="inspectionValue" v-for="(item, index) in empiricalValueAdd" :key="index" + <el-table-column prop="inspectionValue" :key="index" label="妫�楠屾弿杩�" width="240" style="text-align: center;"> <template slot-scope="scope"> <el-col v-if="scope.row.itype === '1'"> @@ -142,7 +151,7 @@ <el-input :disabled="scope.row.eId == null" v-model="scope.row.inote" - @blur="changeState(scope.row, scope.$index)" placeholder="璇疯緭鍏ユ楠屾弿杩�"></el-input> + @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ楠屾弿杩�"></el-input> <span v-if="resultVal != null && processInspectVo.id != null" v-text="scope.row.inote"></span> @@ -153,7 +162,7 @@ class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> <el-input :disabled="scope.row.eId == null" v-model="scope.row.inote" - @blur="changeState(scope.row, scope.$index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input> + @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"> @@ -240,6 +249,7 @@ empiricalValueAddMaxNumber: 0, processInspectVo: { id: null, + finInsNo: null, material: null, mcode: null, prname: null, @@ -249,7 +259,8 @@ quantity: null, specificationsModel: null, unit: null, - technologyId: null + technologyId: null, + documentId: null }, inspectionItems: [], // 鏂板妫�楠岄」鐩〃鏍� inspectionResultForm: [], @@ -275,6 +286,7 @@ this.init() }, methods: { + submitSave(){ let pro = 0 this.inspectionItems.forEach(item => { @@ -337,6 +349,7 @@ if(id != null){ queryById(id).then(res=>{ let result = res.data.data + this.processInspectVo.finInsNo = result.finInsNo this.processInspectVo.orderNumber = result.orderNumber this.processInspectVo.mcode = result.materialCode this.processInspectVo.prname = result.customerName @@ -345,10 +358,11 @@ this.processInspectVo.specificationsModel = result.specs this.processInspectVo.unit = result.punit this.processInspectVo.quantity = result.quantity + this.processInspectVo.documentId = result.documentId let userList = [] result.children.forEach(item=>{ item.iid = Math.random() - if(item.children){ + if(item.children != undefined){ item.children.forEach(obj=>{ let arr = [] if(obj.userName){ @@ -358,9 +372,9 @@ arr = obj.inspectionValue.split(",") } obj.empiricalValueAddss = arr - // if(obj.note){ - // snote=obj.inote - // } + if(obj.note){ + snote=obj.inote + } if(arr.length > this.empiricalValueAdd){ this.empiricalValueAdd = arr.length } @@ -388,15 +402,26 @@ }) }, updateDevice(row,index){ - updateDeviceById({equiomentId:row.eId,fpid:row.iid}).then(res=>{ + let rowId=JSON.stringify(row.iid) + console.log(row); + updateDeviceById({deviceId: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='' + obj.children.forEach(c=>{ + if(c.iid==rowId){ + c.inspectionValue = null + c.iresult = null + c.empiricalValueAddss = [] + c.inote='' + } + }) - } + // 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) @@ -411,6 +436,7 @@ this.processInspectVo.material = sample.material this.processInspectVo.specificationsModel = sample.specs this.processInspectVo.unit = sample.unit + this.processInspectVo.documentId = sample.documentId }, changeState(row, index) { if (row.iid != null && row.iid != '') { @@ -423,7 +449,7 @@ return } let obj = { - equiomentId: row.eId, + deviceId: row.eId, fpid: row.iid, inspectionValue: str, note : row.inote @@ -441,6 +467,7 @@ addTestProject() { let val = this.processInspectVo let data = { + finInsNo: val.finInsNo, customerName: val.prname, material: val.material, materialCode: val.mcode, @@ -449,6 +476,7 @@ quantity: val.quantity, specs: val.specificationsModel, unit: val.unit, + documentId: val.documentId } addFinish(data).then(res=>{ let id = res.data.data @@ -493,6 +521,7 @@ this.processInspectVo.material = null this.processInspectVo.specificationsModel = null this.processInspectVo.unit = null + this.processInspectVo.documentId = null } }) }, @@ -529,7 +558,7 @@ flex-wrap: wrap; } -.finishedProduct-result { +basic.finishedProduct-result { width: 100%; height: 150px; padding: 10px 20px; @@ -543,7 +572,7 @@ .finishedProduct-basic { background-color: #fff; - height: 120px; + height: 155px; display: flex; flex-wrap: wrap; padding: 10px 20px; -- Gitblit v1.9.3