fix: 更改订单列表的冲突
This commit is contained in:
46
src/api/account/shopPagePermission.ts
Normal file
46
src/api/account/shopPagePermission.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
import { get } from "lodash";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/shopPagePermission";
|
||||||
|
const Api = {
|
||||||
|
// 获取所有页面路径
|
||||||
|
getPageAll(params: any) {
|
||||||
|
return request<any, object[]>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 保存修改权限
|
||||||
|
save(data: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取员工拥有页面路径
|
||||||
|
detail(params: any) {
|
||||||
|
return request<any, PagePath[]>({
|
||||||
|
url: `${baseURL}/detail`,
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取当前员工已拥有页面路径
|
||||||
|
mine(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/mine`,
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Api;
|
||||||
|
|
||||||
|
interface PagePath {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
||||||
{{ item.productName }}
|
{{ item.productName }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="item.refundNumber" class="refund">(退 - {{ item.refundNumber }})</span>
|
<span v-if="item.refundNum" class="refund">(退 - {{ item.refundNum }})</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="sku">{{ item.skuName }}</div>
|
<div class="sku">{{ item.skuName }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
名称:
|
名称:
|
||||||
<el-tag type="primary">{{ scope.row.tableName }}</el-tag>
|
<el-tag type="primary">{{ scope.row.tableName || "无" }}</el-tag>
|
||||||
</p>
|
</p>
|
||||||
<p v-if="scope.row.tableCode">编号:{{ scope.row.tableCode }}</p>
|
<p v-if="scope.row.tableCode">编号:{{ scope.row.tableCode }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||||
|
<template #deptName="scope">
|
||||||
|
<div style="display: inline-block;width: 50px;">
|
||||||
|
{{ scope.row.name }}
|
||||||
|
</div>
|
||||||
|
<!-- <el-text></el-text> -->
|
||||||
|
</template>
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
|||||||
],
|
],
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
{ label: "模板名称", align: "center", prop: "name" },
|
{ label: "模板名称", align: "center", slotName: "deptName", templet: "custom", },
|
||||||
{ label: "完整名称", align: "center", prop: "fullName" },
|
{ label: "完整名称", align: "center", prop: "fullName" },
|
||||||
// {
|
// {
|
||||||
// label: "操作",
|
// label: "操作",
|
||||||
|
|||||||
@@ -165,19 +165,8 @@ const modalConfig: IModalConfig<addRequest> = {
|
|||||||
],
|
],
|
||||||
initialValue: 1,
|
initialValue: 1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "员工权限设置",
|
|
||||||
prop: "",
|
|
||||||
type: "title",
|
|
||||||
slotName: "title",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'custom',
|
|
||||||
prop: 'permission',
|
|
||||||
slotName: 'permission',
|
|
||||||
label: '',
|
|
||||||
hidden: true
|
|
||||||
}
|
|
||||||
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -164,12 +164,6 @@ const modalConfig: IModalConfig<editRequest> = {
|
|||||||
],
|
],
|
||||||
initialValue: 1,
|
initialValue: 1,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "员工权限设置",
|
|
||||||
prop: "",
|
|
||||||
type: "title",
|
|
||||||
slotName: "title",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,20 @@
|
|||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
|
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
|
||||||
<template #formFooter>
|
<template #formFooter>
|
||||||
<selectPermission
|
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
||||||
v-model="selPermissionList"
|
<div>
|
||||||
:list="permissionList"
|
<el-checkbox-group v-model="addPagePathIdList">
|
||||||
ref="refSelectPermission"
|
<el-checkbox
|
||||||
></selectPermission>
|
v-for="(item, index) in pagePathIdLists"
|
||||||
|
:key="index"
|
||||||
|
:value="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
/>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
||||||
|
|
||||||
|
<selectPermission v-model="addSelPermissionList" :list="permissionList"></selectPermission>
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
@@ -59,11 +68,20 @@
|
|||||||
@submit-click="handleSubmitClick"
|
@submit-click="handleSubmitClick"
|
||||||
>
|
>
|
||||||
<template #formFooter>
|
<template #formFooter>
|
||||||
<selectPermission
|
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
||||||
v-model="selPermissionList"
|
<div>
|
||||||
:list="permissionList"
|
<el-checkbox-group v-model="editPagePathIdList">
|
||||||
ref="refSelectPermission"
|
<el-checkbox
|
||||||
></selectPermission>
|
v-for="(item, index) in pagePathIdLists"
|
||||||
|
:key="index"
|
||||||
|
:value="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
/>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
||||||
|
|
||||||
|
<selectPermission v-model="selPermissionList" :list="permissionList"></selectPermission>
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
@@ -85,8 +103,7 @@ import RoleApi, { type SysRole } from "@/api/account/role";
|
|||||||
import ShopStaffApi from "@/api/account/shopStaff";
|
import ShopStaffApi from "@/api/account/shopStaff";
|
||||||
import permissionApi, { type ShopPermission } from "@/api/account/permission";
|
import permissionApi, { type ShopPermission } from "@/api/account/permission";
|
||||||
import selectPermission from "./components/select-permission.vue";
|
import selectPermission from "./components/select-permission.vue";
|
||||||
const refSelectPermission = ref();
|
import shopPagePermissionApi from "@/api/account/shopPagePermission";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchRef,
|
searchRef,
|
||||||
contentRef,
|
contentRef,
|
||||||
@@ -106,6 +123,19 @@ const {
|
|||||||
let permissionList = ref<ShopPermission[]>([]);
|
let permissionList = ref<ShopPermission[]>([]);
|
||||||
//选中的权限列表
|
//选中的权限列表
|
||||||
let selPermissionList = ref<string[]>([]);
|
let selPermissionList = ref<string[]>([]);
|
||||||
|
let addSelPermissionList = ref<string[]>([]);
|
||||||
|
|
||||||
|
// 选中的收音机页面列表
|
||||||
|
interface PagePath {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pagePathIdLists = ref<PagePath[]>([]);
|
||||||
|
const addPagePathIdList = ref<string[]>([]);
|
||||||
|
const editPagePathIdList = ref<string[]>([]);
|
||||||
|
|
||||||
// 数据初始化
|
// 数据初始化
|
||||||
async function init() {
|
async function init() {
|
||||||
// 覆写添加确定方法
|
// 覆写添加确定方法
|
||||||
@@ -113,7 +143,8 @@ async function init() {
|
|||||||
addModalConfig.formAction = (data) => {
|
addModalConfig.formAction = (data) => {
|
||||||
return oldAddSubmitFunc({
|
return oldAddSubmitFunc({
|
||||||
...data,
|
...data,
|
||||||
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
|
pagePathIdList: addPagePathIdList.value,
|
||||||
|
shopPermissionIds: addSelPermissionList.value.reduce((pre: string[], cur: string) => {
|
||||||
return pre.concat(cur);
|
return pre.concat(cur);
|
||||||
}, [] as string[]),
|
}, [] as string[]),
|
||||||
});
|
});
|
||||||
@@ -123,6 +154,7 @@ async function init() {
|
|||||||
editModalConfig.formAction = (data) => {
|
editModalConfig.formAction = (data) => {
|
||||||
return oldeditSubmitFunc({
|
return oldeditSubmitFunc({
|
||||||
...data,
|
...data,
|
||||||
|
pagePathIdList: editPagePathIdList.value,
|
||||||
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
|
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
|
||||||
return pre.concat(cur);
|
return pre.concat(cur);
|
||||||
}, [] as string[]),
|
}, [] as string[]),
|
||||||
@@ -141,6 +173,14 @@ async function init() {
|
|||||||
});
|
});
|
||||||
addModalConfig.formItems[1]!.options = roleArr;
|
addModalConfig.formItems[1]!.options = roleArr;
|
||||||
editModalConfig.formItems[1]!.options = roleArr;
|
editModalConfig.formItems[1]!.options = roleArr;
|
||||||
|
const pagesRes = await shopPagePermissionApi.getPageAll({});
|
||||||
|
pagePathIdLists.value = pagesRes.map((item: any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
label: item.name,
|
||||||
|
value: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
init();
|
init();
|
||||||
|
|
||||||
@@ -172,6 +212,9 @@ async function handleEditClick(row: IObject) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const pageList = await shopPagePermissionApi.detail({ staffId: row.id });
|
||||||
|
console.log(pageList);
|
||||||
|
editPagePathIdList.value = pageList.map((item) => item.id);
|
||||||
console.log(selPermissionList.value);
|
console.log(selPermissionList.value);
|
||||||
// 根据id获取数据进行填充
|
// 根据id获取数据进行填充
|
||||||
await ShopStaffApi.get(row.id).then((res) => {
|
await ShopStaffApi.get(row.id).then((res) => {
|
||||||
@@ -179,7 +222,6 @@ async function handleEditClick(row: IObject) {
|
|||||||
editModalRef.value?.setFormData({ ...res });
|
editModalRef.value?.setFormData({ ...res });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
1;
|
|
||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
function handleToolbarClick(name: string) {
|
function handleToolbarClick(name: string) {
|
||||||
console.log(name);
|
console.log(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user