代课下单

This commit is contained in:
魏啾 2024-12-10 11:36:32 +08:00
parent f16d81d9bd
commit 25761ba734
2 changed files with 15 additions and 21 deletions

View File

@ -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);

View File

@ -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("");