| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051 | 
							- <template>
 
- 	<view class="container">
 
- 		<view class="container-body">
 
- 			<!-- 问卷 -->
 
- 			<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 === '每周多少次' && option.writeVal">
 
- 							每周{{option.writeVal || '--'}}次
 
- 						</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" v-if="this.formType!='dietList' && this.formType!='sleepList'&&this.formType!='sportList'" @click="popSubmit">确认</view>
 
- 				</view>
 
- 			</view>
 
- 		</u-popup>
 
- 		<!-- footer -->
 
- 		<view class="footer" v-if="this.formType!='dietList' && this.formType!='sleepList'&&this.formType!='sportList'">
 
- 			<button class="footer-btn" :loading="btnLoading" :disabled="btnLoading" @click="handelSubmit">确认</button>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {getUserInfo} from '@/api/user';
 
- 	import {
 
- 		HealthData,
 
- 		healthHistoryTempList,
 
- 		editRecord,
 
- 		myRecord,
 
- 		HealthLife
 
- 	} from "@/api/healthRecords.js"
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				baseUrl:uni.getStorageSync('requestPath'),
 
- 				show:false,
 
- 				focus: false,
 
- 				chooseIndex: 0,
 
- 				chooseItemIdx: 0,
 
- 				writeVal: "",
 
- 				btnLoading: false,
 
- 				id: undefined,
 
- 				formType: "",
 
- 				title: "",
 
- 				user: {},
 
- 				list: [],
 
- 				// 饮食调查
 
- 				dietList: [
 
- 					{
 
- 						name: "三餐规律",
 
- 						type: 3,
 
- 						value: "",
 
- 						question: [
 
- 							{
 
- 								name: "非常规律",
 
- 								value: 1,
 
- 								isWrite: 0,
 
- 								writeVal: ""
 
- 							},{
 
- 								name: "比较规律",
 
- 								value: 2,
 
- 								isWrite: 0,
 
- 								writeVal: ""
 
- 							},{
 
- 								name: "没有规律",
 
- 								value: 3,
 
- 								isWrite: 0,
 
- 								writeVal: ""
 
- 							}
 
- 						],
 
- 					},{
 
- 						name: "就餐习惯",
 
- 						type: 3,
 
- 						value: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						question: [
 
- 							{
 
- 								name: "是",
 
- 								value: 1,
 
- 								isWrite: 0,
 
- 								writeVal: ""
 
- 							},{
 
- 								name: "无",
 
- 								value: 2,
 
- 								isWrite: 0,
 
- 								writeVal: ""
 
- 							}
 
- 						],
 
- 					},
 
- 				],
 
- 				sleepList: [
 
- 					{
 
- 						name: "睡眠状况",
 
- 						type: 3,
 
- 						value: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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: "",
 
- 						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.id = option.id
 
- 			this.formType = option.formType
 
- 			const formTypeOption = {
 
- 				"healthHistory": "填写疾病史",
 
- 				"symptomHistory": "填写症状史",
 
- 				"familyHistory": "填写家族史",
 
- 				"drugHistory": "填写用药史",
 
- 				"allergyHistory": "填写过敏史",
 
- 				"dietList": "饮食",
 
- 				"sleepList": "睡眠情况",
 
- 				"sportList": "运动",
 
- 			}
 
- 			this.title = formTypeOption[this.formType] || ""
 
- 			uni.setNavigationBarTitle({
 
- 				title: this.title || "",
 
- 			});
 
- 		},
 
- 		onShow() {
 
- 			this.user = {}
 
- 			this.$isLogin().then(
 
- 				res => {
 
- 					if(res){
 
- 						this.getUserInfo();
 
- 					}
 
- 				},
 
- 				rej => {}
 
- 			);
 
- 		},
 
- 		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.getHealthLife()
 
- 								} else {
 
- 									this.getMyRecord()
 
- 								}
 
- 							}
 
- 						}else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: "请求失败",
 
- 							});
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			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()
 
- 			},
 
- 			// 健康生活回显
 
- 			getHealthLife() {
 
- 				const param = {
 
- 					type: this.formType=="dietList" ? 1 : this.formType=="sleepList" ? 2 :this.formType=="sportList" ? 3 : undefined,
 
- 					userId: this.user.userId
 
- 				}
 
- 				HealthLife(param).then(res => {
 
- 						if (res.code == 200 && res.data) {
 
- 							this.list = JSON.parse(res.data.formJson)
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				)
 
- 			},
 
- 			// 健康档案回显
 
- 			getMyRecord() {
 
- 				myRecord().then(res => {
 
- 						if (res.code == 200 && res.data) {
 
- 							if(this.formType) {
 
- 								this.list = res.data[this.formType] ? JSON.parse(res.data[this.formType]) : []
 
- 							}
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				)
 
- 			},
 
- 			// 单选
 
- 			handleChoose(item,option) {
 
- 				if(this.formType=="dietList" || this.formType=="sleepList"||this.formType=="sportList") return
 
- 				if(item.name == '平时应酬' && option.name === '每周多少次') return
 
- 				item.value = option.name
 
- 			},
 
- 			// 多选
 
- 			handleMultiple(item, index, option) {
 
- 				if(this.formType=="dietList" || this.formType=="sleepList"||this.formType=="sportList") 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() {
 
- 				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 ? '' : it.writeVal    // 清空没有选中的选项输入的文字
 
- 					}))
 
- 				}));
 
- 				if(this.formType!="dietList" && this.formType!="sleepList" && this.formType!="sportList") {
 
- 					this.editHealthForm(arry)
 
- 				}
 
- 			},
 
- 			// 修改健康史
 
- 			editHealthForm(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 = {
 
- 					id: Number(this.id || 0),
 
- 					symptomHistory: this.formType == "symptomHistory" ? JSON.stringify(symptomHistory) : undefined, // 症状史
 
- 					healthHistory: this.formType == "healthHistory" ? JSON.stringify(healthHistory) : undefined, // 健康史
 
- 					drugHistory: this.formType == "drugHistory" ? JSON.stringify(drugHistory) : undefined, // 用药史
 
- 					allergyHistory: this.formType == "allergyHistory" ? JSON.stringify(allergyHistory) : undefined, // 过敏史 
 
- 					familyHistory: this.formType == "familyHistory" ? JSON.stringify(familyHistory) : undefined // 家族史
 
- 				};
 
- 				this.btnLoading = true
 
- 				editRecord(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;
 
- 		&-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: center;
 
- 			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 {
 
- 			width: 206rpx;
 
- 			height: 90rpx;
 
- 		}
 
- 		.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>
 
 
  |