fix: 更改订单列表的冲突
This commit is contained in:
commit
18eb536ce2
|
|
@ -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' : '']">
|
||||
{{ 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>
|
||||
|
|
|
|||
|
|
@ -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 ? "启用" : "禁用" }}
|
||||
|
|
|
|||
|
|
@ -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: "操作",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -164,12 +164,6 @@ const modalConfig: IModalConfig<editRequest> = {
|
|||
],
|
||||
initialValue: 1,
|
||||
},
|
||||
{
|
||||
label: "员工权限设置",
|
||||
prop: "",
|
||||
type: "title",
|
||||
slotName: "title",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue