LotteryList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div>
  3. <el-drawer
  4. :show-close="false"
  5. :title="curObj.id ? '编辑楼盘摇号信息' : '新增楼盘摇号信息'"
  6. :wrapper-closable="false"
  7. :close-on-press-escape="false"
  8. :visible.sync="isShow"
  9. size="960px"
  10. custom-class="xl-drawer"
  11. direction="rtl"
  12. >
  13. <table-list
  14. :list-loading="listLoading"
  15. :data="tableData2"
  16. :columns="listConfig"
  17. :current-page="currentPage"
  18. :page-size="pageSize"
  19. :total-records="totalRecords"
  20. @currentChange="pageHandle"
  21. :isAdd="true"
  22. @add="openLEPopup"
  23. />
  24. <div class="xl-form">
  25. <div class="xl-form-footer fixed" style="width:960px;padding-top: 20px;border-top: 1px solid #dcdcdc;right:0;">
  26. <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
  27. </div>
  28. </div>
  29. </el-drawer>
  30. <lottery-edit
  31. :isShow="isLEShow"
  32. :curObj="cObj"
  33. @close="closeLEPopup"
  34. />
  35. </div>
  36. </template>
  37. <script>
  38. import baseTable from '_m/baseTable.js'
  39. import LotteryEdit from './LotteryEdit'
  40. export default {
  41. components: {
  42. LotteryEdit
  43. },
  44. mixins: [baseTable],
  45. props: {
  46. isShow: Boolean,
  47. curObj: Object
  48. },
  49. inject: ['parentData'],
  50. data() {
  51. return {
  52. apiStr: 'house.admestatelottery2list',
  53. searchForm: {},
  54. noCreated: true,
  55. isLEShow: false,
  56. cObj: {},
  57. }
  58. },
  59. computed: {
  60. tableData2() {
  61. const arr = [...this.tableData]
  62. arr.map(item => {
  63. })
  64. return arr
  65. }
  66. },
  67. mounted() {
  68. this.listConfig = {
  69. rows: [
  70. { label: '期数', prop: 'batch'},
  71. { label: '排序', prop: 'sort' },
  72. { label: '摇号中标题', prop: 'under_way'},
  73. { label: '摇号时间', prop: 'lottery_time'},
  74. { label: '摇号结果标题', prop: 'lottery_res'},
  75. { label: '操作', width: 120, type: 'handle2', operations:
  76. [
  77. { label: '编辑', func: this.openLEPopup, btnType: 'primary' },
  78. // { label: '删除', func: this.delHandle, btnType: 'danger' },
  79. ]
  80. }
  81. ]
  82. }
  83. },
  84. watch: {
  85. isShow: function(val) {
  86. if (val) {
  87. // this.$api.house.admestatelottery2list({estate_id: this.curObj.estate_id}).then(res => {
  88. // console.log(res)
  89. // })
  90. this.searchForm = {
  91. estate_id: this.curObj.estate_id
  92. }
  93. this.fetchData()
  94. }
  95. },
  96. },
  97. methods: {
  98. delHandle(row) {
  99. this.$msg(`您确定要删除该楼盘吗?`, 'confirm', () => {
  100. this.$api.house.admestatelottery2del({
  101. id: row.id,
  102. }).then(data => {
  103. this.$msgs(`已删除!`)
  104. this.fetchData()
  105. })
  106. }, null, true)
  107. },
  108. openLEPopup(row) {
  109. let cObj = {
  110. estate_id: this.curObj.estate_id
  111. }
  112. if (row && row.id) {
  113. this.cObj = {...cObj, ...row}
  114. } else {
  115. this.cObj = {...cObj}
  116. }
  117. this.isLEShow = true
  118. },
  119. closeLEPopup(obj) {
  120. this.isLEShow = false
  121. if (obj) {
  122. this.fetchData()
  123. }
  124. },
  125. close(str) {
  126. this.$emit('close')
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. </style>