This commit is contained in:
Paidax
2025-06-04 10:51:35 +08:00
parent 7decda0510
commit 482e6da554
2 changed files with 29 additions and 8 deletions
@@ -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();
}
}
}
@@ -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()