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 StockGainItem {
|
||
|
|
id?: number
|
||
|
|
stockGainId?: number
|
||
|
|
warehouseId?: number
|
||
|
|
warehouseName?: string
|
||
|
|
productId?: number
|
||
|
|
productName?: string
|
||
|
|
productUnitName?: string
|
||
|
|
count?: number
|
||
|
|
productPrice?: number
|
||
|
|
totalPrice?: number
|
||
|
|
remark?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 报溢单信息 */
|
||
|
|
export interface StockGain {
|
||
|
|
id?: number
|
||
|
|
no?: string
|
||
|
|
gainTime?: string
|
||
|
|
totalCount?: number
|
||
|
|
totalPrice?: number
|
||
|
|
status?: number
|
||
|
|
reason?: string
|
||
|
|
remark?: string
|
||
|
|
items?: StockGainItem[]
|
||
|
|
productNames?: string
|
||
|
|
creatorName?: string
|
||
|
|
createTime?: number
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 获取报溢单分页列表 */
|
||
|
|
export function getStockGainPage(params: PageParam) {
|
||
|
|
return http.get<PageResult<StockGain>>('/erp/stock-gain/page', params)
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 获取报溢单详情 */
|
||
|
|
export function getStockGain(id: number) {
|
||
|
|
return http.get<StockGain>(`/erp/stock-gain/get?id=${id}`)
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 创建报溢单 */
|
||
|
|
export function createStockGain(data: StockGain) {
|
||
|
|
return http.post<number>('/erp/stock-gain/create', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 更新报溢单 */
|
||
|
|
export function updateStockGain(data: StockGain) {
|
||
|
|
return http.put<boolean>('/erp/stock-gain/update', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 更新报溢单状态 */
|
||
|
|
export function updateStockGainStatus(id: number, status: number) {
|
||
|
|
return http.put<boolean>('/erp/stock-gain/update-status', undefined, { id, status })
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 删除报溢单 */
|
||
|
|
export function deleteStockGain(ids: number[]) {
|
||
|
|
return http.delete<boolean>('/erp/stock-gain/delete', undefined, { ids: ids.join(',') })
|
||
|
|
}
|