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.
108 lines
3.3 KiB
TypeScript
108 lines
3.3 KiB
TypeScript
import request from '@/config/axios'
|
|
|
|
// 编码生成记录 VO
|
|
export interface AutocodeRecordVO {
|
|
id: number // ID
|
|
ruleId: number // 规则ID
|
|
genDate: string // 生成日期时间
|
|
genIndex: number // 最后产生的序号
|
|
lastResult: string // 最后产生的值
|
|
lastSerialNo: number // 最后产生的流水号
|
|
lastInputChar: string // 最后传入的参数
|
|
remark: string // 备注
|
|
isEnable: boolean // 是否启用
|
|
}
|
|
|
|
// 编码生成记录 API
|
|
export const AutocodeRecordApi = {
|
|
// 查询编码生成记录分页
|
|
getAutocodeRecordPage: async (params: any) => {
|
|
return await request.get({ url: `/erp/autocode-record/page`, params })
|
|
},
|
|
|
|
// 查询编码生成记录详情
|
|
getAutocodeRecord: async (id: number) => {
|
|
return await request.get({ url: `/erp/autocode-record/get?id=` + id })
|
|
},
|
|
|
|
// 新增编码生成记录
|
|
createAutocodeRecord: async (data: AutocodeRecordVO) => {
|
|
return await request.post({ url: `/erp/autocode-record/create`, data })
|
|
},
|
|
|
|
// 修改编码生成记录
|
|
updateAutocodeRecord: async (data: AutocodeRecordVO) => {
|
|
return await request.put({ url: `/erp/autocode-record/update`, data })
|
|
},
|
|
|
|
// 删除编码生成记录
|
|
deleteAutocodeRecord: async (id: number) => {
|
|
return await request.delete({ url: `/erp/autocode-record/delete?id=` + id })
|
|
},
|
|
|
|
// 导出编码生成记录 Excel
|
|
exportAutocodeRecord: async (params) => {
|
|
return await request.download({ url: `/erp/autocode-record/export-excel`, params })
|
|
}
|
|
}
|
|
|
|
|
|
// 编码规则 VO
|
|
export interface AutocodeRuleVO {
|
|
id: number // ID
|
|
ruleCode: string // 规则编码
|
|
ruleName: string // 规则名称
|
|
barcodeType?: number | string
|
|
barCodeType?: number | string
|
|
ruleDesc: string // 描述
|
|
maxLength: number // 最大长度
|
|
isPadded: string // 是否补齐
|
|
paddedChar: string // 补齐字符
|
|
paddedMethod: string // 补齐方式
|
|
remark: string // 备注
|
|
isEnable: boolean // 是否启用
|
|
}
|
|
|
|
// 编码规则 API
|
|
export const AutocodeRuleApi = {
|
|
// 查询编码规则分页
|
|
getAutocodeRulePage: async (params: any) => {
|
|
return await request.get({ url: `/erp/autocode-rule/page`, params })
|
|
},
|
|
|
|
// 查询编码规则详情
|
|
getAutocodeRule: async (id: number) => {
|
|
return await request.get({ url: `/erp/autocode-rule/get?id=` + id })
|
|
},
|
|
|
|
// 新增编码规则
|
|
createAutocodeRule: async (data: AutocodeRuleVO) => {
|
|
return await request.post({ url: `/erp/autocode-rule/create`, data })
|
|
},
|
|
|
|
// 修改编码规则
|
|
updateAutocodeRule: async (data: AutocodeRuleVO) => {
|
|
return await request.put({ url: `/erp/autocode-rule/update`, data })
|
|
},
|
|
|
|
// 删除编码规则
|
|
deleteAutocodeRule: async (id: number) => {
|
|
return await request.delete({ url: `/erp/autocode-rule/delete?id=` + id })
|
|
},
|
|
// 测试编码规则
|
|
getTestCode: async (ruleCode: string) => {
|
|
return await request.get({ url: `/erp/autocode-rule/getTestCode?ruleCode=` + ruleCode })
|
|
},
|
|
// 导出编码规则 Excel
|
|
exportAutocodeRule: async (params) => {
|
|
return await request.download({ url: `/erp/autocode-rule/export-excel`, params })
|
|
},
|
|
|
|
// ==================== 子表(编码规则组成) ====================
|
|
|
|
// 获得编码规则组成列表
|
|
getAutocodePartListByRuleId: async (ruleId) => {
|
|
return await request.get({ url: `/erp/autocode-rule/autocode-part/list-by-rule-id?ruleId=` + ruleId })
|
|
}
|
|
}
|