From 63116158434214f23d1318f54b78de1d0f47ab4e Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 15 五月 2024 15:28:39 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master --- src/components/view/person-manage.vue | 97 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 86 insertions(+), 11 deletions(-) diff --git a/src/components/view/person-manage.vue b/src/components/view/person-manage.vue index 9003944..3542f40 100644 --- a/src/components/view/person-manage.vue +++ b/src/components/view/person-manage.vue @@ -46,32 +46,31 @@ .search { background-color: #fff; - height: 80px; + height: 60px; display: flex; align-items: center; } .search_thing { - width: 350px; + width: 250px; display: flex; align-items: center; } .search_label { - width: 110px; + width: 90px; font-size: 14px; text-align: right; } .search_input { - width: calc(100% - 110px); + width: calc(100% - 90px); } .table { - margin-top: 10px; + margin-top: 4px; background-color: #fff; - height: calc(100% - 100px); - padding: 20px; + height: calc(100% - 44px); } </style> <style> @@ -83,21 +82,47 @@ justify-content: center; } </style> +<style> + .person_manage .el-tree-node__content { + height: 32px; + font-size: 14px; + border-radius: 2px; + } + .person_manage .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content { + color: #3A7BFA; + } + + .person_manage .has-gutter .el-table__cell .cell { + line-height: 34px; + background-color: #f8f8f8; + } + + .person_manage .has-gutter .el-table__cell { + background-color: #fafafa !important; + } + + .person_manage .el-table__row .cell { + font-size: 14px; + } + + .person_manage .el-table .warning-row .cell { + color: #bababa; + } +</style> <template> <div class="person_manage"> <!-- <el-row class="title"> <el-col :span="12" style="padding-left: 20px;">鐢ㄦ埛绠$悊</el-col> <el-col :span="12" style="text-align: right;"> - <el-button size="medium" type="primary" @click="openthirdParty">鑾峰彇涓夋柟浜哄憳</el-button> - <el-button size="medium" type="primary" @click="opeaAdd" v-if="addPower">鏂板鐢ㄦ埛</el-button> + </el-col> </el-row> --> <div class="left"> <el-row> <el-col :span="20"> <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�" suffix-icon="el-icon-search" v-model="search" size="small" - style="margin-bottom: 5px;" clearable @blur="searchFilter" @clear="searchFilter"></el-input> + style="margin-bottom: 5px;" clearable @blur="searchFilter" @clear="searchFilter" @keyup.enter.native="searchFilter()"></el-input> </el-col> <el-col :span="4" style="text-align: center;line-height: 30px;" v-if="addPower"> <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="handleAdd"></el-button> @@ -150,6 +175,10 @@ <div class="search_thing" style="padding-left: 30px;"> <el-button size="small" @click="refresh()">閲� 缃�</el-button> <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> + </div> + <div class="search_thing"> + <el-button size="small" type="primary" @click="openthirdParty">鑾峰彇涓夋柟浜哄憳</el-button> + <el-button size="small" type="primary" @click="opeaAdd" v-if="addPower">鏂板鐢ㄦ埛</el-button> </div> </div> <div class="table"> @@ -244,6 +273,7 @@ name: null, state: null, company: null, + departId:null, orderBy:{ field: 'id', order: 'asc' @@ -303,6 +333,7 @@ }, */ requiredAdd:['account','name','state','roleId','password','nameEn','phone'], requiredUp:['account','name','state','roleId','nameEn','phone'], + // disabledUp:['departId'], addUpload:['pictureUrl','signatureUrl'], addUploadConfig:{ accept:'.png, .jpg, .jpeg, .gif', @@ -313,6 +344,7 @@ upIndex: 0, addDia: false, addPower: true, + delStandardTree:true, addDia0:false, addOb:{ fatherId:'', @@ -342,7 +374,8 @@ }, refresh() { this.componentData.entity = this.HaveJson(this.entityCopy) - this.upIndex++ + // this.upIndex++ + this.refreshTable() }, upUser(row){ console.log(row); @@ -360,7 +393,12 @@ }) }, opeaAdd(){ + if(!this.addOb.fatherId||this.selectTree==''||this.selectTree=='鍏ㄩ儴'){ + this.$message.error('璇烽�夋嫨涓�涓粍缁�') + return + } this.$refs.ValueTable.openAddDia(this.$api.user.addUser); + this.$refs['ValueTable'].upData.departId = this.selectTree }, selectTreeList(){ /* this.$axios.get(this.$api.department.selectDepartment).then(res => { @@ -383,6 +421,7 @@ let power = JSON.parse(sessionStorage.getItem('power')) let up = false let add = false + let delStandardTree = false for (var i = 0; i < power.length; i++) { if(power[i].menuMethod=='updateUser'){ up = true @@ -390,10 +429,14 @@ if(power[i].menuMethod=='addUser'){ add = true } + if(power[i].menuMethod=='delDepartment'){ + delStandardTree = true + } } if(!up){ this.componentData.do.splice(0, 1) } + this.delStandardTree = delStandardTree this.addPower = add }, handleAdd(){ @@ -430,6 +473,12 @@ nodeClose(data, node, el) { $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder') }, + getNodeParent(val) { + if (val.parent != null) { + this.selectTree += ' - ' + val.label + this.getNodeParent(val.parent) + } + }, remove(node, data) { this.$confirm("鏄惁鍒犻櫎璇ュ眰绾�", "鎻愮ず", { type: "error" @@ -461,6 +510,32 @@ this.refreshTable() }) }, + addStandardTree() { + if (this.addOb.name == null || this.addOb.factory == '') { + this.$message.error('鏋勬灦鍚嶇О鏄繀濉」') + return + } + this.addLoad = true + this.$axios.post(this.$api.department.addDepartment, this.addOb, { + headers: { + 'Content-Type': 'application/json' + } + }).then(res => { + if (res.code === 201) { + this.addLoad = false + return + } + this.$message.success('娣诲姞鎴愬姛') + this.addDia0 = false + this.selectTreeList() + this.addLoad = false + this.addOb.name = '' + this.addOb.fatherId = '' + }).catch(e => { + this.addDia0 = false + this.addLoad = false + }) + }, } } </script> -- Gitblit v1.9.3