This commit is contained in:
左哥 2025-06-10 00:21:13 +08:00
parent f89100c1ed
commit 5161f11dd3
7 changed files with 198 additions and 225 deletions

View File

@ -2,6 +2,15 @@
page {
background-color: #f3f3f3;
--td-brand-color: #0091cc; // 任何你想要的主题色
font-size: 28rpx;
.t-cell__title-text {
font-size: 28rpx;
}
.t-input__control {
font-size: 28rpx;
}
}
.page {

View File

@ -11,7 +11,7 @@
<t-upload media-type="{{['image']}}" max="{{1}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
</view>
<view class="follow-item">
<view>
门静脉左右分支</view>
@ -36,190 +36,12 @@
<t-upload media-type="{{['image']}}" max="{{1}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
<t-row gutter="12">
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 血小板10^9/L </view>
<t-input placeholder="请输入" size="small" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 血红蛋白g/L</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 白细胞10^9/L</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
</t-row>
</view>
<view class="follow-item">
<view>
营养指标</view>
<view class="wrapper">
<view class="input-example">
<view class="input-example__label"> 上传营养指标检查报告支持OCR识别</view>
</view>
<t-upload media-type="{{['image']}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
<t-row gutter="12">
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 25OHD3 (ng/ml) </view>
<t-input placeholder="请输入" size="small" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 维生素A (ng/ml)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 维生素K (ng/ml)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 维生素E (ng/ml)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
</t-row>
</view>
<view class="follow-item">
<view>
B超</view>
<view class="wrapper">
<view class="input-example">
<view class="input-example__label"> 上传B超报告支持OCR识别</view>
</view>
<t-upload media-type="{{['image']}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
<t-row gutter="12">
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 肝肋下(mm)肝肋下(mm)</view>
<t-input placeholder="请输入" size="small" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 肝剑突下(mm)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 脾肋下(mm)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 门静脉主干(mm)</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 门静脉流速</view>
<t-input placeholder="请输入" size="small" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 肝弹性值</view>
<t-input placeholder="请输入" borderless="{{true}}" style="{{style}}" />
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 有无肝囊肿</view>
<t-radio-group default-value="0" borderless t-class="box">
<t-radio block="{{false}}" label="有" value="0" />
<t-radio block="{{false}}" label="无" value="1" />
</t-radio-group>
</view>
</view>
</t-col>
<t-col span="12">
<view class="dark">
<view class="input-example">
<view class="input-example__label"> 有无腹水</view>
<t-radio-group default-value="0" borderless t-class="box">
<t-radio block="{{false}}" label="有" value="0" />
<t-radio block="{{false}}" label="无" value="1" />
</t-radio-group>
</view>
</view>
</t-col>
</t-row>
</view>
<view class="follow-item">
<view>
MDT电子病历</view>
<view class="wrapper">
<view class="input-example">
<view class="input-example__label"> 上传本次随访的电子病历</view>
</view>
<t-upload media-type="{{['image']}}" files="{{originFiles}}" gridConfig="{{gridConfig}}" removeBtn="{{false}}" bind:success="handleSuccess" bind:remove="handleRemove" bind:click="handleClick" bind:sort-end="handleSortEnd" />
</view>
</view>
<t-button bindtap="clockIn" theme="primary" block bindtap="toQuestionnaire">提交</t-button>
<t-date-time-picker auto-close bind:cancel="hidePicker" bind:change="onPickerChange" cancelBtn="取消" confirmBtn="确认" data-mode="birth" defaultValue="{{personInfo.birth}}" end="{{birthEnd}}" filter="{{birthFilter}}" format="YYYY-MM-DD" mode="date" popup-props="{{ { usingCustomNavbar: true } }}" start="{{birthStart}}" title="选择生日" value="{{personInfo.birth}}" visible="{{birthVisible}}" />
</view>

View File

@ -13,9 +13,10 @@
</view>
<view class="time">胆道闭锁手术时间:{{personalInfo.operative_date}}</view>
<view class="peld">PELD评分{{personalInfo.risk_value}}
<t-tag wx:if="{{personalInfo.risk_type == 1}}" class="tag" theme="success" size="small">低危</t-tag></view>
<t-tag wx:if="{{personalInfo.risk_type == 2}}" class="tag" theme="warning" size="small">中危</t-tag></view>
<t-tag wx:if="{{personalInfo.risk_type == 3}}" class="tag" theme="danger" size="small">高危</t-tag></view>
<t-tag wx:if="{{personalInfo.risk_type == 1}}" class="tag" theme="success" size="small">低危</t-tag>
<t-tag wx:if="{{personalInfo.risk_type == 2}}" class="tag" theme="warning" size="small">中危</t-tag>
<t-tag wx:if="{{personalInfo.risk_type == 3}}" class="tag" theme="danger" size="small">高危</t-tag>
</view>
</view>

View File

@ -1,5 +1,8 @@
import request from '~/api/request';
let mode = ''
let modeText = ''
Page({
data: {
personInfo: {
@ -8,7 +11,14 @@ Page({
id_number: '',
birthday: '',
operative_date: '',
delivery_type: '',
prenatal_check_type: '',
gestational_week: '',
conception_type: '',
birth_number: '',
parity_number: '',
birth_weight: '',
prenatal_check_remark: ''
},
genderOptions: [
{
@ -47,9 +57,27 @@ Page({
width: 160,
height: 160,
},
defaultTime: '',
newTime: '',
timeValue: '',
timePicker:new Date().toISOString().split('T')[0],
idError: false,
numberError: false,
weekError: false,
numberFormat: (v) => {
const isNumber = /^\d+(\.\d+)?$/.test(v);
if (isNumber) {
return parseFloat(v).toFixed(2);
}
return v;
},
// 下拉
selectList: [],
selectValue: '',
selectVisible: false,
deliveryList:[{label: '顺产', value: 1},{label: '剖腹产', value: 2}],
prenatal_checkList: [{label: '有', value: 1},{label: '无', value: 2}],
parity_numberList: [{label: '1胎', value: 1},{label: '2胎', value: 2},{label: '3胎', value: 3},{label: '大于等于4胎', value: 4}],
birth_numberList:[{label: '1产', value: 1},{label: '2产', value: 2},{label: '大于等于3产', value: 3}],
conception_typeList: [{label: '自然受孕', value: 1},{label: '辅助生殖技术', value: 2}]
},
onLoad() {
@ -63,8 +91,16 @@ Page({
username: info.username,
sex: info.sex,
id_number: info.id_number,
birthday: info.birthday,
birthday: info.birthday || '',
operative_date: info.operative_date,
delivery_type: info.delivery_type,
prenatal_check_type: info.prenatal_check_type,
gestational_week: info.gestational_week,
conception_type: info.conception_type,
birth_number: info.birth_number,
parity_number: info.parity_number,
birth_weight: info.birth_weight,
prenatal_check_remark: info.prenatal_check_remark
}
})
},
@ -100,13 +136,19 @@ Page({
},
showPicker(e) {
console.log(e)
const { mode } = e.currentTarget.dataset;
this.setData({
birthVisible: true,
defaultTime: e.detail.value,
newTime: e.detail.value,
});
mode = e.currentTarget.dataset.mode;
if(mode == "birth"){
this.setData({
birthVisible: true,
timePicker: this.data.personInfo.birthday ? this.data.personInfo.birthday : new Date().toISOString().split('T')[0]
});
} else {
this.setData({
birthVisible: true,
timePicker: this.data.personInfo.operative_date ? this.data.personInfo.operative_date : new Date().toISOString().split('T')[0]
});
}
},
@ -119,16 +161,17 @@ Page({
onPickerChange(e) {
const { value, label } = e.detail;
const { mode } = e.currentTarget.dataset;
this.setData({
[`personInfo.${mode}`]: value,
});
if (mode === 'address') {
console.log(mode, mode == 'birth')
if(mode == 'birth'){
this.setData({
addressText: label.join(' '),
});
['personInfo.birthday']: value
})
}else{
this.setData({
['personInfo.operative_date']:value
})
}
},
personInfoFieldChange(field, e) {
@ -139,7 +182,7 @@ Page({
},
onNameChange(e) {
this.personInfoFieldChange('name', e);
this.personInfoFieldChange('username', e);
},
onGenderChange(e) {
@ -184,4 +227,62 @@ Page({
})
wx.navigateBack()
},
onIdInput(e){
// 18位身份证正则
const { idError } = this.data;
const reg18 = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/.test(e.detail.value);
if (idError == reg18) {
this.setData({
idError: !reg18,
});
}
this.personInfoFieldChange('id_number', e);
},
onWeightInput(e){
const { numberError } = this.data;
const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value);
if (numberError === isNumber) {
this.setData({
numberError: !isNumber,
});
}
this.personInfoFieldChange('birth_weight', e);
},
onWeekInput(e){
const { weekError } = this.data;
const isNumber = /^\d+(\.\d+)?$/.test(e.detail.value);
if (weekError === isNumber) {
this.setData({
weekError: !isNumber,
});
}
this.personInfoFieldChange('gestational_week', e);
},
showSelect(e){
const { mode, list } = e.currentTarget.dataset;
modeText = mode
this.setData({
selectVisible: true,
selectValue: this.data.personInfo[mode] ? this.data.personInfo[mode] : '',
selectList: list
})
},
onSelectChange(e){
const { value, label } = e.detail;
this.setData({
[`personInfo.${modeText}`]: value[0]
})
},
onSaveInfo(){
console.log(this.data.personInfo)
let obj = this.data.personInfo
obj.birth_weight = Number(obj.birth_weight)
obj.gestational_week = Number(obj.gestational_week)
if( obj.prenatal_check_type == 2){
obj.prenatal_check_remark = '无'
}
request('patient/set_personal_information', 'post', obj)
}
});

View File

@ -31,12 +31,16 @@ page {
}
.info-edit__save {
position: fixed;
left: 32rpx;
right: 32rpx;
bottom: calc(env(safe-area-inset-bottom) + 32rpx);
padding: 28rpx;
// position: fixed;
// left: 32rpx;
// right: 32rpx;
// bottom: calc(env(safe-area-inset-bottom) + 32rpx);
}
.info-edit__gender {
width: 45%;
}
.t-textarea{
height: 140rpx;
}

View File

@ -1,7 +1,7 @@
<t-navbar left-arrow title="个人信息" />
<view class="info-edit">
<t-cell class="info-edit__cell" required title="姓名">
<t-input bind:change="onNameChange" borderless placeholder="请输入姓名" slot="note" value="{{personInfo.username}}" />
<t-input bind:change="onNameChange" align="right" borderless placeholder="请输入患者姓名" slot="note" value="{{personInfo.username}}" />
</t-cell>
<t-cell class="info-edit__cell" required title="性别">
<t-radio-group
@ -15,14 +15,44 @@
/>
</t-cell>
<t-cell class="info-edit__cell" title="身份证号">
<t-input bind:change="onNameChange" borderless placeholder="请输入身份证号" slot="note" value="{{personInfo.id_number}}" />
<t-input bind:change="onIdInput" align="right" borderless placeholder="请输入身份证号" slot="note" value="{{personInfo.id_number}}"
tips="{{idError ? '身份证号输入不正确' : ''}}"
/>
</t-cell>
<t-cell required arrow bind:click="showPicker" data-mode="birth" note="{{personInfo.birthday || ''}}" title="出生日期" />
<t-cell required arrow bind:click="showPicker" data-mode="birth" note="{{personInfo.birthday || '请选择'}}" title="出生日期" />
<!-- <t-cell class="info-edit__cell" required title="年龄" note="{{personInfo.age}}">
<t-cell class="info-edit__cell" align="right" required title="年龄" note="{{personInfo.age}}">
</t-cell> -->
<t-cell required arrow bind:click="showPicker" data-mode="operative" note="{{personInfo.operative_date || ''}}" title="胆道闭锁手术时间" />
</t-cell>
<t-cell class="info-edit__cell" required title="出生体重">
<t-input align="right" bind:change="onWeightInput" borderless placeholder="请输入" slot="note" value="{{personInfo.birth_weight}}" suffix="g"
format="{{numberFormat}}"
tips="{{numberError ? '请输入正确的体重' : ''}}"
/>
</t-cell>
<t-cell required arrow bind:click="showPicker" data-mode="operative" note="{{personInfo.operative_date || '请选择'}}" title="胆道闭锁手术时间" />
<t-cell title="胎次" required arrow bind:click="showSelect" data-mode="parity_number" data-list="{{parity_numberList}}" note="{{personInfo.parity_number ? (parity_numberList[personInfo.parity_number - 1].label) : '请选择'}}">
</t-cell>
<t-cell title="产次" required arrow bind:click="showSelect" data-mode="birth_number" data-list="{{birth_numberList}}" note="{{personInfo.birth_number ? (birth_numberList[personInfo.birth_number - 1].label) : '请选择'}}">
</t-cell>
<t-cell title="受孕方式" required arrow bind:click="showSelect" data-mode="conception_type" data-list="{{conception_typeList}}" note="{{personInfo.conception_type ? (conception_typeList[personInfo.conception_type - 1].label) : '请选择'}}">
</t-cell>
<t-cell class="info-edit__cell" required title="孕周">
<t-input align="right" suffix="周" bind:change="onWeekInput" borderless placeholder="请输入" slot="note" value="{{personInfo.gestational_week}}"
format="{{numberFormat}}"
tips="{{weekError ? '请输入正确的孕周' : ''}}" />
</t-cell>
<t-cell title="产检是否有异常(如有,请填写)" required arrow bind:click="showSelect" data-mode="prenatal_check_type" data-list="{{prenatal_checkList}}" note="{{personInfo.prenatal_check_type ? (prenatal_checkList[personInfo.prenatal_check_type - 1].label) : '请选择'}}">
</t-cell>
<t-textarea t-class="external-class" wx:if="{{personInfo.prenatal_check_type == 1}}" placeholder="请输入异常描述" disableDefaultPadding="{{true}}" value="{{personInfo.prenatal_check_remark}}" />
<t-cell title="分娩方式" required arrow bind:click="showSelect" data-mode="delivery_type" data-list="{{deliveryList}}" note="{{personInfo.delivery_type ? (deliveryList[personInfo.delivery_type - 1].label) : '请选择'}}">
</t-cell>
</view>
@ -37,7 +67,7 @@
cancelBtn="取消"
confirmBtn="确认"
data-mode="birth"
defaultValue="{{defaultTime}}"
defaultValue="{{timePicker}}"
end="{{birthEnd}}"
filter="{{birthFilter}}"
format="YYYY-MM-DD"
@ -45,7 +75,20 @@
popup-props="{{ { usingCustomNavbar: true } }}"
start="{{birthStart}}"
title="选择生日"
value="{{newTime}}"
value="{{timeValue}}"
visible="{{birthVisible}}"
/>
<!-- 下拉选择 -->
<t-picker
visible="{{selectVisible}}"
value="{{selectValue}}"
data-key="value"
cancelBtn="取消"
confirmBtn="确认"
usingCustomNavbar
bindchange="onSelectChange"
bindcancel="onPickerCancel"
>
<t-picker-item options="{{selectList}}"></t-picker-item>
</t-picker>

View File

@ -1,7 +0,0 @@
const crypto = require('crypto-js');
function md5Encrypt(password) {
return crypto.MD5(password).toString();
}
module.exports = { md5Encrypt };