car_owner_credit.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template xmlns:piechart="http://www.w3.org/1999/html">
  2. <div class="body-wrapper">
  3. <div class="search-card">
  4. <h5>车主停车欠费情况</h5>
  5. </div>
  6. <el-table :data="tableData" style="background: #2a2a2a;border-color: #333;">
  7. <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
  8. </el-table-column>
  9. </el-table>
  10. <div class="table-pagination">
  11. <el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
  12. :current-page.sync="pageNum5" :page-size.sync="pageSize5">
  13. </el-pagination>
  14. </div>
  15. <br>
  16. </div>
  17. </template>
  18. <script>
  19. import api from "@/api/audit.js";
  20. import piechart from "@/components/pieChart";
  21. export default {
  22. components: {
  23. piechart
  24. },
  25. data() {
  26. return {
  27. columns: [
  28. {
  29. label: '姓名',
  30. key: 'resourceName'
  31. },
  32. {
  33. label: '欠费金额',
  34. key: 'resourceType'
  35. } ,{
  36. label: '信用分',
  37. key: 'resourceName'
  38. }
  39. ],
  40. tableData: [],
  41. total: 0,
  42. pageSize: 10,
  43. pageNum: 1,
  44. radio: '2',
  45. dialogVisible: false,
  46. selRow: {},
  47. searchWords: undefined,
  48. searchWords2: undefined,
  49. }
  50. },
  51. mounted() {
  52. this.getTableData()
  53. },
  54. watch: {
  55. },
  56. methods: {
  57. handlePageChange() {
  58. this.getTableData()
  59. },
  60. handleAudit(row) {
  61. this.selRow = row
  62. this.dialogVisible = true
  63. },
  64. handleCancelApply(row) {
  65. console.log('enter handle cancel apply')
  66. },
  67. handleConfirm() {
  68. const {id} = this.selRow
  69. api.applyResource({id, applyType: this.radio}).then(res => {
  70. if(res.success) {
  71. this.dialogVisible = false
  72. this.$message({
  73. message: '审核成功!',
  74. type: 'success'
  75. })
  76. this.getTableData()
  77. }
  78. })
  79. },
  80. getTableData() {
  81. const {pageNum, pageSize, searchWords} = this
  82. api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
  83. this.tableData = []
  84. res.data.records.map((item, index) => {
  85. const newItem = {...item}
  86. newItem.applyTypeText = this.getApplyTypeText(item.applyType)
  87. this.tableData.push(newItem)
  88. })
  89. this.total = res.data.total
  90. })
  91. },
  92. getTableData2() {
  93. api.applyList({}).then(res => {
  94. this.tableData2 = res.data.data
  95. this.total2 = res.data.total
  96. })
  97. },
  98. getTableData3() {
  99. api.applyList({pageNum: this.pageNum2, pageSize:this.pageSize2, resourceName: this.searchWords2}).then(res => {
  100. this.tableData3 = res.data.data
  101. this.total3 = res.data.total
  102. })
  103. },
  104. getApplyTypeText(val) {
  105. if (!val){
  106. return '未申请'
  107. }
  108. const textMap = {
  109. 1: '待审批',
  110. 2: '审批通过',
  111. 3: '审批驳回'
  112. }
  113. return textMap[val]
  114. },
  115. handleSearch() {
  116. this.pageNum = 1
  117. this.getTableData()
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .body-wrapper {
  124. padding: 20px;
  125. background: #0c0c0c;
  126. .button-block{
  127. text-align: right;
  128. margin-bottom: 20px;
  129. }
  130. .table-pagination{
  131. text-align: right;
  132. }
  133. .search-card{
  134. font-size: 24px;
  135. font-weight: bold;
  136. color: #3498db;
  137. margin-bottom: 20px;
  138. .input-wrapper{
  139. width: 36%;
  140. }
  141. }
  142. }
  143. .audit-dialog{
  144. .mg-bt{
  145. margin-bottom: 24px;
  146. }
  147. .label{
  148. text-align: right;
  149. }
  150. }
  151. </style>