From 60299f0637a3e7b1490f643e479a921533bf76ca Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期三, 17 一月 2024 16:56:43 +0800 Subject: [PATCH] 质检-树形序号修改 --- src/views/quality/rawMaterial/rawMaterial-form.vue | 90 +++++++++++++++++++++-------- src/views/plan/manufacturingorder/index.vue | 12 ++-- src/views/quality/packageinspect/packageInspect-form.vue | 23 +++++-- src/views/common/processinspect-part.vue | 10 +-- src/views/quality/exception/exception-form.vue | 2 src/views/quality/finishedProductInspection/finishedProduct-form.vue | 10 ++ src/views/quality/rawMaterial/index.vue | 9 +- src/views/quality/processInspect/processInspect-form.vue | 11 ++- 8 files changed, 110 insertions(+), 57 deletions(-) diff --git a/src/views/common/processinspect-part.vue b/src/views/common/processinspect-part.vue index f7f7ade..fdc3d3d 100644 --- a/src/views/common/processinspect-part.vue +++ b/src/views/common/processinspect-part.vue @@ -27,7 +27,7 @@ > <template #toolbar></template> </ttable> - + <div slot="footer" class="dialog-footer"> <el-button @click="innerVisible = false">鍙� 娑�</el-button> <el-button type="primary" @click="saveSelectRow">纭� 瀹�</el-button> @@ -182,10 +182,9 @@ ttable }, created(){ - + }, mounted() { - console.log(this.currshowlist,"寮�"); }, // props:['currentRow'], methods: { @@ -240,11 +239,11 @@ .part-dialog .el-dialog__body { padding: 5px 20px; } - + .part-dialog .el-dialog__footer { padding: 5px 20px 10px; } - + .part-dialog .el-dialog__body .avue-crud__pagination { margin-top: 0px; margin-bottom: 5px; @@ -255,4 +254,3 @@ } } */ </style> - \ No newline at end of file diff --git a/src/views/plan/manufacturingorder/index.vue b/src/views/plan/manufacturingorder/index.vue index b9bfe77..71a087f 100644 --- a/src/views/plan/manufacturingorder/index.vue +++ b/src/views/plan/manufacturingorder/index.vue @@ -204,10 +204,10 @@ <el-dialog title="鏍囩鍒楄〃" :visible.sync="diaPrintTab" width="28%" top="5vh"> <div style="width:100%;height: 400px;overflow-y: auto;"> <div class="dia_body"> - <el-checkbox + <el-checkbox style="margin: 10px 5px;" - :indeterminate="isIndeterminate" - v-model="checkAll" + :indeterminate="isIndeterminate" + v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox> <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList"> <el-card class="box-card" v-for="(item, i) in qrData" :key="i" style="margin-bottom: 15px; font-size: 16px !important;"> @@ -601,7 +601,7 @@ return this.bomTypeDbOptions } }, - + { minWidth: '120', prop: 'manufactureAttr', @@ -1142,7 +1142,7 @@ printable: 'printMOrder',//椤甸潰 type: "html",//鏂囨。绫诲瀷 maxWidth:450, - targetStyles:['*'], + targetStyles:['*'], style: `@page { margin:0; size: 360px 175px; @@ -1167,7 +1167,7 @@ console.log(data); let index = Number(data.qtyRequired) + Number(data.scrapQty) if(index>0){ - for(var i=1;i<= index;i++){ + for(var i=index;i>= 1;i--){ let obj = { orderNo: data.customerOrderNo, cName: data.customerName, diff --git a/src/views/quality/exception/exception-form.vue b/src/views/quality/exception/exception-form.vue index ef33e4e..070dbed 100644 --- a/src/views/quality/exception/exception-form.vue +++ b/src/views/quality/exception/exception-form.vue @@ -216,7 +216,7 @@ }, created() { this.getExceptionHandleType() - this.getWxNoticeList() + // this.getWxNoticeList() }, methods: { init(id) { diff --git a/src/views/quality/finishedProductInspection/finishedProduct-form.vue b/src/views/quality/finishedProductInspection/finishedProduct-form.vue index d2354d9..10715eb 100644 --- a/src/views/quality/finishedProductInspection/finishedProduct-form.vue +++ b/src/views/quality/finishedProductInspection/finishedProduct-form.vue @@ -113,7 +113,11 @@ :header-cell-style="{textAlign:'center',color:'black',backgroundColor:'#fafafa'}" :cell-style="{textAlign:'center'}" row-key="iid" default-expand-all style="width: 100%" ref="table" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> - <el-table-column type="index" label="搴忓彿" width="60"></el-table-column> + <el-table-column type="index" prop="parentIndex" label="搴忓彿" width="60"> + <template scope="scope"> + <span v-if="scope.row.isIndex">{{scope.row.parentIndex}}</span> + </template> + </el-table-column> <el-table-column label="椤圭洰" prop="father" show-overflow-tooltip width="140" ></el-table-column> <el-table-column prop="iname" label="鎸囨爣" show-overflow-tooltip width="140" ></el-table-column> <el-table-column prop="iunit" label="鍗曚綅" show-overflow-tooltip width="140" ></el-table-column> @@ -442,8 +446,10 @@ this.processInspectVo.locName = result.locName this.processInspectVo.productNo = result.productNo let userList = [] - result.children.forEach(item=>{ + result.children.forEach((item,index)=>{ item.iid = Math.random() + item.isIndex = true; + item.parentIndex = index + 1; if(item.children != undefined){ item.children.forEach(obj=>{ let arr = [] diff --git a/src/views/quality/packageinspect/packageInspect-form.vue b/src/views/quality/packageinspect/packageInspect-form.vue index 873dc2b..2cf2980 100644 --- a/src/views/quality/packageinspect/packageInspect-form.vue +++ b/src/views/quality/packageinspect/packageInspect-form.vue @@ -92,7 +92,10 @@ row-key="randomId" class="l-mes" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> - <el-table-column type="index" label="搴忓彿" width="60"> + <el-table-column type="index" prop="parentIndex" label="搴忓彿" width="60"> + <template scope="scope"> + <span v-if="scope.row.isIndex">{{scope.row.parentIndex}}</span> + </template> </el-table-column> <el-table-column prop="name" label="椤圭洰" width="160"> <template slot-scope="scope"> @@ -256,7 +259,6 @@ } this.getAllInspect() this.init() - this.checkShowState() }, watch:{ @@ -273,7 +275,7 @@ if(ele.children){ ele.children.forEach(c=>{ if(c.pid){ - num++ + num+=1 } }) } @@ -367,6 +369,8 @@ clickAddLine() { this.list.push({ name: '', + isIndex : true, + parentIndex : this.list.length + 1, randomId: Math.random(), isEdit: true, children: [{ @@ -457,10 +461,12 @@ let userNameList = [] if(dataList){ let tempList = [] - dataList.forEach(ele=>{ + dataList.forEach((ele,index)=>{ let obj = { randomId: Math.random(), name: ele.inspectName, + isIndex: true, + parentIndex: index+1, children: [] } if(ele.children){ @@ -478,9 +484,11 @@ }) _than.list = tempList } - data.packageInsProductS.forEach(item => { + data.packageInsProductS.forEach((item,index) => { if (item.children) { let ele = { + isIndex: true, + parentIndex: index+1, isEdit: true, randomId: Math.random(), name: null, @@ -505,9 +513,7 @@ _than.list.push(ele) } }) - // let find1 = this.list.find(ele=>ele.name===inspect1[0].name&&ele.isEdit) !=undefined; - // let find2 = this.list.find(ele=>ele.name===inspect2[0].name&&ele.isEdit) !=undefined; - // this.isShow = find1||find2 + _than.conclusionTable = [{ packageNo: data.packageNo, userName: Array.from(new Set(userNameList)).join(','), @@ -516,6 +522,7 @@ _than.$nextTick(()=>{ if(_than.list.length>0){ _than.changeResult() + _than.checkShowState() } }) }).catch(error=>{ diff --git a/src/views/quality/processInspect/processInspect-form.vue b/src/views/quality/processInspect/processInspect-form.vue index d0d066d..ba99dd7 100644 --- a/src/views/quality/processInspect/processInspect-form.vue +++ b/src/views/quality/processInspect/processInspect-form.vue @@ -124,7 +124,11 @@ default-expand-all style="width: 100%" ref="table" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> - <el-table-column type="index" label="搴忓彿" show-overflow-tooltip width="60"></el-table-column> + <el-table-column type="index" prop="parentIndex" label="搴忓彿" width="60"> + <template scope="scope"> + <span v-if="scope.row.isIndex">{{scope.row.parentIndex}}</span> + </template> + </el-table-column> <el-table-column label="椤圭洰" prop="father" show-overflow-tooltip width="140"></el-table-column> <el-table-column prop="iname" label="鎸囨爣" show-overflow-tooltip width="140"></el-table-column> <el-table-column prop="iunit" label="鍗曚綅" show-overflow-tooltip width="140"></el-table-column> @@ -345,7 +349,6 @@ }, methods: { queryCode(){ - console.log("llll"); this.workshop = true console.log(this.workshop); // this.paramObj = { @@ -481,7 +484,9 @@ this.processInspectVo.unit = result.punit this.processInspectVo.quantity = result.quantity let userList = [] - result.children.forEach(item => { + result.children.forEach((item,index) => { + item.isIndex = true; + item.parentIndex = index + 1; item.iid = Math.random() if (item.children != undefined) { item.children.forEach(obj => { diff --git a/src/views/quality/rawMaterial/index.vue b/src/views/quality/rawMaterial/index.vue index 3437c51..063bb40 100644 --- a/src/views/quality/rawMaterial/index.vue +++ b/src/views/quality/rawMaterial/index.vue @@ -17,7 +17,7 @@ <template> <div class="mod-config"> <basic-container> - <ttable + <ttable :table="table" :resultData="resultData" @handleSelectionChange="handleSelectionChange" @@ -60,7 +60,7 @@ import { mapGetters } from 'vuex' import PrintJS from 'print-js' import { transformZip } from '@/util/fileTransform' -import printTemplate from './rawMaterial-print.vue' +import printTemplate from './rawMaterial-print' export default { data() { return { @@ -232,7 +232,7 @@ RawMaterialForm, printTemplate, }, - created() { + created() { if(this.permissions.quality_rawMaterial_add){ this.table.toolbar.push({ text: '鏂板', @@ -374,7 +374,7 @@ } this.$router.push({ name: 'rawMaterialForm', - query: { + query: { id: row == null ? null : row.id, resultVal: row == null ? null : row.judgeState } @@ -435,4 +435,3 @@ } } </script> - \ No newline at end of file diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue index b4d8e55..2e84932 100644 --- a/src/views/quality/rawMaterial/rawMaterial-form.vue +++ b/src/views/quality/rawMaterial/rawMaterial-form.vue @@ -135,11 +135,14 @@ row-key="iid" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> - <el-table-column type="index" label="搴忓彿" width="60"> + <el-table-column type="index" prop="parentIndex" label="搴忓彿" width="60"> + <template scope="scope"> + <span v-if="scope.row.isIndex">{{scope.row.parentIndex}}</span> + </template> </el-table-column> <el-table-column prop="father" label="妫�楠岄」鐩�" width="160"> <template slot-scope="scope"> - <el-input v-if="scope.row.children" style="width:90%" :disabled="dataForm.id!=null" v-model="scope.row.father" placeholder="璇疯緭鍏ユ楠岄」鐩�"></el-input> + <el-input v-if="scope.row.children" style="width:80%" :disabled="dataForm.id!=null" v-model="scope.row.father" placeholder="璇疯緭鍏ユ楠岄」鐩�"></el-input> </template> </el-table-column> <el-table-column prop="name" label="椤圭洰" width="160"> @@ -170,11 +173,25 @@ <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 style="width:100%" allow-create filterable default-first-option + <!-- <el-autocomplete clearable + :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" + @blur="changeState(scope.row,scope.$index)" + v-model="scope.row.testValueList[index]" + :fetch-suggestions="querySearch" + placeholder="璇疯緭鍏ユ垨閫夋嫨妫�娴嬪��" > + <i style="line-height: normal;padding: 10px 7px;" class="el-icon-arrow-down" slot="suffix"></i> + <template slot-scope="{ item }"> + <div>{{ item.value }}</div> + </template> + </el-autocomplete> --> + + <el-select style="width:100%" filterable :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.testValueList[index]" placeholder="璇疯緭鍏ユ垨閫夋嫨妫�娴嬪��" - @change="changeState(scope.row,scope.$index)"> + @change="changeState(scope.row,scope.$index)" + @blur="selectBlur" + > <el-option label="鏄�" value="鏄�"/> <el-option label="鍚�" value="鍚�"/> </el-select> @@ -489,6 +506,10 @@ }, }, methods:{ + querySearch(queryString, cb){ + // 璋冪敤 callback 杩斿洖寤鸿鍒楄〃鐨勬暟鎹� + cb([{value:'鏄�'},{value:'鍚�'}]); + }, tabsClick(tab,even){ if(tab.index == 1){ if(this.dataForm.rawInsNo==null){ @@ -549,7 +570,7 @@ this.updateDevice(this.row,this.proIndex) }else{ this.$message({ - message: '鏈瘑鍒嚭浜屼綅鐮佽閲忓櫒鍏蜂俊鎭紒', + message: '浜岀淮鐮佹湭璇嗗埆鍑鸿閲忓櫒鍏蜂俊鎭紒', type: 'warning' }); } @@ -564,7 +585,7 @@ getResultInfo(data){ if(!data.includes("part_no")){ this.$message({ - message: '鏈瘑鍒嚭浜岀淮鐮侀浂浠朵俊鎭紒', + message: '浜岀淮鐮佹湭璇嗗埆鍑洪浂浠朵俊鎭紒', type: 'warning' }); } @@ -575,7 +596,7 @@ this.showPart = true }else{ this.$message({ - message: '鏈瘑鍒嚭浜岀淮鐮侀浂浠朵俊鎭紒', + message: '浜岀淮鐮佹湭璇嗗埆鍑洪浂浠朵俊鎭紒', type: 'warning' }); } @@ -602,8 +623,8 @@ this.dataForm.message = param.message this.dataForm.projectName = param.projectName this.projectList = param.rawInsProducts == null ? [] : param.rawInsProducts - param.rawInsProducts.forEach(o=>{ - this.clickAddLine(o) + param.rawInsProducts.forEach((o,index)=>{ + this.clickAddLine(o,index) }) } @@ -677,7 +698,7 @@ this.empiricalValueAdd = this.empiricalValueAdd + 1; }, // 娣诲姞琛� - clickAddLine(row) { + clickAddLine(row,index) { let ele = { fId: Math.random(), father: null, @@ -685,6 +706,8 @@ children:[] } if(row){ + ele.isIndex = true; + ele.parentIndex = index + 1; ele.father = row.father?row.father:null row.children.forEach(item => { ele.children.push({ @@ -709,6 +732,8 @@ }) this.list.push(ele) }else{ + ele.isIndex = true; + ele.parentIndex = this.list.length + 1; ele.children.push({ deviceId: null, deviceName: null, @@ -784,17 +809,19 @@ this.dataForm.createUser = data.createUser let userNameList = [] this.list = [] - data.children.forEach(item => { + data.children.forEach((item,index) => { if (item.children) { let ele = { iid: null, father: null, children: [] } + ele.isIndex = true; + ele.parentIndex = index + 1; ele.iid = Math.random() ele.father = item.rpFather if (item.children != undefined) { - item.children.forEach(obj => { + item.children.forEach((obj) => { let arr= [] if(obj.userName){ userNameList.push(obj.userName) @@ -853,33 +880,43 @@ this.conclusionTable = [] } }, + selectBlur(e){ + console.log(e); + }, 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,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ - if(!reg.test(val) && !['鏄�','鍚�'].includes(val)){ - this.$message.error("璇疯緭鍏ユ暟瀛楁垨閫夋嫨鏄惁") - row.testValueList[i] = null - isTrue = false - } - } - if(!isTrue){ - return - } + console.log(row.testValueList); + return + this.$nextTick(()=>{ + if(row){ + let isTrue = true + for(var i=0;i<row.testValueList.length;i++){ + let val = row.testValueList[i] + let reg = /(^-?[0-9]{1,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ + if(!reg.test(val) && !['鏄�','鍚�'].includes(val)){ + row.testValueList[i] = null + this.$message.error("璇疯緭鍏ユ暟瀛楁垨閫夋嫨鏄惁") + isTrue = false + } + } + if(!isTrue){ + return + } } if (row.rpId != null && row.rpId != '') { let val = row.testValueList.join(",") if (val === undefined || val === '' || val === null) { return } + console.log(val); + console.log(...row.testValueList); let obj = { deviceId: row.deviceId, rpId: row.rpId, testValue: val, note: row.note } + console.log(obj); + return updateRawInsProduct(obj).then(res => { if (res.data.code == 0) { this.$message.success("鏇存柊鎴愬姛") @@ -889,6 +926,7 @@ this.init() }) } + }) }, // 鍒犻櫎瀛愰」鐩� delChildren(row,index,isParent) { -- Gitblit v1.9.3