| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- import { request } from '@/utils'
- // ==================== 二维码管理 ====================
- /** 分页查询二维码 */
- export function getQrCodePage(params) {
- return request.get('/hotel/qrcode/page', { params })
- }
- /** 查询二维码详情 */
- export function getQrCodeDetail(id) {
- return request.get(`/hotel/qrcode/${id}`)
- }
- /** 批量生成二维码 */
- export function batchGenerateQrCode(data) {
- return request.post('/hotel/qrcode/batch-generate', data)
- }
- /** 绑定房间 */
- export function bindQrCode(id, data) {
- return request.post(`/hotel/qrcode/${id}/bind`, data)
- }
- /** 重新绑定房间 */
- export function rebindQrCode(id, data) {
- return request.post(`/hotel/qrcode/${id}/rebind`, data)
- }
- /** 解绑房间 */
- export function unbindQrCode(id) {
- return request.post(`/hotel/qrcode/${id}/unbind`)
- }
- /** 更新二维码状态 */
- export function updateQrCodeStatus(id, status) {
- return request.put(`/hotel/qrcode/${id}/status`, null, { params: { status } })
- }
- /** 查询绑定日志 */
- export function getQrCodeBindLogs(id) {
- return request.get(`/hotel/qrcode/${id}/bind-logs`)
- }
- /** 批量删除二维码 */
- export function batchRemoveQrCode(ids) {
- return request.post('/hotel/qrcode/batch-remove', ids)
- }
- /** 批量下载二维码ZIP(返回blob) */
- export function batchDownloadQrCode(ids) {
- return request.post('/hotel/qrcode/batch-download', ids, { responseType: 'blob' })
- }
- // ==================== 房间管理 ====================
- /** 分页查询房间 */
- export function getRoomPage(params) {
- return request.get('/hotel/room/page', { params })
- }
- /** 查询全部房间(下拉用) */
- export function getRoomListAll() {
- return request.get('/hotel/room/list-all')
- }
- /** 查询房间详情 */
- export function getRoomDetail(id) {
- return request.get(`/hotel/room/${id}`)
- }
- /** 新增房间 */
- export function createRoom(data) {
- return request.post('/hotel/room', data)
- }
- /** 修改房间 */
- export function updateRoom(data) {
- return request.put('/hotel/room', data)
- }
- /** 删除房间 */
- export function deleteRoom(id) {
- return request.post(`/hotel/room/remove/${id}`)
- }
- // ==================== 房型管理 ====================
- /** 查询房型列表 */
- export function getRoomTypeList() {
- return request.get('/hotel/room-type/list')
- }
- /** 查询房型详情 */
- export function getRoomTypeDetail(id) {
- return request.get(`/hotel/room-type/${id}`)
- }
- /** 新增房型 */
- export function createRoomType(data) {
- return request.post('/hotel/room-type', data)
- }
- /** 修改房型 */
- export function updateRoomType(data) {
- return request.put('/hotel/room-type', data)
- }
- /** 删除房型 */
- export function deleteRoomType(id) {
- return request.post(`/hotel/room-type/remove/${id}`)
- }
- // ==================== 菜品分类管理 ====================
- /** 查询全部分类(带菜品数量) */
- export function getDishCategoryList() {
- return request.get('/hotel/dish-category/list')
- }
- /** 查询启用分类(下拉用) */
- export function getDishCategoryEnabled() {
- return request.get('/hotel/dish-category/enabled')
- }
- /** 查询分类详情 */
- export function getDishCategoryDetail(id) {
- return request.get(`/hotel/dish-category/${id}`)
- }
- /** 新增分类 */
- export function createDishCategory(data) {
- return request.post('/hotel/dish-category', data)
- }
- /** 修改分类 */
- export function updateDishCategory(data) {
- return request.put('/hotel/dish-category', data)
- }
- /** 删除分类 */
- export function deleteDishCategory(id) {
- return request.post(`/hotel/dish-category/remove/${id}`)
- }
- /** 切换分类状态 */
- export function toggleDishCategoryStatus(id) {
- return request.post(`/hotel/dish-category/${id}/toggle-status`)
- }
- // ==================== 菜品管理 ====================
- /** 分页查询菜品 */
- export function getDishPage(params) {
- return request.get('/hotel/dish/page', { params })
- }
- /** 查询菜品详情 */
- export function getDishDetail(id) {
- return request.get(`/hotel/dish/${id}`)
- }
- /** 新增菜品 */
- export function createDish(data) {
- return request.post('/hotel/dish', data)
- }
- /** 修改菜品 */
- export function updateDish(data) {
- return request.put('/hotel/dish', data)
- }
- /** 删除菜品 */
- export function deleteDish(id) {
- return request.post(`/hotel/dish/remove/${id}`)
- }
- /** 更新菜品状态 */
- export function updateDishStatus(id, status) {
- return request.put(`/hotel/dish/${id}/status`, null, { params: { status } })
- }
- /** 标记售罄 */
- export function markDishSoldOut(id) {
- return request.post(`/hotel/dish/${id}/sold-out`)
- }
- /** 恢复上架 */
- export function restoreDish(id) {
- return request.post(`/hotel/dish/${id}/restore`)
- }
- /** 批量操作菜品 */
- export function batchOperateDish(data) {
- return request.post('/hotel/dish/batch', data)
- }
- /** 销量排行 */
- export function getDishSalesRanking(limit = 10) {
- return request.get('/hotel/dish/ranking', { params: { limit } })
- }
- // ==================== 菜品规格管理 ====================
- /** 分页查询规格组 */
- export function getDishSpecPage(params) {
- return request.get('/hotel/dish-spec/page', { params })
- }
- /** 根据菜品ID查询规格组(含选项) */
- export function getDishSpecByDishId(dishId) {
- return request.get(`/hotel/dish-spec/by-dish/${dishId}`)
- }
- /** 查询规格组详情 */
- export function getDishSpecDetail(id) {
- return request.get(`/hotel/dish-spec/${id}`)
- }
- /** 新增规格组 */
- export function createDishSpec(data) {
- return request.post('/hotel/dish-spec', data)
- }
- /** 修改规格组 */
- export function updateDishSpec(data) {
- return request.put('/hotel/dish-spec', data)
- }
- /** 删除规格组(级联删除选项) */
- export function deleteDishSpec(id) {
- return request.post(`/hotel/dish-spec/remove/${id}`)
- }
- /** 根据规格组ID查询选项列表 */
- export function getDishSpecOptionList(groupId) {
- return request.get(`/hotel/dish-spec/option/list/${groupId}`)
- }
- /** 查询规格选项详情 */
- export function getDishSpecOptionDetail(id) {
- return request.get(`/hotel/dish-spec/option/${id}`)
- }
- /** 新增规格选项 */
- export function createDishSpecOption(data) {
- return request.post('/hotel/dish-spec/option', data)
- }
- /** 修改规格选项 */
- export function updateDishSpecOption(data) {
- return request.put('/hotel/dish-spec/option', data)
- }
- /** 删除规格选项 */
- export function deleteDishSpecOption(id) {
- return request.post(`/hotel/dish-spec/option/remove/${id}`)
- }
- // ==================== 营业时段管理 ====================
- /** 分页查询营业时段 */
- export function getBusinessHoursPage(params) {
- return request.get('/hotel/business-hours/page', { params })
- }
- /** 查询全部营业时段(含禁用) */
- export function getBusinessHoursAll() {
- return request.get('/hotel/business-hours/all')
- }
- /** 查询启用的营业时段(顾客端用) */
- export function getBusinessHoursEnabled() {
- return request.get('/hotel/business-hours/enabled')
- }
- /** 检查当前营业状态(顾客端用) */
- export function checkCurrentBusinessHours() {
- return request.get('/hotel/business-hours/check-current')
- }
- /** 查询营业时段详情 */
- export function getBusinessHoursDetail(id) {
- return request.get(`/hotel/business-hours/${id}`)
- }
- /** 新增营业时段 */
- export function createBusinessHours(data) {
- return request.post('/hotel/business-hours', data)
- }
- /** 修改营业时段 */
- export function updateBusinessHours(data) {
- return request.put('/hotel/business-hours', data)
- }
- /** 切换营业时段状态 */
- export function toggleBusinessHours(id) {
- return request.post(`/hotel/business-hours/${id}/toggle`)
- }
- /** 删除营业时段 */
- export function deleteBusinessHours(id) {
- return request.post(`/hotel/business-hours/remove/${id}`)
- }
|