init: 橘视厅酒店版会员系统前端
This commit is contained in:
63
src/api/manage/store.ts
Normal file
63
src/api/manage/store.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import http from '@/utils/httpRequest'
|
||||
import type { ManageListResponse, ManageResponse, ManagePageParams } from './types'
|
||||
|
||||
/**
|
||||
* 门店信息
|
||||
*/
|
||||
export interface StoreInfo {
|
||||
id: number
|
||||
parentId: number
|
||||
mpath: string
|
||||
name: string
|
||||
orderNo?: number
|
||||
type: string
|
||||
/** 后端 @JsonProperty("orgCode") 重命名,JSON 中为 orgCode */
|
||||
orgCode?: string
|
||||
status: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
/** 非表字段,后端 join 返回 */
|
||||
parentOrgName?: string
|
||||
channelName?: string
|
||||
children?: StoreInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店列表查询参数
|
||||
*/
|
||||
export interface StoreListParams extends ManagePageParams {
|
||||
name?: string
|
||||
status?: string
|
||||
channelOrgId?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店保存/更新数据
|
||||
*/
|
||||
export interface StoreSaveData {
|
||||
id?: number
|
||||
parentId: number
|
||||
name: string
|
||||
orgCode?: string
|
||||
}
|
||||
|
||||
/** 门店分页列表 */
|
||||
export function getStoreList(params?: StoreListParams): Promise<ManageListResponse<StoreInfo>> {
|
||||
return http.get(http.adornUrl('/manage/org/store/list'), { params: http.adornParams(params || {}) }).then(res => res.data)
|
||||
}
|
||||
|
||||
/** 门店详情 */
|
||||
export function getStoreInfo(id: number): Promise<ManageResponse<{ store?: StoreInfo }>> {
|
||||
return http.get(http.adornUrl(`/manage/org/store/info/${id}`), { params: http.adornParams() }).then(res => res.data)
|
||||
}
|
||||
|
||||
/** 新增/修改门店 */
|
||||
export function saveOrUpdateStore(data: StoreSaveData): Promise<ManageResponse> {
|
||||
const url = data.id ? '/manage/org/store/update' : '/manage/org/store/save'
|
||||
return http.post(http.adornUrl(url), http.adornData(data)).then(res => res.data)
|
||||
}
|
||||
|
||||
/** 删除门店(批量软删除) */
|
||||
export function deleteStore(ids: number[]): Promise<ManageResponse> {
|
||||
return http.post(http.adornUrl('/manage/org/store/delete'), http.adornData(ids, false)).then(res => res.data)
|
||||
}
|
||||
Reference in New Issue
Block a user