diff --git a/src/api/eam/item/transaction/index.ts b/src/api/eam/item/transaction/index.ts new file mode 100644 index 0000000..c11588a --- /dev/null +++ b/src/api/eam/item/transaction/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface TransactionVO { + itemNumber: string + locationNumber: string + transactionType: string + inventoryAction: string + businessType: string + inventoryStatus: string + uom: string + qty: number +} + +// 查询库存事务列表 +export const getTransactionPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/transaction/senior', data }) + } else { + return await request.get({ url: `/eam/transaction/page`, params }) + } +} + +// 查询库存事务详情 +export const getTransaction = async (id: number) => { + return await request.get({ url: `/eam/transaction/get?id=` + id }) +} + +// 新增库存事务 +export const createTransaction = async (data: TransactionVO) => { + return await request.post({ url: `/eam/transaction/create`, data }) +} + +// 修改库存事务 +export const updateTransaction = async (data: TransactionVO) => { + return await request.put({ url: `/eam/transaction/update`, data }) +} + +// 删除库存事务 +export const deleteTransaction = async (id: number) => { + return await request.delete({ url: `/eam/transaction/delete?id=` + id }) +} + +// 导出库存事务 Excel +export const exportTransaction = async (params) => { + return await request.download({ url: `/eam/transaction/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/transaction/get-import-template' }) +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 7c51e9c..12ecc79 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -226,7 +226,6 @@ export enum DICT_TYPE { BARCODE_PREFIX = 'barcode_prefix', // 条码前缀 SETTLEMENT_TYPE = 'settlement_type', // 结算类型 FROZEN_REASON = 'frozen_reason', // 冻结原因 - INVENTORY_ACTION = 'inventory_action', // 库存动作 CONTAINER_TYPE = 'container_type', // 器具类型 CONTAINER_CONTENT_TYPE = 'container_content_type', // 器具内容类型 RESET_PERIOD = 'reset_period', // 重置周期 @@ -277,9 +276,9 @@ export enum DICT_TYPE { DEVICE_MOLD_TYPE = 'device_mold_type', // 设备/模具类型 TRANSACTION_TYPE = 'transaction_Type', // 事务类型 RESULT = 'result', // 维修结果 - REQUEST_APPLY = 'class_type', // 班组类型 FAULT_TYPE = 'fault_type',//故障类型 WEI_XIU_ORDER_STATUS = 'wei_xiu_order_status',//维修单状态 BASIC_STATUS = 'basic_status',//设备模具状态 - + CLASS_TYPE = 'class_type', // 班组类型 + INVENTORY_ACTION = 'inventory_action' //库存动作 } diff --git a/src/views/eam/item/transaction/index.vue b/src/views/eam/item/transaction/index.vue new file mode 100644 index 0000000..875dc25 --- /dev/null +++ b/src/views/eam/item/transaction/index.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/views/eam/item/transaction/transaction.data.ts b/src/views/eam/item/transaction/transaction.data.ts new file mode 100644 index 0000000..04054bf --- /dev/null +++ b/src/views/eam/item/transaction/transaction.data.ts @@ -0,0 +1,102 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +// 表单校验 +export const Rules = reactive({ + itemNumber: [required], + locationNumber: [required], + inventoryAction: [required], + businessType: [required], + uom: [required], +}) + +export const Transaction = useCrudSchemas(reactive([ + + { + label: '事务编号', + field: 'number', + sort: 'custom', + isSearch: true, + }, + + { + label: '备件编号', + field: 'itemNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '库位编码', + field: 'locationNumber', + sort: 'custom', + isSearch: true, + }, + { + label: '事务类型', + field: 'transactionType', + sort: 'custom', + dictType: DICT_TYPE.TRANSACTION_TYPE, + dictClass: 'string', + isSearch: false, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '库存动作', + field: 'inventoryAction', + sort: 'custom', + dictType: DICT_TYPE.INVENTORY_ACTION, + dictClass: 'string', + isSearch: false, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '业务类型', + field: 'businessType', + sort: 'custom', + isSearch: true, + form: { + component: 'Select' + }, + }, + { + label: '库存状态', + field: 'inventoryStatus', + sort: 'custom', + isSearch: true, + form: { + component: 'Radio' + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + isSearch: true, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + isSearch: true, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/system/dept/DeptForm.vue b/src/views/system/dept/DeptForm.vue index 5410185..b4ad191 100644 --- a/src/views/system/dept/DeptForm.vue +++ b/src/views/system/dept/DeptForm.vue @@ -51,9 +51,9 @@ - - - +