提交
This commit is contained in:
1 parent
012a2ad68e
commit
5fe53c5481
4775 files changed
+2190111
-40277
No files matched your search
@@ -14,33 +14,32 @@ export interface CrmProductOption {
|
||||
status?: string
|
||||
}
|
||||
|
||||
function extractList<T>(res: unknown): T[] {
|
||||
function extractOptions<T>(res: unknown): T[] {
|
||||
if (Array.isArray(res)) return res as T[]
|
||||
const data = (res as { list?: T[]; rows?: T[] }) || {}
|
||||
return data.list || data.rows || []
|
||||
}
|
||||
|
||||
/** CRM 客户远程搜索(只读) */
|
||||
/** CRM 客户下拉(只读,租户内不做数据权限) */
|
||||
export async function fetchCustomerOptions(keyword?: string): Promise<CrmCustomerOption[]> {
|
||||
const res = await api.post<{ list?: CrmCustomerOption[] }>({
|
||||
url: '/web/crm/customer/list',
|
||||
const res = await api.post<CrmCustomerOption[]>({
|
||||
url: '/web/crm/customer/options',
|
||||
data: {
|
||||
page: 1,
|
||||
pageSize: keyword?.trim() ? 50 : 20,
|
||||
...(keyword?.trim() ? { customerName: keyword.trim() } : {})
|
||||
limit: keyword?.trim() ? 50 : 20,
|
||||
...(keyword?.trim() ? { keyword: keyword.trim() } : {})
|
||||
}
|
||||
})
|
||||
return extractList<CrmCustomerOption>(res)
|
||||
return extractOptions<CrmCustomerOption>(res)
|
||||
}
|
||||
|
||||
/** CRM 产品远程搜索(只读) */
|
||||
/** CRM 产品下拉(只读,租户内不做数据权限;仅上架) */
|
||||
export async function fetchProductOptions(keyword?: string): Promise<CrmProductOption[]> {
|
||||
const res = await api.post<{ list?: CrmProductOption[] }>({
|
||||
url: '/web/crm/products/list',
|
||||
const res = await api.post<CrmProductOption[]>({
|
||||
url: '/web/crm/products/options',
|
||||
data: {
|
||||
page: 1,
|
||||
pageSize: keyword?.trim() ? 50 : 20,
|
||||
...(keyword?.trim() ? { productName: keyword.trim() } : {})
|
||||
limit: keyword?.trim() ? 50 : 20,
|
||||
...(keyword?.trim() ? { keyword: keyword.trim() } : {})
|
||||
}
|
||||
})
|
||||
return extractList<CrmProductOption>(res)
|
||||
return extractOptions<CrmProductOption>(res)
|
||||
}
|
||||
@@ -21,6 +21,8 @@ export interface InventoryRecord {
|
||||
purchasePlanId?: string
|
||||
isDeleted: number
|
||||
createdAt: string
|
||||
createBy?: string
|
||||
createByName?: string
|
||||
grossWeight?: number
|
||||
tareWeight?: number
|
||||
deduction?: number
|
||||
|
||||
@@ -24,6 +24,8 @@ export interface Plan {
|
||||
executedQuantity?: number
|
||||
isDeleted: number
|
||||
createdAt: string
|
||||
createBy?: string
|
||||
createByName?: string
|
||||
/** 生成链接交三方填写时对应的出入库单 id */
|
||||
fillLinkInventoryId?: string
|
||||
autoGenerateEnabled?: number
|
||||
|
||||
@@ -30,6 +30,8 @@ export interface WeighingRecord {
|
||||
currentQuantity?: number
|
||||
isVoided: number
|
||||
createdAt: string
|
||||
createBy?: string
|
||||
createByName?: string
|
||||
inventoryDate?: string
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user