From 8ed20bc6e74e33e1fd8b053346926884beddf1d7 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 26 九月 2024 13:50:26 +0800 Subject: [PATCH] 修改电路试验模板切换 --- src/components/do/b1-ins-order/add.vue | 183 +++++++++++++++++++++++++++++---------------- 1 files changed, 118 insertions(+), 65 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 1eaf682..4e6f9cb 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -185,18 +185,13 @@ <div class="search_label"><span class="required-span">* </span>鍒跺崟浜猴細</div> <div class="search_input"> <el-input size="small" clearable disabled v-model="addObj.custom"></el-input> - <!-- <el-input readonly size="small" v-model="addObj.custom"> - <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true" - :disabled="active>1"></el-button></template> - </el-input> --> </div> </el-col> <el-col class="search_thing" :span="6"> <div class="search_label"><span class="required-span">* </span>濮旀墭鍗曚綅锛�</div> <div class="search_input"> - <!-- <el-input size="small" placeholder="鈫愰�夋嫨濮旀墭瀹㈡埛" clearable disabled v-model="addObj.company"></el-input> --> <el-input readonly size="small" v-model="addObj.company" placeholder="閫夋嫨濮旀墭鍗曚綅"> - <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true" + <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true,createState=1" :disabled="active>1"></el-button></template> </el-input> </div> @@ -254,14 +249,29 @@ </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-select v-model="addObj.formType" size="small" :disabled="active>1" style="width: 100%;"> <el-option v-for="(a,ai) in formType" :key="ai" :label="a.label" :value="a.value"></el-option> </el-select> </div> </el-col> - <el-col class="search_thing" :span="6"> + <el-col class="search_thing" :span="6" v-if="addObj.formType==='鍏朵粬鎴愬搧'"> + <div class="search_label">闆朵欢鍙凤細</div> + <div class="search_input"> + <el-input size="small" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable v-model="addObj.partNo" + :readonly="active>1"></el-input> + </div> + </el-col> + <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-select v-model="addObj.issueUser" size="small" :disabled="active>1" style="width: 100%;"> + <el-option v-for="(a,ai) in personList" :key="ai" :label="a.label" :value="a.value"></el-option> + </el-select> + </div> + </el-col> + <!-- <el-col class="search_thing" :span="6"> <div class="search_label">鎶ュ憡鍙戦�佹柟寮忥細</div> <div class="search_input"> <el-radio-group v-model="addObj.send"> @@ -269,8 +279,8 @@ <el-radio :label="0">鍏朵粬</el-radio> </el-radio-group> </div> - </el-col> - <el-col class="search_thing" :span="6"> + </el-col> --> + <!-- <el-col class="search_thing" :span="6"> <div class="search_label">鏍峰搧澶勭悊鏂瑰紡锛�</div> <div class="search_input"> <el-radio-group v-model="addObj.processing"> @@ -278,7 +288,7 @@ <el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio> </el-radio-group> </div> - </el-col> + </el-col> --> <el-col class="search_thing" :span="6"> <div class="search_label">宸ョ▼鍚嶇О锛�</div> <div class="search_input"> @@ -296,8 +306,12 @@ <el-col class="search_thing" :span="6"> <div class="search_label"><span class="required-span">* </span>鐢熶骇鍗曚綅锛�</div> <div class="search_input"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.production" - :readonly="active>1"></el-input> + <!-- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.production" + :readonly="active>1"></el-input> --> + <el-input size="small" v-model="addObj.production" placeholder="閫夋嫨鐢熶骇鍗曚綅" :readonly="active>1"> + <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true,createState=2" + :disabled="active>1"></el-button></template> + </el-input> </div> </el-col> <el-col class="search_thing" :span="6"> @@ -307,7 +321,7 @@ :readonly="active>1"></el-input> </div> </el-col> - <el-col class="search_thing" :span="6"> + <!-- <el-col class="search_thing" :span="6"> <div class="search_label">鏄惁鐣欐牱锛�</div> <div class="search_input"> <el-radio-group v-model="addObj.isLeave"> @@ -315,7 +329,7 @@ <el-radio :label="1">鐣欐牱</el-radio> </el-radio-group> </div> - </el-col> + </el-col> --> <el-col class="search_thing" :span="6"> <div class="search_label" style="width: 175px;">鏄惁娑夊強閰嶅鏍峰搧锛�</div> <div class="search_input" style="width: calc(100% - 175px);"> @@ -325,12 +339,12 @@ </el-radio-group> </div> </el-col> - <el-col class="search_thing" :span="6"> + <!-- <el-col class="search_thing" :span="6"> <div class="search_label">OTC璁㈠崟鍙凤細</div> <div class="search_input"> <el-input size="small" :placeholder="active>1 ? '' : '璇疯緭鍏�'" clearable v-model="addObj.otcCode" :readonly="active>1"></el-input> </div> - </el-col> + </el-col> --> <el-col class="search_thing" :span="6"> <div class="search_label">濮旀墭浜猴細</div> <div class="search_input"> @@ -367,8 +381,8 @@ <div class="search_thing"> <div class="search_label">妫�楠屾爣鍑嗭細</div> <div class="search_input"> - <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭鍏�'" size="small" @focus="methodFocus" - :loading="methodLoad" @change="changeStandardMethodListId"> + <el-select v-model="standardMethodListId" :placeholder="active>1 ? '' : '璇疯緭閫夋嫨'" size="small" @focus="methodFocus" + :loading="methodLoad" multiple @change="changeStandardMethodListId"> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -384,7 +398,7 @@ <el-input size="small" v-model="scope.row.sample" clearable :readonly="active>1"></el-input> </template> </el-table-column> - <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="140" align="center"> + <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="100" align="center"> <template slot-scope="scope"> <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" :readonly="active>1"></el-input> @@ -399,7 +413,7 @@ </el-select> </template> </el-table-column> - <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" width="130" 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="闈炲繀濉�" @keyup.enter.native="methodChange(scope.row.standardMethodListId, scope.row)" @@ -410,8 +424,17 @@ <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 = []"> + @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> @@ -990,7 +1013,8 @@ companyId: null, prepareUser:null, departmentLimsId:null, - departmentLims:null + departmentLims:null, + partNo: null, // 闆朵欢鍙� }, sample: { sampleCode: null, @@ -1093,7 +1117,7 @@ RTS: '', totalArr: [], model: null, - standardMethodListId: null, + standardMethodListId: [], symbolList:[ 'RTS','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'], inspectionItem:null, @@ -1127,7 +1151,9 @@ temId: '', sonLaboratoryList:[], selectiveEcho: [], // 妫�楠屼笅鍗曠殑鏃跺�欏嬀閫夋楠岄」鐩�,濡傛灉浣跨敤绛涢�夋彁浜ゆ樉绀烘楠岄」鐩负绌� 鍥炴樉鍒楄〃 - deaprtEnum:[] + deaprtEnum:[], + standard:[], + createState:1,//1:閫夋嫨濮旀墭鍗曚綅锛�2锛氶�夋嫨鐢熶骇鍗曚綅 } }, watch: { @@ -1179,11 +1205,11 @@ }, 'addObj.sample'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] }, 'addObj.sampleNum'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] } }, mounted() { @@ -1193,6 +1219,7 @@ // this.selectInsOrderTemplate() this.getAuthorizedPerson(); this.selectEnumByCategoryForUnit() + this.selectEnumByCategoryForStandard() this.selectStandardMethods() this.selectEnumByCategoryForOrderType() this.selectDepartmentEnum() @@ -1208,7 +1235,10 @@ ...res.data.insOrder }; this.addObj.type = String(this.addObj.type) - this.sampleList = this.HaveJson(res.data.sampleProduct); + this.sampleList = this.HaveJson(res.data.sampleProduct) + this.sampleList.forEach(m=>{ + m.standardMethodListId = JSON.parse(m.standardMethodListId) + }); this.getProNum() this.addObj.sampleNum = this.sampleList.length this.$nextTick(() => { @@ -1222,6 +1252,7 @@ } }, methods: { + //鐗规畩鍊煎~鍐欏鐞� inputValueHandler(row,index){ if(row){ @@ -1527,14 +1558,23 @@ this.$message.error('鏈�夋嫨鏁版嵁') return } - this.addObj.company = selects.company - this.addObj.code = selects.code - this.addObj.companyId = selects.id - this.selectUserDia = false - if(this.active==1){ - // TODO - this.selectInsOrderTemplate() + if(this.createState==1){ + this.addObj.company = selects.company + this.addObj.code = selects.code + this.addObj.companyId = selects.id + if(this.active==1){ + this.selectInsOrderTemplate() + } + }else if(this.createState==2){ + this.addObj.production = selects.company + // 濡傛灉閫夋嫨鐨勫崟浣嶆槸娌℃湁瀵瑰簲鐨勮嫳鏂囧悕绉板氨鐢�'/'浠f浛 + if (!selects.companyEn) { + this.addObj.productionEn = '/' + } else { + this.addObj.productionEn = selects.companyEn + } } + this.selectUserDia = false }, containsValue(str) { if(str){ @@ -1594,18 +1634,28 @@ }else if(this.addObj.orderType&&this.addObj.orderType!='C'&&!this.addObj.departmentLimsId){ this.addObj.departmentLims = '妫�娴嬩腑蹇�' this.addObj.departmentLimsId = this.deaprtEnum.find(m=>m.name=='妫�娴嬩腑蹇�').id - }else{ - this.$message.error('璇烽�夋嫨妫�楠岀被鍒�') - return } + // else{ + // this.$message.error('璇烽�夋嫨妫�楠岀被鍒�') + // return + // } if (!this.addObj.companyId) { this.$message.error('鏈�夋嫨瀹㈡埛鍗曚綅') + return + } + let noLaboratory = this.totalArr.filter(a => a.state == 1&&!a.sonLaboratory) + if(noLaboratory.length>0){ + let str = '' + noLaboratory.forEach((m,j)=>{ + str += j==noLaboratory.length-1?m.inspectionItem+'-'+m.inspectionItemSubclass:m.inspectionItem+'-'+m.inspectionItemSubclass+',' + }) + this.$message.error(str+'娌℃湁鍏宠仈瀹為獙瀹ゅ锛岃鑱旂郴绠$悊鍛�') return } if (!this.addObj.type) { this.$message.error('鏈�夋嫨绱ф�ョ▼搴�') } else if (!this.addObj.formType) { - this.$message.error('璇疯緭鍏ユ潵鏍锋柟寮�') + this.$message.error('璇疯緭鍏ヨ鍗曠被鍨�') } else if (!this.addObj.orderType) { this.$message.error('璇烽�夋嫨妫�楠岀被鍒�') } else if (!this.addObj.production) { @@ -1620,9 +1670,11 @@ this.$message.error('璇疯緭鍏ユ牱鍝佸悕绉�') } else if (!this.sampleList.every(m => m.model)) { this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�') - } else if (!this.sampleList.every(m => m.standardMethodListId)) { + } else if (!this.sampleList.every(m => m.standardMethodListId&&m.standardMethodListId.length>0)) { this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�') - } else { + } else if(this.addObj.formType&&this.addObj.formType!='鍏朵粬鎴愬搧'&&!this.addObj.issueUser){ + this.$message.error('璇烽�夋嫨涓嬪彂瀵硅薄') + }else{ //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹� // if(this.active==1&&this.isAskOnlyRead){ // const isTrue = this.checkRequiredValueAndRemark(filterProductList) @@ -2128,9 +2180,15 @@ }) }, getProNum() { - this.sampleSelectionList.forEach((m, i) => { - Vue.set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length) - }) + if (this.active != 1) { + this.sampleList.forEach((m, i) => { + Vue.set(this.sampleList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length) + }) + }else{ + this.sampleSelectionList.forEach((m, i) => { + Vue.set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length) + }) + } this.$refs.sampleTable.doLayout() }, searchFilter() { @@ -2216,7 +2274,7 @@ this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit - this.sample.standardMethodListId = null + this.sample.standardMethodListId = [] this.sample.insProduct = [] this.sample.id = this.count this.sample.childSampleList = [] @@ -2261,7 +2319,7 @@ this.sample.sample = this.addObj.sample this.sample.model = this.addObj.model this.sample.unit = this.addObj.unit - this.sample.standardMethodListId = null + this.sample.standardMethodListId = [] this.sample.insProduct = [] this.sample.id = parseInt(i+1) this.sample.childSampleList = [] @@ -2301,12 +2359,6 @@ }, rowClick(row, column, event) { this.currentMethod = row - let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) - if (obj && obj.code == '濮旀墭瑕佹眰') { - this.isAskOnlyRead = true - } else { - this.isAskOnlyRead = false - } this.sampleId = row.id if (this.active !== 1) { this.sampleIds = [] @@ -2550,6 +2602,13 @@ this.units = res.data }) }, + selectEnumByCategoryForStandard() { + this.$axios.post(this.$api.enums.selectEnumByCategory, { + category: "璇曢獙鏍囧噯" + }).then(res => { + this.standard = res.data + }) + }, selectEnumByCategoryForOrderType() { this.$axios.post(this.$api.enums.selectEnumByCategory, { category: "妫�楠岀被鍒�" @@ -2562,7 +2621,7 @@ }, selectEnumByCategoryForSampleForm() { this.$axios.post(this.$api.enums.selectEnumByCategory, { - category: "鏉ユ牱鏂瑰紡" + category: "璁㈠崟绫诲瀷" }).then(res => { this.formType = res.data if (this.formType.length > 0) { @@ -2571,33 +2630,25 @@ }) }, methodChange(val, row) { - if (val === null || val === '') return + if (val === null || val === ''||val.length ==0) return this.currentMethod = row - let obj = this.methods.find(a => a.id == this.currentMethod.standardMethodListId) - if (obj && obj.code == '濮旀墭瑕佹眰') { - this.isAskOnlyRead = true - } else { - this.isAskOnlyRead = false - } this.getProductLoad = true let selectTreeList = this.selectTree.split(" - ") this.addObj.model&&(selectTreeList[selectTreeList.length - 1] = this.addObj.model) - - console.log( this.selectTree); this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: (this.addObj.model?this.addObj.model:row.model) + '-' + row.modelNum, - standardMethodListId: val, + standardMethodListId: val.join(','), factory: selectTreeList.join(" - "), }, { headers: { 'Content-Type': 'application/json' } }).then(res => { + this.getProductLoad = false res.data.forEach(a => { a.state = 0 }) row.insProduct = this.HaveJson(res.data) - this.getProductLoad = false this.productList = row.insProduct this.productList0 = JSON.parse(JSON.stringify(this.productList)) this.$refs.sampleTable.setCurrentRow(row) @@ -2606,6 +2657,8 @@ if (a.state == 1) this.toggleSelection(a) }) }, 200) + }).catch(e => { + this.getProductLoad = false }) this.searchProject() this.searchTemList() @@ -3196,7 +3249,7 @@ }, selectDepartmentEnum(){ this.$axios.get(this.$api.department.selectDepartmentLimsEnum).then(res=>{ - this.deaprtEnum = res.data + this.deaprtEnum = res.data.filter(item=>item.name === '璐ㄩ噺閮�' || item.name === '妫�娴嬩腑蹇�') }) } } -- Gitblit v1.9.3