结算审批页面,导出,直转审核导出

This commit is contained in:
hongchao 2025-11-05 18:02:22 +08:00
parent 2c18753063
commit 1cf9136589
3 changed files with 144 additions and 128 deletions

View File

@ -2,11 +2,11 @@
<div class="app-container"> <div class="app-container">
<el-row style="width: 100%"> <el-row style="width: 100%">
<el-col :span="18"> <el-col :span="18">
<el-button type="primary" size="mini" @click="handleExport1">租赁明细导出</el-button> <el-button type="primary" size="mini" @click="handleExport1" :disabled="leaseList && leaseList.length == 0 " >租赁明细导出</el-button>
<el-button type="primary" size="mini" @click="handleExport3">维修明细导出</el-button> <el-button type="primary" size="mini" @click="handleExport3" :disabled="repairList && repairList.length == 0 ">维修明细导出</el-button>
<el-button type="primary" size="mini" @click="handleExport4">报废明细导出</el-button> <el-button type="primary" size="mini" @click="handleExport4" :disabled="scrapList && scrapList.length == 0 ">报废明细导出</el-button>
<el-button type="primary" size="mini" @click="handleExport2">丢失明细导出</el-button> <el-button type="primary" size="mini" @click="handleExport2" :disabled="loseList && loseList.length == 0 ">丢失明细导出</el-button>
<el-button type="primary" size="mini" @click="handleExport5">减免明细导出</el-button> <el-button type="primary" size="mini" @click="handleExport5" :disabled="reducList && reducList.length == 0 ">减免明细导出</el-button>
<el-button type="warning" size="mini" @click="handleExportAll">全部明细导出</el-button> <el-button type="warning" size="mini" @click="handleExportAll">全部明细导出</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -27,32 +27,34 @@
{{ projectName }} {{ projectName }}
</div> </div>
</div> </div>
<el-table :data="leaseList"> <div class="tabelAllTopUnit">
<el-table-column label="租赁费用明细" align="center"> <div class="costTopUnit">出场日期</div>
<div class="costRightUnit">
{{ actualTimeAndName }}
</div>
</div>
<el-table :data="leaseList" max-height="500px">
<el-table-column label="租赁(超期)费用明细" align="center" >
<el-table-column label="序号" align="center" type="index" width="60" /> <el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
<el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true"> <el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope" v-show="scope.row.leasePrice">
{{ Number(scope.row.leasePrice || 0).toFixed(2) }} {{ scope.row.leasePrice.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true"> <el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true"/>
<template slot-scope="scope"> <el-table-column label="领料日期" align="center" prop="startTime" :show-overflow-tooltip="true" />
{{ Number(scope.row.num || 0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="租赁日期" align="center" prop="startTime" :show-overflow-tooltip="true" />
<el-table-column label="归还日期 " align="center" prop="endTime" :show-overflow-tooltip="true" /> <el-table-column label="归还日期 " align="center" prop="endTime" :show-overflow-tooltip="true" />
<el-table-column label="租赁天数" align="center" prop="leaseDays" :show-overflow-tooltip="true"> <el-table-column label="租赁天数" align="center" prop="leaseDays" :show-overflow-tooltip="true"/>
<template slot-scope="scope"> <el-table-column label="出场日期" align="center" prop="actualExitTime" :show-overflow-tooltip="true"/>
{{ Number(scope.row.leaseDays || 0).toFixed(2) }} <el-table-column label="超期日期" align="center" prop="overTime" :show-overflow-tooltip="true"/>
</template> <el-table-column label="超期天数" align="center" prop="overDay" :show-overflow-tooltip="true"/>
</el-table-column> <el-table-column label="超期费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
<el-table-column label="租赁费用(元)" align="center" prop="costs" :show-overflow-tooltip="true"> <template slot-scope="scope" v-show="scope.row.costs">
<template slot-scope="scope"> {{ scope.row.costs.toFixed(2) }}
{{ Number(scope.row.costs || 0).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -67,21 +69,18 @@
</div> </div>
<div> <div>
<el-table :data="repairList"> <el-table :data="repairList" max-height="500px">
<el-table-column label="维修费用明细" align="center"> <el-table-column label="维修费用明细" align="center" >
<el-table-column label="序号" align="center" type="index" width="60" /> <el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
<el-table-column label="维修数量" align="center" prop="num" :show-overflow-tooltip="true"> <el-table-column label="维修数量" align="center" prop="num" :show-overflow-tooltip="true"/>
<template slot-scope="scope">
{{ Number(scope.row.num || 0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true" /> <el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true" />
<el-table-column label="维修费用(元)" align="center" prop="costs" :show-overflow-tooltip="true"> <el-table-column label="维修费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope" v-show="scope.row.costs">
{{ Number(scope.row.costs || 0).toFixed(2) }} {{ scope.row.costs.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -95,21 +94,18 @@
</div> </div>
<div> <div>
<el-table :data="scrapList"> <el-table :data="scrapList" max-height="500px">
<el-table-column label="报废费用明细" align="center"> <el-table-column label="报废费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60" /> <el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
<el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true"> <el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true"/>
<template slot-scope="scope">
{{ Number(scope.row.num || 0).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true" /> <el-table-column label="是否收费" align="center" prop="partType" :show-overflow-tooltip="true" />
<el-table-column label="报废费用(元)" align="center" prop="costs" :show-overflow-tooltip="true"> <el-table-column label="报废费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope" v-show="scope.row.costs">
{{ Number(scope.row.costs || 0).toFixed(2) }} {{ scope.row.costs.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -123,20 +119,22 @@
</div> </div>
<div> <div>
<el-table :data="loseList"> <el-table :data="loseList" max-height="500px">
<el-table-column label="丢失费用明细" align="center"> <el-table-column label="未归还费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60" /> <el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
<el-table-column label="丢失数量" align="center" prop="num" :show-overflow-tooltip="true"> <el-table-column label="丢失数量" align="center" prop="num" :show-overflow-tooltip="true"/>
<template slot-scope="scope"> <el-table-column label="原值(元)" align="center" prop="buyPrice" :show-overflow-tooltip="true" >
{{ Number(scope.row.num || 0).toFixed(2) }} <template slot-scope="scope" v-show="scope.row.buyPrice">
{{ scope.row.buyPrice.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="丢失费用(元)" align="center" prop="costs" :show-overflow-tooltip="true"> <el-table-column label="未归还费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope" v-show="scope.row.costs">
{{ Number(scope.row.costs || 0).toFixed(2) }} {{ scope.row.costs.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -150,12 +148,13 @@
</div> </div>
<div> <div>
<el-table :data="reducList"> <el-table :data="reducList" max-height="500px">
<el-table-column label="减免费用明细" align="center"> <el-table-column label="减免费用明细" align="center">
<el-table-column label="序号" align="center" type="index" width="60" /> <el-table-column label="序号" align="center" type="index" width="60" />
<el-table-column label="单位名称" align="center" prop="unitName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" /> <el-table-column label="设备名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modeName" :show-overflow-tooltip="true" /> <el-table-column label="规格型号" align="center" prop="modeName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" /> <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
<el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true" /> <el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true" />
<el-table-column label="减免数量" align="center" prop="reduceNum" :show-overflow-tooltip="true" /> <el-table-column label="减免数量" align="center" prop="reduceNum" :show-overflow-tooltip="true" />
<el-table-column label="减免开始日期" align="center" prop="startTime" :show-overflow-tooltip="true" /> <el-table-column label="减免开始日期" align="center" prop="startTime" :show-overflow-tooltip="true" />
@ -163,8 +162,8 @@
<el-table-column label="减免天数" align="center" prop="days" :show-overflow-tooltip="true" /> <el-table-column label="减免天数" align="center" prop="days" :show-overflow-tooltip="true" />
<el-table-column label="减免原因" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column label="减免原因" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="减免费用(元)" align="center" prop="leaseMoney" :show-overflow-tooltip="true"> <el-table-column label="减免费用(元)" align="center" prop="leaseMoney" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope" v-show="scope.row.leaseMoney">
{{ Number(scope.row.leaseMoney || 0).toFixed(2) }} {{ scope.row.leaseMoney.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -216,7 +215,8 @@ export default {
deptName: undefined, deptName: undefined,
applyList: [], applyList: [],
projectName: undefined, // projectName: undefined, //
unitName: undefined // unitName: undefined, //
actualTimeAndName: '', //
} }
}, },
mounted() { mounted() {
@ -257,6 +257,7 @@ export default {
const projectNames = [] const projectNames = []
const unitNames = [] const unitNames = []
const actualTimeAndNames = [] //
// 便 // 便
dataArray.forEach(item => { dataArray.forEach(item => {
@ -286,13 +287,26 @@ export default {
const listWithUnit = item.reductionList.map(x => ({ ...x, unitName: x.unitName || currentUnitName })) const listWithUnit = item.reductionList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
this.reducList = [...this.reducList, ...listWithUnit] 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) const unique = arr => Array.from(new Set(arr)).filter(Boolean)
this.unitName = unique(unitNames).join('') this.unitName = unique(unitNames).join('')
this.projectName = unique(projectNames).join('') this.projectName = unique(projectNames).join('')
this.actualTimeAndName = unique(actualTimeAndNames).join(', ')
// //
const sumCosts = list => list.reduce((s, x) => s + (Number(x.costs) || 0), 0) const sumCosts = list => list.reduce((s, x) => s + (Number(x.costs) || 0), 0)
this.leaseCost = this.countCost(this.leaseList) this.leaseCost = this.countCost(this.leaseList)
@ -399,9 +413,9 @@ export default {
} }
const currentTime = formatTime(new Date()) 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) } 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() { handleExport2() {
@ -416,9 +430,9 @@ export default {
} }
const currentTime = formatTime(new Date()) 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) } 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() { handleExport3() {
@ -483,9 +497,9 @@ export default {
} }
const currentTime = formatTime(new Date()) 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) } 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`)
} }
} }
} }

View File

@ -84,7 +84,7 @@
> >
审批 审批
</el-button> </el-button>
<el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button> <!-- <el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -267,20 +267,22 @@ export default {
}, },
// //
handleExport() { handleExport() {
// const formatTime = (date) => {
this.$message({ const year = date.getFullYear();
type: 'warning', const month = String(date.getMonth() + 1).padStart(2, '0');
message: '导出功能开发中,敬请期待!' const day = String(date.getDate()).padStart(2, '0');
}) const hours = String(date.getHours()).padStart(2, '0');
try { const minutes = String(date.getMinutes()).padStart(2, '0');
let fileName = `导出_${formatTime(new Date())}.xLsx` const seconds = String(date.getSeconds()).padStart(2, '0');
let url = '/material/material_direct/export' return `${year}${month}${day}_${hours}${minutes}${seconds}`;
const params = { ...this.queryParams } };
console.log('🚀 ~ 导出 ~ params:', params)
this.download(url, params, fileName) const currentTime = formatTime(new Date());
} catch (error) { this.download(
console.log('导出数据失败', error) "/material/material_direct/export",
} { ...this.queryParams },
`导出_${currentTime}.xlsx`
);
} }
} }
} }