12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490 |
- <template>
- <view class="container">
- <image
- class="jkda_top_bg"
- :src="baseUrl+'/images/healthRecords/integral_top_bg@2x.png'"
- mode="widthFix"
- v-if="this.formType!='dietList' && this.formType!='sleepList'&&this.formType!='sportList'&& this.formType!='healthLife'"
- ></image>
- <view class="container-body">
- <!-- 就诊人信息 -->
- <view class="userbox" v-if="this.formType!='dietList' && this.formType!='sleepList'&&this.formType!='sportList'&& this.formType!='healthLife'">
- <view class="userbox-left" style="opacity: 0.65;" @click="addPatient()" v-if="patient!=null">
- <view class="userbox-headimg">
- <image :src="defaultHeadimg" mode="aspectFill" style="width: 100%;height: 100%"></image>
- </view>
- <view class="userbox-info">
- <view class="userbox-name">
- <text>{{patient.patientName}}</text>
- <text class="userbox-idcard">{{$parseIdCard(patient.idCard)}}</text>
- </view>
- <view class="userbox-info-tag">
- <view v-if="patient.sex==1">男</view>
- <view v-if="patient.sex==2">女</view>
- <view>{{$getAge(patient.birthday)}}岁</view>
- </view>
- </view>
- </view>
- <view class="userbind" @click="addPatient()" v-if="patient==null">
- <image :src="baseUrl+'/images/healthRecords/upload_id_card_icon.png'" mode="aspectFill"></image>
- <text>绑定就诊人</text>
- </view>
- </view>
- <!-- 问卷 -->
- <view class="listbox multiplebox" v-for="(item,index) in list" :key="index">
- <view class="listbox-titlebox">
- <text>{{index + 1}}.</text>
- <view class="listbox-titletag" v-if="item.type == 2">多选</view>
- <text class="listbox-title">{{item.name}}</text>
- </view>
- <!-- 多选 -->
- <view class="listbox-option" v-if="item.type == 2">
- <view v-for="(option,i) in item.question" :key="i" class="listbox-option-flex">
- <view
- @click="handleMultiple(item,index,option)"
- :class="item.value.indexOf(option.name) === -1 ? 'listbox-option-item' : 'listbox-option-item option-active'">
- {{option.name}}
- </view>
- <view class="otherinput" v-if="option.isWrite == 1 && item.value.indexOf(option.name) !== -1" @click="handleEdit(index,i)">
- {{option.writeVal || '请输入相关描述'}}
- </view>
- </view>
- </view>
- <!-- 单选 -->
- <view style="margin-top: 20rpx;" v-if="item.type == 1">
- <view class="listbox-choose" v-for="(option,i) in item.question" :key="i" @click="handleChoose(item,option)">
- <image class="choose-icon" v-if="item.value == option.name" :src="baseUrl+'/images/healthRecords/choose_icon.png'" mode="aspectFill"></image>
- <image class="choose-icon" v-if="item.value != option.name" :src="baseUrl+'/images/healthRecords/choose_no_icon.png'" mode="aspectFill"></image>
- <text style="flex-shrink: 0;">{{option.name}}</text>
- <view class="choose-input" v-if="option.isWrite == 1 && item.value == option.name" @click.stop="handleEdit(index,i)">
- {{option.writeVal || '请输入相关描述'}}
- </view>
- </view>
- </view>
- <!-- 饮食调查 -->
- <view class="dietary-survey" v-if="item.type == 3">
- <view class="dietary-survey-item" v-for="(option,i) in item.question" :key="i"
- @click="handleChoose(item,option)">
- <view class="dietary-survey-iteml" v-if="option.name !== '每周多少次'">
- <view :class="item.value == option.name ? 'dietary-survey-active':''">{{i+1}}</view>
- <text>{{option.name}}</text>
- </view>
- <view class="dietary-survey-input" v-if="item.name == '平时应酬' && option.name === '每周多少次'">
- <text>每周</text>
- <input class="uni-input" type="number" maxlength="2"
- :value="option.writeVal" @input="clearInput($event,option)" />
- <text>次</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <u-popup :show="show" @close="close" >
- <view class="popbox">
- <view class="popbox-title" v-if="list&&list.length>0">{{chooseIndex+1}}.{{list[chooseIndex].name}}</view>
- <view class="popbox-desc" v-if="list&&list.length>0">选项:{{list[chooseIndex].question[chooseItemIdx].name}}</view>
- <view class="uni-textarea-wrapper">
- <textarea class="textarea" placeholder-style="font-size: 28rpx;" :focus="focus" placeholder="请输入相关描述" :value="writeVal" @input="handleinput"/>
- <view class="popbox-confirm-btn" @click="popSubmit">确认</view>
- </view>
- </view>
- </u-popup>
-
- <!-- footer -->
- <view class="footer">
- <button class="footer-btn" :loading="btnLoading" :disabled="btnLoading" @click="handelSubmit">
- {{this.formType=='dietList' || this.formType=='sleepList'||this.formType=='sportList' ? '提交':'提交健康档案'}}
- </button>
- </view>
- </view>
- </template>
- <script>
- import {getUserInfo} from '@/api/user';
- import {
- myRecord,
- healthHistoryTempList,
- addRecord,
- addFsHealthLife,
- HealthLife,
- } from "@/api/healthRecords.js"
- export default {
- data() {
- return {
- isShare:null,
- baseUrl:uni.getStorageSync('requestPath'),
- show:false,
- patient:null,
- focus: false,
- chooseIndex: 0,
- chooseItemIdx: 0,
- writeVal: "",
- inputValue: "",
- btnLoading: false,
- formType: "",
- defaultHeadimg: uni.getStorageSync('requestPath')+"/images/healthRecords/my_heads_icon.png",
- title: "快速填写健康档案",
- user: {},
- defaultList: [
- {
- name: "目前是否有以下不适?",
- questionType: "symptomHistory",
- type: 2,
- value: "",
- required: true,
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },
- {
- name: "头晕",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },
- {
- name: "头痛",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "容易疲劳",
- value: 4,
- isWrite: 0,
- writeVal: ""
- },{
- name: "记忆力下降",
- value: 5,
- isWrite: 0,
- writeVal: ""
- },{
- name: "咳嗽",
- value: 6,
- isWrite: 0,
- writeVal: ""
- },{
- name: "咳痰",
- value: 7,
- isWrite: 0,
- writeVal: ""
- },{
- name: "呼吸困难",
- value: 8,
- isWrite: 0,
- writeVal: ""
- },{
- name: "胸痛",
- value: 9,
- isWrite: 0,
- writeVal: ""
- },{
- name: "心悸",
- value: 10,
- isWrite: 0,
- writeVal: ""
- },{
- name: "腹痛",
- value: 11,
- isWrite: 0,
- writeVal: ""
- },{
- name: "腹胀",
- value: 12,
- isWrite: 0,
- writeVal: ""
- },{
- name: "便秘",
- value: 13,
- isWrite: 0,
- writeVal: ""
- },{
- name: "腹泻",
- value: 14,
- isWrite: 0,
- writeVal: ""
- },{
- name: "食欲差",
- value: 15,
- isWrite: 0,
- writeVal: ""
- },{
- name: "骨痛",
- value: 16,
- isWrite: 0,
- writeVal: ""
- },{
- name: "尿频、尿急、尿不尽",
- value: 17,
- isWrite: 0,
- writeVal: ""
- },{
- name: "其它",
- value: 18,
- isWrite: 1,
- writeVal: ""
- },
- ]
- },{
- name: "您父母或直系亲属是否有以下疾病?",
- questionType: "familyHistory",
- type: 2,
- value: "",
- required: true,
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "糖尿病",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "高血压",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "心脑血管病",
- value: 4,
- isWrite: 0,
- writeVal: ""
- },{
- name: "高脂血症",
- value: 5,
- isWrite: 0,
- writeVal: ""
- },{
- name: "肥胖",
- value: 6,
- isWrite: 0,
- writeVal: ""
- },{
- name: "其它",
- value: 7,
- isWrite: 1,
- writeVal: ""
- },
- ],
- },
- {
- name: "目前是否在用其它疾病的药品?",
- questionType: "drugHistory",
- type: 1,
- value: "",
- required: false,
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "有",
- value: 2,
- isWrite: 1,
- writeVal: ""
- },
- ],
- },{
- name: "用药是否出现了不良反应?",
- questionType: "drugHistory",
- type: 1,
- value: "",
- required: false,
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "有",
- value: 2,
- isWrite: 1,
- writeVal: ""
- },
- ],
- },{
- name: "是否对药物或某些物质过敏?",
- questionType: "allergyHistory",
- type: 1,
- value: "",
- required: false,
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "有",
- value: 2,
- isWrite: 1,
- writeVal: ""
- },
- ],
- }
- ],
- list: [],
- // 饮食调查
- dietList: [
- {
- name: "三餐规律",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "非常规律",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "比较规律",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "没有规律",
- value: 3,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "就餐习惯",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "暴饮暴食",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "压力大经常进食",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "就外就餐多",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "夜宵",
- value: 4,
- isWrite: 0,
- writeVal: ""
- },{
- name: "不吃早餐",
- value: 5,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "进食速度",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "大约20-30分钟",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "大约10-20分钟",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "大约5-10分钟",
- value: 3,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "酒类",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "从不喝酒",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "每天",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "大于3次/周",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "小于3次/周",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "平时应酬",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "多",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "一般",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "少",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "每周多少次",
- value: 3,
- isWrite: 1,
- writeVal: ""
- }
- ],
- },{
- name: "喝水量",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "低于1000ml",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "1000ml-1500ml",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "1500ml-1700ml",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "1700ml以上",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "您每天吃的食物种类多吗?",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "种类非常多,12种以上",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "一般6-10种",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "种类较少3-5种",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "种类比较固定",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "您是否有抽烟习惯?",
- type: 3,
- value: "",
- questionType: "dietList",
- question: [
- {
- name: "是",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "无",
- value: 2,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },
- ],
- sleepList: [
- {
- name: "睡眠状况",
- type: 3,
- value: "",
- questionType: "sleepList",
- question: [
- {
- name: "很差",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "差",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "一般",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "良好",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "睡眠时间",
- type: 3,
- value: "",
- questionType: "sleepList",
- question: [
- {
- name: "<6小时",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "6-8小时",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "9-10小时",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: ">10小时",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "经常熬夜吗?",
- type: 3,
- value: "",
- questionType: "sleepList",
- question: [
- {
- name: "经常",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "偶尔",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "很少",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "无",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },
- ],
- sportList: [
- {
- name: "日常运动量",
- type: 3,
- value: "",
- questionType: "sportList",
- question: [
- {
- name: "久坐不动",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "轻度运动(3000-6000步)",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "中度运动(6000-10000步)",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "大量运动(一万步以上)",
- value: 4,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "日常是否有运动?",
- type: 2,
- value: "",
- questionType: "sportList",
- question: [
- {
- name: "无",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "散步",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "跑步",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: "自行车",
- value: 4,
- isWrite: 0,
- writeVal: ""
- },{
- name: "舞蹈或太极拳",
- value: 5,
- isWrite: 0,
- writeVal: ""
- },{
- name: "上下楼梯",
- value: 6,
- isWrite: 0,
- writeVal: ""
- },{
- name: "球类",
- value: 7,
- isWrite: 0,
- writeVal: ""
- },{
- name: "游泳",
- value: 8,
- isWrite: 0,
- writeVal: ""
- },{
- name: "其他",
- value: 9,
- isWrite: 1,
- writeVal: ""
- }
- ],
- },{
- name: "您平均每周锻炼次数?",
- type: 3,
- value: "",
- questionType: "sportList",
- question: [
- {
- name: "≤2次",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "3-5次",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "≥5次",
- value: 3,
- isWrite: 0,
- writeVal: ""
- }
- ],
- },{
- name: "平均每次锻炼时间是多少分钟?",
- type: 3,
- value: "",
- questionType: "sportList",
- question: [
- {
- name: "≤20",
- value: 1,
- isWrite: 0,
- writeVal: ""
- },{
- name: "20-40",
- value: 2,
- isWrite: 0,
- writeVal: ""
- },{
- name: "41-60",
- value: 3,
- isWrite: 0,
- writeVal: ""
- },{
- name: ">60",
- value: 3,
- isWrite: 0,
- writeVal: ""
- }
- ],
- }
- ]
- }
- },
-
- onLoad(option) {
- this.formType = option.formType
- this.isShare = option.isShare
- if(this.formType=="dietList") {
- this.list = this.dietList
- }else if(this.formType=="sleepList") {
- this.list = this.sleepList
- }else if(this.formType=="sportList") {
- this.list = this.sportList
- }else if(this.formType=="healthLife") {
- this.list = [...this.dietList,...this.sleepList,...this.sportList]
- }else {
- this.list = this.defaultList
- }
- if(option.isShare!=null){
- this.companyId=option.companyId;
- this.companyUserId=option.companyUserId;
- }
- else{
- this.companyId=uni.getStorageSync('companyId');
- this.companyUserId=uni.getStorageSync('companyUserId');
- }
- const formTypeOption = {
- "healthHistory": "填写疾病史",
- "symptomHistory": "填写症状史",
- "familyHistory": "填写家族史",
- "drugHistory": "填写用药史",
- "allergyHistory": "填写过敏史",
- "dietList": "饮食",
- "sleepList": "睡眠情况",
- "sportList": "运动",
- "healthLife": "生活习惯", // 包括 饮食、睡眠情况、运动
- }
- this.title = formTypeOption[this.formType] || ""
- uni.setNavigationBarTitle({
- title: this.title || "",
- });
- uni.$on('refreshOrderPatient', (res) => {
- this.patient=res
- })
- },
- onShow() {
- this.user = {}
- this.$isLogin().then(
- res => {
- if(res){
- this.getUserInfo();
-
- }
- },
- rej => {}
- );
- },
- onShareAppMessage(res) {
- //禁止二次转发--
- uni.showShareMenu({
- withShareTicket: true
- });
- wx.updateShareMenu({
- isPrivateMessage: true,
- withShareTicket: true,
- success(res) {
- console.log('updateShareMenu: ', res);
- },
- fail() {}
- });
- //禁止二次转发--end
- return {
- title: "健康档案",
- imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png',
- path: "/pages_user/healthRecords/add?isShare=1&formType="+this.formType+"&companyId="+this.companyId+"&companyUserId="+this.companyUserId,
- }
- },
- methods: {
- getUserInfo(){
- getUserInfo().then(
- res => {
- if(res.code==200){
- if(res.user!=null){
- this.user=res.user;
- if(this.formType!="dietList" && this.formType!="sleepList"&&this.formType!="sportList"&& this.formType!='healthLife') {
- this.getHealthHistoryTempList()
- }else {
- this.getHealthLife()
- }
- this.getMyRecord();
- }
- }else{
- uni.showToast({
- icon:'none',
- title: "请求失败",
- });
- }
- },
- rej => {}
- );
- },
- addPatient(){
- uni.navigateTo({
- url: '/pages_user/patient'
- })
- },
- handleEdit(index,i) {
- this.chooseIndex = index
- this.chooseItemIdx = i
- this.focus = true
- this.writeVal = this.list[index].question[i].writeVal
- this.show=true;
- },
- close() {
- this.focus = false
- this.show=false;
- },
- // 输入
- handleinput(e) {
- this.writeVal = e.detail.value
- },
- popSubmit() {
- this.list[this.chooseIndex].question[this.chooseItemIdx].writeVal = this.writeVal
- this.close()
- },
- // 每周喝多少次
- clearInput(event,option) {
- this.inputValue = event.detail.value;
- option.writeVal = this.inputValue
- },
- // 健康档案
- getMyRecord() {
- myRecord().then(res => {
- if (res.code == 200) {
- if(res.data) {
- if(this.isShare!=null){
- uni.showToast({
- icon:'none',
- title: "您已填写过档案",
- });
- setTimeout(function(){
- uni.redirectTo({
- url:"/pages_user/healthRecords/index"
- })
- },2000);
-
- }
- } else {
-
- }
- } else {
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
-
- },
- rej => {}
- )
- },
- // 健康生活
- getHealthLife() {
- const param = {
- userId: this.user.userId
- }
- HealthLife(param).then(res => {
- if (res.code == 200 && res.data) {
-
- this.dietList = res.data.eat ? JSON.parse(res.data.eat) : this.dietList
- this.sleepList = res.data.sleep ? JSON.parse(res.data.sleep) : this.sleepList
- this.sportList = res.data.sport ? JSON.parse(res.data.sport) : this.sportList
-
- if (this.formType == "healthLife") {
- this.list = [...this.dietList,...this.sleepList,...this.sportList]
- } else {
- this.list = this.formType == "dietList" ? this.dietList : this.formType == "sleepList" ? this.sleepList : this.formType == "sportList" ? this.sportList : []
- }
- }
- },
- rej => {}
- )
- },
- getHealthHistoryTempList() {
- healthHistoryTempList().then(res => {
- let list = []
- if (res.code == 200 && res.data && res.data.length > 0) {
- list = res.data.map(item => ({
- ...item,
- value: item.value || "",
- required: true,
- question: JSON.parse(item.question).map((it, i) => ({
- ...it,
- writeVal: ""
- }))
- }));
- }
- this.list = list.concat(this.defaultList)
- },
- rej => {}
- );
- },
- // 单选
- handleChoose(item,option) {
- if(this.patient==null&&this.formType!="dietList" && this.formType!="sleepList"&&this.formType!="sportList"&& this.formType!='healthLife'){
- uni.showToast({
- icon:'none',
- title: "请选择就诊人",
- });
- return;
- }
- if(item.name == '平时应酬' && option.name === '每周多少次') return
- item.value = option.name
- },
- // 多选
- handleMultiple(item,index,option) {
- if(this.patient==null&&this.formType!="dietList" && this.formType!="sleepList"&&this.formType!="sportList"&& this.formType!='healthLife'){
- uni.showToast({
- icon:'none',
- title: "请选择就诊人",
- });
- return;
- }
- const arry = item.value ? item.value.split(',') : []
- if(arry.indexOf(option.name) === -1) {
- arry.push(option.name)
- item.value = arry.join(',')
- } else {
- arry.splice(arry.indexOf(option.name),1)
- item.value = arry.join(',')
- }
- },
- // 提交健康档案
- handelSubmit() {
- if(this.patient==null && this.formType!="dietList" && this.formType!="sleepList"&&this.formType!="sportList"&& this.formType!='healthLife'){
- uni.showToast({
- icon:'none',
- title: "请选择就诊人",
- });
- return;
- }
- for (let i = 0; i < this.list.length; i++) {
- // 检查当前项的字段是否有值
- if (!this.list[i].value) {
- uni.showToast({
- title: "请检查健康档案是否填写完整",
- icon: "none"
- })
- return
- }
- }
- const arry = this.list.map((item, index) => ({
- id: index + 1,
- name: item.name,
- sort: item.sort,
- type: item.type,
- value: item.value,
- questionType: item.questionType,
- question: item.question.map(it=>({
- ...it,
- writeVal: item.value.indexOf(it.name) == -1 && item.name != '平时应酬' && it.name != '每周多少次' ? '' : it.writeVal // 清空没有选中的选项输入的文字,(除了应酬次数)
- }))
- }));
-
- if(this.formType=="dietList" || this.formType=="sleepList" || this.formType=="sportList" || this.formType=='healthLife') {
- this.submitHealthLife(arry)
- } else {
- this.addHealthForm(arry)
- }
- },
- // 新增修改生活习惯
- submitHealthLife(arry) {
- // 判断字符串为正整数
- const reg = /^[1-9]\d*$/
- if(this.inputValue && !reg.test(this.inputValue)) {
- uni.showToast({
- title: "请输入正确的平时应酬次数",
- icon: "none"
- })
- return
- }
- const filterByQuestionType = (questionType) => arry.filter(item => item.questionType && item.questionType === questionType);
-
- const eat = filterByQuestionType("dietList");
- const sleep = filterByQuestionType("sleepList");
- const sport = filterByQuestionType("sportList");
-
- const param = {
- eat: eat && eat.length > 0 ? JSON.stringify(eat) : JSON.stringify(this.dietList),
- sleep: sleep && sleep.length > 0 ? JSON.stringify(sleep) : JSON.stringify(this.sleepList),
- sport: sport && sport.length > 0 ? JSON.stringify(sport) : JSON.stringify(this.sportList),
- }
- addFsHealthLife(param).then(res => {
- this.btnLoading = false
- if (res.code == 200) {
- uni.showToast({
- title: "保存成功",
- icon: 'none',
- duration: 1000,
- });
- var timer = setTimeout(function() {
- uni.redirectTo({
- url: "/pages_user/healthRecords/index"
- });
- clearTimeout('timer')
- }, 1000)
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- })
- }
- },
- rej => {
- this.btnLoading = false
- }
- ).catch(()=>{
- this.btnLoading = false
- });
- },
- // 新增健康史
- addHealthForm(arry) {
- const filterByQuestionType = (questionType) => arry.filter(item => item.questionType && item.questionType === questionType);
-
- const symptomHistory = filterByQuestionType("symptomHistory");
- const drugHistory = filterByQuestionType("drugHistory");
- const allergyHistory = filterByQuestionType("allergyHistory");
- const familyHistory = filterByQuestionType("familyHistory");
- const healthHistory = arry.filter(item => !item.questionType);
- var companyUserId=this.companyUserId;
- var companyId=this.companyId;
- const param = {
- companyId:companyId,
- companyUserId:companyUserId,
- name: this.patient.patientName,
- sex: this.patient.sex, // this.patient.sex1男2女
- age: this.$getAge(this.patient.birthday),
- weight: undefined,
- height: undefined,
- bmi: undefined,
- symptomHistory: JSON.stringify(symptomHistory), // 症状史
- healthHistory: JSON.stringify(healthHistory), // 健康史
- drugHistory: JSON.stringify(drugHistory), // 用药史
- allergyHistory: JSON.stringify(allergyHistory), // 过敏史
- familyHistory: JSON.stringify(familyHistory) // 家族史
- };
-
- this.btnLoading = true
- addRecord(param).then(res => {
- this.btnLoading = false
- if(res.code == 200) {
- uni.showToast({
- title: "提交健康档案成功",
- icon: 'none',
- duration: 1000,
- });
- var timer = setTimeout(function() {
- uni.redirectTo({
- url: "/pages_user/healthRecords/index"
- });
- clearTimeout('timer')
- }, 1000)
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- })
- }
- },
- rej => {this.btnLoading = false}
- ).catch(()=>{
- this.btnLoading = false
- });
- }
- }
- }
- </script>
- <style scoped lang="scss">
-
- .container {
- position: relative;
- font-family: PingFang SC, PingFang SC;
- .jkda_top_bg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: auto;
- }
- &-body {
- position: relative;
- padding: 32rpx 24rpx;
- padding-bottom: calc(var(--window-bottom) + 152rpx);
- }
- }
- .userbox {
- padding: 32rpx;
- margin-bottom: 20rpx;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- overflow: hidden;
- .userbind {
- width: 100%;
- padding: 8rpx 0;
- font-weight: 400;
- font-size: 34rpx;
- color: #FF5C03;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- image {
- width: 48rpx;
- height: 48rpx;
- margin-right: 16rpx;
- }
- }
- &-headimg {
- flex-shrink: 0;
- width: 140rpx;
- height: 140rpx;
- }
- &-left {
- flex-shrink: 0;
- flex: 1;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- }
- &-name {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- flex-wrap: wrap;
- gap: 0 30rpx;
- }
- &-idcard {
- font-weight: 500;
- font-size: 28rpx;
- }
- &-info {
- margin-left: 24rpx;
- font-weight: 600;
- font-size: 32rpx;
- color: #222222;
- &-tag {
- margin-top: 30rpx;
- font-weight: 400;
- font-size: 22rpx;
- color: #FF5C03;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- view {
- min-width: 62rpx;
- height: 42rpx;
- padding: 0 20rpx;
- box-sizing: border-box;
- background: #FCF0E7;
- border-radius: 24rpx 24rpx 24rpx 24rpx;
- text-align: center;
- line-height: 42rpx;
- margin-right: 14rpx;
- }
- }
- }
- }
- .listbox {
- padding: 32rpx 24rpx;
- margin-bottom: 20rpx;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #222222;
- &-titlebox {
- font-weight: 600;
- font-size: 34rpx;
- white-space: normal;
- }
- &-titletag {
- min-width: 80rpx;
- height: 40rpx;
- padding: 0 16rpx;
- margin: 0 12rpx;
- flex-shrink: 0;
- box-sizing: border-box;
- line-height: 40rpx;
- text-align: center;
- background: #FF5C03;
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- font-weight: 400;
- font-size: 24rpx;
- color: #FFFFFF;
- display: inline-block;
- }
- &-option {
- margin-top: 34rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- flex-wrap: wrap;
- gap: 18rpx;
- &-flex {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- gap: 18rpx;
- }
- &-item {
- display: inline-flex;
- min-width: 206rpx;
- min-height: 72rpx;
- padding: 16rpx;
- box-sizing: border-box;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- border: 2rpx solid #ECECEC;
- align-items: center;
- justify-content: center;
- }
- }
- .otherinput {
- width: 430rpx;
- height: 72rpx;
- overflow: hidden;
- padding: 16rpx 24rpx;
- box-sizing: border-box;
- background: #F5F7FA;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- font-weight: 400;
- font-size: 28rpx;
- color: #999999;
- justify-content: flex-start;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .option-active{
- font-weight: 400;
- font-size: 28rpx;
- color: #FF5C03;
- background: #FCF0E7;
- border: 2rpx solid #FF5C03;
- }
- &-choose {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- min-height: 86rpx;
- image {
- flex-shrink: 0;
- width: 36rpx;
- height: 36rpx;
- margin-right: 18rpx;
- }
- }
- .choose-input {
- width: 430rpx;
- height: 72rpx;
- padding: 16rpx 24rpx;
- box-sizing: border-box;
- margin-left: 42rpx;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- border: 2rpx solid #ECECEC;
- display: inline-flex;
- align-items: center;
- justify-content: flex-start;
- font-weight: 400;
- font-size: 28rpx;
- color: #999999;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .dietary-survey {
- display: flex;
- flex-direction: row;
- align-items: flex-start;
- justify-content: flex-start;
- flex-wrap: wrap;
- gap: 18rpx;
- margin-top: 36rpx;
- }
- .dietary-survey-iteml {
- width: 206rpx;
- display: inline-flex;
- flex-direction: column;
- align-items: center;
- font-weight: 400;
- font-size: 32rpx;
- view {
- width: 206rpx;
- height: 90rpx;
- background: #F5F7FA;
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- border: 2rpx solid #ECECEC;
- box-sizing: border-box;
- margin-bottom: 20rpx;
- text-align: center;
- line-height: 90rpx;
- }
-
- text {
- font-size: 24rpx;
- color: #757575;
- }
- }
- .dietary-survey-item {
- display: inline-flex;
- }
- .dietary-survey-input {
- height: 90rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: flex-start;
- display: inline-flex;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #757575;
- .uni-input {
- width: 100rpx;
- height: 72rpx;
- padding: 0 10rpx;
- text-align: center;
- box-sizing: border-box;
- margin: 0 10rpx;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- border: 2rpx solid #ECECEC;
- }
- }
- .dietary-survey-active {
- color: #fff !important;
- background: #FF5C03 !important;
- border: 2rpx solid #FF5C03 !important;
- }
- }
- .footer {
- width: 100%;
- height: 152rpx;
- padding: 20rpx 24rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- box-shadow: 0rpx -6rpx 8rpx 0rpx rgba(114,114,114,0.1);
- position: fixed;
- bottom: var(--window-bottom);
- left: 0;
- &-btn {
- height: 112rpx;
- background: #FF5C03;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- font-weight: 600;
- font-size: 34rpx;
- color: #FFFFFF;
- line-height: 112rpx;
- text-align: center;
- &::after {
- border: none;
- }
- }
- }
- .popbox {
- background: #fff;
- padding: 20rpx;
- font-family: PingFang SC, PingFang SC;
- color: #222222;
- font-weight: 400;
- font-size: 28rpx;
- &-title {
- font-weight: 600;
- font-size: 34rpx;
- }
- &-desc {
- margin: 20rpx 0;
- }
- .uni-textarea-wrapper {
- display: flex;
- flex-direction: row;
- align-items: flex-end;
- justify-content: space-between;
- }
- .textarea {
- flex: 1;
- max-height: 146rpx;
- padding: 15rpx 24rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- line-height: 36rpx;
- border: 2rpx solid #ECECEC;
- color: #222222;
- font-weight: 400;
- font-size: 28rpx;
- }
- .popbox-confirm-btn {
- flex-shrink: 0;
- width: 140rpx;
- height: 70rpx;
- margin-left: 10rpx;
- background: #FF5C03;
- border-radius: 16rpx;
- color: #fff;
- text-align: center;
- line-height: 70rpx;
- }
- }
- </style>
|