|
@@ -8,9 +8,9 @@
|
|
|
<div class="fl">
|
|
|
<el-button v-if="checkBtnRole('add')" size="small" type="primary" icon="el-icon-plus" @click="addOrEdit('add')">新增账号</el-button>
|
|
|
</div>
|
|
|
- <div class="fr">
|
|
|
- <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />
|
|
|
- </div>
|
|
|
+ <!-- <div class="fr">-->
|
|
|
+ <!-- <ImportButton :im-url="'stock/importToll'" @importSuccess="getList" />-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
|
|
|
<div class="table">
|
|
@@ -19,9 +19,16 @@
|
|
|
<el-table-column align="center" label="账号" prop="userName" />
|
|
|
<el-table-column align="center" label="创建时间" prop="createTime" />
|
|
|
<el-table-column align="center" label="最后登录时间" prop="lastLoginTime" />
|
|
|
+ <el-table-column align="center" label="主帐号" prop="isMaster">
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <el-tag v-if="scope.row.isMaster" type="success">是</el-tag>
|
|
|
+ <el-tag v-else type="danger">否</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="addOrEdit('edit',scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" @click="addOrEdit('edit',scope.row)">修改</el-button>
|
|
|
<el-button v-if="checkBtnRole('detail')" type="text" @click="setMenuRole(scope.row.adminUserId,'role')">设置权限</el-button>
|
|
|
|
|
|
</template>
|
|
@@ -74,11 +81,11 @@
|
|
|
:visible.sync="dialogVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
width="45%"
|
|
|
- :title="'add'===addFormType?'新增':'编辑'"
|
|
|
+ :title="'add'===addFormType?'新增':'修改'"
|
|
|
@close="cancelAddForm"
|
|
|
>
|
|
|
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="demo-ruleForm">
|
|
|
- <el-form-item label="账号" prop="account">
|
|
|
+ <el-form-item v-if="addFormType!=='edit'" label="账号" prop="account">
|
|
|
<el-input v-model="ruleForm.account" type="text" autocomplete="off" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="密码" prop="password">
|
|
@@ -87,7 +94,7 @@
|
|
|
</el-form>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>
|
|
|
+ <!-- <el-button type="primary" style="float: left;" @click="setMenuRole">设置权限</el-button>-->
|
|
|
<el-button @click="cancelAddForm">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitAddForm">确 定</el-button>
|
|
|
</span>
|
|
@@ -104,7 +111,8 @@ import {
|
|
|
editSubAccount,
|
|
|
getAccountList,
|
|
|
getMenuList,
|
|
|
- getMenuRoleIds
|
|
|
+ getRoleChecked,
|
|
|
+ setMenuRole
|
|
|
} from '@/api/setting'
|
|
|
|
|
|
export default {
|
|
@@ -173,13 +181,11 @@ export default {
|
|
|
|
|
|
getList() {
|
|
|
this.listLoading = true
|
|
|
-
|
|
|
const params = {
|
|
|
pageNum: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
customerId: this.customerId
|
|
|
}
|
|
|
-
|
|
|
getAccountList(params).then(res => {
|
|
|
this.dataList = res.data.records
|
|
|
this.listTotal = res.data.total
|
|
@@ -216,7 +222,8 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.ruleForm = {
|
|
|
account: row.userName,
|
|
|
- password: row.password
|
|
|
+ password: '',
|
|
|
+ adminUserId: row.adminUserId
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -237,11 +244,12 @@ export default {
|
|
|
const params = {
|
|
|
userName: this.ruleForm.account,
|
|
|
password: this.ruleForm.password,
|
|
|
- adminModuleIds: this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') : ''
|
|
|
+ adminModuleIds: ''
|
|
|
+ // adminModuleIds:this.$refs.tree ? this.$refs.tree.getCheckedKeys().join(',') :
|
|
|
}
|
|
|
if (valid) {
|
|
|
if (this.addFormType === 'edit') {
|
|
|
- params.adminRoleId = this.editId
|
|
|
+ params.adminUserId = this.ruleForm.adminUserId
|
|
|
editSubAccount(params).then(res => {
|
|
|
this.cancelAddForm()
|
|
|
this.getList()
|
|
@@ -265,27 +273,22 @@ export default {
|
|
|
getMenuList({ adminUserId: this.userid }).then(res => {
|
|
|
this.menuRoleList = res.data
|
|
|
})
|
|
|
- if (type === 'role') {
|
|
|
-
|
|
|
- getMenuRoleIds({ adminRoleId: id }).then(res => {
|
|
|
- console.log(78888,res.data)
|
|
|
- this.$refs.tree.setCheckedKeys(res.data)
|
|
|
- })
|
|
|
- }
|
|
|
+ getRoleChecked({ adminUserId: id }).then(res => {
|
|
|
+ this.$refs.tree.setCheckedKeys(res.data)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 设置权限 - 提交数据
|
|
|
submitRoleForm(type) {
|
|
|
- // if (type === 'role') {
|
|
|
- // const params = {
|
|
|
- // adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
|
|
|
- // adminRoleId: this.editId
|
|
|
- // }
|
|
|
- // setMenuRole(params).then(res => {
|
|
|
- // this.getList()
|
|
|
- // this.$successMsg()
|
|
|
- // })
|
|
|
- // }
|
|
|
+ const params = {
|
|
|
+ adminModuleIds: this.$refs.tree.getCheckedKeys().join(','),
|
|
|
+ adminRoleId: this.editId
|
|
|
+ }
|
|
|
+ setMenuRole(params).then(res => {
|
|
|
+ this.getList()
|
|
|
+ this.$successMsg()
|
|
|
+ })
|
|
|
+
|
|
|
this.roleFormVisible = false
|
|
|
},
|
|
|
|