| | |
| | | padding: 20px; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-upload--text{ |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <div class="person_manage"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">人员管理</el-col> |
| | | <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="opeaAdd" v-if="addPower">新增人员</el-button> |
| | | <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> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">客户名称:</div> |
| | | <div class="search_label">用户名:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable |
| | | v-model="componentData.entity.name" @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.user.selectUserList" :upUrl="$api.user.updateUser" :componentData="componentData" :key="upIndex" @upUser="upUser"/> |
| | | </div> |
| | | <el-dialog title="添加三方人员" :visible.sync="addthirdParty" width="400px"> |
| | | <div class="body"> |
| | | <el-tree |
| | | :data="datathirdParty" |
| | | show-checkbox |
| | | node-key="id" |
| | | :default-expanded-keys="[2, 3]" |
| | | :default-checked-keys="[5]" |
| | | :props="defaultProps"> |
| | | </el-tree> |
| | | <span slot="footer" style="padding-left: 200px"> |
| | | <el-button @click="addthirdParty = false" size="mini">取 消</el-button> |
| | | <el-button type="primary" @click="" :loading="addLoad" size="mini">确 定</el-button> |
| | | </span> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | datathirdParty:[{ |
| | | id: 1, |
| | | label: '一级 1', |
| | | children: [{ |
| | | id: 4, |
| | | label: '二级 1-1', |
| | | children: [{ |
| | | id: 9, |
| | | label: '三级 1-1-1' |
| | | }, { |
| | | id: 10, |
| | | label: '三级 1-1-2' |
| | | }] |
| | | }] |
| | | }, { |
| | | id: 2, |
| | | label: '一级 2', |
| | | children: [{ |
| | | id: 5, |
| | | label: '二级 2-1' |
| | | }, { |
| | | id: 6, |
| | | label: '二级 2-2' |
| | | }] |
| | | }, { |
| | | id: 3, |
| | | label: '一级 3', |
| | | children: [{ |
| | | id: 7, |
| | | label: '二级 3-1' |
| | | }, { |
| | | id: 8, |
| | | label: '二级 3-2' |
| | | }] |
| | | }], |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | }, |
| | | addthirdParty:false, |
| | | componentData: { |
| | | entity: { |
| | | name: null, |
| | |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isIndex: false, |
| | | showSelect: true, |
| | | select: true, |
| | | row: 2, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: false, |
| | | init:false, |
| | | do: [{ |
| | | id: 'update', |
| | | font: '编辑', |
| | |
| | | roleId: { |
| | | select: [] |
| | | } |
| | | } |
| | | }, |
| | | /* cascaderField:{ |
| | | departId:{ |
| | | tree:[] |
| | | }, |
| | | // 字段配置 |
| | | props:{ |
| | | value:'id', |
| | | label:'name', |
| | | checkStrictly: true |
| | | } |
| | | }, */ |
| | | requiredAdd:['account','name','state','roleId','password','nameEn','phone'], |
| | | requiredUp:['account','name','state','roleId','nameEn','phone'], |
| | | addUpload:['pictureUrl','signatureUrl'], |
| | | addUploadConfig:{ |
| | | accept:'.png, .jpg, .jpeg, .gif', |
| | | url:this.$api.deviceScope.uploadFile |
| | | }, |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.selectTreeList() |
| | | this.selectRole() |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | | }, |
| | | methods: { |
| | | openthirdParty(){ |
| | | this.addthirdParty=true; |
| | | |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | }, |
| | |
| | | opeaAdd(){ |
| | | this.$refs.ValueTable.openAddDia(this.$api.user.addUser); |
| | | }, |
| | | selectTreeList(){ |
| | | /* this.$axios.get(this.$api.department.selectDepartment).then(res => { |
| | | this.componentData.cascaderField.departId.tree = this.handleTree(res.data[0].children) |
| | | }) */ |
| | | this.$refs.ValueTable.selectList() |
| | | }, |
| | | handleTree(arr){ |
| | | arr.forEach(a => { |
| | | if(a.children.length==0){ |
| | | a.children = null; |
| | | }else{ |
| | | this.handleTree(a.children) |
| | | } |
| | | }) |
| | | return arr |
| | | }, |
| | | // 权限分配 |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | </script> |