diff --git a/src/api/system/user.js b/src/api/system/user.js index 97fdd5e..e05ec72 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -68,6 +68,14 @@ export function updateUser(data) { data: data }) } + +export function editAgency(data) { + return request({ + url: '/system/user/editAgency', + method: 'post', + data: data + }) +} export function editDepartment(data) { return request({ url: '/system/user/editDepartment', diff --git a/src/views/system/agency/index.vue b/src/views/system/agency/index.vue index 8697514..7b87c07 100644 --- a/src/views/system/agency/index.vue +++ b/src/views/system/agency/index.vue @@ -109,8 +109,8 @@ {{ agencyList.parentAgencyName }} - {{ agencyList.nodeType == "HEALTH_COMYISION" ? "卫健委" : "" }} + + {{ agencyList.nodeType == "CANPUS" ? "院区" : "" }} {{ agencyList.nodeType == "HOSPITAL" ? "医院" : "" @@ -391,9 +391,7 @@ style="width: 205px" v-model="form.parentId" :show-all-levels="false" - :placeholder=" - form.parentAgencyName ? form.parentAgencyName : '' - " + :placeholder="form.parentAgencyName ? form.parentAgencyName : ''" clearable ref="cascader" :key="isResouceShow" @@ -407,9 +405,7 @@ @change="changeagencyCategoryId($event)" style="width: 205px" :placeholder=" - form.agencyCategoryName - ? form.agencyCategoryName - : '' + form.agencyCategoryName ? form.agencyCategoryName : '' " v-model="form.agencyCategoryId" :show-all-levels="false" @@ -476,7 +472,6 @@ { this.nodeTypeoptions = res.data; }); @@ -1134,32 +1128,33 @@ export default { /** 提交按钮 */ submitForm() { - // if (this.form.provinceCode && !this.form.communityCode) { - // this.$message("请选择到社区"); - // } + if (this.form.areaCode && !this.form.streetName) { + this.$message.error("行政区划请至少选择到街道"); + } else { + console.log(this.form); + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.id != null) { + updateAgency(this.form).then((response) => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + ++this.isResouceShow; + this.gettreelist(); + }); + } else { + addAgency(this.form).then((response) => { + this.$modal.msgSuccess("新增成功"); + this.open = false; + ++this.isResouceShow; + this.gettreelist(); + }); + } + } + }); + } // if(this.form.cityName){ // this.form.areaCode=this.form.cityName // } - console.log(this.form); - this.$refs["form"].validate((valid) => { - if (valid) { - if (this.form.id != null) { - updateAgency(this.form).then((response) => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - ++this.isResouceShow; - this.gettreelist(); - }); - } else { - addAgency(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - ++this.isResouceShow; - this.gettreelist(); - }); - } - } - }); }, /** 删除按钮操作 */ handleDelete(row) { @@ -1189,7 +1184,7 @@ export default { };