index.vue 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="page-container">
  3. <PageTitle title="部门采购金额" />
  4. <SearchBar :form="searchForm" :filters="filters" @search="handleSearch" @reset="handleReset">
  5. <template #buttons>
  6. <el-button type="danger">导出</el-button>
  7. </template>
  8. </SearchBar>
  9. <el-table :data="tableData" border style="width: 100%">
  10. <el-table-column type="index" label="序号" width="60" align="center" />
  11. <el-table-column prop="deptName" label="部门名称" width="120" align="center" />
  12. <el-table-column prop="orderPerson" label="下单人" width="100" align="center" />
  13. <el-table-column prop="orderAmount" label="下单金额" min-width="120" align="center">
  14. <template #default="{ row }">¥{{ row.orderAmount.toLocaleString() }}</template>
  15. </el-table-column>
  16. <el-table-column prop="completedAmount" label="已完成订单金额" min-width="140" align="center">
  17. <template #default="{ row }">¥{{ row.completedAmount.toLocaleString() }}</template>
  18. </el-table-column>
  19. <el-table-column prop="pendingAmount" label="待完成订单金额" min-width="140" align="center">
  20. <template #default="{ row }">¥{{ row.pendingAmount.toLocaleString() }}</template>
  21. </el-table-column>
  22. </el-table>
  23. <TablePagination v-model:page="pagination.page" v-model:pageSize="pagination.pageSize" :total="pagination.total" />
  24. </div>
  25. </template>
  26. <script setup lang="ts">
  27. import { reactive, ref } from 'vue';
  28. import { PageTitle, SearchBar, TablePagination } from '@/components';
  29. const searchForm = reactive({
  30. keyword: '',
  31. dateRange: [],
  32. deptId: ''
  33. });
  34. const filters = [
  35. {
  36. field: 'deptId',
  37. label: '下单部门',
  38. options: [
  39. { label: '全部', value: '' },
  40. { label: '人事部', value: '1' },
  41. { label: '行政部', value: '2' },
  42. { label: '设计部', value: '3' },
  43. { label: '技术部', value: '4' }
  44. ]
  45. }
  46. ];
  47. const pagination = reactive({ page: 1, pageSize: 10, total: 100 });
  48. const tableData = ref([
  49. { deptName: '人事部', orderPerson: '李世海', orderAmount: 2115.97, completedAmount: 2115.97, pendingAmount: 2115.97 },
  50. { deptName: '行政部', orderPerson: '李书萍', orderAmount: 4476.12, completedAmount: 4476.12, pendingAmount: 4476.12 },
  51. { deptName: '人事部', orderPerson: '邓文锦', orderAmount: 7751.34, completedAmount: 7751.34, pendingAmount: 7751.34 },
  52. { deptName: '设计部', orderPerson: '王凡宏', orderAmount: 7936.37, completedAmount: 7936.37, pendingAmount: 7936.37 },
  53. { deptName: '技术部', orderPerson: '赵昊艳', orderAmount: 3931.45, completedAmount: 3931.45, pendingAmount: 3931.45 },
  54. { deptName: '人事部', orderPerson: '钱君霞', orderAmount: 6132.75, completedAmount: 6132.75, pendingAmount: 6132.75 },
  55. { deptName: '行政部', orderPerson: '周静', orderAmount: 3189.56, completedAmount: 3189.56, pendingAmount: 3189.56 },
  56. { deptName: '行政部', orderPerson: '吴彦琛', orderAmount: 993.66, completedAmount: 993.66, pendingAmount: 993.66 },
  57. { deptName: '设计部', orderPerson: '钱慧倩', orderAmount: 2763.35, completedAmount: 2763.35, pendingAmount: 2763.35 },
  58. { deptName: '技术部', orderPerson: '孙银茹', orderAmount: 9286.45, completedAmount: 9286.45, pendingAmount: 9286.45 }
  59. ]);
  60. const handleSearch = () => {
  61. // 搜索逻辑
  62. };
  63. const handleReset = () => {
  64. // 重置逻辑
  65. };
  66. </script>