This commit is contained in:
shawnzhang 2019-05-10 20:47:39 +08:00
parent a56fdfb432
commit 0f6c75fa55
6 changed files with 390 additions and 16 deletions

33
src/api/Getauthority.js Normal file
View file

@ -0,0 +1,33 @@
import request from '@/utils/request'
// 角色列表
export function repairList() {
return request({
url: '/erp/role/getrolelist',
method: 'post'
})
}
// 角色列表
export function getauthoritydetaillist() {
return request({
url: '/erp/role/getauthoritydetaillist',
method: 'post'
})
}
// 添加角色
export function addrole(query) {
var params = new URLSearchParams()
if (query.rolename !== '' && query.rolename !== null && query.rolename !== undefined) {
params.append('rolename', query.rolename) // 你要传给后台的参数值 key/value
}
if (query.createPersonId !== '' && query.createPersonId !== null && query.createPersonId !== undefined) {
params.append('createPersonId', query.createPersonId) // 你要传给后台的参数值 key/value
}
return request({
url: '/erp/role/addrole',
method: 'post',
data: params
})
}

View file

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1557451461201" class="icon" style="" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6995" xmlns:xlink="http://www.w3.org/1999/xlink" width="215.234375" height="200"><defs><style type="text/css"></style></defs><path d="M511.921243 472.542686a196.892786 196.892786 0 1 0 0-393.785572 196.892786 196.892786 0 0 0 0 393.785572z m0 78.757114a275.6499 275.6499 0 1 1 0-551.2998 275.6499 275.6499 0 0 1 0 551.2998zM693.062606 708.814029h346.531303a63.005691 63.005691 0 0 1 63.005691 63.005691v189.017074a63.005691 63.005691 0 0 1-63.005691 63.005692H693.062606a63.005691 63.005691 0 0 1-63.005692-63.005692V771.81972a63.005691 63.005691 0 0 1 63.005692-63.005691z m15.751423 78.757114v157.514228h315.028457v-157.514228H708.814029z m118.135671 39.378557h78.757114a39.378557 39.378557 0 0 1 0 78.757114h-78.757114a39.378557 39.378557 0 0 1 0-78.757114z" p-id="6996"></path><path d="M866.328257 551.2998a157.514229 157.514229 0 0 1 157.514229 157.514229v78.757114H708.814029V708.814029a157.514229 157.514229 0 0 1 157.514228-157.514229z m-78.757114 157.514229h157.514228a78.757114 78.757114 0 1 0-157.514228 0zM551.2998 945.242886a39.378557 39.378557 0 1 1 0 78.757114L39.378557 1023.842486a39.378557 39.378557 0 0 1-39.378557-39.378557A511.921243 511.921243 0 0 1 511.921243 472.542686H551.2998a39.378557 39.378557 0 0 1 0 78.757114h-39.378557a433.242886 433.242886 0 0 0-431.431472 393.785571L551.2998 945.242886z" p-id="6997"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -267,7 +267,8 @@ export default {
CustomerVisitList: '客户回访列表',
GroupBuyRules: '团购活动规则',
AddGroupBuyRules: '新建团购活动规则',
GroupBuyRulesList: '团购活动规则列表'
GroupBuyRulesList: '团购活动规则列表',
Getauthority: '角色权限'
},
navbar: {
logOut: '退出登录',
@ -1712,7 +1713,13 @@ export default {
endTime: '活动结束时间',
isEffective: '应用状态'
},
Getauthority: {
rolename: '角色名称',
createTime: '创建时间',
createPersonName: '创建人'
},
public: {
save: '保存',
modifyDate: '最后修改日期',
move: '调入',
judgePersonName: '审核人',

View file

@ -414,6 +414,23 @@ export const asyncRouterMap = [
}
]
},
{
path: '/Getauthority',
component: Layout,
redirect: 'noredirect',
meta: {
icon: 'quanxian',
type: 1
},
children: [
{
path: 'index',
component: () => import('@/views/Getauthority/index'),
name: 'Getauthority',
meta: { title: 'Getauthority', noCache: true }
}
]
},
// 库存管理
{
path: '/Stockenter',

View file

@ -0,0 +1,305 @@
<template>
<div class="ERP-container">
<div class="app-container" style="padding-right: 0">
<!--基本信息-->
<el-card class="box-card" shadow="never" style="height: 800px">
<el-row :gutter="20">
<el-form ref="getemplist" :model="getemplist" label-width="100px" style="margin-top: 10px">
<el-col :span="5">
<el-form-item label="角色名称" label-width="100px">
<el-input v-model="getemplist.rolename" :placeholder="$t('Getauthority.rolename')" clearable/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-button class="filter-item" type="primary" style="width: 86px" @click="newRole">{{ $t('public.save') }}</el-button>
</el-col>
</el-form>
</el-row>
<el-row :gutter="20">
<el-col :span="8" >
<div class="container" style="margin-top: 20px">
<div style="width: 100%;border: 1px solid #ebeef5;border-bottom:none;height: 30px;padding-top: 5px;padding-left: 28px;color: #606266;">角色列表</div>
<el-table
v-loading="listLoading"
:key="tableKey"
:data="list"
border
fit
height="730px"
highlight-current-row
style="width: 100%;">
<el-table-column :label="$t('Getauthority.rolename')" :resizable="false" align="center" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.roleName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Getauthority.createTime')" :resizable="false" align="center" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Getauthority.createPersonName')" :resizable="false" align="center" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.createPersonName }}</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
<el-col :span="8">
<div class="container5" style="margin-top: 20px">
<div style="width: 100%;border: 1px solid #ebeef5;border-bottom:none;height: 30px;padding-top: 5px;padding-left: 28px;color: #606266;">模块列表</div>
<el-card class="box-card" shadow="never" style="height: 800px">
<div slot="header" class="clearfix">
<span>名称</span>
</div>
<el-scrollbar class="tree">
<el-tree :data="treeData" :props="defaultProps" accordion highlight-current @node-click="handleNodeClick"/>
</el-scrollbar>
</el-card>
</div>
</el-col>
<el-col :span="8">
<div class="container3" style="margin-top: 20px">
<div style="width: 100%;border: 1px solid #ebeef5;border-bottom:none;height: 30px;padding-top: 5px;padding-left: 28px;color: #606266;">操作权限</div>
<el-card class="box-card" shadow="never" style="height: 730px">
<div slot="header" class="clearfix">
<span>名称</span>
<el-checkbox v-model="checkAll" style="float: right;margin-bottom: -5px" @change="handleCheckAllChange">全选</el-checkbox>
</div>
<div class="upsides">
<el-checkbox-group v-model="operations" @change="handleCheckedCitiesChange">
<div v-for="(item,index) in operates" :key="index" class="text item">
<el-checkbox :label="item.id">{{ item.name }}</el-checkbox>
</div>
</el-checkbox-group>
</div>
</el-card>
</div>
</el-col>
<!--<el-col :span="6">-->
<!--<div class="container" style="margin-top: 37px">-->
<!--<span>1234</span>-->
<!--</div>-->
<!--</el-col>-->
</el-row>
</el-card>
</div>
</div>
</template>
<script>
import { repairList, getauthoritydetaillist, addrole } from '@/api/Getauthority'
export default {
name: 'Getauthority',
data() {
return {
checkAll: false,
//
operations: [],
//
operates: [],
//
details: [],
//
treeData: [],
defaultProps: {
children: 'authorityVos',
label: 'name'
},
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
getemplist: {
createPersonId: 3
}
}
},
created() {
this.getlist()
},
methods: {
restAllForm() {
this.getemplist.rolename = null
},
//
newRole() {
addrole(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: '成功',
message: '保存成功',
type: 'success',
offset: 100
})
this.restAllForm()
this.getlist()
} else {
this.$notify.error({
title: '错误',
message: res.data.msg,
offset: 100
})
}
})
},
handleCheckAllChange(val) {
console.log(val)
console.log(this.details)
console.log(this.operations)
if (val === true) {
this.operations = this.details
} else {
this.operations = []
}
},
handleCheckedCitiesChange(value) {
console.log(value)
const checkedCount = value.length
this.checkAll = checkedCount === this.operates.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.operates.length
},
//
handleNodeClick(data) {
console.log(data)
if (data.authorityDetails !== null) {
this.operates = data.authorityDetails
this.details = data.detail.split(',').map(function(item) {
return Number(item)
})
} else {
this.operates = []
this.details = []
}
},
//
getlist() {
//
this.listLoading = true
repairList().then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content
}
setTimeout(() => {
this.listLoading = false
}, 0.5 * 100)
})
getauthoritydetaillist().then(res => {
if (res.data.ret === 200) {
this.treeData = res.data.data.content
}
})
},
//
// handlesave() {
// const Data = this.personalForm
// for (const key in Data) {
// if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
// delete Data[key]
// }
// }
// const parms = JSON.stringify(Data)
// this.$refs.personalForm.validate((valid) => {
// if (valid) {
// addCustomerChat(parms).then(res => {
// console.log(res)
// if (res.data.ret === 200) {
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// offset: 100
// })
// this.restAllForm()
// this.$refs.personalForm.clearValidate()
// this.$refs.personalForm.resetFields()
// } else {
// this.$notify.error({
// title: '',
// message: res.data.msg,
// offset: 100
// })
// }
// })
// } else {
// this.$notify.error({
// title: '',
// message: '',
// offset: 100
// })
// return false
// }
// })
// },
//
handlecancel() {
this.$router.go(-1)
const view = { path: '/GroupBuyRules/AddGroupBuyRules', name: 'AddGroupBuyRules', fullPath: '/GroupBuyRules/AddGroupBuyRules', title: 'AddGroupBuyRules' }
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
})
}
}
}
</script>
<style rel="stylesheet/css" scoped>
.ERP-container {
margin-right: 0;
font-size: 14px;
}
.ERP-container >>> .el-card__header{
padding:13px 28px;
color: #909399;
font-weight: bold;
}
.ERP-container >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
.tree{
height: 500px;
}
.tree >>> .el-tree {
min-width: 100%;
}
.upsides >>> .el-checkbox{
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 46px;
flex-flow: row-reverse;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 20px;
}
.container{
margin-top: 40px;
}
.el-button+.el-button{
width: 98px;
}
.container3 .text {
font-size: 14px;
}
.container3 .item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
</style>

View file

@ -8,22 +8,24 @@
placeholder="输入关键字进行过滤"
style="margin-bottom: 30px"
clearable/>
<el-tree
ref="tree2"
:data="detalist"
:props="detaillistProps"
:filter-node-method="filterNode"
:default-expand-all="true"
class="filter-tree"
@node-click="handleNodeClick">
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ node.label }}</span>
<span v-if="data.parentId !== 0" style="margin-left: 50px">
<i class="el-icon-edit" @click="edittree(data)"/>
<i class="el-icon-delete" @click="nodedelete(data)"/>
<el-scrollbar class="tree">
<el-tree
ref="tree2"
:data="detalist"
:props="detaillistProps"
:filter-node-method="filterNode"
:default-expand-all="true"
class="filter-tree"
@node-click="handleNodeClick">
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ node.label }}</span>
<span v-if="data.parentId !== 0" style="margin-left: 50px">
<i class="el-icon-edit" @click="edittree(data)"/>
<i class="el-icon-delete" @click="nodedelete(data)"/>
</span>
</span>
</span>
</el-tree>
</el-tree>
</el-scrollbar>
<el-dialog :visible.sync="editVisible" title="修改分类" class="normal" width="600px">
<el-form :model="edittreeform" label-position="left" label-width="120px" style="width: 400px; margin-left:50px;">
<el-form-item :label="$t('Product.name')" label-width="120px">
@ -340,6 +342,15 @@ export default {
.ERP-container {
margin: 0px 20px;
margin-right: 0;
}
.ERP-container >>> .el-scrollbar__wrap {
overflow-x: hidden;
}
.tree{
height: 500px;
}
.tree >>> .el-tree {
min-width: 100%;
}
.form-name{
font-size: 18px;