|
|
|
@ -10,12 +10,12 @@ |
|
|
|
label-width="120px"> |
|
|
|
<el-form-item prop="name" |
|
|
|
:label="$t('dept.name')"> |
|
|
|
<el-input v-model="dataForm.name" |
|
|
|
<el-input class="input-width-jg" v-model="dataForm.name" |
|
|
|
:placeholder="$t('dept.name')"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="partyCode" |
|
|
|
:label="$t('dept.partyCode')"> |
|
|
|
<el-input v-model="dataForm.partyCode" |
|
|
|
<el-input class="input-width-jg" v-model="dataForm.partyCode" |
|
|
|
:placeholder="$t('dept.partyCode')"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="parentName" |
|
|
|
@ -35,7 +35,7 @@ |
|
|
|
@current-change="deptListTreeCurrentChangeHandle"> |
|
|
|
</el-tree> |
|
|
|
</el-popover> |
|
|
|
<el-input v-model="dataForm.parentName" |
|
|
|
<el-input class="input-width-jg" v-model="dataForm.parentName" |
|
|
|
v-popover:deptListPopover |
|
|
|
:readonly="true" |
|
|
|
:placeholder="$t('dept.parentName')"> |
|
|
|
@ -70,8 +70,15 @@ |
|
|
|
@current-change="areaCodeListTreeCurrentChangeHandle"> |
|
|
|
</el-tree> |
|
|
|
</el-popover> |
|
|
|
<el-input v-model="dataForm.areaCode" v-popover:areaCodeListPopover :readonly="true" placeholder="区域编码"> |
|
|
|
<el-input class="input-width-jg" v-model="dataForm.areaCode" v-popover:areaCodeListPopover :readonly="true" placeholder="区域编码"> |
|
|
|
</el-input> |
|
|
|
<el-tooltip placement="top"> |
|
|
|
<div slot="content">机构类型为街道或社区时,请选择行政区划中的组织机构,若没用对应选项点击下方红色文字链接新增行政区划;<br/>机构类型为其他类型时,请选择其上级行政区划。</div> |
|
|
|
<i class="el-icon-question" style="color: #ff4c52" /> |
|
|
|
</el-tooltip> |
|
|
|
<div> |
|
|
|
<el-link @click="addAreaCode()" v-if="dataForm.typeKey === 'street_party' || dataForm.typeKey === 'community_party'" type="danger">如果没有匹配的行政区划,请点击此处新增</el-link> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="sort" |
|
|
|
:label="$t('dept.sort')"> |
|
|
|
@ -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%; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|