结算修改
This commit is contained in:
parent
8ba43c268d
commit
9b71da35f5
|
|
@ -36,6 +36,15 @@ export function getSltInfo(params){
|
|||
})
|
||||
}
|
||||
|
||||
// 查询材料站结算待审核详情(仅需 sltApplyCode)
|
||||
export function getClzSettledInfo(sltApplyCode) {
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/getSettledInfo',
|
||||
method: 'get',
|
||||
params: { sltApplyCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询材料站费用结算申请详情
|
||||
export function getClzSltInfo(params){
|
||||
return request({
|
||||
|
|
@ -119,6 +128,15 @@ export function getSltList(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询材料站的结算审批列表
|
||||
export function getClzSltList(query) {
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/getSltList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已结算报表列表
|
||||
export function getSltReportedList(params){
|
||||
return request({
|
||||
|
|
@ -137,6 +155,15 @@ export function costExamine(params){
|
|||
})
|
||||
}
|
||||
|
||||
// 材料站结算审批提交
|
||||
export function clzCostExamine(params){
|
||||
return request({
|
||||
url: '/material/material_sltAgreementInfo/costExamine',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询减免费用列表
|
||||
export function getReliefList(query) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -93,6 +93,20 @@ export const constantRoutes = [
|
|||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
},
|
||||
// 新增结算
|
||||
{
|
||||
path: '/settlement',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'add',
|
||||
name: 'SettlementAdd',
|
||||
meta: { title: '新增结算' },
|
||||
component: () => import('@/views/settlement/add.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" plain size="mini" @click="handleApplyList">批量结算</el-button>
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="goToSettlement">新增结算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
|
@ -88,8 +89,10 @@
|
|||
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
style="display: none"
|
||||
disabled="disabled"
|
||||
size="mini"
|
||||
type="primary"
|
||||
type="hi"
|
||||
icon="el-icon-edit"
|
||||
@click="handleApply(scope.row)"
|
||||
v-if="scope.row.sltStatus == '0' || scope.row.sltStatus == '3'"
|
||||
|
|
@ -199,7 +202,7 @@
|
|||
<script>
|
||||
import { getUnitList } from '@/api/back/index.js'
|
||||
import { getTeamList } from '@/api/materialsStation/auth.js'
|
||||
import { getSltAgreementInfo, getClzSltAgreementInfo, getProjectListByUnitIds, getClzProjectListByUnitIds, getAgreementInfoById, getClzAgreementInfoById, getSltInfo } from '@/api/cost/cost'
|
||||
import { getClzSltAgreementInfo, getClzProjectListByUnitIds, getClzAgreementInfoById, getSltInfo } from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
|
|
@ -432,6 +435,10 @@ export default {
|
|||
// maxWidth:'1400'
|
||||
// // 其他配置选项
|
||||
// });
|
||||
},
|
||||
/** 新增结算按钮操作 */
|
||||
goToSettlement() {
|
||||
this.$router.push('/settlement/add')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,24 +35,24 @@
|
|||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.leasePrice.toFixed(2) }}
|
||||
{{ Number(scope.row.leasePrice || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
{{ 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="leaseDays" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.leaseDays).toFixed(2) }}
|
||||
{{ Number(scope.row.leaseDays || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
{{ Number(scope.row.costs || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -75,13 +75,13 @@
|
|||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="维修数量" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
{{ 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="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
{{ Number(scope.row.costs || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -103,13 +103,13 @@
|
|||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="报废数量" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
{{ 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="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
{{ Number(scope.row.costs || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -131,12 +131,12 @@
|
|||
<el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="丢失数量" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
{{ Number(scope.row.num || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="丢失费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
{{ Number(scope.row.costs || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -163,8 +163,8 @@
|
|||
<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="leaseMoney" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-if="scope.row.leaseMoney">
|
||||
{{ scope.row.leaseMoney.toFixed(2) }}
|
||||
<template slot-scope="scope">
|
||||
{{ Number(scope.row.leaseMoney || 0).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getSltInfo } from '@/api/cost/cost'
|
||||
import { getSltInfo, getClzSettledInfo } from '@/api/cost/cost'
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
|
|
@ -239,31 +239,74 @@ export default {
|
|||
},
|
||||
/** 查询列表 */
|
||||
getDataAll() {
|
||||
getSltInfo(this.rowData).then(response => {
|
||||
this.leaseList = response.data.leaseList //租赁费用列表
|
||||
this.projectName = response.data.projectName
|
||||
this.unitName = response.data.unitName
|
||||
// 后端仅需 code 参数,这里优先取 sltApplyCode,若为数组则取第一个
|
||||
const code = Array.isArray(this.rowData)
|
||||
? (this.rowData[0]?.sltApplyCode || this.rowData[0]?.code)
|
||||
: (this.rowData?.sltApplyCode || this.rowData?.code)
|
||||
|
||||
getClzSettledInfo(code).then(response => {
|
||||
const dataArray = Array.isArray(response.data) ? response.data : [response.data]
|
||||
|
||||
// 初始化
|
||||
this.leaseList = []
|
||||
this.repairList = []
|
||||
this.scrapList = []
|
||||
this.loseList = []
|
||||
this.reducList = []
|
||||
this.reducCost = 0
|
||||
|
||||
const projectNames = []
|
||||
const unitNames = []
|
||||
|
||||
// 合并各项列表,同时为明细补充单位名称以便显示
|
||||
dataArray.forEach(item => {
|
||||
if (!item) return
|
||||
const currentUnitName = item.unitName || ''
|
||||
const currentProjectName = item.projectName || ''
|
||||
if (currentUnitName) unitNames.push(currentUnitName)
|
||||
if (currentProjectName) projectNames.push(currentProjectName)
|
||||
|
||||
if (Array.isArray(item.leaseList) && item.leaseList.length) {
|
||||
const listWithUnit = item.leaseList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
|
||||
this.leaseList = [...this.leaseList, ...listWithUnit]
|
||||
}
|
||||
if (Array.isArray(item.repairList) && item.repairList.length) {
|
||||
const listWithUnit = item.repairList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
|
||||
this.repairList = [...this.repairList, ...listWithUnit]
|
||||
}
|
||||
if (Array.isArray(item.scrapList) && item.scrapList.length) {
|
||||
const listWithUnit = item.scrapList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
|
||||
this.scrapList = [...this.scrapList, ...listWithUnit]
|
||||
}
|
||||
if (Array.isArray(item.loseList) && item.loseList.length) {
|
||||
const listWithUnit = item.loseList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
|
||||
this.loseList = [...this.loseList, ...listWithUnit]
|
||||
}
|
||||
if (Array.isArray(item.reductionList) && item.reductionList.length) {
|
||||
const listWithUnit = item.reductionList.map(x => ({ ...x, unitName: x.unitName || currentUnitName }))
|
||||
this.reducList = [...this.reducList, ...listWithUnit]
|
||||
}
|
||||
})
|
||||
|
||||
// 单位/工程名展示:去重后拼接
|
||||
const unique = arr => Array.from(new Set(arr)).filter(Boolean)
|
||||
this.unitName = unique(unitNames).join(',')
|
||||
this.projectName = unique(projectNames).join(',')
|
||||
|
||||
// 费用汇总
|
||||
const sumCosts = list => list.reduce((s, x) => s + (Number(x.costs) || 0), 0)
|
||||
this.leaseCost = this.countCost(this.leaseList)
|
||||
|
||||
this.repairList = response.data.repairList //维修费用列表
|
||||
this.repairCost = response.data.repairCost.toFixed(2)
|
||||
// this.repairCost = this.countCost(this.repairList)
|
||||
|
||||
this.scrapList = response.data.scrapList //报废费用列表
|
||||
this.scrapCost = response.data.scrapCost.toFixed(2)
|
||||
// this.scrapCost = this.countCost(this.scrapList)
|
||||
|
||||
this.loseList = response.data.loseList //丢失费用列表
|
||||
this.loseCost = this.countCost(this.loseList)
|
||||
this.reducList = response.data.reductionList //减免费用列表
|
||||
console.log('111111111111111111', this.reducList)
|
||||
if (this.reducList != null) {
|
||||
this.reducList.forEach(item => {
|
||||
this.reducCost = Number(this.reducCost) + Number(item.leaseMoney)
|
||||
this.repairCost = sumCosts(this.repairList).toFixed(2)
|
||||
this.scrapCost = sumCosts(this.scrapList).toFixed(2)
|
||||
if (this.reducList && this.reducList.length) {
|
||||
this.reducList.forEach(x => {
|
||||
this.reducCost = Number(this.reducCost) + Number(x.leaseMoney || 0)
|
||||
})
|
||||
}
|
||||
|
||||
this.applyList = response.data.relations
|
||||
// relations 直接取第一项或合并(保持兼容:若存在则做基本数值归一)
|
||||
this.applyList = (dataArray[0] && Array.isArray(dataArray[0].relations)) ? dataArray[0].relations : []
|
||||
this.applyList.forEach(item => {
|
||||
item.leaseCost = Number(item.leaseCost)
|
||||
item.repairCost = Number(item.repairCost)
|
||||
|
|
@ -279,7 +322,7 @@ export default {
|
|||
Number(item.subCost)
|
||||
})
|
||||
|
||||
let costSum =
|
||||
const costSum =
|
||||
Number(this.leaseCost) +
|
||||
Number(this.repairCost) +
|
||||
Number(this.scrapCost) +
|
||||
|
|
@ -293,14 +336,10 @@ export default {
|
|||
countCost(list) {
|
||||
let arrCost = 0
|
||||
list.forEach(item => {
|
||||
// arrCost += parseInt(item.costs)
|
||||
|
||||
console.log(item)
|
||||
if (item.partType != 0 && item.scrapType != 0) {
|
||||
arrCost = arrCost + Number(item.costs)
|
||||
}
|
||||
// 后端返回的明细中 costs 可能为 null,这里做安全求和
|
||||
const costs = Number(item.costs || 0)
|
||||
arrCost = arrCost + costs
|
||||
})
|
||||
|
||||
return arrCost.toFixed(2)
|
||||
},
|
||||
//el-table-合计总费用
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@
|
|||
|
||||
<script>
|
||||
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
|
||||
import { getSltList, costExamine, getSltInfo } from '@/api/cost/cost'
|
||||
import {getClzSltList, costExamine, getSltInfo, getClzSettledInfo, clzCostExamine} from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
|
|
@ -355,7 +355,7 @@ export default {
|
|||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
getSltList(this.queryParams).then(response => {
|
||||
getClzSltList(this.queryParams).then(response => {
|
||||
this.tableList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
|
|
@ -390,6 +390,8 @@ export default {
|
|||
},
|
||||
//结算审批
|
||||
handleExame(row) {
|
||||
console.log(row)
|
||||
this.sltApplyCode = row.sltApplyCode
|
||||
this.id = row.id
|
||||
this.agreementIdTemp = row.agreementId
|
||||
this.applyVisible = true
|
||||
|
|
@ -400,9 +402,10 @@ export default {
|
|||
id: this.id,
|
||||
status: this.aform.status,
|
||||
remark: this.aform.remark,
|
||||
agreementId: this.agreementIdTemp
|
||||
agreementId: this.agreementIdTemp,
|
||||
code: this.sltApplyCode,
|
||||
}
|
||||
costExamine(param)
|
||||
clzCostExamine(param)
|
||||
.then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess('审批成功')
|
||||
|
|
|
|||
|
|
@ -0,0 +1,840 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 操作栏 -->
|
||||
<div class="operation-bar">
|
||||
<el-form :inline="true" label-width="80px" style="margin-bottom: 20px;">
|
||||
<el-form-item label="结算班组">
|
||||
<treeselect
|
||||
v-model="selectedTeams"
|
||||
:options="teamList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 300px"
|
||||
:disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择结算班组"
|
||||
:multiple="true"
|
||||
></treeselect>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结算工程">
|
||||
<treeselect
|
||||
v-model="selectedProject"
|
||||
:options="projectList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 300px"
|
||||
:disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择结算工程"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery" :loading="loading">查询</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 结算数据展示 -->
|
||||
<div>
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="18">
|
||||
<el-button type="primary" size="mini" @click="handleExport1" :disabled="!hasData">租赁明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport3" :disabled="!hasData">维修明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport4" :disabled="!hasData">报废明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport2" :disabled="!hasData">丢失明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport5" :disabled="!hasData">减免明细导出</el-button>
|
||||
<el-button type="warning" size="mini" @click="handleExportAll" :disabled="!hasData">全部明细导出</el-button>
|
||||
<el-button type="warning" size="mini" @click="handleExportEach" :disabled="!hasData">各结算明细导出</el-button>
|
||||
<el-button type="success" size="mini" @click="handleAdd" :disabled="!hasData">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div style="margin-top: 20px">
|
||||
<div class="tabelAllTop">
|
||||
<div class="costTop">结算费用</div>
|
||||
</div>
|
||||
<div class="tabelAllTopUnit">
|
||||
<div class="costTopUnit">结算班组</div>
|
||||
<div class="costRightUnit">
|
||||
{{ unitName || '请先选择班组并查询' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelAllTopUnit">
|
||||
<div class="costTopUnit">结算工程</div>
|
||||
<div class="costRightUnit">
|
||||
{{ projectName || '请先选择工程并查询' }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 租赁费用明细 -->
|
||||
<el-table :data="leaseList">
|
||||
<el-table-column label="租赁费用明细" align="center">
|
||||
<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="modelName" :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">
|
||||
<template slot-scope="scope" v-show="scope.row.leasePrice">
|
||||
{{ scope.row.leasePrice.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.num">
|
||||
{{ scope.row.num.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="leaseDays" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.leaseDays">
|
||||
{{ Number(scope.row.leaseDays).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="租赁费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.costs">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAll">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ leaseCost || '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 维修费用明细 -->
|
||||
<div>
|
||||
<el-table :data="repairList">
|
||||
<el-table-column label="维修费用明细" align="center">
|
||||
<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="modelName" :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">
|
||||
<template slot-scope="scope" v-show="scope.row.num">
|
||||
{{ scope.row.num.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="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.costs">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAll">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ repairCost || '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 报废费用明细 -->
|
||||
<div>
|
||||
<el-table :data="scrapList">
|
||||
<el-table-column label="报废费用明细" align="center">
|
||||
<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="modelName" :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">
|
||||
<template slot-scope="scope" v-show="scope.row.num">
|
||||
{{ scope.row.num.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="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.costs">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAll">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ scrapCost || '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 丢失费用明细 -->
|
||||
<div>
|
||||
<el-table :data="loseList">
|
||||
<el-table-column label="丢失费用明细" align="center">
|
||||
<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="modelName" :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">
|
||||
<template slot-scope="scope" v-show="scope.row.num">
|
||||
{{ scope.row.num.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="丢失费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-show="scope.row.costs">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAll">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ loseCost || '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 减免费用明细 -->
|
||||
<div>
|
||||
<el-table :data="reducList">
|
||||
<el-table-column label="减免费用明细" align="center">
|
||||
<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="modeName" :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="reduceNum" :show-overflow-tooltip="true" />
|
||||
<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="days" :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">
|
||||
<template slot-scope="scope" v-show="scope.row.leaseMoney">
|
||||
{{ scope.row.leaseMoney.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">费用小计:</div>
|
||||
<div class="columnAll">
|
||||
{{ reducCost || '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计:</div>
|
||||
<div class="columnAll">
|
||||
{{ costAll ? costAll.toFixed(2) : '0.00' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getClzSltInfo, submitClzCosts } from '@/api/cost/cost'
|
||||
import { getUnitList, getProjectList } from '@/api/back/index.js'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'SettlementAdd',
|
||||
components: {
|
||||
Treeselect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
hasQueried: false,
|
||||
selectedTeams: [],
|
||||
selectedProject: '',
|
||||
teamList: [],
|
||||
projectList: [],
|
||||
leaseList: [], //租赁费用列表
|
||||
leaseCost: 0,
|
||||
repairList: [], //维修费用列表
|
||||
repairCost: 0,
|
||||
scrapList: [], //报废费用列表
|
||||
scrapCost: 0,
|
||||
loseList: [], //丢失费用列表
|
||||
loseCost: 0,
|
||||
reducList: [], //减免费用列表
|
||||
reducCost: 0,
|
||||
costAll: 0,
|
||||
applyList: [],
|
||||
projectName: '', //结算工程
|
||||
unitName: '', //结算班组
|
||||
rowData: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasData() {
|
||||
return this.leaseList.length > 0 || this.repairList.length > 0 ||
|
||||
this.scrapList.length > 0 || this.loseList.length > 0 || this.reducList.length > 0
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.loadTeamList()
|
||||
await this.loadProjectList()
|
||||
},
|
||||
methods: {
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.label || node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
|
||||
async loadTeamList() {
|
||||
try {
|
||||
const response = await getUnitList({})
|
||||
if (response.code === 200) {
|
||||
this.teamList = response.data || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取班组列表失败:', error)
|
||||
this.$message.error('获取班组列表失败')
|
||||
}
|
||||
},
|
||||
|
||||
async loadProjectList() {
|
||||
try {
|
||||
const response = await getProjectList({})
|
||||
if (response.code === 200) {
|
||||
this.projectList = response.data || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取工程列表失败:', error)
|
||||
this.$message.error('获取工程列表失败')
|
||||
}
|
||||
},
|
||||
|
||||
async handleQuery() {
|
||||
if (this.selectedTeams.length === 0) {
|
||||
this.$message.warning('请选择结算班组')
|
||||
return
|
||||
}
|
||||
if (!this.selectedProject) {
|
||||
this.$message.warning('请选择结算工程')
|
||||
return
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
this.hasQueried = true
|
||||
|
||||
try {
|
||||
// 构造查询参数,模拟原有的rowData结构
|
||||
this.rowData = {
|
||||
unitIds: this.selectedTeams,
|
||||
projectId: this.selectedProject
|
||||
}
|
||||
|
||||
await this.getDataAll()
|
||||
} catch (error) {
|
||||
console.error('查询结算数据失败:', error)
|
||||
this.$message.error('查询结算数据失败')
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
|
||||
/** 查询列表 */
|
||||
async getDataAll() {
|
||||
try {
|
||||
const response = await getClzSltInfo(this.rowData)
|
||||
console.log('接口返回数据:', response)
|
||||
|
||||
// 处理返回的数据结构,合并所有班组的数据
|
||||
const dataArray = Array.isArray(response.data) ? response.data : [response.data]
|
||||
console.log('数据数组:', dataArray)
|
||||
|
||||
// 初始化合并后的数据
|
||||
this.leaseList = []
|
||||
this.repairList = []
|
||||
this.scrapList = []
|
||||
this.loseList = []
|
||||
this.reducList = []
|
||||
|
||||
// 收集项目名称和班组名称
|
||||
const projectNames = []
|
||||
const unitNames = []
|
||||
|
||||
let totalRepairCost = 0
|
||||
let totalScrapCost = 0
|
||||
|
||||
// 遍历所有班组数据进行合并
|
||||
dataArray.forEach((data, index) => {
|
||||
console.log(`处理第${index + 1}个班组数据:`, data)
|
||||
|
||||
// 获取当前班组的单位名称
|
||||
const currentUnitName = data.unitName || ''
|
||||
|
||||
// 合并各项费用列表,并为每个明细项设置正确的单位名称
|
||||
if (data.leaseList && data.leaseList.length > 0) {
|
||||
const leaseListWithUnit = data.leaseList.map(item => ({
|
||||
...item,
|
||||
unitName: item.unitName || currentUnitName
|
||||
}))
|
||||
this.leaseList = [...this.leaseList, ...leaseListWithUnit]
|
||||
}
|
||||
if (data.repairList && data.repairList.length > 0) {
|
||||
const repairListWithUnit = data.repairList.map(item => ({
|
||||
...item,
|
||||
unitName: item.unitName || currentUnitName
|
||||
}))
|
||||
this.repairList = [...this.repairList, ...repairListWithUnit]
|
||||
}
|
||||
if (data.scrapList && data.scrapList.length > 0) {
|
||||
const scrapListWithUnit = data.scrapList.map(item => ({
|
||||
...item,
|
||||
unitName: item.unitName || currentUnitName
|
||||
}))
|
||||
this.scrapList = [...this.scrapList, ...scrapListWithUnit]
|
||||
}
|
||||
if (data.loseList && data.loseList.length > 0) {
|
||||
const loseListWithUnit = data.loseList.map(item => ({
|
||||
...item,
|
||||
unitName: item.unitName || currentUnitName
|
||||
}))
|
||||
this.loseList = [...this.loseList, ...loseListWithUnit]
|
||||
}
|
||||
if (data.reductionList && data.reductionList.length > 0) {
|
||||
const reducListWithUnit = data.reductionList.map(item => ({
|
||||
...item,
|
||||
unitName: item.unitName || currentUnitName
|
||||
}))
|
||||
this.reducList = [...this.reducList, ...reducListWithUnit]
|
||||
}
|
||||
|
||||
// 收集项目和班组名称
|
||||
if (data.projectName && !projectNames.includes(data.projectName)) {
|
||||
projectNames.push(data.projectName)
|
||||
}
|
||||
if (data.unitName && !unitNames.includes(data.unitName)) {
|
||||
unitNames.push(data.unitName)
|
||||
}
|
||||
|
||||
// 累计维修和报废费用
|
||||
if (data.repairCost) {
|
||||
totalRepairCost += Number(data.repairCost)
|
||||
}
|
||||
if (data.scrapCost) {
|
||||
totalScrapCost += Number(data.scrapCost)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('合并后的租赁列表:', this.leaseList)
|
||||
console.log('合并后的维修列表:', this.repairList)
|
||||
console.log('合并后的报废列表:', this.scrapList)
|
||||
console.log('合并后的丢失列表:', this.loseList)
|
||||
console.log('合并后的减免列表:', this.reducList)
|
||||
|
||||
// 设置项目和班组名称(多个用逗号分隔)
|
||||
this.projectName = projectNames.join(', ')
|
||||
this.unitName = unitNames.join(', ')
|
||||
console.log('项目名称:', this.projectName)
|
||||
console.log('班组名称:', this.unitName)
|
||||
|
||||
// 计算各项费用
|
||||
this.leaseCost = this.countCost(this.leaseList)
|
||||
this.repairCost = totalRepairCost.toFixed(2)
|
||||
this.scrapCost = totalScrapCost.toFixed(2)
|
||||
this.loseCost = this.countCost(this.loseList)
|
||||
|
||||
// 计算减免费用
|
||||
this.reducCost = 0
|
||||
if (this.reducList.length > 0) {
|
||||
this.reducList.forEach(item => {
|
||||
this.reducCost = Number(this.reducCost) + Number(item.leaseMoney || 0)
|
||||
})
|
||||
}
|
||||
|
||||
console.log('租赁费用:', this.leaseCost)
|
||||
console.log('维修费用:', this.repairCost)
|
||||
console.log('报废费用:', this.scrapCost)
|
||||
console.log('丢失费用:', this.loseCost)
|
||||
console.log('减免费用:', this.reducCost)
|
||||
|
||||
// 计算总费用
|
||||
let costSum =
|
||||
Number(this.leaseCost) +
|
||||
Number(this.repairCost) +
|
||||
Number(this.scrapCost) +
|
||||
Number(this.loseCost) -
|
||||
Number(this.reducCost)
|
||||
this.costAll = costSum
|
||||
|
||||
console.log('各项数据长度:', {
|
||||
leaseList: this.leaseList.length,
|
||||
repairList: this.repairList.length,
|
||||
scrapList: this.scrapList.length,
|
||||
loseList: this.loseList.length,
|
||||
reducList: this.reducList.length
|
||||
})
|
||||
console.log('hasData结果:', this.hasData)
|
||||
console.log('总费用:', this.costAll)
|
||||
} catch (error) {
|
||||
console.error('获取结算数据失败:', error)
|
||||
this.$message.error('获取结算数据失败')
|
||||
}
|
||||
},
|
||||
|
||||
//计算金额
|
||||
countCost(list) {
|
||||
let arrCost = 0
|
||||
list.forEach(item => {
|
||||
// 对于租赁和丢失费用,直接累加costs字段
|
||||
// partType和scrapType为null的情况也需要计算
|
||||
if (item.costs && item.costs > 0) {
|
||||
arrCost = arrCost + Number(item.costs)
|
||||
}
|
||||
})
|
||||
return arrCost.toFixed(2)
|
||||
},
|
||||
|
||||
//提交按钮
|
||||
handleAdd() {
|
||||
this.$modal
|
||||
.confirm('是否确认提交?')
|
||||
.then(() => {
|
||||
// 从费用明细数据中提取协议ID
|
||||
const agreementIds = this.getAgreementIds()
|
||||
|
||||
let params = {
|
||||
agreementIds: agreementIds,
|
||||
totalCostAll: this.costAll,
|
||||
leaseList: this.leaseList,
|
||||
repairList: this.repairList,
|
||||
scrapList: this.scrapList,
|
||||
loseList: this.loseList,
|
||||
reductionList: this.reducList
|
||||
}
|
||||
console.log('提交参数:', params)
|
||||
console.log('协议ID列表:', agreementIds)
|
||||
submitClzCosts(params).then(response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功'
|
||||
})
|
||||
this.reset()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
// 提取协议ID
|
||||
getAgreementIds() {
|
||||
const agreementIds = new Set()
|
||||
|
||||
// 从租赁费用明细中提取协议ID
|
||||
this.leaseList.forEach(item => {
|
||||
if (item.agreementId) {
|
||||
agreementIds.add(item.agreementId)
|
||||
}
|
||||
})
|
||||
|
||||
// 从维修费用明细中提取协议ID
|
||||
this.repairList.forEach(item => {
|
||||
if (item.agreementId) {
|
||||
agreementIds.add(item.agreementId)
|
||||
}
|
||||
})
|
||||
|
||||
// 从报废费用明细中提取协议ID
|
||||
this.scrapList.forEach(item => {
|
||||
if (item.agreementId) {
|
||||
agreementIds.add(item.agreementId)
|
||||
}
|
||||
})
|
||||
|
||||
// 从丢失费用明细中提取协议ID
|
||||
this.loseList.forEach(item => {
|
||||
if (item.agreementId) {
|
||||
agreementIds.add(item.agreementId)
|
||||
}
|
||||
})
|
||||
|
||||
// 从减免费用明细中提取协议ID
|
||||
this.reducList.forEach(item => {
|
||||
if (item.agreementId) {
|
||||
agreementIds.add(item.agreementId)
|
||||
}
|
||||
})
|
||||
|
||||
// 转换为数组并返回
|
||||
return Array.from(agreementIds)
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.selectedTeams = []
|
||||
this.selectedProject = ''
|
||||
this.hasQueried = false
|
||||
this.clearData()
|
||||
},
|
||||
|
||||
clearData() {
|
||||
this.leaseList = []
|
||||
this.leaseCost = 0
|
||||
this.repairList = []
|
||||
this.repairCost = 0
|
||||
this.scrapList = []
|
||||
this.scrapCost = 0
|
||||
this.loseList = []
|
||||
this.loseCost = 0
|
||||
this.reducList = []
|
||||
this.reducCost = 0
|
||||
this.costAll = 0
|
||||
this.projectName = ''
|
||||
this.unitName = ''
|
||||
this.rowData = []
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
// 导出功能
|
||||
handleExport1() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportLease', { ...params }, `租赁费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExport2() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportLose', { ...params }, `丢失费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExport3() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportRepair', { ...params }, `维修费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExport4() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportScrap', { ...params }, `报废费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExport5() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportReduction', { ...params }, `减免费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExportAll() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportAll', { ...params }, `全部费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
handleExportEach() {
|
||||
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())
|
||||
let data = _.cloneDeep(this.rowData)
|
||||
const params = { params: JSON.stringify(data) }
|
||||
this.download('material/material_sltAgreementInfo/exportEach', { ...params }, `各费用明细_${currentTime}.xlsx`)
|
||||
},
|
||||
|
||||
// 监听器已不需要,工程列表独立加载
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// 不再需要监听器
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.operation-bar {
|
||||
//background: #f5f7fa;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-table .fixed-width .el-button--mini {
|
||||
width: 80px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tabelAllTop {
|
||||
display: flex;
|
||||
border: 1px solid #dfe6ec;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background-color: #f8f8f9;
|
||||
border-left: none;
|
||||
border-bottom: none;
|
||||
|
||||
.costTop {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
border-left: 1px solid #dfe6ec;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center; /* 将内容对齐到中间 */
|
||||
width: 100%;
|
||||
font-weight: bold; /* 添加字体加粗样式 */
|
||||
}
|
||||
}
|
||||
|
||||
.tabelAllTopUnit {
|
||||
display: flex;
|
||||
border: 1px solid #dfe6ec;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background-color: #f8f8f9;
|
||||
border-bottom: none;
|
||||
|
||||
.costTopUnit {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
width: 21.4%;
|
||||
border-left: none;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center; /* 将内容对齐到中间 */
|
||||
}
|
||||
|
||||
.costRightUnit {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
border-left: 1px solid #dfe6ec;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: center; /* 将内容对齐到中间 */
|
||||
// padding-left: 20px; /* 添加左内边距 */
|
||||
}
|
||||
}
|
||||
|
||||
.tabelAll {
|
||||
display: flex;
|
||||
border: 1px solid #ecedf3;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #dfe6ec;
|
||||
border-top: none;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.tabelAllBottom {
|
||||
display: flex;
|
||||
border: 1px solid #dfe6ec;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #dfe6ec;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.columnAll {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
border-left: 1px solid #dfe6ec;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: flex-end; /* 将内容对齐到右侧 */
|
||||
margin-right: 60px; /* 添加右边距 */
|
||||
}
|
||||
|
||||
.columnAllNum {
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 21.4%;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
/* 最后一列无右边框 */
|
||||
.tabelAll .column:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue