From d975fc4756806f5b51f006c19c33571b9b8c0b3b Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 20 十二月 2024 09:30:19 +0800 Subject: [PATCH] 修改下单时要求值输入限制 --- src/components/do/b1-ins-order/add.vue | 371 +++++++++++++++++++++++----------------------------- 1 files changed, 166 insertions(+), 205 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index daa5066..7794127 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -134,9 +134,9 @@ <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 + <el-col :span="8" 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-col :span="16" style="text-align: right;"> <el-select v-model="template" size="medium" placeholder="涓嬪崟妯℃澘" style="margin-right: 10px;" v-show="active==1" @change="selectInsOrderTemplateById"> <el-option v-for="(a, ai) in templates" :key="ai" :value="a.id" :label="a.name"> @@ -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" @@ -219,7 +216,7 @@ </div> </el-col> <el-col class="search_thing" :span="6"> - <div class="search_label"><span class="required-span">* </span>鏍峰搧鍚嶇О锛�</div> + <div class="search_label"><span class="required-span">* </span>鏍峰搧绫诲瀷锛�</div> <div class="search_input"> <el-input readonly size="small" v-model="addObj.sample"> <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectStandardTree = true" @@ -237,7 +234,7 @@ <div class="search_label"><span class="required-span">* </span>鏍峰搧鏁伴噺锛�</div> <div class="search_input"> <el-input-number size="small" v-model="addObj.sampleNum" :min="1" :max="100" :precision="0" - style="width: 65%;" @change="addStandardTree" :disabled="active>1"></el-input-number> + style="width: 100%;" @change="addStandardTree" :disabled="active>1"></el-input-number> </div> </el-col> <!-- <el-col class="search_thing" :span="6"> @@ -359,11 +356,11 @@ :disabled="active>1" type="date" placeholder="閫夋嫨鏃ユ湡" - size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> + size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;"> </el-date-picker> </div> </el-col> - <el-col class="search_thing" :span="6"> + <el-col class="search_thing" :span="6" v-if="addObj.formType!='鍏朵粬鎴愬搧'&&addObj.formType"> <div class="search_label"><span class="required-span">* </span>鏍锋満瀹屾垚鏃堕棿锛�</div> <div class="search_input"> <el-date-picker @@ -371,7 +368,7 @@ :disabled="active>1" type="date" placeholder="閫夋嫨鏃ユ湡" - size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> + size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;"> </el-date-picker> </div> </el-col> @@ -412,11 +409,33 @@ <div style="height: auto;"> <div class="search" v-if="active==1" style="display: flex;background: transparent;"> <div class="search_thing"> - <div class="search_label">鏍峰搧鍨嬪彿锛�</div> + <div class="search_label">鏍峰搧鍚嶇О锛�</div> <div class="search_input"> - <el-select v-model="model" :placeholder="active>1 ? '' : '璇疯緭鍏�'" filterable allow-create default-first-option size="small" - @change="changeModel"> + <el-input size="small" v-model="allInfo.sample" @change="changeModel('sample')"></el-input> + </div> + </div> + <div class="search_thing"> + <div class="search_label">鏍峰搧绫诲埆锛�</div> + <div class="search_input"> + <el-select v-model="allInfo.model" :placeholder="active>1 ? '' : '璇疯緭鍏�'" filterable allow-create default-first-option size="small" + @change="changeModel('model')"> <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </div> + </div> + <div class="search_thing"> + <div class="search_label">浜у搧鍨嬪彿锛�</div> + <div class="search_input"> + <el-input size="small" v-model="allInfo.modelNum" @change="changeModel('modelNum')"></el-input> + </div> + </div> + <div class="search_thing"> + <div class="search_label">璇曢獙鏍囧噯锛�</div> + <div class="search_input"> + <el-select v-model="allInfo.testRequirements" :placeholder="active>1 ? '' : '璇疯緭鍏�'" filterable allow-create default-first-option size="small" + @change="changeModel('testRequirements')"> + <el-option v-for="item in standard" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </div> @@ -442,7 +461,7 @@ <el-table-column type="index" label="搴忓彿" width="65" align="center"></el-table-column> <el-table-column prop="sample" label="鏍峰搧鍚嶇О" align="center" min-width="100"> <template slot-scope="scope"> - <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1"></el-input> + <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1" placeholder="蹇呭~"></el-input> </template> </el-table-column> <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="100" align="center"> @@ -451,18 +470,18 @@ :readonly="active>1"></el-input> </template> </el-table-column> - <el-table-column prop="model" label="鏍峰搧鍨嬪彿" align="center" min-width="100"> + <el-table-column prop="model" label="鏍峰搧绫诲埆" align="center" min-width="100"> <template slot-scope="scope"> - <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="鏍峰搧鍨嬪彿" + <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="鏍峰搧绫诲埆" size="small" @change="handleChangeModel" :disabled="active>1" style="width: 100%;"> <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </template> </el-table-column> - <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" min-width="100" align="center" v-if="!(active>1)"> + <el-table-column prop="modelNum" label="浜у搧鍨嬪彿" min-width="100" align="center" v-if="!(active>1)"> <template slot-scope="scope"> - <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="闈炲繀濉�" + <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="蹇呭~" @keyup.enter.native="methodChange(scope.row.standardMethodListId, scope.row)" @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input> </template> @@ -470,7 +489,7 @@ <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> + placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable @change="changeModel0(scope.row)"> <el-option v-for="item in standard" :key="item.id" :label="item.label" :value="item.value"> </el-option> </el-select> @@ -543,7 +562,7 @@ <template slot-scope="scope"> <el-input size="small" placeholder="瑕佹眰鎻忚堪" v-model="scope.row.tell" clearable type="textarea" :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'tell')" - v-if="active==1"></el-input> + v-if="active==1" :disabled="!!scope.row.tell&&scope.row.tell.includes('[')&&scope.row.tell.includes(']')&&scope.row.tell.includes(',')"></el-input> <span v-else> <template >{{ scope.row.tell }}</template> </span> @@ -553,7 +572,7 @@ <template slot-scope="scope"> <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea" :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'ask')" - v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input> + v-if="active==1&&scope.row.inspectionValueType!='5'" :disabled="!!scope.row.ask&&scope.row.ask.includes('[')&&scope.row.ask.includes(']')&&scope.row.ask.includes(',')"></el-input> <span v-else> <!-- <template v-if="(scope.row.ask.indexOf('D')>-1 ||scope.row.ask.indexOf('W')>-1 @@ -595,11 +614,6 @@ :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" /> @@ -1041,6 +1055,12 @@ <filePreview v-if="lookFileVisible" :fileUrl="currentFile.url" :currentFile="currentFile" style="max-height: 87vh;overflow-y: auto;"/> </el-dialog> + <p style="font-size: 12px;color: red;margin-top: 20px;margin-bottom: 20px;">鍙屾柟鎵胯:<br/> + 1銆佸鎵樻柟鎵胯鎻愪緵鐨勪俊鎭笌鏍峰搧鐨勭湡瀹炴��;<br/> + 2銆佸鎵橀�佹牱妫�楠岀粨鏋滀粎閫傜敤浜庢敹鍒扮殑鏍峰搧;<br/> + 3銆佽瘯楠岃繃绋嬪鑷寸殑鏍峰搧鎹熷潖銆侀厤浠舵崯鍧忋�佹崯鑰楋紝鏈祴璇曞満涓嶆壙鎷呰禂鍋胯矗浠�;<br/> + 4銆佸疄楠屽鎵胯鍏寮�灞曟娴嬫椿鍔紝骞舵壙璇轰繚瀹堝湪妫�娴嬫椿鍔ㄨ繃绋嬩腑鎵�鑾风煡鐨勪繚瀵嗕俊鎭�� + </p> </div> </template> @@ -1306,11 +1326,17 @@ requiredUp: [] }, ruleInfo:{ - rule:null, + rule:1, num:null, }, powerShow:false, - powerTable:[] + powerTable:[], + allInfo:{ + model:null, + sample:null, + modelNum:null, + testRequirements:null, + } } }, watch: { @@ -1361,12 +1387,21 @@ } }, 'addObj.sample'(val) { - this.model = null + this.allInfo.model = null + this.allInfo.sample = null + this.allInfo.modelNum = null + this.allInfo.testRequirements = null this.standardMethodListId = [] }, 'addObj.sampleNum'(val) { - this.model = null + this.allInfo.model = null + this.allInfo.sample = null + this.allInfo.modelNum = null + this.allInfo.testRequirements = null this.standardMethodListId = [] + }, + active(val){ + this.saveLoad = false } }, mounted() { @@ -1415,7 +1450,7 @@ }) }) // 鏂囦欢淇℃伅 - this.componentData0.entity.insOrderId = this.currentId + this.componentData0.entity.insOrderId = this.currentId; this.$refs.fileList.selectList() } }, @@ -1536,7 +1571,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 () { @@ -1890,12 +1931,12 @@ this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�') }else if (!this.addObj.appointed) { this.$message.error('璇烽�夋嫨绾﹀畾鏃堕棿') - }else if (!this.addObj.issueTime) { - this.$message.error('璇烽�夋嫨鏍锋満瀹屾垚鏃堕棿') - } else if (!this.sampleList.every(m => m.standardMethodListId&&m.standardMethodListId.length>0)) { + }else if (!this.sampleList.every(m => m.standardMethodListId&&m.standardMethodListId.length>0)) { this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�') } else if(this.addObj.formType&&this.addObj.formType!='鍏朵粬鎴愬搧'&&!this.addObj.issueUser){ this.$message.error('璇烽�夋嫨閫氱煡鑷虫牱鏈哄憳') + }else if(this.addObj.formType&&this.addObj.formType!='鍏朵粬鎴愬搧'&&!this.addObj.issueTime){ + this.$message.error('璇烽�夋嫨鏍锋満瀹屾垚鏃堕棿') }else{ //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹� // if(this.active==1&&this.isAskOnlyRead){ @@ -1922,15 +1963,23 @@ } } } + + let index0 = sampleList.findIndex(m=>!m.sample) + if(index0>-1) return this.$message.error('璇峰~鍐欐牱鍝佸悕绉�') + let index1 = sampleList.findIndex(m=>!m.modelNum) + if(index1>-1) return this.$message.error('璇峰~鍐欎骇鍝佸瀷鍙�') + + let projectNum = this.totalArr.filter(a => a.state == 1).length if(projectNum==0){ - this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(() => { - this.saveMethod(sampleList) - }).catch(() => {}) + // this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", { + // confirmButtonText: "纭畾", + // cancelButtonText: "鍙栨秷", + // type: "warning" + // }).then(() => { + // this.saveMethod(sampleList) + // }).catch(() => {}) + return this.$message.error('璇锋坊鍔犳楠岄」鐩�') }else{ 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=='妫�娴嬩腑蹇�') { @@ -1994,7 +2043,6 @@ let min = Math.min(...splits) let max = Math.max(...splits) if(min==max){ - console.log(2222); isTrue = false } //瑕佹眰鎻忚堪涓笉鍖呭惈卤浠ュ強鍖洪棿鐨勬暟瀛楋紝鍒欒繑鍥瀎alse @@ -2275,10 +2323,20 @@ }, saveMethod(sampleList){ let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1) + let isHaveAsk0 = this.totalArr.filter(a => (a.ask=='/'||a.ask=='-'||a.ask=='鈥斺��'||((/\d/.test(a.ask))&&(a.ask.includes('<')||a.ask.includes('>')||a.ask.includes('=')||a.ask.includes('锛�')||a.ask.includes('锛�')||a.ask.includes('鈮�')||a.ask.includes('鈮�'))))&&a.state==1) + let stateArr = this.totalArr.filter(a=>a.state==1) if (isHaveAsk.length > 0) { this.$message({ type: 'error', message: '璇峰~鍐欒姹傚�煎悗鍐嶆彁浜�' + }) + return false; + } + if (isHaveAsk0.length <stateArr.length) { + this.$message({ + type: 'error', + message: '瑕佹眰鍊艰緭鍏ユ牸寮忎笉瀵癸紝鍙緭鍏�/銆�-銆佲�斺�斾唬琛ㄤ笉鍒ゅ畾锛�<銆�=銆�>銆佲墺銆佲墹鍔犱笂鏁板瓧浠h〃鑼冨洿锛岃閲嶆柊杈撳叆', + duration: 8 * 1000 }) return false; } @@ -2473,22 +2531,6 @@ this.models = val.children this.getNodeParent(node) - let flag = false - if (node.level == 3) { - if(node.data.children.length>0){ - node.data.children.forEach(a => { - let key = Object.keys(a) - if(!key.includes('level')) { - flag = true - } - }) - - } - } - this.selectTree = this.selectTree.replace(' - ', '') - if(flag) { - this.selectTree = '- - ' + this.selectTree - } let data = this.selectTree.split(' - ') let data2 = '' for (let index = data.length - 1; index >= 0; index--) { @@ -2519,27 +2561,24 @@ return data.label.indexOf(value) !== -1; }, activeStandardTree() { - let trees = this.selectTree.split(" - ") + if(this.selectTree == null || this.selectTree == '') return this.$message.error('鏈�夋嫨鏍峰搧绫诲瀷') + let trees = this.selectTree.split(" - ").filter(m=>m) if (trees.length < 3) { - this.$message.error('鏈�夋嫨瀵硅薄') + this.$message.error('鏈�夋嫨鏍峰搧绫诲埆') return } - this.addObj.factory = trees[0] - this.addObj.laboratory = trees[1] - this.addObj.sampleType = trees[2] - if (trees[3] === undefined || trees[3] === '' || trees[3] === '- ') { - this.addObj.sample = trees[2] - } else { - this.addObj.sample = trees[3] - } - this.addObj.model = (trees[4] == undefined ? null : trees[4]) + this.addObj.factory = '涓ぉ绉戞妧妫�娴嬩腑蹇�' + this.addObj.laboratory = '閫氫俊浜у搧瀹為獙瀹�' + this.addObj.sampleType = trees[0] + this.addObj.sample = trees[1] + this.addObj.model = trees[2] this.selectStandardTree = false this.sampleList = [] for (var i = 0; i < this.addObj.sampleNum; i++) { this.sample.joinName = null this.sample.joinModel = null this.sample.joinNum = 1 - this.sample.sample = this.addObj.sample + // this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit this.sample.standardMethodListId = [] @@ -2557,23 +2596,10 @@ selectsStandardMethodByFLSSM() { this.methodLoad = true this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { - tree: this.selectTree + tree: '涓ぉ绉戞妧妫�娴嬩腑蹇�'+' - '+'閫氫俊浜у搧瀹為獙瀹�'+' - '+this.selectTree }).then(res => { this.methodLoad = false - try { - if (res.data.standardMethodList.length == 0 && this.selectTree.split('-').length == 5) { - let arr = this.selectTree.split('-') - let arr0 = arr.slice(0, arr.length - 1) - let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1) - this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { - tree: selectTree - }).then(ress => { - this.methods = ress.data.standardMethodList - }) - } else { - this.methods = res.data.standardMethodList - } - } catch (e) {} + this.methods = res.data.standardMethodList }) }, addStandardTree() { @@ -2584,7 +2610,7 @@ this.sample.joinName = null this.sample.joinModel = null this.sample.joinNum = 1 - this.sample.sample = this.addObj.sample + // this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit this.sample.standardMethodListId = [] @@ -2657,7 +2683,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) @@ -2720,32 +2747,15 @@ } return item }) - const select = this.selectTree.split(' - ') - if (row.inspectionItem === '娓╁害寰幆' && select[2] === '鍏夌紗' && row.state === 1&&this.isAskOnlyRead) { - this.circulateShow = true; - return - } else if (row.inspectionItem === '娓╁害寰幆' && select[2] === '鍏夌紗' && row.state === 0) { - this.circulateShow = false; - } - if ((row.inspectionItem === '娓╁崌璇曢獙' || row.inspectionItem === '鐑惊鐜�') && row.state === 1) { - // console.log('row---', row) - this.temperatureTitle = `${row.inspectionItem}瑕佹眰濉啓` - this.isShowInput = row.inspectionItem === '鐑惊鐜�' - this.temId = row.id - this.temperatureShow = true; - return - } else if ((row.inspectionItem === '娓╁崌璇曢獙' || row.inspectionItem === '鐑惊鐜�') && row.state === 0) { - this.temperatureShow = false; - } - // if (row.inspectionItem === '鍗曟牴鍨傜洿鐕冪儳' && select[2] === '鍏夌紗' && row.state === 1) { - // this.singleVerticalCombustionShow = true; - // return - // } else if (row.inspectionItem === '鍗曟牴鍨傜洿鐕冪儳' && select[2] === '鍏夌紗' && row.state === 0) { - // this.singleVerticalCombustionShow = 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() }, searchProject () { @@ -2820,7 +2830,23 @@ // 淇濆瓨妯℃澘 addTemplateDia() { if (this.templateName) { - this.templateLoading = true; + if(this.templates.find(m=>m.name==this.templateName)){ + this.$confirm('宸插瓨鍦ㄥ悓鍚嶆ā鏉匡紝鏄惁杩涜鏇挎崲?', "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(() => { + this.saveTemplateDia() + }).catch(() => {}) + }else{ + this.saveTemplateDia() + } + } else { + this.$message.error('璇峰~鍐欐ā鏉垮悕绉�') + } + }, + saveTemplateDia(){ + this.templateLoading = true; this.$axios.post(this.$api.insOrder.addInsOrderTemplate, { name: this.templateName, thing: JSON.stringify({ @@ -2840,9 +2866,6 @@ this.selectInsOrderTemplate() this.templateName = '' }) - } else { - this.$message.error('璇峰~鍐欐ā鏉垮悕绉�') - } }, // 鏌ヨ妯℃澘 selectInsOrderTemplateById(e) { @@ -2883,7 +2906,7 @@ }).then(res => { this.orderType = res.data if (res.data.length > 0) { - this.addObj.orderType = res.data[0].value + this.addObj.orderType = 'C' } }) }, @@ -2906,7 +2929,7 @@ this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum+';'+row.testRequirements, standardMethodListId: val.join(','), - factory: selectTreeList.join(" - "), + factory: '涓ぉ绉戞妧妫�娴嬩腑蹇�'+' - '+'閫氫俊浜у搧瀹為獙瀹�'+' - '+selectTreeList.join(" - "), }, { headers: { 'Content-Type': 'application/json' @@ -2944,13 +2967,22 @@ } }) }, - changeModel() { + changeModel(type) { this.sampleList.forEach(a => { let obj = this.sampleIds.find(b => b == a.id) if (obj) { - a.model = this.model + this.$set(a,type, this.allInfo[type]) + if(type=='testRequirements'&&a.standardMethodListId&&a.standardMethodListId.length>0){ + this.methodChange(a.standardMethodListId, a) + } + // a[type] = this.allInfo[type] } }) + }, + changeModel0(row){ + if(row.standardMethodListId&&row.standardMethodListId.length>0){ + this.methodChange(row.standardMethodListId, row) + } }, changeStandardMethodListId() { this.sampleList.forEach(a => { @@ -3056,30 +3088,6 @@ this.$refs.productTable.clearSelection() return } - const select = this.selectTree.split(' - ') - if (p.inspectionItem === '娓╁害寰幆' && select[2] === '鍏夌紗' && p.state === 1&&this.isAskOnlyRead) { - this.circulateShow = true; - return - } else if (p.inspectionItem === '娓╁害寰幆' && select[2] === '鍏夌紗' && p.state === 0) { - this.circulateShow = false; - } - if ((p.inspectionItem === '娓╁崌璇曢獙' || p.inspectionItem === '鐑惊鐜�') && p.state === 1) { - // console.log('p---', p) - this.temperatureTitle = `${p.inspectionItem}瑕佹眰濉啓` - this.isShowInput = p.inspectionItem === '鐑惊鐜�' - this.temId = p.id - this.temperatureShow = true; - return - } else if ((p.inspectionItem === '娓╁崌璇曢獙' || p.inspectionItem === '鐑惊鐜�') && p.state === 0) { - this.temperatureShow = false; - } - /* if (p.ask.includes('RTS')&&p.state === 1) { - p.rts = '' - this.bsm3Val = '' - this.bsm3 = true - this.bsm3Dia = true - this.bsmRow3.push(p) - } */ }) if (e.length > 0) { this.sampleList.map(item => { @@ -3103,7 +3111,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() @@ -3149,36 +3163,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) { @@ -3186,35 +3170,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('鏈�変腑鏍峰搧') @@ -3283,7 +3238,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