clickRecord.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. :isAdd="true"
  16. @add="openPopup"
  17. :operationsDefaultLength="5"
  18. />
  19. <popup-edit
  20. :isShow="isDtlShow"
  21. :curObj="curObj"
  22. @close="closePopup"
  23. />
  24. </div>
  25. </template>
  26. <script>
  27. import { arrToObj } from '@/utils'
  28. import SearchForm from './components/searchForm/ClickRecord'
  29. import PopupEdit from './components/popup/IndexEdit'
  30. import baseTable from '_m/baseTable.js'
  31. export default {
  32. name: 'index',
  33. components: {
  34. SearchForm,
  35. PopupEdit,
  36. },
  37. provide() {
  38. return {
  39. parentData: this
  40. }
  41. },
  42. mixins: [baseTable],
  43. data() {
  44. return {
  45. apiStr: 'house.admcontactclicklist',
  46. searchForm: null,
  47. isDtlShow: false,
  48. // noCreated: true,
  49. curObj: {},
  50. }
  51. },
  52. computed: {
  53. tableData2() {
  54. const arr = [...this.tableData]
  55. arr.map(item => {})
  56. return arr
  57. }
  58. },
  59. created() {},
  60. mounted() {
  61. this.listConfig = {
  62. rows: [
  63. { label: '咨询客户', prop: 'nickname' },
  64. { label: '客户头像', prop: 'avatar', type: 'img' },
  65. { label: '点击类型', prop: 'click_type', type: 'flag', flags: arrToObj(this.$dictData.contact_click_type) },
  66. // { label: '目标类型', prop: 'target_type', type: 'flag', flags: arrToObj(this.$dictData.contact_target_type) },
  67. { label: '联系ID', prop: 'target_id', },
  68. { label: '置业经理', prop: 'sale_name' },
  69. { label: '置业经理头像', prop: 'sale_avatar', type: 'img' },
  70. { label: '创建时间', prop: 'create_at' },
  71. { label: '操作', width: 120, type: 'handle2', operations:
  72. [
  73. { label: '查看咨询房源', func: this.openPopup, btnType: 'primary' },
  74. ]
  75. }
  76. ]
  77. }
  78. },
  79. methods: {
  80. saveHandle (row) {
  81. this.$api.house.admoldhousesortedit({
  82. id: row.id,
  83. sort: row.sort,
  84. }).then(data => {
  85. this.$msgs(`已保存!`)
  86. this.fetchData()
  87. })
  88. },
  89. delHandle(row) {
  90. this.$msg(`您确定要删除该楼盘吗?`, 'confirm', () => {
  91. this.$api.house.admoldhousedel({
  92. id: row.id,
  93. status: 2
  94. }).then(data => {
  95. this.$msgs(`已删除!`)
  96. this.fetchData()
  97. })
  98. }, null, true)
  99. },
  100. openPopup(row) {
  101. this.curObj = {
  102. id: row.target_id
  103. }
  104. this.isDtlShow = true
  105. },
  106. closePopup(obj) {
  107. this.isDtlShow = false
  108. if (obj) {
  109. this.fetchData()
  110. }
  111. }
  112. }
  113. }
  114. </script>