From 69ed1555e7be98d643e5cf9c55b591c44d52d1b9 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 01 十一月 2024 11:24:24 +0800 Subject: [PATCH] 修改标签打印格式 --- src/components/do/b1-ins-order/add.vue | 269 +++++++++++++++++++++++++++++++++++------------------ 1 files changed, 178 insertions(+), 91 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index d7c17e7..87986a4 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"> @@ -148,10 +148,7 @@ <el-button size="medium" @click="templateDia=true" v-show="active==1"> <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span> </el-button> - <el-button size="medium" type="primary" @click="openCableConfig" - v-if="active==1&&PROJECT=='瑁呭鐢电紗'&&addObj.sampleType!=undefined&&addObj.sampleType.indexOf('鐢电紗')>-1">鐢电紗閰嶇疆</el-button> <el-button size="medium" type="primary" @click="openEquipConfig" v-if="active==1">瀛愭牱鍝侀厤缃�</el-button> - <el-button size="medium" type="primary" @click="openConfig" v-if="addObj.sampleType==='鍏夌紗'">鍏夌氦閰嶇疆</el-button> <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active==1">鎻愪氦</el-button> <!-- 瀹℃牳 --> <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3&&addObj.companyId" @@ -333,7 +330,7 @@ <el-col class="search_thing" :span="6"> <div class="search_label" style="width: 175px;">鏄惁娑夊強閰嶅鏍峰搧锛�</div> <div class="search_input" style="width: calc(100% - 175px);"> - <el-radio-group v-model="addObj.mating" @change="$refs.sampleTable.doLayout()"> + <el-radio-group v-model="addObj.mating" @change="$refs.sampleTable.doLayout()" :disabled="active>1"> <el-radio :label="1">鏄�</el-radio> <el-radio :label="0">鍚�</el-radio> </el-radio-group> @@ -356,6 +353,7 @@ <div class="search_input"> <el-date-picker v-model="addObj.appointed" + :disabled="active>1" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> @@ -367,10 +365,30 @@ <div class="search_input"> <el-date-picker v-model="addObj.issueTime" + :disabled="active>1" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker> + </div> + </el-col> + <el-col class="search_thing upload" :span="4" style="align-items: flex-start;height: auto" v-if="active==1"> + <el-upload + style="margin: 8px 0 0px 50px;" + action="#" + :auto-upload="false" + accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :on-change="handleChangeUpload"> + <el-button size="small" type="primary">涓婁紶闄勪欢</el-button> + </el-upload> + </el-col> + <el-col class="search_thing" :span="8"> + <div class="search_input" style="width: 100%;margin-left: 40px;"> + <el-radio-group v-model="ruleInfo.rule" @change="$refs.sampleTable.doLayout()" :disabled="active>1"> + <el-radio :label="1">涓嶈�冭檻涓嶇‘瀹氬害</el-radio> + <el-radio :label="2">鑰冭檻涓嶇‘瀹氬害<el-input placeholder="" v-model="ruleInfo.num" style="width: 100px;margin-left: 10px;" size="mini" :disabled="active>1"> + <template slot="append">%</template> + </el-input></el-radio> + </el-radio-group> </div> </el-col> <el-col class="search_thing" :span="6" style="align-items: flex-start;margin: 8px 0;"> @@ -379,14 +397,6 @@ <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2}" size="small" clearable :placeholder="active>1 ? '' : '璇疯緭鍏�'" v-model="addObj.remark" :readonly="active>1"></el-input> </div> - </el-col> - <el-col class="search_thing upload" :span="4" style="align-items: flex-start;margin: 8px 0 0 50px;height: auto" v-if="active==1"> - <el-upload - action="#" - :auto-upload="false" - accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :on-change="handleChangeUpload"> - <el-button size="small" type="primary">涓婁紶闄勪欢</el-button> - </el-upload> </el-col> <!-- <el-col class="search_thing" :span="6" v-if="active==1"> <div class="search_label">RTS锛�</div> @@ -454,21 +464,21 @@ @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input> </template> </el-table-column> + <el-table-column prop="testRequirements" label="璇曢獙鏍囧噯" align="center" min-width="100"> + <template slot-scope="scope"> + <el-select v-model="scope.row.testRequirements" :disabled="scope.row.model==null||active>1" + placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable> + <el-option v-for="item in standard" :key="item.id" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </template> + </el-table-column> <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" min-width="100"> <template slot-scope="scope"> <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1" placeholder="妫�楠屾爣鍑�" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" @focus="methodFocus" :readonly="active>1" style="width: 100%;" clearable @clear="productList = []" multiple> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> - </el-option> - </el-select> - </template> - </el-table-column> - <el-table-column prop="testRequirements" label="璇曢獙鏍囧噯" align="center" min-width="100"> - <template slot-scope="scope"> - <el-select v-model="scope.row.testRequirements" :disabled="scope.row.model==null||active>1" - placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable> - <el-option v-for="item in standard" :key="item.id" :label="item.label" :value="item.value"> </el-option> </el-select> </template> @@ -582,6 +592,11 @@ :delUrl="$api.insOrderPlan.delfile" style="height: 100%;margin-top: 16px;" v-show="currentPage==1"/> </div> </div> + <p style="font-size: 12px;color: red;margin-top: 20px;margin-bottom: 20px;">鍙屾柟鎵胯:<br/> + 1銆佸鎵樻柟鎵胯鎻愪緵鐨勪俊鎭笌鏍峰搧鐨勭湡瀹炴��;<br/> + 2銆佸鎵橀�佹牱妫�楠岀粨鏋滀粎閫傜敤浜庢敹鍒扮殑鏍峰搧;<br/> + 3銆佽瘯楠岃繃绋嬪鑷寸殑鏍峰搧鎹熷潖銆侀厤浠舵崯鍧忋�佹崯鑰楋紝鏈祴璇曞満涓嶆壙鎷呰禂鍋胯矗浠�;<br/> + 4銆佸疄楠屽鎵胯鍏寮�灞曟娴嬫椿鍔紝骞舵壙璇轰繚瀹堝湪妫�娴嬫椿鍔ㄨ繃绋嬩腑鎵�鑾风煡鐨勪繚瀵嗕俊鎭��</p> <el-dialog title="閫夋嫨鍗曚綅" :visible.sync="selectUserDia" width="70%"> <div class="body" style="height: 60vh;" v-if="selectUserDia"> <ValueTable ref="ValueTable2" :url="$api.user.selectCustomPageList" :componentData="componentData2" /> @@ -978,6 +993,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" @@ -1249,6 +1302,12 @@ requiredAdd: [], requiredUp: [] }, + ruleInfo:{ + rule:1, + num:null, + }, + powerShow:false, + powerTable:[] } }, watch: { @@ -1329,6 +1388,14 @@ this.addObj = { ...res.data.insOrder }; + if(this.addObj.rule){ + if(this.addObj.rule=='涓嶈�冭檻涓嶇‘瀹氬害'){ + this.ruleInfo.rule = 1 + }else{ + this.ruleInfo.rule = 2 + this.ruleInfo.num = this.addObj.rule.split('-')[1] + } + } this.addObj.type = String(this.addObj.type) this.sampleList = this.HaveJson(res.data.sampleProduct) this.sampleList.forEach(m=>{ @@ -1466,7 +1533,13 @@ }) this.circulateShow = false this.changeProductList0() - this.currentMethod.insProduct = this.productList0 + if(this.sampleSelectionList.length>0){ + this.sampleSelectionList.forEach(item=>{ + item.insProduct = this.productList0 + }) + }else{ + this.currentMethod.insProduct = this.productList0 + } this.getProNum() }, spliceTemperatureTest () { @@ -1517,6 +1590,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 = [] @@ -1818,6 +1909,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('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", { @@ -1828,13 +1935,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) @@ -1881,7 +1997,6 @@ let min = Math.min(...splits) let max = Math.max(...splits) if(min==max){ - console.log(2222); isTrue = false } //瑕佹眰鎻忚堪涓笉鍖呭惈卤浠ュ強鍖洪棿鐨勬暟瀛楋紝鍒欒繑鍥瀎alse @@ -1978,7 +2093,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 @@ -2176,6 +2291,18 @@ message: '璇峰~鍐欒姹傛弿杩板悗鍐嶆彁浜�' }) return false; + } + if(this.ruleInfo.rule==1){ + this.addObj.rule = '涓嶈�冭檻涓嶇‘瀹氬害' + }else if(this.ruleInfo.rule==2){ + if(this.ruleInfo.rule==2&&(!this.ruleInfo.num||this.ruleInfo.num<0||this.ruleInfo.num==0)){ + this.$message({ + type: 'error', + message: '璇疯緭鍏ヤ笉纭畾搴�' + }) + return; + } + this.addObj.rule = '鑰冭檻涓嶇‘瀹氬害'+'-'+this.ruleInfo.num } this.saveLoad = true let fd = new FormData(); @@ -2532,7 +2659,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) @@ -2620,7 +2748,13 @@ // } this.changeProductList0() - this.currentMethod.insProduct = this.productList0 + if(this.sampleSelectionList.length>0){ + this.sampleSelectionList.forEach(item=>{ + item.insProduct = this.productList0 + }) + }else{ + this.currentMethod.insProduct = this.productList0 + } this.getProNum() }, searchProject () { @@ -2779,7 +2913,7 @@ let selectTreeList = this.selectTree.split(" - ") this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model) this.$axios.post(this.$api.standardTree.selectStandardProductList, { - model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum, + model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum+';'+row.testRequirements, standardMethodListId: val.join(','), factory: selectTreeList.join(" - "), }, { @@ -2978,7 +3112,13 @@ }) } this.changeProductList0() - this.currentMethod.insProduct = this.productList0 + if(this.sampleSelectionList.length>0){ + this.sampleSelectionList.forEach(item=>{ + item.insProduct = this.productList0 + }) + }else{ + this.currentMethod.insProduct = this.productList0 + } this.getProNum() this.$nextTick(() => { this.$refs.productTable.doLayout() @@ -3024,36 +3164,6 @@ const property = column['property']; return row[property] === value; }, - openConfig() { - if (this.active === 1) { - if (this.sampleIds.length === 0) { - this.$message.error("鏈�夋嫨鏍峰搧") - return - } - this.configShow = true - } else { - if (this.sampleId === null) { - this.$message.error('鏈�変腑鏍峰搧') - return - } - this.sampleIds = [this.sampleId] - this.$axios.post(this.$api.insBushing.selectBushingBySampleId, { - sampleId: this.sampleId - }).then(res => { - if (res.data.length === 0) { - this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�') - return - } - for (var i in this.sampleList) { - if (this.sampleList[i].id = this.sampleId) { - this.sampleList[i].bushing = res.data - break - } - } - this.configShow = true - }) - } - }, openEquipConfig() { if (this.active === 1) { if (this.sampleIds.length === 0) { @@ -3061,35 +3171,6 @@ return } this.equipConfigShow = true - } else { - if (this.sampleId === null) { - this.$message.error('鏈�変腑鏍峰搧') - return - } - // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, { - // sampleId: this.sampleId - // }).then(res => { - // if (res.data.length === 0) { - // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�') - // return - // } - // for (var i in this.sampleList) { - // if (this.sampleList[i].id = this.sampleId) { - // this.sampleList[i].bushing = res.data - // break - // } - // } - // this.configShow = true - // }) - } - }, - openCableConfig() { - if (this.active === 1) { - if (this.sampleIds.length === 0) { - this.$message.error("鏈�夋嫨鏍峰搧") - return - } - this.cableConfigShow = true } else { if (this.sampleId === null) { this.$message.error('鏈�変腑鏍峰搧') @@ -3158,7 +3239,13 @@ } } this.changeProductList0() - this.currentMethod.insProduct = this.productList0 + if(this.sampleSelectionList.length>0){ + this.sampleSelectionList.forEach(item=>{ + item.insProduct = this.productList0 + }) + }else{ + this.currentMethod.insProduct = this.productList0 + } }, save1 () { if (this.bsm1DiaList.length > 0) { -- Gitblit v1.9.3