tuqin
2026-09-24 409a6c46741422f0d6dc00acc38b5f7dc1f35e9f
src/views/procurementManagement/procurementReport/index.vue
@@ -70,6 +70,7 @@
          :is-show-pagination="true"
          :page="page"
          @pagination="handlePagination"
          @sort-change="handleSortChange"
        />
      </div>
    </el-card>
@@ -165,7 +166,8 @@
  {
    label: '录入日期',
    prop: 'entryDate',
    width: 120
    width: 120,
    sortable: 'custom'
  }
])
@@ -178,6 +180,22 @@
  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) {
@@ -243,6 +261,12 @@
    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) {
      // 兼容后端可能直接返回数组/或返回分页对象