index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div class="quota-control-container">
  3. <div class="page-header">
  4. <PageTitle title="额度控制" />
  5. <el-button type="danger" @click="handleApplyQuota">额度申请</el-button>
  6. </div>
  7. <!-- 额度统计卡片 -->
  8. <div class="quota-cards">
  9. <div class="quota-card">
  10. <div class="card-icon"><el-icon><CreditCard /></el-icon></div>
  11. <div class="card-info">
  12. <div class="card-label">当前额度 ></div>
  13. <div class="card-value">32</div>
  14. </div>
  15. </div>
  16. <div class="quota-card">
  17. <div class="card-info">
  18. <div class="card-label">剩余可用额度 ></div>
  19. <div class="card-value">8,831.00</div>
  20. </div>
  21. </div>
  22. <div class="quota-card">
  23. <div class="card-info">
  24. <div class="card-label">已使用额度 ></div>
  25. <div class="card-value">8,831.00</div>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- 信用额度申请记录 -->
  30. <div class="section-title">信用额度申请记录</div>
  31. <el-table :data="recordList" border>
  32. <el-table-column prop="applyTime" label="申请时间" min-width="120" align="center" />
  33. <el-table-column prop="monthAmount" label="月度采购金额" min-width="120" align="center" />
  34. <el-table-column prop="yearAmount" label="预估年度采购金额" min-width="140" align="center" />
  35. <el-table-column prop="creditAmount" label="申请信用金额" min-width="120" align="center" />
  36. <el-table-column prop="category" label="主要采购类目" min-width="120" align="center" />
  37. <el-table-column prop="status" label="申请状态" min-width="100" align="center">
  38. <template #default="{ row }">
  39. <span :class="['status-text', getStatusClass(row.status)]">{{ row.status }}</span>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. </div>
  44. </template>
  45. <script setup lang="ts">
  46. import { ref } from 'vue'
  47. import { useRouter } from 'vue-router'
  48. import { CreditCard } from '@element-plus/icons-vue'
  49. import { PageTitle } from '@/components'
  50. const router = useRouter()
  51. const recordList = ref([
  52. { id: 1, applyTime: '2025-11-30', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '待审批' },
  53. { id: 2, applyTime: '2025-11-29', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '已通过' },
  54. { id: 3, applyTime: '2025-11-25', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '已通过' },
  55. { id: 4, applyTime: '2025-12-05', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '已通过' },
  56. { id: 5, applyTime: '2025-12-07', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '已通过' },
  57. { id: 6, applyTime: '2025-12-07', monthAmount: '0.00', yearAmount: '0.00', creditAmount: '0.00', category: '食品饮料', status: '已通过' }
  58. ])
  59. const getStatusClass = (status: string) => {
  60. if (status === '已通过') return 'success'
  61. if (status === '待审批') return 'warning'
  62. return ''
  63. }
  64. const handleApplyQuota = () => {
  65. router.push('/cost/quotaControl/apply')
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .quota-control-container {
  70. padding: 20px;
  71. background: #fff;
  72. min-height: 100%;
  73. }
  74. .page-header {
  75. display: flex;
  76. justify-content: space-between;
  77. align-items: center;
  78. margin-bottom: 20px;
  79. :deep(.page-title) { margin-bottom: 0; }
  80. }
  81. .quota-cards {
  82. display: flex;
  83. gap: 20px;
  84. margin-bottom: 30px;
  85. .quota-card {
  86. flex: 1;
  87. display: flex;
  88. align-items: center;
  89. gap: 15px;
  90. padding: 20px;
  91. background: #f9f9f9;
  92. border-radius: 4px;
  93. .card-icon {
  94. width: 40px;
  95. height: 40px;
  96. background: #409eff;
  97. border-radius: 4px;
  98. display: flex;
  99. align-items: center;
  100. justify-content: center;
  101. color: #fff;
  102. font-size: 20px;
  103. }
  104. .card-info {
  105. .card-label { font-size: 13px; color: #999; margin-bottom: 5px; }
  106. .card-value { font-size: 24px; font-weight: bold; color: #333; }
  107. }
  108. }
  109. }
  110. .section-title {
  111. font-size: 14px;
  112. color: #333;
  113. margin-bottom: 15px;
  114. }
  115. :deep(.el-table) {
  116. th.el-table__cell {
  117. background: #fafafa;
  118. font-weight: 500;
  119. color: #333;
  120. }
  121. .el-table__cell {
  122. padding: 10px 0;
  123. }
  124. }
  125. .status-text {
  126. &.success { color: #67c23a; }
  127. &.warning { color: #e6a23c; }
  128. }
  129. </style>