From 411b434b265a9e348308d2ca2563198b61bb88d9 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 15 Oct 2024 17:19:18 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E5=B0=86=E4=B9=8B=E5=89=8D=E7=9A=84=E6=89=93=E5=8C=85=E8=B5=A0?= =?UTF-8?q?=E9=80=81=E7=AD=89=E6=8E=A5=E5=8F=A3=E4=BB=8E=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/Instead/components/cart-item.vue | 2 +- src/views/tool/Instead/index.vue | 119 +++++++++++++++--- src/views/tool/Instead/util.js | 13 ++ 3 files changed, 116 insertions(+), 18 deletions(-) diff --git a/src/views/tool/Instead/components/cart-item.vue b/src/views/tool/Instead/components/cart-item.vue index 1fcab58..c958b53 100644 --- a/src/views/tool/Instead/components/cart-item.vue +++ b/src/views/tool/Instead/components/cart-item.vue @@ -211,7 +211,7 @@ export default { padding: 4px; border-radius: 2px; display: flex; - overflow: hidden; + overflow: visible; cursor: pointer; align-items: center; justify-content: space-between; diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index a2c6ab6..30d49e9 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -268,8 +268,23 @@ :selIndex="order.selIndex" > +
以下是优惠菜品
+
@@ -321,6 +336,24 @@ >
+ + +
订单备注: {{ note.content }}
@@ -328,9 +361,9 @@
-
- 已优惠¥{{ allGiftMoney | to2 }} - +
+ 已优惠¥{{ allGiftMoney }} +
@@ -1169,6 +1202,7 @@ import { arrayContainsAll, generateCombinations, returnReverseVal, + returnGiftArr } from "./util.js"; import { $status } from "@/utils/table.js"; export default { @@ -1271,6 +1305,13 @@ export default { total: 0, }, order: { + packFee: { + totalNumber: 0, + status: "", + number: 0, + name: "打包费", + totalAmount: 0, + }, extra: { selIndex: -1, }, @@ -1381,15 +1422,49 @@ export default { return this.table ? "代客下单" + `(${this.table.name})` : "代客下单"; }, allGiftMoney() { - const price = this.order.list + const nowprice = this.order.list .filter((v) => v.isGift === "true" || v.status == "return") .reduce((a, b) => { return a + b.number * b.salePrice; }, 0); - return price; + + const oldPrice=this.order.old.list.reduce((a,b)=>{ + const total=b.info.filter((v) => v.isGift === "true").reduce((prve, cur) => { + return prve + cur.number * cur.salePrice; + },0) + return a+total + },0) + return (nowprice+oldPrice).toFixed(2); + }, + allPackMoney() { + let n = 0; + const nowPrice = this.order.list + .filter((v) => v.isPack === "true") + .reduce((a, b) => { + n += b.number * 1; + return a + b.packFee * 1; + }, 0); + const oldPrice = this.order.old.list.reduce((a, b) => { + const bPrice= b.info.filter((v) => v.isPack === "true").reduce((prve, cur) => { + n += cur.number * 1; + return prve + cur.packFee * 1; + }, 0); + return a + bPrice; + }, 0); + + const total = (nowPrice + oldPrice).toFixed(2); + this.order.packFee.totalAmount = total; + this.order.packFee.totalNumber = n; + return total; }, giftLen() { - return this.order.list.filter((v) => v.isGift === "true").length; + const nowlen=this.order.list.filter((v) => v.isGift === "true").length + const oldlen=this.order.old.list.reduce((prve,cur)=>{ + const arr=cur.info.filter((v) => v.isGift === "true") + prve.push(...arr) + return prve + },[]).length + return nowlen+oldlen; }, isSku() { if (this.order.selIndex < 0 || this.order.list.length <= 0) { @@ -1436,6 +1511,7 @@ export default { return ( oldPrice + price + + +this.order.packFee.totalAmount + this.order.seatFee.totalAmount * (this.order.seatFee.status == "return" ? 0 : 1) ).toFixed(2); @@ -1643,6 +1719,7 @@ export default { methods: { changeOrderExtraSel(index, canChangeNumber, placeNum) { // console.log(index,canChangeNumber,placeNum) + this.order.selIndex = -1; this.order.selGoods = this.order.seatFee; this.order.selPlaceNum = placeNum; this.order.extra.selIndex = index; @@ -1692,9 +1769,9 @@ export default { return res; }, async payBeforeClear() { - this.getMasterId().then(res=>{ + this.getMasterId().then((res) => { this.masterId = res.masterId; - }) + }); this.loading = false; this.order.list = []; this.order.query.page = 1; @@ -1721,7 +1798,7 @@ export default { this.key = ""; this.order.orderId = ""; this.perpole = ""; - this.useTypes.sel = "dine-in"; + // this.useTypes.sel = "dine-in"; }, async cachePay() { await this.returnCreateOrderData(); @@ -1734,14 +1811,15 @@ export default { this.order.payType = "scanCode"; this.payTypeItemClick({ payType: "scanCode" }); }, - changeOrderUseType(useType) { + async changeOrderUseType(useType) { if (useType && this.order.list.length) { const tableId = useType == "takeout" ? undefined : this.table.tableId; - $changeUseType({ + await $changeUseType({ useType, tableId, cartIds: this.order.list.map((v) => v.id), }); + this.getCart(); } }, //设置用餐类型 @@ -1955,7 +2033,8 @@ export default { isSellOut(item) { return ( item.isPauseSale || - (item.typeEnum !== "sku" && item.specList[0].stockNumber <= 0) + (item.typeEnum !== "sku" && + (item.isStock == 1 ? item.stockNumber <= 0 : false)) ); }, toggleFullScreen() { @@ -2183,8 +2262,9 @@ export default { updateOrder(par = {}) { let item = this.order.list[this.order.selIndex]; console.log(item.specSnap); - const { productId, skuId, isPack, isGift, number } = item; - addCart({ + const { productId, skuId, isPack, isGift, number, id } = item; + $updateCart({ + cartId: id, masterId: this.masterId, vipUserId: this.vipUser.id, productId, @@ -2794,12 +2874,16 @@ export default { }, //设置购物车数据 setCart(res) { + console.log(res); this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee; this.perpole = res.seatFee ? res.seatFee.totalNumber : 1; const nowCart = res.records.find((v) => v.placeNum == 0); this.order.list = nowCart ? nowCart.info : []; const oldCart = res.records.filter((v) => v.placeNum != 0); this.order.old.list = oldCart ? oldCart : []; + this.order.gift.list=returnGiftArr(res.records) + console.log( this.order.old.list); + }, //获取购物车数据 async getCart() { @@ -2951,9 +3035,9 @@ export default { return false; } let isShow = true; - if (v.typeEnum !== "sku") { - isShow = v.specList.length >= 1; - } + // if (v.typeEnum !== "sku") { + // isShow = v.specList.length >= 1; + // } v.specList.map((spe) => { $goodsMap[`${v.id}_${spe.id}`] = spe; }); @@ -3798,6 +3882,7 @@ input[type="number"]::-webkit-outer-spin-button { justify-content: space-between; background-color: rgba(0, 0, 0, 0); transition: all 0.3s; + overflow: visible; .pack { right: 100%; width: 18px; diff --git a/src/views/tool/Instead/util.js b/src/views/tool/Instead/util.js index 2ec3413..3b7bd4d 100644 --- a/src/views/tool/Instead/util.js +++ b/src/views/tool/Instead/util.js @@ -45,3 +45,16 @@ export function returnReverseVal(val, isReturnString = true) { } return reverseNewval; } + +export function returnGiftArr(arr){ + let result=[] + for(let i=0;i Date: Thu, 17 Oct 2024 11:39:10 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A0=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E5=8F=B0=E6=A1=8C=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/Instead/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 30d49e9..d3d48a5 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -207,6 +207,9 @@ }}
+
+ 无可用桌台 +
{{ table ? "桌台号:" + table.name : "桌台号/取餐号" }} From d40a7b18560e3245aeeb37de727a1964f07eff62 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 17 Oct 2024 13:55:01 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/Instead/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index d3d48a5..bcd136f 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1385,7 +1385,7 @@ export default { { label: "图文显示", value: "img-and-text" }, { label: "文字显示", value: "text" }, ], - sel: "img-and-text", + sel: "default", }, // 选择用户 vipUser: { @@ -4003,7 +4003,7 @@ input[type="number"]::-webkit-outer-spin-button { font-size: 14px; position: absolute; inset: 0; - background: rgba(0, 0, 0, 0.4); + background: rgba(46, 46, 46, 0.38); color: #fff; box-sizing: border-box; padding: 10px; From 401e9fc8d3cbf084b755355eac5ef05a644ea860 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Fri, 18 Oct 2024 13:44:11 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/devices/details.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/devices/details.vue b/src/views/devices/details.vue index 478a4bb..c27342f 100644 --- a/src/views/devices/details.vue +++ b/src/views/devices/details.vue @@ -115,9 +115,15 @@ export default { return { forms: { sort: "0", - status: "0", - connectionType: "network", printType: [], - selectcheckbox: [] + status: 1, + connectionType: "network", + selectcheckbox: [], + + receiptSize: '58mm', + classifyPrint: '0', + printQty: 'm1^1', + printType: ["refund", 'handover', 'queue'], + printMethod: "all", }, partList: [] } From 0fd7264309152b22ae553cba7415182adc0513d3 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Fri, 18 Oct 2024 15:53:21 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/devices/details.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/devices/details.vue b/src/views/devices/details.vue index c27342f..8a58cc4 100644 --- a/src/views/devices/details.vue +++ b/src/views/devices/details.vue @@ -49,6 +49,7 @@ 部分分类 +
仅打印制作单[厨房]
+ +
+
+ + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/return-cart.vue b/src/views/tool/Instead/components/return-cart.vue index 61678f2..5442ae4 100644 --- a/src/views/tool/Instead/components/return-cart.vue +++ b/src/views/tool/Instead/components/return-cart.vue @@ -1,10 +1,19 @@ diff --git a/src/views/tool/Instead/components/return-cart.vue b/src/views/tool/Instead/components/return-cart.vue index 5442ae4..5937eb0 100644 --- a/src/views/tool/Instead/components/return-cart.vue +++ b/src/views/tool/Instead/components/return-cart.vue @@ -3,11 +3,11 @@
退菜数量
- +
- 菜品已点数量 2 份 + 菜品已点数量 {{max}} 份
退菜原因 *
@@ -50,6 +50,10 @@ export default { default:()=>{ return{} } + }, + max:{ + type:Number, + default:1 } }, data() { @@ -73,6 +77,8 @@ export default { }, reset() { this.note = ""; + this.number=1; + console.log(this.number) }, delTag(index) { this.tags.splice(index, 1); @@ -85,9 +91,11 @@ export default { }, open(note) { this.show = true; + this.number=1; }, close() { this.show = false; + this.number=1; }, confirm() { const selTag=this.tags.filter(item=>item.checked).map(item=>item.label).join(",") diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index e158bf9..8a9aa4a 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1166,6 +1166,7 @@
From 36d667326ef5358b2c48a8cb1c9edc266f917f0d Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 22 Oct 2024 13:28:09 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E9=80=80=E8=8F=9C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/table.js | 11 ++ .../order_manage/components/orderDetail.vue | 62 ++++++- .../tool/Instead/components/cart-item.vue | 2 +- .../tool/Instead/components/return-cart.vue | 14 +- .../tool/Instead/components/return-money.vue | 175 ++++++++++++++++++ 5 files changed, 254 insertions(+), 10 deletions(-) create mode 100644 src/views/tool/Instead/components/return-money.vue diff --git a/src/api/table.js b/src/api/table.js index 34af13a..57bf688 100644 --- a/src/api/table.js +++ b/src/api/table.js @@ -439,3 +439,14 @@ export function $getOrderPayUrl(data) { } }); } +//退款 +export function $returnOrder(data) { + return request({ + url: '/api/place/returnOrder', + method: "post", + data:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} diff --git a/src/views/order_manage/components/orderDetail.vue b/src/views/order_manage/components/orderDetail.vue index 86127d7..c8007f7 100644 --- a/src/views/order_manage/components/orderDetail.vue +++ b/src/views/order_manage/components/orderDetail.vue @@ -130,12 +130,12 @@ ¥{{ scope.row.priceAmount }} - +
@@ -199,6 +199,19 @@ -->
+ + @@ -206,8 +219,14 @@ import orderEnum from "../orderEnum"; 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"; export default { + components: { returnCart,returnMoney }, + data() { return { orderEnum, @@ -215,7 +234,8 @@ export default { type: "1", detail: "", loading: false, - refoundList: [] + refoundList: [], + selGoods:{num:1} }; }, filters: { @@ -249,11 +269,37 @@ export default { } }, methods: { - tuikuan(item){ - + async refReturnMoneyConfirm(e){ + const res = await $returnOrder({ + ...e, + orderId:this.detail.id, + orderDetails:[{ + id:this.selGoods.id, + num:e.num + }] + }); + this.update(); }, - tuiCaidan(item){ - + update(){ + this.tbOrderInfoDetail(this.detail.id); + }, + async refReturnCartConfirm(e){ + const res = await $returnCart({ + ...e, + cartId: this.selGoods.id, + tableId: this.detail.tableId, + }); + this.update(); + }, + tuikuan(item){ + this.selGoods=item; + console.log(item); + this.$refs.refReturnMoney.open(item); + }, + tuiCai(item){ + this.selGoods=item; + console.log(item); + this.$refs.refReturnCart.open(item); }, // 切换类型 getTableData() { diff --git a/src/views/tool/Instead/components/cart-item.vue b/src/views/tool/Instead/components/cart-item.vue index 9b84f2e..f88f087 100644 --- a/src/views/tool/Instead/components/cart-item.vue +++ b/src/views/tool/Instead/components/cart-item.vue @@ -76,7 +76,7 @@ }" > ¥{{ item.totalAmount }} - ¥{{ item.salePrice }} + ¥{{ item.totalAmount }} diff --git a/src/views/tool/Instead/components/return-cart.vue b/src/views/tool/Instead/components/return-cart.vue index 5937eb0..c99550d 100644 --- a/src/views/tool/Instead/components/return-cart.vue +++ b/src/views/tool/Instead/components/return-cart.vue @@ -1,5 +1,5 @@