-
-
- 待出菜({{ item.pendingDishCount
- }})
-
+
+
-
+
+
+
+ {{ item.tableName }} | {{ item.areaName }}
-
+
+
@@ -118,7 +121,7 @@
@@ -216,6 +219,7 @@ const checkType = ref(1)
// 清除搜索内容
function inputClear() {
+ selectItemIndex.value = 0
goodsListActive.value = -1
checkTypeHandle({ value: checkType.value })
}
@@ -257,7 +261,7 @@ const queryForm = reactive({
// 按台桌查看
const tableList = ref([])
-const selectItem = ref({})
+const selectItemIndex = ref(0)
async function getKitchenTableAjax() {
try {
const res = await getKitchenTable({
@@ -265,14 +269,9 @@ async function getKitchenTableAjax() {
})
tableList.value = res
if (res.length > 0) {
- if (!selectItem.value.orderId) {
- selectItem.value = res[0]
- }
getKitchenTableFoodsAjax()
-
- console.log(selectItem.value);
} else {
- selectItem.value = {}
+ selectItemIndex.value = 0
tableData.list = []
}
} catch (error) {
@@ -281,8 +280,8 @@ async function getKitchenTableAjax() {
}
// 切换台桌
-function changeTableItem(item) {
- selectItem.value = item
+function changeTableItem(index) {
+ selectItemIndex.value = index
getKitchenTableFoodsAjax()
}
@@ -293,9 +292,9 @@ const tableData = reactive({
async function getKitchenTableFoodsAjax() {
try {
const res = await getKitchenTableFoods({
- orderId: selectItem.value.orderId,
- tableCode: selectItem.value.tableCode,
- isNoTable: selectItem.value.tableCode ? '' : 1
+ orderId: tableList.value[selectItemIndex.value].orderId,
+ tableCode: tableList.value[selectItemIndex.value].tableCode,
+ isNoTable: tableList.value[selectItemIndex.value].tableCode ? '' : 1
})
res.forEach(item => {
@@ -596,12 +595,10 @@ onUnmounted(() => {
.item {
flex: 1;
- &.list {
+ .list {
display: grid;
grid-template-columns: repeat(4, 1fr);
- grid-template-rows: repeat(auto, 1fr);
- grid-column-gap: var(--padding);
- grid-row-gap: var(--padding);
+ gap: var(--padding);
&.empty {
display: flex;
- {{ selectItem.tableName || '-' }} | {{ selectItem.areaName || '-'
+ {{ tableList[selectItemIndex].tableName || '-' }} | {{
+ tableList[selectItemIndex].areaName || '-'
}}
- 待出菜({{ selectItem.pendingDishCount }})
- 员工名称:{{ selectItem.staffName || notStaff }}
- 下单时间:{{ selectItem.orderTime || '-' }}
+ 待出菜({{ tableList[selectItemIndex].pendingDishCount }})
+ 员工名称:{{ tableList[selectItemIndex].staffName || notStaff }}
+ 下单时间:{{ tableList[selectItemIndex].orderTime || '-' }}
{{ item.productName }} 待出菜({{ item.total
- }})
+ }})