4 files modified
1 files added
| | |
| | | }) |
| | | } |
| | | |
| | | export const getDetatil = (id) => { |
| | | export const getDetatil = (params) => { |
| | | return request({ |
| | | url: '/api/blade-house/house/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | params: params |
| | | }) |
| | | } |
| | | |
| New file |
| | |
| | | <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"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.household_delete" |
| | | @click="handleDelete">删 除 |
| | | </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> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getList, |
| | | remove, |
| | | add, |
| | | update, |
| | | getDetatil |
| | | } from "@/api/userHouse/list/houseHold.js"; |
| | | import { |
| | | exportBlob |
| | | } from "@/api/common"; |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | import { |
| | | getToken |
| | | } from '@/util/auth'; |
| | | import { |
| | | downloadXls |
| | | } from "@/util/util"; |
| | | import { |
| | | dateNow |
| | | } from "@/util/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import Qs from "qs"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | search: {}, |
| | | excelBox: false, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | option: { |
| | | height: 420, |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | addBtn: true, |
| | | dialogType: 'dialog', |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | label: "姓名", |
| | | prop: "name", |
| | | search: true, |
| | | searchSpan: 4, |
| | | labelWidth:120, |
| | | }, |
| | | { |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | labelWidth:120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | labelWidth:120, |
| | | prop: "idCard", |
| | | }, |
| | | { |
| | | label: "性别", |
| | | prop: "gender", |
| | | type: "select", |
| | | labelWidth:120, |
| | | dicData: [ |
| | | { |
| | | label: "男", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "女", |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: "未知", |
| | | value: 1 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "关系", |
| | | prop: "roleType", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleType", |
| | | labelWidth:120, |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "与角色关系", |
| | | prop: "relationship", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=roleRelation", |
| | | dataType: "number", |
| | | labelWidth:120, |
| | | hide: true, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "小区", |
| | | prop: "aoiName", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | display: false |
| | | }, |
| | | { |
| | | label: "主要联系人", |
| | | prop: "isPrimaryContact", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=primaryContactType", |
| | | dataType: "number", |
| | | hide: true, |
| | | labelWidth:120, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "居住情况", |
| | | prop: "residentialStatus", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth:120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=residentialStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "idCard", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "生日", |
| | | prop: "birthday", |
| | | type: "date", |
| | | labelWidth:120, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "港澳台通行证", |
| | | prop: "hkmtPass", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "护照", |
| | | prop: "passport", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "民族", |
| | | prop: "ethnicity", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth:120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "学历", |
| | | prop: "education", |
| | | type: "select", |
| | | hide: true, |
| | | labelWidth:120, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "户籍登记地", |
| | | prop: "hukouRegistration", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "工作状态", |
| | | prop: "workStatus", |
| | | type: "select", |
| | | labelWidth:120, |
| | | hide: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=workStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "工作单位", |
| | | prop: "employer", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "婚姻状态", |
| | | prop: "maritalStatus", |
| | | type: "select", |
| | | labelWidth:120, |
| | | hide: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=marriageStatusType", |
| | | dataType: "number", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "车牌号", |
| | | prop: "cardNumber", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "其他联系方式", |
| | | prop: "otherContact", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "现居住地址", |
| | | prop: "currentAddress", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "残疾证", |
| | | prop: "disabilityCert", |
| | | labelWidth:120, |
| | | hide: true, |
| | | }, |
| | | ] |
| | | }, |
| | | houseCode: "", |
| | | 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 |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: 1 |
| | | } |
| | | ], |
| | | 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.household_add, true), |
| | | viewBtn: this.vaildData(this.permission.household_view, true), |
| | | delBtn: this.vaildData(this.permission.household_delete, true), |
| | | editBtn: this.vaildData(this.permission.household_edit, true) |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | init(data) { |
| | | this.houseCode = data.houseCode |
| | | this.onLoad(this.page) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | row['houseCode'] = this.houseCode |
| | | 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) { |
| | | update(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | 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() { |
| | | this.$confirm("是否导出住户数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | var data = { |
| | | ...this.query |
| | | } |
| | | data = Qs.stringify(data); |
| | | exportBlob( |
| | | `/api/blade-household/household/export-household?${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; |
| | | }); |
| | | } |
| | | 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 = {}) { |
| | | params['houseCode'] = this.houseCode |
| | | 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.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .box { |
| | | height: 800px; |
| | | } |
| | | |
| | | .el-scrollbar { |
| | | height: 100%; |
| | | } |
| | | |
| | | .box .el-scrollbar__wrap { |
| | | overflow: scroll; |
| | | } |
| | | </style> |
| | |
| | | @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.user_delete" |
| | | <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.houseRental_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin')" |
| | | icon="el-icon-upload2" @click="handleImport">导入 |
| | | <el-button type="success" size="small" plain v-if="permission.houseRental_import" icon="el-icon-upload2" |
| | | @click="handleImport">导入 |
| | | </el-button> |
| | | <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')" |
| | | icon="el-icon-download" @click="handleExport">导出 |
| | | <el-button type="warning" size="small" plain v-if="permission.houseRental_export" icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="tenantName"> |
| | |
| | | getDetatil |
| | | } from "@/api/userHouse/list/houseRental.js"; |
| | | import { |
| | | getList as getHouseList, |
| | | getDetatil as getHouseDetail |
| | | } from "@/api/userHouse/list/house.js"; |
| | | import { |
| | | exportBlob |
| | | } from "@/api/common"; |
| | | import { |
| | |
| | | import 'nprogress/nprogress.css'; |
| | | import func from "@/util/func"; |
| | | import Qs from "qs"; |
| | | import website from '@/config/website'; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | addBtn:true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | 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: { |
| | | 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: "关系", |
| | |
| | | label: "不同一户", |
| | | value: 2 |
| | | } |
| | | ], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择关系", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | value: 2 |
| | | } |
| | | ], |
| | | }, |
| | | rules: [ |
| | | { |
| | | label: "租房时间", |
| | | prop: "rentalTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100, |
| | | required: true, |
| | | message: "请选择房屋状态", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | label: "到期时间", |
| | | prop: "dueTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 100 |
| | | ], |
| | | }, |
| | | { |
| | | label: "用途", |
| | |
| | | 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", |
| | |
| | | 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, |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.household_add, false), |
| | | viewBtn: this.vaildData(this.permission.household_view, false), |
| | | delBtn: this.vaildData(this.permission.household_delete, false), |
| | | editBtn: this.vaildData(this.permission.household_edit, false) |
| | | 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) |
| | | }; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | 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); |
| | |
| | | }); |
| | | }, |
| | | 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); |
| | |
| | | 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; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => { |
| | | 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> |
| | | import { |
| | | getList, |
| | | getPageList, |
| | | remove, |
| | | add, |
| | | update, |
| | | getDetatil, |
| | | saveOrUpdateHouseLabel |
| | | getDetatil |
| | | } from "@/api/userHouse/list/houseHold.js"; |
| | | import { |
| | | exportBlob |
| | |
| | | } from "@/util/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import func from "@/util/func"; |
| | | import Qs from "qs"; |
| | | |
| | | export default { |
| | |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.household_add, true), |
| | | addBtn: this.vaildData(this.permission.household_add, false), |
| | | viewBtn: this.vaildData(this.permission.household_view, true), |
| | | delBtn: this.vaildData(this.permission.household_delete, true), |
| | | editBtn: this.vaildData(this.permission.household_edit, true) |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => { |
| | | 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; |
| | |
| | | icon="el-icon-download" @click="handleExport">导出 |
| | | </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="handleHouseholdManager(scope.row)">住户管理 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="tenantName"> |
| | | <el-tag>{{ row.tenantName }}</el-tag> |
| | | </template> |
| | |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <el-dialog title="住户管理" append-to-body :visible.sync="householdManagerVisible" width="70%" height="60%"> |
| | | <householdManager ref="householdManager"/> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <script> |
| | | import { |
| | | getList, |
| | | getPageList, |
| | | remove, |
| | | add, |
| | | update, |
| | | getDetatil, |
| | | saveOrUpdateHouseLabel |
| | | getDetatil |
| | | } from "@/api/userHouse/list/house.js"; |
| | | import { |
| | | exportBlob |
| | |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import func from "@/util/func"; |
| | | import householdManager from "./components/householdManager"; |
| | | import Qs from "qs"; |
| | | export default { |
| | | components: { |
| | | householdManager |
| | | }, |
| | | data() { |
| | | return { |
| | | householdManagerVisible:false, |
| | | form: {}, |
| | | search: {}, |
| | | excelBox: false, |
| | |
| | | viewBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | menuWidth:280, |
| | | column: [{ |
| | | label: "房屋编号", |
| | | prop: "houseCode", |
| | | width: 180, |
| | | hide: true, |
| | | disabled: true, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "地址", |
| | |
| | | label: "小区", |
| | | prop: "districtName", |
| | | search: true, |
| | | }, |
| | | rules: [ |
| | | { |
| | | label: "楼层", |
| | | prop: "floor", |
| | | required: true, |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "手机", |
| | | prop: "phone", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入绑定手机", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "服务到期", |
| | | prop: "serviceDue", |
| | | label: "幢", |
| | | prop: "building", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "物业费", |
| | | prop: "propertyPrice", |
| | | label: "单元", |
| | | prop: "unit", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "室", |
| | | prop: "room", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "楼层", |
| | | prop: "floor", |
| | | type: "number", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入楼层", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "面积", |
| | | prop: "area", |
| | | type: "number", |
| | | }, |
| | | { |
| | | label: "物业费", |
| | | prop: "propertyPrice", |
| | | type: "number", |
| | | }, |
| | | { |
| | | label: "服务到期", |
| | | prop: "serviceDue", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.user_add, false), |
| | | viewBtn: this.vaildData(this.permission.user_view, true), |
| | | delBtn: this.vaildData(this.permission.user_delete, true), |
| | | editBtn: this.vaildData(this.permission.user_edit, true) |
| | | addBtn: this.vaildData(this.permission.house_add, true), |
| | | viewBtn: this.vaildData(this.permission.house_view, true), |
| | | delBtn: this.vaildData(this.permission.house_delete, true), |
| | | editBtn: this.vaildData(this.permission.house_edit, true) |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | handleHouseholdManager(row){ |
| | | var that = this |
| | | this.householdManagerVisible = true |
| | | this.$nextTick(() => { |
| | | that.$refs.householdManager.init(row) |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.initFlag = false; |
| | |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetatil(this.form.id).then(res => { |
| | | getDetatil({ |
| | | id: this.form.id |
| | | }).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => { |
| | | 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; |