Browse Source

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

zhanglei
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'),
name: 'organizationManage',
meta: {
title: '组织架构管理'
title: '组织管理'
}
}]
},

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

@ -1,7 +1,7 @@
<template xmlns="" xmlns="" xmlns="">
<div class="container" style="display: flex;">
<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>{{ node.label || $store.getters.userInfo.Orgname }}</span>
<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>
</el-tooltip>
<!-- <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>-->
<!-- </el-tooltip>-->
<!-- <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>-->
<!-- </el-tooltip>-->
<!-- <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>-->
<!-- </el-tooltip>-->
<!-- <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>-->
<!-- </el-tooltip>-->
</span>
</span>
</el-tree>
@ -24,22 +24,26 @@
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
<table class="e-table" cellspacing="0">
<tr>
<td>部门名称</td>
<td>组织名称</td>
<td>
<el-input v-model="form.name" style="width:300px"></el-input>
</td>
<td>部门编码</td>
<td>组织编码</td>
<td>
<el-input v-model="form.orgCode" style="width:300px"></el-input>
</td>
</tr>
<tr>
<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 class="td_left"/>
<td class="td_left"/>
</tr>
<tr>
<!-- <td>主管人员</td>-->
@ -75,7 +79,7 @@
</td>
</tr>
<tr>
<td>部门联系人</td>
<td>组织联系人</td>
<td>
<el-input v-model="form.linkPerson" style="width:300px"></el-input>
</td>
@ -160,7 +164,7 @@
<el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20">
<el-col :span="16">
<h4 style="margin: 0;line-height: 32px;">部门二维码</h4>
<h4 style="margin: 0;line-height: 32px;">组织二维码</h4>
</el-col>
<el-col :span="8">
<el-form-item style="float: right;">
@ -175,7 +179,7 @@
<div class="ewm" style="display: flex;justify-content: center; align-items: center;" ref="print">
<img style="width: 200px; height: 200px;" :src="ewmForm.qrFilePath" alt="">
<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>
</div>
</div>
@ -185,7 +189,7 @@
<el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20">
<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 :span="8">
<el-form-item style="float: right;">
@ -200,22 +204,26 @@
<div class="ediut">
<table class="e-table" cellspacing="0">
<tr>
<td>部门名称</td>
<td>组织名称</td>
<td>
<el-input v-model="form.name" style="width:300px"></el-input>
</td>
<td>部门编码</td>
<td>组织编码</td>
<td>
<el-input v-model="form.orgCode" style="width:300px"></el-input>
</td>
</tr>
<tr>
<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 class="td_left"/>
<td class="td_left"/>
</tr>
<tr>
<!-- <td>主管人员</td>-->
@ -237,7 +245,7 @@
</td>
</tr>
<tr>
<td>部门联系人</td>
<td>组织联系人</td>
<td>
<el-input v-model="form.linkPerson" style="width:300px"></el-input>
</td>
@ -279,6 +287,7 @@ import {
putOrgtree,
selectBySid
} from '@/api/system/departments/departments.js'
import { typeValues } from '@/api/system/roleAdminister/index'
import Position from '@/components/amap/amap.vue'
export default {
@ -303,6 +312,7 @@ export default {
departmentName: '',
address: ''
},
orgAttribute_list: [],
form: {
sid: '',
name: '',
@ -317,7 +327,9 @@ export default {
linkPhone: '',
sort: '',
isDept: '',
orgAbbre: ''
orgAbbre: '',
orgAttributeValue: '',
orgAttributeKey: ''
},
fgStaffSid: [],
formBackup: Object.assign({}, this.form),
@ -353,11 +365,31 @@ export default {
},
mounted() {
this.getOrgTree()
this.init()
// this.getStaff()
// this.getStaff2()
// this.getPageList()
},
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) { //
this.page.current = val.pageNum
this.page.size = val.pageSize
@ -492,7 +524,7 @@ export default {
})
},
remove(data) {
this.$confirm('确定要删除该部门吗, 是否继续?', '提示', {
this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

Loading…
Cancel
Save