123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <div>
- <el-drawer
- :show-close="false"
- :title="curObj.id ? '编辑楼盘摇号信息' : '新增楼盘摇号信息'"
- :wrapper-closable="false"
- :close-on-press-escape="false"
- :visible.sync="isShow"
- size="960px"
- custom-class="xl-drawer"
- direction="rtl"
- >
- <table-list
- :list-loading="listLoading"
- :data="tableData2"
- :columns="listConfig"
- :current-page="currentPage"
- :page-size="pageSize"
- :total-records="totalRecords"
- @currentChange="pageHandle"
- :isAdd="true"
- @add="openLEPopup"
- />
- <div class="xl-form">
- <div class="xl-form-footer fixed" style="width:960px;padding-top: 20px;border-top: 1px solid #dcdcdc;right:0;">
- <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
- </div>
- </div>
- </el-drawer>
- <lottery-edit
- :isShow="isLEShow"
- :curObj="cObj"
- @close="closeLEPopup"
- />
- </div>
- </template>
- <script>
- import baseTable from '_m/baseTable.js'
- import LotteryEdit from './LotteryEdit'
- export default {
- components: {
- LotteryEdit
- },
- mixins: [baseTable],
- props: {
- isShow: Boolean,
- curObj: Object
- },
- inject: ['parentData'],
- data() {
- return {
- apiStr: 'house.admestatelottery2list',
- searchForm: {},
- noCreated: true,
- isLEShow: false,
- cObj: {},
- }
- },
- computed: {
- tableData2() {
- const arr = [...this.tableData]
- arr.map(item => {
- })
- return arr
- }
- },
- mounted() {
- this.listConfig = {
- rows: [
- { label: '期数', prop: 'batch'},
- { label: '排序', prop: 'sort' },
- { label: '摇号中标题', prop: 'under_way'},
- { label: '摇号时间', prop: 'lottery_time'},
- { label: '摇号结果标题', prop: 'lottery_res'},
- { label: '操作', width: 120, type: 'handle2', operations:
- [
- { label: '编辑', func: this.openLEPopup, btnType: 'primary' },
- // { label: '删除', func: this.delHandle, btnType: 'danger' },
- ]
- }
- ]
- }
- },
- watch: {
- isShow: function(val) {
- if (val) {
- // this.$api.house.admestatelottery2list({estate_id: this.curObj.estate_id}).then(res => {
- // console.log(res)
- // })
- this.searchForm = {
- estate_id: this.curObj.estate_id
- }
- this.fetchData()
- }
- },
- },
- methods: {
- delHandle(row) {
- this.$msg(`您确定要删除该楼盘吗?`, 'confirm', () => {
- this.$api.house.admestatelottery2del({
- id: row.id,
- }).then(data => {
- this.$msgs(`已删除!`)
- this.fetchData()
- })
- }, null, true)
- },
- openLEPopup(row) {
- let cObj = {
- estate_id: this.curObj.estate_id
- }
- if (row && row.id) {
- this.cObj = {...cObj, ...row}
- } else {
- this.cObj = {...cObj}
- }
- this.isLEShow = true
- },
- closeLEPopup(obj) {
- this.isLEShow = false
- if (obj) {
- this.fetchData()
- }
- },
- close(str) {
- this.$emit('close')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|