资产月度报表

This commit is contained in:
hongchao 2025-11-19 14:53:17 +08:00
parent 1ef359d0b5
commit fa67295241
2 changed files with 26 additions and 85 deletions

View File

@ -337,5 +337,12 @@ export function getHistoryScrapCostDetails(query) {
})
}
// 查询资产占有月度报表列表
export function getAssestsReportList(query) {
return request({
url: '/material/bm_report/getAssetReportList',
method: 'get',
params: query
})
}

View File

@ -3,30 +3,11 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item prop="projectIds">
<treeselect
v-model="queryParams.projectId"
v-model="queryParams.proId"
:options="proList" :normalizer="normalizer"
:show-count="true" style="width: 240px" :disable-branch-nodes="true"
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
placeholder="请选择结算工程" @select="proChange"
/>
</el-form-item>
<el-form-item prop="startTime">
<el-date-picker
v-model="queryParams.startTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="开始日期"
style="width: 130px"
/>
</el-form-item>
<el-form-item>-</el-form-item>
<el-form-item prop="endTime">
<el-date-picker
v-model="queryParams.endTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="结束日期"
style="width: 130px"
placeholder="请选择工程"
/>
</el-form-item>
<el-form-item>
@ -44,11 +25,15 @@
}}</span>
</template>
</el-table-column>
<el-table-column label="工程名称" align="center" prop="agreementCode" :show-overflow-tooltip="true"/>
<el-table-column label="投入" align="center" prop="buyPrice" />
<el-table-column label="在用" align="center" prop="buyPrice" >
<el-table-column label="工程名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="投入费用(万元)" align="center" prop="inputCost" >
<template slot-scope="scope">
{{ scope.row.buyPrice ? scope.row.buyPrice.toFixed(2) : '0.00' }}
{{ scope.row.inputCost? scope.row.inputCost.toFixed(2) : '0.00' }}
</template>
</el-table-column>
<el-table-column label="在用费用(万元)" align="center" prop="useCost" >
<template slot-scope="scope">
{{ scope.row.useCost ? scope.row.useCost.toFixed(2) : '0.00' }}
</template>
</el-table-column>
</el-table>
@ -66,16 +51,14 @@
<script>
import {
getProjectList,
getAgreementInfoById,
getUnitListFilterTeam,
} from '@/api/back/index.js'
import { getLostReportList } from '@/api/cost/cost'
import { getAssestsReportList } from '@/api/cost/cost'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import * as XLSX from 'xlsx';
export default {
name: 'LostReportHome',
name: 'AssestsReportHome',
components: { Treeselect },
data() {
return {
@ -93,57 +76,15 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
dateRange: null,
startTime: null,
endTime: null,
proId: null,
},
}
},
created() {
this.initDefaultDateRange()
this.GetProData()
this.getList()
},
methods: {
//
initDefaultDateRange() {
const now = new Date()
const year = now.getFullYear()
const month = now.getMonth()
//
const firstDay = new Date(year, month, 1)
const firstDayStr = this.formatDate(firstDay)
//
const lastDay = new Date(year, month + 1, 0)
const lastDayStr = this.formatDate(lastDay)
this.queryParams.dateRange = [firstDayStr, lastDayStr]
this.queryParams.startTime = firstDayStr
this.queryParams.endTime = lastDayStr
},
// yyyy-MM-dd
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
//
handleDateRangeChange(dateRange) {
if (dateRange && dateRange.length === 2) {
this.queryParams.startTime = dateRange[0]
this.queryParams.endTime = dateRange[1]
} else {
this.queryParams.startTime = null
this.queryParams.endTime = null
}
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
@ -156,7 +97,6 @@ export default {
};
},
//
async GetProData() {
const params = {
@ -166,13 +106,12 @@ export default {
this.proList = res.data;
},
/** 查询列表 */
getList() {
this.loading = true
getLostReportList(this.queryParams).then((response) => {
this.tableList = response.rows || []
this.total = response.total
getAssestsReportList(this.queryParams).then((response) => {
this.tableList = response.data.rows || []
this.total = response.data.total
this.loading = false
}).catch((error) => {
console.error('获取丢失费用报表失败:', error)
@ -193,14 +132,9 @@ export default {
this.queryParams = {
pageNum: 1,
pageSize: 10,
projectId: null,
agreementCode: null,
dateRange: null,
startTime: null,
endTime: null,
proId: null,
}
//
this.initDefaultDateRange()
this.resetForm('queryForm')
this.handleQuery()
},
@ -224,7 +158,7 @@ export default {
const currentTime = formatTime(new Date());
this.download(
'/material/slt_agreement_info/exportLostList',
'/material/bm_report/exportAssetReportList',
{
...this.queryParams,
},