体检管理需求整改
This commit is contained in:
@@ -48,6 +48,15 @@ const branchUnionManage = {
|
||||
<el-form-item label="校区" prop="campus">
|
||||
<dict-select v-model="formData.campus" code="USER_CAMPUS"></dict-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="formData.linkMan" maxlength="64" placeholder="联系人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" :prop="contactNumber">
|
||||
<el-input v-model="formData.contactNumber" placeholder="联系电话"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="formData.address" placeholder="地址"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
@@ -64,7 +73,11 @@ const branchUnionManage = {
|
||||
formRules: {
|
||||
name: [{ required: true, message: "请输入工会名称", trigger: ["change", "blur"] }],
|
||||
unionCode: [{ required: true, message: "请输入工会编码", trigger: ["change", "blur"] }],
|
||||
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }]
|
||||
campus: [{ required: false, message: "请选择校区", trigger: ["change", "blur"] }],
|
||||
contactNumber: [
|
||||
{ required: false, message: '手机号码',trigger: ['blur', 'change'] },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+53
-1
@@ -59,9 +59,17 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="体检项目">
|
||||
<el-radio-group v-model="pageForm.physicalExaminationStatus" size="medium" @change="doSearch" class="pr10">
|
||||
<el-radio-button :label="2">全部</el-radio-button>
|
||||
<el-radio-button :label="1">已体检</el-radio-button>
|
||||
<el-radio-button :label="0">未体检</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" size="small" @click="openImport"
|
||||
v-if="$auth.hasPermissionOr(['healthCheckup.list.import'])">导入名单
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="openImportMedicalExaminationReport"
|
||||
v-if="$auth.hasPermissionOr(['healthCheckup.list.import.medicalExamination'])">导入体检报告
|
||||
</el-button>
|
||||
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
||||
@click="doAudit(true)">确认名单
|
||||
</el-button>
|
||||
@@ -69,6 +77,12 @@ layout("/layouts/platform.html"){
|
||||
<el-button :disabled="!pageForm.projectId" type="danger" size="small"
|
||||
@click="doAudit(false)">取消确认
|
||||
</el-button>
|
||||
<el-button @click="msgNotSelect"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN'])">给未选发送消息
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
|
||||
@@ -176,6 +190,16 @@ layout("/layouts/platform.html"){
|
||||
width="700px"
|
||||
:extra_params="{healthProjectId:pageForm.projectId}"
|
||||
></excel-import>
|
||||
|
||||
<excel-import
|
||||
ref="excelImportExaminationReportRef"
|
||||
url="/platform/healthCheckup/list/mange/healthImportMedicalExaminationReport"
|
||||
template_url="/platform/healthCheckup/list/mange/downloadTemMedicalExaminationReport"
|
||||
:visible.sync="importVisibleExaminationReport"
|
||||
title="导入名单数据"
|
||||
width="700px"
|
||||
:extra_params="{healthProjectId:pageForm.projectId}"
|
||||
></excel-import>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -188,6 +212,7 @@ layout("/layouts/platform.html"){
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
physicalExaminationStatus: '2',
|
||||
},
|
||||
unions: [],
|
||||
units: [],
|
||||
@@ -201,7 +226,6 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'optionName', label: '所选套餐'},
|
||||
{prop: 'selectTime', label: '选择时间', width: "160px"},
|
||||
{prop: 'receiveAddress', label: '邮寄地址', width: "160px"},
|
||||
{prop: 'isAudit', label: '是否确认'},
|
||||
{prop: 'auditTime', label: '确认时间'},
|
||||
{prop: 'bz', label: '备注',width: "200px"},
|
||||
@@ -211,6 +235,7 @@ layout("/layouts/platform.html"){
|
||||
loading: false,
|
||||
//导入名单
|
||||
importVisible: false,
|
||||
importVisibleExaminationReport: false,
|
||||
|
||||
campusOptions: [],
|
||||
}
|
||||
@@ -319,6 +344,11 @@ layout("/layouts/platform.html"){
|
||||
|
||||
this.importVisible = true;
|
||||
},
|
||||
openImportMedicalExaminationReport() {
|
||||
// importUser
|
||||
|
||||
this.importVisibleExaminationReport = true;
|
||||
},
|
||||
successImport() {
|
||||
this.importLoading = false
|
||||
this.doSearch()
|
||||
@@ -339,6 +369,28 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
|
||||
},
|
||||
async msgNotSelect() {
|
||||
const confirm = await this.$confirm('是否给未体检的教职工发送提醒短信?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.tableLoading = true
|
||||
const resp = await $.get('/platform/healthCheckup/statistics/single/msgNotSelect', {
|
||||
projectId: this.pageForm.projectId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
setTimeout(() => {
|
||||
this.doSearch()
|
||||
this.tableLoading = false
|
||||
this.notifySuccess(resp.msg)
|
||||
}, 2000)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
|
||||
+7
-2
@@ -140,6 +140,11 @@ layout("/layouts/platform.html"){
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="温馨提示">
|
||||
<el-input type="textarea" v-model="formData.friendlyReminderText" :rows="4"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="体检套餐" prop="healthCheckupProjectSubjects">
|
||||
<el-card shadow="hover" v-for="(item,index) in formData.healthCheckupProjectSubjects"
|
||||
@@ -201,7 +206,6 @@ layout("/layouts/platform.html"){
|
||||
autosize
|
||||
class="text-input"
|
||||
data-type="option"
|
||||
readonly
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -653,9 +657,10 @@ layout("/layouts/platform.html"){
|
||||
formData.choiceTimeStart = formData.choiceTime[0]
|
||||
formData.choiceTimeEnd = formData.choiceTime[1]
|
||||
formData.healthCheckupProjectSubjects = JSON.stringify(this.formData.healthCheckupProjectSubjects)
|
||||
formData.activityGroupName = this.activityGroupList.find(v => v.groupId === this.formData.activityGroupId).groupName
|
||||
formData.activityGroupName = this.activityGroupList.find(v => v.groupId === this.formData.activityGroupId)?.groupName
|
||||
formData.deleteRowIds = JSON.stringify(this.deleteRowIds)
|
||||
formData.deleteSubjectIds = JSON.stringify(this.deleteSubjectIds)
|
||||
formData.friendlyReminderText = (formData.friendlyReminderText || '');
|
||||
const resp = await this.$axios.post("/platform/healthCheckup/project/mange/doAdd", formData)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
|
||||
+14
-6
@@ -357,6 +357,10 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async getHealthCheckupSubject() {
|
||||
this.projectSubjectOptions = []
|
||||
if(!this.pageForm.projectId){
|
||||
this.notifyError("请选择体检项目查询")
|
||||
return ;
|
||||
}
|
||||
const resp = await this.$axios.post("/platform/healthCheckup/project/mange/findOne", {id: this.pageForm.projectId})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data) {
|
||||
@@ -402,12 +406,16 @@ layout("/layouts/platform.html"){
|
||||
if (!this.pageForm.projectId) {
|
||||
this.tableData = []
|
||||
}
|
||||
|
||||
const resp = await this.$axios.post(loc() + '/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.tableList
|
||||
}
|
||||
loading.close()
|
||||
if(!this.pageForm.projectId){
|
||||
this.notifyError("请选择体检项目查询")
|
||||
this.tableData = []
|
||||
} else {
|
||||
const resp = await this.$axios.post(loc() + '/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.tableList
|
||||
}
|
||||
}
|
||||
loading.close()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageFormUnion.pageNumber = val;
|
||||
|
||||
+23
-2
@@ -29,6 +29,25 @@ layout("/layouts/platform_h5.html"){
|
||||
<table-list api="/platform/healthCheckup/h5/pageData" :page_form.sync="pageForm" ref="tableListRef"
|
||||
@ready="doSearch" img="cover">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="项目名称">
|
||||
<div style="display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start; /* 关键:改成顶部对齐 */
|
||||
width: 100%;">
|
||||
<span style="word-break: break-all;
|
||||
white-space: normal;
|
||||
flex: 1;
|
||||
padding-right: 5px;">{{ row.name }}</span>
|
||||
<span style="margin-left: 8px; font-size: 14px; white-space: nowrap;">
|
||||
<span v-if="row.selectCount > 0" style="color: rgb(29 179 76);">
|
||||
已报名
|
||||
</span>
|
||||
<span v-if="row.selectCount == 0" style="color: #ff0000;">
|
||||
未报名
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</table-column>
|
||||
<table-column label="开始时间">
|
||||
{{$moment(row.choiceTimeStart).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
@@ -38,7 +57,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<template v-if="$moment().isBefore($moment(row.choiceTimeEnd))">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<div class="action-btn" style="text-align: right" @click="onView(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>去报名</span>
|
||||
</div>
|
||||
@@ -90,7 +109,9 @@ layout("/layouts/platform_h5.html"){
|
||||
return;
|
||||
}
|
||||
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + row.id)
|
||||
// this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + row.id)
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/listParticulars?projectId=" + row.id)
|
||||
sessionStorage.setItem("friendlyReminderStatus", 0);
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<style scoped>
|
||||
.buttonClass {
|
||||
height: 93px;
|
||||
margin: 8px 0px;
|
||||
border-radius: 20px
|
||||
}
|
||||
.van-dialog__header {
|
||||
color: red;
|
||||
font-size: 20px;
|
||||
}
|
||||
.dialog-content > div {
|
||||
padding: 8px 20px;
|
||||
}
|
||||
</style>
|
||||
<div id="app">
|
||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="报名详情" placeholder
|
||||
fixed></van-nav-bar>
|
||||
<div style="padding: 15px 20px">
|
||||
<van-button round type="primary" size="large" color="#0db776" class="buttonClass" @click="userMessage"><van-icon name="user-o" size="27px"/> 基础信息确认</van-button>
|
||||
<van-button round type="primary" size="large" color="#2cabdd" class="buttonClass" @click="selectPhysicalExaminationHospital"><van-icon name="records-o" size="27px"/> 选择体检医院</van-button>
|
||||
<van-button round type="primary" size="large" color="#eca807" class="buttonClass" @click="minePhysicalExaminationHospital"><van-icon name="idcard" size="27px"/> 我的体检医院</van-button>
|
||||
</div>
|
||||
<van-dialog v-model="show" title="温馨提醒" v-if="show" @confirm="confirmClick"
|
||||
:confirm-button-text="confirmButtonText">
|
||||
<div class="dialog-content">
|
||||
<div style="white-space: pre-line">{{project.friendlyReminderText}}</div>
|
||||
</div>
|
||||
</van-dialog>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
confirmButtonText: "",
|
||||
amount: 0,
|
||||
project: {
|
||||
id: "",
|
||||
friendlyReminderText: "",
|
||||
},
|
||||
baseLoc: "",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
userMessage() {
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/userBaseMessage?projectId=" + this.project.id);
|
||||
},
|
||||
selectPhysicalExaminationHospital() {
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/projectManageForm?projectId=" + this.project.id);
|
||||
},
|
||||
minePhysicalExaminationHospital() {
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/mine?projectId=" + this.project.id);
|
||||
},
|
||||
confirmClick() {
|
||||
sessionStorage.setItem("friendlyReminderStatus", 1);
|
||||
},
|
||||
// 查询体检套餐
|
||||
async findSubject(id) {
|
||||
try {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {id});
|
||||
this.project = resp.data || {};
|
||||
} catch (error) {
|
||||
vant.Toast('获取体检项目失败');
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let projectId = GetQueryString("projectId");
|
||||
this.findSubject(projectId);
|
||||
let friendlyReminderStatus = sessionStorage.getItem("friendlyReminderStatus");
|
||||
if (friendlyReminderStatus == "0" ) {
|
||||
this.show = true;
|
||||
let count = 5;
|
||||
this.confirmButtonText = '已悉知(' + count + ')'
|
||||
let timer = setInterval(() => {
|
||||
count--;
|
||||
this.confirmButtonText = '已悉知(' + count + ')'
|
||||
if (count <= 0) {
|
||||
this.confirmButtonText = '已悉知';
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+12
-14
@@ -4,25 +4,20 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的体检" placeholder fixed></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-tabs v-model="pageForm.status"
|
||||
@change="onStatusChange">
|
||||
<van-tab title="进行中" name="ongoing"></van-tab>
|
||||
<van-tab title="已结束" name="finished"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
|
||||
<table-list api="/platform/healthCheckup/h5/mineData" :page_form.sync="pageForm" ref="tableListRef"
|
||||
@ready="doSearch" title="healthCheckupName">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="项目名称">{{row.name}}</table-column>
|
||||
<tableR-column label="项目名称">{{row.name}}</tableR-column>
|
||||
<table-column label="开始时间">{{row.choiceTimeStart}}</table-column>
|
||||
<table-column label="结束时间">{{row.choiceTimeEnd}}</table-column>
|
||||
<table-column label="选择医院">{{row.optionName}}</table-column>
|
||||
<table-column label="邮寄地址">{{row.receiveAddress}}</table-column>
|
||||
<!-- <table-column label="邮寄地址">{{row.receiveAddress}}</table-column>-->
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="look(row)">
|
||||
<van-icon name="eye-o" />
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="edit(row)" v-if="new Date().getTime() < new Date(row.choiceTimeEnd).getTime()">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>修改</span>
|
||||
@@ -33,8 +28,6 @@ layout("/layouts/platform_h5.html"){
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
@@ -52,7 +45,8 @@ layout("/layouts/platform_h5.html"){
|
||||
totalCount: 0,
|
||||
year: "",
|
||||
status: "ongoing", // 默认为进行中
|
||||
name: "" // 添加搜索名称字段
|
||||
name: "", // 添加搜索名称字段
|
||||
projectId: ""
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -107,7 +101,11 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$set(this.pageForm, "year", this.yearList[0].value)
|
||||
// 初始化状态
|
||||
this.$set(this.pageForm, "status", "ongoing")
|
||||
this.pageForm.projectId = GetQueryString("projectId");
|
||||
},
|
||||
look() {
|
||||
this.$pjaxReplace("/platform/healthCheckup/h5/physicalExaminationList?projectId=" + this.pageForm.projectId)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
|
||||
+501
@@ -0,0 +1,501 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="体检套餐选择" placeholder
|
||||
fixed></van-nav-bar>
|
||||
|
||||
<div class="form-container">
|
||||
<van-form ref="formRef" @submit="doSubmit">
|
||||
<van-cell-group title="基础信息">
|
||||
<van-field
|
||||
input-align="right"
|
||||
label="身份证号"
|
||||
name="idCard"
|
||||
readonly
|
||||
required
|
||||
placeholder="请联系校工会补充身份证号"
|
||||
v-model="formData.idCard"
|
||||
:rules="[{ required: true, message: '请输入身份证号' }]">
|
||||
</van-field>
|
||||
<van-cell title="人员类型">{{formData.userState}}</van-cell>
|
||||
<van-field
|
||||
input-align="right"
|
||||
readonly
|
||||
required
|
||||
label="婚姻状况"
|
||||
name="marriage"
|
||||
placeholder="请联系校工会补充婚姻状况"
|
||||
v-model="formData.marriage"
|
||||
:rules="[{ required: true, message: '请选择婚姻状况' }]"></van-field>
|
||||
|
||||
<van-cell title="出生年月">{{$moment(formData.birthday).format('YYYY-MM-DD')}}</van-cell>
|
||||
<van-cell title="单位">{{formData.unitName}}</van-cell>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="本年度预约体检医院">
|
||||
<van-cell title="本年度预约体检医院">{{getSelectedOptionName}}</van-cell>
|
||||
<van-field
|
||||
input-align="right"
|
||||
readonly
|
||||
required
|
||||
label="所选医院额度"
|
||||
name="marriage"
|
||||
placeholder="请选择医院"
|
||||
v-model="formData.money"
|
||||
:rules="[{ required: true, message: '请选择医院' }]"></van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="上年度预约体检医院">
|
||||
<div class="van-card-body">
|
||||
<van-cell title="上年度体检医院" :value="formData.lastYearHospital" />
|
||||
</div>
|
||||
</van-cell-group>
|
||||
<!-- <van-cell-group title="体检报告邮寄地址">-->
|
||||
<!-- <van-radio-group v-model="formData.postMethod" disabled>-->
|
||||
<!-- <van-cell-group>-->
|
||||
<!-- <van-cell title="单位" >-->
|
||||
<!-- <template #right-icon>-->
|
||||
<!-- <van-radio name="1"></van-radio>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- <van-cell title="自选" >-->
|
||||
<!-- <template #right-icon>-->
|
||||
<!-- <van-radio name="2"></van-radio>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- </van-cell-group>-->
|
||||
<!-- </van-radio-group>-->
|
||||
<!-- <template>-->
|
||||
<!-- <van-field-->
|
||||
<!-- v-if="formData.postMethod === '2'"-->
|
||||
<!-- v-model="formData.receiveAddress"-->
|
||||
<!-- label="邮寄地址"-->
|
||||
<!-- placeholder="请选择邮寄地址"-->
|
||||
<!-- readonly-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- autosize-->
|
||||
<!-- rows="2"-->
|
||||
<!-- is-link-->
|
||||
<!-- @click="editAddressPopup = true"-->
|
||||
<!-- required-->
|
||||
<!-- ></van-field>-->
|
||||
<!-- <van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>-->
|
||||
<!-- <van-cell title="体检报告">-->
|
||||
<!-- <div v-html="formData.medicalExamination"></div>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell-group>-->
|
||||
|
||||
<van-cell-group title="家属信息" v-if="formData.isFamily === '是'">
|
||||
<div style="padding: 10px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
||||
<span>家属信息</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="formData.companionList && formData.companionList.length > 0">
|
||||
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
|
||||
<van-tab
|
||||
v-for="(item, index) in formData.companionList"
|
||||
:key="index"
|
||||
:title="'家属' + (index + 1)">
|
||||
<van-field
|
||||
label="姓名"
|
||||
name="userName"
|
||||
placeholder="请填写姓名"
|
||||
v-model="item.userName"
|
||||
:rules="[{ required: true, message: '请填写姓名' }]">
|
||||
</van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择性别' }]"
|
||||
label="性别"
|
||||
name="sex">
|
||||
<template #input>
|
||||
<van-radio-group direction="horizontal" v-model="item.sex">
|
||||
<van-radio name="男" shape="square">男</van-radio>
|
||||
<van-radio name="女" shape="square">女</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择婚否' }]"
|
||||
label="婚否"
|
||||
name="marry">
|
||||
<template #input>
|
||||
<van-radio-group direction="horizontal" v-model="item.marry">
|
||||
<van-radio name="未婚" shape="square">未婚</van-radio>
|
||||
<van-radio name="已婚" shape="square">已婚</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field
|
||||
label="年龄"
|
||||
name="age"
|
||||
placeholder="请填写年龄"
|
||||
type="digit"
|
||||
:rules="[{ required: true, message: '请填写年龄' }]"
|
||||
v-model="item.age">
|
||||
</van-field>
|
||||
<van-field
|
||||
label="身份证号"
|
||||
name="idCard"
|
||||
placeholder="请填写身份证号"
|
||||
type="digit"
|
||||
:rules="[{ required: true, message: '请填写身份证号' }]"
|
||||
v-model="item.idCard">
|
||||
</van-field>
|
||||
<van-field
|
||||
label="手机号"
|
||||
name="mobile"
|
||||
placeholder="请填写手机号"
|
||||
type="digit"
|
||||
:rules="[{ required: true, message: '请填写手机号' }]"
|
||||
v-model="item.mobile">
|
||||
</van-field>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</div>
|
||||
<div v-else class="empty_text">
|
||||
<span>如有家属,请添加家属</span>
|
||||
</div>
|
||||
</div>
|
||||
</van-cell-group>
|
||||
</van-form>
|
||||
</div>
|
||||
|
||||
<!--体检院区弹出框-->
|
||||
<van-action-sheet title="体检院区" v-model="campusVisible">
|
||||
<van-picker
|
||||
title="院区"
|
||||
show-toolbar
|
||||
:columns="campusList"
|
||||
value-key="campusName"
|
||||
@confirm="onCampusConfirm"
|
||||
@cancel="campusVisible = false">
|
||||
</van-picker>
|
||||
</van-action-sheet>
|
||||
|
||||
<!--查看说明-->
|
||||
<van-action-sheet title="医院说明" v-model="descVisible" :style="{ height: '60%' }">
|
||||
<div class="form-container" style="margin: 10px;">
|
||||
<van-cell-group title="说明"></van-cell-group>
|
||||
<div v-html="desc" class="pre_text"></div>
|
||||
<div style="margin-top: 10px">
|
||||
<van-cell-group title="以下内容由医院方提供"></van-cell-group>
|
||||
<file-preview :files="files" complete_result></file-preview>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
<!-- 收货地址选择弹窗 -->
|
||||
<van-action-sheet v-model="editAddressPopup" title="选择收货地址" :round="true">
|
||||
<div style="padding: 16px 0 0">
|
||||
<div
|
||||
v-for="address in addressOptions"
|
||||
:key="address.id"
|
||||
class="address-item"
|
||||
@click="selectAddress(address)"
|
||||
style="padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start">
|
||||
<div style="flex: 1">
|
||||
<div style="font-size: 16px; font-weight: 500; color: #323233; margin-bottom: 4px">
|
||||
{{ address.userName }} {{ address.tel }}
|
||||
</div>
|
||||
<div style="font-size: 14px; color: #646566; line-height: 1.4">
|
||||
{{ address.province }}{{ address.city }}{{ address.county }}{{ address.addressDetail
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<van-tag v-if="address.isDefault" type="primary" size="mini" style="margin-left: 8px">默认
|
||||
</van-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="addressOptions.length === 0"
|
||||
style="text-align: center; padding: 40px 16px; color: #969799">暂无收货地址
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 16px; border-top: 1px solid #f0f0f0; background: #fafafa">
|
||||
<van-button type="info" block round @click="goToAddressManage">收货地址管理</van-button>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["ASSET_USAGE_STATE"],
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
formData: {
|
||||
subjectId: '',
|
||||
campus: '',
|
||||
campusName: '',
|
||||
isFamily: '否',
|
||||
companionList: [],
|
||||
projectId: '',
|
||||
postMethod: ''
|
||||
},
|
||||
assetUsageStateNameOption: [],
|
||||
showAssetUsageStateNamePopup: false,
|
||||
assetUseUserOption: [],
|
||||
assetUseNameShow: false,
|
||||
searchKeyword: "",
|
||||
active: 0,
|
||||
campusList: [],
|
||||
campusVisible: false,
|
||||
descVisible: false,
|
||||
desc: '',
|
||||
files: [],
|
||||
project: {},
|
||||
|
||||
marriageList: ["已婚", "未婚"],
|
||||
marriageVisible: false,
|
||||
|
||||
editAddressPopup: false,
|
||||
addressOptions: [],
|
||||
userBaseMessage: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 根据 subjectId 自动匹配出 optionName
|
||||
getSelectedOptionName() {
|
||||
if (!this.formData.subjectId) return ''
|
||||
if (!this.project?.healthCheckupProjectSubjects) return ''
|
||||
const item = this.project.healthCheckupProjectSubjects.find(
|
||||
item => item.id == this.formData.subjectId
|
||||
)
|
||||
return item ? item.optionName : ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 选择收货地址
|
||||
selectAddress(address) {
|
||||
this.formData.receiveAddress =
|
||||
address.userName + " " + address.tel + " " + address.province + address.city + address.county + address.addressDetail
|
||||
this.editAddressPopup = false
|
||||
},
|
||||
// 跳转到地址管理页面
|
||||
goToAddressManage() {
|
||||
this.$pjaxReplace("/platform/h5/welfare/address/list")
|
||||
},
|
||||
// 获取收货地址
|
||||
getAddress() {
|
||||
this.$axios.post("/platform/welfare/addressManage/selectUserAddress").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.addressOptions = resp.data
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
addressClick() {
|
||||
|
||||
},
|
||||
// 打开表单
|
||||
async initData() {
|
||||
await this.getCampus()
|
||||
this.getAddress()
|
||||
let projectId = GetQueryString("projectId")
|
||||
await this.findSubject(projectId);
|
||||
if (projectId) {
|
||||
const {id, userState, marriage, birthday, unit} = this.$store.state.user
|
||||
await this.selectInfo(projectId);
|
||||
await this.findUserBaseMessage(projectId, id);
|
||||
await this.findLastYearHospital(projectId, id);
|
||||
this.$set(this.formData, 'projectId', projectId)
|
||||
this.$set(this.formData, 'idCard', this.userBaseMessage?.card)
|
||||
this.$set(this.formData, 'userState', userState)
|
||||
this.$set(this.formData, 'marriage', this.userBaseMessage?.marriage)
|
||||
this.$set(this.formData, 'birthday', birthday)
|
||||
this.$set(this.formData, 'unitName', unit.name)
|
||||
this.$set(this.formData, 'postMethod', this.formData?.postMethod ? this.formData.postMethod : "1")
|
||||
this.$set(this.formData, 'receiveAddress', this.formData?.receiveAddress ? this.formData.receiveAddress : unit.name)
|
||||
this.$set(this.formData, 'medicalExamination', this.formData?.medicalExamination)
|
||||
}
|
||||
},
|
||||
clickRadio(item) {
|
||||
const toast = this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true,
|
||||
message: '查询中....',
|
||||
});
|
||||
$.post("/platform/healthCheckup/h5/getSubjectMoney", {
|
||||
id: item.id,
|
||||
marriage: this.formData.marriage
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData, 'subjectId', item.id)
|
||||
this.$set(this.formData, 'money', resp.data.money)
|
||||
this.$set(this.formData, 'subjectMoneyId', resp.data.subjectMoneyId)
|
||||
} else {
|
||||
this.$set(this.formData, 'money', 0)
|
||||
}
|
||||
toast.clear();
|
||||
})
|
||||
},
|
||||
async selectInfo(projectId) {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/selectInfo', {projectId: projectId});
|
||||
if (resp.data !== null) {
|
||||
this.formData = resp.data;
|
||||
}
|
||||
},
|
||||
|
||||
// 查看说明
|
||||
viewDesc(item) {
|
||||
if (item.description || item.files) {
|
||||
this.files = item.files;
|
||||
this.desc = item.description;
|
||||
this.descVisible = true;
|
||||
} else {
|
||||
vant.Toast('暂无详细说明');
|
||||
}
|
||||
},
|
||||
|
||||
// 执行提交
|
||||
async doSubmit() {
|
||||
const formData = clone(this.formData);
|
||||
if (!formData.receiveAddress) {
|
||||
this.$toast.fail('请填写邮寄地址!')
|
||||
}
|
||||
|
||||
const subject = this.project.healthCheckupProjectSubjects.find(v => v.id === formData.subjectId)
|
||||
|
||||
this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要提交选择的【' + subject.optionName + '】吗?',
|
||||
}).then(() => {
|
||||
const toast = this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true,
|
||||
message: '提交中....',
|
||||
});
|
||||
/* if (formData.isFamily === '否') {
|
||||
formData.companionList = [];
|
||||
} else {
|
||||
// 过滤空的家属信息
|
||||
formData.companionList = formData.companionList.filter(item => item.userName && item.userName.trim() !== '');
|
||||
}*/
|
||||
this.$axios.post('/platform/healthCheckup/h5/doSubmit', {
|
||||
userSelection: JSON.stringify(formData),
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
toast.clear();
|
||||
this.$toast.success(resp.msg)
|
||||
this.historyBack()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
// 添加家属
|
||||
addCompanion() {
|
||||
// 检查是否已达到最大数量限制
|
||||
if (this.companionList && this.formData.companionList.length >= 5) {
|
||||
vant.Toast('最多只能添加5个家属');
|
||||
return;
|
||||
}
|
||||
if (!this.formData.companionList) {
|
||||
this.$set(this.formData, 'companionList', []);
|
||||
}
|
||||
this.formData.companionList.push({
|
||||
userName: '', sex: '', marry: '', age: '', idCard: '', mobile: ''
|
||||
});
|
||||
},
|
||||
|
||||
// 删除家属
|
||||
delCompanion() {
|
||||
if (this.formData.companionList && this.formData.companionList.length > 0) {
|
||||
this.formData.companionList.splice(this.active, 1);
|
||||
// 确保active索引有效
|
||||
if (this.active >= this.formData.companionList.length && this.active > 0) {
|
||||
this.active = this.formData.companionList.length - 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 院区选择确认
|
||||
onCampusConfirm(value) {
|
||||
this.formData.campusName = value.campusName;
|
||||
this.formData.campus = value.id;
|
||||
this.campusVisible = false;
|
||||
},
|
||||
|
||||
// 婚姻状况确认
|
||||
onMarriageConfirm(value) {
|
||||
this.$set(this.formData, 'marriage', value)
|
||||
this.$set(this.formData, 'subjectId', null)
|
||||
this.marriageVisible = false;
|
||||
},
|
||||
|
||||
// 查询体检套餐
|
||||
async findSubject(id) {
|
||||
try {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {
|
||||
id: id
|
||||
});
|
||||
this.project = resp.data || {};
|
||||
} catch (error) {
|
||||
vant.Toast('获取体检套餐失败');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取院区
|
||||
async getCampus() {
|
||||
try {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/getCampus');
|
||||
this.campusList = resp.data || [];
|
||||
} catch (error) {
|
||||
vant.Toast('获取院区失败');
|
||||
}
|
||||
},
|
||||
async findUserBaseMessage(projectId, userId) {
|
||||
//获取用户基础信息
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
|
||||
if (resp.data !== null) {
|
||||
this.userBaseMessage = resp.data;
|
||||
}
|
||||
},
|
||||
async findLastYearHospital(projectId, userId,subjectId) {
|
||||
//获取上年度体检医院
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/findLastYearHospital', {
|
||||
projectId,
|
||||
selectUserId: userId
|
||||
});
|
||||
if (resp.data !== null) {
|
||||
this.$set(this.formData, 'lastYearHospital', resp.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
+72
-49
@@ -38,13 +38,11 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-radio-group v-model="formData.subjectId" class="basic">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
v-for="item in project.healthCheckupProjectSubjects"
|
||||
v-for="(item,index) in project.healthCheckupProjectSubjects"
|
||||
:key="item.id"
|
||||
:title="item.optionName">
|
||||
:title="(index + 1) + '、 ' +item.optionName">
|
||||
<template #label>
|
||||
<div style="display: flex; justify-content: space-between; margin-left: 8px">
|
||||
<!-- <div>{{ item.optionName }}</div>-->
|
||||
<div></div>
|
||||
<div @click.stop="viewDesc(item)" style="color: #0e78c5">查看说明</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -65,40 +63,45 @@ layout("/layouts/platform_h5.html"){
|
||||
v-model="formData.money"
|
||||
:rules="[{ required: true, message: '请选择医院' }]"></van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="体检报告邮寄地址">
|
||||
<van-radio-group v-model="formData.postMethod">
|
||||
<van-cell-group>
|
||||
<van-cell title="单位" clickable
|
||||
@click="formData.postMethod = '1';formData.receiveAddress=formData.unitName">
|
||||
<template #right-icon>
|
||||
<van-radio name="1"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="自选" clickable
|
||||
@click="formData.postMethod = '2';formData.receiveAddress=''">
|
||||
<template #right-icon>
|
||||
<van-radio name="2"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
<template>
|
||||
<van-field
|
||||
v-if="formData.postMethod === '2'"
|
||||
v-model="formData.receiveAddress"
|
||||
label="邮寄地址"
|
||||
placeholder="请选择邮寄地址"
|
||||
readonly
|
||||
type="textarea"
|
||||
autosize
|
||||
rows="2"
|
||||
is-link
|
||||
@click="editAddressPopup = true"
|
||||
required
|
||||
></van-field>
|
||||
<van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>
|
||||
</template>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="上年度预约体检医院">
|
||||
<div class="van-card-body">
|
||||
<van-cell title="上年度体检医院" :value="formData.lastYearHospital" />
|
||||
</div>
|
||||
</van-cell-group>
|
||||
<!-- <van-cell-group title="体检报告邮寄地址">-->
|
||||
<!-- <van-radio-group v-model="formData.postMethod">-->
|
||||
<!-- <van-cell-group>-->
|
||||
<!-- <van-cell title="单位" clickable-->
|
||||
<!-- @click="formData.postMethod = '1';formData.receiveAddress=formData.unitName">-->
|
||||
<!-- <template #right-icon>-->
|
||||
<!-- <van-radio name="1"></van-radio>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- <van-cell title="自选" clickable-->
|
||||
<!-- @click="formData.postMethod = '2';formData.receiveAddress=''">-->
|
||||
<!-- <template #right-icon>-->
|
||||
<!-- <van-radio name="2"></van-radio>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell>-->
|
||||
<!-- </van-cell-group>-->
|
||||
<!-- </van-radio-group>-->
|
||||
<!-- <template>-->
|
||||
<!-- <van-field-->
|
||||
<!-- v-if="formData.postMethod === '2'"-->
|
||||
<!-- v-model="formData.receiveAddress"-->
|
||||
<!-- label="邮寄地址"-->
|
||||
<!-- placeholder="请选择邮寄地址"-->
|
||||
<!-- readonly-->
|
||||
<!-- type="textarea"-->
|
||||
<!-- autosize-->
|
||||
<!-- rows="2"-->
|
||||
<!-- is-link-->
|
||||
<!-- @click="editAddressPopup = true"-->
|
||||
<!-- required-->
|
||||
<!-- ></van-field>-->
|
||||
<!-- <van-cell title="邮寄地址" v-else>{{formData.receiveAddress}}</van-cell>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-cell-group>-->
|
||||
|
||||
<!-- <van-cell-group title="基础信息">
|
||||
<div class="van-card-body">
|
||||
@@ -309,7 +312,8 @@ layout("/layouts/platform_h5.html"){
|
||||
marriageVisible: false,
|
||||
|
||||
editAddressPopup: false,
|
||||
addressOptions: []
|
||||
addressOptions: [],
|
||||
userBaseMessage: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -348,14 +352,17 @@ layout("/layouts/platform_h5.html"){
|
||||
async initData() {
|
||||
await this.getCampus()
|
||||
this.getAddress()
|
||||
await this.findSubject(GetQueryString("projectId"))
|
||||
if (GetQueryString("projectId")) {
|
||||
await this.selectInfo(GetQueryString("projectId"));
|
||||
const {idCard, userState, marriage, birthday, unit} = this.$store.state.user
|
||||
this.$set(this.formData, 'projectId', GetQueryString("projectId"))
|
||||
this.$set(this.formData, 'idCard', idCard)
|
||||
this.$set(this.formData, 'userState', userState)
|
||||
this.$set(this.formData, 'marriage', marriage)
|
||||
let projectId = GetQueryString("projectId")
|
||||
await this.findSubject(projectId);
|
||||
if (projectId) {
|
||||
const {id, personType, birthday, unit} = this.$store.state.user
|
||||
await this.selectInfo(projectId);
|
||||
await this.findUserBaseMessage(projectId, id);
|
||||
await this.findLastYearHospital(projectId, id);
|
||||
this.$set(this.formData, 'projectId', projectId)
|
||||
this.$set(this.formData, 'idCard', this.userBaseMessage?.card)
|
||||
this.$set(this.formData, 'userState', personType)
|
||||
this.$set(this.formData, 'marriage', this.userBaseMessage?.marriage)
|
||||
this.$set(this.formData, 'birthday', birthday)
|
||||
this.$set(this.formData, 'unitName', unit.name)
|
||||
this.$set(this.formData, 'postMethod', this.formData?.postMethod ? this.formData.postMethod : "1")
|
||||
@@ -502,11 +509,27 @@ layout("/layouts/platform_h5.html"){
|
||||
} catch (error) {
|
||||
vant.Toast('获取院区失败');
|
||||
}
|
||||
}
|
||||
},
|
||||
async findUserBaseMessage(projectId, userId) {
|
||||
//获取用户基础信息
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
|
||||
if (resp.data !== null) {
|
||||
this.userBaseMessage = resp.data;
|
||||
}
|
||||
},
|
||||
async findLastYearHospital(projectId, userId,subjectId) {
|
||||
//获取上年度体检医院
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/findLastYearHospital', {
|
||||
projectId,
|
||||
selectUserId: userId
|
||||
});
|
||||
if (resp.data !== null) {
|
||||
this.$set(this.formData, 'lastYearHospital', resp.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="基础信息" placeholder
|
||||
fixed></van-nav-bar>
|
||||
<div class="form-container" v-cloak>
|
||||
<van-form ref="formRef" @submit="doSubmit">
|
||||
<van-cell-group>
|
||||
<van-field
|
||||
input-align="right"
|
||||
label="姓名"
|
||||
name="userName"
|
||||
readonly
|
||||
required
|
||||
v-model="formData.userName"
|
||||
:rules="[{ required: true, message: '请输入姓名' }]">
|
||||
</van-field>
|
||||
|
||||
<van-cell title="性别">
|
||||
<template #right-icon>
|
||||
<van-radio-group v-model="formData.sex" direction="horizontal">
|
||||
<van-radio name="男">男</van-radio>
|
||||
<van-radio name="女">女</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="年龄">{{formData.age}}</van-cell>
|
||||
<van-field
|
||||
input-align="right"
|
||||
label="手机号码"
|
||||
name="phone"
|
||||
required
|
||||
v-model="formData.phone"
|
||||
:rules="[{ required: false, message: '手机号码',trigger: ['blur', 'change'] },{ pattern: /^1[3456789]\d{9}$/, message: '输入正确的手机号码'}]">
|
||||
</van-field>
|
||||
<van-field
|
||||
input-align="right"
|
||||
label="身份证号"
|
||||
name="card"
|
||||
required
|
||||
placeholder="请联系输入身份证号"
|
||||
v-model="formData.card"
|
||||
:rules="[{ required: true, message: '请输入子女身份证号', trigger: 'blur' }, {pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码', trigger: 'blur'}]">
|
||||
</van-field>
|
||||
<van-cell title="人员类型">{{formData.personType}}</van-cell>
|
||||
<van-cell title="婚姻状态">
|
||||
<template #right-icon>
|
||||
<van-radio-group v-model="formData.marriage" direction="horizontal">
|
||||
<van-radio name="已婚">已婚</van-radio>
|
||||
<van-radio name="未婚">未婚</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
<!-- 按钮区域 -->
|
||||
<div class="form-actions">
|
||||
<van-button type="primary"
|
||||
class="buttonClass"
|
||||
block
|
||||
native-type="submit">提交&修改</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
project: {},
|
||||
formData: {
|
||||
sex: "",
|
||||
age: 0,
|
||||
marriage: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开表单
|
||||
async initData() {
|
||||
await this.findSubject(GetQueryString("projectId"))
|
||||
if (GetQueryString("projectId")) {
|
||||
const {id, birthday} = this.$store.state.user
|
||||
await this.selectInfo(GetQueryString("projectId"),id);
|
||||
this.$set(this.formData, 'projectId', GetQueryString("projectId"))
|
||||
// 1. 转成日期对象
|
||||
if(birthday) {
|
||||
const birth = new Date(birthday)
|
||||
const now = new Date()
|
||||
let age = now.getFullYear() - birth.getFullYear()
|
||||
const birthMonth = birth.getMonth()
|
||||
const nowMonth = now.getMonth()
|
||||
const birthDate = birth.getDate()
|
||||
const nowDate = now.getDate()
|
||||
if (nowMonth < birthMonth || (nowMonth === birthMonth && nowDate < birthDate)) {
|
||||
age--
|
||||
}
|
||||
this.$set(this.formData, 'age', age);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
async findSubject(id) {
|
||||
try {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/project/mange/findOne', {id});
|
||||
this.project = resp.data || {};
|
||||
} catch (error) {
|
||||
vant.Toast('获取体检项目失败');
|
||||
}
|
||||
},
|
||||
// 执行提交
|
||||
async doSubmit() {
|
||||
const formData = clone(this.formData);
|
||||
this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要提交吗?',
|
||||
}).then(() => {
|
||||
const toast = this.$toast.loading({
|
||||
duration: 0,
|
||||
forbidClick: true,
|
||||
message: '提交中....',
|
||||
});
|
||||
this.$axios.post('/platform/healthCheckup/h5/doSubmitUserBaseMessage', formData).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
toast.clear();
|
||||
this.$toast.success(resp.msg)
|
||||
this.historyBack()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
async selectInfo(projectId,userId) {
|
||||
const resp = await this.$axios.post('/platform/healthCheckup/h5/findUserBaseMessageData', {projectId,userId});
|
||||
if (resp.data !== null) {
|
||||
this.formData = resp.data;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
Reference in New Issue
Block a user