物业公司,物业公司小区,区域查询,用户,组织机构调整
4 files modified
6 files added
| New file |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-district/district/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-district/district/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-district/district/submit', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-district/district/submit', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const getDistrict = (id) => { |
| | | return request({ |
| | | url: '/api/blade-district/district/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| New file |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompany/propertyCompany/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompany/propertyCompany/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompany/propertyCompany/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompany/propertyCompany/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const getPropertyCompany = (id) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompany/propertyCompany/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| New file |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/saveOrUpdate', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const getPropertyCompanyDistrict = (id) => { |
| | | return request({ |
| | | url: '/api/blade-propertyCompanyDistrict/propertyCompanyDistrict/detail', |
| | | method: 'get', |
| | | params: { |
| | | id |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | export const add = (row) => { |
| | | return request({ |
| | | url: '/api/blade-system/dept/submit', |
| | | url: '/api/blade-system/dept/saveOrUpdateDeptInfo', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/blade-system/dept/submit', |
| | | url: '/api/blade-system/dept/saveOrUpdateDeptInfo', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | topCode: '00', |
| | | topCode: '36', |
| | | treeCode: '', |
| | | treeParentCode: '', |
| | | treeData: [], |
| | |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentCode = (node.level === 0) ? "00" : node.data.id; |
| | | const parentCode = (node.level === 0) ? "36" : node.data.id; |
| | | getLazyTree(parentCode).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | @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 size="small" icon="el-icon-delete" plain v-if="permission.district_delete" @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, remove, update, add, getDistrict } from "@/api/district/index"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from '@/config/website'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "小区名称", |
| | | prop: "name", |
| | | searchSpan: 4, |
| | | search: true, |
| | | width:260, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入小区名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "所属社区", |
| | | prop: "communityCode", |
| | | search: true, |
| | | searchSpan: 4, |
| | | width:110, |
| | | type: "tree", |
| | | dicUrl:"/api/blade-system/region/tree?parentCode=361102", |
| | | // parent:false, |
| | | defaultExpandedKeys:["361102003"], |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属社区", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "小区图片", |
| | | prop: "picUrl", |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | | label: "小区简介", |
| | | prop: "remark", |
| | | component: "AvueUeditor", |
| | | options: { |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | props: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | }, |
| | | hide: true, |
| | | minRows: 6, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.district_add, true), |
| | | viewBtn: this.vaildData(this.permission.district_view, true), |
| | | delBtn: this.vaildData(this.permission.district_delete, true), |
| | | editBtn: this.vaildData(this.permission.district_edit, true), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | if (row.picUrl.length > 0) { |
| | | var urls = [] |
| | | var split = row.picUrl.split(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.picUrl = urls.join(",") |
| | | } |
| | | row.userid = this.userInfo.user_id; |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.picUrl.length > 0) { |
| | | var urls = [] |
| | | var split = row.picUrl.split(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.picUrl = urls.join(",") |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | 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.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(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDistrict(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | if (this.form.picUrl.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.picUrl.split(","); |
| | | names.forEach(name=>{ |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.picUrl = urls.join(",") |
| | | } |
| | | }); |
| | | } |
| | | // con |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { dateTime } = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | }; |
| | | values.dateTime = null; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.data.forEach(item=>{ |
| | | if(item.picUrl){ |
| | | if(item.picUrl.length>0){ |
| | | var urls = [] |
| | | var names = item.picUrl.split(","); |
| | | names.forEach(name=>{ |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.picUrl = urls.join(",") |
| | | } |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <!-- 物业公司管理 --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | @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 size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, remove, update, add, getPropertyCompany } from "@/api/property/propertyCompany"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from '@/config/website'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 1150, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "物业公司名称", |
| | | prop: "name", |
| | | searchSpan: 6, |
| | | search: true, |
| | | searchLabelWidth:120, |
| | | span: 18, |
| | | row: true, |
| | | labelWidth: 120, |
| | | width: 260, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入物业公司名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '省份', |
| | | prop: 'province', |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | hide:true, |
| | | span: 6, |
| | | labelWidth: 120, |
| | | cascader: ['city'], |
| | | dicUrl: `/api/blade-system/region/select`, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择省份', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '城市', |
| | | prop: 'city', |
| | | type: 'select', |
| | | span: 6, |
| | | labelWidth: 60, |
| | | cascader: ['area'], |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | hide:true, |
| | | dicUrl: `/api/blade-system/region/select?code={{key}}`, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择城市', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '地区', |
| | | prop: 'area', |
| | | type: 'select', |
| | | span: 6, |
| | | labelWidth: 60, |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | }, |
| | | hide:true, |
| | | dicUrl: `/api/blade-system/region/select?code={{key}}`, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择地区', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | span:18, |
| | | labelWidth: 120, |
| | | row:true, |
| | | }, |
| | | { |
| | | label: "社会信用代码", |
| | | prop: "socialCreditCode", |
| | | labelWidth: 120, |
| | | }, |
| | | |
| | | { |
| | | label: "简介", |
| | | prop: "remark", |
| | | component: "AvueUeditor", |
| | | labelWidth: 120, |
| | | options: { |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | props: { |
| | | res: "data", |
| | | url: "link", |
| | | }, |
| | | }, |
| | | hide: true, |
| | | minRows: 6, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.propertyCompany_add, true), |
| | | viewBtn: this.vaildData(this.permission.propertyCompany_view, true), |
| | | delBtn: this.vaildData(this.permission.propertyCompany_delete, true), |
| | | editBtn: this.vaildData(this.permission.propertyCompany_edit, true), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | row.userid = this.userInfo.user_id; |
| | | add(row).then( |
| | | () => { |
| | | 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.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.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(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getPropertyCompany(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | // con |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { dateTime } = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | }; |
| | | values.dateTime = null; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <!-- 物业公司管理 --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | @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 size="small" icon="el-icon-delete" plain v-if="permission.propertyCompanyDistrict_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, remove, update, add, getPropertyCompanyDistrict } from "@/api/property/propertyCompanyDistrict"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from '@/config/website'; |
| | | import func from "@/util/func"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 1150, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "小区", |
| | | prop: "districtId", |
| | | searchSpan: 5, |
| | | search: true, |
| | | type: 'tree', |
| | | dicUrl: `/api/blade-district/district/getDistrictTree`, |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | defaultExpandedKeys:["361102003"], |
| | | span: 12, |
| | | labelWidth: 120, |
| | | width: 260, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择小区", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '物业公司', |
| | | prop: 'propertyCompanyId', |
| | | type: 'tree', |
| | | hide:true, |
| | | searchSpan: 5, |
| | | search: true, |
| | | span: 12, |
| | | labelWidth: 120, |
| | | dicUrl: `/api/blade-propertyCompany/propertyCompany/getPropertyCompanyList`, |
| | | cascader: ['userId'], |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择物业公司', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '负责人', |
| | | prop: 'principal', |
| | | span: 12, |
| | | labelWidth: 120, |
| | | search:true, |
| | | searchSpan:4, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入负责人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '联系方式', |
| | | prop: 'principalPhone', |
| | | span: 12, |
| | | labelWidth: 120, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入联系方式", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "物业成员", |
| | | prop: "userId", |
| | | span: 12, |
| | | labelWidth: 120, |
| | | type:"tree", |
| | | multiple: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id' |
| | | }, |
| | | hide:true, |
| | | dicUrl: `/api/blade-propertyCompany/propertyCompany/getUserByPropertyCompany?id={{key}}`, |
| | | }, |
| | | { |
| | | label: "物业阶段", |
| | | span: 12, |
| | | prop: "propertyStage", |
| | | labelWidth: 120, |
| | | type: "select", |
| | | search: true, |
| | | searchSpan: 4, |
| | | dataType: "number", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=propertyStage", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | label: "合同开始时间", |
| | | prop: "startTime", |
| | | span: 12, |
| | | labelWidth: 120, |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择合同开始时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "合同结束时间", |
| | | prop: "endTime", |
| | | labelWidth: 120, |
| | | span:12, |
| | | type: "date", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择合同结束时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.propertyCompanyDistrict_add, true), |
| | | viewBtn: this.vaildData(this.permission.propertyCompanyDistrict_view, true), |
| | | delBtn: this.vaildData(this.permission.propertyCompanyDistrict_delete, true), |
| | | editBtn: this.vaildData(this.permission.propertyCompanyDistrict_edit, true), |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | row.userId = func.join(row.userId); |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.userId = func.join(row.userId); |
| | | update(row).then( |
| | | () => { |
| | | 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.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(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getPropertyCompanyDistrict(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | // con |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { dateTime } = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (dateTime) { |
| | | values = { |
| | | ...params, |
| | | startTime: dateTime[0], |
| | | endTime: dateTime[1], |
| | | ...this.query, |
| | | }; |
| | | values.dateTime = null; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| | |
| | | dicUrl: "/api/blade-system/tenant/select", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: website.tenantMode, |
| | | viewDisplay: false, |
| | | span: 24, |
| | | props: { |
| | | label: "tenantName", |
| | | value: "tenantId" |
| | | }, |
| | | hide: !website.tenantMode, |
| | | search: website.tenantMode, |
| | | hide: true, |
| | | search: false, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入所属租户", |
| | |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | // { |
| | | // label: "所属部门", |
| | | // prop: "deptId", |
| | | // type: "tree", |
| | | { |
| | | label: "所属部门", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | // multiple: true, |
| | | // dicData: [], |
| | | // props: { |
| | | // label: "title" |
| | | // }, |
| | | // checkStrictly: true, |
| | | // slot: true, |
| | | // rules: [{ |
| | | // required: true, |
| | | // message: "请选择所属部门", |
| | | // trigger: "click" |
| | | // }] |
| | | // }, |
| | | dicData: [], |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | checkStrictly: true, |
| | | slot: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属部门", |
| | | trigger: "click" |
| | | }] |
| | | }, |
| | | // { |
| | | // label: "所属岗位", |
| | | // prop: "postId", |
| | |
| | | const column = this.findObject(this.option.group, "roleId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | // getDeptTree(tenantId).then(res => { |
| | | // const column = this.findObject(this.option.group, "deptId"); |
| | | // column.dicData = res.data.data; |
| | | // }); |
| | | getDeptTree(tenantId).then(res => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | // getPostList(tenantId).then(res => { |
| | | // const column = this.findObject(this.option.group, "postId"); |
| | | // column.dicData = res.data.data; |
| | |
| | | rowSave(row, done, loading) { |
| | | row['tenantId'] = "000000" |
| | | row['userType'] = 1 |
| | | row['deptId'] = '1123598813738675201' |
| | | // row.deptId = func.join(row.deptId); |
| | | row.deptId = func.join(row.deptId); |
| | | row.roleId = func.join(row.roleId); |
| | | // row.postId = func.join(row.postId); |
| | | add(row).then(() => { |
| | |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row['tenantId'] = "000000" |
| | | row['deptId'] = '1123598813738675201' |
| | | row['userType'] = 1 |
| | | // row.deptId = func.join(row.deptId); |
| | | row.deptId = func.join(row.deptId); |
| | | row.roleId = func.join(row.roleId); |
| | | // row.postId = func.join(row.postId); |
| | | update(row).then(() => { |