From 982e7e94302863e9063fcb7b8142cbc81c92b84b Mon Sep 17 00:00:00 2001
From: "YEJIAXING-PC\\lenovo" <591141169@qq.com>
Date: Tue, 13 May 2025 10:24:20 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=8F=B0=E8=B4=A6=E5=8F=98?=
=?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E8=A1=A8=20=20=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/eam/item/itemAccountsChange/index.ts | 59 +++++
src/utils/dict.ts | 4 +
.../eam/item/itemAccountsChange/index.vue | 244 ++++++++++++++++++
.../itemAccountsChange.data.ts | 148 +++++++++++
4 files changed, 455 insertions(+)
create mode 100644 src/api/eam/item/itemAccountsChange/index.ts
create mode 100644 src/views/eam/item/itemAccountsChange/index.vue
create mode 100644 src/views/eam/item/itemAccountsChange/itemAccountsChange.data.ts
diff --git a/src/api/eam/item/itemAccountsChange/index.ts b/src/api/eam/item/itemAccountsChange/index.ts
new file mode 100644
index 0000000..f196a84
--- /dev/null
+++ b/src/api/eam/item/itemAccountsChange/index.ts
@@ -0,0 +1,59 @@
+import request from '@/config/axios'
+
+export interface ItemAccountsChangeVO {
+ id: number
+ number: string
+ operationType: string
+ beforeAfter: string
+ itemNumber: string
+ areaNumber: string
+ locationNumber: string
+ qty: number
+ isInAccount: string
+ siteId: string
+ available: string
+ concurrencyStamp: number
+ purchaseTime: Date
+ batch: string
+}
+
+// 查询备件台账变更记录列表
+export const getItemAccountsChangePage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/item-accounts-change/senior', data })
+ } else {
+ return await request.get({ url: `/eam/item-accounts-change/page`, params })
+ }
+}
+
+// 查询备件台账变更记录详情
+export const getItemAccountsChange = async (id: number) => {
+ return await request.get({ url: `/eam/item-accounts-change/get?id=` + id })
+}
+
+// 新增备件台账变更记录
+export const createItemAccountsChange = async (data: ItemAccountsChangeVO) => {
+ return await request.post({ url: `/eam/item-accounts-change/create`, data })
+}
+
+// 修改备件台账变更记录
+export const updateItemAccountsChange = async (data: ItemAccountsChangeVO) => {
+ return await request.put({ url: `/eam/item-accounts-change/update`, data })
+}
+
+// 删除备件台账变更记录
+export const deleteItemAccountsChange = async (id: number) => {
+ return await request.delete({ url: `/eam/item-accounts-change/delete?id=` + id })
+}
+
+// 导出备件台账变更记录 Excel
+export const exportItemAccountsChange = async (params) => {
+ return await request.download({ url: `/eam/item-accounts-change/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/item-accounts-change/get-import-template' })
+}
\ No newline at end of file
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index a163ba3..2b2c65b 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -315,6 +315,10 @@ export enum DICT_TYPE {
PUSH_STATUS = 'push_status',//推送状态
MOLD_TIME_SYNC_STATUS = 'mold_time_sync_status',//模具时间同步状态
PURCHASE_WAY = 'purchase_way',//模具时间同步状态
+ BEFORE_AFTER = 'before_after',//操作前后
+
+
+
}
diff --git a/src/views/eam/item/itemAccountsChange/index.vue b/src/views/eam/item/itemAccountsChange/index.vue
new file mode 100644
index 0000000..1baa9d8
--- /dev/null
+++ b/src/views/eam/item/itemAccountsChange/index.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/eam/item/itemAccountsChange/itemAccountsChange.data.ts b/src/views/eam/item/itemAccountsChange/itemAccountsChange.data.ts
new file mode 100644
index 0000000..8843fcc
--- /dev/null
+++ b/src/views/eam/item/itemAccountsChange/itemAccountsChange.data.ts
@@ -0,0 +1,148 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+
+// 表单校验
+export const ItemAccountsChangeRules = reactive({
+ number: [required],
+ operationType: [required],
+ beforeAfter: [required],
+ itemNumber: [required],
+ areaNumber: [required],
+ locationNumber: [required],
+ qty: [required],
+ available: [required],
+ concurrencyStamp: [required],
+ batch: [required]
+})
+
+export const ItemAccountsChange = useCrudSchemas(
+ reactive([
+ {
+ label: '编号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true
+ },
+
+ {
+ label: '操作类型',
+ field: 'operationType',
+ sort: 'custom',
+ dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
+ dictClass: 'string',
+ isSearch: false,
+ isTable: true,
+ tableForm: {
+ type: 'Select'
+ },
+ isForm: true,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+
+ {
+ label: '操作前后',
+ field: 'beforeAfter',
+ sort: 'custom',
+ dictType: DICT_TYPE.BEFORE_AFTER,
+ dictClass: 'string',
+ isSearch: false,
+ isTable: true,
+ tableForm: {
+ type: 'Select'
+ },
+ isForm: true,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '备件编号',
+ field: 'itemNumber',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '库区编号',
+ field: 'areaNumber',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '库位编号',
+ field: 'locationNumber',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '库存数量',
+ field: 'qty',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '是否账内库',
+ field: 'isInAccount',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isSearch: true,
+ search: {
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ type: 'daterange',
+ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
+ }
+ },
+ isForm: false
+ },
+ {
+ label: '采购时间',
+ field: 'purchaseTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isSearch: true,
+ search: {
+ component: 'DatePicker',
+ componentProps: {
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ type: 'daterange',
+ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
+ }
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ type: 'datetime',
+ valueFormat: 'x'
+ }
+ }
+ },
+ {
+ label: '批次',
+ field: 'batch',
+ sort: 'custom',
+ isSearch: true
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+ ])
+)