| | |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" |
| | | border |
| | | v-loading="loading"> |
| | | v-loading="loading" |
| | | show-summary |
| | | :summary-method="summarizeListTable"> |
| | | <el-table-column label="序号" |
| | | type="index" |
| | | width="60" |
| | |
| | | <el-table-column label="项目名称" |
| | | prop="projectName" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="合同金额(元)" |
| | | <el-table-column label="含税总价(元)" |
| | | prop="contractAmount" |
| | | align="right"> |
| | | <template #default="scope"> |
| | | {{ formattedNumber(null, null, scope.row.contractAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数量" |
| | | prop="productTotalQuantity" |
| | | align="right"> |
| | | <template #default="scope"> |
| | | {{ scope.row.productTotalQuantity ?? "-" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="总面积(m²)" |
| | | prop="productTotalArea" |
| | | align="right"> |
| | | <template #default="scope"> |
| | | {{ scope.row.productTotalArea != null && scope.row.productTotalArea !== "" ? Number(scope.row.productTotalArea).toFixed(4) : "-" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="反审核类型" |
| | |
| | | return dayjs(time).format("YYYY-MM-DD HH:mm:ss"); |
| | | }; |
| | | |
| | | const summarizeListTable = param => { |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = "合计"; |
| | | return; |
| | | } |
| | | const prop = column.property; |
| | | if (prop === "productTotalQuantity") { |
| | | const values = data.map(item => Number(item.productTotalQuantity)); |
| | | sums[index] = values.every(value => isNaN(value)) |
| | | ? "" |
| | | : values.reduce((prev, curr) => { |
| | | const value = Number(curr); |
| | | return isNaN(value) ? prev : prev + value; |
| | | }, 0); |
| | | return; |
| | | } |
| | | if (prop === "productTotalArea") { |
| | | const values = data.map(item => Number(item.productTotalArea)); |
| | | sums[index] = values.every(value => isNaN(value)) |
| | | ? "" |
| | | : values |
| | | .reduce((prev, curr) => { |
| | | const value = Number(curr); |
| | | return isNaN(value) ? prev : prev + value; |
| | | }, 0) |
| | | .toFixed(4); |
| | | return; |
| | | } |
| | | if (prop === "contractAmount") { |
| | | const values = data.map(item => Number(item.contractAmount)); |
| | | sums[index] = values.every(value => isNaN(value)) |
| | | ? "" |
| | | : values |
| | | .reduce((prev, curr) => { |
| | | const value = Number(curr); |
| | | return isNaN(value) ? prev : prev + value; |
| | | }, 0) |
| | | .toLocaleString("zh-CN", { |
| | | minimumFractionDigits: 2, |
| | | maximumFractionDigits: 2, |
| | | }); |
| | | return; |
| | | } |
| | | sums[index] = ""; |
| | | }); |
| | | return sums; |
| | | }; |
| | | |
| | | const summarizeMainTable = param => { |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | |
| | | "quantity", |
| | | "actualTotalArea", |
| | | "taxInclusiveTotalPrice", |
| | | "taxExclusiveTotalPrice", |
| | | ].includes(prop) |
| | | ) { |
| | | const values = data.map(item => Number(item[prop])); |