修改代课下单本地测试环境
This commit is contained in:
parent
e0be30bd02
commit
51e410a4be
|
|
@ -5,7 +5,7 @@ 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 = 'http://t361017w45.qicp.vip/'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ ENV = 'production'
|
|||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
# 测试
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
VUE_APP_BASE_API = 'http://t361017w45.qicp.vip/'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ export function $cacheOrder(data) {
|
|||
*/
|
||||
export function $getCacheOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/car`,
|
||||
url: `/api/place/pending/cart`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
|
|
@ -295,3 +295,25 @@ export function $getCacheOrder(data) {
|
|||
});
|
||||
}
|
||||
|
||||
// 会员点单/取消会员点单
|
||||
export function $setUser(data) {
|
||||
return request({
|
||||
url: `/api/place/updateVip`,
|
||||
method: "delete",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 删除订单
|
||||
export function $delOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/order`,
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -67,11 +67,17 @@
|
|||
</div>
|
||||
<div class="flex row-between">
|
||||
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
||||
<div class="tableId">
|
||||
<div class="tableId">
|
||||
{{ table ? "桌台号:" + table.name : "桌台号/取餐号" }}
|
||||
</div>
|
||||
|
||||
<el-button @click="clearCart" type="text" size="mini" :disabled="order.list.length<=0">清空</el-button>
|
||||
<el-button
|
||||
@click="clearCart"
|
||||
type="text"
|
||||
size="mini"
|
||||
:disabled="order.list.length <= 0"
|
||||
>清空</el-button
|
||||
>
|
||||
<!-- <div
|
||||
class="clear cur-pointer color-000 flex"
|
||||
@click="clearCart"
|
||||
|
|
@ -87,7 +93,11 @@
|
|||
</div>
|
||||
|
||||
<div class="flex row-between">
|
||||
<el-checkbox v-model="order.allPack" :disabled="!this.order.list.length">打包</el-checkbox>
|
||||
<el-checkbox
|
||||
v-model="order.allPack"
|
||||
:disabled="!this.order.list.length"
|
||||
>打包</el-checkbox
|
||||
>
|
||||
<div class="flex">
|
||||
<span class="color-666" style="margin-right: 5px"
|
||||
>共{{ allNumber }}件</span
|
||||
|
|
@ -108,24 +118,47 @@
|
|||
<span>加菜/返回</span>
|
||||
</button>
|
||||
<div style="width: 15px"></div>
|
||||
<button class="my-btn flex-1 success" @click="payOrder">
|
||||
<span>立即支付</span>
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-dropdown
|
||||
split-button
|
||||
size="medium"
|
||||
type="success"
|
||||
@command="changeIsPrint"
|
||||
>
|
||||
{{ isPrint ? "下单并打印制作单" : "仅下单(不打印)" }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="false"
|
||||
>仅下单(不打印)</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item :command="true"
|
||||
>下单并打印制作单</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<div style="width: 15px"></div>
|
||||
<div class="flex-1">
|
||||
<el-button
|
||||
size="medium"
|
||||
:disabled="!order.list.length"
|
||||
@click="createOrderShow"
|
||||
>
|
||||
去结账
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- <button
|
||||
class="my-btn flex-1 success"
|
||||
:class="{ disabled: !order.list.length }"
|
||||
:disabled="!order.list.length"
|
||||
@click="createOrderShow"
|
||||
>
|
||||
<span>去结账</span>
|
||||
</button> -->
|
||||
</template>
|
||||
|
||||
<button
|
||||
v-if="!isCreateOrder"
|
||||
class="my-btn flex-1 success"
|
||||
:class="{ disabled: !order.list.length }"
|
||||
:disabled="!order.list.length"
|
||||
@click="createOrderShow"
|
||||
>
|
||||
<span>去结账</span>
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="my-btn flex-1 success"
|
||||
@click="payOrder"
|
||||
>
|
||||
<span>立即支付</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="flex mt-14">
|
||||
|
|
@ -275,7 +308,7 @@
|
|||
>
|
||||
删除
|
||||
</div>
|
||||
|
||||
|
||||
<div
|
||||
class="btn"
|
||||
:class="{ disabled: !order.list.length }"
|
||||
|
|
@ -284,7 +317,7 @@
|
|||
存单
|
||||
</div>
|
||||
<div
|
||||
class="btn relative"
|
||||
class="btn relative"
|
||||
:class="{ disabled: !prveOrder.list.length }"
|
||||
@click="cacheOrderShow"
|
||||
>
|
||||
|
|
@ -292,7 +325,7 @@
|
|||
<span class="prve-car-len" v-if="prveOrder.list.length">{{
|
||||
prveOrder.list.length
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div
|
||||
class="btn"
|
||||
|
|
@ -369,7 +402,7 @@
|
|||
(goods.query.categoryId !== '') &
|
||||
(goods.query.categoryId != item.categoryId),
|
||||
}"
|
||||
@click="addCart(item)"
|
||||
@click="goodsClick(item)"
|
||||
v-for="(item, index) in goods.list"
|
||||
:key="index"
|
||||
>
|
||||
|
|
@ -697,7 +730,7 @@
|
|||
<div class="tollli_index">{{ index + 1 }}</div>
|
||||
<div class="tollli_price">¥{{ item.totalAmount }}</div>
|
||||
<div class="tollli_time_and_num">
|
||||
<div class="tollli_time">{{ item.created_at ||''}}</div>
|
||||
<div class="tollli_time">{{ item.created_at || "" }}</div>
|
||||
<div class="tollli_num">({{ item.totalNumber }}件)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -771,7 +804,10 @@ import {
|
|||
$allPack,
|
||||
$createOrder,
|
||||
$getMasterId,
|
||||
$cacheOrder,$getCacheOrder
|
||||
$cacheOrder,
|
||||
$getCacheOrder,
|
||||
$delOrder,
|
||||
$setUser
|
||||
} from "@/api/table";
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
function returnReverseVal(val, isReturnString = true) {
|
||||
|
|
@ -796,6 +832,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
//是否打印
|
||||
isPrint: false,
|
||||
// 备注
|
||||
note: {
|
||||
content: "",
|
||||
|
|
@ -916,7 +954,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.table ? "代客下单" +`(${this.table.name })` : "代客下单";
|
||||
return this.table ? "代客下单" + `(${this.table.name})` : "代客下单";
|
||||
},
|
||||
allGiftMoney() {
|
||||
const price = this.order.list
|
||||
|
|
@ -1001,9 +1039,18 @@ export default {
|
|||
},
|
||||
},
|
||||
watch: {
|
||||
"vipUser.id":function(val){
|
||||
$setUser({
|
||||
tableId:this.table.tableId,
|
||||
masterId:this.masterId,
|
||||
vipUserId:val,
|
||||
type:val===''?1:0
|
||||
})
|
||||
},
|
||||
"prveOrder.list.length": function (val) {
|
||||
if (val !== 0) {
|
||||
this.prveOrder.selCart = this.prveOrder.list[this.prveOrder.sel].carList;
|
||||
this.prveOrder.selCart =
|
||||
this.prveOrder.list[this.prveOrder.sel].carList;
|
||||
} else {
|
||||
this.prveOrder.selCart = [];
|
||||
}
|
||||
|
|
@ -1011,10 +1058,12 @@ export default {
|
|||
},
|
||||
"prveOrder.sel": function (val) {
|
||||
this.prveOrder.selCart =
|
||||
this.prveOrder.list.length !== 0 ? this.prveOrder.list[val].carList : [];
|
||||
this.prveOrder.list.length !== 0
|
||||
? this.prveOrder.list[val].carList
|
||||
: [];
|
||||
console.log(this.prveOrder.selCart);
|
||||
if(val<0){
|
||||
this.prveOrde.show=false
|
||||
if (val < 0) {
|
||||
this.prveOrde.show = false;
|
||||
}
|
||||
},
|
||||
// 本地缓存版本
|
||||
|
|
@ -1119,6 +1168,11 @@ export default {
|
|||
this.getCategory();
|
||||
},
|
||||
methods: {
|
||||
//改变是否打印
|
||||
changeIsPrint(e) {
|
||||
console.log(e);
|
||||
this.isPrint = e;
|
||||
},
|
||||
refOrderNoteConfirm(note) {
|
||||
this.note.content = note;
|
||||
},
|
||||
|
|
@ -1181,7 +1235,7 @@ export default {
|
|||
const masterId = await this.getMasterId();
|
||||
this.masterId = masterId;
|
||||
},
|
||||
|
||||
|
||||
// 获取取餐号
|
||||
getMasterId() {
|
||||
return $getMasterId({
|
||||
|
|
@ -1309,8 +1363,8 @@ export default {
|
|||
},
|
||||
//选择挂单确认
|
||||
async confirmChoosePrveOrder() {
|
||||
if(this.prveOrder.list.length<=0){
|
||||
return
|
||||
if (this.prveOrder.list.length <= 0) {
|
||||
return;
|
||||
}
|
||||
// const { sel } = this.prveOrder;
|
||||
// const order=this.prveOrder.list[sel];
|
||||
|
|
@ -1320,6 +1374,14 @@ export default {
|
|||
// tableId:this.table.tableId,
|
||||
// masterId:order.carList[0].masterId
|
||||
// })
|
||||
const {masterId,tableId,userId}= await $cacheOrder({orderId:this.prveOrder.list[this.prveOrder.sel].orderId,isPending:false})
|
||||
|
||||
getCart({
|
||||
masterId,
|
||||
tableId,
|
||||
vipUserId:userId?userId:''
|
||||
})
|
||||
return
|
||||
this.order.list = this.prveOrder.list[this.prveOrder.sel].carList;
|
||||
this.delPrveOrder();
|
||||
this.prveOrder.show = false;
|
||||
|
|
@ -1327,29 +1389,28 @@ export default {
|
|||
//删除挂单
|
||||
async delPrveOrder() {
|
||||
const { sel } = this.prveOrder;
|
||||
const order=this.prveOrder.list[sel];
|
||||
const res=await $cacheOrder({
|
||||
orderId:order.orderId,
|
||||
isPending:false
|
||||
})
|
||||
const order = this.prveOrder.list[sel];
|
||||
const res = await $delOrder({
|
||||
orderId: order.orderId
|
||||
});
|
||||
this.$notify({
|
||||
message: '删除成功',
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
this.prveOrder.list.splice(sel, 1);
|
||||
this.prveOrder.sel = sel - 1 <= 0 ? 0 : sel - 1;
|
||||
},
|
||||
cacheOrderShow(){
|
||||
cacheOrderShow() {
|
||||
this.prveOrder.show = true;
|
||||
},
|
||||
//获取挂起订单
|
||||
async getCacheOrder() {
|
||||
const res=await $getCacheOrder();
|
||||
console.log(res)
|
||||
this.prveOrder.list=res
|
||||
const res = await $getCacheOrder();
|
||||
console.log(res);
|
||||
this.prveOrder.list = res;
|
||||
},
|
||||
async saveOrder() {
|
||||
const res=await $cacheOrder({
|
||||
const res = await $cacheOrder({
|
||||
masterId: this.masterId,
|
||||
tableId: this.table.tableId,
|
||||
vipUserId: this.vipUser.id,
|
||||
|
|
@ -1359,9 +1420,9 @@ export default {
|
|||
this.order.selIndex = -1;
|
||||
const masterId = await this.getMasterId();
|
||||
this.masterId = masterId;
|
||||
this.$nextTick(()=>{
|
||||
this.getCacheOrder()
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.getCacheOrder();
|
||||
});
|
||||
},
|
||||
// 删除购物车商品
|
||||
removeCart() {
|
||||
|
|
@ -1426,8 +1487,8 @@ export default {
|
|||
this.order.cacheNumber = newval;
|
||||
},
|
||||
clearCart() {
|
||||
if(this.order.list.length<=0){
|
||||
return
|
||||
if (this.order.list.length <= 0) {
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定要清空点餐列表吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
|
|
@ -1608,6 +1669,7 @@ export default {
|
|||
this.note.content = "";
|
||||
this.vipUser = { id: "" };
|
||||
this.allPack = false;
|
||||
this.note.content = "";
|
||||
},
|
||||
//获取购物车数据
|
||||
async getCart() {
|
||||
|
|
@ -1652,7 +1714,8 @@ export default {
|
|||
this.selGoods.title = item.name;
|
||||
this.selGoods.show = true;
|
||||
},
|
||||
async addCart(item) {
|
||||
//根据右侧商品单规格多规格做不同处理
|
||||
async goodsClick(item) {
|
||||
if (item.typeEnum === "sku") {
|
||||
this.selGoods.data = item;
|
||||
this.selGoods.skuMap = {};
|
||||
|
|
@ -1662,6 +1725,7 @@ export default {
|
|||
}
|
||||
console.log(this.selGoods.skuMap);
|
||||
let specSnap = "";
|
||||
// const canBudyGoods=specList.filter(v=>v)
|
||||
this.selGoods.skuList = JSON.parse(item.skuResult.tagSnap).map((v) => {
|
||||
const values = v.value.split(",");
|
||||
specSnap += values[0] + ",";
|
||||
|
|
@ -1732,7 +1796,7 @@ export default {
|
|||
this.masterId = res.masterId;
|
||||
this.getCart();
|
||||
// this.getPrveCart();
|
||||
this.getCacheOrder()
|
||||
this.getCacheOrder();
|
||||
},
|
||||
close() {
|
||||
this.informationdialogshow = false;
|
||||
|
|
@ -1794,7 +1858,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
}
|
||||
::v-deep .el-button--text{
|
||||
::v-deep .el-button--text {
|
||||
color: #000;
|
||||
}
|
||||
::v-deep .number-box .el-input__inner {
|
||||
|
|
@ -1807,6 +1871,21 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
background: #22bf64;
|
||||
color: #fff;
|
||||
}
|
||||
::v-deep .el-tag--dark .el-tag--success {
|
||||
background: #22bf64;
|
||||
color: #fff;
|
||||
}
|
||||
::v-deep .flex-1 .el-button{
|
||||
width: 100%;
|
||||
}
|
||||
::v-deep .el-button--medium {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
::v-deep .number-box .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
|
|
@ -1826,6 +1905,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.lh-16 {
|
||||
line-height: 16px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue