代课下单修改存单取单以及用户切换时masterid相关逻辑

当是取出的订单状态时使用订单的masterID
This commit is contained in:
YeMingfei666 2024-08-20 17:46:25 +08:00
parent 977b2e5cd7
commit 555d0ebaa0
1 changed files with 14 additions and 5 deletions

View File

@ -921,6 +921,7 @@ export default {
}, },
order: { order: {
payType: "", payType: "",
masterId:'',
allPack: false, allPack: false,
btns: [ btns: [
{ {
@ -1084,7 +1085,11 @@ export default {
}, },
watch: { watch: {
"vipUser.id": async function (val) { "vipUser.id": async function (val) {
const { masterId } = await this.getMasterId(); let masterId=this.order.masterId
if(!masterId){
const res = await this.getMasterId();
masterId=res.masterId
}
this.masterId = masterId; this.masterId = masterId;
$setUser({ $setUser({
tableId: this.table.tableId, tableId: this.table.tableId,
@ -1269,17 +1274,17 @@ export default {
this.isCreateOrder = false; this.isCreateOrder = false;
}, },
async createOrderShow() { async createOrderShow() {
this.order.payType;
this.isCreateOrder = true;
const res = await $createOrder({ const res = await $createOrder({
masterId: this.masterId, masterId:this.order.masterId||this.masterId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
tableId: this.table.tableId, tableId: this.table.tableId,
note: this.note.content, note: this.note.content
}); });
this.createOrder.data = res; this.createOrder.data = res;
const masterId = await this.getMasterId(); const masterId = await this.getMasterId();
this.masterId = masterId; this.masterId = masterId;
this.isCreateOrder = true;
}, },
// //
@ -1425,12 +1430,14 @@ export default {
isPending: false, isPending: false,
}); });
this.masterId = masterId; this.masterId = masterId;
console.log(masterId)
const { records } = await getCart({ const { records } = await getCart({
masterId, masterId,
tableId, tableId,
vipUserId: userId != "null" ? userId : "", vipUserId: userId != "null" ? userId : "",
}); });
console.log(records); console.log(records);
this.order.masterId=masterId
this.order.list = records; this.order.list = records;
this.prveOrder.show = false; this.prveOrder.show = false;
return; return;
@ -1468,6 +1475,7 @@ export default {
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
isPending: true, isPending: true,
}); });
this.order.masterId='';
this.order.list = []; this.order.list = [];
this.order.selIndex = -1; this.order.selIndex = -1;
const masterId = await this.getMasterId(); const masterId = await this.getMasterId();
@ -1779,6 +1787,7 @@ export default {
}, },
reset() { reset() {
// this.goods.list = []; // this.goods.list = [];
this.order.masterId='';
this.order.list = []; this.order.list = [];
this.order.query.page = 1; this.order.query.page = 1;
this.goods.total = 0; this.goods.total = 0;