|
|
|
@ -40,7 +40,7 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<span style="width: 60px;display:inline-block;">代码:</span>
|
|
|
|
|
<el-input v-model="updateData.role_code" placeholder="" style="width: 200px;" />
|
|
|
|
|
<el-input v-model="updateData.role_code" placeholder="" style="width: 200px;" :disabled="inputDisabled"/>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<span style="width: 60px;display:inline-block;">名称:</span>
|
|
|
|
@ -163,28 +163,28 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="18" :height="defaultHeight.height">
|
|
|
|
|
<div :height="defaultHeight.height">
|
|
|
|
|
<!-- <el-table-->
|
|
|
|
|
<!-- ref="gnqxTable"-->
|
|
|
|
|
<!-- v-loading="isGnqxTableLoading"-->
|
|
|
|
|
<!-- :show-overflow-tooltip="true"-->
|
|
|
|
|
<!-- :data="c_gnqxTableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"-->
|
|
|
|
|
<!-- :height="defaultHeight.height35"-->
|
|
|
|
|
<!-- width="100%"-->
|
|
|
|
|
<!-- :border="true"-->
|
|
|
|
|
<!-- highlight-current-row-->
|
|
|
|
|
<!-- element-loading-background="rgba(0, 0, 0, 0.01)"-->
|
|
|
|
|
<!-- element-loading-text="数据正在加载中"-->
|
|
|
|
|
<!-- element-loading-spinner="el-icon-loading"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <el-table-column label="" property="checked" style="width: 30px;">-->
|
|
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
|
|
<!-- <el-checkbox v-model="scope.row.checked" @change="handleGnqxSelect(scope.row)" />-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column label="菜单名称" property="ms" />-->
|
|
|
|
|
<!-- <el-table-column label="功能类别" property="gnlb" />-->
|
|
|
|
|
<!-- <el-table-column label="菜单" property="ckcs" />-->
|
|
|
|
|
<!-- </el-table>-->
|
|
|
|
|
<el-table
|
|
|
|
|
ref="gnqxTable"
|
|
|
|
|
v-loading="isGnqxTableLoading"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
:data="c_gnqxTableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
|
|
|
|
|
:height="defaultHeight.height35"
|
|
|
|
|
width="100%"
|
|
|
|
|
:border="true"
|
|
|
|
|
highlight-current-row
|
|
|
|
|
element-loading-background="rgba(0, 0, 0, 0.01)"
|
|
|
|
|
element-loading-text="数据正在加载中"
|
|
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="" property="checked" style="width: 30px;">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-checkbox v-model="scope.row.checked" @change="handleGnqxSelect(scope.row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="菜单名称" property="menu_name" />
|
|
|
|
|
<el-table-column label="功能类别" property="gnlb" />
|
|
|
|
|
<el-table-column label="菜单" property="ylzd1" />
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-pagination
|
|
|
|
|
:current-page="currentPage"
|
|
|
|
|
:page-sizes="[20, 50, 100, 10000]"
|
|
|
|
@ -210,7 +210,7 @@ import {
|
|
|
|
|
getRoleList,
|
|
|
|
|
getUserList,
|
|
|
|
|
getInstitutionList,
|
|
|
|
|
getMenuList,
|
|
|
|
|
getMenuForRole,
|
|
|
|
|
|
|
|
|
|
addRole,
|
|
|
|
|
deleteRole,
|
|
|
|
@ -247,7 +247,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
zxtbmList: [],
|
|
|
|
|
dm_depart: [],
|
|
|
|
|
|
|
|
|
|
inputDisabled:true,
|
|
|
|
|
currentPage: 1,
|
|
|
|
|
pageSize: 100,
|
|
|
|
|
activeTabName: 'yhxx',
|
|
|
|
@ -313,7 +313,7 @@ export default {
|
|
|
|
|
getInstitutionList({}).then(response => {
|
|
|
|
|
this.fzqxTableData = response.data
|
|
|
|
|
this.isFzqxTableLoading = false
|
|
|
|
|
getMenuList({}).then(response => {
|
|
|
|
|
getMenuForRole({}).then(response => {
|
|
|
|
|
this.gnqxTreeData = this.parseTreeData(response.data)
|
|
|
|
|
this.gnqxTableData = response.data
|
|
|
|
|
this.isGnqxTableLoading = false
|
|
|
|
@ -365,77 +365,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
return ''
|
|
|
|
|
},
|
|
|
|
|
// parseTreeData(menu) {
|
|
|
|
|
// const treeData = [{ 'label': '全部功能', 'id': '@', children: [], disabled: true }]
|
|
|
|
|
//
|
|
|
|
|
// const myMap = new Map();
|
|
|
|
|
// for (let i = 0; i< menu.length - 1; i++) {
|
|
|
|
|
// if (menu[i].ylzd1) {
|
|
|
|
|
// menu[i].children = []
|
|
|
|
|
// myMap.set(menu[i].ylzd1,menu[i])
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (let i = 0; i< menu.length - 1; i++) {
|
|
|
|
|
// if (myMap.has(menu[i].ylzd1)) {
|
|
|
|
|
// myMap.get(menu[i].ylzd1).children.push(menu[i])
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // let id = 0;
|
|
|
|
|
// // myMap.forEach((value, key) => {
|
|
|
|
|
// // console.log('info1',key)
|
|
|
|
|
// // console.log('info2',value)
|
|
|
|
|
// // id = id+1;
|
|
|
|
|
// // treeData[0].children.push({ 'label': key, 'id': id, 'children': value.children })
|
|
|
|
|
// // });
|
|
|
|
|
// console.log("info",myMap.get(menu[1].ylzd1))
|
|
|
|
|
// // const treeData= [{ 'label': '全部功能', 'id': '@', children: [], disabled: true }]
|
|
|
|
|
// treeData[0].children.push({ 'label': '计划排产', 'id': 1, 'children': []})
|
|
|
|
|
// treeData[0].children.push({ 'label': '计划排产', 'id': 2, 'children': []})
|
|
|
|
|
// treeData[0].children.push({ 'label': '计划排产', 'id': 3, 'children': []})
|
|
|
|
|
// // console.log('info',myMap)
|
|
|
|
|
// // console.log('infotree',treeData)
|
|
|
|
|
// // const info = menu.reduce((map, node) => {
|
|
|
|
|
// // node.label = node.ylzd1
|
|
|
|
|
// // node.children = []
|
|
|
|
|
// // return map[node.ylzd1] = node, node.children = [], map
|
|
|
|
|
// // const myMap = new Map([
|
|
|
|
|
// // [node.ylzd1, node]
|
|
|
|
|
// // ]);
|
|
|
|
|
// // return map[node.ylzd1,node], map
|
|
|
|
|
// // }, {})
|
|
|
|
|
// // console.log('info',info)
|
|
|
|
|
// // for (let i = 0; i< menu.length - 1; i++) {
|
|
|
|
|
// // if (info[menu[i].ylzd1]) {
|
|
|
|
|
// // info[menu[i].ylzd1].children.push(menu[i])
|
|
|
|
|
// // }
|
|
|
|
|
// // }
|
|
|
|
|
// // for(let item of info){
|
|
|
|
|
// // console.log('info',item)
|
|
|
|
|
// // }
|
|
|
|
|
//
|
|
|
|
|
// // console.log('info',info)
|
|
|
|
|
//
|
|
|
|
|
// // const result = menu.filter(node => {
|
|
|
|
|
// // if (info[node.ylzd1]) {
|
|
|
|
|
// // info[node.ylzd1].children.push(node)
|
|
|
|
|
// // }
|
|
|
|
|
// // return !node.ylzd1
|
|
|
|
|
// // })
|
|
|
|
|
// // const system_menu = {}
|
|
|
|
|
// // for (let i = 0; i < result.length; i++) {
|
|
|
|
|
// //
|
|
|
|
|
// // if (!system_menu[result[i].system_code]) {
|
|
|
|
|
// // system_menu[result[i].system_code] = []
|
|
|
|
|
// // }
|
|
|
|
|
// // system_menu[result[i].system_code].push(result[i])
|
|
|
|
|
// // }
|
|
|
|
|
// // for (let i = 0; i < this.zxtbmList.length; i++) {
|
|
|
|
|
// //
|
|
|
|
|
// // const key = this.zxtbmList[i].zxtbm
|
|
|
|
|
// // treeData[0].children.push({ 'label': this.getSystemName(key), 'id': key, 'children': system_menu[key] })
|
|
|
|
|
// // }
|
|
|
|
|
// return treeData
|
|
|
|
|
// },
|
|
|
|
|
parseTreeData(menu) {
|
|
|
|
|
const treeData = [{ 'label': '全部功能', 'id': '@', children: [], disabled: true }]
|
|
|
|
|
|
|
|
|
@ -449,7 +378,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
return !node.parent_id
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const system_menu = {}
|
|
|
|
|
for (let i = 0; i < result.length; i++) {
|
|
|
|
|
if (!system_menu[result[i].system_code]) {
|
|
|
|
@ -457,12 +385,12 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
system_menu[result[i].system_code].push(result[i])
|
|
|
|
|
}
|
|
|
|
|
console.log('info',info)
|
|
|
|
|
console.log('result',result)
|
|
|
|
|
for (let i = 0; i < this.zxtbmList.length; i++) {
|
|
|
|
|
const key = this.zxtbmList[i].zxtdm
|
|
|
|
|
treeData[0].children.push({ 'label': this.getSystemName(key), 'id': key, 'children': system_menu[key] })
|
|
|
|
|
}
|
|
|
|
|
// for (let i = 0; i < this.zxtbmList.length; i++) {
|
|
|
|
|
// const key = this.zxtbmList[i].zxtdm
|
|
|
|
|
// console.log(system_menu[key])
|
|
|
|
|
// treeData[0].children.push({ 'label': this.getSystemName(key), 'id': key, 'children': system_menu[key] })
|
|
|
|
|
// }
|
|
|
|
|
treeData[0].children.push({ 'label': this.getSystemName('PS'), 'id': 'PS', 'children': system_menu['PS'] })
|
|
|
|
|
console.log('treeData',treeData)
|
|
|
|
|
return treeData
|
|
|
|
|
},
|
|
|
|
@ -547,6 +475,7 @@ export default {
|
|
|
|
|
}, handleWorkGroupAdd() {
|
|
|
|
|
this.dialogTitle = '添加工作组'
|
|
|
|
|
this.dialogTableVisible = true
|
|
|
|
|
this.inputDisabled=false;
|
|
|
|
|
this.updateData = {}
|
|
|
|
|
},
|
|
|
|
|
handleWorkGroupAddComplated() {
|
|
|
|
@ -563,6 +492,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.dialogTitle = '修改工作组'
|
|
|
|
|
this.dialogTableVisible = true
|
|
|
|
|
this.inputDisabled=true
|
|
|
|
|
this.updateData = JSON.parse(JSON.stringify(this.selectWorkGroup))
|
|
|
|
|
}, handleWorkGroupUpdateComplated() {
|
|
|
|
|
updateRole(this.updateData).then(response => {
|
|
|
|
@ -592,7 +522,7 @@ export default {
|
|
|
|
|
this.$message({ message: '请选择一个工作组!', type: 'warning' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'user_code': row.user_code }
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'yhdm': row.yhdm, 'yhms': row.yhms }
|
|
|
|
|
if (row.checked) {
|
|
|
|
|
addRoleForUser([data]).then(response => {
|
|
|
|
|
this.$message({ message: '添加用户到工作组成功!', type: 'success' })
|
|
|
|
@ -603,7 +533,10 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}, handleFzqxSelect(row) {
|
|
|
|
|
const data = { 'institution_code': row.institution_code, 'role_code': this.selectWorkGroup.role_code }
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code,
|
|
|
|
|
'FZDM': row.institution_code.substring(0,2) ,
|
|
|
|
|
'ZXTDM':row.institution_code.substring(2),
|
|
|
|
|
}
|
|
|
|
|
if (row.checked) {
|
|
|
|
|
addRoleForInstitution([data]).then(response => {
|
|
|
|
|
this.$message({ message: '添加分组权限到工作组成功!', type: 'success' })
|
|
|
|
@ -614,7 +547,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}, handleZxtSelect(row) {
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'system_code': row.system_code }
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'system_code': row.zxtdm }
|
|
|
|
|
if (row.checked) {
|
|
|
|
|
addRoleForSystem([data]).then(response => {
|
|
|
|
|
this.$message({ message: '添加子系统权限到工作组成功!', type: 'success' })
|
|
|
|
@ -625,7 +558,15 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}, handleGnqxSelect(row) {
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'menu_id': row.id }
|
|
|
|
|
let gnlb=''
|
|
|
|
|
if (row.gnlb){
|
|
|
|
|
gnlb=row.gnlb
|
|
|
|
|
}
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code,
|
|
|
|
|
'system_code': row.system_code,
|
|
|
|
|
'menu_name': row.menu_name,
|
|
|
|
|
'gnlb': gnlb,
|
|
|
|
|
}
|
|
|
|
|
if (row.checked) {
|
|
|
|
|
addRoleForMenu([data]).then(response => {
|
|
|
|
|
this.$refs.tree.setChecked(row.id, true, false)
|
|
|
|
@ -661,7 +602,15 @@ export default {
|
|
|
|
|
this.gnqxTableData[j]['checked'] = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code, 'menu_id': this.gnqxTableData[j]['id'] }
|
|
|
|
|
let gnlb=''
|
|
|
|
|
if (this.gnqxTableData[j]['gnlb']){
|
|
|
|
|
gnlb=this.gnqxTableData[j]['gnlb']
|
|
|
|
|
}
|
|
|
|
|
const data = { 'role_code': this.selectWorkGroup.role_code,
|
|
|
|
|
'system_code': this.gnqxTableData[j]['system_code'],
|
|
|
|
|
'menu_name': this.gnqxTableData[j]['menu_name'],
|
|
|
|
|
'gnlb': gnlb
|
|
|
|
|
}
|
|
|
|
|
if (source && !this.gnqxTableData[j]['checked']) {
|
|
|
|
|
deleteFunction.push(data)
|
|
|
|
|
}
|
|
|
|
|