代课下单
This commit is contained in:
parent
f16d81d9bd
commit
25761ba734
|
|
@ -7,7 +7,7 @@
|
|||
<h4 class="boxspan">本组菜品{{ item.count }}选{{ item.number || 1 }}</h4>
|
||||
<el-alert v-if="item.alertshow" title="错误:请按照规定选择套餐" type="warning" :closable="false"></el-alert>
|
||||
</div>
|
||||
<el-table ref="dialogpackagetable" :data="item.goods" tooltip-effect="dark" style="width: 100%"
|
||||
<el-table ref="refdialogpackagetable" :data="item.goods" tooltip-effect="dark" style="width: 100%"
|
||||
@selection-change="handleSelectionChange($event, index)">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
|
@ -44,26 +44,23 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
toggleSelection(rows) {
|
||||
if (rows) {
|
||||
rows.forEach(row => {
|
||||
this.$refs.dialogpackagetable.toggleRowSelection(row);
|
||||
});
|
||||
} else {
|
||||
this.$refs.dialogpackagetable.clearSelection();
|
||||
}
|
||||
|
||||
toggleSelection() {
|
||||
this.$refs.refdialogpackagetable.forEach((a) => {
|
||||
a.clearSelection();
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val, index) {
|
||||
try {
|
||||
this.listdata.proGroupVo.forEach((a, i) => {
|
||||
this.multipleSelection[index] = i === index ? val : this.multipleSelection[index] || []
|
||||
})
|
||||
this.disabledshow = !this.listdata.proGroupVo.every((element, num) => element.number <= this.multipleSelection[num].length);
|
||||
this.disabledshow = !this.listdata.proGroupVo.every((element, num) => element.number == this.multipleSelection[num].length);
|
||||
} catch (error) { }
|
||||
this.$set(this.listdata.proGroupVo, index, { ...this.listdata.proGroupVo[index], alertshow: this.listdata.proGroupVo[index].number >= this.multipleSelection[index].length ? true : false });
|
||||
|
||||
this.$set(this.listdata.proGroupVo, index, { ...this.listdata.proGroupVo[index], alertshow: this.listdata.proGroupVo[index].number != this.multipleSelection[index].length ? true : false });
|
||||
},
|
||||
confirm() {
|
||||
console.log(listdata.proGroupVo)
|
||||
this.$emit("dialogpackageconfirm", this.listdata, this.multipleSelection);
|
||||
this.show = false;
|
||||
|
||||
|
|
@ -71,11 +68,10 @@ export default {
|
|||
open(item) {
|
||||
this.listdata = item
|
||||
try {
|
||||
this.$refs.dialogpackagetable.clearSelection();
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
this.$refs.refdialogpackagetable.forEach((a) => {
|
||||
a.clearSelection();
|
||||
})
|
||||
} catch (error) { }
|
||||
this.multipleSelection = []
|
||||
this.disabledshow = true
|
||||
console.log(this.listdata, this.multipleSelection);
|
||||
|
|
|
|||
|
|
@ -1902,9 +1902,7 @@ export default {
|
|||
},
|
||||
//套餐下单
|
||||
async dialogpackageconfirm(item, multipleSelection) {
|
||||
console.log(item)
|
||||
console.log(multipleSelection)
|
||||
this.goodsClick(item, 1, true, multipleSelection)
|
||||
this.goodsClick(item, 1, true, multipleSelection.flatMap(subArray => subArray.map(item => item.proId)))
|
||||
},
|
||||
//挂账人支付确认
|
||||
guazhangPayConfirm(guazhangren, price) {
|
||||
|
|
@ -3613,7 +3611,7 @@ export default {
|
|||
}
|
||||
},
|
||||
//根据右侧商品单规格多规格做不同处理
|
||||
async goodsClick(item, number = 0, isConfirm = false, multipleSelection='') {
|
||||
async goodsClick(item, number = 0, isConfirm = false, multipleSelection = '') {
|
||||
|
||||
// if (!this.table) {
|
||||
// return this.$message.error("暂不支持无桌台下单,请先选择桌台");
|
||||
|
|
|
|||
Loading…
Reference in New Issue