fix: 更改订单列表的冲突

This commit is contained in:
wwz 2025-04-02 17:22:05 +08:00
commit 18eb536ce2
7 changed files with 113 additions and 36 deletions

View 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;
}

View File

@ -52,7 +52,7 @@
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
{{ item.productName }}
</span>
<span v-if="item.refundNumber" class="refund">(退 - {{ item.refundNumber }})</span>
<span v-if="item.refundNum" class="refund">(退 - {{ item.refundNum }})</span>
</div>
<div class="sku">{{ item.skuName }}</div>
</div>
@ -63,7 +63,7 @@
<div>
<p>
名称
<el-tag type="primary">{{ scope.row.tableName }}</el-tag>
<el-tag type="primary">{{ scope.row.tableName || "无" }}</el-tag>
</p>
<p v-if="scope.row.tableCode">编号{{ scope.row.tableCode }}</p>
</div>

View File

@ -10,6 +10,12 @@
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
@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">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}

View File

@ -45,7 +45,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
],
cols: [
// { type: "selection", width: 50, align: "center" },
{ label: "模板名称", align: "center", prop: "name" },
{ label: "模板名称", align: "center", slotName: "deptName", templet: "custom", },
{ label: "完整名称", align: "center", prop: "fullName" },
// {
// label: "操作",

View File

@ -165,19 +165,8 @@ const modalConfig: IModalConfig<addRequest> = {
],
initialValue: 1,
},
{
label: "员工权限设置",
prop: "",
type: "title",
slotName: "title",
},
{
type: 'custom',
prop: 'permission',
slotName: 'permission',
label: '',
hidden: true
}
],
};

View File

@ -164,12 +164,6 @@ const modalConfig: IModalConfig<editRequest> = {
],
initialValue: 1,
},
{
label: "员工权限设置",
prop: "",
type: "title",
slotName: "title",
},
],
};

View File

@ -44,11 +44,20 @@
<!-- 新增 -->
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<template #formFooter>
<selectPermission
v-model="selPermissionList"
:list="permissionList"
ref="refSelectPermission"
></selectPermission>
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
<div>
<el-checkbox-group v-model="addPagePathIdList">
<el-checkbox
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>
</page-modal>
@ -59,11 +68,20 @@
@submit-click="handleSubmitClick"
>
<template #formFooter>
<selectPermission
v-model="selPermissionList"
:list="permissionList"
ref="refSelectPermission"
></selectPermission>
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
<div>
<el-checkbox-group v-model="editPagePathIdList">
<el-checkbox
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>
</page-modal>
@ -85,8 +103,7 @@ import RoleApi, { type SysRole } from "@/api/account/role";
import ShopStaffApi from "@/api/account/shopStaff";
import permissionApi, { type ShopPermission } from "@/api/account/permission";
import selectPermission from "./components/select-permission.vue";
const refSelectPermission = ref();
import shopPagePermissionApi from "@/api/account/shopPagePermission";
const {
searchRef,
contentRef,
@ -106,6 +123,19 @@ const {
let permissionList = ref<ShopPermission[]>([]);
//
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() {
//
@ -113,7 +143,8 @@ async function init() {
addModalConfig.formAction = (data) => {
return oldAddSubmitFunc({
...data,
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
pagePathIdList: addPagePathIdList.value,
shopPermissionIds: addSelPermissionList.value.reduce((pre: string[], cur: string) => {
return pre.concat(cur);
}, [] as string[]),
});
@ -123,6 +154,7 @@ async function init() {
editModalConfig.formAction = (data) => {
return oldeditSubmitFunc({
...data,
pagePathIdList: editPagePathIdList.value,
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
return pre.concat(cur);
}, [] as string[]),
@ -141,6 +173,14 @@ async function init() {
});
addModalConfig.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();
@ -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);
// id
await ShopStaffApi.get(row.id).then((res) => {
@ -179,7 +222,6 @@ async function handleEditClick(row: IObject) {
editModalRef.value?.setFormData({ ...res });
});
}
1;
//
function handleToolbarClick(name: string) {
console.log(name);