discountGroup.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="app-container">
  3. <search-form
  4. :list-loading="listLoading"
  5. @change="searchHandle"
  6. />
  7. <table-list
  8. :list-loading="listLoading"
  9. :data="tableData2"
  10. :columns="listConfig"
  11. :current-page="currentPage"
  12. :page-size="pageSize"
  13. :total-records="totalRecords"
  14. @currentChange="pageHandle"
  15. @sizeChange="sizeChange"
  16. />
  17. <dg-join
  18. :isShow="isDJShow"
  19. :curObj="curObj"
  20. @close="closeDJPopup"
  21. />
  22. <dg-status
  23. :isShow="isDSShow"
  24. :curObj="curObj"
  25. @close="closeDSPopup"
  26. />
  27. </div>
  28. </template>
  29. <script>
  30. import { arrToObj } from '@/utils'
  31. import SearchForm from './components/searchForm/DiscountGroup'
  32. import DgJoin from './components/popup/DiscountGroupJoin'
  33. import DgStatus from './components/popup/DiscountGroupStatus'
  34. import baseTable from '_m/baseTable.js'
  35. export default {
  36. name: 'index',
  37. components: {
  38. SearchForm,
  39. DgJoin,
  40. DgStatus,
  41. },
  42. provide() {
  43. return {
  44. parentData: this
  45. }
  46. },
  47. mixins: [baseTable],
  48. data() {
  49. return {
  50. apiStr: 'other.admactivitybuyinglaunchlist',
  51. searchForm: null,
  52. isDtlShow: false,
  53. isPhotoShow: false,
  54. // noCreated: true,
  55. curObj: {},
  56. isTHEShow: false,
  57. isDJShow: false,
  58. isDSShow: false,
  59. }
  60. },
  61. computed: {
  62. tableData2() {
  63. const arr = [...this.tableData]
  64. arr.map(item => {
  65. if (Number(item.status) !== 2) item.noCan = true
  66. })
  67. return arr
  68. }
  69. },
  70. created() {},
  71. mounted() {
  72. this.listConfig = {
  73. rows: [
  74. { label: '楼盘名称', prop: 'estate_name', minWidth: 150, align: 'left' },
  75. { label: '助力人', prop: 'avatar', type: 'img' },
  76. { label: '昵称', prop: 'nickname'},
  77. { label: '状态', prop: 'status', type: 'tag', tags: arrToObj(this.$dictData.buying_status), tagTypeObj: {'1': 'info', '2': 'success', '3': 'danger'} },
  78. { label: '手机号', prop: 'phone' },
  79. { label: 'hash', prop: 'hash' },
  80. { label: '发起时间', prop: 'create_at' },
  81. { label: '操作', width: 200, type: 'handle2', operations:
  82. [
  83. { label: '已助用户', func: this.openDJPopup, btnType: 'success' },
  84. { label: '编辑状态', func: this.openDSPopup, btnType: 'primary' },
  85. // { label: '标记使用', func: this.markUsedHandle, btnType: 'warning', hide: 'noCan' },
  86. ]
  87. }
  88. ]
  89. }
  90. },
  91. methods: {
  92. openDSPopup(row) {
  93. if (row && row.id) {
  94. this.curObj = row
  95. } else {
  96. this.curObj = {}
  97. }
  98. this.isDSShow = true
  99. },
  100. closeDSPopup(obj) {
  101. this.isDSShow = false
  102. if (obj) {
  103. this.fetchData()
  104. }
  105. },
  106. openDJPopup(row) {
  107. if (row && row.id) {
  108. this.curObj = row
  109. } else {
  110. this.curObj = {}
  111. }
  112. this.isDJShow = true
  113. },
  114. closeDJPopup(obj) {
  115. this.isDJShow = false
  116. if (obj) {
  117. this.fetchData()
  118. }
  119. },
  120. markUsedHandle(row) {
  121. this.$msg(`您确定要将此优惠标记为已使用吗?`, 'confirm', () => {
  122. this.$api.other.admactivitybuyinglaunchedit({
  123. id: row.id,
  124. }).then(data => {
  125. this.$msgs(`已标记!`)
  126. this.fetchData()
  127. })
  128. }, null, true)
  129. },
  130. delHandle(row) {
  131. this.$msg(`您确定要删除该楼盘吗?`, 'confirm', () => {
  132. this.$api.house.admestaterecyclepurge({
  133. id: row.id,
  134. }).then(data => {
  135. this.$msgs(`已删除!`)
  136. this.fetchData()
  137. })
  138. }, null, true)
  139. },
  140. }
  141. }
  142. </script>