Browse Source

完善组织管理新增/编辑页面,增加组织属性字段、部门改为组织、树形列表默认展示第二级

master
yunuo970428 3 years ago
parent
commit
eb688ffba8
  1. 2
      anrui-system-ui/src/router/index.js
  2. 88
      anrui-system-ui/src/views/organizationManage/organizationManage.vue

2
anrui-system-ui/src/router/index.js

@ -185,7 +185,7 @@ export const constantRoutes = [
import('@/views/organizationManage/organizationManage.vue'), import('@/views/organizationManage/organizationManage.vue'),
name: 'organizationManage', name: 'organizationManage',
meta: { meta: {
title: '组织架构管理' title: '组织管理'
} }
}] }]
}, },

88
anrui-system-ui/src/views/organizationManage/organizationManage.vue

@ -1,7 +1,7 @@
<template xmlns="" xmlns="" xmlns=""> <template xmlns="" xmlns="" xmlns="">
<div class="container" style="display: flex;"> <div class="container" style="display: flex;">
<div class="org-tree"> <div class="org-tree">
<el-tree :data="treedata" node-key="sid" :props="props" @node-click="handleNodeClick" :expand-on-click-node="false"> <el-tree :data="treedata" node-key="sid" :props="props" :default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" @click.stop.native> <span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" @click.stop.native>
<span>{{ node.label || $store.getters.userInfo.Orgname }}</span> <span>{{ node.label || $store.getters.userInfo.Orgname }}</span>
<span v-show="data.del" class="handle"> <span v-show="data.del" class="handle">
@ -9,14 +9,14 @@
<el-button type="text" size="mini" @click.stop="() => append(data)" icon="el-icon-circle-plus-outline"> <el-button type="text" size="mini" @click.stop="() => append(data)" icon="el-icon-circle-plus-outline">
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="修改" placement="top-start">--> <!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="修改" placement="top-start">-->
<!-- <el-button type="text" size="mini" @click.stop="() => deit(data)" icon="el-icon-edit">--> <!-- <el-button type="text" size="mini" @click.stop="() => deit(data)" icon="el-icon-edit">-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- </el-tooltip>--> <!-- </el-tooltip>-->
<!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="删除" placement="top-start">--> <!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="删除" placement="top-start">-->
<!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">--> <!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- </el-tooltip>--> <!-- </el-tooltip>-->
</span> </span>
</span> </span>
</el-tree> </el-tree>
@ -24,22 +24,26 @@
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit"> <el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
<table class="e-table" cellspacing="0"> <table class="e-table" cellspacing="0">
<tr> <tr>
<td>部门名称</td> <td>组织名称</td>
<td> <td>
<el-input v-model="form.name" style="width:300px"></el-input> <el-input v-model="form.name" style="width:300px"></el-input>
</td> </td>
<td>部门编码</td> <td>组织编码</td>
<td> <td>
<el-input v-model="form.orgCode" style="width:300px"></el-input> <el-input v-model="form.orgCode" style="width:300px"></el-input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>部门地址</td> <td>组织地址</td>
<td> <td>
<el-input v-model="form.addrs" style="width:130%"></el-input> <el-input v-model="form.addrs" style="width:300px"></el-input>
</td>
<td>组织属性</td>
<td>
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
</el-select>
</td> </td>
<td class="td_left"/>
<td class="td_left"/>
</tr> </tr>
<tr> <tr>
<!-- <td>主管人员</td>--> <!-- <td>主管人员</td>-->
@ -75,7 +79,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>部门联系人</td> <td>组织联系人</td>
<td> <td>
<el-input v-model="form.linkPerson" style="width:300px"></el-input> <el-input v-model="form.linkPerson" style="width:300px"></el-input>
</td> </td>
@ -160,7 +164,7 @@
<el-form ref="form" :inline="true" :model="form" label-width="80px"> <el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="16"> <el-col :span="16">
<h4 style="margin: 0;line-height: 32px;">部门二维码</h4> <h4 style="margin: 0;line-height: 32px;">组织二维码</h4>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="float: right;"> <el-form-item style="float: right;">
@ -175,7 +179,7 @@
<div class="ewm" style="display: flex;justify-content: center; align-items: center;" ref="print"> <div class="ewm" style="display: flex;justify-content: center; align-items: center;" ref="print">
<img style="width: 200px; height: 200px;" :src="ewmForm.qrFilePath" alt=""> <img style="width: 200px; height: 200px;" :src="ewmForm.qrFilePath" alt="">
<ul style="list-style:none; line-height: 32px; font-size: 16px;"> <ul style="list-style:none; line-height: 32px; font-size: 16px;">
<li><label>部门名称: </label><span>{{ ewmForm.departmentName }}</span></li> <li><label>组织名称: </label><span>{{ ewmForm.departmentName }}</span></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -185,7 +189,7 @@
<el-form ref="form" :inline="true" :model="form" label-width="80px"> <el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="16"> <el-col :span="16">
<h4 style="margin: 0;line-height: 32px;"> {{ dialogTitle }}部门信息</h4> <h4 style="margin: 0;line-height: 32px;"> {{ dialogTitle }}组织信息</h4>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="float: right;"> <el-form-item style="float: right;">
@ -200,22 +204,26 @@
<div class="ediut"> <div class="ediut">
<table class="e-table" cellspacing="0"> <table class="e-table" cellspacing="0">
<tr> <tr>
<td>部门名称</td> <td>组织名称</td>
<td> <td>
<el-input v-model="form.name" style="width:300px"></el-input> <el-input v-model="form.name" style="width:300px"></el-input>
</td> </td>
<td>部门编码</td> <td>组织编码</td>
<td> <td>
<el-input v-model="form.orgCode" style="width:300px"></el-input> <el-input v-model="form.orgCode" style="width:300px"></el-input>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>部门地址</td> <td>组织地址</td>
<td> <td>
<el-input v-model="form.addrs" style="width:130%"></el-input> <el-input v-model="form.addrs" style="width:300px"></el-input>
</td>
<td>组织属性</td>
<td>
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
</el-select>
</td> </td>
<td class="td_left"/>
<td class="td_left"/>
</tr> </tr>
<tr> <tr>
<!-- <td>主管人员</td>--> <!-- <td>主管人员</td>-->
@ -237,7 +245,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>部门联系人</td> <td>组织联系人</td>
<td> <td>
<el-input v-model="form.linkPerson" style="width:300px"></el-input> <el-input v-model="form.linkPerson" style="width:300px"></el-input>
</td> </td>
@ -279,6 +287,7 @@ import {
putOrgtree, putOrgtree,
selectBySid selectBySid
} from '@/api/system/departments/departments.js' } from '@/api/system/departments/departments.js'
import { typeValues } from '@/api/system/roleAdminister/index'
import Position from '@/components/amap/amap.vue' import Position from '@/components/amap/amap.vue'
export default { export default {
@ -303,6 +312,7 @@ export default {
departmentName: '', departmentName: '',
address: '' address: ''
}, },
orgAttribute_list: [],
form: { form: {
sid: '', sid: '',
name: '', name: '',
@ -317,7 +327,9 @@ export default {
linkPhone: '', linkPhone: '',
sort: '', sort: '',
isDept: '', isDept: '',
orgAbbre: '' orgAbbre: '',
orgAttributeValue: '',
orgAttributeKey: ''
}, },
fgStaffSid: [], fgStaffSid: [],
formBackup: Object.assign({}, this.form), formBackup: Object.assign({}, this.form),
@ -353,11 +365,31 @@ export default {
}, },
mounted() { mounted() {
this.getOrgTree() this.getOrgTree()
this.init()
// this.getStaff() // this.getStaff()
// this.getStaff2() // this.getStaff2()
// this.getPageList() // this.getPageList()
}, },
methods: { methods: {
init() {
typeValues({ type: 'orgAttribute' }).then((res) => {
if (res.success) {
this.orgAttribute_list = res.data
}
})
},
changeOrgAttribute(value) {
let bb = null
this.orgAttribute_list.forEach((e) => {
if (e.dictValue === value) {
bb = {
key: e.dictKey,
value: e.dictValue
}
}
})
this.form.orgAttributeKey = bb.key
},
pagination(val) { // pagination(val) { //
this.page.current = val.pageNum this.page.current = val.pageNum
this.page.size = val.pageSize this.page.size = val.pageSize
@ -492,7 +524,7 @@ export default {
}) })
}, },
remove(data) { remove(data) {
this.$confirm('确定要删除该部门吗, 是否继续?', '提示', { this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'

Loading…
Cancel
Save