diff --git a/src/assets/images/shalou.png b/src/assets/images/shalou.png new file mode 100644 index 0000000..46cd083 Binary files /dev/null and b/src/assets/images/shalou.png differ diff --git a/src/views/table/components/table-diancan-components/return-cart copy.vue b/src/views/table/components/table-diancan-components/return-cart copy.vue new file mode 100644 index 0000000..d160c95 --- /dev/null +++ b/src/views/table/components/table-diancan-components/return-cart copy.vue @@ -0,0 +1,109 @@ + + + + \ No newline at end of file diff --git a/src/views/table/components/table-diancan-components/return-cart.vue b/src/views/table/components/table-diancan-components/return-cart.vue index d160c95..61678f2 100644 --- a/src/views/table/components/table-diancan-components/return-cart.vue +++ b/src/views/table/components/table-diancan-components/return-cart.vue @@ -1,18 +1,18 @@ -
+
-
+
@@ -341,6 +342,9 @@
+
+ +
@@ -401,14 +405,14 @@
存单
取单 @@ -438,12 +442,19 @@
整单备注
+ 退菜 +
+
@@ -1275,10 +1286,8 @@ export default { return result.substring(0, result.length - 1); }, allPrice() { - const oldPrice = this.order.old.list - .filter((v) => v.isGift !== "true") - .reduce((a, b) => { - const bTotal = b.info.reduce((prve, cur) => { + const oldPrice = this.order.old.list.reduce((a, b) => { + const bTotal = b.info.filter((v) => v.isGift !== "true").reduce((prve, cur) => { return prve + cur.number * cur.salePrice; }, 0); return a + bTotal; @@ -1724,6 +1733,7 @@ export default { console.log(isNowPay); console.log(this.postPay && isNowPay); this.createOrder.status = "success"; + this.getCart() if (this.postPay && !isNowPay) { this.$notify({ title: "下单成功", @@ -2364,16 +2374,25 @@ export default { }, //获取购物车数据 async getCart() { + this.order.list=[] + this.order.old.list=[] const res = await getCart({ ...this.order.query, masterId: this.masterId, tableId: this.table.tableId, }); - if (this.key|| res.records.length) { - this.order.old.list = res.records; - } else { - this.order.list = res.records; + for(let i in res.records){ + if(res.records[i].placeNum==0){ + this.order.list = res.records[i].info; + }else{ + this.order.old.list.push(res.records[i]); + } } + // if (this.key|| res.records.length) { + // this.order.old.list = res.records; + // } else { + // this.order.list = res.records; + // } }, showSelGoods(item) { console.log(item); @@ -3316,19 +3335,20 @@ input[type="number"]::-webkit-outer-spin-button { border-bottom: 1px solid #ebebeb; margin-bottom: 10px; } + .order-list-all{ + } .order { border-radius: 6px; display: flex; - padding-left: 12px; .bottom { - left: 0; - right: 0; box-sizing: border-box; - padding: 14px; - bottom: 0; + padding:0 14px 14px 14px; background-color: #fff; z-index: 10; - border-top: 1px solid #ebebeb; + .border-top{ + padding-top: 14px; + border-top: 1px solid #ebebeb; + } } .list { @@ -3385,6 +3405,7 @@ input[type="number"]::-webkit-outer-spin-button { color: #fff; text-align: center; line-height: 17px; + z-index: 2; } &.active { background-color: rgba(0, 0, 0, 0.04); diff --git a/src/views/table/status.js b/src/views/table/status.js index beacd71..17b21e6 100644 --- a/src/views/table/status.js +++ b/src/views/table/status.js @@ -13,7 +13,7 @@ export default { }, idle: { label: "空闲", - type: "#67C23A", + type: "#3F9EFF", }, subscribe: { label: "预定", diff --git a/src/views/table/table_list.vue b/src/views/table/table_list.vue index 1ee95ad..ee50e58 100644 --- a/src/views/table/table_list.vue +++ b/src/views/table/table_list.vue @@ -41,6 +41,20 @@ 下载店铺码
+
+
+ + {{ item.label }} +
+ +
- {{ item.name }} +
+ {{ item.name }} + 丨{{areaMap[item.areaId]||''}} +
@@ -65,8 +82,9 @@
+
-
+ + + + + +
+ | + + ¥{{item.totalAmount||0}}「{{item.productNum}}件」 +
+
- +
- +
+ + {{item.durationTime|formatTime}} +
+
+
@@ -177,6 +199,7 @@ import { tbShopAreaDelete, tbShopTableDelete, } from "@/api/table"; +import dayjs from "dayjs"; export default { components: { addEara, @@ -192,12 +215,18 @@ export default { total: 0, tableList: [], status: $status, - selTable:''//当前选中的桌台 + selTable:'',//当前选中的桌台 + areaMap:{} }; }, mounted() { this.tbShopAreaGet(); }, + filters:{ + formatTime(time){ + return dayjs(time).format('HH小时mm分'); + } + }, methods: { tableComman(command, item) { if (command == "edit") { @@ -226,10 +255,11 @@ export default { //key isPayOrder结账 console.log(item) this.selTable=item - if(item.status=='idle'){ + const num=item.useNum||0 + if(item.useNum<=0){ return this.$refs.refChooseDinersNumber.open() } - this.$refs.diancan.open(item, key); + this.$refs.diancan.open(item, key,num); }, chooseDinersNumberConfirm(num){ //就餐人数 @@ -290,6 +320,10 @@ export default { shopId: localStorage.getItem("shopId"), }); this.tabs = content; + this.areaMap=content.reduce((prve,cur)=>{ + prve[cur.id]=cur.name + return prve + },{}) this.tbShopTableGet(); } catch (error) { console.log(error); @@ -305,6 +339,9 @@ export default { } \ No newline at end of file +