From c8de8e973d532407c58ac0eb01d1a0dd532ea96d Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Mon, 26 Jan 2026 19:32:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=95=B4=E4=BD=93table=20=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20=E9=87=8D=E7=BD=AE=20=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormModel/index.vue | 13 +++++++------ .../EquipmentEntryApply/EquipmentDetailList.vue | 7 ++++--- .../EquipmentEntryApply/EquipmentMainList.vue | 7 ++++--- .../EquipmentEntryApply/equipmentInput/index1.vue | 2 +- .../EquipmentEntryApproval/EquipmentDetailList.vue | 7 ++++--- .../EquipmentEntryApproval/EquipmentMainList.vue | 5 +++-- .../equipmentInput/index.vue | 7 ++++--- .../EquipmentLedger/components/equ-retire.vue | 2 +- src/views/EquipmentRetireApply/todo.vue | 2 +- src/views/EquipmentRoamRecord/index.vue | 2 +- src/views/EquipmentServicing/index.vue | 2 +- src/views/EquipmentUpOrDown/equipment/index.vue | 2 +- src/views/EquipmentUpOrDown/tool/index.vue | 5 ++--- .../repairApply/SelectToolDialog.vue | 2 +- src/views/feedback/index.vue | 2 +- .../components/MunicipalChart/EquipStatusMore.vue | 8 ++++---- .../home/components/provincial/Dialog/AllEquip.vue | 4 ++-- .../provincial/Dialog/EquipStatusMore.vue | 4 ++-- .../components/provincial/Dialog/ProEquipMore.vue | 4 ++-- src/views/iotDevice/index.vue | 2 +- src/views/iotDevice/index1.vue | 3 ++- src/views/permission-template/index.vue | 14 +++++++------- .../entryApply/components/EquipmentAdd.vue | 12 ++++++------ 23 files changed, 62 insertions(+), 56 deletions(-) diff --git a/src/components/FormModel/index.vue b/src/components/FormModel/index.vue index a1bee2c4..35d0cc4f 100644 --- a/src/components/FormModel/index.vue +++ b/src/components/FormModel/index.vue @@ -60,6 +60,12 @@ /> + 重置 查询 - 重置 + + + 重置 + 查询 - - 重置 - + diff --git a/src/views/EquipmentEntryApply/EquipmentMainList.vue b/src/views/EquipmentEntryApply/EquipmentMainList.vue index 1977ace7..b0b11cbc 100644 --- a/src/views/EquipmentEntryApply/EquipmentMainList.vue +++ b/src/views/EquipmentEntryApply/EquipmentMainList.vue @@ -25,12 +25,13 @@ - - 查询 - 重置 + + 查询 + + diff --git a/src/views/EquipmentEntryApply/equipmentInput/index1.vue b/src/views/EquipmentEntryApply/equipmentInput/index1.vue index c374701b..3939f8d2 100644 --- a/src/views/EquipmentEntryApply/equipmentInput/index1.vue +++ b/src/views/EquipmentEntryApply/equipmentInput/index1.vue @@ -28,8 +28,8 @@ - 查询 重置 + 查询 新增装备 diff --git a/src/views/EquipmentEntryApproval/EquipmentDetailList.vue b/src/views/EquipmentEntryApproval/EquipmentDetailList.vue index 546bd3d8..6450a809 100644 --- a/src/views/EquipmentEntryApproval/EquipmentDetailList.vue +++ b/src/views/EquipmentEntryApproval/EquipmentDetailList.vue @@ -134,14 +134,15 @@ + + 重置 + 查询 - - 重置 - + diff --git a/src/views/EquipmentEntryApproval/EquipmentMainList.vue b/src/views/EquipmentEntryApproval/EquipmentMainList.vue index d9b3b391..d675924d 100644 --- a/src/views/EquipmentEntryApproval/EquipmentMainList.vue +++ b/src/views/EquipmentEntryApproval/EquipmentMainList.vue @@ -37,10 +37,11 @@ + + 重置 查询 - - 重置 + diff --git a/src/views/EquipmentEntryApproval/equipmentInput/index.vue b/src/views/EquipmentEntryApproval/equipmentInput/index.vue index 31fc3f17..38a16970 100644 --- a/src/views/EquipmentEntryApproval/equipmentInput/index.vue +++ b/src/views/EquipmentEntryApproval/equipmentInput/index.vue @@ -133,12 +133,13 @@ - - 查询 - 重置 + + 查询 + + - 查询 重置 + 查询 确定添加 diff --git a/src/views/EquipmentRetireApply/todo.vue b/src/views/EquipmentRetireApply/todo.vue index d5cdc845..75d7f88c 100644 --- a/src/views/EquipmentRetireApply/todo.vue +++ b/src/views/EquipmentRetireApply/todo.vue @@ -18,10 +18,10 @@ + 重置 查询 - 重置 diff --git a/src/views/EquipmentRoamRecord/index.vue b/src/views/EquipmentRoamRecord/index.vue index df95fbd1..d20ab0e4 100644 --- a/src/views/EquipmentRoamRecord/index.vue +++ b/src/views/EquipmentRoamRecord/index.vue @@ -39,8 +39,8 @@ /> - 查询 重置 + 查询 diff --git a/src/views/EquipmentServicing/index.vue b/src/views/EquipmentServicing/index.vue index 566ca7bb..5188e865 100644 --- a/src/views/EquipmentServicing/index.vue +++ b/src/views/EquipmentServicing/index.vue @@ -312,10 +312,10 @@ + 重置 查询 - 重置 diff --git a/src/views/EquipmentUpOrDown/equipment/index.vue b/src/views/EquipmentUpOrDown/equipment/index.vue index ba965d30..f6e451e8 100644 --- a/src/views/EquipmentUpOrDown/equipment/index.vue +++ b/src/views/EquipmentUpOrDown/equipment/index.vue @@ -225,8 +225,8 @@ - 查询 重置 + 查询 diff --git a/src/views/EquipmentUpOrDown/tool/index.vue b/src/views/EquipmentUpOrDown/tool/index.vue index 309dfc67..7d659516 100644 --- a/src/views/EquipmentUpOrDown/tool/index.vue +++ b/src/views/EquipmentUpOrDown/tool/index.vue @@ -219,9 +219,8 @@ /> - 查询 重置 - + 查询 - 查询 重置 + 查询 --> - 查询 重置 + 查询 diff --git a/src/views/feedback/index.vue b/src/views/feedback/index.vue index 7c631fab..ead6b4d9 100644 --- a/src/views/feedback/index.vue +++ b/src/views/feedback/index.vue @@ -221,8 +221,8 @@ - 查询 重置 + 查询 diff --git a/src/views/home/components/MunicipalChart/EquipStatusMore.vue b/src/views/home/components/MunicipalChart/EquipStatusMore.vue index 96db5635..86a35f8a 100644 --- a/src/views/home/components/MunicipalChart/EquipStatusMore.vue +++ b/src/views/home/components/MunicipalChart/EquipStatusMore.vue @@ -23,8 +23,8 @@ - 查询 重置 + 查询 @@ -70,7 +70,7 @@ - - diff --git a/src/views/index.vue b/src/views/index.vue index ca3dcf67..7a6c954b 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -2655,83 +2655,79 @@ export default { // 对于有多个出线的节点,默认高亮第一条线 if (nodeId === 'equipmentLedger') { // 装备台账 - this.$router.push({ path: '/equipment/equipment-ledger' }) - } else if (nodeId === 'equipmentShelf') { - this.$router.push({ path: '/equipment/equipment-ledger' }) + this.$router.push({ path: '/equipment/manage/equipment-ledger' }) } else if (nodeId === 'equipmentRepair') { // 维修申请 - this.$router.push({ path: '/equipmentRepair/repairList' }) + this.$router.push({ path: '/all/equipmentRepair/repairList' }) } else if (nodeId === 'equipmentEntry') { // 装备录入 this.$router.push({ path: '/equipment/equipment-entry-apply' }) } else if (nodeId === 'entryAudit') { // 装备录入审核 this.$router.push({ path: '/equipment/equipment-entry-approval' }) - } else if (nodeId === 'equipmentOffShelf') { - this.$router.push({ path: '/equipment/equipment-ledger' }) } else if (nodeId === 'selfUseOut') { this.$router.push({ path: '/equipment/euq-out' }) } else if (nodeId === 'retire-apply') { // 退役申请 - this.$router.push({ path: '/business/EquipmentRetireApply/equipment/retire-apply' }) + this.$router.push({ path: '/all/business/EquipmentRetireApply/equipment/retire-apply' }) } else if (nodeId === 'equipmentReturn' || nodeId === 'shareReturn') { this.$router.push({ path: '/equipment/equ-repair' }) } else if (nodeId === 'rentalHall') { // 共享大厅 - this.$router.push({ path: '/equipmentShared/MallIframe' }) + this.$router.push({ path: '/equipmentShared/app/MallIframe' }) } else if (nodeId === 'shareOut') { // 共享出库 - this.$router.push({ path: '/equipmentShared/order/equipment-shared-lessor' }) + this.$router.push({ path: '/equipmentShared/app/order/equipment-shared-lessor' }) } else if (nodeId === 'equStore') { this.$router.push({ path: '/equipment/equStore' }) } else if (nodeId === 'sharedLessor') { // 共享订单 - this.$router.push({ path: '/equipmentShared/order/equipment-shared-order' }) + this.$router.push({ path: '/equipmentShared/app/order/equipment-shared-order' }) } else if (nodeId === 'warehouse') { // 退库申请 - this.$router.push({ path: '/business/warehouse/index' }) + this.$router.push({ path: '/all/business/warehouse/index' }) } else if (nodeId === 'outbound') { // 自用出库 - this.$router.push({ path: '/business/outbound/index' }) + this.$router.push({ path: '/all/business/outbound/index' }) } else if (nodeId === 'toolsLedger') { // 工具台账 - this.$router.push({ path: '/equipment/toolsLedger' }) + this.$router.push({ path: '/equipment/manage/tools/toolsLedger' }) } else if (nodeId === 'equipmen') { // 装备上架 - this.$router.push({ path: '/equipmentShared/euqipmentUpOrDown/equipmen' }) + this.$router.push({ path: '/equipmentShared/shareManage/euqipmentUpOrDown/equipmen' }) } else if (nodeId === 'tool') { // 工具上架 - this.$router.push({ path: '/equipmentShared/euqipmentUpOrDown/tool' }) + this.$router.push({ path: '/equipmentShared/shareManage/euqipmentUpOrDown/tool' }) } else if (nodeId === 'auditList') { // 自用审核 - this.$router.push({ path: '/business/outbound/auditList' }) + this.$router.push({ path: '/all/business/outbound/auditList' }) } else if (nodeId === 'applyList') { // 自用申请 - this.$router.push({ path: '/business/outbound/applyList' }) + this.$router.push({ path: '/all/business/outbound/addApply' }) } else if (nodeId === 'approveList') { // 工具录入审核 this.$router.push({ path: '/toolsManage/approveList' }) } else if (nodeId === 'EquipmentRetireApply') { // 退役审核 - this.$router.push({ path: '/business/EquipmentRetireApply/EquipmentRetireApply' }) + this.$router.push({ path: '/all/business/EquipmentRetireApply/EquipmentRetireApply' }) } else if (nodeId === 'repairAuditList') { // 维修审核 - this.$router.push({ path: '/equipmentRepair/repairAuditList' }) + this.$router.push({ path: '/all/equipmentRepair/repairAuditList' }) } else if (nodeId === 'warehouse-auditList') { // 退库审核 - this.$router.push({ path: '/business/warehouse/auditList' }) + this.$router.push({ path: '/all/business/warehouse/auditList' }) } else if (nodeId === 'applicantList') { // 工具录入申请 this.$router.push({ path: '/toolsManage/applicantList' }) } else if (nodeId === 'codeToolsLedger') { // 编码工具台账 - this.$router.push({ path: '/equipment/codeToolsLedger'}) + this.$router.push({ path: '/equipment/manage/tools/codeToolsLedger'}) } else if (nodeId === 'inventoryAudit') { // 入库审核 - this.$router.push({ path: '/stockManagement/inventoryAudit' }) + this.$router.push({ path: '/all/stockManagement/inventoryAudit' }) } else if (nodeId == 'entryApply') { // 入库申请 - this.$router.push({ path: '/stockManagement/entryApply'}) + this.$router.push({ path: '/all/stockManagement/entryApply'}) } }, }, diff --git a/src/views/screen/wsScreen/components/center/index-ah.vue b/src/views/screen/wsScreen/components/center/index-ah.vue index fead39f7..c06e3888 100644 --- a/src/views/screen/wsScreen/components/center/index-ah.vue +++ b/src/views/screen/wsScreen/components/center/index-ah.vue @@ -416,7 +416,7 @@ export default { console.log('🚀 ~ initChart ~ params.data-->>:', params.data) if (!params.data) return this.$router.push({ - path: '/equipment/equipment-ledger', + path: '/equipment/manage/equipment-ledger', query: { parentId: params.data.parentId, deptId: params.data.deptId, diff --git a/src/views/screen/wsScreen/components/center/index.vue b/src/views/screen/wsScreen/components/center/index.vue index 5b8fbc88..1a76e61c 100644 --- a/src/views/screen/wsScreen/components/center/index.vue +++ b/src/views/screen/wsScreen/components/center/index.vue @@ -423,7 +423,7 @@ export default { console.log('🚀 ~ initChart ~ params.data-->>:', params.data) if (!params.data) return this.$router.push({ - path: '/equipment/equipment-ledger', + path: '/equipment/manage/equipment-ledger', query: { parentId: params.data.parentId, deptId: params.data.deptId, diff --git a/src/views/screen/wsScreenWidescreen/components/center/index-ah.vue b/src/views/screen/wsScreenWidescreen/components/center/index-ah.vue index 8e62fd61..1c524d7a 100644 --- a/src/views/screen/wsScreenWidescreen/components/center/index-ah.vue +++ b/src/views/screen/wsScreenWidescreen/components/center/index-ah.vue @@ -416,7 +416,7 @@ export default { console.log('🚀 ~ initChart ~ params.data-->>:', params.data) if (!params.data) return this.$router.push({ - path: '/equipment/equipment-ledger', + path: '/equipment/manage/equipment-ledger', query: { parentId: params.data.parentId, deptId: params.data.deptId, diff --git a/src/views/screen/wsScreenWidescreen/components/center/index.vue b/src/views/screen/wsScreenWidescreen/components/center/index.vue index 3cadbd0e..6d8932d0 100644 --- a/src/views/screen/wsScreenWidescreen/components/center/index.vue +++ b/src/views/screen/wsScreenWidescreen/components/center/index.vue @@ -423,7 +423,7 @@ export default { console.log('🚀 ~ initChart ~ params.data-->>:', params.data) if (!params.data) return this.$router.push({ - path: '/equipment/equipment-ledger', + path: '/equipment/manage/equipment-ledger', query: { parentId: params.data.parentId, deptId: params.data.deptId, diff --git a/src/views/stockManagement/entryApply/apply.vue b/src/views/stockManagement/entryApply/apply.vue index 7e9e38fd..c6772a34 100644 --- a/src/views/stockManagement/entryApply/apply.vue +++ b/src/views/stockManagement/entryApply/apply.vue @@ -48,7 +48,7 @@ export default { }, methods: { goBack() { - this.$router.push({ path: '/stockManagement/entryApply' }).then(() => { + this.$router.push({ path: '/all/stockManagement/entryApply' }).then(() => { this.$tab.closePage({ path: '/stockManagement/entryApply/apply' }) }) }, diff --git a/src/views/stockManagement/entryApply/components/EquipmentAdd.vue b/src/views/stockManagement/entryApply/components/EquipmentAdd.vue index da4b3e7d..8373e88d 100644 --- a/src/views/stockManagement/entryApply/components/EquipmentAdd.vue +++ b/src/views/stockManagement/entryApply/components/EquipmentAdd.vue @@ -93,21 +93,21 @@ - 导入 + 导入 下载导入模板 - 导入 + 导入 @@ -836,7 +836,7 @@ export default { { key: 42, label: `特征项9`, prop: 'featureItem9', visible: true }, { key: 43, label: `特征值9`, prop: 'featureValue9', visible: true } ], - fieldVoList:[], + fieldVoList:[], dialogVisible: false, dialogTitle: '', dialogList: [], @@ -1051,7 +1051,7 @@ export default { // 返回上一页 goBack() { // this.$router.go(-1) - this.$router.push({ path: '/stockManagement/entryApply' }) + this.$router.push({ path: '/all/stockManagement/entryApply' }) }, async approval(row, status) { equipmentPassAndRejectApiNew({ devIds: row.maId, status: status, id: this.orderId }).then((res) => { diff --git a/src/views/stockManagement/entryApply/index.vue b/src/views/stockManagement/entryApply/index.vue index 414b81b6..c6961b49 100644 --- a/src/views/stockManagement/entryApply/index.vue +++ b/src/views/stockManagement/entryApply/index.vue @@ -223,7 +223,7 @@ export default { query: { isAddVisible: false, isApprovalVisible: false } }) .then(() => { - this.$tab.closePage({ path: '/stockManagement/entryApply' }) + this.$tab.closePage({ path: '/all/stockManagement/entryApply' }) }) }, // 编辑 @@ -241,7 +241,7 @@ export default { } }) .then(() => { - this.$tab.closePage({ path: '/stockManagement/entryApply' }) + this.$tab.closePage({ path: '/all/stockManagement/entryApply' }) }) }, // 删除 diff --git a/src/views/stockManagement/inventoryAudit/index.vue b/src/views/stockManagement/inventoryAudit/index.vue index d6b13e64..a1a7c345 100644 --- a/src/views/stockManagement/inventoryAudit/index.vue +++ b/src/views/stockManagement/inventoryAudit/index.vue @@ -217,7 +217,7 @@ export default { }, }) .then(() => { - this.$tab.closePage({ path: '/stockManagement/entryApply' }) + this.$tab.closePage({ path: '/all/stockManagement/entryApply' }) }) }, // 提交 diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 7eb1a9f9..92639577 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -33,7 +33,7 @@ 菜单管理列表 - 共{{total}}条记录 +
From 3e78f2c7380c430e13ef10d3480817c7eceb654a Mon Sep 17 00:00:00 2001 From: jiang Date: Mon, 26 Jan 2026 19:49:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A3=85=E5=A4=87=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=8E=87=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/equipmentNew.js | 59 ++ src/views/rent-facility/index.vue | 510 ++++++++++------ src/views/system/equipment/index.vue | 839 ++++++++++++++++++++++++--- 3 files changed, 1143 insertions(+), 265 deletions(-) diff --git a/src/api/system/equipmentNew.js b/src/api/system/equipmentNew.js index c5f83d58..b4ed4c40 100644 --- a/src/api/system/equipmentNew.js +++ b/src/api/system/equipmentNew.js @@ -10,6 +10,30 @@ export function listUser(query) { }) } +export function getOwnEquipmentList(query) { + return request({ + url: '/material-mall/deptConfig/getOwnEquipmentList', + method: 'get', + params: query + }) +} + +export function getSharingEquipmentList(query) { + return request({ + url: '/material-mall/deptConfig/getSharingEquipmentList', + method: 'get', + params: query + }) +} + +export function getRentalEquipmentList(query) { + return request({ + url: '/material-mall/deptConfig/getRentalEquipmentList', + method: 'get', + params: query + }) +} + export function selectResourceList(query) { return request({ url: '/material-mall/deptConfig/selectResourceList', @@ -26,6 +50,41 @@ export function selectInventoryList(query) { }) } +export function saveInstanceSelection(data) { + return request({ + url: '/material-mall/deptConfig/saveInstanceSelection', + method: 'post', + data: data + }) +} + +export function getConfigurationTotal() { + return request({ + url: '/material-mall/deptConfig/getConfigurationTotal', + method: 'post' + }) +} + +export function getConfigurationDetails(data) { + return request({ + url: '/material-mall/deptConfig/getConfigurationDetails', + method: 'post', + data: data + }) +} + + +export function exportStatsData() { + return request({ + url: '/material-mall/deptConfig/exportStatsData', + method: 'get', + }) +} + + + + + export function insertResource(data) { return request({ url: '/material-mall/deptConfig/insertResource', diff --git a/src/views/rent-facility/index.vue b/src/views/rent-facility/index.vue index 6e5ef3d0..a6efca45 100644 --- a/src/views/rent-facility/index.vue +++ b/src/views/rent-facility/index.vue @@ -1,227 +1,389 @@ - + + + - diff --git a/src/views/system/equipment/index.vue b/src/views/system/equipment/index.vue index bb56b8c7..b7181e6d 100644 --- a/src/views/system/equipment/index.vue +++ b/src/views/system/equipment/index.vue @@ -362,6 +362,317 @@
+ + + +
+ +
+ + + + + + + + + + + + + + + 查询 + 重置 + + +
+ + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ + + + + + + + + + + + + + 查询 + 重置 + + +
+ + + + + + + + + + + + +
+ + +
+ + + +
+ +
+ + + + + + + + + + + + + + 查询 + 重置 + + +
+ + + + + + + + + + + + +
+ + +
@@ -371,8 +682,21 @@ import EquipmentTable from './table.vue' import CorrelationTable from './correlationTable.vue' // 接口统一引入 import { - listUser, addUser, getUser, delUser, updateEquipmentConfig, - deptTreeSelect, selectResourceList, insertResource, deleteResource, getCategoryList, selectInventoryList + listUser, + addUser, + getUser, + delUser, + updateEquipmentConfig, + deptTreeSelect, + selectResourceList, + insertResource, + deleteResource, + getCategoryList, + selectInventoryList, + getOwnEquipmentList, + getSharingEquipmentList, + getRentalEquipmentList, + saveInstanceSelection } from '@/api/system/equipmentNew' export default { @@ -381,26 +705,34 @@ export default { dicts: ['voltage_type', 'ma_machine_status'], data() { return { - // 主标签页配置:统一管理,便于扩展 + // 原有数据保持不变 mainTabList: [ { name: '0', key: 'line', label: '线路工程' }, { name: '1', key: 'power', label: '变电工程' }, { name: '2', key: 'cable', label: '电缆工程' } ], lineTypeOptions: [ - { label: '35kV', value: '35kV' }, // value可根据后端需求改为编码(如'35kV') + { label: '35kV', value: '35kV' }, { label: '110kV', value: '110kV' }, { label: '220kV', value: '220kV' }, { label: '500kV', value: '500kV' }, { label: '特高压', value: '特高压' } ], - jijuTypeOptions: [{ label: '通用装备', value: '通用装备' }, // value可根据后端需求改为编码(如'35kV') + jijuTypeOptions: [ + { label: '通用装备', value: '通用装备' }, { label: '专用设备', value: '专用设备' }, { label: '新型装备', value: '新型装备' } ], - activeTab: '0', // 激活的主标签页 + activeTab: '0', - // 所有表格列配置:聚合管理,按业务分类 + // 新增:装备类型选项(用于筛选) + equipmentTypeOptions: [ + { label: '通用装备', value: '通用装备' }, + { label: '专用设备', value: '专用设备' }, + { label: '新型装备', value: '新型装备' } + ], + + // 所有表格列配置:新增实例详情列配置 tableColumns: { main: [ { label: '项目名称', prop: 'typeName', minWidth: 120 }, @@ -423,7 +755,7 @@ export default { classification: [ { label: '名称', prop: 'name', minWidth: 400 }, { - label: '类型', prop: 'category', minWidth: 80,// 混合场景:先判断值,再返回文字 + label: '类型', prop: 'category', minWidth: 80, dictMap: { 0: '装备', 1: '工具' } }, { label: '数量', prop: 'quantity', minWidth: 80 }, @@ -442,15 +774,51 @@ export default { inventory: [ { label: '实列类型', prop: 'type', minWidth: 120, - dictMap: { 0: '自用', 1: '共享', 2: '外租' } + dictMap: { 0: '自有', 1: '共享', 2: '外租' } }, { label: '名称', prop: 'name', minWidth: 120 }, { label: '类型', prop: 'category', minWidth: 80, dictMap: { 0: '装备', 1: '工具' } }, + { label: '数量', prop: 'num', minWidth: 80 } + ], + // 新增:实例详情表格列(用于弹窗内的表格) + instanceDetail: [ + { label: '分类', prop: 'type', minWidth: 300 }, + { + label: '类型', prop: 'category', minWidth: 100, + dictMap: { 0: '装备', 1: '工具' } + }, + { label: '设备编码', prop: 'deviceCode', minWidth: 120 }, + { label: '装备名称', prop: 'name', minWidth: 150 }, + { label: '规格型号', prop: 'specificationModel', minWidth: 120 }, + { label: '原始编码', prop: 'originalEncoding', minWidth: 120 }, + { label: '数量', prop: 'num', minWidth: 80 } + ], + rentalDetail: [ + { label: '分类', prop: 'type', minWidth: 300 }, + { label: '装备名称', prop: 'name', minWidth: 150 }, + { label: '所属项目', prop: 'proName', minWidth: 150 }, + { label: '出租公司', prop: 'rentalCompany', minWidth: 150 }, + { label: '租赁时间', prop: 'startTime', minWidth: 120 }, + { label: '归还时间', prop: 'endTime', minWidth: 120 }, + { label: '数量', prop: 'num', minWidth: 80 } + ], + sharingDetail: [ + { label: '订单编号', prop: 'orderNumber', minWidth: 150 }, + { + label: '分类', prop: 'category', minWidth: 100, + dictMap: { 0: '装备', 1: '工具' } + }, + { label: '装备名称', prop: 'name', minWidth: 150 }, + { label: '规格型号', prop: 'specificationModel', minWidth: 120 }, + { label: '开始时间', prop: 'startTime', minWidth: 120 }, + { label: '结束时间', prop: 'endTime', minWidth: 120 }, + { label: '数量', prop: 'num', minWidth: 80 } ] + }, // 左侧部门树配置 @@ -462,7 +830,7 @@ export default { currentDeptId: null, configId: null, - // 所有表格状态:聚合管理 + // 所有表格状态:新增自有/共享/外租表格数据 tableData: { line: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, power: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, @@ -470,15 +838,24 @@ export default { fuzzy: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, classification: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, instance: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, - inventory: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 } + inventory: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, + // 新增 + own: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, + sharing: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 }, + rental: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 } }, - // 弹窗状态:主弹窗+三个独立关联弹窗(完全独立) + // 弹窗状态:新增三个实例弹窗状态 dialogOpen: false, correlationOpen: false, - fuzzyOpen: false, // 模糊弹窗显隐 - classificationOpen: false,// 分类弹窗显隐 - instanceOpen: false, // 实例弹窗显隐 + fuzzyOpen: false, + classificationOpen: false, + instanceOpen: false, + // 新增 + ownOpen: false, // 自有装备弹窗 + sharingOpen: false, // 共享装备弹窗 + rentalOpen: false, // 外租装备弹窗 + dialogTitle: '', correlationTitle: '', fuzzyTitle: '新增模糊匹配', @@ -487,9 +864,8 @@ export default { isEdit: false, submitLoading: false, - // 表单数据:主表单+三个独立关联表单(字段按需配置,完全独立) + // 表单数据 formData: { - // 主表单 mainForm: { id: null, typeName: '', @@ -505,32 +881,52 @@ export default { deptId: '', configType: '' }, - // 1. 模糊匹配表单(仅matchingName) fuzzyForm: { matchingName: '', - matchingType: '0', // 固定0:模糊匹配 + matchingType: '0', configId: '' }, - // 2. 分类匹配表单(matchingName+category) classificationForm: { matchingName: '', name: '', category: '', - matchingType: '1', // 固定1:分类匹配 + matchingType: '1', configId: '' }, - // 3. 实例匹配表单(matchingName+category) instanceForm: { matchingName: '', category: '', - matchingType: '2', // 固定2:实例匹配 + matchingType: '2', configId: '' } }, - // 校验规则:主规则+三个独立关联规则(按需配置,完全独立) + // 新增:筛选表单数据 + searchForm: { + own: { + equipmentName: '', + equipmentType: '', + specModel: '' + }, + sharing: { + equipmentName: '', + equipmentType: '', + deptName: '' + }, + rental: { + equipmentName: '', + equipmentType: '', + companyName: '' + } + }, + + // 新增:选中的行数据 + selectedOwnRows: [], + selectedSharingRows: [], + selectedRentalRows: [], + + // 校验规则 formRules: { - // 主表单规则 mainRules: { typeName: [ { required: true, message: '请输入项目名称', trigger: 'blur' }, @@ -551,20 +947,17 @@ export default { configRate: [{ validator: this.validateConfigRate, trigger: 'change' }], isNew: [{ required: true, message: '请选择是否新型装备', trigger: 'change' }] }, - // 1. 模糊匹配规则(仅校验matchingName) fuzzyRules: { matchingName: [ { required: true, message: '请输入匹配名称', trigger: 'blur' }, { max: 100, message: '匹配名称长度不能超过100个字符', trigger: 'blur' } ] }, - // 2. 分类匹配规则(校验matchingName+category) classificationRules: { matchingName: [ { required: true, message: '请选择分类', trigger: 'change' } ] }, - // 3. 实例匹配规则(与分类一致,校验matchingName+category) instanceRules: { matchingName: [ { required: true, message: '请输入匹配名称', trigger: 'blur' }, @@ -602,10 +995,9 @@ export default { formRef() { return this.$refs.formRef } - // 移除所有关联表单的computed引用,直接在方法中通过$refs获取,避免缓存问题 }, methods: { - // 通用配置率校验 + // 原有方法保持不变 validateConfigRate(rule, value, callback) { if (this.formData.mainForm.configRateType === 'custom') { if (value === undefined || value === null) { @@ -624,12 +1016,10 @@ export default { if (res.code === 200) { this.categoryList = res.data.map(item => ({ ...item, - uniqueKey: `${item.typeId}-${item.type}` // 生成唯一key + uniqueKey: `${item.typeId}-${item.type}` })) } }, - - // 左侧部门树相关方法 async getDeptTree() { try { this.treeLoading = true @@ -655,8 +1045,6 @@ export default { if (!value) return true return data.deptName?.toLowerCase().includes(value.toLowerCase()) }, - - // 主标签页核心方法 handleTabClick(tab) { this.activeTab = tab.name const tabConfig = this.tableData[tab.key] @@ -699,8 +1087,6 @@ export default { const tab = this.mainTabList.find(item => item.key === tabKey) this.loadMainTabData(tab.name) }, - - // 关联弹窗核心方法 async handleTableRelate(row) { if (!row?.id) return this.configId = row.id @@ -753,10 +1139,7 @@ export default { this.tableData[key].pageNum = 1 }) this.loadMainTabData(this.activeTab) - }, - - // 主表格操作方法 handleTableAdd() { if (!this.currentDeptId) { this.$message.warning('请先在左侧选择所属公司') @@ -809,16 +1192,12 @@ export default { } }) }, - - // 关联表格删除方法(精准刷新对应表格) handleCorrelationDelete(row) { if (!row?.id) return this.$confirm('确定删除此条关联数据吗?', '温馨提示', { type: 'warning' }).then(async() => { try { - // 待实现:关联数据删除接口 await deleteResource(row.id) this.$message.success('删除成功') - // 根据matchingType精准刷新对应表格 let tabKey = '' if (row.matchingType === '0') { tabKey = 'fuzzy' @@ -832,7 +1211,6 @@ export default { } }) }, - async handleFormSubmit() { try { await this.formRef.validate() @@ -860,8 +1238,6 @@ export default { this.formRef?.clearValidate() this.submitLoading = false }, - - // ====================== 模糊匹配独立弹窗方法(修复后) ====================== handleFuzzyTableAdd() { this.initForm('fuzzy') this.fuzzyOpen = true @@ -936,8 +1312,6 @@ export default { this.$refs.fuzzyFormRef?.clearValidate() this.initForm('fuzzy') }, - - // ====================== 分类匹配独立弹窗方法(与模糊逻辑一致) ====================== handleClassificationTableAdd() { this.initForm('classification') this.classificationOpen = true @@ -946,34 +1320,29 @@ export default { this.$refs.classificationFormRef?.clearValidate() }) }, - // 分类选择-变化事件:获取选中项完整数据(搜索后依然生效) handleCategoryChange(selectedTypeId) { - // 判空:清空选择/搜索无结果时,重置自定义字段 if (!selectedTypeId) { this.formData.classificationForm.selectedCategory = null - this.formData.classificationForm.category = '' // 清空分类名称存储 + this.formData.classificationForm.category = '' return } - // 反向查找选中项的完整对象,获取所有自定义字段 const selectedItem = this.categoryList.find( item => item.typeId === selectedTypeId ) if (selectedItem) { - // 存储完整对象和分类名称,方便后续提交/展示 this.formData.classificationForm.matchingName = selectedItem.typeId this.formData.classificationForm.category = selectedItem.type this.formData.classificationForm.name = selectedItem.equipmentName } }, handleJijuTypeChange(selectedTypeId) { - // 判空:清空选择/搜索无结果时,重置自定义字段 if (!selectedTypeId) { this.formData.mainForm.jijuType = null - this.formData.mainForm.isNew = '0' // 清空分类名称存储 + this.formData.mainForm.isNew = '0' } else { if (selectedTypeId == '新型装备') { this.formData.mainForm.jijuType = selectedTypeId - this.formData.mainForm.isNew = '1' // 清空分类名称存储 + this.formData.mainForm.isNew = '1' } } }, @@ -1005,8 +1374,6 @@ export default { this.$refs.classificationFormRef?.clearValidate() this.initForm('classification') }, - - // ====================== 实例匹配独立弹窗方法(与分类逻辑一致) ====================== handleInstanceTableAdd() { this.initForm('instance') this.instanceOpen = true @@ -1014,48 +1381,318 @@ export default { this.$refs.instanceFormRef?.clearValidate() }) }, - handleInstanceTableOwn() { - this.initForm('instance') - this.instanceOpen = true - this.$nextTick(() => { - this.$refs.instanceFormRef?.clearValidate() - }) + + // ====================== 新增:实例匹配弹窗相关方法 ====================== + // 1. 自有装备弹窗方法 + async handleInstanceTableOwn() { + // 重置筛选条件和选中状态 + this.searchForm.own = { + equipmentName: '', + equipmentType: '', + specModel: '' + } + this.selectedOwnRows = [] + // 初始化分页 + this.tableData.own.pageNum = 1 + // 加载数据并打开弹窗 + await this.loadOwnEquipmentData() + this.ownOpen = true }, - handleInstanceSharingAdd() { - this.initForm('instance') - this.instanceOpen = true - this.$nextTick(() => { - this.$refs.instanceFormRef?.clearValidate() - }) + async loadOwnEquipmentData() { + const tabConfig = this.tableData.own + tabConfig.loading = true + try { + const queryParams = { + deptId: this.currentDeptId, + configId: this.configId, + ...this.searchForm.own, + pageNum: tabConfig.pageNum, + pageSize: tabConfig.pageSize + } + const res = await getOwnEquipmentList(queryParams) + tabConfig.list = res.rows || [] + tabConfig.total = res.total || 0 + } catch (err) { + console.error('加载自有装备数据失败:', err) + this.$message.error('加载自有装备数据失败,请稍后重试') + tabConfig.list = [] + tabConfig.total = 0 + } finally { + tabConfig.loading = false + } }, - handleInstanceRentalAdd() { - this.initForm('instance') - this.instanceOpen = true - this.$nextTick(() => { - this.$refs.instanceFormRef?.clearValidate() - }) + handleOwnSearch() { + this.tableData.own.pageNum = 1 + this.loadOwnEquipmentData() }, - async handleInstanceConfirm() { + resetOwnSearch() { + this.searchForm.own = { + equipmentName: '', + equipmentType: '', + specModel: '' + } + this.tableData.own.pageNum = 1 + this.loadOwnEquipmentData() + }, + handleOwnSizeChange(val) { + this.tableData.own.pageSize = val + this.loadOwnEquipmentData() + }, + handleOwnCurrentChange(val) { + this.tableData.own.pageNum = val + this.loadOwnEquipmentData() + }, + handleOwnSelectionChange(val) { + this.selectedOwnRows = val + }, + async handleOwnConfirm() { + try { + // 提交选中的自有装备数据 + const submitData = { + configId: this.configId, + matchingType: '2', + type: '0', // 0-自有 + equipmentList: this.selectedOwnRows.map(item => ({ + matchingName: item.id, + name: item.name, + category: item.category + })) + } + const res = await saveInstanceSelection(submitData) + if (res.code === 200) { + this.$message.success('自有装备选择成功') + this.ownOpen = false + // 刷新实例表格和清单表格 + await this.loadCorrelationData('instance') + await this.loadCorrelationData('inventory') + } else { + this.$message.error(res.message || '自有装备选择失败') + } + } catch (err) { + console.error('保存自有装备选择失败:', err) + this.$message.error('保存自有装备选择失败,请稍后重试') + } + }, + handleOwnClose() { + this.selectedOwnRows = [] + this.$refs.ownTableRef?.clearSelection() + }, + + // 2. 共享装备弹窗方法 + async handleInstanceSharingAdd() { + // 重置筛选条件和选中状态 + this.searchForm.sharing = { + equipmentName: '', + equipmentType: '', + deptName: '' + } + this.selectedSharingRows = [] + // 初始化分页 + this.tableData.sharing.pageNum = 1 + // 加载数据并打开弹窗 + await this.loadSharingEquipmentData() + this.sharingOpen = true + }, + async loadSharingEquipmentData() { + const tabConfig = this.tableData.sharing + tabConfig.loading = true + try { + const queryParams = { + deptId: this.currentDeptId, + configId: this.configId, + ...this.searchForm.sharing, + pageNum: tabConfig.pageNum, + pageSize: tabConfig.pageSize + } + const res = await getSharingEquipmentList(queryParams) + tabConfig.list = res.rows || [] + tabConfig.total = res.total || 0 + } catch (err) { + console.error('加载共享装备数据失败:', err) + this.$message.error('加载共享装备数据失败,请稍后重试') + tabConfig.list = [] + tabConfig.total = 0 + } finally { + tabConfig.loading = false + } + }, + handleSharingSearch() { + this.tableData.sharing.pageNum = 1 + this.loadSharingEquipmentData() + }, + resetSharingSearch() { + this.searchForm.sharing = { + equipmentName: '', + equipmentType: '', + deptName: '' + } + this.tableData.sharing.pageNum = 1 + this.loadSharingEquipmentData() + }, + handleSharingSizeChange(val) { + this.tableData.sharing.pageSize = val + this.loadSharingEquipmentData() + }, + handleSharingCurrentChange(val) { + this.tableData.sharing.pageNum = val + this.loadSharingEquipmentData() + }, + handleSharingSelectionChange(val) { + this.selectedSharingRows = val + }, + async handleSharingConfirm() { + try { + // 提交选中的共享装备数据 + const submitData = { + configId: this.configId, + matchingType: '2', + type: '1', // 共享 + equipmentList: this.selectedSharingRows.map(item => ({ + matchingName: item.id, + name: item.name, + category: item.category + })) + } + const res = await saveInstanceSelection(submitData) + if (res.code === 200) { + this.$message.success('共享装备选择成功') + this.sharingOpen = false + // 刷新实例表格和清单表格 + await this.loadCorrelationData('instance') + await this.loadCorrelationData('inventory') + } else { + this.$message.error(res.message || '共享装备选择失败') + } + } catch (err) { + console.error('保存共享装备选择失败:', err) + this.$message.error('保存共享装备选择失败,请稍后重试') + } + }, + handleSharingClose() { + this.selectedSharingRows = [] + this.$refs.sharingTableRef?.clearSelection() + }, + + // 3. 外租装备弹窗方法 + async handleInstanceRentalAdd() { + // 重置筛选条件和选中状态 + this.searchForm.rental = { + equipmentName: '', + equipmentType: '', + companyName: '' + } + this.selectedRentalRows = [] + // 初始化分页 + this.tableData.rental.pageNum = 1 + // 加载数据并打开弹窗 + await this.loadRentalEquipmentData() + this.rentalOpen = true + }, + async loadRentalEquipmentData() { + const tabConfig = this.tableData.rental + tabConfig.loading = true + try { + const queryParams = { + deptId: this.currentDeptId, + configId: this.configId, + ...this.searchForm.rental, + pageNum: tabConfig.pageNum, + pageSize: tabConfig.pageSize + } + const res = await getRentalEquipmentList(queryParams) + tabConfig.list = res.rows || [] + tabConfig.total = res.total || 0 + } catch (err) { + console.error('加载外租装备数据失败:', err) + this.$message.error('加载外租装备数据失败,请稍后重试') + tabConfig.list = [] + tabConfig.total = 0 + } finally { + tabConfig.loading = false + } + }, + handleRentalSearch() { + this.tableData.rental.pageNum = 1 + this.loadRentalEquipmentData() + }, + resetRentalSearch() { + this.searchForm.rental = { + equipmentName: '', + equipmentType: '', + companyName: '' + } + this.tableData.rental.pageNum = 1 + this.loadRentalEquipmentData() + }, + handleRentalSizeChange(val) { + this.tableData.rental.pageSize = val + this.loadRentalEquipmentData() + }, + handleRentalCurrentChange(val) { + this.tableData.rental.pageNum = val + this.loadRentalEquipmentData() + }, + handleRentalSelectionChange(val) { + this.selectedRentalRows = val + }, + async handleRentalConfirm() { + try { + // 提交选中的外租装备数据 + const submitData = { + configId: this.configId, + matchingType: '2', + type: '2', // 外租 + equipmentList: this.selectedRentalRows.map(item => ({ + matchingName: item.id, + name: item.name, + category: item.category + })) + } + const res = await saveInstanceSelection(submitData) + if (res.code === 200) { + this.$message.success('外租装备选择成功') + this.rentalOpen = false + // 刷新实例表格和清单表格 + await this.loadCorrelationData('instance') + await this.loadCorrelationData('inventory') + } else { + this.$message.error(res.message || '外租装备选择失败') + } + } catch (err) { + console.error('保存外租装备选择失败:', err) + this.$message.error('保存外租装备选择失败,请稍后重试') + } + }, + handleRentalClose() { + this.selectedRentalRows = [] + this.$refs.rentalTableRef?.clearSelection() + }, + + handleInstanceConfirm() { const instanceForm = this.$refs.instanceFormRef if (!instanceForm) { this.$message.warning('表单加载中,请稍候再试') return } try { - await instanceForm.validate() - this.submitLoading = true - const res = await insertResource(this.formData.instanceForm) - if (res.code === 200) { - this.$message.success('新增实例匹配成功') - this.instanceOpen = false - await this.loadCorrelationData('instance') - await this.loadCorrelationData('inventory') - } else { - this.$message.error(res.message || '新增实例匹配失败') - } + instanceForm.validate().then(async() => { + this.submitLoading = true + const res = await insertResource(this.formData.instanceForm) + if (res.code === 200) { + this.$message.success('新增实例匹配成功') + this.instanceOpen = false + await this.loadCorrelationData('instance') + await this.loadCorrelationData('inventory') + } else { + this.$message.error(res.message || '新增实例匹配失败') + } + }).catch(err => { + console.error('表单验证失败:', err) + }).finally(() => { + this.submitLoading = false + }) } catch (err) { console.error('新增实例匹配失败:', err) - } finally { this.submitLoading = false } }, @@ -1068,9 +1705,10 @@ export default {