| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2024-01-04 15:18:13 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2024-01-04 17:13:22 |
| | | * @LastEditTime: 2024-01-05 17:23:39 |
| | | * @FilePath: \jczz_web\src\views\article\components\deitDiscussion.vue |
| | | * @Description: |
| | | * |
| | |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | label: '小区', |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | label: '小区', |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | |
| | | <template> |
| | | <basicContainer> |
| | | <avue-crud :data="data" ref="crud" :table-loading="loading" @current-change="currentChange" |
| | | @search-change="searchChange" @search-reset="searchReset" @size-change="sizeChange" :option="option" |
| | | v-model="data" :page="page" @selection-change="selectionChange" @row-del="rowDel" @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <!-- <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 除 |
| | | <basicContainer> |
| | | <avue-crud :data="data" ref="crud" :table-loading="loading" @current-change="currentChange" |
| | | @search-change="searchChange" @search-reset="searchReset" @size-change="sizeChange" :option="option" |
| | | v-model="data" :page="page" @selection-change="selectionChange" @row-del="rowDel" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <!-- <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 除 |
| | | </el-button> --> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete" |
| | | @click="handleDelete">批量删除 |
| | | </el-button> |
| | | </template> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete" |
| | | @click="handleDelete">批量删除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-s-custom" size="small" @click.stop="openDilog(scope.row,0)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="primary" icon="el-icon-s-custom" size="small" @click.stop="openUser(scope.row,0)"> |
| | | 参与用户 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-s-custom" size="small" @click.stop="openDilog(scope.row, 0)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="primary" icon="el-icon-s-custom" size="small" @click.stop="openUser(scope.row, 0)"> |
| | | 参与用户 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose"> |
| | | <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm"> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisibles" width="50%" :before-close="handleClose"> |
| | | <avue-form @submit="handleSubmit" :option="optionEnroll" v-model="discussForm"> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="50%" :before-close="userHandleClose"> |
| | | <!-- <span slot="title" class="dialog-footer"> |
| | | <el-dialog title="" append-to-body :visible.sync="dialogVisiblesUser" width="50%" :before-close="userHandleClose"> |
| | | <!-- <span slot="title" class="dialog-footer"> |
| | | {{discussForm.ontitle}} |
| | | </span> --> |
| | | <avue-crud :data="dataUser" :page="pageUser" :option="option1" @on-load="getUser"></avue-crud> |
| | | </el-dialog> |
| | | <avue-crud :data="dataUser" :page="pageUser" :option="option1" @on-load="getUser"></avue-crud> |
| | | </el-dialog> |
| | | |
| | | |
| | | </basicContainer> |
| | | </basicContainer> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | import { |
| | | getListPd, |
| | | getDetailPd, |
| | | addPd, |
| | | updatePd, |
| | | removePd, |
| | | } from "@/api/discuss/publicDiscuss"; |
| | | import { |
| | | } from "@/api/discuss/publicDiscuss" |
| | | import { |
| | | getPageUser, |
| | | } from "@/api/discuss/userPublicEnroll"; |
| | | import option from "@/option/discuss/publicDiscuss"; |
| | | import { |
| | | } from "@/api/discuss/userPublicEnroll" |
| | | import option from "@/option/discuss/publicDiscuss" |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | import { |
| | | } from "vuex" |
| | | import { |
| | | getDictionary |
| | | } from '@/api/system/dict' |
| | | } from '@/api/system/dict' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | option1: { |
| | | menu: false, |
| | | addBtn: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name' |
| | | }, { |
| | | label: '头像', |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | label: '小区', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | discussForm: { |
| | | ontitle: '', |
| | | title: '', |
| | | openFlag: 0, |
| | | numberRestrictions: 0, |
| | | voteRestrictions: 0, |
| | | userRestrictions: 0, |
| | | endTime: '', |
| | | articleId: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | repeatVote: 0, |
| | | voteNumberPublic: 0, |
| | | appointUser: '', |
| | | userIds: '', |
| | | eventType: 1, |
| | | }, |
| | | optionEnroll: { |
| | | column: [{ |
| | | label: "", |
| | | type: 'title', |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | offset: 2, |
| | | styles: { |
| | | fontSize: '24px' |
| | | } |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '开启', |
| | | prop: 'openFlag', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | | }, { |
| | | label: '不开启', |
| | | value: 1 |
| | | }] |
| | | export default { |
| | | data () { |
| | | return { |
| | | option1: { |
| | | menu: false, |
| | | addBtn: false, |
| | | column: [{ |
| | | label: '姓名', |
| | | prop: 'name' |
| | | }, { |
| | | label: '头像', |
| | | prop: 'avatar' |
| | | }, { |
| | | label: '手机', |
| | | prop: 'phone' |
| | | }, { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: 'aoiName' |
| | | }, { |
| | | label: '地址', |
| | | prop: 'addressName' |
| | | }, { |
| | | label: '时间', |
| | | prop: 'createTime' |
| | | }] |
| | | }, |
| | | { |
| | | labelWidth: 100, |
| | | label: '开启投票', |
| | | prop: 'openFlag', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | | }, { |
| | | label: '不开启', |
| | | value: 1 |
| | | }] |
| | | discussForm: { |
| | | ontitle: '', |
| | | title: '', |
| | | openFlag: 0, |
| | | numberRestrictions: 0, |
| | | voteRestrictions: 0, |
| | | userRestrictions: 0, |
| | | endTime: '', |
| | | articleId: '', |
| | | createTime: '', |
| | | updateTime: '', |
| | | deleteFlag: '', |
| | | repeatVote: 0, |
| | | voteNumberPublic: 0, |
| | | appointUser: '', |
| | | userIds: '', |
| | | eventType: 1, |
| | | }, |
| | | { |
| | | label: "截止时间", |
| | | row: true, |
| | | offset: 6, |
| | | prop: "endTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "timestamp", |
| | | optionEnroll: { |
| | | column: [{ |
| | | label: "", |
| | | type: 'title', |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | offset: 2, |
| | | styles: { |
| | | fontSize: '24px' |
| | | } |
| | | }, { |
| | | labelWidth: 100, |
| | | label: '开启', |
| | | prop: 'openFlag', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | | }, { |
| | | label: '不开启', |
| | | value: 1 |
| | | }] |
| | | }, |
| | | { |
| | | labelWidth: 100, |
| | | label: '开启投票', |
| | | prop: 'openFlag', |
| | | type: 'radio', |
| | | button: true, |
| | | row: true, |
| | | offset: 6, |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | | }, { |
| | | label: '不开启', |
| | | value: 1 |
| | | }] |
| | | }, |
| | | { |
| | | label: "截止时间", |
| | | row: true, |
| | | offset: 6, |
| | | prop: "endTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "timestamp", |
| | | }, |
| | | ] |
| | | }, |
| | | ] |
| | | }, |
| | | dialogVisibles: false, |
| | | dialogVisiblesUser: false, |
| | | // 弹框标题 |
| | | title: '', |
| | | // 是否展示弹框 |
| | | box: false, |
| | | // 是否显示查询 |
| | | search: true, |
| | | // 加载中 |
| | | loading: true, |
| | | // 是否为查看模式 |
| | | view: false, |
| | | // 查询信息 |
| | | query: {}, |
| | | // 分页信息 |
| | | page: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | dialogVisibles: false, |
| | | dialogVisiblesUser: false, |
| | | // 弹框标题 |
| | | title: '', |
| | | // 是否展示弹框 |
| | | box: false, |
| | | // 是否显示查询 |
| | | search: true, |
| | | // 加载中 |
| | | loading: true, |
| | | // 是否为查看模式 |
| | | view: false, |
| | | // 查询信息 |
| | | query: {}, |
| | | // 分页信息 |
| | | page: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | |
| | | // 分页信息 |
| | | pageUser: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | // 表单数据 |
| | | form: {}, |
| | | // 选择行 |
| | | selectionList: [], |
| | | // 表单配置 |
| | | option: { |
| | | selection: true, |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | align: 'center', |
| | | menuAlign: 'center', |
| | | addBtn: false, |
| | | editBtn: false, |
| | | searchMenuSpan: 3, |
| | | searchBtn: true, |
| | | menuWidth: 500, |
| | | column: [{ |
| | | label: 'ID', |
| | | prop: 'id', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | // 分页信息 |
| | | pageUser: { |
| | | pageSize: 10, |
| | | pageSizes: [10, 20, 30, 50, 100], |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | { |
| | | label: '标题', |
| | | prop: 'title', |
| | | searchSpan: 4, |
| | | search: true, |
| | | // 表单数据 |
| | | form: {}, |
| | | // 选择行 |
| | | selectionList: [], |
| | | // 表单配置 |
| | | option: { |
| | | selection: true, |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | align: 'center', |
| | | menuAlign: 'center', |
| | | addBtn: false, |
| | | editBtn: false, |
| | | searchMenuSpan: 3, |
| | | searchBtn: true, |
| | | menuWidth: 500, |
| | | column: [{ |
| | | label: 'ID', |
| | | prop: 'id', |
| | | searchSpan: 4, |
| | | // search: true, |
| | | }, |
| | | { |
| | | label: '标题', |
| | | prop: 'title', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '参与人数', |
| | | prop: 'enrollCount', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '截止时间', |
| | | prop: 'endTime', |
| | | searchSpan: 4, |
| | | search: true, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '参与人数', |
| | | prop: 'enrollCount', |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '截止时间', |
| | | prop: 'endTime', |
| | | searchSpan: 4, |
| | | search: true, |
| | | } |
| | | ] |
| | | }, |
| | | // 表单列表 |
| | | data: [], |
| | | dataUser: [], |
| | | } |
| | | // 表单列表 |
| | | data: [], |
| | | dataUser: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.init(); |
| | | // this.onLoad(this.page); |
| | | mounted () { |
| | | // this.init(); |
| | | // this.onLoad(this.page); |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | ...mapGetters(["permission"]), |
| | | ids () { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | init(data) { |
| | | this.houseCode = data.houseCode |
| | | this.onLoad(this.page) |
| | | }, |
| | | getUser(page, params = {}) { |
| | | getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageUser.total = data.total; |
| | | this.dataUser = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | userHandleClose() { |
| | | this.dialogVisiblesUser = false |
| | | }, |
| | | openUser(row) { |
| | | this.dialogVisiblesUser = true |
| | | this.getUser(this.pageUser, params = {}) |
| | | }, |
| | | openDilog(row, type) { |
| | | this.dialogVisibles = true |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime(); |
| | | this.discussForm.endTime = times |
| | | console.table(this.discussForm) |
| | | if (type == 0) { |
| | | this.discussForm.ontitle = '公益报名' |
| | | } else { |
| | | this.discussForm.ontitle = '创建议题' |
| | | } |
| | | }, |
| | | init (data) { |
| | | this.houseCode = data.houseCode |
| | | this.onLoad(this.page) |
| | | }, |
| | | getUser (page, params = {}) { |
| | | getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.pageUser.total = data.total |
| | | this.dataUser = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | userHandleClose () { |
| | | this.dialogVisiblesUser = false |
| | | }, |
| | | openUser (row) { |
| | | this.dialogVisiblesUser = true |
| | | this.getUser(this.pageUser, params = {}) |
| | | }, |
| | | openDilog (row, type) { |
| | | this.dialogVisibles = true |
| | | this.discussForm = row |
| | | let times = new Date(row.endTime).getTime() |
| | | this.discussForm.endTime = times |
| | | console.table(this.discussForm) |
| | | if (type == 0) { |
| | | this.discussForm.ontitle = '公益报名' |
| | | } else { |
| | | this.discussForm.ontitle = '创建议题' |
| | | } |
| | | }, |
| | | |
| | | searchHide() { |
| | | this.search = !this.search; |
| | | }, |
| | | searchChange() { |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | handleSubmit(form, done) { |
| | | done() |
| | | if (!this.discussForm.id) { |
| | | addPd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | } else { |
| | | updatePd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | searchHide () { |
| | | this.search = !this.search |
| | | }, |
| | | searchChange () { |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page) |
| | | }, |
| | | handleSubmit (form, done) { |
| | | done() |
| | | if (!this.discussForm.id) { |
| | | addPd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } else { |
| | | updatePd(this.discussForm).then(() => { |
| | | this.dialogVisibles = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | handleAdd () { |
| | | this.title = '新增' |
| | | this.form = {} |
| | | this.box = true |
| | | }, |
| | | handleEdit (row) { |
| | | this.title = '编辑' |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleView (row) { |
| | | this.title = '查看' |
| | | this.view = true |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removePd(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.selectionClear() |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | beforeClose (done) { |
| | | done() |
| | | this.form = {} |
| | | this.view = false |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | // this.$refs.table.clearSelection(); |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | this.onLoad(this.page) |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | this.onLoad(this.page) |
| | | }, |
| | | onLoad (page, params = { |
| | | eventType: 0 |
| | | }) { |
| | | this.loading = true |
| | | getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | }, |
| | | handleAdd() { |
| | | this.title = '新增' |
| | | this.form = {} |
| | | this.box = true |
| | | }, |
| | | handleEdit(row) { |
| | | this.title = '编辑' |
| | | this.box = true |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | }, |
| | | handleView(row) { |
| | | this.title = '查看' |
| | | this.view = true; |
| | | this.box = true; |
| | | getDetailPd(row.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removePd(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.selectionClear(); |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | beforeClose(done) { |
| | | done() |
| | | this.form = {}; |
| | | this.view = false; |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | // this.$refs.table.clearSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.onLoad(this.page); |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.onLoad(this.page); |
| | | }, |
| | | onLoad(page, params = { |
| | | eventType: 0 |
| | | }) { |
| | | this.loading = true; |
| | | getListPd(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-pagination { |
| | | .el-pagination { |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | labelWidth: 120, |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: "社区名称", |
| | | prop: "name", |
| | | searchSpan: 5, |
| | | search: true, |
| | | span: 12, |
| | | labelWidth: 120, |
| | | width: 220, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ], |
| | | }, |
| | | { |
| | | width: 110, |
| | | overHidden: true, |
| | | label: "社区编号", |
| | | prop: "code", |
| | | searchSpan: 5, |
| | | search: true, |
| | | span: 12, |
| | | labelWidth: 120, |
| | | width: 220, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 110, |
| | | parent: false, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | width: 96, |
| | | label: "所属街道", |
| | | prop: "townName", |
| | | search: true, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 110, |
| | | hide: true, |
| | | parent: false, |
| | | label: "所属街道", |
| | | prop: "streetCode", |
| | | width: 150, |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/getTownTree", |
| | | props: { |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 110, |
| | | label: "社区民警", |
| | | prop: "resPoliceUserId", |
| | | labelWidth: 120, |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/user/getUserListByParam?roleName=民警", |
| | | props: { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: "社区图片", |
| | | prop: "picUrl", |
| | | width: 80, |
| | | labelWidth: 120, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | |
| | | }, |
| | | |
| | | { |
| | | overHidden: true, |
| | | label: "地址", |
| | | prop: "address", |
| | | span: 24, |
| | | labelWidth: 120, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | |
| | | { |
| | | label: "社区简介", |
| | | prop: "remark", |
| | | labelWidth: 120, |
| | | component: "AvueUeditor", |
| | | options: { |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | labelWidth: 120, |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "小区名称", |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | span: 12, |
| | | labelWidth: 120, |
| | | width: 220, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | |
| | | |
| | | { |
| | | width: 110, |
| | | overHidden: true, |
| | | parent: false, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | width: 96, |
| | | label: "所属街道", |
| | | prop: "townStreetName", |
| | | search: true, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 156, |
| | | overHidden: true, |
| | | parent: false, |
| | | label: "所属社区", |
| | | prop: "communityCode", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchType: 'input', |
| | | width: 150, |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/tree", |
| | | props: { |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 110, |
| | | overHidden: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | width: 96, |
| | | label: "所属网格", |
| | | prop: "gridName", |
| | | }, |
| | | |
| | | { |
| | | width: 110, |
| | | label: "小区图片", |
| | | prop: "picUrl", |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | |
| | | label: "地址", |
| | | prop: "address", |
| | | span: 24, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | message: "请输入手机号", |
| | | trigger: "blur", |
| | | },], |
| | | }, { |
| | | }, |
| | | { |
| | | label: "小区", |
| | | prop: "areaId", |
| | | searchSpan: 5, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | label: "小区", |
| | | prop: "areaName" |
| | | }, |
| | | |
| | |
| | | search: true |
| | | }, |
| | | { |
| | | label: "小区名称", |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "areaName", |
| | | search: true |
| | | }, |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | width: 160, |
| | | label: "小区名称", |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | |
| | | { |
| | | hide: true, |
| | | parent: false, |
| | | label: "小区名称", |
| | | label: "小区", |
| | | prop: "districtId", |
| | | search: false, |
| | | type: 'tree', |
| | |
| | | width: 260, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择小区名称", |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | width: 160, |
| | | label: "小区名称", |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | |
| | | { |
| | | hide: true, |
| | | parent: false, |
| | | label: "小区名称", |
| | | label: "小区", |
| | | prop: "districtId", |
| | | search: false, |
| | | type: 'tree', |
| | |
| | | width: 260, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择小区名称", |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 142, |
| | | label: "小区", |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "aoiName", |
| | | display: false |
| | | }, |
| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <basic-container> |
| | | <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" |
| | | v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave" |
| | | :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.houseRental_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <basic-container> |
| | | <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" |
| | | v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" |
| | | @row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" |
| | | @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" |
| | | v-if="permission.houseRental_delete" @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-circle-plus-outline" size="small" v-if="permission.househould_manager" |
| | | @click="ManageTenants(scope.row)">管理租户 |
| | | </el-button> |
| | | <!-- <el-button type="success" size="small" plain icon="el-icon-upload2" @click="handleImport">导入 |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" icon="el-icon-circle-plus-outline" size="small" |
| | | v-if="permission.househould_manager" @click="ManageTenants(scope.row)">管理租户 |
| | | </el-button> |
| | | <!-- <el-button type="success" size="small" plain icon="el-icon-upload2" @click="handleImport">导入 |
| | | </el-button> |
| | | <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出 |
| | | </el-button> --> |
| | | </template> |
| | | <template slot-scope="{row}" slot="tenantName"> |
| | | <el-tag>{{ row.tenantName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="roleName"> |
| | | <el-tag>{{ row.roleName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="deptName"> |
| | | <el-tag>{{ row.deptName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="userTypeName"> |
| | | <el-tag>{{ row.userTypeName }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | </template> |
| | | <template slot-scope="{row}" slot="tenantName"> |
| | | <el-tag>{{ row.tenantName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="roleName"> |
| | | <el-tag>{{ row.roleName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="deptName"> |
| | | <el-tag>{{ row.deptName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" slot="userTypeName"> |
| | | <el-tag>{{ row.userTypeName }}</el-tag> |
| | | </template> |
| | | </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" @refresh-change="refreshChange"></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" |
| | | @refresh-change="refreshChange"></avue-crud> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="roleBox = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitRole">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="roleBox = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitRole">确 定</el-button> |
| | | </span> |
| | | </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> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | <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> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | import { |
| | | getList as getHouseholdList, |
| | | remove as householdDel, |
| | | add as householdAdd, |
| | | update as householdUpdate, |
| | | getDetatil as getHouseholdDetatil |
| | | } from "@/api/userHouse/list/houseHold.js"; |
| | | import { |
| | | } from "@/api/userHouse/list/houseHold.js" |
| | | import { |
| | | getList, |
| | | getPageList, |
| | | remove, |
| | | add, |
| | | update, |
| | | getDetatil |
| | | } from "@/api/userHouse/list/houseRental.js"; |
| | | import { |
| | | } from "@/api/userHouse/list/houseRental.js" |
| | | import { |
| | | getList as getHouseList, |
| | | getDetatil as getHouseDetail |
| | | } from "@/api/userHouse/list/house.js"; |
| | | import { |
| | | } from "@/api/userHouse/list/house.js" |
| | | import { |
| | | exportBlob |
| | | } from "@/api/common"; |
| | | import { |
| | | } from "@/api/common" |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | import { |
| | | } from "vuex" |
| | | import { |
| | | getToken |
| | | } from '@/util/auth'; |
| | | import { |
| | | } from '@/util/auth' |
| | | import { |
| | | downloadXls |
| | | } from "@/util/util"; |
| | | import { |
| | | } from "@/util/util" |
| | | import { |
| | | dateNow |
| | | } from "@/util/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import func from "@/util/func"; |
| | | import Qs from "qs"; |
| | | import website from '@/config/website'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | roleBox: false, |
| | | form: {}, |
| | | search: {}, |
| | | excelBox: false, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | rowHouseHold: {}, |
| | | houseHoldForm: { |
| | | relationship: 18, |
| | | roleType: 2, |
| | | }, |
| | | houseHold: [], |
| | | holdPage: { |
| | | pageSize: 100, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | houseHoldOption: { |
| | | height: 'auto', |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | // selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: "姓名", |
| | | prop: "name", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "性别", |
| | | prop: "gender", |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "男", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "女", |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: "未知", |
| | | value: 1 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "relationship", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleRelation", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "小区", |
| | | prop: "aoiName", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | display: false |
| | | }, |
| | | ] |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | menuWidth: 280, |
| | | column: [{ |
| | | label: "房屋", |
| | | prop: "address", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "房屋", |
| | | prop: "houseCode", |
| | | hide: true, |
| | | type: "table", |
| | | children: { |
| | | border: true, |
| | | height: 400, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | submitText: "确定", |
| | | column: [{ |
| | | label: "小区", |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, { |
| | | label: "地址", |
| | | prop: "address", |
| | | width: 180, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "手机", |
| | | prop: "phone", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入绑定手机", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | ], |
| | | }, |
| | | page: { |
| | | } from "@/util/date" |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | import func from "@/util/func" |
| | | import Qs from "qs" |
| | | import website from '@/config/website' |
| | | export default { |
| | | data () { |
| | | return { |
| | | roleBox: false, |
| | | form: {}, |
| | | search: {}, |
| | | excelBox: false, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | formatter: (row) => { |
| | | console.log(row, 888) |
| | | if (!row.districtName) return '' |
| | | return row.districtName + '-' + row.unit + row.building + row.room |
| | | }, |
| | | onLoad: ({ |
| | | page, |
| | | value, |
| | | data |
| | | }, callback) => { |
| | | //首次加载去查询对应的值 |
| | | if (value) { |
| | | getHouseDetail({ |
| | | houseCode: value |
| | | }).then(res => { |
| | | var resData = res.data.data; |
| | | // 查询对应行数据 |
| | | callback(resData) |
| | | return |
| | | }); |
| | | } |
| | | if (page) { |
| | | this.loading = true; |
| | | getHouseList(page.currentPage, page.pageSize, Object.assign(data)).then(res => { |
| | | const resData = res.data.data; |
| | | var total = resData.total; |
| | | var data = resData.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | //分页查询信息 |
| | | callback({ |
| | | total: total, |
| | | data: data |
| | | }) |
| | | }); |
| | | } |
| | | }, |
| | | props: { |
| | | label: 'address', |
| | | value: 'houseCode' |
| | | } |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "tenantRelationship", |
| | | search: true, |
| | | searchSpan: 4, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "同一户", |
| | | value: 1 |
| | | rowHouseHold: {}, |
| | | houseHoldForm: { |
| | | relationship: 18, |
| | | roleType: 2, |
| | | }, |
| | | houseHold: [], |
| | | holdPage: { |
| | | pageSize: 100, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | houseHoldOption: { |
| | | height: 'auto', |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | // selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: "姓名", |
| | | prop: "name", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "不同一户", |
| | | value: 2 |
| | | } |
| | | ], |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择关系", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | label: "房屋状态", |
| | | prop: "houseStatus", |
| | | search: true, |
| | | searchSpan: 4, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "部分出租", |
| | | value: 1 |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "全部出租", |
| | | value: 2 |
| | | } |
| | | ], |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择房屋状态", |
| | | trigger: "blur", |
| | | }, ], |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "性别", |
| | | prop: "gender", |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "男", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "女", |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: "未知", |
| | | value: 1 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "relationship", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleRelation", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | display: false |
| | | }, |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "aoiName", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | display: false |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | label: "用途", |
| | | prop: "rentalUse", |
| | | type: "select", |
| | | search: true, |
| | | searchSpan: 3, |
| | | dataType: "number", |
| | | width: 100, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=rentalUseType", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择用途", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | label: "租房时间", |
| | | prop: "rentalTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择租房时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | label: "到期时间", |
| | | prop: "dueTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择到期时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | menuWidth: 280, |
| | | column: [{ |
| | | label: "房屋", |
| | | prop: "address", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "房屋", |
| | | prop: "houseCode", |
| | | hide: true, |
| | | type: "table", |
| | | children: { |
| | | border: true, |
| | | height: 400, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | submitText: "确定", |
| | | column: [ |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "districtName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区名称", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | width: 180, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "手机", |
| | | prop: "phone", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入绑定手机", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | ], |
| | | }, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | formatter: (row) => { |
| | | console.log(row, 888) |
| | | if (!row.districtName) return '' |
| | | return row.districtName + '-' + row.unit + row.building + row.room |
| | | }, |
| | | onLoad: ({ |
| | | page, |
| | | value, |
| | | data |
| | | }, callback) => { |
| | | //首次加载去查询对应的值 |
| | | if (value) { |
| | | getHouseDetail({ |
| | | houseCode: value |
| | | }).then(res => { |
| | | var resData = res.data.data |
| | | // 查询对应行数据 |
| | | callback(resData) |
| | | return |
| | | }) |
| | | } |
| | | if (page) { |
| | | this.loading = true |
| | | getHouseList(page.currentPage, page.pageSize, Object.assign(data)).then(res => { |
| | | const resData = res.data.data |
| | | var total = resData.total |
| | | var data = resData.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | //分页查询信息 |
| | | callback({ |
| | | total: total, |
| | | data: data |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | props: { |
| | | label: 'address', |
| | | value: 'houseCode' |
| | | } |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "tenantRelationship", |
| | | search: true, |
| | | searchSpan: 4, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "同一户", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "不同一户", |
| | | value: 2 |
| | | } |
| | | ], |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择关系", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | label: "房屋状态", |
| | | prop: "houseStatus", |
| | | search: true, |
| | | searchSpan: 4, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "部分出租", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "全部出租", |
| | | value: 2 |
| | | } |
| | | ], |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择房屋状态", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | label: "用途", |
| | | prop: "rentalUse", |
| | | type: "select", |
| | | search: true, |
| | | searchSpan: 3, |
| | | dataType: "number", |
| | | width: 100, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=rentalUseType", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择用途", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | label: "租房时间", |
| | | prop: "rentalTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择租房时间", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | label: "到期时间", |
| | | prop: "dueTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择到期时间", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | |
| | | { |
| | | label: "租赁期限", |
| | | prop: "dldType", |
| | | width: 100, |
| | | display: false, |
| | | search: true, |
| | | searchSpan: 3, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "长期", |
| | | value: 1 |
| | | { |
| | | label: "租赁期限", |
| | | prop: "dldType", |
| | | width: 100, |
| | | display: false, |
| | | search: true, |
| | | searchSpan: 3, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "长期", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "中期", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "短期", |
| | | value: 3 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "中期", |
| | | value: 2 |
| | | label: "审核状态", |
| | | prop: "auditStatus", |
| | | type: "select", |
| | | width: 80, |
| | | search: true, |
| | | searchSpan: 4, |
| | | display: false, |
| | | dicData: [{ |
| | | label: "已确认", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "待确认", |
| | | value: 0 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "短期", |
| | | value: 3 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | | prop: "auditStatus", |
| | | type: "select", |
| | | width: 80, |
| | | search: true, |
| | | searchSpan: 4, |
| | | display: false, |
| | | dicData: [{ |
| | | label: "已确认", |
| | | value: 1 |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | display: false, |
| | | width: 160, |
| | | }, |
| | | { |
| | | label: "待确认", |
| | | value: 0 |
| | | } |
| | | ], |
| | | label: "合同", |
| | | prop: "fileUrls", |
| | | // align:'center', |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | hide: true, |
| | | span: 24, |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | display: false, |
| | | width: 160, |
| | | }, |
| | | { |
| | | label: "合同", |
| | | prop: "fileUrls", |
| | | // align:'center', |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | hide: true, |
| | | span: 24, |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [], |
| | | |
| | | excelForm: {}, |
| | | excelOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [{ |
| | | label: '模板上传', |
| | | prop: 'excelFile', |
| | | type: 'upload', |
| | | drag: true, |
| | | loadText: '模板上传中,请稍等', |
| | | span: 24, |
| | | propsHttp: { |
| | | res: 'data' |
| | | }, |
| | | tip: '请上传 .xls,.xlsx 标准格式文件', |
| | | action: "/api/blade-system/user/import-user" |
| | | }, |
| | | { |
| | | label: "数据覆盖", |
| | | prop: "isCovered", |
| | | type: "switch", |
| | | align: "center", |
| | | width: 80, |
| | | dicData: [{ |
| | | label: "否", |
| | | value: 0 |
| | | excelForm: {}, |
| | | excelOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [{ |
| | | label: '模板上传', |
| | | prop: 'excelFile', |
| | | type: 'upload', |
| | | drag: true, |
| | | loadText: '模板上传中,请稍等', |
| | | span: 24, |
| | | propsHttp: { |
| | | res: 'data' |
| | | }, |
| | | tip: '请上传 .xls,.xlsx 标准格式文件', |
| | | action: "/api/blade-system/user/import-user" |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: 1 |
| | | label: "数据覆盖", |
| | | prop: "isCovered", |
| | | type: "switch", |
| | | align: "center", |
| | | width: 80, |
| | | dicData: [{ |
| | | label: "否", |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: 1 |
| | | } |
| | | ], |
| | | value: 0, |
| | | slot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择是否覆盖", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: '模板下载', |
| | | prop: 'excelTemplate', |
| | | formslot: true, |
| | | span: 24, |
| | | } |
| | | ], |
| | | value: 0, |
| | | slot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择是否覆盖", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: '模板下载', |
| | | prop: 'excelTemplate', |
| | | formslot: true, |
| | | span: 24, |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.houseRental_add, true), |
| | | viewBtn: this.vaildData(this.permission.houseRental_view, true), |
| | | delBtn: this.vaildData(this.permission.houseRental_delete, true), |
| | | editBtn: this.vaildData(this.permission.houseRental_edit, true) |
| | | }; |
| | | } |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList () { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.houseRental_add, true), |
| | | viewBtn: this.vaildData(this.permission.houseRental_view, true), |
| | | delBtn: this.vaildData(this.permission.houseRental_delete, true), |
| | | editBtn: this.vaildData(this.permission.houseRental_edit, true) |
| | | } |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | mounted () { }, |
| | | methods: { |
| | | |
| | | ManageTenants(item) { |
| | | this.roleBox = true |
| | | this.rowHouseHold = item |
| | | this.onLoadHouseHold() |
| | | }, |
| | | ManageTenants (item) { |
| | | this.roleBox = true |
| | | this.rowHouseHold = item |
| | | this.onLoadHouseHold() |
| | | }, |
| | | |
| | | onLoadHouseHold() { |
| | | let params = { |
| | | housingRentalId: this.rowHouseHold.id, |
| | | } |
| | | getHouseholdList(this.holdPage.currentPage, this.holdPage.pageSize, Object.assign(params)).then(res => { |
| | | const data = res.data.data; |
| | | this.houseHold = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | onLoadHouseHold () { |
| | | let params = { |
| | | housingRentalId: this.rowHouseHold.id, |
| | | } |
| | | getHouseholdList(this.holdPage.currentPage, this.holdPage.pageSize, Object.assign(params)).then(res => { |
| | | const data = res.data.data |
| | | this.houseHold = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | |
| | | houseHoldRowSave(row, done, loading) { |
| | | row.aoiName = this.rowHouseHold.aoiName |
| | | row.address = this.rowHouseHold.address |
| | | row.housingRentalId = this.rowHouseHold.id |
| | | row.houseCode = this.rowHouseHold.houseCode |
| | | householdAdd(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoadHouseHold(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.fileUrls = urls.join(",") |
| | | } |
| | | add(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.fileUrls = urls.join(",") |
| | | } |
| | | update(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | houseHoldRowUpdate(row, index, done, loading) { |
| | | householdUpdate(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoadHouseHold(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | houseHoldRowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return householdDel(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoadHouseHold(); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.treeDeptId = ''; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | // this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleExport() { |
| | | const account = func.toStr(this.search.account); |
| | | const realName = func.toStr(this.search.realName); |
| | | this.$confirm("是否导出出租信息数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | var data = { |
| | | ...this.query |
| | | } |
| | | data = Qs.stringify(data); |
| | | exportBlob( |
| | | `/api/blade-houseRental/houseRental/export-houseRental?${this.website.tokenHeader}=${getToken()}&` + |
| | | data |
| | | ).then(res => { |
| | | downloadXls(res.data, `出租信息数据表${dateNow()}.xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | }, |
| | | handleTemplate() { |
| | | exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "出租信息数据模板.xlsx"); |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetatil(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | if (this.form.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.fileUrls.split(","); |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.fileUrls = urls.join(",") |
| | | houseHoldRowSave (row, done, loading) { |
| | | row.aoiName = this.rowHouseHold.aoiName |
| | | row.address = this.rowHouseHold.address |
| | | row.housingRentalId = this.rowHouseHold.id |
| | | row.houseCode = this.rowHouseHold.houseCode |
| | | householdAdd(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoadHouseHold() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowSave (row, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(",") |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/") |
| | | urls.push(names[1]) |
| | | }) |
| | | row.fileUrls = urls.join(",") |
| | | } |
| | | }); |
| | | } |
| | | this.initFlag = true; |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.data.forEach(item => { |
| | | if (item.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var names = item.fileUrls.split(","); |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.fileUrls = urls.join(",") |
| | | add(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | if (row.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.fileUrls.split(",") |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/") |
| | | urls.push(names[1]) |
| | | }) |
| | | row.fileUrls = urls.join(",") |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | update(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | houseHoldRowUpdate (row, index, done, loading) { |
| | | householdUpdate(row).then(() => { |
| | | this.initFlag = false |
| | | this.onLoadHouseHold() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | houseHoldRowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return householdDel(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadHouseHold() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset () { |
| | | this.query = {} |
| | | this.treeDeptId = '' |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = [] |
| | | // this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleImport () { |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleExport () { |
| | | const account = func.toStr(this.search.account) |
| | | const realName = func.toStr(this.search.realName) |
| | | this.$confirm("是否导出出租信息数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start() |
| | | var data = { |
| | | ...this.query |
| | | } |
| | | data = Qs.stringify(data) |
| | | exportBlob( |
| | | `/api/blade-houseRental/houseRental/export-houseRental?${this.website.tokenHeader}=${getToken()}&` + |
| | | data |
| | | ).then(res => { |
| | | downloadXls(res.data, `出租信息数据表${dateNow()}.xlsx`) |
| | | NProgress.done() |
| | | }) |
| | | }) |
| | | }, |
| | | handleTemplate () { |
| | | exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "出租信息数据模板.xlsx") |
| | | }) |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetatil(this.form.id).then(res => { |
| | | this.form = res.data.data |
| | | if (this.form.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.fileUrls.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.fileUrls = urls.join(",") |
| | | } |
| | | }) |
| | | } |
| | | this.initFlag = true |
| | | done() |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.data.forEach(item => { |
| | | if (item.fileUrls.length > 0) { |
| | | var urls = [] |
| | | var names = item.fileUrls.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.fileUrls = urls.join(",") |
| | | } |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .box { |
| | | .box { |
| | | height: 800px; |
| | | } |
| | | } |
| | | |
| | | .el-scrollbar { |
| | | .el-scrollbar { |
| | | height: 100%; |
| | | } |
| | | } |
| | | |
| | | .box .el-scrollbar__wrap { |
| | | .box .el-scrollbar__wrap { |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 96, |
| | | width: 110, |
| | | label: "姓名", |
| | | prop: "name", |
| | | search: true, |
| | |
| | | }, |
| | | |
| | | { |
| | | display: true, |
| | | width: 160, |
| | | display: true, |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | search: true, |
| | |
| | | |
| | | |
| | | { |
| | | width: 60, |
| | | label: "性别", |
| | | prop: "gender", |
| | | type: "select", |
| | |
| | | // }, |
| | | |
| | | { |
| | | width: 142, |
| | | label: "小区", |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | prop: "aoiName", |
| | | search: true, |
| | | searchSpan: 4, |
| | |
| | | }, |
| | | |
| | | { |
| | | width: 220, |
| | | overHidden: true, |
| | | label: '小区名称', |
| | | parent: false, |
| | | label: "小区名称", |
| | | prop: "districtName", |
| | | searchSpan: 4, |
| | | display: false, |
| | | search: true, |
| | | overHidden: true, |
| | | }, |
| | | |
| | | { |