trend.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. :isAdd="true"
  17. @add="openPopup"
  18. />
  19. <popup-edit
  20. :isShow="isDtlShow"
  21. :curObj="curObj"
  22. @close="closePopup"
  23. />
  24. <popup-update
  25. :isShow="isUpdateShow"
  26. :curObj="curObj"
  27. @close="closeUpdatePopup"
  28. />
  29. <popup-record
  30. :isShow="isQShow"
  31. :curObj="curObj"
  32. @close="closeQPopup"
  33. />
  34. </div>
  35. </template>
  36. <script>
  37. import { arrToObj } from '@/utils'
  38. import SearchForm from './components/searchForm/Trend'
  39. import PopupEdit from './components/popup/TrendEdit'
  40. import PopupUpdate from './components/popup/TrendUpdate'
  41. import PopupRecord from './components/popup/TrendRecord'
  42. import baseTable from '_m/baseTable.js'
  43. export default {
  44. name: 'index',
  45. components: {
  46. SearchForm,
  47. PopupEdit,
  48. PopupUpdate,
  49. PopupRecord,
  50. },
  51. provide() {
  52. return {
  53. parentData: this
  54. }
  55. },
  56. mixins: [baseTable],
  57. data() {
  58. return {
  59. apiStr: 'house.admestatehousedynamiclist',
  60. searchForm: null,
  61. isDtlShow: false,
  62. curObj: {},
  63. isUpdateShow: false,
  64. isQShow: false,
  65. }
  66. },
  67. computed: {
  68. tableData2() {
  69. const arr = [...this.tableData,]
  70. arr.map(item => {})
  71. return arr
  72. }
  73. },
  74. created() {},
  75. mounted() {
  76. this.listConfig = {
  77. rows: [
  78. // minWidth: 150, align: 'left'
  79. { label: '更新时间', prop: 'update_re' },
  80. { label: '楼盘名称', prop: 'estate_name' },
  81. { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) },
  82. { label: '产品类型', prop: 'product_type', type: 'flag', flags: arrToObj(this.$dictData.product_type) },
  83. { label: '户型面积', prop: 'house_square' },
  84. { label: '起价', prop: 'price_min' },
  85. { label: '封顶价', prop: 'price_max' },
  86. { label: '现场折扣', prop: 'scene_discount' },
  87. { label: '实际折扣', prop: 'actual_discount' },
  88. { label: '最新动态', prop: 'dynamic' },
  89. { label: '更新人', prop: 'update_by' },
  90. { label: '操作', width: 220, type: 'handle2', operations:
  91. [
  92. { label: '去更新', func: this.openUpdatePopup, btnType: 'success' },
  93. { label: '更新记录', func: this.openQPopup, btnType: 'primary' },
  94. { label: '编辑', func: this.openPopup, btnType: 'primary' },
  95. { label: '删除', func: this.delHandle, btnType: 'danger' },
  96. ]
  97. }
  98. ]
  99. }
  100. },
  101. methods: {
  102. delHandle(row) {
  103. this.$msg(`您确定要删除该动态数据吗?`, 'confirm', () => {
  104. this.$api.house.admestatehousedynamicdel({
  105. id: row.id,
  106. }).then(data => {
  107. this.$msgs(`已删除!`)
  108. this.fetchData()
  109. })
  110. }, null, true)
  111. },
  112. openQPopup (row) {
  113. if (row && row.id) {
  114. this.curObj = row
  115. } else {
  116. this.curObj = {}
  117. }
  118. this.isQShow = true
  119. },
  120. closeQPopup (obj) {
  121. this.isQShow = false
  122. if (obj) {
  123. this.fetchData()
  124. }
  125. },
  126. openPopup(row) {
  127. if (row && row.id) {
  128. this.curObj = row
  129. } else {
  130. this.curObj = {}
  131. }
  132. this.isDtlShow = true
  133. },
  134. closePopup(obj) {
  135. this.isDtlShow = false
  136. if (obj) {
  137. this.fetchData()
  138. }
  139. },
  140. openUpdatePopup(row) {
  141. if (row && row.id) {
  142. this.curObj = row
  143. } else {
  144. this.curObj = {}
  145. }
  146. this.isUpdateShow = true
  147. },
  148. closeUpdatePopup(obj) {
  149. this.isUpdateShow = false
  150. if (obj) {
  151. this.fetchData()
  152. }
  153. }
  154. }
  155. }
  156. </script>