From 2e461caed08ed12ae55799717d4937def2241f93 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Wed, 12 May 2021 10:39:50 +0800 Subject: [PATCH] =?UTF-8?q?PC=E7=AB=AF-=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E6=9C=BA=E6=9E=84=E7=AE=A1=E7=90=86-=E9=9B=86?= =?UTF-8?q?=E6=88=90=E4=BA=A7=E5=93=81=E6=96=B0=E5=A2=9E=E8=A1=8C=E6=94=BF?= =?UTF-8?q?=E5=8C=BA=E5=88=92=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/dept-add-or-update.vue | 40 ++++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) 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%; +}