From 07959b422026f1de7bbd90af23e440ebd4fea567 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 03 九月 2024 10:50:46 +0800 Subject: [PATCH] 菜单 --- src/components/do/b1-ins-order/add.vue | 160 +++++++++++++++++++++++++++++++++-------------------- 1 files changed, 100 insertions(+), 60 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 28aeca3..0f3c868 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -207,6 +207,14 @@ <el-input size="small" placeholder="閫夋嫨濮旀墭瀹㈡埛" clearable :readonly="active>1" v-model="addObj.phone"></el-input> </div> </el-col> + <el-col class="search_thing" :span="6" v-if="addObj.orderType=='C'"> + <div class="search_label"><span class="required-span">* </span>涓嬪崟鑷筹細</div> + <div class="search_input"> + <el-select size="small" style="width: 100%;" clearable v-model="addObj.departmentLimsId" :disabled="active>1" placeholder="閮ㄩ棬"> + <el-option v-for="(a, ai) in deaprtEnum" :key="ai" :value="a.id" :label="a.name"></el-option> + </el-select> + </div> + </el-col> <el-col class="search_thing" :span="6"> <div class="search_label"><span class="required-span">* </span>绱ф�ョ▼搴︼細</div> <div class="search_input"> @@ -376,7 +384,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> @@ -391,7 +399,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)" @@ -404,6 +412,15 @@ placeholder="妫�楠屾爣鍑�" size="small" :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" @focus="methodFocus" :readonly="active>1" style="width: 100%;" clearable @clear="productList = []"> <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> @@ -465,17 +482,17 @@ <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&&isAskOnlyRead"></el-input> + v-if="active==1"></el-input> <span v-else> <template >{{ scope.row.tell }}</template> </span> </template> </el-table-column> - <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px" v-if="isAskOnlyRead"> + <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px" > <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&&isAskOnlyRead&&scope.row.inspectionValueType!='5'"></el-input> + v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input> <span v-else> <!-- <template v-if="(scope.row.ask.indexOf('D')>-1 ||scope.row.ask.indexOf('W')>-1 @@ -523,7 +540,7 @@ <el-button type="primary" @click="selectUser">纭� 瀹�</el-button> </span> </el-dialog> - <el-dialog title="閫夋嫨鏍峰搧" :visible.sync="selectStandardTree" width="400px"> + <el-dialog title="閫夋嫨鏍峰搧" :visible.sync="selectStandardTree" width="500px"> <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree"> <el-row> <el-col :span="24"> @@ -920,7 +937,6 @@ import equipConfig from './equip-config.vue' import cableConfig from './cable-config.vue' import Vue from 'vue' -import {iuCharts} from "../../../util/echarts"; export default { components: { @@ -981,7 +997,9 @@ production: null, productionEn: null, companyId: null, - prepareUser:null + prepareUser:null, + departmentLimsId:null, + departmentLims:null }, sample: { sampleCode: null, @@ -1118,6 +1136,8 @@ temId: '', sonLaboratoryList:[], selectiveEcho: [], // 妫�楠屼笅鍗曠殑鏃跺�欏嬀閫夋楠岄」鐩�,濡傛灉浣跨敤绛涢�夋彁浜ゆ樉绀烘楠岄」鐩负绌� 鍥炴樉鍒楄〃 + deaprtEnum:[], + standard:[] } }, watch: { @@ -1183,8 +1203,10 @@ // this.selectInsOrderTemplate() this.getAuthorizedPerson(); this.selectEnumByCategoryForUnit() + this.selectEnumByCategoryForStandard() this.selectStandardMethods() this.selectEnumByCategoryForOrderType() + this.selectDepartmentEnum() // this.selectEnumByCategoryForSonLaboratory() this.selectEnumByCategoryForSampleForm() if (this.active != 1) { @@ -1578,8 +1600,27 @@ return str.replace(find, value); }, save() { + if(this.addObj.orderType=='C'&&this.addObj.departmentLimsId){ + this.addObj.departmentLims = this.deaprtEnum.find(m=>m.id==this.addObj.departmentLimsId).name + }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 + // } 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) { @@ -1592,6 +1633,8 @@ this.$message.error('璇疯緭鍏ョ敓浜у崟浣�') } else if (!this.addObj.productionEn) { this.$message.error('璇疯緭鍏ョ敓浜у崟浣岴N') + }else if (!this.addObj.departmentLimsId) { + this.$message.error('閫夋嫨涓嬪崟鍒板摢涓儴闂�') } else if (this.sampleList.length < 1) { this.$message.error('璇锋坊鍔犱竴涓牱鍝�') } else if (!this.sampleList.every(m => m.sample)) { @@ -1601,54 +1644,14 @@ } else if (!this.sampleList.every(m => m.standardMethodListId)) { this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�') } else { - const select = this.selectTree.split(' - ') - const productListSelected = this.productListSelected.some(item => item.inspectionItem === '娓╁害寰幆') - let isHaveBushing = '' - this.sampleList.forEach(item => { - if (!item.bushing || item.bushing.length === 0) { - isHaveBushing = false - } - }) - //杩囨护妫�娴嬮」锛氬幓闄ょ壒娈婇」 - let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{ - if(select[1].indexOf('閫氫俊')>=0 && ['鍏夌紗','鍏夌氦'].includes(select[2])){ - return !['娓╁害寰幆','鍏夌氦鎺ュご鎹熻��'].includes(ele.inspectionItem) - } - return true - }).filter(ele=>{ - if(select[1].indexOf('鐢靛姏')>=0){ - return !['娓╁崌璇曢獙','鐑惊鐜�'].includes(ele.inspectionItem) - } - return true - }) //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹� - if(this.active==1&&this.isAskOnlyRead){ - const isTrue = this.checkRequiredValueAndRemark(filterProductList) - if(!isTrue){ - this.$message.error('妫�楠岄」鐨勮姹傚�间笌瑕佹眰鎻忚堪涓嶅尮閰嶏紝 璇锋鏌�') - return - } - } - - // console.log('isHaveBushing===', this.totalArr) - let spcialItem = this.totalArr.filter(a => a.state == 1 && a.inspectionItem.includes('鏉惧绠�')) - if (productListSelected && select[2] === '鍏夌紗' && isHaveBushing === false&&spcialItem.length==0) { - this.$message.error('鍏夌紗娓╁害寰幆椤圭洰蹇呴』杩涜鍏夌氦閰嶇疆') - this.$refs.sampleTable.setCurrentRow(this.currentMethod, true) - this.rowClick(this.currentMethod) - this.sampleIds = [this.currentMethod.id] - this.openConfig() - return - }else if(spcialItem.length>0&& isHaveBushing === false){ - this.$message.error('鏉惧绠¢」鐩繀椤昏繘琛屽厜绾ら厤缃�') - // this.$refs.sampleTable.setCurrentRow(this.currentMethod, true) - // this.rowClick(this.currentMethod) - spcialItem.forEach(item=>{ - this.sampleIds.push(item.id) - }) - this.openConfig() - return - } + // if(this.active==1&&this.isAskOnlyRead){ + // const isTrue = this.checkRequiredValueAndRemark(filterProductList) + // if(!isTrue){ + // this.$message.error('妫�楠岄」鐨勮姹傚�间笌瑕佹眰鎻忚堪涓嶅尮閰嶏紝 璇锋鏌�') + // return + // } + // } let sampleList = this.HaveJson(this.sampleList) let projectNum = this.totalArr.filter(a => a.state == 1).length if(projectNum==0){ @@ -1821,7 +1824,7 @@ } } }else{ - this.$message.error('瑕佹眰鍊间负绌猴紝闇�瑕佸幓鏍囧噯搴撶淮鎶わ紒') + // this.$message.error('瑕佹眰鍊间负绌猴紝闇�瑕佸幓鏍囧噯搴撶淮鎶わ紒') } } // arr.forEach(f => { @@ -1993,6 +1996,22 @@ } }, saveMethod(sampleList){ + let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1) + if (isHaveAsk.length > 0) { + this.$message({ + type: 'error', + message: '璇峰~鍐欒姹傚�煎悗鍐嶆彁浜�' + }) + return false; + } + let isHaveTell = this.totalArr.filter(a => (a.tell == null||a.tell=='')&&a.state==1) + if (isHaveTell.length > 0) { + this.$message({ + type: 'error', + message: '璇峰~鍐欒姹傛弿杩板悗鍐嶆彁浜�' + }) + return false; + } this.saveLoad = true this.$axios.post(this.$api.insOrder.addInsOrder, { str: JSON.stringify({ @@ -2067,7 +2086,10 @@ this.distributeData.appointed = ress.data }) setTimeout(() => { - this.issuedDialogVisible = true; + // this.issuedDialogVisible = true; + // this.$message.success('鎻愪氦鎴愬姛') + this.upLoad = false + this.$parent.playOrder(0) }, 1000) }) } else { @@ -2127,9 +2149,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() { @@ -2547,6 +2575,13 @@ category: "鍗曚綅" }).then(res => { this.units = res.data + }) + }, + selectEnumByCategoryForStandard() { + this.$axios.post(this.$api.enums.selectEnumByCategory, { + category: "璇曢獙鏍囧噯" + }).then(res => { + this.standard = res.data }) }, selectEnumByCategoryForOrderType() { @@ -3192,6 +3227,11 @@ if(this.sonLaboratoryList.length>0){ this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value } + }, + selectDepartmentEnum(){ + this.$axios.get(this.$api.department.selectDepartmentLimsEnum).then(res=>{ + this.deaprtEnum = res.data + }) } } } -- Gitblit v1.9.3