From 71a8e88eccd5626877c4ab2c93f523c4f71d79c1 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 09 八月 2024 10:38:28 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master --- src/components/do/b1-ins-order/fiberoptic-config.vue | 156 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 93 insertions(+), 63 deletions(-) diff --git a/src/components/do/b1-ins-order/fiberoptic-config.vue b/src/components/do/b1-ins-order/fiberoptic-config.vue index 543547e..17c6272 100644 --- a/src/components/do/b1-ins-order/fiberoptic-config.vue +++ b/src/components/do/b1-ins-order/fiberoptic-config.vue @@ -31,16 +31,16 @@ style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;"> <div class="search-item" style="margin-right: 10px;"> <label>濂楃鏁扮洰</label> - <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @blur="addBushing" :disabled="active!=1"></el-input> + <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @blur="addBushing" :disabled="active!=1" ></el-input> </div> <div class="search-item" style="margin-right: 10px;"> - <label style="width: 70px;">鏍囧噯閲�</label> - <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @blur="addStandNum" :disabled="active!=1"></el-input> + <label style="width: 100px">姣忔牴绠℃娊妫�鏍囧噯閲�</label> + <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @blur="addStandNum" :disabled="active!=1" style="width:70px"></el-input> </div> <div class="search-item"> - <label style="width: 70px;">妫�娴嬮噺</label> + <label style="width: 100px">姣忔牴绠℃娊妫�妫�娴嬮噺</label> <el-input v-model="packageInfo.testNum" placeholder="璇疯緭鍏�" size="small" @blur="addTestNum" - :disabled="packageInfo.radio===0||active!=1"></el-input> + :disabled="packageInfo.radio===0||active!=1" style="width:70px"></el-input> </div> </div> <el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px" size="small" @@ -78,7 +78,7 @@ @select="upProductSelect" > <el-table-column type="selection" width="55" - :selectable="()=>((currentDetectionItems||this.multiFiberList.length > 0)&&active==1)"> + :selectable="()=>((currentDetectionItems||this.selectFiberList.length > 0 || this.multiFiberList.length > 0)&&active==1)"> </el-table-column> <el-table-column label="瀹為獙瀹�" show-overflow-tooltip prop="sonLaboratory" ></el-table-column> <el-table-column prop="inspectionItem" label="妫�楠岄」" show-overflow-tooltip> @@ -134,7 +134,7 @@ <div class="search-item" style="width: 50%;margin-right: 16px;"> <label style="width: 80px;">绾ゅ甫绫诲瀷</label> <el-select v-model="miresModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" - :disabled="selectBushing.length===0||active!=1" + > <el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value"> </el-option> @@ -358,6 +358,7 @@ return { detectionType: null, detectionSelect: [], + selectFiberList: [], type:1, saveLoad: false, packageInfo: { @@ -467,24 +468,24 @@ // 鍏夌氦甯� this.fibersList.push(b) // 鍏夌氦 - b.fiber.forEach(c=>{ - this.fiberList.push(c) - }) + // this.fiberList = [] + // this.fiberList = b.fiber }) } else { a.fiber.forEach(b=>{ this.fiberList.push(b) }) } - + }else{ + this.fiberList = [] a.fiber.forEach(b=>{ this.fiberList.push(b) }) } }) } - + this.getTypeDicts1() this.getStandTreeBySampleType() this.getStandTreeBySampleType2() @@ -492,8 +493,11 @@ }, methods: { handleSelectionChange(val) { - this.selectFibers = val + // this.selectFibers = val this.multiFiberList = val + if(val.length > 0) { + this.rowClickFiber(val[val.length-1],null,null,1) + } }, handleSelectionChange1(val) { this.selectBushing = val @@ -502,27 +506,44 @@ this.detectionSelect = val // 璧嬪�兼娴嬮」淇℃伅 鍏夌氦甯� if(this.detectionItems.type == 1) { - for(let i= 0; i < this.fibersList.length; i++){ - this.multiFiberList.forEach(item => { - if(this.fibersList[i].ident == item.ident){ + this.multiFiberList.forEach(item => { + this.fibersList.forEach(a => { + if(a.ident == item.ident){ + a.productList = [] this.fibersList.find(a => a.ident == item.ident).productList = this.detectionSelect } }) - } + }) + } if(this.detectionItems.type == 0) { // 璧嬪�兼娴嬮」淇℃伅 鍏夌氦 - this.multiFiberList.forEach(item => { + this.selectFiberList.forEach(item => { this.fiberList.forEach(a => { if(a.ident == item.ident){ + a.productList = [] this.fiberList.find(a => a.ident == item.ident).productList = this.detectionSelect } }) }) + + // 閫夋嫨鐨勬椂鍊欏氨灏唂iberList鐨勫�艰祴鍊肩粰瀵瑰簲鐨刦iberList + if(this.multiFiberList.length > 0) { + this.multiFiberList.forEach(item => { + this.fibersList.forEach(a => { + if(a.ident == item.ident){ + a.fiber = this.fiberList + } + }) + }) + } } }, handleSelectionChange4(val){ - this.multiFiberList = val + this.selectFiberList = val + if(val != 0) { + this.rowClickFiber(val[val.length-1],null,null,0) + } }, outConfig() { this.$parent.configShow = false @@ -563,6 +584,11 @@ }, // 濂楃妫�娴嬮噺璧嬪�� addTestNum() { + + if(parseInt(this.packageInfo.testNum) > parseInt(this.packageInfo.standNum)) { + this.packageInfo.testNum = this.packageInfo.standNum + this.$message.error('妫�娴嬮噺涓嶈兘澶т簬鏍囧噯閲�') + } if(this.selectBushing.length > 0) { this.bushing.forEach(item => { this.selectBushing.forEach(a => { @@ -577,7 +603,7 @@ this.fiberList = [] this.fibersList = [] this.detectionItems = [] - + // 椤甸潰鏄惁鍚湁鍏夌氦甯� if(this.packageInfo.ismiers) { // 鍏ㄦ @@ -588,7 +614,7 @@ this.packageInfo.testNum = this.packageInfo.standNum this.selectBushing = this.bushing this.addFibers() - this.selectFibers = this.fibersList + this.multiFiberList = this.fibersList // 榛樿鍕鹃�� setTimeout(() => { this.selectBushing.forEach(item =>{ @@ -596,7 +622,7 @@ this.$refs.table0.toggleRowSelection(rowToSelect, true) }) - this.selectFibers.forEach(item =>{ + this.multiFiberList.forEach(item =>{ let rowToSelect = this.fibersList.find(a => a.ident == item.ident) this.$refs.table2.toggleRowSelection(rowToSelect, true) }) @@ -609,7 +635,6 @@ this.packageInfo.testNum = this.packageInfo.standNum this.selectBushing = this.bushing this.addFiber() - // 榛樿鍕鹃�� setTimeout(() => { this.selectBushing.forEach(item =>{ @@ -621,8 +646,8 @@ } } - - + + }, upNum() { this.fiberList = [] @@ -683,7 +708,7 @@ } a.fibers.push(fibers) this.fibersList.push(fibers) - } + } }) } else { this.bushing = [] @@ -757,13 +782,13 @@ // this.addFiber() // }, 200) // }) - + // 灏嗕笅鎷夋鍊艰祴鍊肩粰鍏夌氦 鐩戝惉鍘婚櫎 - if(this.multiFiberList.length == 0) { + if(this.selectFiberList.length == 0) { this.$message.error('璇烽�夋嫨鏁版嵁') return } - this.multiFiberList.forEach(item => { + this.selectFiberList.forEach(item => { this.fiberList.forEach(a => { if(a.ident == item.ident){ a.model = this.mireModel.split(' - ')[1] // 鍏夌氦瑙勬牸 @@ -794,7 +819,7 @@ this.detectionType = 0 this.$set(this.detectionItems,'type',0) } - + }) }, methodChange2(val) { @@ -863,7 +888,6 @@ }) }, addFiber() { - // 鏈�鏂� let colors2 = [] if (this.packageInfo.num1 / this.colors.length > 1) { @@ -878,8 +902,8 @@ this.fiberList = [] // 閫夋嫨浜嗗厜绾ゅ甫 if (this.packageInfo.ismiers) { - if(this.selectFibers.length != 0){ - this.selectFibers.forEach((a,index) => { + if(this.multiFiberList.length != 0){ + this.multiFiberList.forEach((a,index) => { a.fiber = [] for (var i = 0; i < parseInt(a.num); i++) { let fiber = { @@ -892,7 +916,7 @@ fibersIdent: a.ident, productList: [] } - this.fiberList.push(fiber) + this.fiberList.push(fiber) } }) } else { @@ -904,6 +928,7 @@ bushColor: a.color, color: colors2[(i+(parseInt(a.testNum))*index)>colors2.length?0:i+(parseInt(a.testNum))*index].label, model: null, + noSplitModel: null, standard: null, productList: [] } @@ -912,7 +937,7 @@ }) } }else { - this.fiberList = [] + this.fiberList = [] let flag = true // 鎸夌収椤哄簭鐢熸垚鍏夌氦鑹叉爣 let colors2 = [] @@ -954,7 +979,7 @@ // this.$message.error('鏈�夋嫨濂楃') // return // } - // this.fiberList = [] + // this.fiberList = [] // let flag = true // // 鎸夌収椤哄簭鐢熸垚鍏夌氦鑹叉爣 // let colors2 = [] @@ -1131,6 +1156,11 @@ // }) // }, 200) if(type == 1) { + this.fiberList = row.fiber + if((row.model == null || row.model == '') && (row.standard == null || row.standard == '')){ + this.detectionItems = [] + return + } if(row.model != null && row.model != ''){ this.miresModel = row.model this.selectsStandardMethodByFLSSM2() @@ -1151,28 +1181,28 @@ // 灏嗚幏鍙栫殑妫�娴嬮」淇℃伅璧嬪�� this.detectionItems = [] if(res.data != null && res.data.length != 0){ - res.data.forEach(a => { - a.state = 0 - }) this.detectionItems = res.data this.detectionType = 1 this.$set(this.detectionItems,'type',1) - - if (row.productList != null && row.productList.length > 0) { + if (row.productList != null && row.productList.length > 0) { + let product = JSON.parse(JSON.stringify(row.productList)) setTimeout(() => { - row.productList.forEach(product => { - let rowToSelect = this.detectionItems.find(item => item.id === product.id); - if (rowToSelect) { - this.toggleSelection(rowToSelect); - } - }); - },200) - + product.forEach(p => { + let rowToSelect = this.detectionItems.find(item => item.id === p.id); + if (rowToSelect) { + this.toggleSelection(rowToSelect); + } + }); + },200) } } }) },1000) }else if(type == 0) { + if((row.noSplitModel == null || row.noSplitModel == '') && (row.standard == null || row.standard == '')){ + this.detectionItems = [] + return + } if(row.model != null && row.model != ''){ this.mireModel = row.noSplitModel this.selectsStandardMethodByFLSSM() @@ -1183,7 +1213,7 @@ } this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: this.mireModel.split(' - ')[1], - standardMethodListId: this.mireStandard, + standardMethodListId: this.mireStandard, factory: '' }, { headers: { @@ -1199,18 +1229,18 @@ this.detectionType = 0 this.$set(this.detectionItems,'type',0) - if (row.productList != null && row.productList.length > 0) { + if (row.productList != null && row.productList.length > 0) { + let product = JSON.parse(JSON.stringify(row.productList)) setTimeout(() => { - row.productList.forEach(product => { - let rowToSelect = this.detectionItems.find(item => item.id === product.id); - if (rowToSelect) { - this.toggleSelection(rowToSelect); - } - }); + product.forEach(p => { + let rowToSelect = this.detectionItems.find(item => item.id === p.id); + if (rowToSelect) { + this.toggleSelection(rowToSelect); + } + }); },200) } } - }) },1000); } @@ -1330,8 +1360,8 @@ }, upProductSelect(selection, row) { row.state = row.state == 1 ? 0 : 1 - if(this.multiFiberList.length > 0){ - this.multiFiberList.map(item => { + if(this.selectFiberList.length > 0){ + this.selectFiberList.map(item => { item.productList.map(m=>{ if(m.id == row.id){ m.state = row.state; @@ -1430,9 +1460,9 @@ this.bushing.forEach(item=>{ // 濡傛灉鍏夌氦甯︽湁鍊� if(this.fibersList.length != 0) { - this.fibersList.forEach(a=>{ - a.fiber = this.fiberList.filter(b=>b.fibersIdent == a.ident) - }) + // this.fibersList.forEach(a=>{ + // a.fiber = this.fiberList + // }) item.fibers = this.fibersList // 鍏夌氦甯� item.fiber = [] // 鍏夌氦 }else { -- Gitblit v1.9.3