From bac2e99f0d190ccf0c3d9837d7dee80bafb88f19 Mon Sep 17 00:00:00 2001 From: "Mr.j" <2221464500@qq.com> Date: Wed, 13 Aug 2025 10:17:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=AE=BE=E5=A4=87=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=A1=B5=E9=9D=A2=E4=BB=A5=E5=8F=8A=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E6=90=AD=E5=BB=BA=E5=AE=8C=E6=88=90=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9B=98=E5=BA=93=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/equipment/index.ts | 22 +- src/router/route.ts | 10 + src/stores/modules/route.ts | 36 +- src/types/components.d.ts | 1 + .../components/EquipmentTypeModal.vue | 201 +++++++++++ .../device-management/index.vue | 34 ++ .../device-management/inventory.vue | 330 ++++++++++++++++++ 7 files changed, 622 insertions(+), 12 deletions(-) create mode 100644 src/views/system-resource/device-management/components/EquipmentTypeModal.vue create mode 100644 src/views/system-resource/device-management/inventory.vue diff --git a/src/apis/equipment/index.ts b/src/apis/equipment/index.ts index 79de61c..35e2089 100644 --- a/src/apis/equipment/index.ts +++ b/src/apis/equipment/index.ts @@ -49,4 +49,24 @@ export function returnEquipment(equipmentId: string) { } // 导出设备采购 API -export * from './procurement' \ No newline at end of file +export * from './procurement' + +// 设备盘库相关 API +/** @desc 分页查询设备盘库记录 */ +export function pageEquipmentInventory(query: T.EquipmentPageQuery) { + return http.get(`${BASE_URL}/inventory/page`, query) +} + +/** @desc 执行设备盘库 */ +export function executeEquipmentInventory(equipmentId: string, inventoryResult: string, remark?: string) { + return http.post(`${BASE_URL}/inventory/${equipmentId}`, null, { + params: { inventoryResult, remark } + }) +} + +/** @desc 批量执行设备盘库 */ +export function batchExecuteEquipmentInventory(equipmentIds: string[], inventoryResult: string, remark?: string) { + return http.post(`${BASE_URL}/inventory/batch`, null, { + params: { equipmentIds, inventoryResult, remark } + }) +} \ No newline at end of file diff --git a/src/router/route.ts b/src/router/route.ts index 2f749c1..5a06e43 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -1282,6 +1282,16 @@ export const systemRoutes: RouteRecordRaw[] = [ hidden: false, }, }, + { + path: '/system-resource/device-management/inventory', + name: 'DeviceInventory', + component: () => import('@/views/system-resource/device-management/inventory.vue'), + meta: { + title: '设备盘库', + icon: 'inbox', + hidden: false, + }, + }, { path: '/system-resource/device-management/online', name: 'SystemResourceDeviceOnline', diff --git a/src/stores/modules/route.ts b/src/stores/modules/route.ts index 909490b..fb90fbd 100644 --- a/src/stores/modules/route.ts +++ b/src/stores/modules/route.ts @@ -226,6 +226,20 @@ const storeSetup = () => { { id: 2013, parentId: 2010, + title: '设备盘库', + type: 2, + path: '/asset-management/device-management/inventory', + name: 'DeviceInventory', + component: 'system-resource/device-management/inventory', + icon: 'inbox', + isExternal: false, + isCache: false, + isHidden: false, + sort: 3, + }, + { + id: 2014, + parentId: 2010, title: '审批台', type: 2, path: '/asset-management/device-management/approval', @@ -235,10 +249,10 @@ const storeSetup = () => { isExternal: false, isCache: false, isHidden: false, - sort: 3, + sort: 4, }, { - id: 2014, + id: 2015, parentId: 2010, title: '在线管理', type: 1, @@ -250,11 +264,11 @@ const storeSetup = () => { isExternal: false, isCache: false, isHidden: false, - sort: 4, + sort: 5, children: [ { - id: 20141, - parentId: 2014, + id: 20151, + parentId: 2015, title: '无人机', type: 2, path: '/asset-management/device-management/online/drone', @@ -267,8 +281,8 @@ const storeSetup = () => { sort: 1, }, { - id: 20142, - parentId: 2014, + id: 20152, + parentId: 2015, title: '机巢', type: 2, path: '/asset-management/device-management/online/nest', @@ -281,8 +295,8 @@ const storeSetup = () => { sort: 2, }, { - id: 20143, - parentId: 2014, + id: 20153, + parentId: 2015, title: '其他智能终端', type: 2, path: '/asset-management/device-management/online/smart-terminal', @@ -297,7 +311,7 @@ const storeSetup = () => { ], }, { - id: 2015, + id: 2016, parentId: 2010, title: '设备详情', type: 2, @@ -308,7 +322,7 @@ const storeSetup = () => { isExternal: false, isCache: false, isHidden: true, - sort: 5, + sort: 6, }, ], }, diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 7fa6b1b..81c6b77 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -7,6 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { + CircularProgress: typeof import('./../components/CircularProgress/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/src/views/system-resource/device-management/components/EquipmentTypeModal.vue b/src/views/system-resource/device-management/components/EquipmentTypeModal.vue new file mode 100644 index 0000000..a28ee9e --- /dev/null +++ b/src/views/system-resource/device-management/components/EquipmentTypeModal.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/views/system-resource/device-management/index.vue b/src/views/system-resource/device-management/index.vue index 7e731a2..908d55a 100644 --- a/src/views/system-resource/device-management/index.vue +++ b/src/views/system-resource/device-management/index.vue @@ -19,6 +19,12 @@ @search="handleSearch" @reset="handleReset" /> + + + 添加设备类型 + @@ -250,9 +264,11 @@ import { IconPlus, IconRefresh, IconSearch, + IconTag, } from '@arco-design/web-vue/es/icon' import message from '@arco-design/web-vue/es/message' import DeviceModal from './components/DeviceModal.vue' +import EquipmentTypeModal from './components/EquipmentTypeModal.vue' import EquipmentSearch from './components/EquipmentSearch.vue' import router from '@/router' import { EquipmentAPI } from '@/apis' @@ -287,6 +303,11 @@ const modalVisible = ref(false) const currentEquipment = ref(null) const modalMode = ref<'add' | 'edit' | 'view'>('add') +// 设备类型弹窗控制 +const equipmentTypeModalVisible = ref(false) +const currentEquipmentType = ref(null) +const equipmentTypeModalMode = ref<'add' | 'edit'>('add') + // 表格列配置 const columns = [ { @@ -913,6 +934,19 @@ const handleModalSuccess = () => { loadData() } +// 新增设备类型 +const handleAddEquipmentType = () => { + equipmentTypeModalMode.value = 'add' + currentEquipmentType.value = null + equipmentTypeModalVisible.value = true +} + +// 设备类型弹窗成功回调 +const handleEquipmentTypeModalSuccess = () => { + equipmentTypeModalVisible.value = false + loadData() +} + // 监听表格数据变化 watch(tableData, (_newData) => { // 数据变化监听 diff --git a/src/views/system-resource/device-management/inventory.vue b/src/views/system-resource/device-management/inventory.vue new file mode 100644 index 0000000..bb08cfe --- /dev/null +++ b/src/views/system-resource/device-management/inventory.vue @@ -0,0 +1,330 @@ + + + + +