From dc335441ff07f563356c9cdb3ee9ff5a073c36ab Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 23 十月 2024 14:33:47 +0800 Subject: [PATCH] 修改报告预览 --- src/components/do/b1-ins-order/add.vue | 96 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 90 insertions(+), 6 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 0744bff..42a7626 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -134,8 +134,8 @@ <div class="ins_order_add" style=" display: block; "> <div v-show="!configShow&&!equipConfigShow&&!cableConfigShow"> <el-row class="title"> - <el-col :span="6" style="padding-left: 20px;text-align: left;">濮旀墭鍗曚俊鎭� 鎬讳环锛�<span - style="color: #3A7BFA">锟{total}}</span></el-col> + <el-col :span="6" style="padding-left: 20px;text-align: left;">濮旀墭鍗曚俊鎭� 鍗曚綅鎴愭湰鎬讳环锛�<span + style="color: #3A7BFA">锟{total.toFixed(2)}}</span></el-col> <el-col :span="18" style="text-align: right;"> <el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;" v-show="active==1" @change="selectInsOrderTemplateById"> @@ -996,6 +996,44 @@ <el-button type="primary" @click="spliceTemperatureTest">淇濆瓨</el-button> </span> </el-dialog> + <!-- 鍔熺巼瀹归噺--濉啓绔彛 --> + <el-dialog title="濉啓绔彛" :visible.sync="powerShow" + :close-on-click-modal="false" :close-on-press-escape="false" + width="50%"> + <el-table + :data="powerTable" + border + style="width: 100%"> + <el-table-column + fixed + prop="sample" + label="鏍峰搧" + min-width="150"> + </el-table-column> + <el-table-column + prop="model" + label="鍨嬪彿" + min-width="120"> + </el-table-column> + <el-table-column + prop="inspectionItem" + label="妫�楠岄」" + min-width="120"> + </el-table-column> + <el-table-column + prop="ask" + label="绔彛" + min-width="120"> + <template slot-scope="scope"> + <el-input-number v-model="scope.row.ask" :min="1" :max="100" label="绔彛" size="small"></el-input-number> + </template> + </el-table-column> + </el-table> + <span slot="footer" class="dialog-footer"> + <el-button @click="powerShow=false">鍙栨秷</el-button> + <el-button type="primary" @click="savePowerTest">淇濆瓨</el-button> + </span> + </el-dialog> <el-dialog title="鏂囦欢棰勮" :visible.sync="lookFileVisible" @@ -1270,7 +1308,9 @@ ruleInfo:{ rule:null, num:null, - } + }, + powerShow:false, + powerTable:[] } }, watch: { @@ -1547,6 +1587,24 @@ return } this.spliceTemperatureTest() + }, + savePowerTest(){ + if(!this.powerTable.every(m=>m.ask)) + { + this.$message.error('璇峰~鍐欏畬鏁存暟鎹�') + } + let num = 0; + let sampleList = this.HaveJson(this.sampleList) + sampleList.forEach(item=>{ + item.insProduct.forEach(m=>{ + if(m.inspectionItem.includes('鍔熺巼璇曢獙')&&m.state==1){ + m.ask = '绔彛鏁�:'+this.powerTable[num].ask + num++ + } + }) + }) + this.saveMethod(sampleList) + this.powerShow = false; }, cleanTemperatureTest () { this.temperatureTest = [] @@ -1848,6 +1906,22 @@ // } // } let sampleList = this.HaveJson(this.sampleList) + for (let i = 0; i < sampleList.length; i++) { + if (sampleList[i].insProduct.length > 0) { + let set = new Set() + for (let j = 0; j < sampleList[i].insProduct.length; j++) { + if(sampleList[i].insProduct[j].state == 1){ + let num0 = set.size + set.add(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass) + let num1 = set.size + if(num0==num1){ + this.$message.error(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass+'閲嶅') + return + } + } + } + } + } let projectNum = this.totalArr.filter(a => a.state == 1).length if(projectNum==0){ this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", { @@ -1858,13 +1932,22 @@ this.saveMethod(sampleList) }).catch(() => {}) }else{ - let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1) + let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask&&a.ask.includes(b)) && a.state == 1) if (isRTS&&this.PROJECT=='妫�娴嬩腑蹇�') { this.editTable = this.handleData(sampleList,this.containsValue, 0) this.editTable.forEach(item => { item.value = item.modelNum }) this.bsm3Dia = true; + return + } + let isPower = this.totalArr.find(a => a.inspectionItem.includes('鍔熺巼璇曢獙')&&a.state==1) + if (isPower) { + this.powerTable = this.totalArr.filter(a => a.inspectionItem.includes('鍔熺巼璇曢獙')&&a.state==1) + this.powerTable.forEach(a => { + a.ask = null + }) + this.powerShow = true; return } this.saveMethod(sampleList) @@ -2008,7 +2091,7 @@ let arr = this.editTable.filter(b => b.sampleId == item.id) for (var i=0;i<arr.length;i++){ if(a.ask){ - if(a.ask.includes(arr[i].symbolItem)){ + if(a.ask&&a.ask.includes(arr[i].symbolItem)){ let ask = calBack(a.ask, arr[i].symbolItem,arr[i].value) if (ask) { a.ask = ask @@ -2574,7 +2657,8 @@ if(row.section === null) { row.section = "" } - let arr = this.productList.filter(m=>m.state==1&&row.section.includes(m.section)&&m.ask&&m.section.indexOf('[')==-1) + // console.log(row,this.productList) + let arr = this.productList.filter(m=>m.state==1&&m.bsmRow&&m.bsmRow.section==row.section&&row.section.includes(m.section)&&m.ask&&m.section.indexOf('[')==-1) if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1&&arr.length==0) { if (row.section.indexOf('[') > -1) { row.bsmRow = this.HaveJson(row) -- Gitblit v1.9.3