| | |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" |
| | | v-if="permission.houseRental_delete" @click="handleDelete">删 除 |
| | | </el-button> |
| | | |
| | | </template> |
| | | |
| | | <template slot-scope="{row, size}" slot="menu"> |
| | | <!-- <el-button type="text" :size="size" icon="el-icon-edit" v-if="permission.houseRental_edit" |
| | | @click="showEditMoel(row)">编 辑 |
| | | </el-button> --> |
| | | |
| | | |
| | | <el-button :size="size" type="text" icon="el-icon-circle-plus-outline" |
| | | v-if="permission.househould_manager" @click="ManageTenants(row)">管理租户 |
| | | </el-button> |
| | |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="租户管理" append-to-body :visible.sync="roleBox"> |
| | | <avue-crud :option="houseHoldOption" :search.sync="search" :table-loading="loading" :data="houseHold" |
| | | ref="crud" v-model="houseHoldForm" :permission="permissionList" @row-del="houseHoldRowDel" |
| | | @row-update="houseHoldRowUpdate" @row-save="houseHoldRowSave" :page.sync="holdPage" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" |
| | | <avue-crud :option="houseHoldOption" :search.sync="search" :table-loading="loading" |
| | | :data="houseHold" ref="crud" v-model="houseHoldForm" :permission="permissionList" |
| | | @row-del="houseHoldRowDel" @row-update="houseHoldRowUpdate" @row-save="houseHoldRowSave" |
| | | :page.sync="holdPage" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange"></avue-crud> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px"> |
| | | <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
| | | |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <retalInfo ref="RetalInfo"></retalInfo> |
| | | |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import func from "@/util/func" |
| | | import Qs from "qs" |
| | | import website from '@/config/website' |
| | | |
| | | import retalInfo from './components/retalInfo' |
| | | export default { |
| | | data () { |
| | | components: {retalInfo}, |
| | | data() { |
| | | return { |
| | | roleBox: false, |
| | | form: {}, |
| | |
| | | { |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | width:100, |
| | | width: 100, |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | width:160, |
| | | width: 160, |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | minWidth:160, |
| | | overHidden:true, |
| | | minWidth: 160, |
| | | overHidden: true, |
| | | display: false |
| | | }, |
| | | ] |
| | |
| | | selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | // editBtn: false, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | column: [ |
| | |
| | | watch: {}, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList () { |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.houseRental_add, true), |
| | | viewBtn: this.vaildData(this.permission.houseRental_view, true), |
| | |
| | | editBtn: this.vaildData(this.permission.houseRental_edit, true) |
| | | } |
| | | }, |
| | | showConfirmFlag () { |
| | | showConfirmFlag() { |
| | | return (data) => { |
| | | let tags = {} |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | mounted () { }, |
| | | mounted() { }, |
| | | methods: { |
| | | |
| | | ManageTenants (item) { |
| | | ManageTenants(item) { |
| | | this.roleBox = true |
| | | this.rowHouseHold = item |
| | | this.onLoadHouseHold() |
| | | }, |
| | | |
| | | onLoadHouseHold () { |
| | | onLoadHouseHold() { |
| | | let params = { |
| | | housingRentalId: this.rowHouseHold.id, |
| | | } |
| | |
| | | }) |
| | | }, |
| | | |
| | | houseHoldRowSave (row, done, loading) { |
| | | houseHoldRowSave(row, done, loading) { |
| | | row.aoiName = this.rowHouseHold.aoiName |
| | | row.address = this.rowHouseHold.address |
| | | row.housingRentalId = this.rowHouseHold.id |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | rowSave (row, done, loading) { |
| | | rowSave(row, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(",") |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(",") |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | houseHoldRowUpdate (row, index, done, loading) { |
| | | houseHoldRowUpdate(row, index, done, loading) { |
| | | householdUpdate(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoadHouseHold() |
| | |
| | | loading() |
| | | }) |
| | | }, |
| | | houseHoldRowDel (row) { |
| | | houseHoldRowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel (row) { |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset () { |
| | | searchReset() { |
| | | this.query = {} |
| | | this.treeDeptId = '' |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange (params, done) { |
| | | searchChange(params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange (list) { |
| | | selectionChange(list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | selectionClear() { |
| | | this.selectionList = [] |
| | | // this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete () { |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleImport () { |
| | | handleImport() { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter (res, done, loading, column) { |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleExport () { |
| | | handleExport() { |
| | | const account = func.toStr(this.search.account) |
| | | const realName = func.toStr(this.search.realName) |
| | | this.$confirm("是否导出出租信息数据?", "提示", { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | handleTemplate () { |
| | | handleTemplate() { |
| | | exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "出租信息数据模板.xlsx") |
| | | }) |
| | | }, |
| | | beforeOpen (done, type) { |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetatil(this.form.id).then(res => { |
| | | this.form = res.data.data |
| | |
| | | this.initFlag = true |
| | | done() |
| | | }, |
| | | currentChange (currentPage) { |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange (pageSize) { |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange () { |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | onLoad(page, params = {}) { |
| | | this.loading = true |
| | | |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | showEditMoel(item) { |
| | | this.$refs.RetalInfo.initOpen(item.id) |
| | | }, |
| | | } |
| | | } |
| | | </script> |