index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. >
  18. </table-list>
  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/Index'
  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.admlandlist',
  46. searchForm: null,
  47. isDtlShow: false,
  48. curObj: {}
  49. }
  50. },
  51. computed: {
  52. tableData2() {
  53. const arr = [...this.tableData]
  54. arr.map(item => {
  55. })
  56. return arr
  57. }
  58. },
  59. created() {},
  60. mounted() {
  61. this.listConfig = {
  62. rows: [
  63. { label: '土拍图', prop: 'pri_image', type: 'img' },
  64. { label: '地块编号', prop: 'no' },
  65. { label: '区域', prop: 'area_type', type: 'tag', tags: arrToObj(this.$dictData.area_type) },
  66. { label: '竞得单位', prop: 'company' },
  67. { label: '成交日期', prop: 'deal_time' },
  68. { label: '成交价(万元/亩)', prop: 'final_price' },
  69. { label: '成交楼面价(元)', prop: 'floor_price' },
  70. { label: '起拍价(万元/亩)', prop: 'start_total_price' },
  71. { label: '起拍单价(元)', prop: 'start_unit_price' },
  72. { label: '溢价率(%)', prop: 'premium_rate' },
  73. { label: '出让面积(亩)', prop: 'sell_area' },
  74. { label: '建筑面积(㎡)', prop: 'built_area' },
  75. { label: '出让年限(年)', prop: 'sell_ownership' },
  76. { label: '用途', prop: 'purpose' },
  77. { label: '容积率', prop: 'plot_ratio' },
  78. { label: '操作', width: 120, type: 'handle2', operations:
  79. [
  80. { label: '编辑', func: this.openPopup, btnType: 'primary' },
  81. { label: '删除', func: this.delHandle, btnType: 'danger' },
  82. ]
  83. }
  84. ]
  85. }
  86. },
  87. methods: {
  88. delHandle(row) {
  89. this.$msg(`您确定要删除该文章吗?`, 'confirm', () => {
  90. this.$api.house.admlanddel({
  91. id: row.id,
  92. }).then(data => {
  93. this.$msgs(`已删除!`)
  94. this.fetchData()
  95. })
  96. }, null, true)
  97. },
  98. openPopup(row) {
  99. if (row && row.id) {
  100. this.curObj = row
  101. } else {
  102. this.curObj = {}
  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>
  115. <style lang="scss" scoped>
  116. .scoped-link {
  117. color: #2d8cf0;
  118. text-decoration: underline;
  119. }
  120. </style>