You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
1 year ago
|
import request from '@/config/axios'
|
||
|
|
||
|
export interface ShiftVO {
|
||
|
code: string
|
||
|
name: string
|
||
|
description: string
|
||
|
beginTime: Date
|
||
|
entTime: Date
|
||
|
activeTime: Date
|
||
|
expireTime: Date
|
||
|
remark: string
|
||
|
endAtNextDay: string
|
||
|
available: string
|
||
|
}
|
||
|
|
||
|
// 查询班次列表
|
||
|
export const getShiftPage = async (params) => {
|
||
|
if (params.isSearch) {
|
||
|
delete params.isSearch
|
||
|
const data = {...params}
|
||
|
return request.post({ url: '/wms/shift/senior', data })
|
||
|
} else {
|
||
|
return await request.get({ url: `/wms/shift/page`, params })
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// 查询班次详情
|
||
|
export const getShift = async (id: number) => {
|
||
|
return await request.get({ url: `/wms/shift/get?id=` + id })
|
||
|
}
|
||
|
|
||
|
// 新增班次
|
||
|
export const createShift = async (data: ShiftVO) => {
|
||
|
return await request.post({ url: `/wms/shift/create`, data })
|
||
|
}
|
||
|
|
||
|
// 修改班次
|
||
|
export const updateShift = async (data: ShiftVO) => {
|
||
|
return await request.put({ url: `/wms/shift/update`, data })
|
||
|
}
|
||
|
|
||
|
// 删除班次
|
||
|
export const deleteShift = async (id: number) => {
|
||
|
return await request.delete({ url: `/wms/shift/delete?id=` + id })
|
||
|
}
|
||
|
|
||
|
// 导出班次 Excel
|
||
|
export const exportShift = async (params) => {
|
||
|
if (params.isSearch) {
|
||
|
const data = {...params}
|
||
|
return await request.downloadPost({ url: `/wms/shift/export-excel-senior`, data })
|
||
|
} else {
|
||
|
return await request.download({ url: `/wms/shift/export-excel`, params })
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// 下载用户导入模板
|
||
|
export const importTemplate = () => {
|
||
|
return request.download({ url: '/wms/shift/get-import-template' })
|
||
|
}
|