This commit is contained in:
wwz 2025-04-08 11:26:41 +08:00
commit 6fb991ff32
39 changed files with 719 additions and 268 deletions

View File

@ -10,6 +10,13 @@ const ShopApi = {
params: params,
});
},
getBranchList(params: PageQuery) {
return request<any, ShopInfoEditDTO[]>({
url: `${baseURL}/branchList`,
method: "get",
params: params,
});
},
add(data: ShopInfoEditDTO) {
return request<any, ShopInfoEditDTO>({
url: `${baseURL}`,
@ -277,4 +284,4 @@ export interface ShopInfo {
tubeType?: number | null;
updateTime?: null | string;
[property: string]: any;
}
}

View File

@ -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;

View File

@ -0,0 +1,46 @@
import request from "@/utils/request";
import { Account_BaseUrl } from "@/api/config";
import { get } from "lodash";
const baseURL = Account_BaseUrl + "/admin/shopPagePermission";
const Api = {
// 获取所有页面路径
getPageAll(params: any) {
return request<any, object[]>({
url: `${baseURL}`,
method: "get",
params: params,
});
},
// 保存修改权限
save(data: any) {
return request<any>({
url: `${baseURL}`,
method: "post",
data: data,
});
},
//获取员工拥有页面路径
detail(params: any) {
return request<any, PagePath[]>({
url: `${baseURL}/detail`,
method: "get",
params: params,
});
},
//获取当前员工已拥有页面路径
mine(params: any) {
return request<any>({
url: `${baseURL}/mine`,
method: "get",
params: params,
});
}
};
export default Api;
interface PagePath {
label: string;
value: string;
[property: string]: any;
}

View File

@ -41,6 +41,15 @@ const AuthAPI = {
data,
});
},
// 简单修改
// /admin/prod/group/update
updates(data: Object) {
return request<any, Responseres>({
url: `${baseURL}/update`,
method: "put",
data,
});
},
// 删除
deleteByIds(id: number | String) {
return request<any, Responseres>({

View File

@ -20,6 +20,13 @@ const AuthAPI = {
},
// 新增
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>({
url: `${baseURL}`,
method: "post",

60
src/api/supplier/index.ts Normal file
View File

@ -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;

View File

@ -303,7 +303,7 @@
{{ item.text }}
</el-button>
<el-dropdown v-else style="margin-top: 4px">
<el-dropdown style="margin-top: 4px" v-else>
<el-button
v-if="item.render === undefined || item.render(scope.row)"
v-bind="
@ -327,8 +327,6 @@
<template v-if="item.options && item.options.length > 0" #dropdown>
<el-dropdown-menu>
<el-dropdown-item
v-for="opt in item.options"
:key="opt.value"
@click="
handleOperat({
name: item.name,
@ -338,6 +336,8 @@
command: opt.command ? opt.command : '',
})
"
v-for="opt in item.options"
:key="opt.value"
>
{{ opt.label }}
</el-dropdown-item>
@ -1039,4 +1039,18 @@ defineExpose({ fetchPageData, exportPageData, getFilterParams, getselectTable, p
:deep(.el-table .el-table__cell) {
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>

View File

@ -153,8 +153,7 @@ import dayjs from "dayjs";
const props = withDefaults(
defineProps<{
searchConfig: ISearchConfig;
isOpenAutoSearch: boolean;
watchKey: Array<string>;
isOpenAutoSearch?: boolean;
}>(),
{
isOpenAutoSearch: true,

View File

@ -1,34 +1,67 @@
<template>
<div class="logo">
<transition name="el-fade-in-linear" mode="out-in">
<router-link :key="+collapse" class="wh-full flex-center" to="/">
<img :src="userStore.userInfo.logo" class="w20px h20px" />
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
<el-dropdown trigger="click">
<span class="el-dropdown-link">
<span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span>
<el-icon class="el-icon--right">
<arrow-down />
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>门店 1</el-dropdown-item>
<el-dropdown-item>门店 2</el-dropdown-item>
<el-dropdown-item>门店 3</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</router-link>
</transition>
<div class="logo wh-full flex-center">
<!-- <transition name="el-fade-in-linear" mode="out-in"> -->
<!-- <router-link :key="+collapse" class="wh-full flex-center" to="/"> -->
<img :src="state.userInfo.logo" class="w20px h20px" />
<!-- <span v-if="!collapse" class="title">{{ userStore.userInfo.shopName }}</span> -->
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<span v-if="!collapse" class="title">{{ state.shopName }}</span>
<el-icon class="el-icon--right">
<arrow-down />
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
:command="item.shopId"
v-for="(item,index) in state.branchList" :key="index"
> {{ item.shopName }}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<!-- </router-link> -->
<!-- </transition> -->
</div>
</template>
<script lang="ts" setup>
<script setup>
import defaultSettings from "@/settings";
import { useUserStore } from "@/store";
import ShopApi from "@/api/account/shop";
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({
collapse: {
@ -43,6 +76,7 @@ defineProps({
width: 100%;
height: $navbar-height;
background-color: $sidebar-logo-background;
cursor: pointer;
.title {
flex-shrink: 0;

View File

@ -191,6 +191,9 @@ watch(route, () => {
margin-left: 0;
}
}
:deep(.el-backtop .svg-icon) {
margin-right: 0;
}
.layout-mix {
.sidebar-container {

View File

@ -22,7 +22,8 @@ service.interceptors.request.use(
} else {
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;
},
(error) => Promise.reject(error)

View File

@ -59,7 +59,7 @@ class WebSocketManager {
this.sendMessage(this.initParams);
this.clearTimer();
this.timer = setInterval(() => {
this.sendMessage({ type: "ping_interval", set: 'manage' });
this.sendMessage({ type: "ping_interval", set: 'manage' }, false);
}, 1000 * 10);
};
@ -108,7 +108,7 @@ class WebSocketManager {
this.autoConnect = true
}
public sendMessage(message: any) {
public sendMessage(message: any, isSendInitParams: boolean = true) {
if (!this.client || !this.connected) {
// ElMessage.error('发送失败,已重新连接,请重新操作');
this.reconnect();
@ -118,7 +118,7 @@ class WebSocketManager {
this.disconnect();
return
}
const msg = JSON.stringify({ ...this.initParams, ...message });
const msg = JSON.stringify(isSendInitParams ? { ...this.initParams, ...message } : message);
try {
this.client?.send(msg);
} catch (error) {

View File

@ -15,10 +15,13 @@
<el-form-item label="桌型">
<div style="width: 100%">
<div>
<el-button type="primary" @click="
showLocation = true;
title = '新增';
">
<el-button
type="primary"
@click="
showLocation = true;
title = '新增';
"
>
添加
</el-button>
</div>
@ -45,11 +48,21 @@
<h2>通知模板</h2>
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
<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 label="排队即将排到通知">
<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>前面等待</div>
<el-input v-model="form.nearNum" placeholder="" disabled></el-input>
@ -58,7 +71,12 @@
</div>
</el-form-item>
<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>
@ -89,10 +107,18 @@
<el-input v-model="forms.start" placeholder="请输入开始号码"></el-input>
</el-form-item>
<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 label="过号保留">
<el-input v-model="forms.postponeNum" :disabled="!forms.isPostpone" placeholder="请输入名称">
<el-input
v-model="forms.postponeNum"
:disabled="!forms.isPostpone"
placeholder="请输入名称"
>
<template #prepend>
<div>
<span><el-checkbox v-model="forms.isPostpone">开启顺延</el-checkbox></span>
@ -105,10 +131,13 @@
<el-form-item label="" width="120">
<template v-slot="scope">
<div style="display: flex; gap: 10px">
<el-button plain @click="
showLocation = false;
forms = {};
">
<el-button
plain
@click="
showLocation = false;
forms = {};
"
>
取消
</el-button>
<el-button type="primary" @click="submitE">确定</el-button>
@ -189,13 +218,13 @@ export default {
const res = await callTableApi.deleteTable({
callTableId: item.id,
});
console.log(res, '挑食 ');
console.log(res, "挑食 ");
if (res) {
this.init();
ElSubMenu.success("删除成功");
}
})
.catch(() => { });
.catch(() => {});
},
async submitE() {
if (this.title == "新增") {
@ -220,6 +249,9 @@ export default {
}
this.forms = {};
},
async uploadChange() {
const res = await callTableApi.editConfig({ bgCover: this.form.bgCover });
},
async init() {
try {
const res = await callTableApi.getConfig();
@ -229,7 +261,7 @@ export default {
size: 10,
});
this.formtable = data;
} catch (error) { }
} catch (error) {}
},
//
submitHandle() {
@ -248,7 +280,7 @@ export default {
message: "提交成功",
type: "success",
});
} catch (error) { }
} catch (error) {}
}
});
},
@ -263,7 +295,7 @@ export default {
handleBeforeRemove(file, fileList) {
for (let i = 0; i < this.files.length; i++) {
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;
}
}
@ -368,12 +400,12 @@ export default {
display: flex;
align-items: center;
>input {
> input {
width: 120px;
border: none !important;
}
>div {
> div {
color: #999;
width: 118px;
height: 33px;

View File

@ -53,7 +53,7 @@
</div>
<div class="u-flex" style="flex-wrap: wrap">
<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>
<div class="time_wrap u-flex" style="flex-shrink: 0">
<el-radio-group v-model="timeValue" class="m-r-5" @change="timeChange">
@ -338,6 +338,7 @@
<script>
import dataSummaryApi from "@/api/order/data-summary";
import ShopApi from "@/api/account/shop";
import dayjs from "dayjs";
import * as echarts from "echarts";
import { debounce, formatDecimal } from "@/utils/tools";
@ -389,7 +390,7 @@ export default {
saveAmount: null,
},
],
storeList: [{ label: "门店1", value: 1 }],
branchList: [],
storeId: null,
trade: {},
formatDecimal,
@ -481,9 +482,14 @@ export default {
// }
}, 100);
window.addEventListener("resize", this.__resizeHandler);
this.geiShopList()
// this.initCardUserChart();
},
methods: {
async geiShopList() {
let res = await ShopApi.getBranchList()
this.branchList = res;
},
//
timeChange(e) {
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];

View File

@ -13,7 +13,7 @@
<el-form-item>
<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-form-item>
<el-form-item>
@ -182,7 +182,7 @@ export default {
downloadLoading: false,
payCount: "",
payCountTotal: 0,
storeList: [{ label: "门店1", value: 1 }],
branchList: [],
storeId: null,
};
},
@ -195,8 +195,16 @@ export default {
this.resetQuery = { ...this.query };
this.getTableData();
this.getCategory();
this.geiShopList();
},
methods: {
/**
* 获取分店列表
*/
async geiShopList() {
let res = await ShopApi.getBranchList()
this.branchList = res;
},
totalfilter(item, d) {
let num = item + d;
return num.toFixed(2);

View File

@ -12,28 +12,30 @@
<el-col :span="16">
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button type="primary" @click="getTableData" plain>批量付款</el-button>
<el-text tag="b" size="large" style="margin-left: 15px;">供应商供应商名称</el-text>
<el-button type="primary" @click="handlePayment('all')" plain>批量付款</el-button>
<el-text tag="b" size="large" style="margin-left: 15px;">供应商{{ state.supplierName }}</el-text>
</el-col>
</el-row>
</el-card>
</div>
<div class="head-container">
<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 label="耗材信息">
<template v-slot="scope">
<div>{{ scope.row.shopName }}{{ scope.row.shopName }}</div>
<div>账号{{ scope.row.shopName }}</div>
<div>联系电话{{ scope.row.phone }}</div>
<div>{{ scope.row.conName }}</div>
<div>单价{{ scope.row.purchasePrice }}</div>
<div>入库数量{{ scope.row.inOutNumber }}</div>
</template>
</el-table-column>
<el-table-column prop="status" label="账单金额" width="120" />
<el-table-column prop="status" label="已付款金额" width="120" />
<el-table-column prop="status" label="未付款金额" width="120" />
<el-table-column prop="status" label="创建时间" width="120" />
<el-table-column prop="createdAt" label="备注" />
<el-table-column prop="amountPayable" label="账单金额" width="120" />
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="120" />
<el-table-column prop="unPaidAmount" label="未付款金额" width="120" />
<el-table-column prop="createTime" label="创建时间" width="120" />
<el-table-column prop="remark" label="备注" />
<el-table-column label="操作" width="200">
<template v-slot="scope">
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
@ -58,9 +60,9 @@
</template>
<script setup>
import ShopApi from "@/api/account/shop";
import { ElMessageBox } from "element-plus";
import AuthAPI from "@/api/supplier/index";
import payment from "./components/payment.vue";
import { ElMessage } from "element-plus";
const route = useRoute();
const router = useRouter();
@ -68,6 +70,7 @@ const router = useRouter();
const state = reactive({
query: {
name: "",
vendorId: null,
},
tableData: {
list: [],
@ -76,23 +79,28 @@ const state = reactive({
loading: false,
total: 0,
},
supplierName: '',
flowIdList: [],
allAmount: 0
});
onMounted(() => {
console.log(route.query);
if (route.query.id) {
if (route.query.vendorId) {
state.query.vendorId = route.query.vendorId
}
if (route.query.supplierName) {
state.supplierName = route.query.supplierName
}
getTableData();
});
//
//
async function getTableData() {
state.tableData.loading = true;
try {
const res = await ShopApi.getList({
const res = await AuthAPI.getRecordList({
page: state.tableData.page,
size: state.tableData.size,
shopName: state.query.name,
account: state.query.account,
status: state.query.status,
key: state.query.name,
vendorId: state.query.vendorId,
});
state.tableData.loading = false;
state.tableData.list = res.records;
@ -103,11 +111,28 @@ async function getTableData() {
}
const refPayment = ref();
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) {
router.push({ name: "financePaymentRecord", query: { id: id } });
router.push({ name: "financePaymentRecord", query: { id: id, supplierName: state.supplierName } });
}

View File

@ -2,17 +2,18 @@
<!-- 修改和增加 -->
<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-item label="供应商" prop="conName">
<el-input v-model="form.conName" placeholder="请输入供应商名称"></el-input>
<el-form-item label="供应商">
<el-input v-model="supplierName" placeholder="请输入供应商名称" readonly></el-input>
</el-form-item>
<el-form-item label="付款金额 " prop="price">
<el-input-number v-model="form.price" placeholder="请输入付款金额" style="width: 100%;"></el-input-number>
<el-form-item label="付款金额 " prop="amount">
<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 label="付款方式" prop="conName">
<el-input v-model="form.conName" placeholder="请输入付款方式"></el-input>
<el-form-item label="付款方式" prop="type">
<el-input v-model="form.type" placeholder="请输入付款方式"></el-input>
</el-form-item>
<el-form-item label="备注" prop="defaultUnit">
<el-input v-model="form.defaultUnit" placeholder="请输入备注"></el-input>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item style="display: flex; justify-content: flex-end">
<el-button @click="close"> </el-button>
@ -24,33 +25,35 @@
<script setup>
import consApi from "@/api/product/cons";
import AuthAPI from "@/api/supplier/index";
import { ElMessage } from "element-plus";
const emits = defineEmits(["refresh"]);
const rules = {
conName: [{ required: true, message: "请输入耗材名称", trigger: "blur" }],
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
conWarning: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
conUnit: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
type: [{ required: true, message: "请输入付款方式", trigger: "blur" }],
};
const basicForm = {
conName: "",
consGroupId: "",
conUnit: "",
price: undefined,
conWarning: undefined,
flowIdList: [],
amount: undefined,
type: '',
remark: '',
};
const form = reactive({
...basicForm,
});
const supplierName = ref('');
const show = ref(false);
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;
}
@ -61,8 +64,8 @@ const refform = ref();
async function submitForm() {
refform.value.validate(async (valid) => {
if (valid) {
const res = await consApi.add(form);
ElMessage({ type: "success", message: "付款成功" });
const res = await AuthAPI.billPay(form);
ElMessage({ type: "success", message: "付款成功" });
emits("refresh");
close();
}
@ -72,7 +75,7 @@ async function submitForm() {
function reset() {
console.log("reset");
Object.assign(form, basicForm);
console.log(form);
close();
}
defineExpose({
open,

View File

@ -21,16 +21,16 @@
<el-row :gutter="24">
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
<div>账单总金额全部/本月</div>
<div>2000/1000</div>
<div>{{ state.summaryData.amountPayable }} / {{ state.summaryData.mouthAmountPayable }}</div>
</el-col>
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
<div>已付款总金额全部/本月</div>
<div>2000/1000</div>
<div>{{ state.summaryData.actualPaymentAmount }} / {{ state.summaryData.mouthActualPaymentAmount }}</div>
</el-col>
<el-col :span="8" style="display: flex;flex-direction: column; justify-content: center;align-items: center;">
<div>未付款总金额全部/本月</div>
<div>2000/1000</div>
<div>{{ state.summaryData.unPaidAmount }} / {{ state.summaryData.mouthUnPaidAmount }}</div>
</el-col>
</el-row>
</el-card>
@ -38,15 +38,14 @@
<div class="head-container">
<el-card shadow="never">
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
<el-table-column prop="id" label="ID" width="80" />
<el-table-column prop="status" label="供应商" width="220" />
<el-table-column prop="status" label="账单金额" width="160" />
<el-table-column prop="status" label="已付款金额" width="160" />
<el-table-column prop="status" label="未付款金额" width="160" />
<el-table-column prop="createdAt" label="备注" />
<el-table-column prop="name" label="供应商" width="220" />
<el-table-column prop="amountPayable" label="账单金额" width="200" />
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="200" />
<el-table-column prop="unPaidAmount" label="未付款金额" width="200" />
<el-table-column prop="remark" label="备注" />
<el-table-column label="操作" width="120">
<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>
</template>
@ -64,13 +63,14 @@
</template>
<script setup>
import ShopApi from "@/api/account/shop";
import AuthAPI from "@/api/supplier/index";
const router = useRouter();
const state = reactive({
query: {
name: "",
},
summaryData: {},
tableData: {
list: [],
page: 1,
@ -80,18 +80,27 @@ const state = reactive({
},
});
onMounted(() => {
getSummary();
getTableData();
});
//
async function getSummary() {
try {
const res = await AuthAPI.getSummary();
state.summaryData = res;
} catch (error) {
console.log(error);
}
}
//
async function getTableData() {
state.tableData.loading = true;
try {
const res = await ShopApi.getList({
const res = await AuthAPI.getPage({
page: state.tableData.page,
size: state.tableData.size,
shopName: state.query.name,
account: state.query.account,
status: state.query.status,
key: state.query.name,
});
state.tableData.loading = false;
state.tableData.list = res.records;
@ -100,9 +109,9 @@ async function getTableData() {
console.log(error);
}
}
function handleTo(id) {
function handleTo(row) {
// 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 } });
}
//

View File

@ -4,7 +4,7 @@
<el-card shadow="never">
<el-alert title="当前列表仅作为数据记录,不产生任何实际交易。" type="warning" show-icon :closable="false"
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>
</div>
<div class="head-container">
@ -13,20 +13,20 @@
<el-table-column prop="id" label="ID" width="80" />
<el-table-column label="耗材信息">
<template v-slot="scope">
<div>{{ scope.row.shopName }}{{ scope.row.shopName }}</div>
<div>账号{{ scope.row.shopName }}</div>
<div>联系电话{{ scope.row.phone }}</div>
<div>{{ scope.row.conName }}</div>
<div>单价{{ scope.row.purchasePrice }}</div>
<div>入库数量{{ scope.row.inOutNumber }}</div>
</template>
</el-table-column>
<el-table-column prop="status" label="付款金额" width="120" />
<el-table-column prop="status" label="付款方式" width="120" />
<el-table-column prop="createdAt" label="备注" />
<el-table-column prop="status" label="创建时间" />
<el-table-column prop="amount" label="付款金额" width="120" />
<el-table-column prop="type" label="付款方式" width="120" />
<el-table-column prop="remark" label="备注" />
<el-table-column prop="createTime" label="创建时间" />
<el-table-column label="操作人" width="200">
<template v-slot="scope">
<div>员工名称{{ scope.row.shopName }}</div>
<div>员工编号{{ scope.row.shopName }}</div>
<div>员工账号{{ scope.row.phone }}</div>
<div>员工名称{{ scope.row.nickname }}</div>
<div>员工编号{{ scope.row.code }}</div>
<div>员工账号{{ scope.row.account }}</div>
</template>
</el-table-column>
</el-table>
@ -43,12 +43,15 @@
<script setup>
import ShopApi from "@/api/account/shop";
import AuthAPI from "@/api/supplier/index";
import { ElMessageBox } from "element-plus";
const route = useRoute();
const state = reactive({
query: {
name: "",
flowId: null,
},
tableData: {
list: [],
@ -57,23 +60,26 @@ const state = reactive({
loading: false,
total: 0,
},
supplierName: '',
});
onMounted(() => {
console.log(route.query);
if (route.query.id) {
state.query.flowId = route.query.id
}
if (route.query.supplierName) {
state.supplierName = route.query.supplierName
}
getTableData();
});
//
//
async function getTableData() {
state.tableData.loading = true;
try {
const res = await ShopApi.getList({
const res = await AuthAPI.getPayRecordList({
page: state.tableData.page,
size: state.tableData.size,
shopName: state.query.name,
account: state.query.account,
status: state.query.status,
flowId: state.query.flowId,
});
state.tableData.loading = false;
state.tableData.list = res.records;

View File

@ -202,6 +202,8 @@ function handleLogin() {
userStore.meituan_douyin_info = checkInfo.userInfo;
setDouyinToken(checkInfo.userInfo.token);
});
localStorage.removeItem("shopName")
await userStore.getUserInfo();
const { path, queryParams } = parseRedirect();

View File

@ -149,7 +149,9 @@
<el-radio-group v-model="forms.sortMode">
<el-radio value="0" 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-form-item>
<el-form-item label="分组排序">
@ -213,7 +215,7 @@ let forms = reactive({
name: "",
status: 1,
useTime: 0,
sortMode: 0,
sortMode: '0',
sort: 1,
time: ""
})
@ -331,7 +333,7 @@ function handleToolbarClick(name: string) {
name: "",
status: 1,
useTime: 0,
sortMode: 0,
sortMode: '0',
sort: 1,
time: ""
})

View File

@ -73,9 +73,11 @@ const modalConfig: IModalConfig<UserForm> = {
prop: "sortMode",
type: "radio",
options: [
{ label: "默认", value: 0 },
{ label: "价格由高到低", value: 1 },
{ label: "销量由高到低", value: 2 },
{ label: "默认", value: '0' },
{ label: "价格由高到低", value: '1' },
{ label: "价格由低到高", value: '2' },
{ label: "销量由高到低", value: '3' },
{ label: "销量由低到高", value: '4' },
],
initialValue: 0,
},

View File

@ -28,7 +28,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
// importTemplate: UserAPI.downloadTemplate,
modifyAction: function (params) {
let obj = { ...params }
return UserAPI.update(obj);
return UserAPI.updates(obj);
},
importsAction(data) {
// 模拟导入数据

View File

@ -80,7 +80,9 @@ const modalConfig: IModalConfig<UserForm> = {
options: [
{ label: "默认", value: '0' },
{ label: "价格由高到低", value: '1' },
{ label: "销量由高到低", value: '2' },
{ label: "价格由低到高", value: '2' },
{ label: "销量由高到低", value: '3' },
{ label: "销量由低到高", value: '4' },
],
initialValue: '0',
},

View File

@ -100,17 +100,20 @@
</div>
</div>
<div class="row">
<div>支付方式{{ returnPayType(detail.payType) }}</div>
<div>
退款金额{{ detail.refundAmount }}
<span
<!-- <span
style="color: #ff9731; cursor: pointer"
v-if="detail.isRefund"
@click="type = '3'"
>
退款详情>
</span>
</span> -->
</div>
<div>支付方式{{ returnPayType(detail.payType) }}</div>
<div class="color-red">退款方式{{ detail.refundType }}</div>
<div></div>
<div></div>
</div>
</div>
</div>

View File

@ -23,8 +23,7 @@ const contentConfig: IContentConfig = {
}
return OrderApi.getList(params);
},
indexActionData: {
},
indexActionData: {},
// deleteAction: OrderApi.delete,
// modifyAction: function (data) {
// // return OrderApi.edit(data);
@ -46,28 +45,30 @@ const contentConfig: IContentConfig = {
label: "订单号信息",
align: "center",
prop: "orderNo",
templet: "custom",
slotName: "orderNo",
},
{
label: "商品信息",
align: "center",
templet: 'custom',
prop: 'goods',
slotName: 'goods',
templet: "custom",
prop: "goods",
slotName: "goods",
width: 240,
},
{
label: "台桌信息",
align: "center",
templet: 'custom',
slotName: 'table',
templet: "custom",
slotName: "table",
width: 150,
},
{
label: "订单原金额 不含折扣价格",
align: "center",
prop: "originAmount",
templet: 'custom',
slotName: 'originAmount',
templet: "custom",
slotName: "originAmount",
width: 120,
hidden: true,
},
@ -117,7 +118,7 @@ const contentConfig: IContentConfig = {
fixed: "right",
width: 150,
templet: "custom",
slotName: 'operate'
slotName: "operate",
},
],
};

View File

@ -5,9 +5,9 @@
<page-search
ref="searchRef"
:search-config="searchConfig"
:isOpenAutoSearch="true"
@query-click="handleQueryClick"
@reset-click="handleResetClick"
:isOpenAutoSearch="true"
/>
<!-- 列表 -->
<page-content
@ -24,6 +24,20 @@
<template #originAmount="scope">
{{ returnOriginAmount(scope.row) }}
</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">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@ -31,16 +45,16 @@
</template>
<template #goods="scope">
<div class="goods_info">
<div class="row" v-for="item in scope.row.goods" :key="item.id">
<el-image :src="item.productImg" class="cover" lazy></el-image>
<div v-for="item in scope.row.goods" :key="item.id" class="row">
<el-image :src="item.productImg" class="cover" lazy />
<div class="info">
<div class="name">
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
{{ item.productName }}
</span>
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
<span v-if="item.refundNum" class="refund">(退 - {{ item.refundNum }})</span>
</div>
<div class="sku">{{ item.productSkuName }}</div>
<div class="sku">{{ item.skuName }}</div>
</div>
</div>
</div>
@ -49,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>
@ -73,12 +87,12 @@
</template>
<template #operate="scope">
<div>
<el-button @click="showdetail(scope.row)" link>详情</el-button>
<el-button link v-if="scope.row.status == 'done'">开票</el-button>
<el-button link @click="showdetail(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 'done'" link>开票</el-button>
<el-button
v-if="scope.row.status == 'unpaid'"
@click="toPayOrder(scope.row)"
type="primary"
@click="toPayOrder(scope.row)"
>
结账
</el-button>
@ -106,7 +120,7 @@
</template>
</page-modal>
<orderDetail ref="refDetail" @close="refresh"></orderDetail>
<orderDetail ref="refDetail" @close="refresh" />
</div>
</template>
@ -317,7 +331,9 @@ function showdetail(row: OrderInfoVo) {
.goods_info {
.row {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&:not(:first-child) {
margin-top: 10px;
}
@ -331,8 +347,7 @@ function showdetail(row: OrderInfoVo) {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 10px;
margin-top: 2px;
.sku {
color: #999;
}

View File

@ -7,39 +7,73 @@
@reset-click="handleResetClick" /> -->
<!-- 列表 -->
<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">
<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 #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
</el-tag>
</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">
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
</template>
<template #mobile="scope">
<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>
</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">
<Dict v-model="scope.formData[scope.prop]" code="gender" />
</template>
</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">
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
</template>
</page-modal>
</template>
<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">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@ -96,7 +130,6 @@ async function handleEditClick(row: IObject) {
const data = await UserAPI.getunitinfo(row.id);
editModalRef.value?.setFormData(data);
editModalRef.value?.setModalVisible();
}
//
function handleToolbarClick(name: string) {

View File

@ -26,8 +26,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
// },
// exportAction: UserAPI.export,
modifyAction: function (params) {
console.log(1111112222222222222)
let obj = { sort: "1", ...params }
console.log(1111112222222222222);
let obj = { sort: "1", ...params };
return UserAPI.update(obj);
},
@ -44,13 +44,17 @@ const contentConfig: IContentConfig<UserPageQuery> = {
// return res.list;
// },
pk: "id",
toolbar: [
"add",
],
toolbar: ["add"],
cols: [
// { type: "selection", width: 50, align: "center" },
{ label: "分类名称", align: "center", prop: "name" },
{ label: "分类图片", align: "center", prop: "pic", templet: "image" },
{
label: "分类图片",
align: "center",
prop: "pic",
slotName: "slotNameimage",
templet: "custom",
},
{
label: "状态",
align: "center",

View File

@ -737,7 +737,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
ruleForm.proGroupVo.forEach((item: any) => {
})
if (selectTitle) {
ElMessage.error('请填写标题和几选几')
ElMessage.error('请填写组名和几选几')
return
}
//
@ -768,7 +768,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}
})
if (selectTitle) {
ElMessage.error('请填写标题和几选几')
ElMessage.error('请填写组名和几选几')
return
}
}

View File

@ -10,6 +10,12 @@
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
<template #deptName="scope">
<div style="display: inline-block;width: 50px;">
{{ scope.row.name }}
</div>
<!-- <el-text></el-text> -->
</template>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}

View File

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

View File

@ -7,8 +7,14 @@
<el-input v-model="state.query.name" clearable placeholder="请输入分店名称" style="width: 100%" class="filter-item"
@keyup.enter="getTableData" />
</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 @click="resetHandle">重置</el-button>
</el-col>
@ -19,41 +25,42 @@
<el-card shadow="never">
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
<el-table-column prop="status" label="ID" width="80" />
<el-table-column label="店铺信息" >
<el-table-column label="店铺信息">
<template v-slot="scope">
<div>{{ scope.row.shopName }}{{ scope.row.shopName }}</div>
<div>账号{{ scope.row.shopName }}</div>
<div>账号{{ scope.row.account }}</div>
<div>联系电话{{ scope.row.phone }}</div>
</template>
</el-table-column>
<el-table-column prop="status" label="商品同步" width="120">
<el-table-column prop="isEnableProdSync" label="商品同步" width="120">
<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>
</el-table-column>
<el-table-column prop="status" label="会员同步" width="120">
<el-table-column prop="isEnableVipSync" label="会员同步" width="120">
<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>
</el-table-column>
<el-table-column prop="status" label="耗材同步" width="120">
<el-table-column prop="isEnableConsSync" label="耗材同步" width="120">
<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>
</el-table-column>
<el-table-column prop="status" label="账号状态" width="120">
<el-table-column prop="isAllowAccountLogin" label="账号状态" width="120">
<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>
</el-table-column>
<el-table-column prop="createdAt" label="备注" />
<el-table-column label="操作" width="200">
<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 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>
</template>
</el-table-column>
@ -71,22 +78,19 @@
<script setup>
import dayjs from "dayjs";
import ShopApi from "@/api/account/shop";
import ShopBranchApi from "@/api/account/shopBranch";
import { ElNotification, ElMessageBox } from "element-plus";
const state = reactive({
query: {
name: "",
},
par: {
dataSyncMethod: '',
},
status: [
{
type: 1,
label: "开启",
},
{
type: 0,
label: "关闭",
},
{ type: 'auto', label: "实时自动同步", },
{ type: 'manual', label: "手动同步", }
],
tableData: {
list: [],
@ -99,15 +103,14 @@ const state = reactive({
onMounted(() => {
getTableData();
});
//
//
async function getTableData() {
state.tableData.loading = true;
try {
const res = await ShopApi.getList({
const res = await ShopBranchApi.getList({
page: state.tableData.page,
size: state.tableData.size,
shopName: state.query.name,
account: state.query.account,
status: state.query.status,
});
state.tableData.loading = false;
@ -117,6 +120,16 @@ async function getTableData() {
console.log(error);
}
}
//
async function setDataSync() {
await ShopBranchApi.setDataSync(state.par.dataSyncMethod);
ElMessage({
type: "success",
message: "设置成功",
});
}
//
function handleSync(e) {
console.log(e)
ElMessageBox.confirm(`同步功能开启后不能关闭,请确认是否给${e.shopName}开启同步?`, "提示", {
@ -124,7 +137,7 @@ function handleSync(e) {
cancelButtonText: "取消",
type: "warning",
}).then(async () => {
const res = await ShopApi.delete({ id: row.id });
await ShopBranchApi.dataSync(e.id)
ElMessage({
type: "success",
message: "同步成功",
@ -132,6 +145,17 @@ function handleSync(e) {
getTableData();
}).catch(() => { });
}
// /
async function handleAccount(row) {
if (row.isAllowAccountLogin) {
await ShopBranchApi.disable(row.id);
} else {
await ShopBranchApi.enable(row.id);
}
getTableData();
}
//
function resetHandle() {
state.query.name = "";

View File

@ -13,13 +13,13 @@
</el-radio-group>
<div class="tips">请谨慎修改</div>
</el-form-item>
<el-form-item label="是否为主店" prop="isMainStore">
<el-radio-group v-model="state.form.isMainStore" @change=" state.form.mainId = ''">
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isMainStore == '0'">
<el-form-item label="是否为主店" prop="isHeadShop">
<el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''">
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
<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-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
:remote-method="getTableData" :loading="state.shopListLoading">
@ -208,7 +208,7 @@ const state = reactive({
cities: "",
districts: "",
chainName: "",
isMainStore: '0',
isHeadShop: '0',
},
resetForm: "",
rules: {
@ -226,7 +226,7 @@ const state = reactive({
trigger: "blur",
},
],
isMainStore: [
isHeadShop: [
{
required: true,
message: " ",
@ -354,6 +354,7 @@ function submitHandle() {
type: "success",
});
close();
location.reload()
} catch (error) {
state.formLoading = false;
console.log(error);
@ -528,4 +529,4 @@ defineExpose({
.amap-sug-result {
z-index: 2000;
}
</style>
</style>

View File

@ -68,7 +68,7 @@
<template v-slot="scope">
<div>
<span>{{ scope.row.shopName }}</span>
<div>(主店)</div>
<div>(主店{{ scope.row.headShopName }})</div>
</div>
</template>
</el-table-column>

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import type { ISearchConfig } from "@/components/CURD/types";
import { paramTypeOptions } from './config'
import UserAPI from "@/api/product/productclassification";
import ShopApi from "@/api/account/shop";
const searchConfig: ISearchConfig = {
@ -19,7 +20,17 @@ const searchConfig: ISearchConfig = {
},
options: [],
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
},
},
{

View File

@ -44,11 +44,20 @@
<!-- 新增 -->
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<template #formFooter>
<selectPermission
v-model="selPermissionList"
:list="permissionList"
ref="refSelectPermission"
></selectPermission>
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
<div>
<el-checkbox-group v-model="addPagePathIdList">
<el-checkbox
v-for="(item, index) in pagePathIdLists"
:key="index"
:value="item.value"
:label="item.label"
/>
</el-checkbox-group>
</div>
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
<selectPermission v-model="addSelPermissionList" :list="permissionList"></selectPermission>
</template>
</page-modal>
@ -59,11 +68,20 @@
@submit-click="handleSubmitClick"
>
<template #formFooter>
<selectPermission
v-model="selPermissionList"
:list="permissionList"
ref="refSelectPermission"
></selectPermission>
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
<div>
<el-checkbox-group v-model="editPagePathIdList">
<el-checkbox
v-for="(item, index) in pagePathIdLists"
:key="index"
:value="item.value"
:label="item.label"
/>
</el-checkbox-group>
</div>
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
<selectPermission v-model="selPermissionList" :list="permissionList"></selectPermission>
</template>
</page-modal>
@ -85,7 +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,
@ -105,30 +123,45 @@ const {
//
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() {
//
const oldAddSubmitFunc = addModalConfig.formAction;
addModalConfig.formAction = (data) => {
return oldAddSubmitFunc({
addModalConfig.formAction = function (data) {
return ShopStaffApi.add({
...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[]),
});
};
//
const oldeditSubmitFunc = editModalConfig.formAction;
editModalConfig.formAction = (data) => {
return oldeditSubmitFunc({
editModalConfig.formAction = function (data) {
return ShopStaffApi.edit({
...data,
pagePathIdList: editPagePathIdList.value,
shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => {
return pre.concat(cur);
}, [] as string[]),
});
};
const res = await RoleApi.getList({ page: 1, size: 100 });
const permission = await permissionApi.getshopPermission();
permissionList.value = Array.isArray(permission) ? permission : [];
@ -141,6 +174,15 @@ 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,
};
});
addPagePathIdList.value = pagePathIdLists.value.map((v) => v.id);
}
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
await ShopStaffApi.get(row.id).then((res) => {
console.log(res);
editModalRef.value?.setFormData({ ...res });
});
}
1;
//
function handleToolbarClick(name: string) {
console.log(name);