代客下单增加课座费
This commit is contained in:
parent
3828987560
commit
9f72777317
|
|
@ -1,14 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="select_desk">
|
<div class="select_desk">
|
||||||
<el-dialog title="请选择商品" :visible.sync="show">
|
<el-dialog title="请选择商品" :visible.sync="show">
|
||||||
<div style="padding: 10px 0;display: flex;justify-content: space-between;align-items: center;">
|
<div style="
|
||||||
|
padding: 10px 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
">
|
||||||
<el-checkbox v-model="isFull">并桌</el-checkbox>
|
<el-checkbox v-model="isFull">并桌</el-checkbox>
|
||||||
<el-select v-model="targetTableId" placeholder="请选择目标台桌">
|
<el-select v-model="targetTableId" placeholder="请选择目标台桌">
|
||||||
<el-option v-for="item in originTableList" :key="item.tableId" :label="item.name"
|
<el-option v-for="item in originTableList" :key="item.tableId" :label="item.name"
|
||||||
:value="item.tableId" @click="changeTable(item, index)">
|
:value="item.tableId" @click="changeTable(item, index)">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!isFull">
|
<div v-if="!isFull">
|
||||||
<div v-if="itemdata.list.length > 0">
|
<div v-if="itemdata.list.length > 0">
|
||||||
|
|
@ -53,7 +57,6 @@
|
||||||
¥{{ (scope.row.salePrice * scope.row.number).toFixed(2) }}
|
¥{{ (scope.row.salePrice * scope.row.number).toFixed(2) }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,7 +67,6 @@
|
||||||
<el-button @click="toggleSelection">取消</el-button>
|
<el-button @click="toggleSelection">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -74,16 +76,17 @@ import { forEach } from "lodash";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectalllist: [],
|
||||||
show: false,
|
show: false,
|
||||||
itemdata: {},
|
itemdata: {},
|
||||||
list: [],
|
list: [],
|
||||||
masterId: '',
|
masterId: "",
|
||||||
currentTableId: '',
|
currentTableId: "",
|
||||||
targetTableId: '',
|
targetTableId: "",
|
||||||
originTableList: [], //桌台列表
|
originTableList: [], //桌台列表
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
refcartSelection: [],
|
refcartSelection: [],
|
||||||
isFull: false
|
isFull: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -92,64 +95,76 @@ export default {
|
||||||
this.$refs.refcart.clearSelection();
|
this.$refs.refcart.clearSelection();
|
||||||
this.$refs.reftransfertoPinpin.forEach((a) => {
|
this.$refs.reftransfertoPinpin.forEach((a) => {
|
||||||
a.clearSelection();
|
a.clearSelection();
|
||||||
})
|
});
|
||||||
} catch (error) {
|
} catch (error) { }
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleSelectionChange(val, index) {
|
handleSelectionChange(val, index) {
|
||||||
try {
|
try {
|
||||||
this.itemdata.old.list.forEach((a, i) => {
|
this.itemdata.old.list.forEach((a, i) => {
|
||||||
this.multipleSelection[index] = i === index ? val : this.multipleSelection[index] || []
|
this.multipleSelection[index] =
|
||||||
})
|
i === index ? val : this.multipleSelection[index] || [];
|
||||||
|
});
|
||||||
} catch (error) { }
|
} catch (error) { }
|
||||||
},
|
},
|
||||||
handlerefcart(val) {
|
handlerefcart(val) {
|
||||||
this.refcartSelection = val
|
this.refcartSelection = val;
|
||||||
},
|
},
|
||||||
async confirm() {
|
async confirm() {
|
||||||
console.log(this.itemdata, this.multipleSelection)
|
console.log(this.itemdata, this.multipleSelection);
|
||||||
if (!this.targetTableId) {
|
if (!this.targetTableId) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请选择目标台桌!',
|
message: "请选择目标台桌!",
|
||||||
type: 'warning'
|
type: "warning",
|
||||||
})
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// 判断全选增加课桌费
|
||||||
|
var tzf = []
|
||||||
|
try {
|
||||||
|
let one = this.itemdata.old.list.every((i, index) => i.info.length == this.multipleSelection[index].length)
|
||||||
|
let tow = this.itemdata.list.every((icon) => icon.length == this.refcartSelection.length)
|
||||||
|
if (one && tow) {
|
||||||
|
tzf = [999]
|
||||||
|
}
|
||||||
|
} catch (error) { }
|
||||||
|
// 数据处理 增加cartId方便判断
|
||||||
if (this.refcartSelection.length) {
|
if (this.refcartSelection.length) {
|
||||||
this.refcartSelection.forEach((i) => {
|
this.refcartSelection.forEach((i) => {
|
||||||
i.cartId = i.id
|
i.cartId = i.id;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
let cartIds = [...this.multipleSelection, [...this.refcartSelection]]
|
let cartIds = [...this.multipleSelection, [...this.refcartSelection]];
|
||||||
console.log(cartIds)
|
console.log(cartIds)
|
||||||
await placeswitch({
|
await placeswitch({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
orderId: this.itemdata.orderId, //当前台桌订单id 可选
|
orderId: this.itemdata.orderId, //当前台桌订单id 可选
|
||||||
cartIds: this.isFull ? '' : cartIds.flatMap(subArray => subArray.map(item => item.cartId)),//转单的购物车商品 并桌时可不传 可选
|
cartIds: this.isFull ? "" : [...cartIds.flatMap((subArray) => subArray.map((item) => item.cartId)),...tzf] , //转单的购物车商品 并桌时可不传 可选
|
||||||
isFull: this.isFull, //并台会将全部购物车商品转入,默认为false 可选
|
isFull: this.isFull, //并台会将全部购物车商品转入,默认为false 可选
|
||||||
currentTableId: this.currentTableId,
|
currentTableId: this.currentTableId,
|
||||||
targetTableId: this.targetTableId,
|
targetTableId: this.targetTableId,
|
||||||
|
});
|
||||||
})
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
this.$emit("transfertoPinpin");
|
this.$emit("transfertoPinpin");
|
||||||
this.show = false;
|
this.show = false;
|
||||||
|
|
||||||
},
|
},
|
||||||
open(item, masterId, currentTableId, originTableList) {
|
open(item, masterId, currentTableId, originTableList) {
|
||||||
// 订单信息,取餐码,用餐类型,桌台号id,台桌列表
|
// 订单信息,取餐码,用餐类型,桌台号id,台桌列表
|
||||||
console.log(item, masterId, currentTableId, originTableList)
|
console.log(item, masterId, currentTableId, originTableList);
|
||||||
this.itemdata = item
|
this.itemdata = item;
|
||||||
this.masterId = masterId//取餐码
|
this.masterId = masterId; //取餐码
|
||||||
this.currentTableId = currentTableId//当前桌台id
|
this.currentTableId = currentTableId; //当前桌台id
|
||||||
this.originTableList = originTableList.filter((i) => i.tableId != currentTableId && i.status == 'using')//台桌列表
|
this.originTableList = originTableList.filter(
|
||||||
|
(i) => i.tableId != currentTableId && i.status == "using"
|
||||||
|
); //台桌列表
|
||||||
try {
|
try {
|
||||||
this.$refs.refcart.clearSelection();
|
this.$refs.refcart.clearSelection();
|
||||||
this.$refs.reftransfertoPinpin.forEach((a) => {
|
this.$refs.reftransfertoPinpin.forEach((a) => {
|
||||||
a.clearSelection();
|
a.clearSelection();
|
||||||
})
|
});
|
||||||
} catch (error) { }
|
} catch (error) { }
|
||||||
|
this.multipleSelection = []
|
||||||
|
this.refcartSelection = []
|
||||||
|
this.targetTableId = ''
|
||||||
this.show = true;
|
this.show = true;
|
||||||
},
|
},
|
||||||
returnTableColor(key) {
|
returnTableColor(key) {
|
||||||
|
|
@ -157,7 +172,7 @@ export default {
|
||||||
return item ? item.type : "";
|
return item ? item.type : "";
|
||||||
},
|
},
|
||||||
changeTable(item, index) {
|
changeTable(item, index) {
|
||||||
console.log(item, index)
|
console.log(item, index);
|
||||||
},
|
},
|
||||||
searchInput(e) {
|
searchInput(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
@ -179,7 +194,6 @@ export default {
|
||||||
margin: 20px 10px;
|
margin: 20px 10px;
|
||||||
|
|
||||||
.boxspan {}
|
.boxspan {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttonbox {
|
.buttonbox {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue