-
或然城市合伙人
+ 或然城市合伙人
添加分类
@@ -232,13 +232,14 @@ export default {
qrcode: '',
expireTime: '',
curTeamId: '',
- submiting: false // 新增编辑防抖标识
+ submiting: false, // 新增编辑防抖标识
+ setKey: ''
};
},
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
- this.searchTimer = setTimeout(this.getList, 500);
+ this.searchTimer = setTimeout(this.initData, 500);
}
},
mounted() {
@@ -250,10 +251,11 @@ export default {
const res = await this.$post(this.api.listParner)
const list = res.treeList
// 没有子级,删除children属性
- const handleLeaf = list => {
+ const handleLeaf = (list, ids) => {
list.map(e => {
+ e.ids = ids ? [...ids, e.id] : [e.id]
if (e.children.length) {
- handleLeaf(e.children)
+ handleLeaf(e.children, e.ids)
} else {
delete e.children
}
@@ -261,6 +263,10 @@ export default {
}
handleLeaf(list)
this.orgList = list
+ // 如果刚编辑完,则选中刚编辑的分类
+ this.setKey && this.$nextTick(() => {
+ this.$refs.orgTree.setCurrentKey(this.setKey)
+ })
this.getList()
},
// 添加部门
@@ -284,7 +290,7 @@ export default {
partnerClassificationName: data.partnerClassificationName
}
this.orgVisible = true
- const ids = data.ids
+ const { ids } = data
ids.splice(ids.length - 1, 1)
this.cascaderValue = ids
},
@@ -332,6 +338,7 @@ export default {
// 编辑
this.$post(this.api.updateParner, form).then(res => {
util.successMsg("编辑成功!")
+ this.setKey = form.id
this.closeOrg()
}).catch(err => {})
}
@@ -342,7 +349,7 @@ export default {
getTeamId(list) {
for (const i in list) {
const e = list[i]
- if (e.isTeam) {
+ if (e.isTeam && !this.curTeamId) {
this.curTeamId = e.id
break
} else {
@@ -352,16 +359,15 @@ export default {
},
// 点击树节点查询列表数据
handleNodeClick(data) {
- this.curTeamId = data.id
+ this.curTeamId = ''
if (data.isTeam) {
this.curTeamId = data.id
} else {
this.getTeamId(data.children)
}
- if (this.curTeamId) {
- this.$refs.orgTree.setCurrentKey(this.curTeamId)
- this.getList()
- }
+ if (!this.curTeamId) this.curTeamId = data.id
+ this.$refs.orgTree.setCurrentKey(this.curTeamId)
+ this.initData()
this.$refs.table.clearSelection()
},
// 关闭组织新增编辑弹框
@@ -370,6 +376,11 @@ export default {
this.cascaderValue = []
this.getOrg()
},
+ // 查询全部
+ getAll() {
+ this.curTeamId = ''
+ this.getList()
+ },
// 员工列表
getList() {
this.$post(this.api.partnerAccountList, {
@@ -454,7 +465,7 @@ export default {
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
- width: calc(100% - 374px);
+ flex: 1;
padding: 24px 0;
}
}
diff --git a/src/views/system/role.vue b/src/views/system/role.vue
index 76f6fef..85c979a 100644
--- a/src/views/system/role.vue
+++ b/src/views/system/role.vue
@@ -107,7 +107,7 @@ export default {
},
methods: {
getData() {
- this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}`).then(res => {
+ this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}&port=0`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
diff --git a/src/views/system/staff.vue b/src/views/system/staff.vue
index 732d7c6..75122b5 100644
--- a/src/views/system/staff.vue
+++ b/src/views/system/staff.vue
@@ -555,7 +555,25 @@ export default {
this.$get(`${this.api.staffDetail}?accountId=${row.accountId}`).then(res => {
const { data } = res
const { staffArchitectureId, roleId } = data
- if (roleId) data.roleList = roleId.split(',').map(e => Number(e))
+ if (roleId) {
+ const roleList = roleId.split(',').map(e => Number(e))
+ const list = this.roleList
+ if (roleList.length) {
+ let has = false // 是否在角色列表里有已选择的角色,全部都被删除了,则提示
+ for (const i in roleList) {
+ if (list.find(n => n.id === roleList[i])) {
+ has = true
+ break
+ }
+ }
+ if (!has) {
+ util.warningMsg('角色被删请重新选择')
+ data.roleList = []
+ } else {
+ data.roleList = roleList
+ }
+ }
+ }
if (staffArchitectureId) {
handleArchId(this.orgList, staffArchitectureId.split(',').map(e => Number(e)))
data.staffArchitectureId = archId
@@ -563,12 +581,11 @@ export default {
this.form = data
this.originAccount = data.account
this.originWorkNumber = data.workNumber
- console.log(333, this.orgList)
}).catch(res => {})
},
// 获取角色数据
getRole() {
- this.$get(`${this.api.roleList}?page=1&size=1000&name=&platformId=${Setting.platformId}`).then(res => {
+ this.$get(`${this.api.roleList}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => {
this.roleList = res.rolePage.records
}).catch(res => {})
},