deduct-audit-list-table.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div>
  3. <div class="filter-box">
  4. <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
  5. </div>
  6. <el-table :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange" v-loading="loading" :height="tool.getTableHeight()">
  7. <el-table-column type="selection" width="55"></el-table-column>
  8. <el-table-column label="会员编号" width="">
  9. <template slot-scope="scope">
  10. <el-tag size="small" class="no-border">{{scope.row.BASE_INFO.USER_NAME}}</el-tag>
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="会员姓名" width="">
  14. <template slot-scope="scope">
  15. <el-tag type="success" size="small" class="no-border">{{scope.row.BASE_INFO.REAL_NAME}}</el-tag>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="会员状态" width="">
  19. <template slot-scope="scope">
  20. {{(scope.row.BASE_INFO.STATUS_NAME)}}
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="结算月" prop="CALC_MONTH" width="">
  24. <template slot-scope="scope">
  25. <el-tag type="danger" size="small" class="no-border">{{scope.row.CALC_MONTH}}</el-tag>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="状态">
  29. <template slot-scope="scope">
  30. <el-tag :type="tool.statusType(scope.row.AUDIT_STATUS)">{{scope.row.STATUS_NAME}}</el-tag>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="操作管理员" width="">
  34. <template slot-scope="scope">
  35. {{scope.row.CREATE_ADMIN_NAME}}
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="操作时间" width="">
  39. <template slot-scope="scope">
  40. {{tool.formatDate(scope.row.CREATED_AT)}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="备注">
  44. <template slot-scope="scope">
  45. {{scope.row.CREATE_REMARK}}
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <div class="white-box-footer">
  50. <el-button type="primary" size="small" @click="handleAdd" icon="el-icon-plus" v-show="permission.hasPermission(`reconsume/deduct-audit-add`)">申请扣除当月复销</el-button>
  51. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import network from '@/utils/network'
  57. import tool from '@/utils/tool'
  58. import FilterUser from '@/components/FilterUser'
  59. import baseInfo from '@/utils/baseInfo'
  60. import permission from '@/utils/permission'
  61. import Pagination from '@/components/Pagination'
  62. import filterHelper from '../../utils/filterHelper'
  63. export default {
  64. name: 'reconsume_deduct-audit-list-table',
  65. components: {FilterUser,Pagination},
  66. mounted () {
  67. this.getData()
  68. },
  69. props: {
  70. status: {
  71. type: Number,
  72. default: 1,
  73. }
  74. },
  75. data () {
  76. return {
  77. allData: null,
  78. tableData: null,
  79. loading: true,
  80. multipleSelection: [],
  81. currentPage: 1,
  82. totalPages: 1,
  83. totalCount: 1,
  84. pageSize: 20,
  85. tool: tool,
  86. permission: permission,
  87. filterTypes: {
  88. 'USER_NAME': {isUserTable: true, name: '会员编号'},
  89. 'REAL_NAME': {isUserTable: true, name: '会员姓名'},
  90. 'ID_CARD': {isUserTable: true, name: '身份证'},
  91. 'MOBILE': {isUserTable: true, name: '手机号'},
  92. },
  93. filterModel: {},
  94. baseInfo: baseInfo,
  95. }
  96. },
  97. methods: {
  98. handleSelectionChange (val) {
  99. this.multipleSelection = val
  100. },
  101. handleCurrentChange (page) {
  102. this.getData(page, this.pageSize)
  103. },
  104. handleSizeChange (pageSize) {
  105. this.getData(this.currentPage, pageSize)
  106. },
  107. handleAdd () {
  108. this.$router.push({path: `/reconsume/deduct-audit-add`})
  109. },
  110. handleAudit (row, status) {
  111. let title = '确定要通过审核?请输入备注:'
  112. if(status === 'reject'){
  113. title = '确定要拒绝审核?请输入备注:'
  114. }
  115. this.$prompt(title, 'Hint', {
  116. confirmButtonText: 'confirm', // 确定
  117. cancelButtonText: 'cancel', // 取消
  118. //type: 'warning',
  119. inputType: 'textarea',
  120. inputValue:row.CREATE_REMARK,
  121. }).then(({value}) => {
  122. return network.postData(`reconsume/deduct-audit/${row.ID}`, {remark: value, auditStatus: status})
  123. }).then(response => {
  124. this.$message({
  125. message: response,
  126. type: 'success'
  127. })
  128. this.getData(this.currentPage, this.pageSize)
  129. }).catch(response => {
  130. })
  131. },
  132. handleFilterUser(filterData){
  133. filterHelper.handleFilterUser(this, filterData)
  134. },
  135. getData (page, pageSize) {
  136. let filterData = this.filterModel
  137. filterData.filterStatus = this.status != -1 ? `=,${this.status}` : ''
  138. network.getPageData(this, 'reconsume/deduct-audit-list', page, pageSize, filterData)
  139. },
  140. },
  141. }
  142. </script>
  143. <style scoped>
  144. </style>