代码更新
This commit is contained in:
@@ -88,6 +88,7 @@
|
||||
$table,
|
||||
tableswitch
|
||||
} from '@/http/yskApi/table.js'
|
||||
import { getShopTable } from '@/api/table.js'
|
||||
let datas = reactive({
|
||||
current: 0,
|
||||
item: "",
|
||||
@@ -108,10 +109,28 @@
|
||||
})
|
||||
onLoad((opt) => {
|
||||
datas.item = JSON.parse(opt.item)
|
||||
console.log(datas.item)
|
||||
})
|
||||
onShow(() => {
|
||||
gettableList()
|
||||
})
|
||||
|
||||
/**
|
||||
* 获取桌台
|
||||
*/
|
||||
async function gettableList() {
|
||||
const res = await getShopTable({
|
||||
status: 'idle',
|
||||
})
|
||||
let arr = []
|
||||
res.records.forEach((ele) => {
|
||||
if (ele.status == 'using' && props.tableId != ele.tableId) {
|
||||
arr.push(ele)
|
||||
}
|
||||
});
|
||||
datas.tableList = arr
|
||||
}
|
||||
|
||||
async function confirm() {
|
||||
// 是否选择其他桌
|
||||
if (datas.selecttableList) {
|
||||
@@ -167,20 +186,7 @@
|
||||
datas.current = e.currentIndex
|
||||
}
|
||||
}
|
||||
// 获取桌台
|
||||
async function gettableList() {
|
||||
const res = await $table.get({
|
||||
page: 1,
|
||||
size: 999
|
||||
})
|
||||
let arr = []
|
||||
res.content.forEach((ele) => {
|
||||
if (ele.status == 'using' && props.tableId != ele.tableId) {
|
||||
arr.push(ele)
|
||||
}
|
||||
});
|
||||
datas.tableList = arr
|
||||
}
|
||||
|
||||
|
||||
function formatPrice(n) {
|
||||
return Number(n).toFixed(2)
|
||||
|
||||
Reference in New Issue
Block a user