Compare commits
17 Commits
f5105cad87
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 75e46ec6dd | |||
| c87c999d42 | |||
| f648a7ea5e | |||
| 0ab8852656 | |||
| 03883e1b26 | |||
| b9308c1f21 | |||
| be12089ffe | |||
| e5cdf0a3dc | |||
| 51812fb0cc | |||
| 6e39a94f01 | |||
| d6a33aea3b | |||
| 397f4b2bcf | |||
| 2f2a152b46 | |||
| e3ddd70ce6 | |||
| 3c68d25286 | |||
| c734bbe353 | |||
| d5a2f0ba24 |
@@ -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>
|
||||
</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')}`;
|
||||
|
||||
@@ -81,9 +81,9 @@
|
||||
<div>优惠券抵扣:¥{{ detail.fullCouponDiscountAmount }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>满减活动:¥{{ detail.discountActAmount || '-' }}</div>
|
||||
<div>新客立减:¥{{ detail.newCustomerDiscountAmount || '-' }}</div>
|
||||
<div>会员折扣:¥{{ detail.vipDiscountAmount || '-' }}</div>
|
||||
<div>满减活动:¥{{ detail.discountActAmount || "-" }}</div>
|
||||
<div>新客立减:¥{{ detail.newCustomerDiscountAmount || "-" }}</div>
|
||||
<div>会员折扣:¥{{ detail.vipDiscountAmount || "-" }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>退单金额:¥{{ detail.refundAmount }}</div>
|
||||
@@ -93,8 +93,13 @@
|
||||
<div>
|
||||
实收金额:
|
||||
<span style="color: red">¥{{ detail.payAmount }}</span>
|
||||
<el-button v-if="detail.status != 'unpaid' && detail.refundAmount < detail.payAmount" size="small"
|
||||
type="danger" class="u-m-l-10" @click="tuikuan()">
|
||||
<el-button
|
||||
v-if="detail.status != 'unpaid' && detail.refundAmount < detail.payAmount"
|
||||
size="small"
|
||||
type="danger"
|
||||
class="u-m-l-10"
|
||||
@click="tuikuan()"
|
||||
>
|
||||
<span>退款</span>
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -111,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>
|
||||
@@ -121,29 +130,44 @@
|
||||
<div style="margin-bottom: 16px; font-size: 16px">商品信息</div>
|
||||
<template v-for="(item, index) in detail.detailMap" :key="index">
|
||||
<h4>第{{ index }}次下单</h4>
|
||||
<el-table :data="item" :ref="'refTable' + index" @select-all="tableSelectAll($event, index)">
|
||||
<el-table
|
||||
:data="item"
|
||||
:ref="'refTable' + index"
|
||||
@select-all="tableSelectAll($event, index)"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="数量" type="selection">
|
||||
<template v-slot="scope">
|
||||
<div v-if="detail.status == 'unpaid'">
|
||||
<el-checkbox v-if="scope.row.num - scope.row.returnNum > 0" v-model="scope.row.checked" />
|
||||
<el-checkbox
|
||||
v-if="scope.row.num - scope.row.returnNum > 0"
|
||||
v-model="scope.row.checked"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-checkbox v-if="scope.row.num - scope.row.refundNum > 0" v-model="scope.row.checked" />
|
||||
<el-checkbox
|
||||
v-if="scope.row.num - scope.row.refundNum > 0"
|
||||
v-model="scope.row.checked"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品" width="150">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.productImg" style="width: 40px; height: 40px"></el-image>
|
||||
<el-image
|
||||
:src="scope.row.productImg"
|
||||
style="width: 40px; height: 40px"
|
||||
></el-image>
|
||||
<div class="info">
|
||||
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">
|
||||
{{ scope.row.productName }}
|
||||
</span>
|
||||
<span style="color: #999">{{ scope.row.productSkuName }}</span>
|
||||
<div>
|
||||
<el-tag v-if="scope.row.isTimeDiscount" type="danger" disable-transitions>限时折扣</el-tag>
|
||||
<el-tag v-if="scope.row.isTimeDiscount" type="danger" disable-transitions>
|
||||
限时折扣
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -167,17 +191,32 @@
|
||||
<el-table-column label="实付">
|
||||
<template v-slot="scope">¥{{ scope.row.payAmount }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="detail.status == 'unpaid'" label="可退菜数量" align="center" width="130px">
|
||||
<el-table-column
|
||||
v-if="detail.status == 'unpaid'"
|
||||
label="可退菜数量"
|
||||
align="center"
|
||||
width="130px"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-if="scope.row.checked" :min="0" style="width: 100px" v-model="scope.row.selNumber"
|
||||
:max="scope.row.num - scope.row.returnNum"></el-input-number>
|
||||
<el-input-number
|
||||
v-if="scope.row.checked"
|
||||
:min="0"
|
||||
style="width: 100px"
|
||||
v-model="scope.row.selNumber"
|
||||
:max="scope.row.num - scope.row.returnNum"
|
||||
></el-input-number>
|
||||
<span class="" v-else>{{ scope.row.num - scope.row.returnNum }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else label="可退款数量" align="center" width="130px">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-if="scope.row.checked" :min="0" style="width: 100px" v-model="scope.row.selNumber"
|
||||
:max="scope.row.num - scope.row.refundNum - scope.row.returnNum"></el-input-number>
|
||||
<el-input-number
|
||||
v-if="scope.row.checked"
|
||||
:min="0"
|
||||
style="width: 100px"
|
||||
v-model="scope.row.selNumber"
|
||||
:max="scope.row.num - scope.row.refundNum - scope.row.returnNum"
|
||||
></el-input-number>
|
||||
<span class="" v-else>
|
||||
{{ scope.row.num - scope.row.refundNum - scope.row.returnNum }}
|
||||
</span>
|
||||
@@ -192,13 +231,23 @@
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<template v-if="detail.status != 'unpaid'">
|
||||
<el-button v-if="canTuikuan(scope.row)" link size="small" @click="tuikuan(scope.row)">
|
||||
<el-button
|
||||
v-if="canTuikuan(scope.row)"
|
||||
link
|
||||
size="small"
|
||||
@click="tuikuan(scope.row)"
|
||||
>
|
||||
<span>退款</span>
|
||||
</el-button>
|
||||
<span class="color-999" v-if="scope.row.status == 'refund'">已退款</span>
|
||||
</template>
|
||||
<template v-if="detail.status == 'unpaid'">
|
||||
<el-button v-if="canTuicai(scope.row)" link size="small" @click="tuicai(scope.row)">
|
||||
<el-button
|
||||
v-if="canTuicai(scope.row)"
|
||||
link
|
||||
size="small"
|
||||
@click="tuicai(scope.row)"
|
||||
>
|
||||
<span>退菜</span>
|
||||
</el-button>
|
||||
<span class="color-999" v-else>已退菜</span>
|
||||
@@ -208,25 +257,41 @@
|
||||
</el-table>
|
||||
</template>
|
||||
<!-- 退款 -->
|
||||
<div class="u-p-20 u-flex u-row-right" v-if="
|
||||
detail.status !== 'refund' &&
|
||||
detail.status !== 'unpaid' &&
|
||||
detail.status !== 'cancelled'
|
||||
">
|
||||
<el-checkbox v-model="allSelected" @change="allSelectedChange" label="全选"></el-checkbox>
|
||||
<div
|
||||
class="u-p-20 u-flex u-row-right"
|
||||
v-if="
|
||||
detail.status !== 'refund' &&
|
||||
detail.status !== 'unpaid' &&
|
||||
detail.status !== 'cancelled'
|
||||
"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="allSelected"
|
||||
@change="allSelectedChange"
|
||||
label="全选"
|
||||
></el-checkbox>
|
||||
<el-button type="danger" class="u-m-l-20" @click.stop="tuikuan('all')">退款</el-button>
|
||||
</div>
|
||||
<!-- 退菜 -->
|
||||
<div class="u-p-20 u-flex u-row-right" v-if="detail.status == 'unpaid'">
|
||||
<el-checkbox v-model="allSelected" @change="allSelectedChange" label="全选"></el-checkbox>
|
||||
<el-checkbox
|
||||
v-model="allSelected"
|
||||
@change="allSelectedChange"
|
||||
label="全选"
|
||||
></el-checkbox>
|
||||
<el-button type="danger" class="u-m-l-20" @click.stop="tuicai('all')">退菜</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<!-- 退款 -->
|
||||
<return-money :modal="false" ref="refReturnMoney" :max="selGoods.num" :goods="selGoods"
|
||||
@confirm="refReturnMoneyConfirm"></return-money>
|
||||
<return-money
|
||||
:modal="false"
|
||||
ref="refReturnMoney"
|
||||
:max="selGoods.num"
|
||||
:goods="selGoods"
|
||||
@confirm="refReturnMoneyConfirm"
|
||||
></return-money>
|
||||
<!-- 退菜 -->
|
||||
<order-return-cart ref="refReturnCart" @confirm="refReturnCartConfirm"></order-return-cart>
|
||||
</div>
|
||||
@@ -330,8 +395,8 @@ export default {
|
||||
if (!payType) {
|
||||
return "";
|
||||
}
|
||||
console.log(payType.replace("_pay", ""));
|
||||
return returnOptionsLabel("payType", payType.replace("_pay", ""));
|
||||
console.log(payType);
|
||||
return returnOptionsLabel("payType", payType);
|
||||
},
|
||||
to2(n) {
|
||||
return Number(n).toFixed(2);
|
||||
@@ -345,7 +410,8 @@ export default {
|
||||
},
|
||||
sendTypeFilter(t) {
|
||||
if (t) {
|
||||
return orderEnum.sendType.find((item) => item.key == t).label;
|
||||
const item = orderEnum.sendType.find((item) => item.key == t);
|
||||
return item ? item.label : "-";
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -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="{
|
||||
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="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
}" format="HH:mm" value-format="HH:mm"></el-time-picker>
|
||||
<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="{
|
||||
selectableRange: '00:00:00 - 23:59:59',
|
||||
}"
|
||||
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);
|
||||
@@ -459,7 +576,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,7 @@
|
||||
<el-button type="primary" size="large" :disabled="disabledMorePay" @click="createOrder('to-pay')">
|
||||
去结账
|
||||
</el-button> -->
|
||||
<el-button type="primary" size="large"
|
||||
:disabled="carts.list.length == 0 || carts.oldOrder.detailMap.length == 0"
|
||||
@click="createOrder('only-create')">
|
||||
<el-button type="primary" size="large" :disabled="carts.list.length == 0" @click="createOrder('only-create')">
|
||||
仅下单
|
||||
</el-button>
|
||||
<el-button type="primary" size="large"
|
||||
@@ -113,10 +111,10 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button type="default" size="large" @click="hideOrder()">加菜/返回</el-button>
|
||||
<el-button type="primary" size="large" :disabled="!carts.isLinkFinshed" @click="createOrder('to-pay')">
|
||||
<el-button type="warning" size="large" @click="hideOrder()">加菜/返回</el-button>
|
||||
<!-- <el-button type="primary" size="large" :disabled="!carts.isLinkFinshed" @click="createOrder('to-pay')">
|
||||
立即支付
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -133,11 +131,11 @@ import { useUserStore } from "@/store/modules/user";
|
||||
function isEmptyObject(obj) {
|
||||
// 步骤1:排除null和非对象类型
|
||||
if (obj === null || typeof obj !== "object") {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
// 步骤2:排除数组(数组也是对象,需单独判断)
|
||||
if (Array.isArray(obj)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
// 步骤3:判断自身可枚举属性是否为空
|
||||
return Object.keys(obj).length === 0;
|
||||
|
||||
@@ -591,7 +591,7 @@ function pointsToMoney(val) {
|
||||
carts.orderCostSummary.pointDeductionAmount = finalMoney;
|
||||
}
|
||||
|
||||
const emits = defineEmits(["chooseUser", "paysuccess"]);
|
||||
const emits = defineEmits(["chooseUser", "paysuccess", 'createOrder']);
|
||||
function chooseUser() {
|
||||
emits("chooseUser");
|
||||
}
|
||||
@@ -703,31 +703,37 @@ async function getPaytype() {
|
||||
}
|
||||
|
||||
const cashRemark = ref("");
|
||||
function nowPayClick(payType) {
|
||||
payType = payType || payTypes.list[payTypes.sel].payType;
|
||||
if (payType === "cash") {
|
||||
ElMessageBox.prompt("是否确认已现金收款:" + currentpayMoney.value + "元", "快捷支付", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
inputPlaceholder: '请输入现金支付备注(选填)',
|
||||
})
|
||||
.then(({ value }) => {
|
||||
cashRemark.value = value || "";
|
||||
payOrder("cash");
|
||||
})
|
||||
.catch(() => { });
|
||||
return;
|
||||
}
|
||||
if (payType == "member-account") {
|
||||
if (!carts.vipUser.id) {
|
||||
return ElMessage.error("请先选择会员");
|
||||
}
|
||||
payOrder(payType);
|
||||
return;
|
||||
async function nowPayClick(payType) {
|
||||
if (carts.list.length) {
|
||||
await emits('createOrder', 'only-create')
|
||||
}
|
||||
|
||||
refScanPayOpen(payType);
|
||||
setTimeout(() => {
|
||||
payType = payType || payTypes.list[payTypes.sel].payType;
|
||||
if (payType === "cash") {
|
||||
ElMessageBox.prompt("是否确认已现金收款:" + currentpayMoney.value + "元", "快捷支付", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
inputPlaceholder: '请输入现金支付备注(选填)',
|
||||
})
|
||||
.then(({ value }) => {
|
||||
cashRemark.value = value || "";
|
||||
payOrder("cash");
|
||||
})
|
||||
.catch(() => { });
|
||||
return;
|
||||
}
|
||||
if (payType == "member-account") {
|
||||
if (!carts.vipUser.id) {
|
||||
return ElMessage.error("请先选择会员");
|
||||
}
|
||||
payOrder(payType);
|
||||
return;
|
||||
}
|
||||
|
||||
refScanPayOpen(payType);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
let authCode = "";
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
</template>
|
||||
<!-- 订单信息展示 -->
|
||||
<Order ref="refOrder" :orderInfo="carts.oldOrder" @chooseUser="showChooseUser" @paysuccess="refresh"
|
||||
:table="carts.tableInfo" :perpole="perpole" v-else :user="user"></Order>
|
||||
:table="carts.tableInfo" :perpole="perpole" v-else :user="user" @create-order="createOrder"></Order>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -802,10 +802,16 @@ onMounted(async () => {
|
||||
// : await orderApi.getHistoryList({
|
||||
// tableCode,
|
||||
// });
|
||||
const res = await orderApi.getHistoryList({
|
||||
// orderId: carts.oldOrder.id,
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
let res = ''
|
||||
if (id) {
|
||||
res = await orderApi.getHistoryList({
|
||||
orderId: id,
|
||||
})
|
||||
} else {
|
||||
res = await orderApi.getHistoryList({
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
}
|
||||
|
||||
const noPayStatus = {
|
||||
cancelled: "订单已取消",
|
||||
|
||||