Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
187 lines
4.6 KiB
TypeScript
187 lines
4.6 KiB
TypeScript
import { requestClient } from '#/api/request';
|
||
|
||
const prefix = 'store/';
|
||
|
||
/**
|
||
* 获取医生下拉列表(用于选择在线复诊负责人)
|
||
* 返回 su_id 作为 id,需传入 store_id
|
||
*/
|
||
export async function getDoctorOptionApi(storeId?: number) {
|
||
return requestClient.get<any>(`${prefix}doctor-option`, {
|
||
params: storeId ? { store_id: storeId } : {},
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 获取有互联网诊疗资质的诊所下拉列表
|
||
* 用于选择委托在线复诊的诊所
|
||
*/
|
||
export async function getInternetMedicalStoreOptionApi() {
|
||
return requestClient.get<any>(`${prefix}internet-medical-store-option`);
|
||
}
|
||
|
||
/**
|
||
* 绑定在线复诊配置
|
||
*/
|
||
export async function bindOnlineConsultationApi(data: {
|
||
id: number;
|
||
is_internet_medical: number;
|
||
delegate_store_id?: number | null;
|
||
online_consultation_doctor_id?: number | null;
|
||
}) {
|
||
return requestClient.post<any>(`${prefix}bind-online-consultation`, data);
|
||
}
|
||
/**
|
||
* 分页查询用户列表
|
||
* @param data
|
||
*/
|
||
export async function getStoreList(data: any) {
|
||
return requestClient.get<any>(`${prefix}list`, { params: data });
|
||
}
|
||
/**
|
||
* 分页查询用户列表
|
||
* @param data
|
||
*/
|
||
export async function getStoreOption(data: any) {
|
||
return requestClient.get<any>(`${prefix}option`, { params: data });
|
||
}
|
||
|
||
/**
|
||
* 获取诊所详情
|
||
* @param id
|
||
*/
|
||
export async function getStoreInfo(id: number) {
|
||
return requestClient.get<any>(`${prefix}detail`, { params: { id } });
|
||
}
|
||
|
||
/**
|
||
* 新增诊所
|
||
* @param data
|
||
*/
|
||
export async function createStore(data: Record<string, any>) {
|
||
return requestClient.post<any>(`${prefix}create`, data);
|
||
}
|
||
|
||
/**
|
||
* 编辑诊所
|
||
* @param data
|
||
*/
|
||
export async function updateStore(data: Record<string, any>) {
|
||
return requestClient.post<any>(`${prefix}update`, data);
|
||
}
|
||
|
||
/**
|
||
* 删除诊所
|
||
* @param data
|
||
*/
|
||
export async function deleteStore(data: Record<string, any>) {
|
||
return requestClient.post<any>(`${prefix}delete`, data);
|
||
}
|
||
|
||
/**
|
||
* 开启后台登录
|
||
* @param id
|
||
*/
|
||
export async function openPcWindowsApiByStore(id: number) {
|
||
return requestClient.post<any>(`${prefix}open-pc-windows`, {
|
||
id,
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 开启后台登录
|
||
* @param id
|
||
*/
|
||
export async function openQrCodeApi(id: number) {
|
||
return requestClient.post<any>(`${prefix}open-qr-code`, {
|
||
id,
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 更新门店包邮状态
|
||
* @param data
|
||
*/
|
||
export async function updateStoreShippingFree(data: { id: number }) {
|
||
return requestClient.post<any>(`${prefix}update-shipping-free`, data);
|
||
}
|
||
|
||
/**
|
||
* 更新门店价格波动订阅状态
|
||
* @param data
|
||
*/
|
||
export async function updateStoreSubscribeStatus(data: { id: number }) {
|
||
return requestClient.post<any>(`${prefix}update-subscribe-status`, data);
|
||
}
|
||
|
||
/**
|
||
* 切换门店是否可查看毛利率
|
||
* @param data
|
||
*/
|
||
export async function updateStoreSeeRateStatus(data: { id: number }) {
|
||
return requestClient.post<any>(`${prefix}update-see-rate`, data);
|
||
}
|
||
|
||
/**
|
||
* 获取诊所药品列表(按类型)
|
||
* @param storeId 诊所ID
|
||
* @param type 商品类型(1中药 2西药 3保健食品 5产品服务包 6非药品 7医疗器械)
|
||
*/
|
||
export async function getStoreDrugsByTypeApi(storeId: number, type: number) {
|
||
return requestClient.get<any>(`${prefix}get-store-drugs-by-type`, {
|
||
params: { store_id: storeId, type },
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 批量更新诊所药品价格(平台管理员专用)
|
||
* @param data
|
||
*/
|
||
export async function updateStoreDrugPricesApi(data: {
|
||
store_id: number;
|
||
drugs: Array<{
|
||
id: number;
|
||
price: number;
|
||
buy_price: number;
|
||
}>;
|
||
}) {
|
||
return requestClient.post<any>(`${prefix}update-store-drug-prices`, data);
|
||
}
|
||
|
||
/**
|
||
* 批量同步总仓库药品
|
||
* @param ids 门店ID数组
|
||
*/
|
||
export async function batchSyncDrugPriceApi(ids: number[]) {
|
||
return requestClient.post<any>(`${prefix}batch-sync-drug-price`, {
|
||
ids,
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 更新诊所类型
|
||
* @param data 包含id和clinic_type的对象,clinic_type: 1=西医诊所, 2=中医诊所
|
||
*/
|
||
export async function updateClinicTypeApi(data: { id: number; clinic_type: number }) {
|
||
return requestClient.post<any>(`${prefix}update-clinic-type`, data);
|
||
}
|
||
|
||
export async function updateAllowInsuranceCategoryApi(data: { id: number }) {
|
||
return requestClient.post<any>(`${prefix}update-allow-insurance-category`, data);
|
||
}
|
||
|
||
export async function toggleSalespersonSeePriceApi(data: { store_id: number }) {
|
||
return requestClient.post<any>('salesperson-store-config/toggle-see-price', data);
|
||
}
|
||
|
||
/**
|
||
* 单独更新 ERP ID 或 MES ID(列表快捷编辑)
|
||
*/
|
||
export async function updateStoreExternalFieldApi(data: {
|
||
id: number;
|
||
field: 'erp_id' | 'mes_id';
|
||
value?: number | string | null;
|
||
}) {
|
||
return requestClient.post<any>(`${prefix}update-store-external-field`, data);
|
||
}
|