From 5a6bad275dd752f788c07215589f3a76926e043b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com>
Date: Wed, 28 Feb 2024 15:37:32 +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/device/problemSolving/index.ts | 55 +++++
src/api/eam/item/replaceItemDes/index.ts | 2 +
src/views/eam/device/problemSolving/index.vue | 224 ++++++++++++++++++
.../problemSolving/problemSolving.data.ts | 83 +++++++
src/views/eam/item/replaceItemDes/index.vue | 4 +-
.../replaceItemDes/replaceItemDes.data.ts | 16 --
6 files changed, 366 insertions(+), 18 deletions(-)
create mode 100644 src/api/eam/device/problemSolving/index.ts
create mode 100644 src/views/eam/device/problemSolving/index.vue
create mode 100644 src/views/eam/device/problemSolving/problemSolving.data.ts
diff --git a/src/api/eam/device/problemSolving/index.ts b/src/api/eam/device/problemSolving/index.ts
new file mode 100644
index 0000000..9c97bc3
--- /dev/null
+++ b/src/api/eam/device/problemSolving/index.ts
@@ -0,0 +1,55 @@
+import request from '@/config/axios'
+
+export interface AttachmentFileVO {
+ itemNumber: string
+ qty: number
+ areaNumber: string
+ isInAccount: string
+ siteId: string
+ available: string
+ funcCode: string
+ concurrencyStamp: number
+}
+
+// 查询备件台账列表
+export const getProblemSolvingPage = async (params) => {
+ params.funcCode="problem_solving"
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/eam/attachment-file/senior', data })
+ } else {
+ return await request.get({ url: `/eam/attachment-file/page`, params })
+ }
+}
+
+// 查询备件台账详情
+export const getProblemSolving = async (id: number) => {
+ return await request.get({ url: `/eam/attachment-file/get?id=` + id })
+}
+
+// 新增备件台账
+export const createProblemSolving = async (data: AttachmentFileVO) => {
+ data.funcCode="problem_solving"
+ return await request.post({ url: `/eam/attachment-file/create`, data })
+}
+
+// 修改备件台账
+export const updateProblemSolving = async (data: AttachmentFileVO) => {
+ return await request.put({ url: `/eam/attachment-file/update`, data })
+}
+
+// 删除备件台账
+export const deleteProblemSolving = async (id: number) => {
+ return await request.delete({ url: `/eam/attachment-file/delete?id=` + id })
+}
+
+// 导出备件台账 Excel
+export const exportProblemSolving = async (params) => {
+ return await request.download({ url: `/eam/attachment-file/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/attachment-file/get-import-template' })
+}
diff --git a/src/api/eam/item/replaceItemDes/index.ts b/src/api/eam/item/replaceItemDes/index.ts
index 4c7daf4..92cd7f2 100644
--- a/src/api/eam/item/replaceItemDes/index.ts
+++ b/src/api/eam/item/replaceItemDes/index.ts
@@ -6,6 +6,7 @@ export interface AttachmentFileVO {
areaNumber: string
isInAccount: string
siteId: string
+ funcCode: string
available: string
concurrencyStamp: number
}
@@ -29,6 +30,7 @@ export const getReplaceItemDes = async (id: number) => {
// 新增备件台账
export const createReplaceItemDes = async (data: AttachmentFileVO) => {
+ data.funcCode="Replace_Item_Des"
return await request.post({ url: `/eam/attachment-file/create`, data })
}
diff --git a/src/views/eam/device/problemSolving/index.vue b/src/views/eam/device/problemSolving/index.vue
new file mode 100644
index 0000000..b603df2
--- /dev/null
+++ b/src/views/eam/device/problemSolving/index.vue
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/eam/device/problemSolving/problemSolving.data.ts b/src/views/eam/device/problemSolving/problemSolving.data.ts
new file mode 100644
index 0000000..1302a63
--- /dev/null
+++ b/src/views/eam/device/problemSolving/problemSolving.data.ts
@@ -0,0 +1,83 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+
+ import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
+ import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
+
+// 表单校验
+export const ProblemSolvingRules = reactive({
+ itemNumber: [required],
+ areaNumber: [required],
+ concurrencyStamp: [required],
+})
+
+export const ProblemSolving = useCrudSchemas(reactive([
+ {
+ label: '设备编号',
+ field: 'number',
+ sort: 'custom',
+ isSearch: true,
+ form: {
+ // labelMessage: '信息提示说明!!!',
+ componentProps: {
+ isSearchList: true, // 开启查询弹窗
+ searchListPlaceholder: '请选择设备编号', // 输入框占位文本
+ searchField: 'number', // 查询弹窗赋值字段
+ searchTitle: '设备信息', // 查询弹窗标题
+ searchAllSchemas: DeviceAccounts.allSchemas, // 查询弹窗所需类
+ searchPage: DeviceAccountsApi.getDeviceAccountsPage, // 查询弹窗所需分页方法
+ searchCondition: [
+ {
+ key: 'available',
+ value: "TRUE",
+ isMainValue: false
+ }]
+ }
+ }
+ },
+ {
+ label: '文件',
+ field: 'filePathListView',
+ sort: 'custom',
+ isTable: false,
+ table: {
+ },
+ form: {
+ component: 'UploadFile',
+ componentProps: {
+
+ }
+ }
+ },
+ {
+ label: '文件',
+ field: 'filePathList',
+ sort: 'custom',
+ isTable: false,
+ isForm: false,
+ table: {
+ },
+ form: {
+ component: 'UploadFile',
+ componentProps: {
+
+ }
+ }
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ sort: 'custom',
+ formatter: dateFormatter,
+ isForm: false
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isForm: false,
+ table: {
+
+ fixed: 'right'
+ }
+ }
+]))
diff --git a/src/views/eam/item/replaceItemDes/index.vue b/src/views/eam/item/replaceItemDes/index.vue
index a20890e..a949072 100644
--- a/src/views/eam/item/replaceItemDes/index.vue
+++ b/src/views/eam/item/replaceItemDes/index.vue
@@ -143,8 +143,8 @@
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
data.filePathList=[];
- for (let i = 0; i < data.filePathListView.length; i++) {
- data.filePathList.push(data.filePathListView[i].url);
+ for (let i = 0; i < data.filePathList.length; i++) {
+ data.filePathList.push(data.filePathList[i].url);
}
if (formType === 'create') {
await ReplaceItemDesApi.createReplaceItemDes(data)
diff --git a/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts
index 77def59..a3417af 100644
--- a/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts
+++ b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts
@@ -35,32 +35,16 @@ export const ReplaceItemDes = useCrudSchemas(reactive([
}
}
},
- {
- label: '文件',
- field: 'filePathListView',
- sort: 'custom',
- isTable: false,
- table: {
- },
- form: {
- component: 'UploadFile',
- componentProps: {
-
- }
- }
- },
{
label: '文件',
field: 'filePathList',
sort: 'custom',
isTable: false,
- isForm: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
-
}
}
},