材料站-费用结算
This commit is contained in:
parent
f90bc471ee
commit
56b25aef20
|
|
@ -0,0 +1,580 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="18">
|
||||
<el-button type="primary" size="mini" @click="handleExport1">租赁明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport3">维修明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport4">报废明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport2">丢失明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport5">减免明细导出</el-button>
|
||||
<el-button type="warning" size="mini" @click="handleExportAll">全部明细导出</el-button>
|
||||
<el-button type="warning" size="mini" @click="handleExportEach">各结算明细导出</el-button>
|
||||
<el-button type="success" size="mini" @click="handleAdd">提交</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="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 }}
|
||||
</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="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 }}
|
||||
</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="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 }}
|
||||
</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="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 }}
|
||||
</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="typeName" :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="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 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计:</div>
|
||||
<div class="columnAll">
|
||||
{{ costAll.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSltInfo, submitCosts } from '@/api/cost/cost'
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
dicts: [],
|
||||
props: {
|
||||
row: {
|
||||
type: [String]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 往来单位数据
|
||||
unitList: [],
|
||||
// 工程数据
|
||||
projectList: [],
|
||||
leaseList: [], //租赁费用列表
|
||||
leaseCost: 0,
|
||||
repairList: [], //维修费用列表
|
||||
repairCost: 0,
|
||||
scrapList: [], //报废费用列表
|
||||
scrapCost: 0,
|
||||
loseList: [], //丢失费用列表
|
||||
loseCost: 0,
|
||||
reducList: [], //减免费用列表
|
||||
reducCost: 0,
|
||||
costAll: 0,
|
||||
deptName: undefined,
|
||||
applyList: [],
|
||||
projectName: undefined, //结算工程
|
||||
unitName: undefined //结算单位
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let arr = JSON.parse(this.row)
|
||||
this.rowData = arr
|
||||
this.getDataAll()
|
||||
},
|
||||
methods: {
|
||||
//获取单位类型 ,getUnitList, getProjectList
|
||||
getUnitList() {
|
||||
getUnitList().then(response => {
|
||||
this.unitList = response.data
|
||||
})
|
||||
},
|
||||
getProjectList() {
|
||||
getProjectList().then(response => {
|
||||
this.projectList = response.data
|
||||
})
|
||||
},
|
||||
/** 查询列表 */
|
||||
getDataAll() {
|
||||
getSltInfo(this.rowData).then(response => {
|
||||
this.leaseList = response.data.leaseList //租赁费用列表
|
||||
this.projectName = response.data.projectName
|
||||
this.unitName = response.data.unitName
|
||||
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 //减免费用列表
|
||||
if (this.reducList != null) {
|
||||
this.reducList.forEach(item => {
|
||||
this.reducCost = Number(this.reducCost) + Number(item.leaseMoney)
|
||||
})
|
||||
}
|
||||
this.applyList = response.data.relations
|
||||
this.applyList.forEach(item => {
|
||||
item.leaseCost = Number(item.leaseCost)
|
||||
item.repairCost = Number(item.repairCost)
|
||||
item.scrapCost = Number(item.scrapCost)
|
||||
item.loseCost = Number(item.loseCost)
|
||||
item.cost =
|
||||
Number(item.leaseCost) +
|
||||
Number(item.repairCost) +
|
||||
Number(item.scrapCost) +
|
||||
Number(item.loseCost) +
|
||||
Number(item.reductionCost) +
|
||||
Number(item.addCost) -
|
||||
Number(item.subCost)
|
||||
})
|
||||
|
||||
let costSum =
|
||||
Number(this.leaseCost) +
|
||||
Number(this.repairCost) +
|
||||
Number(this.scrapCost) +
|
||||
Number(this.loseCost) -
|
||||
Number(this.reducCost)
|
||||
this.costAll = costSum
|
||||
|
||||
this.subCostFlag = costSum
|
||||
})
|
||||
},
|
||||
//计算金额1
|
||||
countCost(list) {
|
||||
let arrCost = 0
|
||||
list.forEach(item => {
|
||||
// arrCost += parseInt(item.costs)
|
||||
if (item.partType != 0 && item.scrapType != 0) {
|
||||
arrCost = arrCost + Number(item.costs)
|
||||
}
|
||||
})
|
||||
|
||||
return arrCost.toFixed(2)
|
||||
},
|
||||
//提交按钮
|
||||
handleAdd() {
|
||||
this.$modal
|
||||
.confirm('是否确认提交?')
|
||||
.then(() => {
|
||||
let params = {
|
||||
agreementIds: Array.isArray(this.rowData) ? this.rowData.map(item => item.agreementId) : [],
|
||||
totalCostAll: this.costAll,
|
||||
leaseList: this.leaseList,
|
||||
repairList: this.repairList,
|
||||
scrapList: this.scrapList,
|
||||
loseList: this.loseList,
|
||||
reductionList: this.reducList
|
||||
}
|
||||
console.log('2222222222222', params)
|
||||
submitCosts(params).then(response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功'
|
||||
})
|
||||
this.$emit('goBackPage')
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
//el-table-合计总费用
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 9) {
|
||||
sums[index] = '最终费用'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
// 只对amount这一列进行总计核算。
|
||||
if (column.property === 'cost') {
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
} else {
|
||||
sums[index] = '---'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
countNum(row) {
|
||||
row.cost =
|
||||
Number(row.leaseCost) +
|
||||
Number(row.repairCost) +
|
||||
Number(row.scrapCost) +
|
||||
Number(row.loseCost) +
|
||||
Number(row.addCost || 0) -
|
||||
Number(row.subCost || 0)
|
||||
},
|
||||
|
||||
//返回
|
||||
handleBack() {
|
||||
this.$emit('goBackPage')
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
//租赁
|
||||
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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/exportEach', { ...params }, `各费用明细_${currentTime}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::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 #dfe6ec;
|
||||
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>
|
||||
|
|
@ -0,0 +1,480 @@
|
|||
<template>
|
||||
<div class="app-container" id="costApplyList">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px">
|
||||
<el-form-item>
|
||||
<treeselect
|
||||
ref="treeselectRef"
|
||||
v-model="unitIds"
|
||||
:options="unitList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 300px"
|
||||
:disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择结算单位"
|
||||
@select="unitChange"
|
||||
:multiple="true"
|
||||
></treeselect>
|
||||
</el-form-item>
|
||||
<el-form-item prop="projectIds">
|
||||
<treeselect
|
||||
v-model="queryParams.projectId"
|
||||
:options="proList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 240px"
|
||||
:disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择结算工程"
|
||||
@select="proChange"
|
||||
:disabled="unitIds.length == 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="agreementCode">
|
||||
<el-tooltip content="协议编号" placement="top" :disabled="!queryParams.agreementCode">
|
||||
<template #content>
|
||||
{{ queryParams.agreementCode }}
|
||||
</template>
|
||||
<el-input v-model="queryParams.agreementCode" placeholder="请输入协议号" clearable disabled />
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sltStatus">
|
||||
<el-select v-model="queryParams.sltStatus" placeholder="请选择结算状态" clearable filterable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.cost_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
:selectable="row => row.sltStatus == 0 || row.sltStatus == 3"
|
||||
/>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="结算单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="结算工程" align="center" prop="projectName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-if="scope.row.costs != null && scope.row.costs != ''">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算状态" align="center" prop="sltStatus" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cost_status" :value="scope.row.sltStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleApply(scope.row)"
|
||||
v-if="scope.row.sltStatus == '0' || scope.row.sltStatus == '3'"
|
||||
>
|
||||
结算申请
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 协议单弹窗 -->
|
||||
<el-dialog :visible.sync="openPrint" width="1100px" append-to-body>
|
||||
<div id="checkId">
|
||||
<div style="height: 600px; overflow-y: scroll">
|
||||
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
||||
<div style="text-align: center; font-weight: 600; font-size: 16px">机具设备有偿使用费结算协议书</div>
|
||||
<div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap">
|
||||
<div class="item" style="width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px"></div>
|
||||
<div class="item" style="width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
||||
<span>协议号:{{ agreementContent.agreementCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">工程名称:</div>
|
||||
<div class="columnContent" style="width: 80%">{{ agreementContent.projectName }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">承租单位:</div>
|
||||
<div class="columnContent" style="width: 40%">{{ agreementContent.unitName }}</div>
|
||||
<div class="columnLabel" style="width: 10%; border-left: 1px solid #9c9c9c">日期:</div>
|
||||
<div class="columnContent" style="width: 30%">{{ agreementContent.applyTime || newData }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 100%">结算项目及金额(元)</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">一、施工机具有偿使用费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.leaseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">二、施工机具维修费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.repairCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">三、施工机具丢失费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.loseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">四、施工机具损坏赔偿费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.scrapCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">五、施工机具租赁减免费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.reductionCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">费用合计金额(大写):</div>
|
||||
<div class="columnContent" style="width: 40%">{{ agreementContent.costAllUpper }}</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.costAll }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn" style="border: 1px solid #9c9c9c;">
|
||||
<div class="columnLabel" style="width: 20%">说明:</div>
|
||||
<div class="columnContent" style="width: 80%">本协议一式三份,甲方一份,乙方一份,经双方签字后生效。</div>
|
||||
</div>
|
||||
|
||||
<div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between">
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>部门负责人:</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>承租负责人:</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>核算员:</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="print">打 印</el-button>
|
||||
<el-button @click="openPrint = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUnitList } from '@/api/back/index.js'
|
||||
import { getSltAgreementInfo, getProjectListByUnitIds, getAgreementInfoById, getSltInfo } from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import printJS from 'print-js'
|
||||
export default {
|
||||
name: 'CostApplyList',
|
||||
dicts: ['cost_status'],
|
||||
components: { Treeselect, vueEasyPrint },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 单位数据
|
||||
unitList: [],
|
||||
// 工程数据
|
||||
proList: [],
|
||||
unitIds: [],
|
||||
projectIds: null,
|
||||
selectTreeProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
multiple: true //false
|
||||
},
|
||||
|
||||
// 表格数据
|
||||
tableList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sltStatus: '',
|
||||
isCommit: '',
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
agreementId: [],
|
||||
agreementCode: ''
|
||||
},
|
||||
openPrint: false,
|
||||
// 协议书内容
|
||||
agreementContent: {
|
||||
agreementCode: '',
|
||||
projectName: '',
|
||||
unitName: '',
|
||||
leaseCost: '', // 租赁费用
|
||||
repairCost: '', // 维修费用
|
||||
loseCost: '', // 丢失费用
|
||||
scrapCost: '', // 报废费用
|
||||
reductionCost: '', // 减免费用
|
||||
costAll: '', // 合计费用
|
||||
costAllUpper: '' // 合计费用大写
|
||||
},
|
||||
newData: new Date().toISOString().split('T')[0]
|
||||
}
|
||||
},
|
||||
// updated() {
|
||||
// this.$nextTick(() => {
|
||||
// // 通过 ref 获取 treeselect 组件的 DOM 元素
|
||||
// const treeselectElm = this.$refs.treeselectRef.$el;
|
||||
// if (treeselectElm && typeof treeselectElm.getBoundingClientRect === 'function') {
|
||||
// const rect = treeselectElm.getBoundingClientRect();
|
||||
// // 处理 rect
|
||||
// console.log(rect);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
created() {
|
||||
this.GetUnitData()
|
||||
// this.GetProData()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
// 获取 来往单位 列表数据
|
||||
async GetUnitData() {
|
||||
const params = {
|
||||
// projectId: this.queryParams.projectId /* */,
|
||||
}
|
||||
const res = await getUnitList(params)
|
||||
this.unitList = res.data
|
||||
if (this.queryParams.projectId) {
|
||||
this.getAgreementInfo()
|
||||
}
|
||||
},
|
||||
unitChange(val) {
|
||||
console.log('Selected values:', val) // 检查选中的值
|
||||
console.log('xxxxxxxxx', this.queryParams.unitId)
|
||||
console.log('yyyyyyyyy', this.unitIds)
|
||||
// this.GetProData()
|
||||
setTimeout(() => {
|
||||
this.queryParams.projectId = null
|
||||
this.queryParams.agreementId = null
|
||||
this.queryParams.agreementCode = null
|
||||
this.GetProData()
|
||||
}, 500)
|
||||
},
|
||||
// 获取 工程名称 列表数据
|
||||
async GetProData() {
|
||||
const unitIdsAsNumbers = this.unitIds.map(id => Number(id))
|
||||
const params = {
|
||||
unitIds: unitIdsAsNumbers
|
||||
}
|
||||
const res = await getProjectListByUnitIds(params)
|
||||
this.proList = res.data
|
||||
|
||||
this.getAgreementInfo()
|
||||
},
|
||||
proChange(val) {
|
||||
setTimeout(() => {
|
||||
this.GetUnitData()
|
||||
}, 500)
|
||||
},
|
||||
// 获取 协议id
|
||||
async getAgreementInfo() {
|
||||
if (this.unitIds && this.unitIds.length > 0 && this.queryParams.projectId) {
|
||||
const params = {
|
||||
unitIds: this.unitIds,
|
||||
projectId: this.queryParams.projectId
|
||||
}
|
||||
const res = await getAgreementInfoById(params)
|
||||
console.log(res)
|
||||
if (!res.data && res.data.some(item => !item.agreementId)) {
|
||||
this.$message.error('当前单位和工程无协议!')
|
||||
this.queryParams.unitId = null
|
||||
this.queryParams.projectId = null
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
} else {
|
||||
this.queryParams.agreementId = res.data.map(item => item.agreementId)
|
||||
this.queryParams.agreementCode = res.data.map(item => item.agreementCode).join(',')
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
const params = {
|
||||
pageNum: this.queryParams.pageNum,
|
||||
pageSize: this.queryParams.pageSize,
|
||||
projectId: this.queryParams.projectId,
|
||||
sltStatus: this.queryParams.sltStatus,
|
||||
// ...this.queryParams,
|
||||
unitIds: this.unitIds
|
||||
}
|
||||
getSltAgreementInfo(params).then(response => {
|
||||
this.tableList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.unitIds = []
|
||||
this.projectIds = []
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sltStatus: '',
|
||||
isCommit: '',
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
agreementId: [],
|
||||
agreementCode: ''
|
||||
}
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
//结算申请
|
||||
handleApply(row) {
|
||||
let arr = []
|
||||
arr.push(row)
|
||||
this.$emit('goDetail', JSON.stringify(arr))
|
||||
},
|
||||
handleApplyList() {
|
||||
if (this.ids.length < 1) {
|
||||
this.$message.error('请勾选需要结算的数据!')
|
||||
return
|
||||
}
|
||||
if (this.ids.length > 0) {
|
||||
let arr = this.ids
|
||||
this.$emit('goDetail', JSON.stringify(arr))
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
async openPrintDialog(row) {
|
||||
this.openPrint = true
|
||||
try {
|
||||
const res = await getSltInfo([row])
|
||||
console.log('🚀 ~ openPrintDialog ~ res:', res)
|
||||
if (!res.data) return
|
||||
this.agreementContent = res.data
|
||||
this.agreementContent.agreementCode = row.agreementCode
|
||||
this.agreementContent.costAll =
|
||||
Number(res.data.leaseCost) +
|
||||
Number(res.data.repairCost) +
|
||||
Number(res.data.scrapCost) +
|
||||
Number(res.data.loseCost) -
|
||||
Number(res.data.reductionCost)
|
||||
// costAllUpper 中文大写
|
||||
this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ openPrintDialog ~ error:', error)
|
||||
}
|
||||
},
|
||||
//维修任务单打印
|
||||
print() {
|
||||
this.$refs.remarksPrintRef.print()
|
||||
// printJS({
|
||||
// printable: 'checkId',
|
||||
// type: 'html',
|
||||
// targetStyles: ['*'],
|
||||
// maxWidth:'1400'
|
||||
// // 其他配置选项
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 80px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
.tabelColumn {
|
||||
width: 1000px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #9c9c9c;
|
||||
// margin-bottom: 1px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.columnLabel {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
border-left: none;
|
||||
}
|
||||
.columnContent {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
border-left: 1px solid #9c9c9c;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,540 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="18">
|
||||
<el-button type="primary" size="mini" @click="handleExport1">租赁明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport3">维修明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport4">报废明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport2">丢失明细导出</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleExport5">减免明细导出</el-button>
|
||||
<el-button type="warning" size="mini" @click="handleExportAll">全部明细导出</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="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">
|
||||
{{ 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">
|
||||
{{ 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">
|
||||
{{ 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">
|
||||
{{ 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 }}
|
||||
</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="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">
|
||||
{{ 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">
|
||||
{{ 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 }}
|
||||
</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="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">
|
||||
{{ 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">
|
||||
{{ 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 }}
|
||||
</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="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">
|
||||
{{ 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">
|
||||
{{ 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 }}
|
||||
</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="typeName" :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="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-if="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 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelAllBottom">
|
||||
<div class="columnAllNum">合计:</div>
|
||||
<div class="columnAll">
|
||||
{{ costAll.toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSltInfo } from '@/api/cost/cost'
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
dicts: [],
|
||||
props: {
|
||||
row: {
|
||||
type: [String]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 往来单位数据
|
||||
unitList: [],
|
||||
// 工程数据
|
||||
projectList: [],
|
||||
leaseList: [], //租赁费用列表
|
||||
leaseCost: 0,
|
||||
repairList: [], //维修费用列表
|
||||
repairCost: 0,
|
||||
scrapList: [], //报废费用列表
|
||||
scrapCost: 0,
|
||||
loseList: [], //丢失费用列表
|
||||
loseCost: 0,
|
||||
reducList: [], //减免费用列表
|
||||
reducCost: 0,
|
||||
costAll: 0,
|
||||
deptName: undefined,
|
||||
applyList: [],
|
||||
projectName: undefined, //结算工程
|
||||
unitName: undefined //结算单位
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('33333333333', this.row)
|
||||
let arr = JSON.parse(this.row)
|
||||
this.rowData = arr
|
||||
this.getDataAll()
|
||||
},
|
||||
methods: {
|
||||
//获取单位类型 ,getUnitList, getProjectList
|
||||
getUnitList() {
|
||||
getUnitList().then(response => {
|
||||
this.unitList = response.data
|
||||
})
|
||||
},
|
||||
getProjectList() {
|
||||
getProjectList().then(response => {
|
||||
this.projectList = response.data
|
||||
})
|
||||
},
|
||||
/** 查询列表 */
|
||||
getDataAll() {
|
||||
getSltInfo(this.rowData).then(response => {
|
||||
this.leaseList = response.data.leaseList //租赁费用列表
|
||||
this.projectName = response.data.projectName
|
||||
this.unitName = response.data.unitName
|
||||
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.applyList = response.data.relations
|
||||
this.applyList.forEach(item => {
|
||||
item.leaseCost = Number(item.leaseCost)
|
||||
item.repairCost = Number(item.repairCost)
|
||||
item.scrapCost = Number(item.scrapCost)
|
||||
item.loseCost = Number(item.loseCost)
|
||||
item.cost =
|
||||
Number(item.leaseCost) +
|
||||
Number(item.repairCost) +
|
||||
Number(item.scrapCost) +
|
||||
Number(item.loseCost) +
|
||||
Number(item.reductionCost) +
|
||||
Number(item.addCost) -
|
||||
Number(item.subCost)
|
||||
})
|
||||
|
||||
let costSum =
|
||||
Number(this.leaseCost) +
|
||||
Number(this.repairCost) +
|
||||
Number(this.scrapCost) +
|
||||
Number(this.loseCost) -
|
||||
Number(this.reducCost)
|
||||
this.costAll = costSum
|
||||
this.subCostFlag = costSum
|
||||
})
|
||||
},
|
||||
//计算金额1
|
||||
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)
|
||||
}
|
||||
})
|
||||
|
||||
return arrCost.toFixed(2)
|
||||
},
|
||||
//el-table-合计总费用
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 9) {
|
||||
sums[index] = '最终费用'
|
||||
return
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]))
|
||||
// 只对amount这一列进行总计核算。
|
||||
if (column.property === 'cost') {
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
// sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = '---'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
countNum(row) {
|
||||
row.cost =
|
||||
Number(row.leaseCost) +
|
||||
Number(row.repairCost) +
|
||||
Number(row.scrapCost) +
|
||||
Number(row.loseCost) +
|
||||
Number(row.addCost || 0) -
|
||||
Number(row.subCost || 0)
|
||||
},
|
||||
|
||||
//返回
|
||||
handleBack() {
|
||||
this.$emit('goBackPage')
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
//租赁
|
||||
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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/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/slt_agreement_info/exportAll', { ...params }, `全部费用明细_${currentTime}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::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 #dfe6ec;
|
||||
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>
|
||||
|
|
@ -0,0 +1,482 @@
|
|||
<template>
|
||||
<div class="app-container" id="costApplyList">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item prop="unitIds">
|
||||
<treeselect
|
||||
v-model="queryParams.unitId"
|
||||
:options="unitList"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
style="width: 240px"
|
||||
:disable-branch-nodes="true"
|
||||
noChildrenText="没有数据了"
|
||||
noOptionsText="没有数据"
|
||||
noResultsText="没有搜索结果"
|
||||
placeholder="请选择结算单位"
|
||||
@select="unitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="projectIds">
|
||||
<treeselect
|
||||
v-model="queryParams.projectId"
|
||||
: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="agreementCode">
|
||||
<el-input v-model="queryParams.agreementCode" placeholder="请输入协议号" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item prop="sltStatus">
|
||||
<el-select v-model="queryParams.sltStatus" placeholder="请选择结算状态" clearable filterable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.cost_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
v-if="dict.value !== '0'"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="结算单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="结算工程" align="center" prop="projectName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="合计费用(元)" align="center" prop="costs" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope" v-if="scope.row.costs != null && scope.row.costs != ''">
|
||||
{{ scope.row.costs.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批人" align="center" prop="auditor" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="审批时间" align="center" prop="auditTime" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="结算状态" align="center" prop="sltStatus" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.cost_status" :value="scope.row.sltStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="normal" icon="el-icon-search" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleExame(scope.row)"
|
||||
v-if="scope.row.sltStatus == '1'"
|
||||
>
|
||||
审批
|
||||
</el-button>
|
||||
<el-button type="primary" plain size="mini" @click="openPrintDialog(scope.row)">协议书</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 审批弹窗 -->
|
||||
<el-dialog title="结算审批" :visible.sync="applyVisible" width="650px" append-to-body>
|
||||
<el-form ref="aform" :model="aform" label-width="120px">
|
||||
<el-form-item label="结算审批" prop="status">
|
||||
<el-radio v-model="aform.status" label="2">通过</el-radio>
|
||||
<el-radio v-model="aform.status" label="3">不通过</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="remark">
|
||||
<el-input
|
||||
v-model="aform.remark"
|
||||
maxlength="100"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
size="small"
|
||||
style="width: 350px"
|
||||
type="textarea"
|
||||
rows="4"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="submitListForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 协议单弹窗 -->
|
||||
<el-dialog :visible.sync="openPrint" width="1100px" append-to-body>
|
||||
<div style="height: 600px; overflow-y: scroll">
|
||||
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
|
||||
<div style="text-align: center; font-weight: 600; font-size: 16px">机具设备有偿使用费结算协议书</div>
|
||||
<div class="info" style="margin-top: 10px; display: flex; flex-wrap: wrap">
|
||||
<div class="item" style="width: 65%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px"></div>
|
||||
<div class="item" style="width: 35%; flex-shrink: 0; margin-bottom: 5px; font-size: 14px">
|
||||
<span>协议号:{{ agreementContent.agreementCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">工程名称:</div>
|
||||
<div class="columnContent" style="width: 80%">{{ agreementContent.projectName }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">承租单位:</div>
|
||||
<div class="columnContent" style="width: 40%">{{ agreementContent.unitName }}</div>
|
||||
<div class="columnLabel" style="width: 10%; border-left: 1px solid #9c9c9c">日期:</div>
|
||||
<div class="columnContent" style="width: 30%">{{ agreementContent.applyTime }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 100%">结算项目及金额(元)</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">一、施工机具有偿使用费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.leaseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">二、施工机具维修费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.repairCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">三、施工机具丢失费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.loseCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">四、施工机具损坏赔偿费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.scrapCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 60%">五、施工机具租赁减免费:</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.reductionCost }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn">
|
||||
<div class="columnLabel" style="width: 20%">费用合计金额(大写):</div>
|
||||
<div class="columnContent" style="width: 40%">{{ agreementContent.costAllUpper }}</div>
|
||||
<div class="columnContent" style="width: 40%">¥ {{ agreementContent.costAll }}</div>
|
||||
</div>
|
||||
<div class="tabelColumn" style="border: 1px solid #9c9c9c;">
|
||||
<div class="columnLabel" style="width: 20%">说明:</div>
|
||||
<div class="columnContent" style="width: 80%">本协议一式三份,甲方一份,乙方一份,经双方签字后生效。</div>
|
||||
</div>
|
||||
|
||||
<div class="fillIn" style="margin-top: 20px; display: flex; justify-content: space-between">
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>部门负责人:</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>承租负责人:</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item" style="width: 33%">
|
||||
<div>
|
||||
<span>核算员:</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="print">打 印</el-button>
|
||||
<el-button @click="openPrint = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
|
||||
import { getSltList, costExamine, getSltInfo } from '@/api/cost/cost'
|
||||
import { toChineseAmount } from '@/utils/bonus.js'
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
export default {
|
||||
name: 'CostApplyList',
|
||||
dicts: ['cost_status'],
|
||||
components: { Treeselect, vueEasyPrint },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 单位数据
|
||||
unitList: [],
|
||||
// 工程数据
|
||||
proList: [],
|
||||
unitIds: null,
|
||||
projectIds: null,
|
||||
selectTreeProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
// multiple: true,//false
|
||||
},
|
||||
// 表格数据
|
||||
tableList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined,
|
||||
sltStatus: '',
|
||||
isCommit: '',
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
agreementId: null,
|
||||
agreementCode: null
|
||||
},
|
||||
openPrint: false,
|
||||
// 审批弹窗
|
||||
aform: { status: '2' },
|
||||
//审批弹窗是否开启
|
||||
applyVisible: false,
|
||||
id: '',
|
||||
agreementIdTemp: '',
|
||||
// 协议书内容
|
||||
agreementContent: {
|
||||
agreementCode: '',
|
||||
projectName: '',
|
||||
unitName: '',
|
||||
leaseCost: '', // 租赁费用
|
||||
repairCost: '', // 维修费用
|
||||
loseCost: '', // 丢失费用
|
||||
scrapCost: '', // 报废费用
|
||||
reductionCost: '', // 减免费用
|
||||
costAll: '', // 合计费用
|
||||
costAllUpper: '' // 合计费用大写
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 转换菜单数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
},
|
||||
// 获取 来往单位 列表数据
|
||||
async GetUnitData() {
|
||||
const params = {
|
||||
// projectId: this.queryParams.projectId /* */,
|
||||
}
|
||||
const res = await getUnitList(params)
|
||||
this.unitList = res.data
|
||||
|
||||
this.getAgreementInfo()
|
||||
},
|
||||
unitChange(val) {
|
||||
setTimeout(() => {
|
||||
this.queryParams.projectId = null
|
||||
this.queryParams.agreementId = null
|
||||
this.queryParams.agreementCode = null
|
||||
this.GetProData()
|
||||
}, 500)
|
||||
},
|
||||
// 获取 工程名称 列表数据
|
||||
async GetProData() {
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId
|
||||
}
|
||||
const res = await getProjectList(params)
|
||||
this.proList = res.data
|
||||
|
||||
this.getAgreementInfo()
|
||||
},
|
||||
proChange(val) {
|
||||
setTimeout(() => {
|
||||
this.GetUnitData()
|
||||
}, 500)
|
||||
},
|
||||
// 获取 协议id
|
||||
async getAgreementInfo() {
|
||||
if (this.queryParams.unitId && this.queryParams.projectId) {
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
projectId: this.queryParams.projectId
|
||||
}
|
||||
const res = await getAgreementInfoById(params)
|
||||
console.log(res)
|
||||
if (!(res.data && res.data.agreementId)) {
|
||||
this.$message.error('当前单位和工程无协议!')
|
||||
this.queryParams.unitId = null
|
||||
this.queryParams.projectId = null
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
} else {
|
||||
this.queryParams.agreementId = res.data.agreementId
|
||||
this.queryParams.agreementCode = res.data.agreementCode
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
getSltList(this.queryParams).then(response => {
|
||||
this.tableList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sltStatus: '',
|
||||
isCommit: '',
|
||||
unitId: null,
|
||||
projectId: null,
|
||||
agreementId: '',
|
||||
agreementCode: ''
|
||||
}
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
//结算审批查看
|
||||
handleView(row) {
|
||||
let arr = []
|
||||
arr.push(row)
|
||||
this.$emit('goDetail', JSON.stringify(arr))
|
||||
},
|
||||
//结算审批
|
||||
handleExame(row) {
|
||||
this.id = row.id
|
||||
this.agreementIdTemp = row.agreementId
|
||||
this.applyVisible = true
|
||||
},
|
||||
//提交按钮
|
||||
submitListForm() {
|
||||
let param = {
|
||||
id: this.id,
|
||||
status: this.aform.status,
|
||||
remark: this.aform.remark,
|
||||
agreementId: this.agreementIdTemp
|
||||
}
|
||||
costExamine(param)
|
||||
.then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess('审批成功')
|
||||
this.getList()
|
||||
this.applyVisible = false
|
||||
} else {
|
||||
this.$modal.msgError(res.msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
//取消按钮
|
||||
cancel() {
|
||||
this.applyVisible = false
|
||||
this.aform = { status: '2' }
|
||||
},
|
||||
|
||||
async openPrintDialog(row) {
|
||||
this.openPrint = true
|
||||
try {
|
||||
const res = await getSltInfo([row])
|
||||
console.log('🚀 ~ openPrintDialog ~ res:', res)
|
||||
if (!res.data) return
|
||||
this.agreementContent = res.data
|
||||
this.agreementContent.agreementCode = row.agreementCode
|
||||
this.agreementContent.costAll =
|
||||
Number(res.data.leaseCost) +
|
||||
Number(res.data.repairCost) +
|
||||
Number(res.data.scrapCost) +
|
||||
Number(res.data.loseCost) -
|
||||
Number(res.data.reductionCost)
|
||||
// costAllUpper 中文大写
|
||||
this.agreementContent.costAllUpper = toChineseAmount(this.agreementContent.costAll.toFixed(2))
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ openPrintDialog ~ error:', error)
|
||||
}
|
||||
},
|
||||
//维修任务单打印
|
||||
print() {
|
||||
this.$refs.remarksPrintRef.print()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 80px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
.tabelColumn {
|
||||
width: 1000px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #9c9c9c;
|
||||
// margin-bottom: 1px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.columnLabel {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
border-left: none;
|
||||
}
|
||||
.columnContent {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
border-left: 1px solid #9c9c9c;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<!-- 结算申请-->
|
||||
<div class="app-container">
|
||||
<PageHeader v-if="isShowComponent !== 'ApplyHome'" :pageContent="pageContent" @goBack="goBack" />
|
||||
<component :is="isShowComponent" :row="rowData" @goDetail="goDetail" @goBackPage="goBack" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageHeader from '@/components/pageHeader'
|
||||
import ApplyHome from './component/applyHome.vue'
|
||||
import ApplyDetail from './component/applyDetail.vue'
|
||||
export default {
|
||||
name: 'CostApplyList',
|
||||
components: {
|
||||
PageHeader,
|
||||
ApplyHome,
|
||||
ApplyDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowComponent: 'ApplyHome',
|
||||
pageContent: '',
|
||||
rowData: null,
|
||||
isView: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 退料编辑
|
||||
goDetail(rowData) {
|
||||
this.rowData = rowData
|
||||
this.pageContent = '结算详情'
|
||||
this.isShowComponent = 'ApplyDetail'
|
||||
},
|
||||
goBack() {
|
||||
this.isShowComponent = 'ApplyHome'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<!-- 结算申请-->
|
||||
<div class="app-container">
|
||||
<PageHeader v-if="isShowComponent !== 'ExamHome'" :pageContent="pageContent" @goBack="goBack" />
|
||||
<component :is="isShowComponent" :row="rowData" @goDetail="goDetail" @goBackPage="goBack" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PageHeader from '@/components/pageHeader'
|
||||
import ExamHome from './component/examHome.vue'
|
||||
import ExamDetail from './component/examDetail.vue'
|
||||
export default {
|
||||
name: 'CostExamList',
|
||||
components: {
|
||||
PageHeader,
|
||||
ExamHome,
|
||||
ExamDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowComponent: 'ExamHome',
|
||||
pageContent: '',
|
||||
rowData: null,
|
||||
isView: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 退料编辑
|
||||
goDetail(rowData) {
|
||||
this.rowData = rowData
|
||||
this.pageContent = '结算详情'
|
||||
this.isShowComponent = 'ExamDetail'
|
||||
},
|
||||
goBack() {
|
||||
this.isShowComponent = 'ExamHome'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue