-
备注:{{ item.note || "" }}
+
备注:{{ item.note }}
备注:
@@ -74,11 +78,23 @@
¥{{ isShowVipPrice ? vipAllPrice : allPrice }}
+
+ ¥{{ discountNewPrice }}
+
+ ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}
+
+
¥{{ item.totalAmount }}
-
¥{{ vipAllPrice }}
-
+
+ ¥{{ vipAllPrice }}
+
+
¥{{ allPrice }}
@@ -142,13 +158,21 @@ export default {
};
},
computed: {
+ discountNewPrice(){
+ const item = this.item;
+ const originPrice=this.isShowVipPrice?this.vipAllPrice:this.allPrice
+ const discount=(this.item.discountSaleAmount*this.item.number)
+ return (originPrice-discount).toFixed(2)
+ },
vipAllPrice() {
const item = this.item;
const price =
this.isShowVipPrice &&
item.memberPrice != null &&
item.memberPrice != undefined
- ? (item.memberPrice<=0?item.salePrice:item.memberPrice)
+ ? item.memberPrice <= 0
+ ? item.salePrice
+ : item.memberPrice
: item.salePrice;
return (price * item.number + (item.packAmount || 0)).toFixed(2);
},
@@ -262,27 +286,36 @@ export default {
justify-content: space-between;
background-color: rgba(0, 0, 0, 0);
transition: all 0.3s;
- .pack {
- right: 100%;
+ .status-box {
width: 18px;
- height: 18px;
+ position: absolute;
+ top: 4px;
+ right: 100%;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ > span {
+ display: block;
+ width: 18px;
+ height: 18px;
+ border-radius: 4px 0 4px 0;
+ font-size: 12px;
+ line-height: 17px;
+ text-align: center;
+ color: #fff;
+ }
+ }
+ .isWaitCall {
+ background: #d3adf7;
+ }
+ .pack {
+ background: #35ac6a;
+ }
+ .da {
background: #35ac6a;
- border-radius: 4px 0 4px 0;
- font-size: 12px;
- color: #fff;
- text-align: center;
- line-height: 17px;
}
.tui {
- right: 100%;
- width: 18px;
- height: 18px;
background: #ac4735;
- border-radius: 4px 0 4px 0;
- font-size: 12px;
- color: #fff;
- text-align: center;
- line-height: 17px;
}
&.active {
background-color: rgba(0, 0, 0, 0.04);
diff --git a/src/views/tool/Instead/components/popup-cart-changePrice.vue b/src/views/tool/Instead/components/popup-cart-changePrice.vue
index 9a619ba..c0ad96c 100644
--- a/src/views/tool/Instead/components/popup-cart-changePrice.vue
+++ b/src/views/tool/Instead/components/popup-cart-changePrice.vue
@@ -131,9 +131,9 @@ export default {
this.max=returnCartPrice(this.goods,this.vipUser)
this.show = true;
if (item.productId != "-999") {
- this.number = 1;
+
} else {
- this.number = item.num;
+ this.price = item.discountSaleAmount||'';
}
},
close() {
diff --git a/src/views/tool/Instead/components/popup-choose-guazhang.vue b/src/views/tool/Instead/components/popup-choose-guazhang.vue
index 99e6720..6f9c351 100644
--- a/src/views/tool/Instead/components/popup-choose-guazhang.vue
+++ b/src/views/tool/Instead/components/popup-choose-guazhang.vue
@@ -143,8 +143,10 @@ export default {
if (this.number * 1 <= 0) {
return this.$message("支付金额不正确");
}
- console.log(this.number);
- this.$emit("confirm", this.number);
+ if (!this.guazhangRen) {
+ return this.$message("请选择挂账人");
+ }
+ this.$emit("confirm",this.guazhangRen, this.number);
this.close();
},
open(number) {
diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue
index cbd4f73..59c1e8b 100644
--- a/src/views/tool/Instead/index.vue
+++ b/src/views/tool/Instead/index.vue
@@ -399,11 +399,18 @@
会员优惠
{{ vipDiscountPrice }}
+
+ 单品改价优惠
+ {{ discountSaleAmount }}
+
已优惠¥{{ youhuiAllPrice }}
@@ -638,6 +645,14 @@
@click="orderBtnsClick('returnCart')"
>
退菜
+
+
+ {{ returnPrintText }}
+
单品改价
- 等叫
- 取消全部等叫
+
+ {{ returnWaingText }}
+
+
+ {{ returnWaingAllText }}
+
-
+
@@ -1507,7 +1539,7 @@ import {
} from "@/api/table";
import { tbShopCategoryGet } from "@/api/shop";
-import { $checkCoupon } from "@/api/Instead";
+import { $checkCoupon,$waitCall } from "@/api/Instead";
import {
isCanBuy,
arrayContainsAll,
@@ -1524,7 +1556,7 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
//商品数量从0到n每一个对应的价格
let $goodsPayPriceMap = {};
import { $status } from "@/utils/table.js";
-import PopupChooseGuazhang from './components/popup-choose-guazhang.vue';
+import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue";
let $originTableList = [];
export default {
@@ -1549,6 +1581,8 @@ export default {
},
data() {
return {
+ //挂账人
+ guazhangRen: "",
disabledPayType: [],
//积分抵扣
points: {
@@ -1762,9 +1796,33 @@ export default {
},
},
timer: null,
+ isAllWaitCall: false,
};
},
computed: {
+ returnPrintText(){
+ if (this.order.selIndex < 0) {
+ return "免厨打";
+ }
+ return this.order.list[this.order.selIndex].isPrint
+ ? "免厨打"
+ : "打印";
+ },
+ returnWaingText() {
+ if (this.order.selIndex < 0) {
+ return "等叫";
+ }
+ return this.order.list[this.order.selIndex].isWaitCall == 1
+ ? "取消等叫"
+ : "等叫";
+ },
+ isHasWaiting() {
+ const waitingArr = this.order.list.filter((v) => v.isWaitCall == 1);
+ return waitingArr.length > 0 ? true : false;
+ },
+ returnWaingAllText() {
+ return this.isAllWaitCall ? "取消全部等叫" : "整单等叫";
+ },
pointsDiscountAmount() {
if (this.points.selected) {
return this.points.toMoney;
@@ -1970,8 +2028,28 @@ export default {
}, 0);
return (oldMemberPrice + nowMemberprice).toFixed(2);
},
+ discountSaleAmount() {
+ const oldTotal = this.order.old.list.reduce((a, b) => {
+ const bTotal = b.info
+ .filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
+ .reduce((prve, cur) => {
+ return prve + cur.number * cur.discountSaleAmount;
+ }, 0);
+ return a + bTotal;
+ }, 0);
+ const nowTotal = this.order.list
+ .filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
+ .reduce((a, b) => {
+ return a + b.number * b.discountSaleAmount;
+ }, 0);
+ return (oldTotal + nowTotal).toFixed(2);
+ },
youhuiAllPrice() {
- return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2);
+ return (
+ this.vipDiscountPrice * 1 +
+ this.allGiftMoney * 1 +
+ this.discountSaleAmount * 1
+ ).toFixed(2);
},
allNumber() {
const oldNumber = this.order.old.list.reduce((a, b) => {
@@ -2246,8 +2324,16 @@ export default {
this.open(this.$route.query);
},
methods: {
+ //挂账人支付确认
+ guazhangPayConfirm(guazhangren, price) {
+ this.guazhangRen = guazhangren;
+ this.pays({
+ creditBuyerId: this.guazhangRen.id,
+ payType: "creditBuyer",
+ });
+ },
//挂账
- guazhangShow(){
+ guazhangShow() {
this.$refs.refGuaZhang.open();
},
//团购券扫码弹窗
@@ -2261,7 +2347,8 @@ export default {
//更新单品改价数据
updateCartItem(res) {
if (res) {
- this.order.list[this.order.selIndex] = res;
+ // this.order.list[this.order.selIndex] = res;
+ this.$set(this.order.list, this.order.selIndex, res)
}
},
// 单品改价
@@ -2972,7 +3059,7 @@ export default {
this.pays();
},
// 支付订单
- async pays() {
+ async pays(par) {
this.loading = true;
const userCouponInfos = this.quansSelArr.reduce((prve, cur) => {
const index = prve.findIndex((v) => v.userCouponId == cur.couponId);
@@ -3004,8 +3091,9 @@ export default {
vipUserId: this.createOrder.data.memberId || this.vipUser.id,
discount: this.createOrder.discount,
code: this.createOrder.code,
- userCouponInfos,
+ userCouponInfos: userCouponInfos.length > 0 ? userCouponInfos : "",
pointsNum: this.points.value,
+ ...par,
});
this.loading = false;
this.payOrderSuccess();
@@ -3133,7 +3221,16 @@ export default {
updateOrder(par = {}) {
let item = this.order.list[this.order.selIndex];
console.log(this.table);
- const { productId, skuId, isPack, isGift, number, id } = item;
+ const {
+ productId,
+ skuId,
+ isPack,
+ isGift,
+ number,
+ id,
+ isPrint,
+ isWaitCall,
+ } = item;
$updateCart({
cartId: id,
masterId: this.masterId,
@@ -3144,6 +3241,8 @@ export default {
num: number,
isPack: isPack === "true" ? true : false,
isGift: isGift === "true" ? true : false,
+ isPrint,
+ isWaitCall,
...par,
}).then((res) => {
this.$set(this.order.list, this.order.selIndex, {
@@ -3196,7 +3295,7 @@ export default {
// },
//右侧控制按钮点击事件
- orderBtnsClick(key) {
+ async orderBtnsClick(key) {
const orderGoods = this.order.list[this.order.selIndex];
if (this.key != "isJieZhang" && this.payAfter) {
this.createOrderClose();
@@ -3221,6 +3320,27 @@ export default {
if (key === "del") {
return this.removeCart();
}
+ if (key === "print") {
+ const isPrint = orderGoods.isPrint;
+ this.updateOrder({ isPrint: !isPrint });
+ return;
+ }
+ if (key === "isWaitCall") {
+ const isWaitCall = orderGoods.isWaitCall;
+ this.updateOrder({ isWaitCall: !isWaitCall });
+ return;
+ }
+ if (key == "AllWaitCall") {
+ await $waitCall({
+ orderId:this.createOrder.data.id,
+ masterId:this.masterId,
+ tableId:this.table.tableId,
+ isWaitCall: !this.isAllWaitCall?1:0
+ })
+ this.isAllWaitCall=!this.isAllWaitCall;
+ this.getCart()
+ return;
+ }
if (key === "save") {
this.prveOrder.list.push({
cart: this.order.list,
@@ -3621,6 +3741,7 @@ export default {
tableId: this.table.tableId,
num: this.skuGoods.number, // 0会删除此商品
isPack: false, // 是否打包
+ isWaitCall:this.isAllWaitCall //是否等叫
});
this.orderListPush({ ...res, specSnap: name });
// this.orderListPush({
@@ -3726,6 +3847,7 @@ export default {
},
reset() {
// this.goods.list = [];
+ this.guazhangRen = "";
this.order.status = "";
this.loading = false;
this.table = "";
@@ -3922,6 +4044,7 @@ export default {
tableId: this.table.tableId,
num: item.specList[0].suit, // 0会删除此商品
isPack: false, // 是否打包
+ isWaitCall:this.isAllWaitCall //是否等叫
});
this.orderListPush(res);
}