Compare commits
13 Commits
e3ddd70ce6
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 75e46ec6dd | |||
| c87c999d42 | |||
| f648a7ea5e | |||
| 0ab8852656 | |||
| 03883e1b26 | |||
| b9308c1f21 | |||
| be12089ffe | |||
| e5cdf0a3dc | |||
| 51812fb0cc | |||
| 6e39a94f01 | |||
| d6a33aea3b | |||
| 397f4b2bcf | |||
| 2f2a152b46 |
@@ -72,7 +72,7 @@ const AuthAPI = {
|
||||
});
|
||||
},
|
||||
|
||||
// 耗材列表
|
||||
// 耗材列表分页
|
||||
productcons(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `/product/admin/product/cons/page`,
|
||||
@@ -80,7 +80,14 @@ const AuthAPI = {
|
||||
params
|
||||
});
|
||||
},
|
||||
|
||||
// 耗材列表
|
||||
productconsList(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `/product/admin/product/cons/list`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
// 上下架
|
||||
onOff(data: any) {
|
||||
return request<any, Responseres>({
|
||||
|
||||
BIN
src/assets/index_bg.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
src/assets/index_quick1.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
src/assets/index_quick2.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
src/assets/index_quick3.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/index_quick4.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
src/assets/index_quick5.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
src/assets/index_quick6.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
@@ -24,61 +24,17 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
},
|
||||
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: "/index",
|
||||
meta: {
|
||||
title: "数据中心",
|
||||
icon: "数据统计",
|
||||
alwaysShow: true,
|
||||
},
|
||||
redirect: '/index',
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: () => import("@/views/data/index.vue"),
|
||||
name: "",
|
||||
path: 'index',
|
||||
component: () => import('@/views/index/index.vue'),
|
||||
name: 'index',
|
||||
meta: {
|
||||
title: "经营数据",
|
||||
affix: false,
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "sales",
|
||||
name: "",
|
||||
component: () => import("@/views/data/sales.vue"),
|
||||
meta: {
|
||||
title: "销售统计",
|
||||
affix: false,
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "table",
|
||||
name: "",
|
||||
component: () => import("@/views/data/table.vue"),
|
||||
meta: {
|
||||
title: "台桌统计",
|
||||
affix: false,
|
||||
keepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "finance",
|
||||
name: "",
|
||||
component: () => import("@/views/data/finance.vue"),
|
||||
meta: {
|
||||
title: "财务报表"
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "work",
|
||||
name: "workStatistics",
|
||||
component: () => import("@/views/data/work.vue"),
|
||||
meta: {
|
||||
title: "收银交班记录",
|
||||
affix: false,
|
||||
keepAlive: true,
|
||||
title: '首页',
|
||||
icon: 'homepage',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -91,9 +47,79 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
component: () => import("@/views/error/404.vue"),
|
||||
meta: { hidden: true },
|
||||
},
|
||||
],
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: "/",
|
||||
// component: Layout,
|
||||
// redirect: "/index",
|
||||
// meta: {
|
||||
// title: "数据中心",
|
||||
// icon: "数据统计",
|
||||
// alwaysShow: true,
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: "index",
|
||||
// component: () => import("@/views/data/index.vue"),
|
||||
// name: "",
|
||||
// meta: {
|
||||
// title: "经营数据",
|
||||
// affix: false,
|
||||
// keepAlive: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "sales",
|
||||
// name: "",
|
||||
// component: () => import("@/views/data/sales.vue"),
|
||||
// meta: {
|
||||
// title: "销售统计",
|
||||
// affix: false,
|
||||
// keepAlive: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "table",
|
||||
// name: "",
|
||||
// component: () => import("@/views/data/table.vue"),
|
||||
// meta: {
|
||||
// title: "台桌统计",
|
||||
// affix: false,
|
||||
// keepAlive: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "finance",
|
||||
// name: "",
|
||||
// component: () => import("@/views/data/finance.vue"),
|
||||
// meta: {
|
||||
// title: "财务报表"
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "work",
|
||||
// name: "workStatistics",
|
||||
// component: () => import("@/views/data/work.vue"),
|
||||
// meta: {
|
||||
// title: "收银交班记录",
|
||||
// affix: false,
|
||||
// keepAlive: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "401",
|
||||
// component: () => import("@/views/error/401.vue"),
|
||||
// meta: { hidden: true },
|
||||
// },
|
||||
// {
|
||||
// path: "404",
|
||||
// component: () => import("@/views/error/404.vue"),
|
||||
// meta: { hidden: true },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: "/shop",
|
||||
// component: Layout,
|
||||
// meta: {
|
||||
|
||||
@@ -226,9 +226,27 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
const isLinkFinshed = ref(false);
|
||||
|
||||
// 当前购物车数据(现在 getAllGoodsList 能直接访问)
|
||||
const list = useStorage<any[]>("carts", []);
|
||||
// 历史订单数据(现在 getAllGoodsList 能直接访问),不从本地缓存获取,改为从接口获取
|
||||
const oldOrder = ref<any>({
|
||||
const list = useStorage<any[]>(
|
||||
"carts",
|
||||
[],
|
||||
localStorage,
|
||||
{
|
||||
serializer: {
|
||||
read: (rawValue) => {
|
||||
// 没有值时直接返回默认空数组
|
||||
if (!rawValue) return []
|
||||
try {
|
||||
return JSON.parse(rawValue)
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
},
|
||||
write: (value) => JSON.stringify(value),
|
||||
},
|
||||
}
|
||||
)
|
||||
// 历史订单数据(现在 getAllGoodsList 能直接访问)
|
||||
const oldOrder = useStorage<any>("Instead_olold_order", {
|
||||
detailMap: [],
|
||||
originAmount: 0
|
||||
});
|
||||
|
||||
@@ -163,7 +163,6 @@ const modalConfig: IModalConfig<editRequest> = {
|
||||
options: options.printType,
|
||||
initialValue: options.printType.map(v => v.value)
|
||||
},
|
||||
|
||||
{
|
||||
label: "打印机状态",
|
||||
prop: "status",
|
||||
@@ -174,6 +173,16 @@ const modalConfig: IModalConfig<editRequest> = {
|
||||
inactiveValue: 0,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "媒体音开关",
|
||||
prop: "volumeSwitch",
|
||||
type: "switch",
|
||||
initialValue: 1,
|
||||
attrs: {
|
||||
activeValue: 1,
|
||||
inactiveValue: 0,
|
||||
}
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,112 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Index</h1>
|
||||
<div class="gyq_container">
|
||||
<div class="item_wrap">
|
||||
<div class="title">您好,欢迎登录</div>
|
||||
<div class="item_list">
|
||||
<div class="item" v-for="(item, index) in quickStore.quickMenus.splice(0, 6)" :key="item.id"
|
||||
@click="menuClick(item.menuId)">
|
||||
<img class="icon" :src="icons[index + 1]" alt="">
|
||||
{{ returnMenuName(item.menuId) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, nextTick } from "vue";
|
||||
import { useQuickStore, usePermissionStore, useUserStore } from "@/store";
|
||||
|
||||
import icon1 from "@/assets/index_quick1.png";
|
||||
import icon2 from "@/assets/index_quick2.png";
|
||||
import icon3 from "@/assets/index_quick3.png";
|
||||
import icon4 from "@/assets/index_quick4.png";
|
||||
import icon5 from "@/assets/index_quick5.png";
|
||||
import icon6 from "@/assets/index_quick6.png";
|
||||
|
||||
const icons = {
|
||||
1: icon1,
|
||||
2: icon2,
|
||||
3: icon3,
|
||||
4: icon4,
|
||||
5: icon5,
|
||||
6: icon6,
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
const quickStore = useQuickStore();
|
||||
const permissionStore = usePermissionStore();
|
||||
|
||||
function returnMenuName(menuId) {
|
||||
return permissionStore.returnMenuName(menuId);
|
||||
}
|
||||
|
||||
function menuClick(menuId) {
|
||||
permissionStore.menuJump(menuId);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick();
|
||||
console.log('quickStore.quickMenus', quickStore.quickMenus);
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gyq_container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('@/assets/index_bg.png') no-repeat center center / cover;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.item_wrap {
|
||||
padding-left: 300px;
|
||||
|
||||
.title {
|
||||
font-size: 40px;
|
||||
margin-bottom: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.item_list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(2, 1fr);
|
||||
grid-column-gap: 90px;
|
||||
grid-row-gap: 90px;
|
||||
|
||||
.item {
|
||||
width: 152px;
|
||||
height: 83px;
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(115deg, #9EC4FF 5.9%, #6668E8 111.62%);
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
padding-left: 30px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
.icon {
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
left: -30px;
|
||||
top: -20px;
|
||||
width: 83px;
|
||||
height: 78px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -74,12 +74,19 @@ const accountList = reactive([
|
||||
{ username: "19107220837", type: 'danger', label: '快乐时光店铺' },
|
||||
// { username: "18199991111", type: 'success', label: '草莓加盟主店可直接管理' },
|
||||
{ username: "18821670757", type: 'success', label: '高歌的小店' },
|
||||
{ username: "18821670757", staffUserName: '18821670758', type: 'primary', label: '高歌的小店的员工-张三' },
|
||||
{ username: "191123456", type: 'primary', label: '酸橘子' },
|
||||
]);
|
||||
|
||||
// 快捷模拟登录
|
||||
function accountHandle(item) {
|
||||
state.loginForm.username = item.username;
|
||||
if (item.staffUserName) {
|
||||
state.loginForm.loginType = 1
|
||||
state.loginForm.staffUserName = item.staffUserName
|
||||
} else {
|
||||
state.loginForm.loginType = 0
|
||||
}
|
||||
state.loginForm.code = 666666
|
||||
const d = new Date();
|
||||
state.loginForm.password = `czg${d.getHours().toString().padStart(2, '0')}${d.getMinutes().toString().padStart(2, '0')}`;
|
||||
|
||||
@@ -116,7 +116,11 @@
|
||||
退款详情>
|
||||
</span> -->
|
||||
</div>
|
||||
<div class="color-red">退款方式:{{ detail.refundType }}</div>
|
||||
<div class="color-red">
|
||||
<span v-if="detail.refundType">
|
||||
退款方式:{{ detail.refundType === "cash" ? "现金退款" : "原路退回" }}
|
||||
</span>
|
||||
</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
@@ -2,14 +2,26 @@
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="newHandleQueryClick"
|
||||
@reset-click="handleResetClick2" />
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="newHandleQueryClick"
|
||||
@reset-click="handleResetClick2"
|
||||
/>
|
||||
<!-- 顶部数据 -->
|
||||
<Statistics :data="gongjiData"></Statistics>
|
||||
<!-- 列表 -->
|
||||
<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 ? "启用" : "禁用" }}
|
||||
@@ -25,11 +37,22 @@
|
||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||
</template>
|
||||
<template #shangjia="scope">
|
||||
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchChange(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template #isStock="scope">
|
||||
<el-switch disabled v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<el-switch
|
||||
v-if="!scope.row.productId"
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
:disabled="!scope.row.type"
|
||||
@click="isStockChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
|
||||
<template #kucunedit="scope">
|
||||
@@ -42,16 +65,29 @@
|
||||
</template>
|
||||
|
||||
<template #tuikuantuihui="scope">
|
||||
<el-switch v-if="!scope.row.productId" v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchhaocai(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-if="!scope.row.productId"
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchhaocai(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template #sellOut="scope">
|
||||
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchChangeTwo(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchChangeTwo(scope.row)"
|
||||
></el-switch>
|
||||
</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>
|
||||
<template #consumables="scope">
|
||||
<template v-if="scope.row.type != null">
|
||||
@@ -74,7 +110,11 @@
|
||||
</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>
|
||||
@@ -121,16 +161,31 @@
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="耗材名称" prop="consInfoId">
|
||||
<template v-slot="scope">
|
||||
<el-select v-model="scope.row.consInfoId" reserve-keyword placeholder="请输入关键词"
|
||||
@change="selectionChange($event, scope.row)">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.conName" :value="item.id"></el-option>
|
||||
<el-select
|
||||
filterable
|
||||
v-model="scope.row.consInfoId"
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词"
|
||||
@change="selectionChange($event, scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id * 1"
|
||||
:label="item.conName"
|
||||
:value="item.id * 1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="conUnit">
|
||||
<template v-slot="scope">
|
||||
<el-input v-model="scope.row.conUnit" readonly disabled placeholder="请选择耗材"></el-input>
|
||||
<el-input
|
||||
v-model="scope.row.conUnit"
|
||||
readonly
|
||||
disabled
|
||||
placeholder="请选择耗材"
|
||||
></el-input>
|
||||
<!-- <el-select v-model="scope.row.conUnit" reserve-keyword placeholder="请输入关键词">
|
||||
<el-option
|
||||
v-for="item in returnConUnits(scope.row.consInfoId)"
|
||||
@@ -149,13 +204,20 @@
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="scope">
|
||||
<div class="table_btn_wrap">
|
||||
<div class="btn sub" v-if="haocaiData.consList.length > 1"
|
||||
@click="haocaiData.consList.splice(scope.$index, 1)">
|
||||
<div
|
||||
class="btn sub"
|
||||
v-if="haocaiData.consList.length > 1"
|
||||
@click="haocaiData.consList.splice(scope.$index, 1)"
|
||||
>
|
||||
<el-icon>
|
||||
<RemoveFilled />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="btn add" v-if="scope.$index == haocaiData.consList.length - 1" @click="createItem(scope.row)">
|
||||
<div
|
||||
class="btn add"
|
||||
v-if="scope.$index == haocaiData.consList.length - 1"
|
||||
@click="createItem(scope.row)"
|
||||
>
|
||||
<el-icon>
|
||||
<CirclePlusFilled />
|
||||
</el-icon>
|
||||
@@ -255,8 +317,8 @@ onMounted(async () => {
|
||||
// 获取耗材列表
|
||||
gethaocaiList();
|
||||
|
||||
const res = await UserAPI.getPage()
|
||||
form.warnLine = res.warnLine || ''
|
||||
const res = await UserAPI.getPage();
|
||||
form.warnLine = res.warnLine || "";
|
||||
// console.log('contentRef.value===', res);
|
||||
});
|
||||
|
||||
@@ -310,7 +372,7 @@ function getTongji(params: IObject | undefined) {
|
||||
|
||||
// 显示批量导入
|
||||
function handleUploadClick() {
|
||||
importDataRef.value.show()
|
||||
importDataRef.value.show();
|
||||
}
|
||||
|
||||
// 导出商品
|
||||
@@ -342,13 +404,25 @@ function createItem(val: IObject) {
|
||||
haocaiData.value.consList.push(item);
|
||||
}
|
||||
// 上架
|
||||
function handleSwitchChange(data: any) {
|
||||
async function handleSwitchChange(data: any) {
|
||||
console.log(data);
|
||||
let obj = {
|
||||
type: data.productId ? "sku" : "product",
|
||||
id: data.id,
|
||||
isSale: data.isSale,
|
||||
};
|
||||
UserAPI.onOff(obj);
|
||||
await UserAPI.onOff(obj);
|
||||
ElMessage.success("修改成功!");
|
||||
|
||||
if (data.productId) {
|
||||
//sku
|
||||
contentRef.value?.fetchPageData();
|
||||
} else {
|
||||
//product
|
||||
data.skuList.map((v) => {
|
||||
v.isSale = data.isSale;
|
||||
});
|
||||
}
|
||||
}
|
||||
// 售罄
|
||||
function handleSwitchChangeTwo(data: any) {
|
||||
@@ -358,6 +432,7 @@ function handleSwitchChangeTwo(data: any) {
|
||||
isSoldOut: data.isSoldStock,
|
||||
};
|
||||
UserAPI.markIsSoldOut(obj);
|
||||
ElMessage.success("修改成功!");
|
||||
}
|
||||
function handleSwitchChangethree(data: any) {
|
||||
let obj = {
|
||||
@@ -368,6 +443,18 @@ function handleSwitchChangethree(data: any) {
|
||||
UserAPI.markIsSoldOut(obj);
|
||||
}
|
||||
|
||||
async function isStockChange(data: any) {
|
||||
console.log(data);
|
||||
let obj = {
|
||||
type: "product",
|
||||
id: data.id,
|
||||
isSale: data.isStock,
|
||||
optType: "stock",
|
||||
};
|
||||
await UserAPI.onOff(obj);
|
||||
ElMessage.success("修改成功!");
|
||||
return;
|
||||
}
|
||||
// 退款退回
|
||||
async function handleSwitchhaocai(row: IObject) {
|
||||
let res = await UserAPI.refundToStock({ isReturn: row.isRefundStock, id: row.id });
|
||||
@@ -398,7 +485,7 @@ async function handleToolbarClick(name: string) {
|
||||
ElMessage.success("操作成功,数据正在后台同步中...");
|
||||
}
|
||||
if (name === "upload") {
|
||||
importDataRef.value.show()
|
||||
importDataRef.value.show();
|
||||
}
|
||||
}
|
||||
async function confirm() {
|
||||
@@ -451,8 +538,8 @@ async function handleOperatClick(data: IOperatData) {
|
||||
}
|
||||
|
||||
async function gethaocaiList() {
|
||||
let res = await UserAPI.productcons({ id: route.query.id });
|
||||
options.value = res.records;
|
||||
let res = await UserAPI.productconsList({ id: route.query.id });
|
||||
options.value = res || [];
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -9,6 +9,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
table: {
|
||||
border: true,
|
||||
highlightCurrentRow: true,
|
||||
expandRowKeys: [],
|
||||
rowKey: 'id',
|
||||
treeProps: {
|
||||
children: 'skuList' // 指定子节点存储的字段为 customChildren
|
||||
|
||||
@@ -3,14 +3,25 @@
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="160px" label-position="left">
|
||||
<el-form-item label="门店名称" prop="shopName">
|
||||
<el-input v-model.trim="form.shopName" placeholder="请输入门店名称" style="width: 500px"></el-input>
|
||||
<el-input
|
||||
v-model.trim="form.shopName"
|
||||
placeholder="请输入门店名称"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="连锁店扩展店名">
|
||||
<el-input v-model.trim="form.chainName" placeholder="请输入连锁店扩展店名" style="width: 500px"></el-input>
|
||||
<el-input
|
||||
v-model.trim="form.chainName"
|
||||
placeholder="请输入连锁店扩展店名"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店logo">
|
||||
<div class="img_box">
|
||||
<single-image-upload style="width: 80px; height: 80px" v-model="form.logo"></single-image-upload>
|
||||
<single-image-upload
|
||||
style="width: 80px; height: 80px"
|
||||
v-model="form.logo"
|
||||
></single-image-upload>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="门店照片">
|
||||
@@ -27,14 +38,22 @@
|
||||
<el-form-item label="门店收款码">
|
||||
<div class="img_box">
|
||||
<canvas ref="canvas" id="QRCode_header" style="width: 80px; height: 80px"></canvas>
|
||||
<el-button size="small" plain v-if="form.paymentQrcode" @click="downloadCanvas(form.paymentQrcode)">
|
||||
<el-button
|
||||
size="small"
|
||||
plain
|
||||
v-if="form.paymentQrcode"
|
||||
@click="downloadCanvas(form.paymentQrcode)"
|
||||
>
|
||||
下载
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信二维码">
|
||||
<div class="img_box">
|
||||
<single-image-upload style="width: 80px; height: 80px" v-model="form.shopQrcode"></single-image-upload>
|
||||
<single-image-upload
|
||||
style="width: 80px; height: 80px"
|
||||
v-model="form.shopQrcode"
|
||||
></single-image-upload>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="店铺小程序码">
|
||||
@@ -52,6 +71,21 @@
|
||||
<el-radio value="after">餐饮版(先下单后支付)</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="是否允许用户自行支付"
|
||||
prop="isUserPay"
|
||||
v-if="form.registerType === 'after'"
|
||||
>
|
||||
<div class="column">
|
||||
<div class="center" style="display: flex; align-items: center; gap: 14px">
|
||||
<el-switch v-model="form.isUserPay" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips" style="font-size: 14px; color: #999">
|
||||
关闭后,用户将不能自行支付
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="就餐模式「多选」" prop="eatModel">
|
||||
<el-checkbox-group v-model="form.eatModel">
|
||||
<el-checkbox value="dine-in">堂食自取</el-checkbox>
|
||||
@@ -65,7 +99,11 @@
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model.trim="form.phone" placeholder="请输入联系电话" style="width: 500px"></el-input>
|
||||
<el-input
|
||||
v-model.trim="form.phone"
|
||||
placeholder="请输入联系电话"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="外卖起送金额">
|
||||
<el-input-number v-model="form.takeaway_money" placeholder="0.00" controls-position="right"
|
||||
@@ -91,30 +129,62 @@
|
||||
<div style="color: #999">注:准确的定位便于用户导航到店铺</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="门店详细地址">
|
||||
<el-input type="textarea" v-model.trim="form.address" placeholder="请输入门店详细地址" style="width: 500px"></el-input>
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model.trim="form.address"
|
||||
placeholder="请输入门店详细地址"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="营业时间">
|
||||
<div class="u-flex gap-2" style="width: 50%">
|
||||
<el-select v-model="form.businessStartDay" placeholder="周几开始">
|
||||
<el-option :value="item.label" :label="item.label" v-for="item in weeks" :key="item.value"></el-option>
|
||||
<el-option
|
||||
:value="item.label"
|
||||
:label="item.label"
|
||||
v-for="item in weeks"
|
||||
:key="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="form.businessEndDay" placeholder="周几结束">
|
||||
<el-option :value="item.label" :label="item.label" v-for="item in weeks" :key="item.value"></el-option>
|
||||
<el-option
|
||||
:value="item.label"
|
||||
:label="item.label"
|
||||
v-for="item in weeks"
|
||||
:key="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-time-picker placeholder="起始时间" v-model="startTime" :picker-options="{
|
||||
<el-time-picker
|
||||
placeholder="起始时间"
|
||||
v-model="startTime"
|
||||
:picker-options="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
format: 'HH:mm',
|
||||
}" format="HH:mm" value-format="HH:mm"></el-time-picker>
|
||||
<el-time-picker placeholder="结束时间" v-model="endTime" :picker-options="{
|
||||
}"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
></el-time-picker>
|
||||
<el-time-picker
|
||||
placeholder="结束时间"
|
||||
v-model="endTime"
|
||||
:picker-options="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
}" format="HH:mm" value-format="HH:mm"></el-time-picker>
|
||||
}"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
></el-time-picker>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="桌位费/位/元">
|
||||
<el-input-number :disabled="!!form.isTableFee" v-model="form.tableFee" :min="0" />
|
||||
<!-- <el-checkbox v-model="form.isTableFee" :label="1">免餐位费</el-checkbox> -->
|
||||
<el-switch class="u-m-l-10" v-model.trim="form.isTableFee" :active-value="1" :inactive-value="0"
|
||||
active-text="免餐位费"></el-switch>
|
||||
<el-switch
|
||||
class="u-m-l-10"
|
||||
v-model.trim="form.isTableFee"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="免餐位费"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否开启8折活动">
|
||||
<el-switch v-model.trim="form.isOpenYhq" active-value="true" inactive-value="false"></el-switch>
|
||||
@@ -148,42 +218,68 @@
|
||||
</el-time-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="店铺简介">
|
||||
<el-input type="textarea" v-model.trim="form.detail" placeholder="请输入店铺简介" style="width: 500px"></el-input>
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model.trim="form.detail"
|
||||
placeholder="请输入店铺简介"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="台桌预订短信">
|
||||
<el-input type="textarea" v-model.trim="form.bookingSms" placeholder="请输入台桌预订短信"
|
||||
style="width: 500px"></el-input>
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model.trim="form.bookingSms"
|
||||
placeholder="请输入台桌预订短信"
|
||||
style="width: 500px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子围栏" prop="isOrderFence">
|
||||
<div class="column">
|
||||
<div class="center" style="display: flex; align-items: center; gap: 14px">
|
||||
<el-switch v-model="form.isOrderFence" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<el-switch
|
||||
v-model="form.isOrderFence"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<div class="tips" style="font-size: 14px; color: #999">
|
||||
开启后,用户只能在店铺附近xx公里内点餐
|
||||
</div>
|
||||
</div>
|
||||
<div class="center" v-if="form.isOrderFence == 1">
|
||||
<el-input v-model="form.orderFenceDistance" placeholder="请输入"
|
||||
@input="(e) => (form.orderFenceDistance = filterNumberInput(e))" style="width: 250px"
|
||||
input-style="text-align: center;">
|
||||
<el-input
|
||||
v-model="form.orderFenceDistance"
|
||||
placeholder="请输入"
|
||||
@input="(e) => (form.orderFenceDistance = filterNumberInput(e))"
|
||||
style="width: 250px"
|
||||
input-style="text-align: center;"
|
||||
>
|
||||
<template #prepend>限制:</template>
|
||||
<template #append>公里</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="上菜时间(分钟)" prop="isServeTimeControl">
|
||||
<div class="column">
|
||||
<div class="center" style="display: flex; align-items: center; gap: 14px">
|
||||
<el-switch v-model="form.isServeTimeControl" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<el-switch
|
||||
v-model="form.isServeTimeControl"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<div class="tips" style="font-size: 14px; color: #999">
|
||||
起菜到上菜的时间间隔,开启后会有超时提示
|
||||
</div>
|
||||
</div>
|
||||
<div class="center" v-if="form.isServeTimeControl == 1">
|
||||
<el-input v-model="form.serveTime" placeholder="请输入"
|
||||
@input="(e) => (form.serveTime = filterNumberInput(e))" style="width: 250px"
|
||||
input-style="text-align: center;">
|
||||
<el-input
|
||||
v-model="form.serveTime"
|
||||
placeholder="请输入"
|
||||
@input="(e) => (form.serveTime = filterNumberInput(e))"
|
||||
style="width: 250px"
|
||||
input-style="text-align: center;"
|
||||
>
|
||||
<template #prepend>限制:</template>
|
||||
<template #append>分钟</template>
|
||||
</el-input>
|
||||
@@ -208,11 +304,24 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<ChooseAddress ref="refChooseAddress" @choose="chooseAddressConfirm"></ChooseAddress>
|
||||
<el-dialog v-model="showUpload" :close-on-click-modal="false" append-to-body width="500px"
|
||||
@close="showUpload = false">
|
||||
<el-upload :before-remove="handleBeforeRemove" :on-success="handleSuccess" :on-error="handleError"
|
||||
:file-list="fileList" :headers="headers" :action="qiNiuUploadApi" :limit="1" list-type="picture"
|
||||
class="upload-demo">
|
||||
<el-dialog
|
||||
v-model="showUpload"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
width="500px"
|
||||
@close="showUpload = false"
|
||||
>
|
||||
<el-upload
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:action="qiNiuUploadApi"
|
||||
:limit="1"
|
||||
list-type="picture"
|
||||
class="upload-demo"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<template #tip>
|
||||
<div style="display: block" class="el-upload__tip">请勿上传违法文件,且文件不超过15M</div>
|
||||
@@ -341,6 +450,14 @@ export default {
|
||||
mounted() {
|
||||
this.tbShopInfo();
|
||||
},
|
||||
watch: {
|
||||
"form.registerType"(val) {
|
||||
console.log(val);
|
||||
if (val === "before") {
|
||||
this.form.isUserPay = 1;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
chooseAddressConfirm(e) {
|
||||
console.log(e);
|
||||
|
||||
@@ -803,15 +803,14 @@ onMounted(async () => {
|
||||
// tableCode,
|
||||
// });
|
||||
let res = ''
|
||||
if (carts.table_code) {
|
||||
res = await orderApi.getHistoryList({
|
||||
// orderId: carts.oldOrder.id,
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
} else {
|
||||
if (id) {
|
||||
res = await orderApi.getHistoryList({
|
||||
orderId: id,
|
||||
})
|
||||
} else {
|
||||
res = await orderApi.getHistoryList({
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
}
|
||||
|
||||
const noPayStatus = {
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="tableArea.tabsSel" type="card" @tab-click="tabClick">
|
||||
<el-tab-pane label="全部" name="" />
|
||||
<el-tab-pane v-for="item in tableArea.tabs" :key="item.id" :label="item.name" :name="`${item.id}`">
|
||||
<el-tab-pane
|
||||
v-for="item in tableArea.tabs"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:name="`${item.id}`"
|
||||
>
|
||||
<template #label>
|
||||
<div class="">
|
||||
<span>
|
||||
@@ -23,38 +28,51 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div class="" style="display: flex;">
|
||||
<div class="">
|
||||
<el-button icon="plus" @click="addEaraShow()">添加区域</el-button>
|
||||
<el-button type="primary" icon="plus" @click="addTableShow()">添加台桌</el-button>
|
||||
<el-button type="danger" icon="Setting" @click="clearTabDialogRef.show()">清台设置</el-button>
|
||||
<el-button type="primary" icon="download" @click="showDownloadTableCode">
|
||||
下载桌台码
|
||||
</el-button>
|
||||
<!-- 批量导入 -->
|
||||
<importData :type="5" @close="init" />
|
||||
<!-- <el-button icon="Upload" @click="importDataRef.show()">
|
||||
批量导入
|
||||
</el-button> -->
|
||||
<!-- <el-button type="primary" icon="download" @click="downloadShopCpde">
|
||||
下载店铺码
|
||||
</el-button> -->
|
||||
</div>
|
||||
|
||||
<div class="u-flex" style="justify-content: space-between">
|
||||
<div class="u-flex u-p-b-15 u-font-14 u-m-t-16">
|
||||
<div v-for="(item, key) in status" :key="key" class="state u-m-r-24">
|
||||
<span class="dot" :style="{
|
||||
<span
|
||||
class="dot"
|
||||
:style="{
|
||||
backgroundColor: status[key] ? status[key].type : '',
|
||||
}" />
|
||||
}"
|
||||
/>
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="color: #3f9eff; font-weight: 700; padding-right: 30px">
|
||||
<span style="color: #333; font-weight: 400">未结账:</span>
|
||||
<span>{{ totalOrder }}笔</span>
|
||||
<span>|</span>
|
||||
<span>{{ totalPerson }}人</span>
|
||||
<span>|</span>
|
||||
<span>¥{{ totalMoney }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="head-container">
|
||||
<div v-loading="loading" class="table_list">
|
||||
<div v-for="item in tableList" :key="item.id" class="item" :style="{
|
||||
<div
|
||||
v-for="item in tableList"
|
||||
:key="item.id"
|
||||
class="item"
|
||||
:style="{
|
||||
'background-color': status[item.status] ? status[item.status].type : '',
|
||||
}">
|
||||
}"
|
||||
>
|
||||
<div class="new-top flex u-row-between">
|
||||
<div class="u-flex u-flex-1 u-p-r-10">
|
||||
<span class="name u-line-1" style="max-width: 50px">
|
||||
@@ -88,18 +106,19 @@
|
||||
<div v-if="item.status == 'subscribe' && item.bookingInfo">
|
||||
<div class="row row1" style="align-items: flex-start">
|
||||
<span style="font-size: 14px; color: #333">
|
||||
{{ item.bookingInfo.createUserName }}订{{
|
||||
item.bookingInfo.bookingPerson
|
||||
}}「{{ item.bookingInfo.gender == 1 ? "先生" : "女士" }}」
|
||||
{{ item.bookingInfo.createUserName }}订{{ item.bookingInfo.bookingPerson }}「{{
|
||||
item.bookingInfo.gender == 1 ? "先生" : "女士"
|
||||
}}」
|
||||
</span>
|
||||
<div class="state" style="
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
">
|
||||
<img style="width: 16px; height: 16px; filter: contrast(0.5)" src="@/assets/images/perpole.png"
|
||||
alt="" />
|
||||
<div
|
||||
class="state"
|
||||
style="font-size: 12px; color: #666; display: flex; align-items: center"
|
||||
>
|
||||
<img
|
||||
style="width: 16px; height: 16px; filter: contrast(0.5)"
|
||||
src="@/assets/images/perpole.png"
|
||||
alt=""
|
||||
/>
|
||||
|
||||
{{ item.bookingInfo.bookingTime.substring(11, 19) }}
|
||||
</div>
|
||||
@@ -112,47 +131,68 @@
|
||||
</div>
|
||||
|
||||
<div v-else class="u-font-18 font-600 total-price">
|
||||
<span v-if="item.status == 'using'" class="cur-pointer" @click="diancanShow(item, 'isAddGoods')">
|
||||
¥{{ item.totalAmount || 0 }}「{{ item.productNum }}件」
|
||||
<span
|
||||
v-if="item.status == 'unsettled'"
|
||||
class="cur-pointer"
|
||||
@click="diancanShow(item, 'isAddGoods')"
|
||||
>
|
||||
¥{{ item.orderAmount || 0 }}
|
||||
<!-- 「{{ item.productNum }}件」 -->
|
||||
</span>
|
||||
<!-- <span v-else class="color-fff">|</span> -->
|
||||
</div>
|
||||
<div class="row btn-group" style="margin-top: 10px">
|
||||
<template v-if="item.status == 'subscribe'">
|
||||
<el-button type="success" :disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="markStatus(item, -1)">
|
||||
<el-button
|
||||
type="success"
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="markStatus(item, -1)"
|
||||
>
|
||||
取消预约
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-if="
|
||||
item.status == 'subscribe' &&
|
||||
item.bookingInfo &&
|
||||
item.bookingInfo.status == 20
|
||||
">
|
||||
<el-button type="success" :disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="markStatus(item, 10)">
|
||||
<template
|
||||
v-if="
|
||||
item.status == 'subscribe' && item.bookingInfo && item.bookingInfo.status == 20
|
||||
"
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="markStatus(item, 10)"
|
||||
>
|
||||
到店
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-if="
|
||||
<template
|
||||
v-if="
|
||||
item.status == 'idle' ||
|
||||
(item.status == 'subscribe' &&
|
||||
item.bookingInfo &&
|
||||
item.bookingInfo.status == 10)
|
||||
">
|
||||
<el-button type="primary" :disabled="!item.tableCode || item.status === 'closed'"
|
||||
@click="diancanShow(item)">
|
||||
"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!item.tableCode || item.status === 'closed'"
|
||||
@click="diancanShow(item)"
|
||||
>
|
||||
点餐
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else-if="item.status != 'idle' && item.status != 'subscribe'">
|
||||
<template v-if="item.status == 'using'">
|
||||
<el-button :disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isAddGoods')">
|
||||
<el-button
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isAddGoods')"
|
||||
>
|
||||
加菜
|
||||
</el-button>
|
||||
<el-button type="danger" :disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isPayOrder')">
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isPayOrder')"
|
||||
>
|
||||
结账
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -160,10 +200,13 @@
|
||||
<el-button type="info" disabled>已关台</el-button>
|
||||
</template>
|
||||
<template v-else-if="item.status == 'cleaning'">
|
||||
<el-button type="info" :style="{
|
||||
<el-button
|
||||
type="info"
|
||||
:style="{
|
||||
backgroundColor: status[item.status].type,
|
||||
borderColor: status[item.status].type,
|
||||
}">
|
||||
}"
|
||||
>
|
||||
清理中
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -173,19 +216,28 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-flex u-col-bottom bottom u-row-between color-666"
|
||||
:class="{ 'opacity-0': item.status == 'closed' }">
|
||||
<div
|
||||
class="u-flex u-col-bottom bottom u-row-between color-666"
|
||||
:class="{ 'opacity-0': item.status == 'closed' }"
|
||||
>
|
||||
<div class="u-flex u-col-center">
|
||||
<img style="width: 16px; height: 16px; filter: contrast(0.5)" src="@/assets/images/perpole.png"
|
||||
alt="" />
|
||||
<img
|
||||
style="width: 16px; height: 16px; filter: contrast(0.5)"
|
||||
src="@/assets/images/perpole.png"
|
||||
alt=""
|
||||
/>
|
||||
<span class="u-m-t-4 u-font-12 u-m-l-2">
|
||||
{{ item.useNum || 0 }}/{{ item.maxCapacity }}
|
||||
{{ item.personNum || 0 }}/{{ item.maxCapacity }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="item.status == 'using'" class="u-flex">
|
||||
<img style="width: 16px; height: 16px; filter: contrast(0.5)" src="@/assets/images/shalou.png" alt="" />
|
||||
<div v-if="item.status == 'unsettled'" class="u-flex">
|
||||
<img
|
||||
style="width: 16px; height: 16px; filter: contrast(0.5)"
|
||||
src="@/assets/images/shalou.png"
|
||||
alt=""
|
||||
/>
|
||||
<span class="u-m-t-4 u-font-12">
|
||||
{{ formatTime(item.durationTime) }}
|
||||
{{ formatTime(item.orderCreateTime) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,7 +275,7 @@ import bindCode from "./components/bind-table-code.vue";
|
||||
import downloadTableCode from "./components/downloadTableCode.vue";
|
||||
import clearTabDialog from "./components/clearTabDialog.vue";
|
||||
|
||||
const clearTabDialogRef = ref(null)
|
||||
const clearTabDialogRef = ref(null);
|
||||
|
||||
const envName = import.meta.env.VITE_APP_NAME;
|
||||
|
||||
@@ -240,15 +292,28 @@ function showDownloadTableCode() {
|
||||
}
|
||||
|
||||
let loading = ref(false);
|
||||
//工具方法
|
||||
function formatTime(milliseconds) {
|
||||
console.log(milliseconds);
|
||||
if (!milliseconds) {
|
||||
return "";
|
||||
|
||||
const nowTime = ref(new Date().getTime());
|
||||
|
||||
// 实时更新当前时间(循环执行)
|
||||
function updateTime() {
|
||||
nowTime.value = new Date().getTime();
|
||||
requestAnimationFrame(updateTime);
|
||||
}
|
||||
updateTime(); // 启动
|
||||
|
||||
// 工具方法
|
||||
function formatTime(str) {
|
||||
if (!str) return "";
|
||||
const targetTime = new Date(str).getTime();
|
||||
const milliseconds = nowTime.value - targetTime;
|
||||
|
||||
if (milliseconds <= 0) return "已结束";
|
||||
|
||||
const days = Math.floor(milliseconds / (1000 * 60 * 60 * 24));
|
||||
const hours = Math.floor((milliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
return `${days ? days + "天" : ""} ${hours ? hours + "时" : ""} ${minutes + "分"}`;
|
||||
}
|
||||
|
||||
@@ -308,7 +373,7 @@ function addTableShow(item) {
|
||||
const tableList = ref([]);
|
||||
const tablequery = reactive({
|
||||
page: 1,
|
||||
size: 100,
|
||||
size: 300,
|
||||
});
|
||||
|
||||
async function tableInit() {
|
||||
@@ -316,6 +381,35 @@ async function tableInit() {
|
||||
tableList.value = res.records;
|
||||
}
|
||||
|
||||
const totalOrder = computed(() => {
|
||||
return tableList.value.reduce((pre, cur) => {
|
||||
if (cur.status == "unsettled") {
|
||||
return pre + 1;
|
||||
}
|
||||
return pre;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
const totalPerson = computed(() => {
|
||||
return tableList.value.reduce((pre, cur) => {
|
||||
if (cur.status == "unsettled") {
|
||||
return pre + cur.personNum;
|
||||
}
|
||||
return pre;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
const totalMoney = computed(() => {
|
||||
return tableList.value
|
||||
.reduce((pre, cur) => {
|
||||
if (cur.status == "unsettled") {
|
||||
return pre + cur.orderAmount;
|
||||
}
|
||||
return pre;
|
||||
}, 0)
|
||||
.toFixed(2);
|
||||
});
|
||||
|
||||
// 区域
|
||||
let areaMap = ref({});
|
||||
const refAddEara = ref(null);
|
||||
|
||||