123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <template>
- <div class="app-container">
- <search-form
- :list-loading="listLoading"
- @change="searchHandle"
- />
- <table-list
- :list-loading="listLoading"
- :data="tableData2"
- :columns="listConfig"
- :current-page="currentPage"
- :page-size="pageSize"
- :total-records="totalRecords"
- @currentChange="pageHandle"
- @sizeChange="sizeChange"
- :operationsDefaultLength="5"
- />
- <popup-edit
- :isShow="isDtlShow"
- :curObj="curObj"
- @close="closePopup"
- />
- </div>
- </template>
- <script>
- import { arrToObj } from '@/utils'
- import SearchForm from './components/searchForm/Index'
- import PopupEdit from './components/popup/IndexEdit'
- import baseTable from '_m/baseTable.js'
- export default {
- name: 'Index',
- components: {
- SearchForm,
- PopupEdit,
- },
- provide() {
- return {
- parentData: this
- }
- },
- mixins: [baseTable],
- data() {
- return {
- apiStr: 'house.admeshouselist',
- searchForm: null,
- isDtlShow: false,
- // noCreated: true,
- curObj: {},
- }
- },
- computed: {
- tableData2() {
- const arr = [...this.tableData]
- arr.map(item => {
- item.pri_image = this.IMadd(item.pri_image)
- })
- return arr
- }
- },
- created() {},
- mounted() {
- this.listConfig = {
- rows: [
- // { label: '排序', prop: 'sort', type: 'input', width: 80},
- { label: '编号', prop: 'id' },
- { label: '楼盘', prop: 'estate_name' },
- { label: '楼盘', prop: 'house_no' },
- // { label: '浏览数', prop: 'view_count' },
- // { label: '置业经理', prop: 'sale_name' },
- { label: '标题', prop: 'title', minWidth: 200, fullShow: true },
- { label: '主图', prop: 'pri_image', type: 'img' },
- { label: '总价', prop: 'price' },
- { label: '面积㎡', prop: 'area' },
- { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) },
- { label: '状态', prop: 'hide_status', type: 'tag', tags: arrToObj(this.$dictData.hide_status), tagTypeObj: {'1': 'success', '2': 'danger'} },
- { label: '已售', prop: 'is_sold', type: 'tag', tags: arrToObj(this.$dictData.sys_yesno), tagTypeObj: {'1': 'success', '2': 'danger'} },
- { label: '售出', prop: 'sold_platform' },
- { label: '更新时间', prop: 'update_at' },
- { label: '创建人', prop: 'sale_name' },
- { label: '创建时间', prop: 'create_at' },
- { label: '操作', width: 220, type: 'handle2', operations:
- [
- { label: '编辑', func: this.openPopup, btnType: 'primary' },
- { label: '删除', func: this.delHandle, btnType: 'danger' },
- { labelFor: 'hide_status', disabled: true, func: this.statusHandle, hide: 'nosys',
- labelConfig: {
- texts: {
- 1: '隐藏',
- 2: '显示'
- },
- btnTypes: {
- 1: 'danger',
- 2: 'success'
- }
- }
- },
- ]
- }
- ]
- }
- },
- methods: {
- statusHandle (row) {
- const hide_status = Number(row.hide_status) === 1 ? 2 : 1
- const msgText = Number(row.hide_status) === 1 ? '隐藏' : '显示'
- this.$msg(`确定要${msgText}该房源吗?`, 'confirm', ()=> {
- this.$api.house.admeshouseshow({
- id: row.id,
- hide_status
- }).then(data => {
- this.$msgs(`${msgText}成功!`)
- this.fetchData()
- })
- }, null, true)
- },
- // saveHandle (row) {
- // this.$api.house.admoldhousesortedit({
- // id: row.id,
- // sort: row.sort,
- // }).then(data => {
- // this.$msgs(`已保存!`)
- // this.fetchData()
- // })
- // },
- delHandle(row) {
- this.$msg(`您确定要删除该房源吗?`, 'confirm', () => {
- this.$api.house.admeshousedel({
- id: row.id,
- }).then(data => {
- this.$msgs(`已删除!`)
- this.fetchData()
- })
- }, null, true)
- },
- openPopup(row) {
- if (row && row.id) {
- this.curObj = row
- } else {
- this.curObj = {}
- }
- this.isDtlShow = true
- },
- closePopup(obj) {
- this.isDtlShow = false
- if (obj) {
- this.fetchData()
- }
- }
- }
- }
- </script>
|