1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372 |
- <template>
- <view class="container">
- <image
- class="jkda_top_bg"
- src="@/static/image/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="@/static/image/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="@/static/image/healthRecords/choose_icon.png" mode="aspectFill"></image>
- <image class="choose-icon" v-if="item.value != option.name" src="@/static/image/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>
- <uni-popup ref="popup">
- <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>
- </uni-popup>
- <!-- footer -->
- <view class="footer">
- <button class="footer-btn" :loading="btnLoading" :disabled="btnLoading" @click="handelSubmit">
- {{this.formType=='dietList' || this.formType=='sleepList'||this.formType=='sportList' || this.formType=='healthLife' ? '提交':'提交健康档案'}}
- </button>
- </view>
- </view>
- </template>
- <script>
- import {
- healthHistoryTempList,
- addRecord,
- addFsHealthLife,
- HealthLife,
- } from "@/api/healthRecords.js"
- export default {
- data() {
- return {
- patient:null,
- focus: false,
- chooseIndex: 0,
- chooseItemIdx: 0,
- writeVal: "",
- inputValue: "",
- btnLoading: false,
- formType: "",
- defaultHeadimg: "../../static/image/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
- 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
- }
- 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 = {}
- if (!this.$isLogin()) {
- this.$showLoginPage();
- } else {
- this.user = this.$getUserInfo();
- if(this.formType!="dietList" && this.formType!="sleepList"&&this.formType!="sportList"&& this.formType!='healthLife') {
- this.getHealthHistoryTempList()
- } else {
- this.getHealthLife()
- }
- }
- },
- methods: {
- 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.$refs.popup.open("bottom")
- },
- close() {
- this.focus = false
- this.$refs.popup.close()
- },
- // 输入
- 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 = event.detail.value
- },
- // 健康生活
- 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: "./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);
-
- const param = {
- 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/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">
- @mixin u-flex($flexD, $alignI, $justifyC) {
- display: flex;
- flex-direction: $flexD;
- align-items: $alignI;
- justify-content: $justifyC;
- }
- .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;
- @include u-flex(row, center,space-between);
- overflow: hidden;
- .userbind {
- width: 100%;
- padding: 8rpx 0;
- font-weight: 400;
- font-size: 34rpx;
- color: #FF5C03;
- @include u-flex(row, center,center);
- image {
- width: 48rpx;
- height: 48rpx;
- margin-right: 16rpx;
- }
- }
- &-headimg {
- flex-shrink: 0;
- width: 140rpx;
- height: 140rpx;
- }
- &-left {
- flex-shrink: 0;
- flex: 1;
- @include u-flex(row, center,flex-start);
- }
- &-name {
- @include u-flex(row, center,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;
- @include u-flex(row, center,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;
- @include u-flex(row, center, flex-start);
- flex-wrap: wrap;
- gap: 18rpx;
- &-flex {
- @include u-flex(row, center, 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 {
- @include u-flex(row, center, 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 {
- @include u-flex(row, flex-start, 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;
- @include u-flex(row, center, 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 {
- @include u-flex(row, flex-end, 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>
|