price.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. </div>
  25. </template>
  26. <script>
  27. import { arrToObj } from '@/utils'
  28. import SearchForm from './components/searchForm/Price'
  29. import PopupEdit from './components/popup/PriceEdit'
  30. import baseTable from '_m/baseTable.js'
  31. export default {
  32. name: 'price',
  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.admpricelist',
  46. searchForm: {},
  47. isDtlShow: false,
  48. // noCreated: true,
  49. curObj: {},
  50. }
  51. },
  52. computed: {
  53. tableData2() {
  54. const arr = [...this.tableData]
  55. arr.map(item => {
  56. item.floor = `${item.cur_layer}/${item.layer}`
  57. })
  58. return arr
  59. }
  60. },
  61. created() {
  62. const query = this.$route.query
  63. this.searchForm.estate_id = query.id || ''
  64. },
  65. mounted() {
  66. this.listConfig = {
  67. rows: [
  68. { label: '签约日期', prop: 'sign_at'},
  69. { label: '楼层', prop: 'floor'},
  70. { label: '面积(㎡)', prop: 'area'},
  71. { label: '总价(万元)', prop: 'price'},
  72. { label: '单价(元)', prop: 'unit_price'},
  73. { label: '签约中介', prop: 'company'},
  74. { label: '备注', prop: 'remark', fullShow: true},
  75. { label: '更新人', prop: 'update_by' },
  76. { label: '更新时间', prop: 'update_at' },
  77. { label: '操作', width: 120, type: 'handle2', operations:
  78. [
  79. { label: '编辑', func: this.openPopup, btnType: 'primary' },
  80. { label: '删除', func: this.delHandle, btnType: 'danger' },
  81. ]
  82. }
  83. ]
  84. }
  85. },
  86. methods: {
  87. delHandle(row) {
  88. this.$msg(`您确定要删除该楼盘吗?`, 'confirm', () => {
  89. this.$api.house.admpricedel({
  90. id: row.id,
  91. }).then(data => {
  92. this.$msgs(`已删除!`)
  93. this.fetchData()
  94. })
  95. }, null, true)
  96. },
  97. openPopup(row) {
  98. if (row && row.id) {
  99. this.curObj = row
  100. } else {
  101. this.curObj = {}
  102. }
  103. this.isDtlShow = true
  104. },
  105. closePopup(obj) {
  106. this.isDtlShow = false
  107. if (obj) {
  108. this.fetchData()
  109. }
  110. }
  111. }
  112. }
  113. </script>