Browse Source

录入信息页,必填项调整

dev
kola-web 3 days ago
parent
commit
544f2a3ac0
  1. 31
      src/patient/pages/enterInfo/index.ts
  2. 42
      src/patient/pages/enterInfo/index.wxml

31
src/patient/pages/enterInfo/index.ts

@ -74,12 +74,13 @@ Page({ @@ -74,12 +74,13 @@ Page({
},
// 同步 picker 的数组与索引
_syncPickerData() {
const { CurrentTreatmentPlanList, currentTreatmentPlan, TeprotumumabInfusionCountList, teprotumumabInfusionCount } = this.data
const { CurrentTreatmentPlanList, currentTreatmentPlan, TeprotumumabInfusionCountList, teprotumumabInfusionCount } =
this.data
const cpKeys = Object.keys(CurrentTreatmentPlanList)
const cpNames = cpKeys.map(k => CurrentTreatmentPlanList[k])
const cpNames = cpKeys.map((k) => CurrentTreatmentPlanList[k])
const cpIndex = cpKeys.indexOf(String(currentTreatmentPlan))
const icKeys = Object.keys(TeprotumumabInfusionCountList)
const icNames = icKeys.map(k => TeprotumumabInfusionCountList[k])
const icNames = icKeys.map((k) => TeprotumumabInfusionCountList[k])
const icIndex = icKeys.indexOf(String(teprotumumabInfusionCount))
this.setData({
currentTreatmentPlanNames: cpNames,
@ -283,8 +284,8 @@ Page({ @@ -283,8 +284,8 @@ Page({
})
},
handleNext() {
const { name, gender, ageRange, relationType, diseaseStage } = this.data
if (!name || !gender || !ageRange || !relationType || !diseaseStage) {
const { name, gender, ageRange, relationType } = this.data
if (!name || !gender || !ageRange || !relationType) {
wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' })
return
}
@ -315,8 +316,7 @@ Page({ @@ -315,8 +316,7 @@ Page({
},
handleSubmit() {
app.mpBehavior({ PageName: 'BTN_PatientInfoComfirm' })
if (this.data.submiting)
return
if (this.data.submiting) return
const {
name,
gender,
@ -343,17 +343,14 @@ Page({ @@ -343,17 +343,14 @@ Page({
} = this.data
const { registrationSource, registChannel, regBusinessId, WorkerId, IsAliQiWei } = app.globalData
const { doctorId, inviteChan, proMethodId } = app.globalData.scene
const { showTeprotumumabFields } = this.data
if (!name || !gender || !ageRange || !relationType || !diseaseStage || !diseasePeriod
|| !firstDiagnosisDate || !isRelapse || !currentTreatmentPlan || !Object.values(pastTreatmentPlan).some(v => v)
|| (showTeprotumumabFields && (!teprotumumabFirstInfusionDate || !teprotumumabInfusionCount))) {
if (!name || !gender || !ageRange) {
wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' })
return
}
const backPage = app.globalData.backPage
const navUrl
= typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index'
const navUrl =
typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index'
this.setData({
submiting: true,
@ -384,7 +381,9 @@ Page({ @@ -384,7 +381,9 @@ Page({
FirstDiagnosisDate: firstDiagnosisDate,
IsRelapse: isRelapse,
CurrentTreatmentPlan: currentTreatmentPlan,
PastTreatmentPlan: Object.keys(pastTreatmentPlan).filter(k => pastTreatmentPlan[k]).join(','),
PastTreatmentPlan: Object.keys(pastTreatmentPlan)
.filter((k) => pastTreatmentPlan[k])
.join(','),
TeprotumumabFirstInfusionDate: teprotumumabFirstInfusionDate || '',
TeprotumumabInfusionCount: teprotumumabInfusionCount || '',
@ -414,8 +413,8 @@ Page({ @@ -414,8 +413,8 @@ Page({
handleVisitors() {
app.mpBehavior({ PageName: 'BTN_PatientInfoSkip' })
const backPage = app.globalData.backPage
const navUrl
= typeof backPage === 'string' && backPage.includes('liveResult')
const navUrl =
typeof backPage === 'string' && backPage.includes('liveResult')
? backPage.replace('liveResult', 'liveDetail')
: '/patient/pages/index/index?visitors=1'
wx.ajax({

42
src/patient/pages/enterInfo/index.wxml

@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
{{item}}
</view>
</view>
<view class="row-title required">您的甲状腺眼病分级</view>
<view class="row-title">您的甲状腺眼病分级</view>
<view class="row row-age">
<view
class="age-item {{diseaseStage==index && 'active'}}"
@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
</view>
</view>
<view class="content" wx:elif="{{step==1}}">
<view class="row-title required" style="margin-top: 10rpx">您的甲状腺眼病分期</view>
<view class="row-title" style="margin-top: 10rpx">您的甲状腺眼病分期</view>
<view class="row row-age">
<view
class="age-item {{diseasePeriod==index && 'active'}}"
@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</view>
</view>
<view class="row-title required" style="margin-top: 10rpx">首次确诊甲状腺眼病的日期</view>
<view class="row-title" style="margin-top: 10rpx">首次确诊甲状腺眼病的日期</view>
<picker mode="date" end="{{today}}" value="{{firstDiagnosisDate}}" bindchange="handleFirstDiagnosisDateChange">
<view class="date-select">
<view class="date-content" data-place="请选择日期">{{firstDiagnosisDate}}</view>
@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
</view>
</picker>
<view class="row-title required" style="margin-top: 10rpx">当前是否为复发</view>
<view class="row-title" style="margin-top: 10rpx">当前是否为复发</view>
<view class="row row-age">
<view
class="age-item {{isRelapse==index && 'active'}}"
@ -102,15 +102,21 @@ @@ -102,15 +102,21 @@
</view>
</view>
<view class="row-title required" style="margin-top: 10rpx">您正在进行的治疗方案</view>
<picker mode="selector" range="{{currentTreatmentPlanNames}}" value="{{currentTreatmentPlanIndex}}" bindchange="handleCurrentTreatmentPlanChange">
<view class="row-title" style="margin-top: 10rpx">您正在进行的治疗方案</view>
<picker
mode="selector"
range="{{currentTreatmentPlanNames}}"
value="{{currentTreatmentPlanIndex}}"
bindchange="handleCurrentTreatmentPlanChange"
>
<view class="date-select">
<!-- prettier-ignore -->
<view class="date-content" data-place="请选择治疗方案">{{CurrentTreatmentPlanList[currentTreatmentPlan] || ''}}</view>
<van-icon class="more" name="arrow-down" />
</view>
</picker>
<view class="row-title required" style="margin-top: 10rpx">您的既往治疗方案(多选)</view>
<view class="row-title" style="margin-top: 10rpx">您的既往治疗方案(多选)</view>
<view class="row row-past-treatment">
<view
class="age-item {{pastTreatmentPlan[index] && 'active'}}"
@ -124,18 +130,30 @@ @@ -124,18 +130,30 @@
</view>
<block wx:if="{{showTeprotumumabFields}}">
<view class="row-title required" style="margin-top: 10rpx">替妥尤首次输注时间</view>
<picker mode="date" end="{{today}}" value="{{teprotumumabFirstInfusionDate}}" bindchange="handleTeprotumumabFirstInfusionDateChange">
<view class="row-title" style="margin-top: 10rpx">替妥尤首次输注时间</view>
<picker
mode="date"
end="{{today}}"
value="{{teprotumumabFirstInfusionDate}}"
bindchange="handleTeprotumumabFirstInfusionDateChange"
>
<view class="date-select">
<view class="date-content" data-place="请选择日期">{{teprotumumabFirstInfusionDate}}</view>
<van-icon class="more" name="arrow-down" />
</view>
</picker>
<view class="row-title required" style="margin-top: 10rpx">替妥尤已输注的次数</view>
<picker mode="selector" range="{{teprotumumabInfusionCountNames}}" value="{{teprotumumabInfusionCountIndex}}" bindchange="handleTeprotumumabInfusionCountChange">
<view class="row-title" style="margin-top: 10rpx">替妥尤已输注的次数</view>
<picker
mode="selector"
range="{{teprotumumabInfusionCountNames}}"
value="{{teprotumumabInfusionCountIndex}}"
bindchange="handleTeprotumumabInfusionCountChange"
>
<view class="date-select">
<view class="date-content" data-place="请选择已输注的次数">{{TeprotumumabInfusionCountList[teprotumumabInfusionCount] || ''}}</view>
<view class="date-content" data-place="请选择已输注的次数">
{{TeprotumumabInfusionCountList[teprotumumabInfusionCount] || ''}}
</view>
<van-icon class="more" name="arrow-down" />
</view>
</picker>

Loading…
Cancel
Save