|
@@ -33,6 +33,17 @@
|
|
|
class="header-city"
|
|
|
type="text"
|
|
|
/>
|
|
|
+
|
|
|
+ <input
|
|
|
+ disabled
|
|
|
+ readonly
|
|
|
+ @click="isShowCounty()"
|
|
|
+ v-model="county.county"
|
|
|
+ placeholder="区"
|
|
|
+ class="header-area"
|
|
|
+ type="text"
|
|
|
+ />
|
|
|
+ <!-- header-area -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<van-popup round position="bottom" :show="provinceShow">
|
|
@@ -63,6 +74,21 @@
|
|
|
"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
+
|
|
|
+ <van-popup round position="bottom" :show="countyShow">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ title="考场区县"
|
|
|
+ :columns="examCountyList"
|
|
|
+ value-key="county"
|
|
|
+ @confirm="getCountyName"
|
|
|
+ @cancel="
|
|
|
+ () => {
|
|
|
+ countyShow = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
</view>
|
|
|
<view class="content">
|
|
|
<view class="list">
|
|
@@ -107,8 +133,10 @@ export default {
|
|
|
query: {},
|
|
|
cityShow: false,
|
|
|
provinceShow: false,
|
|
|
+ countyShow: false,
|
|
|
examProviceList: [],
|
|
|
examCityList: [],
|
|
|
+ examCountyList: [],
|
|
|
examRoomList: [],
|
|
|
province: {
|
|
|
provinceId: "",
|
|
@@ -118,11 +146,26 @@ export default {
|
|
|
cityId: "",
|
|
|
city: "",
|
|
|
},
|
|
|
+ county: {
|
|
|
+ county: "",
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
searchRoadExamRoom(e) {
|
|
|
console.log(e.detail);
|
|
|
+ //初始化选项
|
|
|
+ this.province = {
|
|
|
+ provinceId: "",
|
|
|
+ province: "",
|
|
|
+ };
|
|
|
+ this.city = {
|
|
|
+ cityId: "",
|
|
|
+ city: "",
|
|
|
+ };
|
|
|
+ this.county = {
|
|
|
+ county: "",
|
|
|
+ };
|
|
|
api.exam
|
|
|
.studentExamInfoList({
|
|
|
name: e.detail,
|
|
@@ -150,6 +193,16 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ isShowCounty() {
|
|
|
+ if (this.city.cityId && this.city.city) {
|
|
|
+ this.countyShow = true;
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请先选择城市",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
goCourseCatalog(item) {
|
|
|
uni.navigateTo({
|
|
|
url:
|
|
@@ -163,6 +216,16 @@ export default {
|
|
|
this.city = e.detail.value;
|
|
|
uni.setStorageSync("roadExamCity", e.detail.value);
|
|
|
this.cityShow = false;
|
|
|
+ //清空选项
|
|
|
+ this.county = {
|
|
|
+ county: "",
|
|
|
+ };
|
|
|
+ //获取区县
|
|
|
+ api.exam
|
|
|
+ .studentExamInfoCountyCityId(e.detail.value.cityId)
|
|
|
+ .then((res) => {
|
|
|
+ this.examCountyList = res.data;
|
|
|
+ });
|
|
|
api.exam
|
|
|
.studentExamInfoList({
|
|
|
...this.city,
|
|
@@ -171,6 +234,19 @@ export default {
|
|
|
this.examRoomList = res.rows;
|
|
|
});
|
|
|
},
|
|
|
+ getCountyName(e) {
|
|
|
+ this.county = e.detail.value;
|
|
|
+ uni.setStorageSync("roadExamCounty", e.detail.value);
|
|
|
+ this.countyShow = false;
|
|
|
+
|
|
|
+ api.exam
|
|
|
+ .studentExamInfoList({
|
|
|
+ ...this.county,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.examRoomList = res.rows;
|
|
|
+ });
|
|
|
+ },
|
|
|
getExamCityAndProviceName(e) {
|
|
|
this.provinceShow = false;
|
|
|
this.province = e.detail.value;
|
|
@@ -178,6 +254,9 @@ export default {
|
|
|
cityId: "",
|
|
|
city: "",
|
|
|
};
|
|
|
+ this.county = {
|
|
|
+ county: "",
|
|
|
+ };
|
|
|
uni.setStorageSync("roadExamProvince", e.detail.value);
|
|
|
api.exam
|
|
|
.studentExamInfoCityProviceId(e.detail.value.provinceId)
|
|
@@ -218,46 +297,47 @@ export default {
|
|
|
city: result.data.city,
|
|
|
cityId: result.data.cityCode,
|
|
|
};
|
|
|
- if (that.city.cityId && that.province.provinceId) {
|
|
|
- api.exam.studentExamInfoGetProvice().then((res) => {
|
|
|
- that.examProviceList = res.data;
|
|
|
- if (
|
|
|
- that.examProviceList.some((item) => {
|
|
|
- return that.province.province == item.province;
|
|
|
- })
|
|
|
- ) {
|
|
|
- api.exam
|
|
|
- .studentExamInfoCityProviceId(that.province.provinceId)
|
|
|
- .then((res) => {
|
|
|
- that.examCityList = res.data;
|
|
|
+ that.county = { county: result.data.county };
|
|
|
|
|
|
- api.exam
|
|
|
- .studentExamInfoList({
|
|
|
- ...that.city,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- that.examRoomList = res.rows;
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.city = {
|
|
|
- city: "",
|
|
|
- cityId: "",
|
|
|
- };
|
|
|
- that.province = {
|
|
|
- province: "",
|
|
|
- provinceId: "",
|
|
|
- };
|
|
|
- api.exam
|
|
|
- .studentExamInfoList({
|
|
|
- ...that.city,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- that.examRoomList = res.rows;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ api.exam.studentExamInfoGetProvice().then((res) => {
|
|
|
+ that.examProviceList = res.data;
|
|
|
+ if (
|
|
|
+ that.examProviceList.some((item) => {
|
|
|
+ return that.province.province == item.province;
|
|
|
+ })
|
|
|
+ ) {
|
|
|
+ api.exam
|
|
|
+ .studentExamInfoCityProviceId(that.province.provinceId)
|
|
|
+ .then((res) => {
|
|
|
+ that.examCityList = res.data;
|
|
|
+
|
|
|
+ api.exam
|
|
|
+ .studentExamInfoList({
|
|
|
+ ...that.city,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ that.examRoomList = res.rows;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.city = {
|
|
|
+ city: "",
|
|
|
+ cityId: "",
|
|
|
+ };
|
|
|
+ that.province = {
|
|
|
+ province: "",
|
|
|
+ provinceId: "",
|
|
|
+ };
|
|
|
+ that.county = { county: "" };
|
|
|
+ api.exam
|
|
|
+ .studentExamInfoList({
|
|
|
+ ...that.city,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ that.examRoomList = res.rows;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
fail(res) {
|
|
@@ -320,7 +400,7 @@ export default {
|
|
|
height: 100rpx;
|
|
|
}
|
|
|
.header-province {
|
|
|
- width: 336rpx;
|
|
|
+ width: 210rpx;
|
|
|
height: 60rpx;
|
|
|
background: #fff;
|
|
|
border-radius: 40rpx;
|
|
@@ -329,7 +409,16 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.header-city {
|
|
|
- width: 336rpx;
|
|
|
+ width: 210rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ padding-left: 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .header-area {
|
|
|
+ width: 210rpx;
|
|
|
height: 60rpx;
|
|
|
background: #fff;
|
|
|
border-radius: 40rpx;
|