This commit is contained in:
YeMingfei666 2024-11-20 18:25:57 +08:00
commit 48b8daea75
4 changed files with 180 additions and 85 deletions

View File

@ -5,9 +5,9 @@ ENV = 'development'
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
# 测试
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
#预发布
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
# 生产
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'

View File

@ -1,7 +1,13 @@
<template>
<el-drawer title="订单详情" size="50%" :visible.sync="drawer" direction="rtl" v-loading="loading" >
<el-drawer
title="订单详情"
size="50%"
:visible.sync="drawer"
direction="rtl"
v-loading="loading"
>
<div class="header">
<div class="title" style="text-align: center;">收银订单</div>
<div class="title" style="text-align: center">收银订单</div>
<div class="container">
<div class="info_content">
<div class="item">
@ -72,15 +78,20 @@
<div class="row">
<div>打包费{{ detail.packFee || "-" }}</div>
<div>订单原价{{ detail.originAmount }}</div>
<div>优惠金额{{ detail.userCouponAmount || "-" }}</div>
<div>优惠金额{{ youHuiJinE }}</div>
<div>
实收金额<span style="color: red;">{{ detail.payAmount }}</span>
实收金额<span style="color: red">{{ detail.payAmount }}</span>
</div>
</div>
<div class="row">
<div>
退款金额{{ detail.refundAmount }}
<span style="color: #FF9731;cursor: pointer;" v-if="detail.isRefund" @click="type = '3'">退款详情></span>
<span
style="color: #ff9731; cursor: pointer"
v-if="detail.isRefund"
@click="type = '3'"
>退款详情></span
>
</div>
<div>支付方式{{ detail.payType }}</div>
</div>
@ -100,20 +111,26 @@
</div> -->
</div>
<div>
<div style="margin-bottom: 16px;font-size:16px;">商品信息</div>
<div style="margin-bottom: 16px; font-size: 16px">商品信息</div>
<el-table :data="detail.detailList">
<el-table-column label="商品">
<template v-slot="scope">
<div class="shop_info">
<el-image v-if="scope.row.productSkuId!='-999'" :src="scope.row.productImg" style="width: 40px;height: 40px;"></el-image>
<el-image
v-if="scope.row.productSkuId != '-999'"
:src="scope.row.productImg"
style="width: 40px; height: 40px"
></el-image>
<div class="packeFee" v-else>
<span>
{{ scope.row.productName ||'客座费'}}
{{ scope.row.productName || "客座费" }}
</span>
</div>
<div class="info">
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{ scope.row.productName }}</span>
<span style="color: #999;">{{
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{
scope.row.productName
}}</span>
<span style="color: #999">{{
scope.row.productSkuName
}}</span>
</div>
@ -121,29 +138,37 @@
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
x{{ scope.row.num }}
</template>
<template v-slot="scope"> x{{ scope.row.num }} </template>
</el-table-column>
<el-table-column label="单价">
<template v-slot="scope">
{{ scope.row.price }}/
</template>
<template v-slot="scope"> {{ scope.row.price }}/ </template>
</el-table-column>
<el-table-column label="小计">
<template v-slot="scope">
{{ scope.row.priceAmount }}
</template>
<template v-slot="scope"> {{ scope.row.priceAmount }} </template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
<template v-if="scope.row.status!='unpaid'">
<el-button v-if="canTuikuan(scope.row)" type="text" size="mini" @click="tuikuan(scope.row)"><span >退款</span></el-button>
<template v-if="detail.status != 'unpaid'">
<el-button
v-if="canTuikuan(scope.row)"
type="text"
size="mini"
@click="tuikuan(scope.row)"
><span>退款</span></el-button
>
<span class="color-999" v-if="isTui(scope.row)">已退款</span>
</template>
<template v-if="scope.row.status=='unpaid'">
<el-button v-if="canTuicai(scope.row)" type="text" size="mini" @click="tuiCai(scope.row)"><span >退菜</span></el-button>
<span class="color-999" v-if="scope.row=='return'">已退菜</span>
<template v-if="detail.status == 'unpaid'">
<el-button
v-if="canTuicai(scope.row)"
type="text"
size="mini"
@click="tuiCai(scope.row)"
><span>退菜</span></el-button
>
<span class="color-999" v-if="scope.row == 'return'"
>已退菜</span
>
</template>
</template>
</el-table-column>
@ -211,13 +236,13 @@
<!-- </el-tabs> -->
</div>
<return-cart
:modal="false"
:modal="false"
ref="refReturnCart"
:max="selGoods.num"
@confirm="refReturnCartConfirm"
></return-cart>
<return-money
:modal="false"
:modal="false"
ref="refReturnMoney"
:max="selGoods.num"
:goods="selGoods"
@ -232,12 +257,10 @@ import dayjs from "dayjs";
import { tbOrderInfoDetail, tbOrderInfoData } from "@/api/order";
import returnCart from "@/views/tool/Instead/components/return-cart.vue";
import returnMoney from "@/views/tool/Instead/components/return-money.vue";
import {
$returnCart,$returnOrder
} from "@/api/table";
import * as $util from '../order_goods_util.js'
import { $returnCart, $returnOrder } from "@/api/table";
import * as $util from "../order_goods_util.js";
export default {
components: { returnCart,returnMoney },
components: { returnCart, returnMoney },
data() {
return {
@ -247,27 +270,27 @@ export default {
detail: "",
loading: false,
refoundList: [],
selGoods:{num:1}
selGoods: { num: 1 },
};
},
filters: {
orderTypeFilter(t) {
if (t) {
return t && orderEnum.orderType.find(item => item.key == t).label;
return t && orderEnum.orderType.find((item) => item.key == t).label;
} else {
return t;
}
},
sendTypeFilter(t) {
if (t) {
return orderEnum.sendType.find(item => item.key == t).label;
return orderEnum.sendType.find((item) => item.key == t).label;
} else {
return t;
}
},
statusFilter(t) {
if (t) {
return t && orderEnum.status.find(item => item.key == t).label;
return t && orderEnum.status.find((item) => item.key == t).label;
} else {
return t;
}
@ -278,45 +301,85 @@ export default {
} else {
return "-";
}
}
},
},
watch:{
drawer:function(newval){
if(!newval){
watch: {
drawer: function (newval) {
if (!newval) {
this.close();
}
}
},
},
computed: {
vipDiscountAmount() {
if (!this.detail.memberId) {
return 0;
}
if (this.detail.status == "unpaid") {
return this.detail.detailList
.filter((v) => !$util.isTui(v) && v.productId != "-999")
.reduce((prve, cur) => {
if (!cur.isMember) {
return prve + 0;
} else {
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.price;
return prve + (cur.price - memberPrice) * cur.num;
}
}, 0)
.toFixed(2);
}
return 0
},
youHuiJinE() {
console.log(this.vipDiscountAmount);
const discountAmount=this.detail.discountAmount;
const calcDiscountAmount=(this.detail.originAmount*(1-this.detail.discountRatio)).toFixed(2);
console.log(this.detail.originAmount*(1-this.detail.discountRatio))
const n = $util.numSum([
this.vipDiscountAmount,
(discountAmount?discountAmount:calcDiscountAmount),
this.detail.productCouponDiscountAmount,
this.detail.fullCouponDiscountAmount,
this.detail.pointsDiscountAmount,
]);
if (n * 1 <= 0) {
return "-";
}
return n;
},
},
methods: {
close(){
console.log('drawer close')
this.$emit('close');
close() {
console.log("drawer close");
this.$emit("close");
},
isTui(item){
isTui(item) {
return $util.isTui(item);
},
canTuikuan(item){
return $util.canTuiKuan(this.detail,item);
canTuikuan(item) {
return $util.canTuiKuan(this.detail, item);
},
canTuicai(item){
return $util.canTuicai(this.detail,item);
canTuicai(item) {
return $util.canTuicai(this.detail, item);
},
async refReturnMoneyConfirm(e){
async refReturnMoneyConfirm(e) {
const res = await $returnOrder({
...e,
orderId:this.detail.id,
orderDetails:[{
id:this.selGoods.id,
num:e.num
}]
orderId: this.detail.id,
orderDetails: [
{
id: this.selGoods.id,
num: e.num,
},
],
});
this.$message.success("退款成功");
this.update();
},
update(){
update() {
this.tbOrderInfoDetail(this.detail.id);
},
async refReturnCartConfirm(e){
async refReturnCartConfirm(e) {
const res = await $returnCart({
...e,
cartId: this.selGoods.cartId,
@ -325,13 +388,13 @@ export default {
this.$message.success("退菜成功");
this.update();
},
tuikuan(item){
this.selGoods=item;
tuikuan(item) {
this.selGoods = item;
console.log(item);
this.$refs.refReturnMoney.open(item);
},
tuiCai(item){
this.selGoods=item;
tuiCai(item) {
this.selGoods = item;
console.log(item);
this.$refs.refReturnCart.open(item);
},
@ -348,7 +411,7 @@ export default {
source: this.detail.id,
page: 0,
pageSize: 500,
orderType: "0"
orderType: "0",
});
this.refoundList = res.content;
} catch (error) {
@ -371,23 +434,23 @@ export default {
this.type = "1";
this.detail = "";
this.tbOrderInfoDetail(obj.id);
}
}
},
},
};
</script>
<style scoped lang="scss">
.packeFee{
.packeFee {
width: 40px;
box-sizing: border-box;
height: 40px;
background: #3f9eff;
color: #fff;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
color: #fff;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
}
.shop_info {
display: flex;

View File

@ -12,10 +12,18 @@
<div class="u-flex color-999 u-m-t-4">
{{ goods.productSkuName||'' }}
</div>
<div class="flex u-row-between u-p-b-16 u-m-t-10 border-bottom">
<span>退款数量</span>
<div class="u-flex">
<number-box v-model="number" :min="1" :max="max"></number-box>
<div class="u-p-b-16 border-bottom">
<div class="flex u-row-between">
<span>退款数量</span>
<div class="u-flex" v-if="!isSeatFee">
<number-box v-model="number" :min="1" :max="max"></number-box>
</div>
<div class="u-flex" v-else>
{{ number }}
</div>
</div>
<div class="u-font-12 color-999 u-m-t-8" v-if="isSeatFee">
<div><span class="color-red">*</span><span>客座费只能全退</span> </div>
</div>
</div>
<div class="u-m-t-12 u-font-12 color-999">菜品已点数量 {{ max }} </div>
@ -25,7 +33,7 @@
</div>
<div class="u-flex u-m-t-12 ">
<span>退款金额</span>
<span class="color-red font-bold">{{ goods.price * number|to2 }}</span>
<span class="color-red font-bold">{{ tuikuanJine }}</span>
</div>
<div class="u-m-t-26">
<div><span>退款原因</span> <span class="color-red">*</span></div>
@ -57,6 +65,8 @@
</template>
<script>
import numberBox from "./number-box.vue";
import {returnIsSeatFee} from '../util.js'
export default {
components: { numberBox },
props: {
@ -64,12 +74,6 @@ export default {
type: Boolean,
default: true,
},
goods: {
type: Object,
default: () => {
return {};
},
},
max: {
type: Number,
default: 1,
@ -87,8 +91,20 @@ export default {
{ label: "等待时间过长", checked: false },
],
note: "",
goods:{
productId: -999
}
};
},
computed:{
tuikuanJine(){
const danjia=(this.goods.priceAmount||0)/this.goods.num
return (danjia*this.number).toFixed(2);
},
isSeatFee(){
return returnIsSeatFee(this.goods)
}
},
filters:{
to2(val){
return val.toFixed(2);
@ -112,9 +128,15 @@ export default {
}
this.note = tag + "," + this.note;
},
open(note) {
open(item) {
this.goods = item?item:this.goods;
console.log(item)
this.show = true;
this.number = 1;
if (item.productId != "-999") {
this.number = 1;
} else {
this.number = item.num;
}
},
close() {
this.show = false;

View File

@ -2054,6 +2054,9 @@ export default {
if (this.order.status == "finish") {
return;
}
if(!this.table.tableId&&(this.order.list.length<=0&&this.order.old.list.length<=0)){
return ;
}
$setUser({
tableId: this.table.tableId,
masterId: this.masterId,
@ -4510,6 +4513,13 @@ input[type="number"]::-webkit-outer-spin-button {
font-size: 20px;
font-weight: 600;
}
::v-deep input[aria-hidden="true"] {
display: none !important;
}
::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}
::v-deep .categorys .el-tag--plain.el-tag--info {
border: 1px solid #dcdfe6;