Compare commits
4 Commits
f5105cad87
...
e3ddd70ce6
| Author | SHA1 | Date | |
|---|---|---|---|
| e3ddd70ce6 | |||
| 3c68d25286 | |||
| c734bbe353 | |||
| d5a2f0ba24 |
@@ -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>
|
||||
@@ -121,29 +126,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 +187,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 +227,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 +253,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 +391,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 +406,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;
|
||||
}
|
||||
|
||||
@@ -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,17 @@ onMounted(async () => {
|
||||
// : await orderApi.getHistoryList({
|
||||
// tableCode,
|
||||
// });
|
||||
const res = await orderApi.getHistoryList({
|
||||
// orderId: carts.oldOrder.id,
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
let res = ''
|
||||
if (carts.table_code) {
|
||||
res = await orderApi.getHistoryList({
|
||||
// orderId: carts.oldOrder.id,
|
||||
tableCode: carts.table_code,
|
||||
});
|
||||
} else {
|
||||
res = await orderApi.getHistoryList({
|
||||
orderId: id,
|
||||
})
|
||||
}
|
||||
|
||||
const noPayStatus = {
|
||||
cancelled: "订单已取消",
|
||||
|
||||
Reference in New Issue
Block a user