From 88810da4cf6f4c54c11fd11cbba760a7058e22b5 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 12 九月 2024 14:16:58 +0800 Subject: [PATCH] 检验标准多选,优化审核按钮 --- src/components/do/b1-ins-order/add.vue | 38 +++++++------------ src/components/do/b1-ins-order/cable-config.vue | 18 +++------ src/components/do/b1-ins-order/equip-config.vue | 20 ++-------- src/main.js | 4 +- src/components/view/b1-inspection-order.vue | 28 +++++++++++++- src/assets/api/controller.js | 5 ++ 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js index 2669b3c..7c61c5f 100644 --- a/src/assets/api/controller.js +++ b/src/assets/api/controller.js @@ -32,6 +32,7 @@ insBushing, auxiliaryOriginalHours, evaluate, + role, } } @@ -403,3 +404,7 @@ getEvaluateGroup: "/evaluateGroup/getEvaluateGroup", //鏌ヨ鍛樺伐浜掕瘎 writeEvaluateGroup: "/evaluateGroup/writeEvaluateGroup", //濉啓鍛樺伐浜掕瘎 } + +const role = { + getRole:"/role/getRole",//鑾峰彇褰撳墠鐢ㄦ埛瑙掕壊 +} diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 0f3c868..d2d1314 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -367,8 +367,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> @@ -410,7 +410,7 @@ <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> @@ -1102,7 +1102,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, @@ -1189,11 +1189,11 @@ }, 'addObj.sample'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] }, 'addObj.sampleNum'(val) { this.model = null - this.standardMethodListId = null + this.standardMethodListId = [] } }, mounted() { @@ -1219,7 +1219,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(() => { @@ -1641,7 +1644,7 @@ 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 { //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪,浠呭鎵樿姹� @@ -2243,7 +2246,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 = [] @@ -2288,7 +2291,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 = [] @@ -2328,12 +2331,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 = [] @@ -2607,20 +2604,13 @@ methodChange(val, row) { if (val === null || val === '') 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: { diff --git a/src/components/do/b1-ins-order/cable-config.vue b/src/components/do/b1-ins-order/cable-config.vue index 575fc95..8e706c9 100644 --- a/src/components/do/b1-ins-order/cable-config.vue +++ b/src/components/do/b1-ins-order/cable-config.vue @@ -24,7 +24,7 @@ <div class="search_thing" v-if="currentTab=='缁濈紭'"> <div class="search_label">妫�楠屾爣鍑嗭細</div> <el-select v-model="insulating.standardMethodListId" placeholder="璇烽�夋嫨妫�楠屾爣鍑�" size="small" - @change="(value)=>methodChange(value)"> + @change="(value)=>methodChange(value)" multiple> <el-option v-for="item in standards" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -32,7 +32,7 @@ <div class="search_thing" v-if="currentTab=='鎶ゅ'"> <div class="search_label">妫�楠屾爣鍑嗭細</div> <el-select v-model="sheath.standardMethodListId" placeholder="璇烽�夋嫨妫�楠屾爣鍑�" size="small" - @change="(value)=>methodChange(value)"> + @change="(value)=>methodChange(value)" multiple> <el-option v-for="item in standards" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -56,7 +56,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)" - v-if="active==1&&isAskOnlyRead"></el-input> + v-if="active==1"></el-input> <span v-else>{{ scope.row.ask }}</span> </template> </el-table-column> @@ -86,12 +86,12 @@ tree: '', standards: [], insulating: { - standardMethodListId: null, + standardMethodListId: [], insProduct: [], num: 1 }, sheath: { - standardMethodListId: null, + standardMethodListId: [], insProduct: [] }, isAskOnlyRead: false @@ -177,15 +177,9 @@ }, methodChange(val) { if (val === null || val === '') return - let standard = this.standards.find(a => a.id === val) - if(standard!=null && standard.code==='濮旀墭瑕佹眰'){ - this.isAskOnlyRead = true - }else{ - this.isAskOnlyRead = false - } this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: this.$parent.addObj.model, - standardMethodListId: val, + standardMethodListId: val.join(','), factory: this.tree + ' - ' }, { headers: { diff --git a/src/components/do/b1-ins-order/equip-config.vue b/src/components/do/b1-ins-order/equip-config.vue index ddf3fbd..dde2bd5 100644 --- a/src/components/do/b1-ins-order/equip-config.vue +++ b/src/components/do/b1-ins-order/equip-config.vue @@ -48,7 +48,7 @@ <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%;"> + @focus="methodFocus" :readonly="active>1" style="width: 100%;" multiple> <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> </el-option> </el-select> @@ -81,7 +81,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)" - v-if="active==1&&isAskOnlyRead"></el-input> + v-if="active==1"></el-input> <span v-else>{{ scope.row.ask }}</span> </template> </el-table-column> @@ -245,12 +245,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 = [] @@ -286,16 +280,10 @@ methodChange(val, row) { if (val === null || val === '') 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 this.$axios.post(this.$api.standardTree.selectStandardProductList, { model: row.model + '-' + row.modelNum, - standardMethodListId: val, + standardMethodListId: val.join(','), factory: this.selectTree, }, { headers: { @@ -473,7 +461,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.num = this.addObj.sampleNum diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue index 1f25b27..0289075 100644 --- a/src/components/view/b1-inspection-order.vue +++ b/src/components/view/b1-inspection-order.vue @@ -530,7 +530,21 @@ type: 'text', method: 'handleVerify', disabFun: (row, index) => { - return row.state != 0 + let state0 = false + if(this.currentRole=='妫�娴嬩腑蹇冧富浠�'){ + if(row.checkState1||row.checkState1User){ + state0 = true + } + }else if(this.currentRole=='鐮斿彂閮ㄧ粡鐞�'){ + if(row.checkState2||row.checkState2User){ + state0 = true + } + }else if(this.currentRole=='鎶�鏈礋璐d汉'){ + if(row.checkState3||row.checkState3User){ + state0 = true + } + } + return row.state != 0 || state0 ||(this.currentRole!='妫�娴嬩腑蹇冧富浠�'&&this.currentRole!='鐮斿彂閮ㄧ粡鐞�'&&this.currentRole!='鎶�鏈礋璐d汉') } }, { id: 'quash', @@ -745,7 +759,8 @@ ], qrData:[], multipleSelection:[], - sonLaboratoryList:[] + sonLaboratoryList:[], + currentRole:'' } }, watch:{ @@ -757,6 +772,9 @@ this.isIndeterminate = true; } } + }, + created() { + this.getAuthorizedPersonRole() }, mounted() { this.entityCopy = this.HaveJson(this.componentData.entity) @@ -861,6 +879,11 @@ }) }) this.personList = data + }) + }, + getAuthorizedPersonRole() { + this.$axios.get(this.$api.role.getRole).then(res => { + this.currentRole = res.message }) }, refreshTable(e) { @@ -1115,6 +1138,7 @@ playOrder(num) { this.active = num this.examine = 0 + this.getAuthorizedPersonRole() this.refreshTable('page') }, handleTab(m, i) { diff --git a/src/main.js b/src/main.js index 4be6985..f4acdb6 100644 --- a/src/main.js +++ b/src/main.js @@ -20,11 +20,11 @@ //鏈湴 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80"; // const javaApi = 'http://127.0.0.1:8001'; -// const javaApi = 'http://172.20.10.5:8001'; +const javaApi = 'http://172.20.10.5:8001'; // //閫氫俊娴嬭瘯搴� // Vue.prototype.LOCATIONVUE = "http://10.1.13.77:8080"; -const javaApi = 'http://10.1.13.77:8001'; +// const javaApi = 'http://10.1.13.77:8001'; //浜� // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080"; -- Gitblit v1.9.3