You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
5.1 KiB
TypeScript

import request from '@/config/axios'
// 模具型号 VO
export interface MoldBrandVO {
id: number // ID
code: string // 型号编码
name: string // 型号名称
moldType: string // 规格
productId: number // 产品ID
useTime: number // 预期寿命(小时)
maintainType: number // 维保模式
maintainTime: number // 维保周期
moldSize: number // 模具系数
remark: string // 备注
isEnable: boolean // 是否启用
}
export interface MoldBrandTreeVO extends MoldBrandVO {
parentId?: number
parentChain?: string
createTime?: string
children?: MoldBrandTreeVO[]
leaf?: boolean
}
// 模具 VO
export interface MoldVO {
id: number // ID
code: string // 模具编码
isCode?: boolean
name: string // 模具名称
unitId: number // 单位ID
machineId: number // 机台ID
useTime: number // 使用时间(小时)
inTime: Date // 入库时间
status: number // 状态
images: string // 模具图片
qrcodeUrl?: string
templateJson?: string | any
fileUrl?: string
remark: string // 备注
isEnable: boolean // 是否启用
brandId: number // 型号id
lastMaintainTime: Date // 上次保养
lastRepairTime: Date // 上次维修
lastMoldTime: Date // 上次换模
}
// 模具型号 API
export const MoldBrandApi = {
// 查询模具型号分页
getMoldBrandPage: async (params: any) => {
return await request.get({ url: `/erp/mold-brand/page`, params })
},
// 查询模具型号详情
getMoldBrand: async (id: number) => {
return await request.get({ url: `/erp/mold-brand/get?id=` + id })
},
getMoldBrandTree: async () => {
return await request.get({ url: `/erp/mold-brand/tree` })
},
// 新增模具型号
createMoldBrand: async (data: MoldBrandVO) => {
return await request.post({ url: `/erp/mold-brand/create`, data })
},
// 修改模具型号
updateMoldBrand: async (data: MoldBrandVO) => {
return await request.put({ url: `/erp/mold-brand/update`, data })
},
// 删除模具型号
deleteMoldBrand: async (id: number) => {
return await request.delete({ url: `/erp/mold-brand/delete?id=` + id })
},
// 导出模具型号 Excel
exportMoldBrand: async (params) => {
return await request.download({ url: `/erp/mold-brand/export-excel`, params })
},
// 查询模具型号列表
getBrandList: async (params) => {
return await request.get({ url: `/erp/mold-brand/getBrandList`, params })
},
// ==================== 子表(模具) ====================
// 查询模具列表
getMoldList: async (params) => {
return await request.get({ url: `/erp/mold-brand/getMoldList`, params })
},
// 查询全部模具列表
getMoldAllList: async () => {
return await request.get({ url: `/erp/mold-brand/getMoldAllList` })
},
// 查询在途模具列表(用于上模)
getInTransitMoldAllList: async () => {
return await request.get({ url: `/erp/mold/getInTransitMoldAllList` })
},
// 获得模具分页
getMoldPage: async (params) => {
return await request.get({ url: `/erp/mold-brand/mold/page`, params })
},
getMoldPageWithoutPaging: async () => {
return await request.get({ url: `/erp/mold-brand/mold/list` })
},
// 导出模具 Excel
exportMold: async (params) => {
return await request.download({ url: `/erp/mold-brand/mold/export-excel`, params })
},
// 新增模具
createMold: async (data) => {
return await request.post({ url: `/erp/mold-brand/mold/create`, data })
},
// 修改模具
updateMold: async (data) => {
return await request.put({ url: `/erp/mold-brand/mold/update`, data })
},
// 删除模具
deleteMold: async (id: number) => {
return await request.delete({ url: `/erp/mold-brand/mold/delete?id=` + id })
},
// 获得模具
getMold: async (id: number) => {
return await request.get({ url: `/erp/mold-brand/mold/get?id=` + id })
},
regenerateCode: async (id: number, code: string) => {
return await request.post({ url: `/erp/mold-brand/regenerate-code?id=${id}&code=${encodeURIComponent(code)}` })
},
// 根据状态获得模具
getMoldListByStatus: async (status: number) => {
return await request.get({ url: `/erp/mold/getMoldListByStatus?status=` + status })
},
// ==================== 子表(模具产品) ====================
// 获得模具产品分页
getMoldBrandProductPage: async (params) => {
return await request.get({ url: `/erp/mold-brand/mold-brand-product/page`, params })
},
// 新增模具产品
createMoldBrandProduct: async (data) => {
return await request.post({ url: `/erp/mold-brand/mold-brand-product/create`, data })
},
// 修改模具产品
updateMoldBrandProduct: async (data) => {
return await request.put({ url: `/erp/mold-brand/mold-brand-product/update`, data })
},
// 删除模具产品
deleteMoldBrandProduct: async (id: number) => {
return await request.delete({ url: `/erp/mold-brand/mold-brand-product/delete?id=` + id })
},
// 获得模具产品
getMoldBrandProduct: async (id: number) => {
return await request.get({ url: `/erp/mold-brand/mold-brand-product/get?id=` + id })
}
}