代客下单增加课座费
This commit is contained in:
parent
3828987560
commit
9f72777317
|
|
@ -1,14 +1,18 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<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-select v-model="targetTableId" placeholder="请选择目标台桌">
|
||||
<el-option v-for="item in originTableList" :key="item.tableId" :label="item.name"
|
||||
:value="item.tableId" @click="changeTable(item, index)">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
<div v-if="!isFull">
|
||||
<div v-if="itemdata.list.length > 0">
|
||||
|
|
@ -53,7 +57,6 @@
|
|||
¥{{ (scope.row.salePrice * scope.row.number).toFixed(2) }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
|
@ -64,7 +67,6 @@
|
|||
<el-button @click="toggleSelection">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -74,16 +76,17 @@ import { forEach } from "lodash";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectalllist: [],
|
||||
show: false,
|
||||
itemdata: {},
|
||||
list: [],
|
||||
masterId: '',
|
||||
currentTableId: '',
|
||||
targetTableId: '',
|
||||
masterId: "",
|
||||
currentTableId: "",
|
||||
targetTableId: "",
|
||||
originTableList: [], //桌台列表
|
||||
multipleSelection: [],
|
||||
refcartSelection: [],
|
||||
isFull: false
|
||||
isFull: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -92,64 +95,76 @@ export default {
|
|||
this.$refs.refcart.clearSelection();
|
||||
this.$refs.reftransfertoPinpin.forEach((a) => {
|
||||
a.clearSelection();
|
||||
})
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (error) { }
|
||||
},
|
||||
handleSelectionChange(val, index) {
|
||||
try {
|
||||
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) { }
|
||||
},
|
||||
handlerefcart(val) {
|
||||
this.refcartSelection = val
|
||||
this.refcartSelection = val;
|
||||
},
|
||||
async confirm() {
|
||||
console.log(this.itemdata, this.multipleSelection)
|
||||
console.log(this.itemdata, this.multipleSelection);
|
||||
if (!this.targetTableId) {
|
||||
this.$message({
|
||||
message: '请选择目标台桌!',
|
||||
type: 'warning'
|
||||
})
|
||||
message: "请选择目标台桌!",
|
||||
type: "warning",
|
||||
});
|
||||
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) {
|
||||
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)
|
||||
await placeswitch({
|
||||
masterId: this.masterId,
|
||||
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 可选
|
||||
currentTableId: this.currentTableId,
|
||||
targetTableId: this.targetTableId,
|
||||
|
||||
})
|
||||
});
|
||||
this.$forceUpdate();
|
||||
this.$emit("transfertoPinpin");
|
||||
this.show = false;
|
||||
|
||||
},
|
||||
open(item, masterId, currentTableId, originTableList) {
|
||||
// 订单信息,取餐码,用餐类型,桌台号id,台桌列表
|
||||
console.log(item, masterId, currentTableId, originTableList)
|
||||
this.itemdata = item
|
||||
this.masterId = masterId//取餐码
|
||||
this.currentTableId = currentTableId//当前桌台id
|
||||
this.originTableList = originTableList.filter((i) => i.tableId != currentTableId && i.status == 'using')//台桌列表
|
||||
console.log(item, masterId, currentTableId, originTableList);
|
||||
this.itemdata = item;
|
||||
this.masterId = masterId; //取餐码
|
||||
this.currentTableId = currentTableId; //当前桌台id
|
||||
this.originTableList = originTableList.filter(
|
||||
(i) => i.tableId != currentTableId && i.status == "using"
|
||||
); //台桌列表
|
||||
try {
|
||||
this.$refs.refcart.clearSelection();
|
||||
this.$refs.reftransfertoPinpin.forEach((a) => {
|
||||
a.clearSelection();
|
||||
})
|
||||
});
|
||||
} catch (error) { }
|
||||
this.multipleSelection = []
|
||||
this.refcartSelection = []
|
||||
this.targetTableId = ''
|
||||
this.show = true;
|
||||
},
|
||||
returnTableColor(key) {
|
||||
|
|
@ -157,7 +172,7 @@ export default {
|
|||
return item ? item.type : "";
|
||||
},
|
||||
changeTable(item, index) {
|
||||
console.log(item, index)
|
||||
console.log(item, index);
|
||||
},
|
||||
searchInput(e) {
|
||||
console.log(e);
|
||||
|
|
@ -179,7 +194,6 @@ export default {
|
|||
margin: 20px 10px;
|
||||
|
||||
.boxspan {}
|
||||
|
||||
}
|
||||
|
||||
.buttonbox {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue