Commit c98895b9 by 吕明尚

门店增加门店管理,负责门店收入的数据权限

parent 877121b0
......@@ -163,6 +163,20 @@ export const dynamicRoutes = [
]
},
{
path: '/share/store-manage',
component: Layout,
hidden: true,
permissions: ['system:store:edit'],
children: [
{
path: 'clean/:storeId(\\d+)',
component: () => import('@/views/system/store/manageConsumer'),
name: 'CleanConsumer',
meta: {title: '分配门店管理', activeMenu: '/system/store'}
}
]
},
{
path: '/order/order-index',
component: Layout,
hidden: true,
......
......@@ -126,7 +126,7 @@
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center" prop="remark"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200px">
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250px">
<template slot-scope="scope">
<el-button
size="mini"
......@@ -167,6 +167,14 @@
v-hasPermi="['system:store:edit']"
>分配客服
</el-button>
<el-button
v-hasPermi="['system:store:edit']"
icon="el-icon-user"
size="mini"
type="text"
@click="manageConsumerService(scope.row)"
>分配门店管理
</el-button>
</template>
</el-table-column>
......@@ -583,6 +591,10 @@ export default {
const storeId = row.id;
this.$router.push("/share/store-customer-service/clean/" + storeId);
},
manageConsumerService: function (row) {
const storeId = row.id;
this.$router.push("/share/store-manage/clean/" + storeId);
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
......
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="用户昵称" prop="nickName">
<el-input
v-model="queryParams.nickName"
clearable
placeholder="请输入用户昵称"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
clearable
placeholder="请输入手机号"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="会员性别" prop="sex">-->
<!-- <el-input-->
<!-- v-model="queryParams.sex"-->
<!-- placeholder="请输入会员性别"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['system:store:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="openSelectUser"
>添加管理
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:store:remove']"
:disabled="multiple"
icon="el-icon-circle-close"
plain
size="mini"
type="danger"
@click="cancelAuthUserAll"
>批量取消
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
icon="el-icon-close"
plain
size="mini"
type="warning"
@click="handleClose"
>关闭
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="consumerList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<el-table-column align="center" label="账号" prop="account"/>
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="手机号" prop="phone"/>
<el-table-column align="center" label="角色类型" prop="roleType">
<template slot-scope="scope">
<dict-tag :options="dict.type.wechat_role_type" :value="scope.row.roleType"/>
</template>
</el-table-column>
<el-table-column align="center" label="性别" prop="sex">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['system:store:remove']"
icon="el-icon-circle-close"
size="mini"
type="text"
@click="cancelAuthUser(scope.row)"
>取消分配
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<select-consumer ref="select" :position="queryParams.position" :storeId="queryParams.storeId" @ok="handleQuery"/>
</div>
</template>
<script>
import {allocatedUserList, authUserCancel, authUserCancelAll} from "@/api/system/store";
import selectConsumer from "./selectConsumer";
export default {
name: "CleanConsumer",
dicts: ['sys_user_sex', 'wechat_role_type'],
components: {selectConsumer},
data() {
return {
// 遮罩层
loading: true,
// 选中用户组
consumerIds: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
consumerList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
storeId: undefined,
nickName: undefined,
phone: undefined
}
};
},
created() {
const storeId = this.$route.params && this.$route.params.storeId;
this.queryParams.position = 4;
if (storeId) {
this.queryParams.storeId = storeId;
this.getList();
}
},
methods: {
/** 查询授权用户列表 */
getList() {
this.loading = true;
this.queryParams.position = 4;
allocatedUserList(this.queryParams).then(response => {
this.consumerList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 返回按钮
handleClose() {
const obj = {path: "/share/store"};
this.$tab.closeOpenPage(obj);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.consumerIds = selection.map(item => item.id)
this.multiple = !selection.length
},
/** 打开授权用户表弹窗 */
openSelectUser() {
this.$refs.select.show();
},
/** 取消授权按钮操作 */
cancelAuthUser(row) {
const storeId = this.queryParams.storeId;
this.$modal.confirm('确认要取消分配门店管理"' + row.nickName + '"吗?').then(function () {
return authUserCancel({consumerId: row.id, storeId: storeId, position: 4});
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消成功");
}).catch(() => {
});
},
/** 批量取消授权按钮操作 */
cancelAuthUserAll(row) {
const storeId = this.queryParams.storeId;
const consumerIds = this.consumerIds.join(",");
this.$modal.confirm('是否取消选中分配门店管理数据项?').then(function () {
return authUserCancelAll({storeId: storeId, consumerIds: consumerIds, position: 4});
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消成功");
}).catch(() => {
});
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment