2 files modified
1 files added
| | |
| | | }) |
| | | } |
| | | |
| | | export const getUserlnfoByDistrictlds = (districtIds) => { |
| | | export const getUserlnfoByDistrictlds = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/blade-system/user/getUserInfoByDistrictIds', |
| | | method: 'get', |
| | | params: { |
| | | districtIds, |
| | | ...params, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | |
| | | @close="handleClose" @open="opens"> |
| | | <avue-form ref="DisCussFrom" :option="option" v-model="froms" @submit="handleSubmit"></avue-form> |
| | | </el-dialog> |
| | | |
| | | <userList ref="userList" @selectPersonList="selectPersonList"></userList> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | getDictionary |
| | | } from '@/api/system/dict' |
| | | import userList from "./userList.vue"; |
| | | |
| | | |
| | | // import { |
| | | // getList as getHouseholdList, |
| | |
| | | |
| | | let formData = {} |
| | | export default { |
| | | components: { |
| | | userList |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogVisibles: false, |
| | |
| | | { |
| | | display: false, |
| | | label: "选择用户", |
| | | prop: "userIds", |
| | | prop: "userName", |
| | | tags: true, |
| | | type: "tree", |
| | | type: "input", |
| | | multiple: true, |
| | | span: 12, |
| | | offset: 8, |
| | |
| | | hide: true, |
| | | row: true, |
| | | // dicUrl: `/api/blade-system/user/getUserlnfoByDistrictlds?districtlds={{}}`, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | dicData: [], |
| | | // props: { |
| | | // label: 'name', |
| | | // value: 'id', |
| | | // }, |
| | | // dicData: [], |
| | | rules: [{ |
| | | required: true, |
| | | message: '请输入姓名', |
| | | trigger: 'blur' |
| | | }], |
| | | focus: ({ |
| | | value, |
| | | column |
| | | }) => { |
| | | // this.$message.success('focus事件查看控制台') |
| | | // console.log('获取焦点', value, column) |
| | | // this.$refs.userList && this.$refs.userList.resetForm() |
| | | this.$refs.userList.show(this.discussion.articleRange) |
| | | }, |
| | | }, |
| | | |
| | | { |
| | |
| | | dialogVisibles: false, |
| | | articleId: '', |
| | | discussion: {}, |
| | | id: "" |
| | | id: "", |
| | | personList: [], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | watch: { |
| | | 'froms.appointUser': { |
| | | handler(newData) { |
| | | const column = this.findObject(this.option.column, "userIds") |
| | | const column = this.findObject(this.option.column, "userName") |
| | | if (newData == 1) { |
| | | column.display = true |
| | | // this.$refs.userList.show() |
| | | } else { |
| | | column.display = false |
| | | } |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | selectPersonList(personList) { |
| | | console.log(personList, "++++++++++++") |
| | | this.personList = personList |
| | | let nameList = personList.map(e => { |
| | | return e.name |
| | | }) |
| | | this.froms.userName = nameList.join(",") |
| | | }, |
| | | getuserInfoByDistrictId() { |
| | | getUserlnfoByDistrictlds(this.discussion.articleRange).then(res => { |
| | | const column = this.findObject(this.option.column, "userIds") |
| | |
| | | handleSubmit(form, done) { |
| | | form.articleId = this.articleId |
| | | form.eventType = 1 |
| | | form.userIds = JSON.stringify(form.userIds) |
| | | form.userIds = this.personList.map(e => e.id).join(",") |
| | | // form.userIds = JSON.stringify(form.userIds) |
| | | if (form.appointUser == 0) { |
| | | form.userIds = '' |
| | | } |
| | |
| | | this.froms.userIds = JSON.parse(this.froms.userIds) |
| | | } |
| | | } |
| | | this.getuserInfoByDistrictId() |
| | | // this.getuserInfoByDistrictId() |
| | | |
| | | }) |
| | | }, |
| New file |
| | |
| | | <template> |
| | | <el-dialog class="dept-user-table-dialog" width="70%" title="选择接收人" modal-append-to-body="false" append-to-body="true" |
| | | :close-on-click-model="true" :visible.sync="showDialog" @close="showDialog = false"> |
| | | <!-- <div class="left"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> --> |
| | | <div class="right"> |
| | | <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form" |
| | | :page.sync="page" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"></avue-crud> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="showDialog = false">取 消</el-button> |
| | | <el-button type="primary" @click="submit">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getDeptLazyTree |
| | | } from "@/api/system/dept"; |
| | | import { |
| | | getUserlnfoByDistrictlds |
| | | } from "@/api/system/user"; |
| | | import { |
| | | mapGetters |
| | | } from "vuex"; |
| | | |
| | | export default { |
| | | name: "DeptUserTable", |
| | | data() { |
| | | return { |
| | | showDialog: false, |
| | | form: {}, |
| | | search: {}, |
| | | selectionList: [], |
| | | query: {}, |
| | | loading: true, |
| | | platformLoading: false, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | treeDeptId: '', |
| | | treeData: [], |
| | | treeOption: { |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function(node, resolve) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.id |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }) |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: 'small', |
| | | props: { |
| | | labelText: '标题', |
| | | label: 'title', |
| | | value: 'value', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 120, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | viewBtn: true, |
| | | dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | menu: false, |
| | | addBtn: false, |
| | | rowKey: "id", |
| | | reserveSelection: true, |
| | | column: [{ |
| | | label: "用户姓名", |
| | | prop: "name", |
| | | search: true, |
| | | searchSpan: 4, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "电话", |
| | | prop: "phoneNumber", |
| | | slot: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "地址", |
| | | width: 560, |
| | | prop: "address", |
| | | slot: true, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "楼栋", |
| | | prop: "building", |
| | | slot: true, |
| | | searchSpan: 4, |
| | | search: true, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "单元", |
| | | prop: "unit", |
| | | searchSpan: 4, |
| | | slot: true, |
| | | search: true, |
| | | display: false |
| | | }, |
| | | |
| | | ], |
| | | }, |
| | | data: [], |
| | | articleRange: '', |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | ids() { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | console.log(ele, "---------") |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | idsList() { |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push({ |
| | | id: ele.id, |
| | | name: ele.name |
| | | }) |
| | | }) |
| | | return ids |
| | | } |
| | | }, |
| | | methods: { |
| | | submit() { |
| | | this.$emit("selectPersonList", this.idsList) |
| | | this.showDialog = false |
| | | }, |
| | | |
| | | show(articleRange) { |
| | | console.log("***111111111111111111***", articleRange) |
| | | this.articleRange = articleRange |
| | | this.showDialog = true |
| | | this.onLoad(this.page) |
| | | }, |
| | | |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page) |
| | | }, |
| | | 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) { |
| | | console.log(list, "list") |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | 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 |
| | | params.districtIds = this.articleRange |
| | | getUserlnfoByDistrictlds(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId) |
| | | .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"> |
| | | .dept-user-table-dialog { |
| | | margin: 0 !important; |
| | | |
| | | .el-dialog { |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin: auto !important; |
| | | position: absolute; |
| | | top: 0 !important; |
| | | left: 0 !important; |
| | | right: 0 !important; |
| | | bottom: 0 !important; |
| | | //width: 1000px !important; |
| | | height: 800px !important; |
| | | |
| | | .el-dialog__body { |
| | | height: 0 !important; |
| | | flex: 1; |
| | | display: flex; |
| | | |
| | | .left { |
| | | width: 0; |
| | | flex: 2; |
| | | } |
| | | |
| | | .right { |
| | | margin-left: 10px; |
| | | flex: 9; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |