diff --git a/src/views/modules/sys/dept-add-or-update.vue b/src/views/modules/sys/dept-add-or-update.vue index 00a42d0..8800174 100644 --- a/src/views/modules/sys/dept-add-or-update.vue +++ b/src/views/modules/sys/dept-add-or-update.vue @@ -10,12 +10,12 @@ label-width="120px"> - - - @@ -70,8 +70,15 @@ @current-change="areaCodeListTreeCurrentChangeHandle"> - + + + 机构类型为街道或社区时,请选择行政区划中的组织机构,若没用对应选项点击下方红色文字链接新增行政区划;机构类型为其他类型时,请选择其上级行政区划。 + + + + 如果没有匹配的行政区划,请点击此处新增 + @@ -221,6 +228,28 @@ export default { this.dataForm.parentAreaCode = data.parentCode this.areaCodeListVisible = false }, + addAreaCode () { + if (this.dataForm.name === null || this.dataForm.name === '' || this.dataForm.name.trim() === '') { + return this.$message.error('请填写机构名称') + } + if (this.dataForm.pid === null || this.dataForm.pid === '' || this.dataForm.pid.trim() === '' || this.dataForm.pid.trim() === '0') { + return this.$message.error('请选择上级部门') + } + this.$http['post']('/sys/dept/addAreaCode', this.dataForm).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.$message({ + message: this.$t('prompt.success'), + type: 'success', + duration: 500, + onClose: () => { + this.dataForm.areaCode = res.data.areaCode + this.getAreaCodeDeptList() + } + }) + }).catch(() => { }) + }, // 表单提交 dataFormSubmitHandle: debounce(function () { this.$refs['dataForm'].validate((valid) => { @@ -263,4 +292,7 @@ export default { .el-dialog__footer { margin-top: 100px; } +.input-width-jg { + width: 93%; +}