修改校验

This commit is contained in:
闫晓茹 2024-03-28 14:41:38 +08:00
parent 02911e0255
commit d13b84782b

View File

@ -153,7 +153,12 @@
}}</el-descriptions-item
>
<el-descriptions-item label="行政区划"
>{{ agencyList.areaName }}
v-if="agencyList.provinceName" >{{ agencyList.provinceName }}-{{ agencyList.cityName }}-{{
agencyList.regionName
}}-{{ agencyList.streetName }}-{{ agencyList.communityName }}
</el-descriptions-item>
<el-descriptions-item label="行政区划"
v-else >
</el-descriptions-item>
</el-descriptions>
<!-- <div class="information">机构信息</div>
@ -318,7 +323,7 @@
></el-option>
</el-select>
<el-select
v-model="form.areaCode"
v-model="form.communityCode"
clearable
placeholder="请选择社区"
style="width: 129px; margin-left: 10px"
@ -829,19 +834,25 @@ export default {
//
clickstreet(item) {
// this.form.areaCode=item.areaCode
console.log(item, "jiedao");
this.form.communityCode = "";
this.form.communityName = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.streetlists = res.data;
if (res.data.length == 0) {
this.form.areaCode = item.areaCode;
} else {
this.streetlists = res.data;
}
});
},
//
clickstreetlist(item) {
console.log(item,'555555')
console.log(item, "555555");
this.form.areaCode = item.areaCode;
this.form.communityName = item.areaName;
// this.form.communityCode = item.areaName;
},
//
clickarea(item) {
@ -854,7 +865,17 @@ export default {
this.form.communityName = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.streetlist = res.data;
console.log(item, "qu");
if (res.data.length == 0) {
this.form.areaCode = item.areaCode;
} else {
this.streetlist = res.data;
}
// if (res.data) {
// this.streetlist = res.data;
// } else {
// this.form.areaCode = item.areaCode;
// }
});
},
//
@ -865,9 +886,15 @@ export default {
this.form.streetName = "";
this.form.communityCode = "";
this.form.communityName = "";
// console.log(this.form.cityName,'this.form.cityNames')
// console.log(item, "shi");
// this.form.areaCode=item.areaCode
getSecondaryLevelInfo(item.id).then((res) => {
this.arealist = res.data;
if (res.data.length == 0) {
this.form.areaCode = item.areaCode;
} else {
this.arealist = res.data;
}
});
},
/** 获取省列表 */
@ -878,6 +905,10 @@ export default {
},
//
province(item) {
console.log(item, "sheng");
// this.form.areaCode=item.areaCode
this.form.cityName = "";
// this.form.streeName = "";
// this.form.communityCode =''
@ -888,7 +919,7 @@ export default {
this.form.communityCode = "";
this.form.regionName = "";
this.form.areaCode = "";
// this.form.areaCode = "";
// this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.citylist = res.data;
@ -939,9 +970,8 @@ export default {
}
},
changeagencyCategoryId(e) {
if(e){
if (e) {
this.form.agencyCategoryId = e[e.length - 1];
}
},
// //
@ -1008,8 +1038,13 @@ export default {
//
reset() {
this.form = {
cityName:null,
regionName:null,
provinceName:null,
streetCode:null,
id: null,
parentId: null,
communityCode: null,
agencyCategoryId: null,
agencyCategoryName: null,
areaCode: null,
@ -1067,6 +1102,7 @@ export default {
getAgency(this.id).then((response) => {
console.log(response.data, "response.data.parentId");
this.form = response.data;
this.form.communityCode = response.data.communityName;
this.form.parentAgencyName = response.data.parentAgencyName;
// this.form.parentId=response.data.parentId
@ -1079,9 +1115,13 @@ export default {
/** 提交按钮 */
submitForm() {
if (this.form.provinceCode && !this.form.communityCode) {
this.$message("请选择到社区");
}
// if (this.form.provinceCode && !this.form.communityCode) {
// this.$message("");
// }
// 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) {