From 839a0816c8cda70d976bb1c199dd6a27d262500a Mon Sep 17 00:00:00 2001
From: yejiaxing <591141169@qq.com>
Date: Wed, 31 Jan 2024 09:02:54 +0800
Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/eam/item/transaction/index.ts | 53 ++++
src/utils/dict.ts | 4 +-
src/views/eam/item/transaction/index.vue | 241 ++++++++++++++++++
.../eam/item/transaction/transaction.data.ts | 102 ++++++++
4 files changed, 397 insertions(+), 3 deletions(-)
create mode 100644 src/api/eam/item/transaction/index.ts
create mode 100644 src/views/eam/item/transaction/index.vue
create mode 100644 src/views/eam/item/transaction/transaction.data.ts
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 740e000..9860c6f 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', // 重置周期
@@ -278,6 +277,5 @@ export enum DICT_TYPE {
TRANSACTION_TYPE = 'transaction_Type', // 事务类型
RESULT = 'result', // 事务类型
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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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'
+ }
+ }
+]))