代客下单
去除历史订单,创建订单增加状态,当状态完成时才继续允许请求
This commit is contained in:
3839
src/views/table/components/table-diancan-oldList-back.vue
Normal file
3839
src/views/table/components/table-diancan-oldList-back.vue
Normal file
File diff suppressed because one or more lines are too long
@@ -250,7 +250,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="!order.list.length"
|
:disabled="!order.list.length"
|
||||||
@click="toCreateOrder(false)"
|
@click="toCreateOrderDebounce(false)"
|
||||||
>
|
>
|
||||||
仅下单
|
仅下单
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="!order.list.length && !order.old.list.length"
|
:disabled="!order.list.length && !order.old.list.length"
|
||||||
@click="toCreateOrder(true)"
|
@click="toCreateOrderDebounce(true)"
|
||||||
>
|
>
|
||||||
去结账
|
去结账
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -373,14 +373,14 @@
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
class="btn"
|
class="btn"
|
||||||
:class="{ disabled: !order.list.length ||key}"
|
:class="{ disabled: !order.list.length }"
|
||||||
@click="saveOrder"
|
@click="saveOrder"
|
||||||
>
|
>
|
||||||
存单
|
存单
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="btn relative"
|
class="btn relative"
|
||||||
:class="{ disabled: !prveOrder.list.length ||key}"
|
:class="{ disabled: !prveOrder.list.length }"
|
||||||
@click="cacheOrderShow"
|
@click="cacheOrderShow"
|
||||||
>
|
>
|
||||||
取单
|
取单
|
||||||
@@ -1133,6 +1133,7 @@ export default {
|
|||||||
canUpdate: true,
|
canUpdate: true,
|
||||||
//下单
|
//下单
|
||||||
createOrder: {
|
createOrder: {
|
||||||
|
status: "",
|
||||||
discount: 1,
|
discount: 1,
|
||||||
form: {},
|
form: {},
|
||||||
data: {},
|
data: {},
|
||||||
@@ -1532,6 +1533,13 @@ export default {
|
|||||||
this.isCreateOrder = false;
|
this.isCreateOrder = false;
|
||||||
},
|
},
|
||||||
//生成订单
|
//生成订单
|
||||||
|
toCreateOrderDebounce(isNowPay){
|
||||||
|
if(this.createOrder.status!=''&&this.createOrder.status!='success'){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.createOrder.status='loading'
|
||||||
|
this.toCreateOrder(isNowPay)
|
||||||
|
},
|
||||||
async toCreateOrder(isNowPay = false) {
|
async toCreateOrder(isNowPay = false) {
|
||||||
console.log(this.order)
|
console.log(this.order)
|
||||||
console.log(this.order.orderId)
|
console.log(this.order.orderId)
|
||||||
@@ -1547,6 +1555,7 @@ export default {
|
|||||||
console.log(this.postPay);
|
console.log(this.postPay);
|
||||||
console.log(isNowPay);
|
console.log(isNowPay);
|
||||||
console.log(this.postPay && isNowPay);
|
console.log(this.postPay && isNowPay);
|
||||||
|
this.createOrder.status='success'
|
||||||
if (this.postPay && !isNowPay) {
|
if (this.postPay && !isNowPay) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: "下单成功",
|
title: "下单成功",
|
||||||
@@ -1559,7 +1568,6 @@ export default {
|
|||||||
const { masterId } = await this.getMasterId();
|
const { masterId } = await this.getMasterId();
|
||||||
this.masterId = masterId;
|
this.masterId = masterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isCreateOrder = true;
|
this.isCreateOrder = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2158,6 +2166,7 @@ export default {
|
|||||||
this.prveOrder.selIndex=-1
|
this.prveOrder.selIndex=-1
|
||||||
this.order.old.selIndex = -1;
|
this.order.old.selIndex = -1;
|
||||||
this.isCreateOrder = false;
|
this.isCreateOrder = false;
|
||||||
|
this.createOrder.status=""
|
||||||
this.note.content = "";
|
this.note.content = "";
|
||||||
this.vipUser = { id: "" };
|
this.vipUser = { id: "" };
|
||||||
this.allPack = false;
|
this.allPack = false;
|
||||||
@@ -2175,10 +2184,10 @@ export default {
|
|||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
});
|
});
|
||||||
if (this.key) {
|
|
||||||
this.order.old.list = res.records;
|
|
||||||
} else {
|
|
||||||
this.order.list = res.records;
|
this.order.list = res.records;
|
||||||
|
if (this.key) {
|
||||||
|
// this.order.old.list = res.records;
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
this.order.total = res.total;
|
this.order.total = res.total;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user