64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
import type { PageParam, PageResult } from '@/http/types'
|
|
import { http } from '@/http/http'
|
|
|
|
/** 报损单项 */
|
|
export interface StockLossItem {
|
|
id?: number
|
|
stockLossId?: number
|
|
warehouseId?: number
|
|
warehouseName?: string
|
|
productId?: number
|
|
productName?: string
|
|
productUnitName?: string
|
|
count?: number
|
|
productPrice?: number
|
|
totalPrice?: number
|
|
remark?: string
|
|
}
|
|
|
|
/** 报损单信息 */
|
|
export interface StockLoss {
|
|
id?: number
|
|
no?: string
|
|
lossTime?: string
|
|
totalCount?: number
|
|
totalPrice?: number
|
|
status?: number
|
|
reason?: string
|
|
remark?: string
|
|
items?: StockLossItem[]
|
|
productNames?: string
|
|
creatorName?: string
|
|
createTime?: number
|
|
}
|
|
|
|
/** 获取报损单分页列表 */
|
|
export function getStockLossPage(params: PageParam) {
|
|
return http.get<PageResult<StockLoss>>('/erp/stock-loss/page', params)
|
|
}
|
|
|
|
/** 获取报损单详情 */
|
|
export function getStockLoss(id: number) {
|
|
return http.get<StockLoss>(`/erp/stock-loss/get?id=${id}`)
|
|
}
|
|
|
|
/** 创建报损单 */
|
|
export function createStockLoss(data: StockLoss) {
|
|
return http.post<number>('/erp/stock-loss/create', data)
|
|
}
|
|
|
|
/** 更新报损单 */
|
|
export function updateStockLoss(data: StockLoss) {
|
|
return http.put<boolean>('/erp/stock-loss/update', data)
|
|
}
|
|
|
|
/** 更新报损单状态 */
|
|
export function updateStockLossStatus(id: number, status: number) {
|
|
return http.put<boolean>('/erp/stock-loss/update-status', undefined, { id, status })
|
|
}
|
|
|
|
/** 删除报损单 */
|
|
export function deleteStockLoss(ids: number[]) {
|
|
return http.delete<boolean>('/erp/stock-loss/delete', undefined, { ids: ids.join(',') })
|
|
}
|