代码合并,代客下单增加挂账支付
This commit is contained in:
@@ -500,7 +500,7 @@
|
||||
<el-button
|
||||
size="medium"
|
||||
:disabled="
|
||||
!order.list.length && !order.old.list.length
|
||||
!order.list.length && order.old.list.length <= 0
|
||||
"
|
||||
@click="toCreateOrderDebounce(true)"
|
||||
>
|
||||
@@ -639,10 +639,13 @@
|
||||
>
|
||||
退菜
|
||||
</div>
|
||||
<div @click="refPopChangePriceShow"
|
||||
:class="{ disabled: order.selIndex < 0 }"
|
||||
|
||||
class="btn">单品改价</div>
|
||||
<div
|
||||
@click="refPopChangePriceShow"
|
||||
:class="{ disabled: order.selIndex < 0 }"
|
||||
class="btn"
|
||||
>
|
||||
单品改价
|
||||
</div>
|
||||
<div class="btn">等叫</div>
|
||||
<div class="btn no-wrap u-font-12">取消全部等叫</div>
|
||||
|
||||
@@ -924,8 +927,35 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex flex-wrap">
|
||||
<span class="font-bold no-wrap">团购代金券</span>
|
||||
<div
|
||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||
@click="shouwTuanQuan"
|
||||
>
|
||||
<span class="color-999 u-p-r-10">代金券名称</span>
|
||||
<span
|
||||
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||
></span>
|
||||
</div>
|
||||
<img
|
||||
style="width: 30px; height: 30px"
|
||||
class="cur-pointer"
|
||||
@click="shouwTuanQuan"
|
||||
src="@/assets/images/scan.png"
|
||||
/>
|
||||
<!-- <el-button size="medium " type="text">
|
||||
查看不可用券
|
||||
</el-button> -->
|
||||
</div>
|
||||
<template v-if="tuanQuan">
|
||||
<tuan-quan-table
|
||||
:data="tuanQuan.goods"
|
||||
type="show"
|
||||
ref="refGoodsTable"
|
||||
></tuan-quan-table>
|
||||
</template>
|
||||
<div class="u-flex flex-wrap u-m-t-20">
|
||||
<span class="font-bold no-wrap">优惠券</span>
|
||||
<div
|
||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||
@@ -936,6 +966,7 @@
|
||||
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||
></span>
|
||||
</div>
|
||||
|
||||
<!-- <el-button size="medium " type="text">
|
||||
查看不可用券
|
||||
</el-button> -->
|
||||
@@ -1010,6 +1041,7 @@
|
||||
:disabledPayType="disabledPayType"
|
||||
>
|
||||
</pay-type>
|
||||
<el-button @click="guazhangShow">挂账</el-button>
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="primary" size="medium" @click="payOrder">
|
||||
<span>立即支付</span>
|
||||
@@ -1411,6 +1443,14 @@
|
||||
:vipUser="vipUser"
|
||||
@updateCart="updateCartItem"
|
||||
></cart-change-price>
|
||||
<!-- 团购券 -->
|
||||
<pop-tuan-quan
|
||||
:cartGoods="createOrder.data.detailList || []"
|
||||
ref="refPopTuanQuan"
|
||||
@confirm="tuanQuanConfirm"
|
||||
></pop-tuan-quan>
|
||||
<!-- 挂账 -->
|
||||
<popup-choose-guazhang ref="refGuaZhang" :payMoney="yinFuJinE"></popup-choose-guazhang>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1429,6 +1469,10 @@ import returnCart from "./components/return-cart.vue";
|
||||
import moneyKeyboard from "./components/money-keyboard.vue";
|
||||
import caiAdd from "./components/popup-linshiCai.vue";
|
||||
import cartChangePrice from "./components/popup-cart-changePrice.vue";
|
||||
import popTuanQuan from "./components/popup-tuan-quan.vue";
|
||||
import tuanQuanTable from "./components/tuan-quan-table.vue";
|
||||
import popupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
import { hasPermission } from "@/utils/limits.js";
|
||||
@@ -1463,6 +1507,7 @@ import {
|
||||
} from "@/api/table";
|
||||
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
import { $checkCoupon } from "@/api/Instead";
|
||||
import {
|
||||
isCanBuy,
|
||||
arrayContainsAll,
|
||||
@@ -1479,11 +1524,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
|
||||
//商品数量从0到n每一个对应的价格
|
||||
let $goodsPayPriceMap = {};
|
||||
import { $status } from "@/utils/table.js";
|
||||
import PopupChooseGuazhang from './components/popup-choose-guazhang.vue';
|
||||
|
||||
let $originTableList = [];
|
||||
export default {
|
||||
components: {
|
||||
popupChooseGuazhang,
|
||||
cartChangePrice,
|
||||
popTuanQuan,
|
||||
tuanQuanTable,
|
||||
caiAdd,
|
||||
quansPop,
|
||||
returnCart,
|
||||
@@ -1496,6 +1545,7 @@ export default {
|
||||
moneyDiscount,
|
||||
cartItem,
|
||||
chooseDinersNumber,
|
||||
PopupChooseGuazhang,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -1512,6 +1562,8 @@ export default {
|
||||
value: 0,
|
||||
toMoney: 0,
|
||||
},
|
||||
//团购券
|
||||
tuanQuan: "",
|
||||
//选中可用优惠券
|
||||
quansSelArr: [],
|
||||
//台桌搜索文字
|
||||
@@ -2194,10 +2246,22 @@ export default {
|
||||
this.open(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
//挂账
|
||||
guazhangShow(){
|
||||
this.$refs.refGuaZhang.open();
|
||||
},
|
||||
//团购券扫码弹窗
|
||||
shouwTuanQuan() {
|
||||
this.$refs.refPopTuanQuan.open();
|
||||
},
|
||||
tuanQuanConfirm(e) {
|
||||
console.log(e);
|
||||
this.tuanQuan = e;
|
||||
},
|
||||
//更新单品改价数据
|
||||
updateCartItem(res){
|
||||
if(res){
|
||||
this.order.list[this.order.selIndex]=res
|
||||
updateCartItem(res) {
|
||||
if (res) {
|
||||
this.order.list[this.order.selIndex] = res;
|
||||
}
|
||||
},
|
||||
// 单品改价
|
||||
@@ -2923,6 +2987,15 @@ export default {
|
||||
return prve;
|
||||
}, []);
|
||||
try {
|
||||
// 核销团购券商品
|
||||
if (this.tuanQuan && this.tuanQuan.goods.length > 0) {
|
||||
await $checkCoupon({
|
||||
code: this.tuanQuan.couponCode,
|
||||
num: this.tuanQuan.number,
|
||||
orderId: this.createOrder.data.id,
|
||||
cartId: this.tuanQuan.goods.map((v) => v.cartId),
|
||||
});
|
||||
}
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
|
||||
Reference in New Issue
Block a user