Merge branch 'multi-store' of https://e.coding.net/g-cphe0354/cashier/cashier-web into wwz
This commit is contained in:
commit
6fb991ff32
|
|
@ -10,6 +10,13 @@ const ShopApi = {
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getBranchList(params: PageQuery) {
|
||||||
|
return request<any, ShopInfoEditDTO[]>({
|
||||||
|
url: `${baseURL}/branchList`,
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
},
|
||||||
add(data: ShopInfoEditDTO) {
|
add(data: ShopInfoEditDTO) {
|
||||||
return request<any, ShopInfoEditDTO>({
|
return request<any, ShopInfoEditDTO>({
|
||||||
url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/shop/branch";
|
||||||
|
|
||||||
|
const ShopBranchApi = {
|
||||||
|
getList(params: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/page`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setDataSync(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/setting/dataSyncMethod?dataSyncMethod=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dataSync(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/data/sync/enable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enable(id: any) {
|
||||||
|
console.log(id)
|
||||||
|
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/account/enable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
disable(id: any) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/account/disable?branchShopId=${id}`,
|
||||||
|
method: "post",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export interface Responseres {
|
||||||
|
code?: number | null;
|
||||||
|
data?: any;
|
||||||
|
msg?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ShopBranchApi;
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -41,6 +41,15 @@ const AuthAPI = {
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 简单修改
|
||||||
|
// /admin/prod/group/update
|
||||||
|
updates(data: Object) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/update`,
|
||||||
|
method: "put",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteByIds(id: number | String) {
|
deleteByIds(id: number | String) {
|
||||||
return request<any, Responseres>({
|
return request<any, Responseres>({
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,13 @@ const AuthAPI = {
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
addunit(data: any) {
|
addunit(data: any) {
|
||||||
|
console.log(data, '提示121');
|
||||||
|
if (data.images.length == 0) {
|
||||||
|
data.images = null
|
||||||
|
}
|
||||||
|
if (data.proGroupVo.length == 0) {
|
||||||
|
data.proGroupVo = null
|
||||||
|
}
|
||||||
return request<any, Responseres>({
|
return request<any, Responseres>({
|
||||||
url: `${baseURL}`,
|
url: `${baseURL}`,
|
||||||
method: "post",
|
method: "post",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
const baseURL = "/product/admin/product/vendor";
|
||||||
|
|
||||||
|
// 供应商账单
|
||||||
|
|
||||||
|
const AuthAPI = {
|
||||||
|
/** 供应商账单统计*/
|
||||||
|
getSummary(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/summary`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 分页*/
|
||||||
|
getPage(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单记录
|
||||||
|
getRecordList(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/record`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单付款记录
|
||||||
|
getPayRecordList(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/pay/record`,
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 账单付款
|
||||||
|
billPay(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/bill/pay`,
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface Responseres {
|
||||||
|
code?: number | null;
|
||||||
|
data?: any;
|
||||||
|
msg?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AuthAPI;
|
||||||
|
|
@ -303,7 +303,7 @@
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-dropdown v-else style="margin-top: 4px">
|
<el-dropdown style="margin-top: 4px" v-else>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="item.render === undefined || item.render(scope.row)"
|
v-if="item.render === undefined || item.render(scope.row)"
|
||||||
v-bind="
|
v-bind="
|
||||||
|
|
@ -327,8 +327,6 @@
|
||||||
<template v-if="item.options && item.options.length > 0" #dropdown>
|
<template v-if="item.options && item.options.length > 0" #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-for="opt in item.options"
|
|
||||||
:key="opt.value"
|
|
||||||
@click="
|
@click="
|
||||||
handleOperat({
|
handleOperat({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
|
@ -338,6 +336,8 @@
|
||||||
command: opt.command ? opt.command : '',
|
command: opt.command ? opt.command : '',
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.value"
|
||||||
>
|
>
|
||||||
{{ opt.label }}
|
{{ opt.label }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
@ -1039,4 +1039,18 @@ defineExpose({ fetchPageData, exportPageData, getFilterParams, getselectTable, p
|
||||||
:deep(.el-table .el-table__cell) {
|
:deep(.el-table .el-table__cell) {
|
||||||
z-index: inherit;
|
z-index: inherit;
|
||||||
}
|
}
|
||||||
|
.el-card {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
:deep(.el-table) {
|
||||||
|
overflow: visible;
|
||||||
|
.el-table__header-wrapper {
|
||||||
|
position: sticky;
|
||||||
|
z-index: calc(var(--el-table-index) + 2);
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-table td.el-table__cell div) {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,7 @@ import dayjs from "dayjs";
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
searchConfig: ISearchConfig;
|
searchConfig: ISearchConfig;
|
||||||
isOpenAutoSearch: boolean;
|
isOpenAutoSearch?: boolean;
|
||||||
watchKey: Array<string>;
|
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
isOpenAutoSearch: true,
|
isOpenAutoSearch: true,
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,67 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="logo">
|
<div class="logo wh-full flex-center">
|
||||||
<transition name="el-fade-in-linear" mode="out-in">
|
<!-- <transition name="el-fade-in-linear" mode="out-in"> -->
|
||||||
<router-link :key="+collapse" class="wh-full flex-center" to="/">
|
<!-- <router-link :key="+collapse" class="wh-full flex-center" to="/"> -->
|
||||||
<img :src="userStore.userInfo.logo" class="w20px h20px" />
|
<img :src="state.userInfo.logo" class="w20px h20px" />
|
||||||
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
|
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
|
||||||
<el-dropdown trigger="click">
|
<el-dropdown trigger="click" @command="handleCommand">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span>
|
<span v-if="!collapse" class="title">{{ state.shopName }}</span>
|
||||||
<el-icon class="el-icon--right">
|
<el-icon class="el-icon--right">
|
||||||
<arrow-down />
|
<arrow-down />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item>门店 1</el-dropdown-item>
|
<el-dropdown-item
|
||||||
<el-dropdown-item>门店 2</el-dropdown-item>
|
:command="item.shopId"
|
||||||
<el-dropdown-item>门店 3</el-dropdown-item>
|
v-for="(item,index) in state.branchList" :key="index"
|
||||||
</el-dropdown-menu>
|
> {{ item.shopName }}</el-dropdown-item>
|
||||||
</template>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</template>
|
||||||
</router-link>
|
</el-dropdown>
|
||||||
</transition>
|
<!-- </router-link> -->
|
||||||
|
<!-- </transition> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script setup>
|
||||||
import defaultSettings from "@/settings";
|
import defaultSettings from "@/settings";
|
||||||
import { useUserStore } from "@/store";
|
import { useUserStore } from "@/store";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const state = reactive({
|
||||||
|
branchList: [],
|
||||||
|
userInfo: useUserStore().userInfo,
|
||||||
|
shopName: useUserStore().userInfo.shopName
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
geiShopList()
|
||||||
|
});
|
||||||
|
async function geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
state.branchList = res;
|
||||||
|
if ( !localStorage.getItem("shopName") ) {
|
||||||
|
state.shopName = state.branchList[0].shopName
|
||||||
|
// localStorage.setItem("shopId", state.branchList[0].shopId )
|
||||||
|
localStorage.setItem("shopName", state.branchList[0].shopName )
|
||||||
|
} else {
|
||||||
|
state.shopName = localStorage.getItem("shopName")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
function handleCommand(command) {
|
||||||
|
console.log(command)
|
||||||
|
let res = state.branchList.filter(v=> v.shopId == command)[0]
|
||||||
|
// localStorage.setItem("shopId", res.shopId )
|
||||||
|
localStorage.setItem("shopName", res.shopName )
|
||||||
|
state.shopName = res.shopName
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
console.log(command)
|
||||||
|
}
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
collapse: {
|
collapse: {
|
||||||
|
|
@ -43,6 +76,7 @@ defineProps({
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
background-color: $sidebar-logo-background;
|
background-color: $sidebar-logo-background;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,9 @@ watch(route, () => {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
:deep(.el-backtop .svg-icon) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.layout-mix {
|
.layout-mix {
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ service.interceptors.request.use(
|
||||||
} else {
|
} else {
|
||||||
delete config.headers.token;
|
delete config.headers.token;
|
||||||
}
|
}
|
||||||
config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
config.headers.shopId = config.headers.shopId || localStorage.getItem("shopId");
|
||||||
|
// config.headers.shopId = config.headers.shopId || useUserStoreHook().userInfo.id;
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error) => Promise.reject(error)
|
(error) => Promise.reject(error)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class WebSocketManager {
|
||||||
this.sendMessage(this.initParams);
|
this.sendMessage(this.initParams);
|
||||||
this.clearTimer();
|
this.clearTimer();
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
this.sendMessage({ type: "ping_interval", set: 'manage' });
|
this.sendMessage({ type: "ping_interval", set: 'manage' }, false);
|
||||||
}, 1000 * 10);
|
}, 1000 * 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -108,7 +108,7 @@ class WebSocketManager {
|
||||||
this.autoConnect = true
|
this.autoConnect = true
|
||||||
}
|
}
|
||||||
|
|
||||||
public sendMessage(message: any) {
|
public sendMessage(message: any, isSendInitParams: boolean = true) {
|
||||||
if (!this.client || !this.connected) {
|
if (!this.client || !this.connected) {
|
||||||
// ElMessage.error('发送失败,已重新连接,请重新操作');
|
// ElMessage.error('发送失败,已重新连接,请重新操作');
|
||||||
this.reconnect();
|
this.reconnect();
|
||||||
|
|
@ -118,7 +118,7 @@ class WebSocketManager {
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const msg = JSON.stringify({ ...this.initParams, ...message });
|
const msg = JSON.stringify(isSendInitParams ? { ...this.initParams, ...message } : message);
|
||||||
try {
|
try {
|
||||||
this.client?.send(msg);
|
this.client?.send(msg);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,13 @@
|
||||||
<el-form-item label="桌型">
|
<el-form-item label="桌型">
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="
|
<el-button
|
||||||
showLocation = true;
|
type="primary"
|
||||||
title = '新增';
|
@click="
|
||||||
">
|
showLocation = true;
|
||||||
|
title = '新增';
|
||||||
|
"
|
||||||
|
>
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -45,11 +48,21 @@
|
||||||
<h2>通知模板</h2>
|
<h2>通知模板</h2>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||||
<el-form-item label="排队成功提醒">
|
<el-form-item label="排队成功提醒">
|
||||||
<el-input v-model="form.successMsg" placeholder="请输入排队成功提醒" disabled style="width: 500px"></el-input>
|
<el-input
|
||||||
|
v-model="form.successMsg"
|
||||||
|
placeholder="请输入排队成功提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排队即将排到通知">
|
<el-form-item label="排队即将排到通知">
|
||||||
<div>
|
<div>
|
||||||
<el-input v-model="form.nearMsg" placeholder="请输入排队成功提醒" disabled style="width: 500px"></el-input>
|
<el-input
|
||||||
|
v-model="form.nearMsg"
|
||||||
|
placeholder="请输入排队成功提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
<div class="duoshaozhuo">
|
<div class="duoshaozhuo">
|
||||||
<div>前面等待</div>
|
<div>前面等待</div>
|
||||||
<el-input v-model="form.nearNum" placeholder="" disabled></el-input>
|
<el-input v-model="form.nearNum" placeholder="" disabled></el-input>
|
||||||
|
|
@ -58,7 +71,12 @@
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排队到号提醒">
|
<el-form-item label="排队到号提醒">
|
||||||
<el-input v-model="form.callingMsg" placeholder="请输入排队到号提醒" disabled style="width: 500px"></el-input>
|
<el-input
|
||||||
|
v-model="form.callingMsg"
|
||||||
|
placeholder="请输入排队到号提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
@ -89,10 +107,18 @@
|
||||||
<el-input v-model="forms.start" placeholder="请输入开始号码"></el-input>
|
<el-input v-model="forms.start" placeholder="请输入开始号码"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="临近几桌提醒">
|
<el-form-item label="临近几桌提醒">
|
||||||
<el-input-number step-strictly v-model="forms.nearNum" placeholder="请输入临近几桌提醒"></el-input-number>
|
<el-input-number
|
||||||
|
step-strictly
|
||||||
|
v-model="forms.nearNum"
|
||||||
|
placeholder="请输入临近几桌提醒"
|
||||||
|
></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="过号保留">
|
<el-form-item label="过号保留">
|
||||||
<el-input v-model="forms.postponeNum" :disabled="!forms.isPostpone" placeholder="请输入名称">
|
<el-input
|
||||||
|
v-model="forms.postponeNum"
|
||||||
|
:disabled="!forms.isPostpone"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<div>
|
<div>
|
||||||
<span><el-checkbox v-model="forms.isPostpone">开启顺延</el-checkbox></span>
|
<span><el-checkbox v-model="forms.isPostpone">开启顺延</el-checkbox></span>
|
||||||
|
|
@ -105,10 +131,13 @@
|
||||||
<el-form-item label="" width="120">
|
<el-form-item label="" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div style="display: flex; gap: 10px">
|
<div style="display: flex; gap: 10px">
|
||||||
<el-button plain @click="
|
<el-button
|
||||||
showLocation = false;
|
plain
|
||||||
forms = {};
|
@click="
|
||||||
">
|
showLocation = false;
|
||||||
|
forms = {};
|
||||||
|
"
|
||||||
|
>
|
||||||
取消
|
取消
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="submitE">确定</el-button>
|
<el-button type="primary" @click="submitE">确定</el-button>
|
||||||
|
|
@ -189,13 +218,13 @@ export default {
|
||||||
const res = await callTableApi.deleteTable({
|
const res = await callTableApi.deleteTable({
|
||||||
callTableId: item.id,
|
callTableId: item.id,
|
||||||
});
|
});
|
||||||
console.log(res, '挑食 ');
|
console.log(res, "挑食 ");
|
||||||
if (res) {
|
if (res) {
|
||||||
this.init();
|
this.init();
|
||||||
ElSubMenu.success("删除成功");
|
ElSubMenu.success("删除成功");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
async submitE() {
|
async submitE() {
|
||||||
if (this.title == "新增") {
|
if (this.title == "新增") {
|
||||||
|
|
@ -220,6 +249,9 @@ export default {
|
||||||
}
|
}
|
||||||
this.forms = {};
|
this.forms = {};
|
||||||
},
|
},
|
||||||
|
async uploadChange() {
|
||||||
|
const res = await callTableApi.editConfig({ bgCover: this.form.bgCover });
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
try {
|
try {
|
||||||
const res = await callTableApi.getConfig();
|
const res = await callTableApi.getConfig();
|
||||||
|
|
@ -229,7 +261,7 @@ export default {
|
||||||
size: 10,
|
size: 10,
|
||||||
});
|
});
|
||||||
this.formtable = data;
|
this.formtable = data;
|
||||||
} catch (error) { }
|
} catch (error) {}
|
||||||
},
|
},
|
||||||
// 保存
|
// 保存
|
||||||
submitHandle() {
|
submitHandle() {
|
||||||
|
|
@ -248,7 +280,7 @@ export default {
|
||||||
message: "提交成功",
|
message: "提交成功",
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
} catch (error) { }
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -263,7 +295,7 @@ export default {
|
||||||
handleBeforeRemove(file, fileList) {
|
handleBeforeRemove(file, fileList) {
|
||||||
for (let i = 0; i < this.files.length; i++) {
|
for (let i = 0; i < this.files.length; i++) {
|
||||||
if (this.files[i].uid === file.uid) {
|
if (this.files[i].uid === file.uid) {
|
||||||
crudQiNiu.del([this.files[i].id]).then((res) => { });
|
crudQiNiu.del([this.files[i].id]).then((res) => {});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -368,12 +400,12 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
>input {
|
> input {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
>div {
|
> div {
|
||||||
color: #999;
|
color: #999;
|
||||||
width: 118px;
|
width: 118px;
|
||||||
height: 33px;
|
height: 33px;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="u-flex" style="flex-wrap: wrap">
|
<div class="u-flex" style="flex-wrap: wrap">
|
||||||
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px;">
|
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px;">
|
||||||
<el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<div class="time_wrap u-flex" style="flex-shrink: 0">
|
<div class="time_wrap u-flex" style="flex-shrink: 0">
|
||||||
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
|
||||||
|
|
@ -338,6 +338,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dataSummaryApi from "@/api/order/data-summary";
|
import dataSummaryApi from "@/api/order/data-summary";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import { debounce, formatDecimal } from "@/utils/tools";
|
import { debounce, formatDecimal } from "@/utils/tools";
|
||||||
|
|
@ -389,7 +390,7 @@ export default {
|
||||||
saveAmount: null,
|
saveAmount: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
storeList: [{ label: "门店1", value: 1 }],
|
branchList: [],
|
||||||
storeId: null,
|
storeId: null,
|
||||||
trade: {},
|
trade: {},
|
||||||
formatDecimal,
|
formatDecimal,
|
||||||
|
|
@ -481,9 +482,14 @@ export default {
|
||||||
// }
|
// }
|
||||||
}, 100);
|
}, 100);
|
||||||
window.addEventListener("resize", this.__resizeHandler);
|
window.addEventListener("resize", this.__resizeHandler);
|
||||||
|
this.geiShopList()
|
||||||
// this.initCardUserChart();
|
// this.initCardUserChart();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
this.branchList = res;
|
||||||
|
},
|
||||||
// 切换时间
|
// 切换时间
|
||||||
timeChange(e) {
|
timeChange(e) {
|
||||||
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px">
|
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px">
|
||||||
<el-option v-for="item in storeList" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
@ -182,7 +182,7 @@ export default {
|
||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
payCount: "",
|
payCount: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
storeList: [{ label: "门店1", value: 1 }],
|
branchList: [],
|
||||||
storeId: null,
|
storeId: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -195,8 +195,16 @@ export default {
|
||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
|
this.geiShopList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取分店列表
|
||||||
|
*/
|
||||||
|
async geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
this.branchList = res;
|
||||||
|
},
|
||||||
totalfilter(item, d) {
|
totalfilter(item, d) {
|
||||||
let num = item + d;
|
let num = item + d;
|
||||||
return num.toFixed(2);
|
return num.toFixed(2);
|
||||||
|
|
|
||||||
|
|
@ -12,28 +12,30 @@
|
||||||
|
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
<el-button type="primary" @click="getTableData" plain>批量付款</el-button>
|
<el-button type="primary" @click="handlePayment('all')" plain>批量付款</el-button>
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:供应商名称</el-text>
|
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table @selection-change="handleSelectionChange" v-loading="state.tableData.loading"
|
||||||
|
:data="state.tableData.list">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="耗材信息">
|
<el-table-column label="耗材信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.conName }}</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>单价:{{ scope.row.purchasePrice }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="账单金额" width="120" />
|
<el-table-column prop="amountPayable" label="账单金额" width="120" />
|
||||||
<el-table-column prop="status" label="已付款金额" width="120" />
|
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="未付款金额" width="120" />
|
<el-table-column prop="unPaidAmount" label="未付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="创建时间" width="120" />
|
<el-table-column prop="createTime" label="创建时间" width="120" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
||||||
|
|
@ -58,9 +60,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
import { ElMessageBox } from "element-plus";
|
|
||||||
import payment from "./components/payment.vue";
|
import payment from "./components/payment.vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -68,6 +70,7 @@ const router = useRouter();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
|
vendorId: null,
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -76,23 +79,28 @@ const state = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
|
supplierName: '',
|
||||||
|
flowIdList: [],
|
||||||
|
allAmount: 0
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(route.query);
|
if (route.query.vendorId) {
|
||||||
if (route.query.id) {
|
state.query.vendorId = route.query.vendorId
|
||||||
|
}
|
||||||
|
if (route.query.supplierName) {
|
||||||
|
state.supplierName = route.query.supplierName
|
||||||
}
|
}
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取账单记录列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getRecordList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
key: state.query.name,
|
||||||
account: state.query.account,
|
vendorId: state.query.vendorId,
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
|
|
@ -103,11 +111,28 @@ async function getTableData() {
|
||||||
}
|
}
|
||||||
const refPayment = ref();
|
const refPayment = ref();
|
||||||
function handlePayment(item) {
|
function handlePayment(item) {
|
||||||
refPayment.value.open(item);
|
if (item != 'all') {
|
||||||
|
state.flowIdList = [item.id]
|
||||||
|
} else {
|
||||||
|
if( state.flowIdList.length <= 0 ){
|
||||||
|
ElMessage({ type: "error", message: "请选择付款耗材" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
refPayment.value.open({ flowIdList: state.flowIdList, supplierName: state.supplierName,allAmount:state.allAmount });
|
||||||
|
}
|
||||||
|
function handleSelectionChange(e) {
|
||||||
|
state.flowIdList = []
|
||||||
|
state.allAmount = 0
|
||||||
|
e.map(item => {
|
||||||
|
state.flowIdList.push(item.id)
|
||||||
|
state.allAmount += item.unPaidAmount
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 付款记录
|
// 付款记录
|
||||||
function handleRecord(id) {
|
function handleRecord(id) {
|
||||||
router.push({ name: "financePaymentRecord", query: { id: id } });
|
router.push({ name: "financePaymentRecord", query: { id: id, supplierName: state.supplierName } });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,18 @@
|
||||||
<!-- 修改和增加 -->
|
<!-- 修改和增加 -->
|
||||||
<el-dialog title="付款" v-model="show" width="400px" @close="reset">
|
<el-dialog title="付款" v-model="show" width="400px" @close="reset">
|
||||||
<el-form :inline="false" ref="refform" label-width="90" :model="form" :rules="rules" class="demo-form-inline">
|
<el-form :inline="false" ref="refform" label-width="90" :model="form" :rules="rules" class="demo-form-inline">
|
||||||
<el-form-item label="供应商" prop="conName">
|
<el-form-item label="供应商">
|
||||||
<el-input v-model="form.conName" placeholder="请输入供应商名称"></el-input>
|
<el-input v-model="supplierName" placeholder="请输入供应商名称" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="付款金额 " prop="price">
|
<el-form-item label="付款金额 " prop="amount">
|
||||||
<el-input-number v-model="form.price" placeholder="请输入付款金额" style="width: 100%;"></el-input-number>
|
<el-input-number v-model="form.amount" :readonly="form.flowIdList.length > 1" placeholder="请输入付款金额"
|
||||||
|
style="width: 100%;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="付款方式" prop="conName">
|
<el-form-item label="付款方式" prop="type">
|
||||||
<el-input v-model="form.conName" placeholder="请输入付款方式"></el-input>
|
<el-input v-model="form.type" placeholder="请输入付款方式"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="defaultUnit">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.defaultUnit" placeholder="请输入备注"></el-input>
|
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="display: flex; justify-content: flex-end">
|
<el-form-item style="display: flex; justify-content: flex-end">
|
||||||
<el-button @click="close">取 消</el-button>
|
<el-button @click="close">取 消</el-button>
|
||||||
|
|
@ -24,33 +25,35 @@
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import consApi from "@/api/product/cons";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const emits = defineEmits(["refresh"]);
|
const emits = defineEmits(["refresh"]);
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
conName: [{ required: true, message: "请输入耗材名称", trigger: "blur" }],
|
amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
||||||
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
|
type: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
|
||||||
conWarning: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
|
||||||
conUnit: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const basicForm = {
|
const basicForm = {
|
||||||
conName: "",
|
flowIdList: [],
|
||||||
consGroupId: "",
|
amount: undefined,
|
||||||
conUnit: "",
|
type: '',
|
||||||
price: undefined,
|
remark: '',
|
||||||
conWarning: undefined,
|
|
||||||
};
|
};
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
...basicForm,
|
...basicForm,
|
||||||
});
|
});
|
||||||
|
const supplierName = ref('');
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
function open(item) {
|
function open(item) {
|
||||||
Object.assign(form, item);
|
form.flowIdList = item.flowIdList
|
||||||
|
supplierName.value = item.supplierName
|
||||||
|
if (item.flowIdList.length > 1 && item.allAmount) {
|
||||||
|
form.amount = item.allAmount
|
||||||
|
}
|
||||||
|
// Object.assign(form, item);
|
||||||
show.value = true;
|
show.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,8 +64,8 @@ const refform = ref();
|
||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
refform.value.validate(async (valid) => {
|
refform.value.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const res = await consApi.add(form);
|
const res = await AuthAPI.billPay(form);
|
||||||
ElMessage({ type: "success", message: "付款成功" });
|
ElMessage({ type: "success", message: "付款成功" });
|
||||||
emits("refresh");
|
emits("refresh");
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +75,7 @@ async function submitForm() {
|
||||||
function reset() {
|
function reset() {
|
||||||
console.log("reset");
|
console.log("reset");
|
||||||
Object.assign(form, basicForm);
|
Object.assign(form, basicForm);
|
||||||
console.log(form);
|
close();
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|
|
||||||
|
|
@ -21,16 +21,16 @@
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>账单总金额(全部/本月)</div>
|
<div>账单总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.amountPayable }} / {{ state.summaryData.mouthAmountPayable }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>已付款总金额(全部/本月)</div>
|
<div>已付款总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.actualPaymentAmount }} / {{ state.summaryData.mouthActualPaymentAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
|
||||||
<div>未付款总金额(全部/本月)</div>
|
<div>未付款总金额(全部/本月)</div>
|
||||||
<div>2000/1000</div>
|
<div>{{ state.summaryData.unPaidAmount }} / {{ state.summaryData.mouthUnPaidAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
@ -38,15 +38,14 @@
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="name" label="供应商" width="220" />
|
||||||
<el-table-column prop="status" label="供应商" width="220" />
|
<el-table-column prop="amountPayable" label="账单金额" width="200" />
|
||||||
<el-table-column prop="status" label="账单金额" width="160" />
|
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="200" />
|
||||||
<el-table-column prop="status" label="已付款金额" width="160" />
|
<el-table-column prop="unPaidAmount" label="未付款金额" width="200" />
|
||||||
<el-table-column prop="status" label="未付款金额" width="160" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
|
||||||
<el-table-column label="操作" width="120">
|
<el-table-column label="操作" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link @click="handleTo(scope.row.id)">
|
<el-button type="primary" size="small" link @click="handleTo(scope.row)">
|
||||||
账单记录
|
账单记录
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -64,13 +63,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import AuthAPI from "@/api/supplier/index";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
},
|
},
|
||||||
|
summaryData: {},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -80,18 +80,27 @@ const state = reactive({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getSummary();
|
||||||
|
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
|
||||||
|
async function getSummary() {
|
||||||
|
try {
|
||||||
|
const res = await AuthAPI.getSummary();
|
||||||
|
state.summaryData = res;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取账单列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getPage({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
key: state.query.name,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
|
|
@ -100,9 +109,9 @@ async function getTableData() {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleTo(id) {
|
function handleTo(row) {
|
||||||
// router.push({ path: "/finance/supplierBill/billingRecord", query: { id: e.id } });
|
// router.push({ path: "/finance/supplierBill/billingRecord", query: { id: e.id } });
|
||||||
router.push({ name: "financeBillingRecord", query: { id: id } });
|
router.push({ name: "financeBillingRecord", query: { vendorId: row.vendorId, supplierName: row.name } });
|
||||||
|
|
||||||
}
|
}
|
||||||
// 重置查询
|
// 重置查询
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
|
||||||
style="margin-bottom: 15px;" />
|
style="margin-bottom: 15px;" />
|
||||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:供应商名称</el-text>
|
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
|
|
@ -13,20 +13,20 @@
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="耗材信息">
|
<el-table-column label="耗材信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.conName }}</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>单价:{{ scope.row.purchasePrice }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="付款金额" width="120" />
|
<el-table-column prop="amount" label="付款金额" width="120" />
|
||||||
<el-table-column prop="status" label="付款方式" width="120" />
|
<el-table-column prop="type" label="付款方式" width="120" />
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column prop="status" label="创建时间" />
|
<el-table-column prop="createTime" label="创建时间" />
|
||||||
<el-table-column label="操作人" width="200">
|
<el-table-column label="操作人" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>员工名称:{{ scope.row.shopName }}</div>
|
<div>员工名称:{{ scope.row.nickname }}</div>
|
||||||
<div>员工编号:{{ scope.row.shopName }}</div>
|
<div>员工编号:{{ scope.row.code }}</div>
|
||||||
<div>员工账号:{{ scope.row.phone }}</div>
|
<div>员工账号:{{ scope.row.account }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -43,12 +43,15 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ShopApi from "@/api/account/shop";
|
import ShopApi from "@/api/account/shop";
|
||||||
|
import AuthAPI from "@/api/supplier/index";
|
||||||
|
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
|
flowId: null,
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -57,23 +60,26 @@ const state = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
|
supplierName: '',
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(route.query);
|
console.log(route.query);
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
|
state.query.flowId = route.query.id
|
||||||
|
}
|
||||||
|
if (route.query.supplierName) {
|
||||||
|
state.supplierName = route.query.supplierName
|
||||||
}
|
}
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取账单付款列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await AuthAPI.getPayRecordList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
flowId: state.query.flowId,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
state.tableData.list = res.records;
|
state.tableData.list = res.records;
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,8 @@ function handleLogin() {
|
||||||
userStore.meituan_douyin_info = checkInfo.userInfo;
|
userStore.meituan_douyin_info = checkInfo.userInfo;
|
||||||
setDouyinToken(checkInfo.userInfo.token);
|
setDouyinToken(checkInfo.userInfo.token);
|
||||||
});
|
});
|
||||||
|
localStorage.removeItem("shopName")
|
||||||
|
|
||||||
await userStore.getUserInfo();
|
await userStore.getUserInfo();
|
||||||
|
|
||||||
const { path, queryParams } = parseRedirect();
|
const { path, queryParams } = parseRedirect();
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,9 @@
|
||||||
<el-radio-group v-model="forms.sortMode">
|
<el-radio-group v-model="forms.sortMode">
|
||||||
<el-radio value="0" label="默认" />
|
<el-radio value="0" label="默认" />
|
||||||
<el-radio value="1" label="价格由高到低" />
|
<el-radio value="1" label="价格由高到低" />
|
||||||
<el-radio value="2" label="销量由高到低" />
|
<el-radio value="2" label="价格由低到高" />
|
||||||
|
<el-radio value="3" label="销量由高到低" />
|
||||||
|
<el-radio value="4" label="销量由低到高" />
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分组排序">
|
<el-form-item label="分组排序">
|
||||||
|
|
@ -213,7 +215,7 @@ let forms = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
status: 1,
|
status: 1,
|
||||||
useTime: 0,
|
useTime: 0,
|
||||||
sortMode: 0,
|
sortMode: '0',
|
||||||
sort: 1,
|
sort: 1,
|
||||||
time: ""
|
time: ""
|
||||||
})
|
})
|
||||||
|
|
@ -331,7 +333,7 @@ function handleToolbarClick(name: string) {
|
||||||
name: "",
|
name: "",
|
||||||
status: 1,
|
status: 1,
|
||||||
useTime: 0,
|
useTime: 0,
|
||||||
sortMode: 0,
|
sortMode: '0',
|
||||||
sort: 1,
|
sort: 1,
|
||||||
time: ""
|
time: ""
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,11 @@ const modalConfig: IModalConfig<UserForm> = {
|
||||||
prop: "sortMode",
|
prop: "sortMode",
|
||||||
type: "radio",
|
type: "radio",
|
||||||
options: [
|
options: [
|
||||||
{ label: "默认", value: 0 },
|
{ label: "默认", value: '0' },
|
||||||
{ label: "价格由高到低", value: 1 },
|
{ label: "价格由高到低", value: '1' },
|
||||||
{ label: "销量由高到低", value: 2 },
|
{ label: "价格由低到高", value: '2' },
|
||||||
|
{ label: "销量由高到低", value: '3' },
|
||||||
|
{ label: "销量由低到高", value: '4' },
|
||||||
],
|
],
|
||||||
initialValue: 0,
|
initialValue: 0,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
// importTemplate: UserAPI.downloadTemplate,
|
// importTemplate: UserAPI.downloadTemplate,
|
||||||
modifyAction: function (params) {
|
modifyAction: function (params) {
|
||||||
let obj = { ...params }
|
let obj = { ...params }
|
||||||
return UserAPI.update(obj);
|
return UserAPI.updates(obj);
|
||||||
},
|
},
|
||||||
importsAction(data) {
|
importsAction(data) {
|
||||||
// 模拟导入数据
|
// 模拟导入数据
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,9 @@ const modalConfig: IModalConfig<UserForm> = {
|
||||||
options: [
|
options: [
|
||||||
{ label: "默认", value: '0' },
|
{ label: "默认", value: '0' },
|
||||||
{ label: "价格由高到低", value: '1' },
|
{ label: "价格由高到低", value: '1' },
|
||||||
{ label: "销量由高到低", value: '2' },
|
{ label: "价格由低到高", value: '2' },
|
||||||
|
{ label: "销量由高到低", value: '3' },
|
||||||
|
{ label: "销量由低到高", value: '4' },
|
||||||
],
|
],
|
||||||
initialValue: '0',
|
initialValue: '0',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -100,17 +100,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div>支付方式:{{ returnPayType(detail.payType) }}</div>
|
||||||
<div>
|
<div>
|
||||||
退款金额:¥{{ detail.refundAmount }}
|
退款金额:¥{{ detail.refundAmount }}
|
||||||
<span
|
<!-- <span
|
||||||
style="color: #ff9731; cursor: pointer"
|
style="color: #ff9731; cursor: pointer"
|
||||||
v-if="detail.isRefund"
|
v-if="detail.isRefund"
|
||||||
@click="type = '3'"
|
@click="type = '3'"
|
||||||
>
|
>
|
||||||
退款详情>
|
退款详情>
|
||||||
</span>
|
</span> -->
|
||||||
</div>
|
</div>
|
||||||
<div>支付方式:{{ returnPayType(detail.payType) }}</div>
|
<div class="color-red">退款方式:{{ detail.refundType }}</div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ const contentConfig: IContentConfig = {
|
||||||
}
|
}
|
||||||
return OrderApi.getList(params);
|
return OrderApi.getList(params);
|
||||||
},
|
},
|
||||||
indexActionData: {
|
indexActionData: {},
|
||||||
},
|
|
||||||
// deleteAction: OrderApi.delete,
|
// deleteAction: OrderApi.delete,
|
||||||
// modifyAction: function (data) {
|
// modifyAction: function (data) {
|
||||||
// // return OrderApi.edit(data);
|
// // return OrderApi.edit(data);
|
||||||
|
|
@ -46,28 +45,30 @@ const contentConfig: IContentConfig = {
|
||||||
label: "订单号信息",
|
label: "订单号信息",
|
||||||
align: "center",
|
align: "center",
|
||||||
prop: "orderNo",
|
prop: "orderNo",
|
||||||
|
templet: "custom",
|
||||||
|
slotName: "orderNo",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "商品信息",
|
label: "商品信息",
|
||||||
align: "center",
|
align: "center",
|
||||||
templet: 'custom',
|
templet: "custom",
|
||||||
prop: 'goods',
|
prop: "goods",
|
||||||
slotName: 'goods',
|
slotName: "goods",
|
||||||
width: 240,
|
width: 240,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "台桌信息",
|
label: "台桌信息",
|
||||||
align: "center",
|
align: "center",
|
||||||
templet: 'custom',
|
templet: "custom",
|
||||||
slotName: 'table',
|
slotName: "table",
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "订单原金额 不含折扣价格",
|
label: "订单原金额 不含折扣价格",
|
||||||
align: "center",
|
align: "center",
|
||||||
prop: "originAmount",
|
prop: "originAmount",
|
||||||
templet: 'custom',
|
templet: "custom",
|
||||||
slotName: 'originAmount',
|
slotName: "originAmount",
|
||||||
width: 120,
|
width: 120,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
},
|
},
|
||||||
|
|
@ -117,7 +118,7 @@ const contentConfig: IContentConfig = {
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 150,
|
width: 150,
|
||||||
templet: "custom",
|
templet: "custom",
|
||||||
slotName: 'operate'
|
slotName: "operate",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
<page-search
|
<page-search
|
||||||
ref="searchRef"
|
ref="searchRef"
|
||||||
:search-config="searchConfig"
|
:search-config="searchConfig"
|
||||||
|
:isOpenAutoSearch="true"
|
||||||
@query-click="handleQueryClick"
|
@query-click="handleQueryClick"
|
||||||
@reset-click="handleResetClick"
|
@reset-click="handleResetClick"
|
||||||
:isOpenAutoSearch="true"
|
|
||||||
/>
|
/>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content
|
<page-content
|
||||||
|
|
@ -24,6 +24,20 @@
|
||||||
<template #originAmount="scope">
|
<template #originAmount="scope">
|
||||||
{{ returnOriginAmount(scope.row) }}
|
{{ returnOriginAmount(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #orderNo="scope">
|
||||||
|
<div style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="dark"
|
||||||
|
:content="scope.row.orderNo"
|
||||||
|
placement="top-start"
|
||||||
|
>
|
||||||
|
{{ scope.row.orderNo }}
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</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 ? "启用" : "禁用" }}
|
||||||
|
|
@ -31,16 +45,16 @@
|
||||||
</template>
|
</template>
|
||||||
<template #goods="scope">
|
<template #goods="scope">
|
||||||
<div class="goods_info">
|
<div class="goods_info">
|
||||||
<div class="row" v-for="item in scope.row.goods" :key="item.id">
|
<div v-for="item in scope.row.goods" :key="item.id" class="row">
|
||||||
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
<el-image :src="item.productImg" class="cover" lazy />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
||||||
{{ item.productName }}
|
{{ item.productName }}
|
||||||
</span>
|
</span>
|
||||||
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
|
<span v-if="item.refundNum" class="refund">(退 - {{ item.refundNum }})</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="sku">{{ item.productSkuName }}</div>
|
<div class="sku">{{ item.skuName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -49,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>
|
||||||
|
|
@ -73,12 +87,12 @@
|
||||||
</template>
|
</template>
|
||||||
<template #operate="scope">
|
<template #operate="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-button @click="showdetail(scope.row)" link>详情</el-button>
|
<el-button link @click="showdetail(scope.row)">详情</el-button>
|
||||||
<el-button link v-if="scope.row.status == 'done'">开票</el-button>
|
<el-button v-if="scope.row.status == 'done'" link>开票</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.status == 'unpaid'"
|
v-if="scope.row.status == 'unpaid'"
|
||||||
@click="toPayOrder(scope.row)"
|
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@click="toPayOrder(scope.row)"
|
||||||
>
|
>
|
||||||
结账
|
结账
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -106,7 +120,7 @@
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
<orderDetail ref="refDetail" @close="refresh"></orderDetail>
|
<orderDetail ref="refDetail" @close="refresh" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -317,7 +331,9 @@ function showdetail(row: OrderInfoVo) {
|
||||||
.goods_info {
|
.goods_info {
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
&:not(:first-child) {
|
&:not(:first-child) {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
@ -331,8 +347,7 @@ function showdetail(row: OrderInfoVo) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-left: 10px;
|
margin-top: 2px;
|
||||||
|
|
||||||
.sku {
|
.sku {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,39 +7,73 @@
|
||||||
@reset-click="handleResetClick" /> -->
|
@reset-click="handleResetClick" /> -->
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
<page-content
|
||||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
ref="contentRef"
|
||||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
: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 #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 ? "启用" : "禁用" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #slotNameimage="scope">
|
||||||
|
<el-image
|
||||||
|
v-if="scope.row.pic"
|
||||||
|
:src="scope.row.pic"
|
||||||
|
lazy
|
||||||
|
style="width: 40px; height: 40px"
|
||||||
|
/>
|
||||||
|
<div v-else>无</div>
|
||||||
|
</template>
|
||||||
<template #gender="scope">
|
<template #gender="scope">
|
||||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
<copy-button
|
||||||
|
v-if="scope.row[scope.prop]"
|
||||||
|
:text="scope.row[scope.prop]"
|
||||||
|
style="margin-left: 2px"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
|
<page-modal
|
||||||
|
ref="addModalRef"
|
||||||
|
:modal-config="addModalConfig"
|
||||||
|
@submit-click="handleSubmitClick"
|
||||||
|
>
|
||||||
<template #gender="scope">
|
<template #gender="scope">
|
||||||
<Dict v-model="scope.formData[scope.prop]" code="gender" />
|
<Dict v-model="scope.formData[scope.prop]" code="gender" />
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
<page-modal
|
||||||
|
ref="editModalRef"
|
||||||
|
:modal-config="editModalConfig"
|
||||||
|
@submit-click="handleSubmitClick"
|
||||||
|
>
|
||||||
<template #gender="scope">
|
<template #gender="scope">
|
||||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
|
<page-content
|
||||||
|
ref="contentRef"
|
||||||
|
:content-config="contentConfig2"
|
||||||
|
@operat-click="handleOperatClick"
|
||||||
|
>
|
||||||
<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 ? "启用" : "禁用" }}
|
||||||
|
|
@ -96,7 +130,6 @@ async function handleEditClick(row: IObject) {
|
||||||
const data = await UserAPI.getunitinfo(row.id);
|
const data = await UserAPI.getunitinfo(row.id);
|
||||||
editModalRef.value?.setFormData(data);
|
editModalRef.value?.setFormData(data);
|
||||||
editModalRef.value?.setModalVisible();
|
editModalRef.value?.setModalVisible();
|
||||||
|
|
||||||
}
|
}
|
||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
function handleToolbarClick(name: string) {
|
function handleToolbarClick(name: string) {
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
// },
|
// },
|
||||||
// exportAction: UserAPI.export,
|
// exportAction: UserAPI.export,
|
||||||
modifyAction: function (params) {
|
modifyAction: function (params) {
|
||||||
console.log(1111112222222222222)
|
console.log(1111112222222222222);
|
||||||
let obj = { sort: "1", ...params }
|
let obj = { sort: "1", ...params };
|
||||||
return UserAPI.update(obj);
|
return UserAPI.update(obj);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -44,13 +44,17 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
// return res.list;
|
// return res.list;
|
||||||
// },
|
// },
|
||||||
pk: "id",
|
pk: "id",
|
||||||
toolbar: [
|
toolbar: ["add"],
|
||||||
"add",
|
|
||||||
],
|
|
||||||
cols: [
|
cols: [
|
||||||
// { type: "selection", width: 50, align: "center" },
|
// { type: "selection", width: 50, align: "center" },
|
||||||
{ label: "分类名称", align: "center", prop: "name" },
|
{ label: "分类名称", align: "center", prop: "name" },
|
||||||
{ label: "分类图片", align: "center", prop: "pic", templet: "image" },
|
{
|
||||||
|
label: "分类图片",
|
||||||
|
align: "center",
|
||||||
|
prop: "pic",
|
||||||
|
slotName: "slotNameimage",
|
||||||
|
templet: "custom",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "状态",
|
label: "状态",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
|
||||||
|
|
@ -737,7 +737,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
ruleForm.proGroupVo.forEach((item: any) => {
|
ruleForm.proGroupVo.forEach((item: any) => {
|
||||||
})
|
})
|
||||||
if (selectTitle) {
|
if (selectTitle) {
|
||||||
ElMessage.error('请填写标题和几选几')
|
ElMessage.error('请填写组名和几选几')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 修改时间
|
// 修改时间
|
||||||
|
|
@ -768,7 +768,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (selectTitle) {
|
if (selectTitle) {
|
||||||
ElMessage.error('请填写标题和几选几')
|
ElMessage.error('请填写组名和几选几')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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: "操作",
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,14 @@
|
||||||
<el-input v-model="state.query.name" clearable placeholder="请输入分店名称" style="width: 100%" class="filter-item"
|
<el-input v-model="state.query.name" clearable placeholder="请输入分店名称" style="width: 100%" class="filter-item"
|
||||||
@keyup.enter="getTableData" />
|
@keyup.enter="getTableData" />
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-select v-model="state.par.dataSyncMethod" @change="setDataSync" placeholder="请设置同步方式"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option v-for="item in state.status" :key="item.type" :label="item.label" :value="item.type" />
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="6">
|
<el-col :span="12">
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
<el-button @click="resetHandle">重置</el-button>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -19,41 +25,42 @@
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||||
<el-table-column prop="status" label="ID" width="80" />
|
<el-table-column prop="status" label="ID" width="80" />
|
||||||
<el-table-column label="店铺信息" >
|
<el-table-column label="店铺信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
||||||
<div>账号:{{ scope.row.shopName }}</div>
|
<div>账号:{{ scope.row.account }}</div>
|
||||||
<div>联系电话:{{ scope.row.phone }}</div>
|
<div>联系电话:{{ scope.row.phone }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="商品同步" width="120">
|
<el-table-column prop="isEnableProdSync" label="商品同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableProdSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableProdSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="会员同步" width="120">
|
<el-table-column prop="isEnableVipSync" label="会员同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableVipSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableVipSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="耗材同步" width="120">
|
<el-table-column prop="isEnableConsSync" label="耗材同步" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isEnableConsSync == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isEnableConsSync == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="账号状态" width="120">
|
<el-table-column prop="isAllowAccountLogin" label="账号状态" width="120">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" disabled />
|
<el-tag :type="scope.row.isAllowAccountLogin == 1 ? 'success' : 'error'" effect="dark"> {{ scope.row.isAllowAccountLogin == 1 ? '启用' : '禁用' }} </el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createdAt" label="备注" />
|
<el-table-column prop="createdAt" label="备注" />
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="primary" size="small" link icon="edit" @click="handleSync(scope.row)">
|
<el-button v-if="!scope.row.isEnableProdSync || !scope.row.isEnableVipSync || !scope.row.isEnableConsSync"
|
||||||
|
type="primary" size="small" link icon="edit" @click="handleSync(scope.row)">
|
||||||
同步启用
|
同步启用
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="small" link icon="edit" @click="handleAccount(scope.row.id)">
|
<el-button type="primary" size="small" link icon="edit" @click="handleAccount(scope.row)">
|
||||||
账号启用
|
{{ scope.row.isAllowAccountLogin ? '账号禁用' : '账号启用' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -71,22 +78,19 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import ShopApi from "@/api/account/shop";
|
import ShopBranchApi from "@/api/account/shopBranch";
|
||||||
import { ElNotification, ElMessageBox } from "element-plus";
|
import { ElNotification, ElMessageBox } from "element-plus";
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
query: {
|
query: {
|
||||||
name: "",
|
name: "",
|
||||||
},
|
},
|
||||||
|
par: {
|
||||||
|
dataSyncMethod: '',
|
||||||
|
},
|
||||||
status: [
|
status: [
|
||||||
{
|
{ type: 'auto', label: "实时自动同步", },
|
||||||
type: 1,
|
{ type: 'manual', label: "手动同步", }
|
||||||
label: "开启",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 0,
|
|
||||||
label: "关闭",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
tableData: {
|
tableData: {
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -99,15 +103,14 @@ const state = reactive({
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
// 获取商家列表
|
// 获取分店列表
|
||||||
async function getTableData() {
|
async function getTableData() {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await ShopApi.getList({
|
const res = await ShopBranchApi.getList({
|
||||||
page: state.tableData.page,
|
page: state.tableData.page,
|
||||||
size: state.tableData.size,
|
size: state.tableData.size,
|
||||||
shopName: state.query.name,
|
shopName: state.query.name,
|
||||||
account: state.query.account,
|
|
||||||
status: state.query.status,
|
status: state.query.status,
|
||||||
});
|
});
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
|
|
@ -117,6 +120,16 @@ async function getTableData() {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 设置数据同步
|
||||||
|
async function setDataSync() {
|
||||||
|
await ShopBranchApi.setDataSync(state.par.dataSyncMethod);
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "设置成功",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启同步
|
||||||
function handleSync(e) {
|
function handleSync(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
|
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
|
||||||
|
|
@ -124,7 +137,7 @@ function handleSync(e) {
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
const res = await ShopApi.delete({ id: row.id });
|
await ShopBranchApi.dataSync(e.id)
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "同步成功",
|
message: "同步成功",
|
||||||
|
|
@ -132,6 +145,17 @@ function handleSync(e) {
|
||||||
getTableData();
|
getTableData();
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 账号启用/禁用
|
||||||
|
async function handleAccount(row) {
|
||||||
|
if (row.isAllowAccountLogin) {
|
||||||
|
await ShopBranchApi.disable(row.id);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await ShopBranchApi.enable(row.id);
|
||||||
|
}
|
||||||
|
getTableData();
|
||||||
|
}
|
||||||
// 重置查询
|
// 重置查询
|
||||||
function resetHandle() {
|
function resetHandle() {
|
||||||
state.query.name = "";
|
state.query.name = "";
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class="tips">请谨慎修改!!!</div>
|
<div class="tips">请谨慎修改!!!</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否为主店" prop="isMainStore">
|
<el-form-item label="是否为主店" prop="isHeadShop">
|
||||||
<el-radio-group v-model="state.form.isMainStore" @change=" state.form.mainId = ''">
|
<el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''">
|
||||||
<el-radio value="1">是</el-radio>
|
<el-radio value="1">是</el-radio>
|
||||||
<el-radio value="0">否</el-radio>
|
<el-radio value="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isMainStore == '0'">
|
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isHeadShop == '0'">
|
||||||
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
|
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
|
||||||
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
|
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
|
||||||
:remote-method="getTableData" :loading="state.shopListLoading">
|
:remote-method="getTableData" :loading="state.shopListLoading">
|
||||||
|
|
@ -208,7 +208,7 @@ const state = reactive({
|
||||||
cities: "",
|
cities: "",
|
||||||
districts: "",
|
districts: "",
|
||||||
chainName: "",
|
chainName: "",
|
||||||
isMainStore: '0',
|
isHeadShop: '0',
|
||||||
},
|
},
|
||||||
resetForm: "",
|
resetForm: "",
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -226,7 +226,7 @@ const state = reactive({
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
isMainStore: [
|
isHeadShop: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: " ",
|
message: " ",
|
||||||
|
|
@ -354,6 +354,7 @@ function submitHandle() {
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
close();
|
close();
|
||||||
|
location.reload()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
state.formLoading = false;
|
state.formLoading = false;
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>
|
<div>
|
||||||
<span>{{ scope.row.shopName }}</span>
|
<span>{{ scope.row.shopName }}</span>
|
||||||
<div>(主店:)</div>
|
<div>(主店:{{ scope.row.headShopName }})</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
||||||
|
|
@ -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",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
import { paramTypeOptions } from './config'
|
import { paramTypeOptions } from './config'
|
||||||
import UserAPI from "@/api/product/productclassification";
|
import UserAPI from "@/api/product/productclassification";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
|
|
||||||
|
|
||||||
const searchConfig: ISearchConfig = {
|
const searchConfig: ISearchConfig = {
|
||||||
|
|
@ -19,7 +20,17 @@ const searchConfig: ISearchConfig = {
|
||||||
},
|
},
|
||||||
options: [],
|
options: [],
|
||||||
async initFn(formItem) {
|
async initFn(formItem) {
|
||||||
formItem.options = await UserAPI.getList();
|
// formItem.options = await UserAPI.getList();
|
||||||
|
let res = await ShopApi.getBranchList();
|
||||||
|
let options = [];
|
||||||
|
res.map(v=>{
|
||||||
|
options.push({
|
||||||
|
label: v.shopName,
|
||||||
|
value: v.shopId,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
formItem.options = options
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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,7 +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,
|
||||||
|
|
@ -105,30 +123,45 @@ 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[]>([]);
|
||||||
|
|
||||||
|
const oldAddSubmitFunc = addModalConfig.formAction;
|
||||||
|
|
||||||
|
const oldeditSubmitFunc = editModalConfig.formAction;
|
||||||
// 数据初始化
|
// 数据初始化
|
||||||
async function init() {
|
async function init() {
|
||||||
// 覆写添加确定方法
|
// 覆写添加确定方法
|
||||||
const oldAddSubmitFunc = addModalConfig.formAction;
|
addModalConfig.formAction = function (data) {
|
||||||
addModalConfig.formAction = (data) => {
|
return ShopStaffApi.add({
|
||||||
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[]),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 覆写编辑确定方法
|
// 覆写编辑确定方法
|
||||||
const oldeditSubmitFunc = editModalConfig.formAction;
|
editModalConfig.formAction = function (data) {
|
||||||
editModalConfig.formAction = (data) => {
|
return ShopStaffApi.edit({
|
||||||
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[]),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await RoleApi.getList({ page: 1, size: 100 });
|
const res = await RoleApi.getList({ page: 1, size: 100 });
|
||||||
const permission = await permissionApi.getshopPermission();
|
const permission = await permissionApi.getshopPermission();
|
||||||
permissionList.value = Array.isArray(permission) ? permission : [];
|
permissionList.value = Array.isArray(permission) ? permission : [];
|
||||||
|
|
@ -141,6 +174,15 @@ 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,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
addPagePathIdList.value = pagePathIdLists.value.map((v) => v.id);
|
||||||
}
|
}
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
@ -172,14 +214,14 @@ async function handleEditClick(row: IObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(selPermissionList.value);
|
const pageList = await shopPagePermissionApi.detail({ staffId: row.id });
|
||||||
|
editPagePathIdList.value = pageList.map((item) => item.id);
|
||||||
// 根据id获取数据进行填充
|
// 根据id获取数据进行填充
|
||||||
await ShopStaffApi.get(row.id).then((res) => {
|
await ShopStaffApi.get(row.id).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
editModalRef.value?.setFormData({ ...res });
|
editModalRef.value?.setFormData({ ...res });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
1;
|
|
||||||
// 其他工具栏
|
// 其他工具栏
|
||||||
function handleToolbarClick(name: string) {
|
function handleToolbarClick(name: string) {
|
||||||
console.log(name);
|
console.log(name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue