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.

58 lines
1.5 KiB

1 year ago
import request from '@/config/axios'
export interface ProjectVO {
code: string
name: string
description: string
customerCode: string
available: number
activeTime: Date
expireTime: Date
remark: string
}
// 查询项目列表
export const getProjectPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/project/senior', data })
} else {
return await request.get({ url: `/wms/project/page`, params })
}
}
// 查询项目详情
export const getProject = async (id: number) => {
return await request.get({ url: `/wms/project/get?id=` + id })
}
// 新增项目
export const createProject = async (data: ProjectVO) => {
return await request.post({ url: `/wms/project/create`, data })
}
// 修改项目
export const updateProject = async (data: ProjectVO) => {
return await request.put({ url: `/wms/project/update`, data })
}
// 删除项目
export const deleteProject = async (id: number) => {
return await request.delete({ url: `/wms/project/delete?id=` + id })
}
// 导出项目 Excel
export const exportProject = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/project/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/project/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/project/get-import-template' })
}