Commit 754fb6ff by zhangxw

考勤明细合计天数添加单位

1 parent 4b8d80f0
......@@ -25,7 +25,7 @@
<el-table
v-if="item.tableData.length"
:data="item.tableData"
height="500px"
max-height="470px"
class="table_class"
border
:header-cell-style="{
......@@ -207,12 +207,12 @@ export default {
if (index === 1) {
const numberList = this.tabList[Number(this.activeName)]?.tableData.map((item) => !isNaN(item.deductionDays) ? item.deductionDays : 0)
sums[index] =
(numberList.length
const total = (numberList.length
? numberList.reduce((preVal, curVal) => {
return `${this.activeName == 2 ? '+' : ''}${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
return `${new BigNumber(preVal || 0).plus(new BigNumber(curVal || 0)).toNumber()}`
})
: "0")
sums[index] = `${this.activeName == '2' && total > 0 ? '+' : ''}${Number(total)}天`
}
})
return sums
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!