This commit is contained in:
Paidax
2024-11-22 16:56:54 +08:00
parent 9c21da4f0f
commit f5d37974cd
146 changed files with 8256 additions and 7800 deletions
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#-->
<style>
.van-doc-card {
background-color: #fff;
border-radius: 6px;
@@ -30,7 +29,7 @@ layout("/mobile/platform.html"){
}
.van-card-body {
padding: 0px 10px 0px 10px
padding: 0px 10px 0px 10px;
}
.join_content {
@@ -101,7 +100,8 @@ layout("/mobile/platform.html"){
width: 90% !important;
}
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after {
.van-hairline--top-bottom::after,
.van-hairline-unset--top-bottom::after {
border: none;
}
@@ -116,27 +116,20 @@ layout("/mobile/platform.html"){
padding-left: 20px;
padding-right: 10px;
position: relative;
height: 100px
height: 100px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="体检套餐选择" left-arrow
@click-left="history.go(-1)"></van-nav-bar>
<van-nav-bar title="体检套餐选择" left-arrow @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
</van-sticky>
<div class="join_content">
<van-form @submit="joinSubmit">
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
体检套餐
</div>
<div class="van-card-header">体检套餐</div>
<div class="van-card-body">
<van-radio-group v-model="formData.subjectId" class="basic">
<van-cell-group>
@@ -144,9 +137,9 @@ layout("/mobile/platform.html"){
<template #label>
<div style="display: flex; justify-content: space-between; width: 100%; padding: 10px 0">
<van-image
:src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
fit="contain"
style="width: 60px; height: 60px; border-radius: 10px; margin-left: 10px"
:src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
fit="contain"
style="width: 60px; height: 60px; border-radius: 10px; margin-left: 10px"
></van-image>
<div>{{ item.optionName }}</div>
</div>
@@ -165,14 +158,19 @@ layout("/mobile/platform.html"){
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
基础信息
</div>
<div class="van-card-header">基础信息</div>
<div class="van-card-body">
<van-field @click="campusVisible = true" readonly is-link label="院区" name="campus"
placeholder="请选择体检院区" v-model="formData.campusName"
:rules="[{ required: true }]"></van-field>
<!-- <van-field :rules="[{ required: true, message: '请选择家属是否体检' }]" label="家属体检" name="validator">
<van-field
@click="campusVisible = true"
readonly
is-link
label="院区"
name="campus"
placeholder="请选择体检院区"
v-model="formData.campusName"
:rules="[{ required: true }]"
></van-field>
<!-- <van-field :rules="[{ required: true, message: '请选择家属是否体检' }]" label="家属体检" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.isFamily" disabled>
<van-radio name="是" shape="square">是</van-radio>
@@ -186,7 +184,7 @@ layout("/mobile/platform.html"){
<div class="van-doc-card" style="margin-bottom: 16px" v-if="formData.isFamily === '是'">
<div></div>
<div class="van-card-header" style="display: flex; justify-content: space-between; align-items: center">
<span style="float:left;">家属信息</span>
<span style="float: left">家属信息</span>
<div>
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除家属</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加家属</van-tag>
@@ -195,8 +193,13 @@ layout("/mobile/platform.html"){
<div v-if="formData.companionList.length > 0" class="van-card-body">
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.companionList" :title="'家属' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<van-field
label="姓名"
name="userName"
placeholder="请填写姓名"
v-model="item.userName"
:rules="[{ required: true }]"
></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
@@ -213,64 +216,79 @@ layout("/mobile/platform.html"){
</van-radio-group>
</template>
</van-field>
<van-field label="年龄" name="age" placeholder="请填写年龄" type="digit"
:rules="[{ required: true }]" v-model="item.age"></van-field>
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号" type="digit"
:rules="[{ required: true }]" v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号" type="digit"
:rules="[{ required: true }]" v-model="item.mobile"></van-field>
<van-field
label="年龄"
name="age"
placeholder="请填写年龄"
type="digit"
:rules="[{ required: true }]"
v-model="item.age"
></van-field>
<van-field
label="身份证号"
name="idCard"
placeholder="请填写身份证号"
type="digit"
:rules="[{ required: true }]"
v-model="item.idCard"
></van-field>
<van-field
label="手机号"
name="mobile"
placeholder="请填写手机号"
type="digit"
:rules="[{ required: true }]"
v-model="item.mobile"
></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="empty_text">
<span>
如有家属,请添加家属
</span>
<span>如有家属,请添加家属</span>
</div>
</div>
<div class="footer">
<van-button class="join join_submit">提交选择</van-button>
</div>
</van-form>
</div>
<!--体检院区弹出框-->
<van-popup position="bottom" round v-model="campusVisible">
<van-picker
title="院区" show-toolbar
:columns="campusList" value-key="campusName"
@confirm="(value, index) => {formData.campusName = value.campusName; formData.campus = value.id; campusVisible = false}"
@cancel="campusVisible = false">
</van-picker>
title="院区"
show-toolbar
:columns="campusList"
value-key="campusName"
@confirm="(value, index) => {formData.campusName = value.campusName; formData.campus = value.id; campusVisible = false}"
@cancel="campusVisible = false"
></van-picker>
</van-popup>
<!--查看说明-->
<van-popup position="bottom" round v-model="descVisible" :style="{ height: '60%' }">
<div v-html="desc" class="pre_text"></div>
</van-popup>
</div>
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [mobileMixins],
data() {
return {
id: '',
selectId: '',
id: "",
selectId: "",
active: 0,
project: {},
formData: {
companionList: [],
isFamily: '否',
isFamily: "否"
},
campusList: [],
campusVisible: false,
descVisible: false,
desc: '',
desc: ""
}
},
methods: {
@@ -279,111 +297,112 @@ layout("/mobile/platform.html"){
this.desc = o.description
this.descVisible = true
} else {
vant.Toast('暂无详细说明')
vant.Toast("暂无详细说明")
}
},
async joinSubmit() {
if (!this.formData.subjectId) {
vant.Toast('请选择体检套餐')
vant.Toast("请选择体检套餐")
return
}
//如果等于家属
if (this.project.healthCheckupType === 'js' && this.formData.companionList && this.formData.companionList.length === 0) {
vant.Toast('当前体检项目需要填写家属信息,请填写家属信息。')
if (this.project.healthCheckupType === "js" && this.formData.companionList && this.formData.companionList.length === 0) {
vant.Toast("当前体检项目需要填写家属信息,请填写家属信息。")
return
}
const p = this.project.healthCheckupProjectSubjects.find(o => o.id === this.formData.subjectId)
const res = await $.post('/mobile/healthCheckup/validCondition', {
cndId: p.conditionStructureId,
const p = this.project.healthCheckupProjectSubjects.find((o) => o.id === this.formData.subjectId)
const res = await $.post("/mobile/healthCheckup/validCondition", {
cndId: p.conditionStructureId
})
if (res.code !== 0) {
vant.Dialog.alert({
title: '提示',
title: "提示",
message: res.msg,
confirmButtonColor: '#1867b0'
confirmButtonColor: "#1867b0"
})
return
}
vant.Dialog.confirm({
title: '温馨提醒',
message: '您确定要选择' + p.optionName + '吗?',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
if (cloneData.isFmaily === '否') {
cloneData.companionList = []
}
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
cloneData.projectId = this.id
const resp = await $.post('/mobile/healthCheckup/doSubmit', {
userSelection: JSON.stringify(cloneData),
})
setTimeout(() => {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/mobile/healthCheckup/mine'
}
}, 1000)
}).catch(() => {
title: "温馨提醒",
message: "您确定要选择" + p.optionName + "吗?"
})
.then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: "努力提交中"
})
const cloneData = clone(this.formData)
if (cloneData.isFmaily === "否") {
cloneData.companionList = []
}
cloneData.companionList.forEach((item, index) => {
if (item.userName === "") {
cloneData.companionList.splice(index, 1)
}
})
cloneData.projectId = this.id
const resp = await $.post("/mobile/healthCheckup/doSubmit", {
userSelection: JSON.stringify(cloneData)
})
setTimeout(() => {
if (resp.code === 0) {
toast.message = "提交成功"
toast.type = "success"
} else {
toast.message = resp.msg
toast.type = "fail"
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = "/mobile/healthCheckup/mine"
}
}, 1000)
})
.catch(() => {})
},
addCompanion() {
this.formData.companionList.push({userName: '', sex: '', marry: '',})
this.formData.companionList.push({ userName: "", sex: "", marry: "" })
},
delCompanion() {
this.formData.companionList.splice(this.active, 1)
},
//查询有哪些体检套餐
async findSubject() {
const resp = await $.post('/platform/healthCheckup/project/mange/findOne', {id: this.id})
const resp = await $.post("/platform/healthCheckup/project/mange/findOne", { id: this.id })
this.project = resp.data
this.formData.isFamily = this.project.healthCheckupType === 'jzg' ? "否" : "是"
this.formData.isFamily = this.project.healthCheckupType === "jzg" ? "否" : "是"
//const sex = "${@shiro.getPrincipalProperty('sex')}";
//this.project.healthCheckupProjectSubjects = this.project.healthCheckupProjectSubjects.filter(o => o.sex === sex || o.sex === '' || o.sex === null)
},
//获取院区
async getCampus() {
const resp = await $.post('/mobile/healthCheckup/getCampus')
const resp = await $.post("/mobile/healthCheckup/getCampus")
this.campusList = resp.data
},
//获取报名信息
async getSelectInfo() {
const resp = await $.post('/mobile/healthCheckup/getSelectInfo', {id: this.selectId})
const resp = await $.post("/mobile/healthCheckup/getSelectInfo", { id: this.selectId })
this.formData = resp.data
const o = this.campusList.find(o => o.id === this.formData.campus)
const o = this.campusList.find((o) => o.id === this.formData.campus)
this.formData.campusName = o.campusName
},
}
},
async created() {
this.id = GetQueryString('projectId')
this.selectId = GetQueryString('selectId')
this.id = GetQueryString("projectId")
this.selectId = GetQueryString("selectId")
await this.getCampus()
if (GetQueryString('selectId')) {
if (GetQueryString("selectId")) {
await this.getSelectInfo()
}
await this.findSubject()
},
}
})
window.onload = () => {
window.addEventListener('pageshow', e => {
window.addEventListener("pageshow", (e) => {
if (e.persisted) {
window.location.reload()
}