|
@@ -59,9 +59,9 @@ Page({
|
|
|
cacheArea: [] as { cityCode: string, shiftCityCode: string }[], // 临时存储的对应关系
|
|
|
showArea: false,
|
|
|
areaList: [] as any, // 省市区
|
|
|
- provinceCode: null, // 地区
|
|
|
- cityCode: null,
|
|
|
- regionCode: null,
|
|
|
+ provinceCode: "", // 地区
|
|
|
+ cityCode: "",
|
|
|
+ regionCode: "",
|
|
|
provinceName: "",
|
|
|
cityName: "",
|
|
|
regionName: "",
|
|
@@ -114,7 +114,7 @@ Page({
|
|
|
gender: params.gender + "",
|
|
|
provinceCode: params.provinceCode,
|
|
|
cityCode: params.cityCode,
|
|
|
- regionCode: params.regionCode,
|
|
|
+ regionCode: params.regionCode || "",
|
|
|
provinceName: params.provinceName,
|
|
|
cityName: params.cityName,
|
|
|
regionName: params.regionName,
|
|
@@ -138,6 +138,10 @@ Page({
|
|
|
const schoolAreaIndex = this.data.schoolAreaList.findIndex(((item: any) => {
|
|
|
return item.value === this.data.schoolAreaId
|
|
|
}))
|
|
|
+ // 获取学校列表之后 需要给tempChangeSchoolAreaId赋值 因为tempChangeSchoolAreaId默认选中第一个
|
|
|
+ this.setData({
|
|
|
+ tempChangeSchoolAreaId: params.schoolAreaId
|
|
|
+ })
|
|
|
// 筛选出年级 赋值班级
|
|
|
const gradeIndex = (this.data.gradeList[0]?.values || []).findIndex((item: any) => {
|
|
|
return item.value === params.currentGradeNum
|
|
@@ -194,6 +198,12 @@ Page({
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (selectedOptions[0].code == this.data.provinceCode && selectedOptions[1].code == this.data.cityCode && (selectedOptions[2]?.code || "") == this.data.regionCode) {
|
|
|
+ this.setData({
|
|
|
+ showArea: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.setData({
|
|
|
provinceCode: selectedOptions[0].code,
|
|
|
cityCode: selectedOptions[1].code,
|
|
@@ -321,6 +331,13 @@ Page({
|
|
|
}
|
|
|
const schoolAreaIndex = this.data.schoolAreaList.findIndex((item: any) => item.value === this.data.tempChangeSchoolAreaId)
|
|
|
const detail = this.data.schoolAreaList[schoolAreaIndex]
|
|
|
+ if (detail.value == this.data.schoolAreaId) {
|
|
|
+ this.setData({
|
|
|
+ showSchool: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.setData({
|
|
|
schoolAreaIndex,
|
|
|
schoolAreaName: detail.text,
|
|
@@ -503,6 +520,14 @@ Page({
|
|
|
const gradeIndex = (this.data.gradeList[0]?.values || []).findIndex((item: any) => {
|
|
|
return item.value === selectedOptions[0].value
|
|
|
})
|
|
|
+
|
|
|
+ if (selectedOptions[0].value == this.data.gradeId) {
|
|
|
+ this.setData({
|
|
|
+ showGrade: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.setData({
|
|
|
gradeId: selectedOptions[0].value,
|
|
|
gradeName: selectedOptions[0].text,
|
|
@@ -551,6 +576,14 @@ Page({
|
|
|
const classIndex = (this.data.classList[0]?.values || []).findIndex(((item: any) => {
|
|
|
return item.value === selectedOptions[0].value
|
|
|
}))
|
|
|
+
|
|
|
+ if (selectedOptions[0].value == this.data.classId) {
|
|
|
+ this.setData({
|
|
|
+ showClass: false
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.setData({
|
|
|
classId: selectedOptions[0].value,
|
|
|
className: selectedOptions[0].text,
|