diff --git a/src/main/java/io/v/nutz/zhgh/mobile/healthCheckup/MHealthCheckupListController.java b/src/main/java/io/v/nutz/zhgh/mobile/healthCheckup/MHealthCheckupListController.java index 44d1c64..00871de 100644 --- a/src/main/java/io/v/nutz/zhgh/mobile/healthCheckup/MHealthCheckupListController.java +++ b/src/main/java/io/v/nutz/zhgh/mobile/healthCheckup/MHealthCheckupListController.java @@ -217,4 +217,16 @@ public class MHealthCheckupListController { dao.execute(sql); return sql.getResult(); } + + + @At + @RequiresAuthentication + public Object getUserChoose(String projectId){ + HealthCheckupUserSelection fetch = dao.fetch(HealthCheckupUserSelection.class, Cnd.where("projectId", "=", projectId).and("selectUserId", "=", ShiroUtil.getUserId())); + if (Lang.isNotEmpty(fetch)) { + return Result.success().addData(fetch.getId()); + } else { + return Result.error(); + } + } } diff --git a/src/main/resources/views/mobile/healthCheckup/checkUp.html b/src/main/resources/views/mobile/healthCheckup/checkUp.html index 676c16f..1bc1ee8 100644 --- a/src/main/resources/views/mobile/healthCheckup/checkUp.html +++ b/src/main/resources/views/mobile/healthCheckup/checkUp.html @@ -535,13 +535,21 @@ layout("/mobile/platform.html"){ // this.formData.campusName = o.campusName }, async getUserInfo() { - const resp = await $.post("/mobile/healthCheckup/getUserInfo") - if (resp.code === 0) { - this.$set(this.formData, "username", resp.data.username) - this.$set(this.formData, "sex", resp.data.sex) - this.$set(this.formData, "mobile", resp.data.mobile) - this.$set(this.formData, "idcard", resp.data.idcard) - this.$set(this.formData, "age", resp.data.age) + const data = await $.post("/mobile/healthCheckup/getUserChoose", { + projectId: this.id + }) + if (data.code === 0) { + this.selectId = data.data + await this.getSelectInfo() + } else { + const resp = await $.post("/mobile/healthCheckup/getUserInfo") + if (resp.code === 0) { + this.$set(this.formData, "username", resp.data.username) + this.$set(this.formData, "sex", resp.data.sex) + this.$set(this.formData, "mobile", resp.data.mobile) + this.$set(this.formData, "idcard", resp.data.idcard) + this.$set(this.formData, "age", resp.data.age) + } } }, validateIdCard(idCard) { @@ -590,9 +598,10 @@ layout("/mobile/platform.html"){ this.id = GetQueryString("projectId") this.selectId = GetQueryString("selectId") await this.getCampus() - if (GetQueryString("selectId")) { + if (this.selectId) { await this.getSelectInfo() } else { + // 去查询有没有选过 this.getUserInfo() } await this.findSubject()