优化退款密码

This commit is contained in:
gyq
2024-08-31 10:20:25 +08:00
parent 2d2a014bc4
commit 86c8ca6472
13 changed files with 408 additions and 499 deletions

View File

@@ -89,24 +89,27 @@
<el-text class="t">打包({{ cartInfo.packAmount || 0 }})</el-text>
</div>
<div class="num-wrap">
<el-text>{{ cartInfo.productNum || 0 }}种商品{{
<!-- {{ cartInfo.productNum || 0 }}种商品 -->
<el-text>{{
cartInfo.productSum || 0
}}</el-text>
}}</el-text>{{ formatDecimal(cartInfo.totalAmount || 0) }}
</div>
</div>
<div class="btm">
<el-button icon="Edit" @click="remarkRef.show()"></el-button>
<div class="button">
<el-button type="primary" style="width: 100%" :disabled="!cartList.length" v-loading="createOrderLoading"
@click="createOrderHandle">
<template v-if="!createOrderLoading">
<template v-if="!global.tableInfo.id">
结算
</template>
<template v-else>下单</template>
({{ cartInfo.totalAmount || 0 }})</template>
<template v-else>下单中...</template>
</el-button>
<div class="btn" v-if="global.tableInfo.id">
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length"
@click="createOrderHandle(0)">仅下单</el-button>
</div>
<div class="btn">
<el-button type="primary" style="width: 100%;" :disabled="!cartList.length" v-loading="createOrderLoading"
@click="createOrderHandle(1)">
<template v-if="!createOrderLoading">
去结算</template>
<template v-else>下单中...</template>
</el-button>
</div>
</div>
</div>
</div>
@@ -151,6 +154,7 @@ import settleAccount from "@/views/home/components/settleAccount.vue";
import fastCashier from "@/views/home/components/fastCashier.vue";
import pendingCartModal from "@/views/home/components/pendingCartModal.vue";
import useStorage from '@/utils/useStorage'
import { formatDecimal } from '@/utils/index.js'
import {
createCart,
@@ -199,7 +203,7 @@ const masterId = ref("");
const pendingCartNum = ref(0);
// 生成订单
async function createOrderHandle() {
async function createOrderHandle(t = 0) {
try {
createOrderLoading.value = true;
const res = await createOrder({
@@ -207,11 +211,12 @@ async function createOrderHandle() {
shopId: store.userInfo.shopId,
remark: remark.value,
vipUserId: global.orderMemberInfo.id || '',
tableId: global.tableInfo.qrcode || ''
tableId: global.tableInfo.qrcode || '',
type: t
});
createOrderLoading.value = false;
if (global.tableInfo.id) {
if (global.tableInfo.id && t == 0) {
ElMessage.success('下单成功')
global.setOrderTable({})
createCodeAjax(1)
@@ -653,6 +658,12 @@ onMounted(() => {
.button {
flex: 1;
display: flex;
gap: var(--el-font-size-base);
.btn {
flex: 1;
}
.js {
.t {