费用结算页面优化

This commit is contained in:
BianLzhaoMin 2024-08-14 17:07:38 +08:00
parent 6d7a3e9f10
commit 2ed34bec99
2 changed files with 78 additions and 11 deletions

View File

@ -352,7 +352,7 @@
title="费用结算提交"
align="center"
:visible.sync="applyVisible"
width="1200px"
width="80%"
>
<div>
<el-table
@ -360,6 +360,7 @@
show-summary
sum-text="合计"
:summary-method="getSummaries"
border
>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column
@ -384,7 +385,6 @@
label="租赁费用"
align="center"
prop="leaseCost"
:show-overflow-tooltip="true"
/>
<el-table-column
label="维修费用"
@ -409,17 +409,24 @@
label="增项费用"
align="center"
prop="addCost"
:show-overflow-tooltip="true"
width="150"
width="180"
>
<template slot-scope="scope">
<el-input-number
<!-- <el-input-number
v-model="scope.row.addCost"
controls-position="right"
style="width: 100%"
:min="0"
:max="100000000"
@input="countNum(scope.row)"
></el-input-number> -->
<el-input-number
controls-position="right"
style="width: 150px"
v-model="scope.row.addCost"
:min="0"
:max="99999999"
@change="onAddChange(scope.row)"
></el-input-number>
</template>
</el-table-column>
@ -427,17 +434,24 @@
label="减免费用"
align="center"
prop="subCost"
:show-overflow-tooltip="true"
width="150"
width="180"
>
<template slot-scope="scope">
<el-input-number
<!-- <el-input-number
v-model="scope.row.subCost"
controls-position="right"
style="width: 100%"
:min="0"
:max="scope.row.cost"
@input="countNum(scope.row)"
></el-input-number> -->
<el-input-number
controls-position="right"
style="width: 150px"
v-model="scope.row.subCost"
:min="0"
:max="subCostFlag"
@change="onSubChange(scope.row)"
></el-input-number>
</template>
</el-table-column>
@ -453,6 +467,8 @@
v-model="scope.row.remark"
style="width: 100%"
maxlength="50"
type="textarea"
:rows="6"
></el-input>
</template>
</el-table-column>
@ -633,6 +649,10 @@ export default {
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) +
@ -647,7 +667,8 @@ export default {
Number(this.repairCost) +
Number(this.scrapCost) +
Number(this.loseCost)
this.costAll = costSum.toFixed(2)
this.costAll = costSum
this.subCostFlag = costSum
})
},
//1
@ -661,10 +682,12 @@ export default {
arrCost = arrCost + Number(item.costs)
}
})
return arrCost.toFixed(2)
},
//
handleAdd() {
this.getDataAll()
this.applyVisible = true
},
//el-table-
@ -707,6 +730,50 @@ export default {
Number(row.subCost || 0)
},
/** 费用增项时触发的事件 */
onAddChange(row) {
if (row.addCost === undefined) {
row.addCost = 0
}
if (row.addCost >= 100000000) {
this.$message.error('增项费用不能超过1亿')
row.addCost = 99999999
}
row.cost = (
row.leaseCost +
row.repairCost +
row.scrapCost +
row.loseCost +
row.addCost -
row.subCost
).toFixed(2)
},
/** 费用减项时触发事件 */
onSubChange(row) {
if (row.subCost === undefined) {
row.subCost = 0
}
if (row.subCost > this.costAll && this.costAll === row.cost) {
this.$message.error('减免费用不能超过小计费用')
this.subCostFlag = row.costAll
row.subCost = this.costAll
}
if (row.cost > this.costAll) {
this.$message.error('减免费用不能超过小计费用')
this.subCostFlag = row.cost
row.subCost = row.cost
}
row.cost = (
row.leaseCost +
row.repairCost +
row.scrapCost +
row.loseCost +
row.addCost -
row.subCost
).toFixed(2)
},
//
submitApply() {
let costAll = 0

View File

@ -43,11 +43,11 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
target: `http://192.168.2.160:28080`, //超
// target: `http://192.168.2.160:28080`, //超
// target: `http://10.40.92.81:28080`, //韩/
// target: `http://192.168.2.82:28080`,//旭/
// target: `http://192.168.2.248:28080`, //帅
// target: `http://192.168.2.209:28080`, //福
target: `http://192.168.2.218:28080`, //福
// target: `http://192.168.2.125:39080`, //王
//******** 注意事项 ********* */