Commit d68ff4b595d917993a315be824595c5e993c0c3e
1 parent
6cbcfa50
v1.9 优化admin下组织顶级组织修改bug
Showing
3 changed files
with
12 additions
and
5 deletions
src/components/org/EditOrg.vue
| ... | ... | @@ -45,15 +45,13 @@ |
| 45 | 45 | }, |
| 46 | 46 | rules: { |
| 47 | 47 | orgName: [ |
| 48 | - { required: true, message: this.$t('org.orgNameRequired'), trigger: 'blur' }, | |
| 49 | - { min: 2, max: 50, message: this.$t('org.orgNameLength'), trigger: 'blur' } | |
| 48 | + { required: true, message: this.$t('org.orgName'), trigger: 'blur' } | |
| 50 | 49 | ], |
| 51 | 50 | parentOrgId: [ |
| 52 | - { required: true, message: this.$t('org.parentOrgRequired') } | |
| 51 | + { required: true, message: this.$t('org.parentOrg') } | |
| 53 | 52 | ], |
| 54 | 53 | description: [ |
| 55 | - { required: true, message: this.$t('org.descriptionRequired'), trigger: 'blur' }, | |
| 56 | - { max: 200, message: this.$t('org.descriptionMaxLength'), trigger: 'blur' } | |
| 54 | + { required: true, message: this.$t('org.description'), trigger: 'blur' } | |
| 57 | 55 | ], |
| 58 | 56 | orgId: [ |
| 59 | 57 | { required: true, message: this.$t('org.orgIdRequired') } |
| ... | ... | @@ -92,6 +90,8 @@ |
| 92 | 90 | this.$message.success(this.$t('common.operationSuccess')) |
| 93 | 91 | this.visible = false |
| 94 | 92 | this.$emit('refresh') |
| 93 | + },err=>{ | |
| 94 | + this.$message.error(err) | |
| 95 | 95 | }) |
| 96 | 96 | } |
| 97 | 97 | }) | ... | ... |
src/components/org/OrgTree.vue
| ... | ... | @@ -73,6 +73,11 @@ export default { |
| 73 | 73 | this.$message.warning(this.$t('org.selectOrgFirst')) |
| 74 | 74 | return |
| 75 | 75 | } |
| 76 | + if(this.currentNode.parentId == '-1'){ | |
| 77 | + this.$message.warning(this.$t('org.topOrg')) | |
| 78 | + return | |
| 79 | + } | |
| 80 | + console.log(this.currentNode) | |
| 76 | 81 | this.$refs.editOrg.show(this.currentNode) |
| 77 | 82 | }, |
| 78 | 83 | handleDeleteOrg() { | ... | ... |
src/views/org/orgLang.js
| ... | ... | @@ -29,6 +29,7 @@ export const messages = { |
| 29 | 29 | confirmDeleteOrgRel: 'Are you sure to delete this organization relationship?', |
| 30 | 30 | staffTitle: 'Staff', |
| 31 | 31 | selectOrgFirst: 'Please select an organization first', |
| 32 | + topOrg: 'The top organization cannot be modified', | |
| 32 | 33 | staff: { |
| 33 | 34 | name: 'Name', |
| 34 | 35 | phone: 'Phone', |
| ... | ... | @@ -68,6 +69,7 @@ export const messages = { |
| 68 | 69 | confirmDeleteOrgRel: '确定删除组织关系', |
| 69 | 70 | staffTitle: '员工', |
| 70 | 71 | selectOrgFirst: '请先选择一个组织', |
| 72 | + topOrg: '一级组织不能修改', | |
| 71 | 73 | staff: { |
| 72 | 74 | name: '员工名称', |
| 73 | 75 | phone: '员工电话', | ... | ... |