11
This commit is contained in:
1 parent
3fc2dd44fd
commit
0e204406d2
1 file changed
+9
-14
@@ -14,10 +14,11 @@
|
||||
<right-toolbar @queryTable="getDataList" class="ml10" style="float: right" />
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle" :summary-method="getSummaries" :show-summary="true"
|
||||
row-class-name="success-row" @selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle" @expand-change="tableExpandChange">
|
||||
<el-table height="70vh" :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
:summary-method="getSummaries" :show-summary="true" row-class-name="success-row"
|
||||
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle"
|
||||
@expand-change="tableExpandChange">
|
||||
<el-table-column type="index" label="#" width="60" align="center" />
|
||||
<el-table-column prop="deptName" align="center" label="部门" width="300" />
|
||||
<el-table-column prop="deptTotalPerson" align="center" label="部门总人数" width="200">
|
||||
@@ -40,9 +41,9 @@
|
||||
<span class="color-success">{{ row.totalPerson }}人</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="未写在/非编人数" width="200">
|
||||
<el-table-column prop="fillInPerson" align="center" label="未写在/非编人数" width="200">
|
||||
<template #default="{ row }">
|
||||
<span class="color-danger">{{ row.deptTotalPerson - row.totalPerson }}人</span>
|
||||
<span class="color-danger">{{ row.fillInPerson }}人</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作">
|
||||
@@ -141,7 +142,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
|
||||
const getSummaries = (param: any) => {
|
||||
const { columns, data } = param
|
||||
const totalColumns = ["payUserCount", "timeCount", "payCount", "totalPrice", "payUserCountByTable"]
|
||||
const totalColumns = ["deptTotalPerson", "staffingPerson", "noneStaffingPerson", "totalPerson", "fillInPerson"]
|
||||
const totalRow = Array.from({ length: columns.length })
|
||||
totalRow[0] = "合计"
|
||||
columns.forEach((i: any, index: number) => {
|
||||
@@ -150,13 +151,7 @@ const getSummaries = (param: any) => {
|
||||
.filter((v: any) => v[i.property] != null)
|
||||
.map((v: any) => Number(v[i.property]))
|
||||
.reduce((pren: number, next: number) => pren + next, 0)
|
||||
if (i.property.includes("Price")) {
|
||||
totalRow[index] = displayPrice(total)
|
||||
} else if (i.property == 'payUserCountByTable') {
|
||||
totalRow[index] = "";
|
||||
} else {
|
||||
totalRow[index] = total
|
||||
}
|
||||
totalRow[index] = `${total}人`
|
||||
}
|
||||
})
|
||||
return totalRow
|
||||
|
||||
Reference in new issue
Block a user