| | |
| | | :is-show-pagination="true" |
| | | :page="page" |
| | | @pagination="handlePagination" |
| | | @sort-change="handleSortChange" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | |
| | | { |
| | | label: '录入日期', |
| | | prop: 'entryDate', |
| | | width: 120 |
| | | width: 120, |
| | | sortable: 'custom' |
| | | } |
| | | ]) |
| | | |
| | |
| | | current: 1, |
| | | size: 50, |
| | | }) |
| | | |
| | | // 排序状态(按录入日期排序) |
| | | const sortState = reactive({ prop: '', order: '' }) |
| | | |
| | | // 表格排序变化 |
| | | const handleSortChange = ({ prop, order }) => { |
| | | if (order) { |
| | | sortState.prop = prop |
| | | sortState.order = order === 'ascending' ? 'asc' : 'desc' |
| | | } else { |
| | | sortState.prop = '' |
| | | sortState.order = '' |
| | | } |
| | | page.current = 1 |
| | | handleSearch() |
| | | } |
| | | |
| | | // 转换产品树数据,将 id 改为 value |
| | | function convertIdToValue(data) { |
| | |
| | | params.current = page.current |
| | | params.size = page.size |
| | | |
| | | // 排序参数(按录入日期) |
| | | if (sortState.prop) { |
| | | params.orderByColumn = sortState.prop |
| | | params.isAsc = sortState.order |
| | | } |
| | | |
| | | const res = await procurementBusinessSummaryListPage(params) |
| | | if (res && res.data) { |
| | | // 兼容后端可能直接返回数组/或返回分页对象 |