diff --git a/src/api/system/communityInfo.js b/src/api/system/communityInfo.js index 5433056..44104a3 100644 --- a/src/api/system/communityInfo.js +++ b/src/api/system/communityInfo.js @@ -24,7 +24,7 @@ export function FirstLevels(query) { params: query }) } -// 查询市信息 +// 查询所属下级区域信息集合 export function SecondaryLevelInfo(id) { return request({ url: `/system/communityInfo/getSecondaryLevelInfo?`+`parentId=${id}`, diff --git a/src/views/system/station/index.vue b/src/views/system/station/index.vue index 83457c4..52e9c2c 100644 --- a/src/views/system/station/index.vue +++ b/src/views/system/station/index.vue @@ -436,7 +436,7 @@ @@ -623,7 +623,7 @@ export default { components: { stationAcatar, editor }, name: "Station", data() { - var checkMobile = (rule, value, cb) => { + var checkMobile = (rule, value, cb) => { // 验证手机号的正则表达式 const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/; @@ -637,15 +637,16 @@ export default { // 验证手机号的正则表达式 const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/; - if (!value) { //所以当没有值的时候,我们直接callback,让他不校验直接执行下一步 - return cb() - }else{ - if (regMobile.test(value)) { + if (!value) { + //所以当没有值的时候,我们直接callback,让他不校验直接执行下一步 return cb(); - }else{ - cb(new Error("请输入正确的联系电话")); + } else { + if (regMobile.test(value)) { + return cb(); + } else { + cb(new Error("请输入正确的联系电话")); + } } - } }; return { imageUrl: "", @@ -668,6 +669,7 @@ export default { //护理类型 nurseTypeCode: "nurse_type_code", nurseStationTypelist: [], + nurseStationType2:null, //shengshiqu value3: "", value2: "", @@ -925,13 +927,14 @@ export default { }, // 表单重置 reset() { + this.nurseStationType2 = []; this.form = { id: null, areaCode: null, nurseStationCode: null, nurseStationName: null, nurseStationType: null, - nurseStationType2: [], + agencyIntroduce: null, nurseStationDescription: null, longitude: null, @@ -1047,17 +1050,19 @@ export default { this.form.nurseStationType.length == 0 ) { } else { - this.form.nurseStationType2 = this.form.nurseStationType.split(","); - this.form.nurseStationType = this.form.nurseStationType2; + this.nurseStationType2 = this.form.nurseStationType.split(","); + this.form.nurseStationType = this.nurseStationType2; } // this.form.nurseStationLabelList = []; this.title = "修改护理站信息"; getSubordinateRegions(response.data.areaCode).then((res) => { - this.value = String(res.data.provinceCode); - this.value1 = res.data.cityName; - this.value2 = res.data.regionName; - this.value3 = res.data.streetName; - console.log(typeof this.value); + if (res.data) { + this.value = String(res.data.provinceCode); + this.value1 = res.data.cityName; + this.value2 = res.data.regionName; + this.value3 = res.data.streetName; + console.log(typeof this.value); + } }); }) .then(() => { @@ -1096,17 +1101,18 @@ export default { }); this.open = true; this.loading = false; + console.log(this.form); }); }, /** 提交按钮 */ submitForm() { this.form.nurseStationLabelList = this.looknurseStationLabel; - this.form.nurseStationType = this.form.nurseStationType2; + this.form.nurseStationType = this.nurseStationType2; console.log(this.form); this.$refs["form"].validate((valid) => { if (valid) { this.form.areaCode = Number(this.form.areaCode); - this.form.nurseStationType = this.form.nurseStationType2.join(","); + this.form.nurseStationType = this.nurseStationType2.join(","); if (this.form.id != null) { updateStation(this.form).then((response) => { this.$modal.msgSuccess("修改成功");