From 1cf91365893e54e881fee63cb879bc073e53b2e2 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Wed, 5 Nov 2025 18:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=AE=A1=E6=89=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=AF=BC=E5=87=BA=EF=BC=8C=E7=9B=B4=E8=BD=AC?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cost/component/examDetail.vue | 240 +++++++++--------- .../cost/component/examHome.vue | 2 +- .../straight/straightTransferReview/index.vue | 30 ++- 3 files changed, 144 insertions(+), 128 deletions(-) diff --git a/src/views/materialsStation/cost/component/examDetail.vue b/src/views/materialsStation/cost/component/examDetail.vue index 82e75f19..e3f62ae0 100644 --- a/src/views/materialsStation/cost/component/examDetail.vue +++ b/src/views/materialsStation/cost/component/examDetail.vue @@ -2,11 +2,11 @@
- 租赁明细导出 - 维修明细导出 - 报废明细导出 - 丢失明细导出 - 减免明细导出 + 租赁明细导出 + 维修明细导出 + 报废明细导出 + 丢失明细导出 + 减免明细导出 全部明细导出 @@ -21,41 +21,43 @@ {{ unitName }}
-
-
结算工程
-
- {{ projectName }} +
+
结算工程
+
+ {{ projectName }} +
-
- - - - - - - - +
+
出场日期
+
+ {{ actualTimeAndName }} +
+
+ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - -
@@ -67,24 +69,21 @@
- - - - - - - - + + + + + + + + + + + + - - - - -
费用小计:
@@ -95,24 +94,21 @@
- - - - - - - - + + + + + + + + + + + + - - - - -
费用小计:
@@ -123,23 +119,25 @@
- - - - - - - - + + + + + + + + + + + + + + - - - -
费用小计:
@@ -150,24 +148,25 @@
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + -
费用小计:
@@ -216,7 +215,8 @@ export default { deptName: undefined, applyList: [], projectName: undefined, //结算工程 - unitName: undefined //结算单位 + unitName: undefined, //结算单位 + actualTimeAndName: '', //实际时间和对应的班组名称 } }, mounted() { @@ -257,6 +257,7 @@ export default { const projectNames = [] const unitNames = [] + const actualTimeAndNames = [] // 用于存储实际时间和对应的班组名称 // 合并各项列表,同时为明细补充单位名称以便显示 dataArray.forEach(item => { @@ -286,13 +287,26 @@ export default { const listWithUnit = item.reductionList.map(x => ({ ...x, unitName: x.unitName || currentUnitName })) this.reducList = [...this.reducList, ...listWithUnit] } + if(item.unitName && item.actualExitTime){ + const timeAndName = `${item.unitName} ( ${item.actualExitTime} )`; + // 检查是否已存在该元素,不存在才添加 + if(!actualTimeAndNames.includes(timeAndName)) { + actualTimeAndNames.push(timeAndName); + } + }else if(item.unitName && !item.actualExitTime){ + const timeAndName = `${item.unitName} ( 暂无 )`; + // 检查是否已存在该元素,不存在才添加 + if(!actualTimeAndNames.includes(timeAndName)) { + actualTimeAndNames.push(timeAndName); + } + } }) // 单位/工程名展示:去重后拼接 const unique = arr => Array.from(new Set(arr)).filter(Boolean) this.unitName = unique(unitNames).join(',') this.projectName = unique(projectNames).join(',') - + this.actualTimeAndName = unique(actualTimeAndNames).join(', ') // 费用汇总 const sumCosts = list => list.reduce((s, x) => s + (Number(x.costs) || 0), 0) this.leaseCost = this.countCost(this.leaseList) @@ -399,9 +413,9 @@ export default { } const currentTime = formatTime(new Date()) - let data = _.cloneDeep(this.rowData) + let data = {unitId:this.rowData[0].unitId,projectId:this.rowData[0].projectId,sltApplyCode:this.rowData[0].sltApplyCode} const params = { params: JSON.stringify(data) } - this.download('material/slt_agreement_info/exportLease', { ...params }, `租赁费用明细_${currentTime}.xlsx`) + this.download('material/material_sltAgreementInfo/exportLeaseReview', { ...params }, `租赁费用明细_${currentTime}.xlsx`) }, //丢失 handleExport2() { @@ -416,9 +430,9 @@ export default { } const currentTime = formatTime(new Date()) - let data = _.cloneDeep(this.rowData) + let data = {unitId:this.rowData[0].unitId,projectId:this.rowData[0].projectId,sltApplyCode:this.rowData[0].sltApplyCode} const params = { params: JSON.stringify(data) } - this.download('material/slt_agreement_info/exportLose', { ...params }, `丢失费用明细_${currentTime}.xlsx`) + this.download('material/material_sltAgreementInfo/exportLoseReview', { ...params }, `丢失费用明细_${currentTime}.xlsx`) }, // 维修 handleExport3() { @@ -483,9 +497,9 @@ export default { } const currentTime = formatTime(new Date()) - let data = _.cloneDeep(this.rowData) + let data = {unitId:this.rowData[0].unitId,projectId:this.rowData[0].projectId,sltApplyCode:this.rowData[0].sltApplyCode} const params = { params: JSON.stringify(data) } - this.download('material/slt_agreement_info/exportAll', { ...params }, `全部费用明细_${currentTime}.xlsx`) + this.download('material/material_sltAgreementInfo/exportAllReview', { ...params }, `全部费用明细_${currentTime}.xlsx`) } } } diff --git a/src/views/materialsStation/cost/component/examHome.vue b/src/views/materialsStation/cost/component/examHome.vue index 6ceb9f3a..eeb64747 100644 --- a/src/views/materialsStation/cost/component/examHome.vue +++ b/src/views/materialsStation/cost/component/examHome.vue @@ -84,7 +84,7 @@ > 审批 - 协议书 + diff --git a/src/views/materialsStation/straight/straightTransferReview/index.vue b/src/views/materialsStation/straight/straightTransferReview/index.vue index 2d74ef64..211c0016 100644 --- a/src/views/materialsStation/straight/straightTransferReview/index.vue +++ b/src/views/materialsStation/straight/straightTransferReview/index.vue @@ -267,20 +267,22 @@ export default { }, // 导出数据 handleExport() { - // 提示 - this.$message({ - type: 'warning', - message: '导出功能开发中,敬请期待!' - }) - try { - let fileName = `导出_${formatTime(new Date())}.xLsx` - let url = '/material/material_direct/export' - const params = { ...this.queryParams } - console.log('🚀 ~ 导出 ~ params:', params) - this.download(url, params, fileName) - } catch (error) { - console.log('导出数据失败', error) - } + const formatTime = (date) => { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + return `${year}${month}${day}_${hours}${minutes}${seconds}`; + }; + + const currentTime = formatTime(new Date()); + this.download( + "/material/material_direct/export", + { ...this.queryParams }, + `导出_${currentTime}.xlsx` + ); } } }