| | |
| | | :data="props.row.children" |
| | | border |
| | | show-summary |
| | | :summary-method=" |
| | | (param) => summarizeChildrenTable(param, props.row) |
| | | " |
| | | :summary-method="summarizeChildrenTable" |
| | | > |
| | | <el-table-column align="center" label="序号" type="index" /> |
| | | <el-table-column label="产品大类" prop="productCategory" /> |
| | |
| | | <el-table-column |
| | | label="含税单价(元)" |
| | | prop="taxInclusiveUnitPrice" |
| | | :formatter="sensitiveAmountFormatter" |
| | | :formatter="formattedNumber" |
| | | /> |
| | | <el-table-column |
| | | label="含税总价(元)" |
| | | prop="taxInclusiveTotalPrice" |
| | | :formatter="sensitiveAmountFormatter" |
| | | :formatter="formattedNumber" |
| | | /> |
| | | <el-table-column |
| | | label="不含税总价(元)" |
| | | prop="taxExclusiveTotalPrice" |
| | | :formatter="sensitiveAmountFormatter" |
| | | :formatter="formattedNumber" |
| | | /> |
| | | <!--操作--> |
| | | <el-table-column Width="60px" label="操作" align="center"> |
| | |
| | | }; |
| | | const canEditLedger = (row) => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = (row) => isCurrentUserMaintainer(row); |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | return "*****"; |
| | | } |
| | | return formattedNumber(row, column, cellValue); |
| | | }; |
| | | // 获取tree子数据 |
| | | const getModels = (value) => { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value); |
| | |
| | | |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | | // 过滤掉子数据 |
| | | selectedRows.value = selection.filter((item) => item.children !== undefined); |
| | | console.log("selection", selectedRows.value); |
| | | selectedRows.value = selection; |
| | | }; |
| | | const productSelected = (selectedRows) => { |
| | | productSelectedRows.value = selectedRows; |
| | |
| | | ); |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeChildrenTable = (param, parentRow) => { |
| | | if (!isCurrentUserMaintainer(parentRow)) { |
| | | const { columns } = param; |
| | | return columns.map((column, index) => { |
| | | if (index === 0) { |
| | | return "合计"; |
| | | } |
| | | if ( |
| | | [ |
| | | "taxInclusiveUnitPrice", |
| | | "taxInclusiveTotalPrice", |
| | | "taxExclusiveTotalPrice", |
| | | ].includes(column.property) |
| | | ) { |
| | | return "*****"; |
| | | } |
| | | return ""; |
| | | }); |
| | | } |
| | | const summarizeChildrenTable = (param) => { |
| | | return proxy.summarizeTable( |
| | | param, |
| | | [ |
| | |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | ElMessageBox.confirm( |
| | | "勾选的台账将被导出;未勾选则导出当前搜索条件下的全部台账。是否确认导出?", |
| | | "导出", |
| | | { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | proxy.download("/sales/ledger/export", {}, "销售台账.xlsx"); |
| | | const { entryDate, ...rest } = searchForm; |
| | | const params = { ...rest }; |
| | | if (selectedRows.value.length) { |
| | | params.ids = selectedRows.value.map((item) => item.id); |
| | | } |
| | | proxy.download("/sales/ledger/export", params, "销售台账.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |