<template>
	<view class="wenjuan">
		<image src="../../static/img/bg@2x.png" style="position: fixed;z-index: -1;width: 750rpx;top: 0;left: 0;" mode="widthFix"></image>
		<view class="wenjian-tips u-flex-col">
			<text class="text">问卷调查</text>
			<view class="u-flex u-col-top" style="margin-bottom: 10rpx;">
				<text class="text1" style="width: 150rpx;">目的和内容：</text>
				<text class="text1" style="flex: 1;">了解我国消化系统门诊常见疾病发生以及相关情况；</text>
			</view>
			<view class="u-flex u-col-top" style="margin-bottom: 10rpx;">
				<text class="text1" style="width: 150rpx;">保密承诺：</text>
				<text class="text1" style="flex: 1;">我们保证任何情况下不会以任何方式泄露您的个人信息和调查结果；</text>
			</view>
			<view class="u-flex u-col-top" style="margin-bottom: 10rpx;">
				<text class="text1" style="width: 150rpx;">自愿原则：</text>
				<text class="text1" style="flex: 1;">本调查为自愿，您可以拒绝参加或随时退出。</text>
			</view>
		</view>
		<view class="wenjuan-header">
			<view class="u-flex u-row-between header-time" @click="showtime = true">
				<text class="title">本次门诊时间</text>
				<view class="u-flex u-col-center">
					<input type="text" class="wj-time" :disabled="true" v-model="time.year">
					<text class="title">年</text>
					<input type="text" class="wj-time" :disabled="true" v-model="time.month">
					<text class="title">月</text>
					<input type="text" class="wj-time" :disabled="true" v-model="time.day">
					<text class="title">日</text>
				</view>
			</view>
			<!-- <view class="u-flex u-row-between header-text">
				<view class="u-flex">
					<text class="title">医院</text>
					<input type="text" class="input1" v-model="yiyuan">
				</view>
				<view class="u-flex">
					<text class="title">手机号</text>
					<input type="text" class="input1" v-model="name">
				</view>
			</view> -->
			<view class="u-flex u-row-between header-count">
				<text class="title">本次门诊人数</text>
				<view class="u-flex">
					<input type="number" class="input1" style="margin-right: 0;" v-model="count">
					<text class="title">人</text>
				</view>
			</view>
			<view class="header-start" @click="start">
				开始
			</view>
			<view class="row-tips">
				*此问卷针对您本次门诊所有患者的基础信息和疾病情况进行调研
			</view>
		</view>
		<u-popup mode="right" height="100vh" v-model="show1">
			<view class="timu-box">
				<image src="../../static/img/bg@2x.png" style="position: fixed;top: 0;left: 0;width: 750rpx;height: 100vh;z-index: -1;" mode=""></image>
				<view class="timu-bg">
					<view class="timu-type">
						基本信息
					</view>
					<view class="timu-row">
						<view class="timu-text">
							1、本次门诊患者群中，男性和女性患者比例分别是多少？
						</view>
						<view class="daan-box u-flex u-row-between">
							<view class="daan-item u-flex" v-for="(item,index) in daan1" :key="index" @click="open(1,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu1[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							2、本次门诊患者群中，医疗保险分布情况如何？
						</view>
						<view class="daan-box u-flex u-flex-wrap u-row-between">
							<view class="daan-item u-flex" v-for="(item,index) in daan2" :key="index" @click="open(2,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu2[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							3、本次门诊患者群中，年龄层次分布如何？
						</view>
						<view class="daan-box u-flex u-flex-wrap u-row-between">
							<view class="daan-item u-flex" v-for="(item,index) in daan3" :key="index" @click="open(3,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu3[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							4、本次门诊患者疾病分类及具体比例分别是多少？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan4" :key="index" @click="open(4,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu4[index]" class="timu-input" :disabled="true">
								<text class="title1">%</text>
							</view>
						</view>
					</view>
				</view>
				<view class="u-flex u-row-between timu-tijiao">
					<text class="text1" @click="show1 = false">上一页</text>
					<text class="text2" @click="tijiao(1)">下一页</text>
				</view>
			</view>
		</u-popup>
		<u-popup mode="right" height="100vh" v-model="show2">
			<view class="timu-box">
				<image src="../../static/img/bg@2x.png" style="position: fixed;top: 0;left: 0;width: 750rpx;height: 100vh;z-index: -1;" mode=""></image>
				<view class="timu-bg">
					<view class="timu-type">
						腹胀患者调研
					</view>
					<view class="timu-row">
						<view class="timu-text">
							5、本次门诊就诊患者群中，有腹胀症状（包括患者主诉）的患者比例有多少？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" @click="open(5,0)">
								<text class="title u-flex-1"></text>
								<input type="text" v-model="timu5[0]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							6、以上有腹胀症状的患者中，新发腹胀和有腹胀病史的患者比例分别占比多少？
						</view>
						<view class="daan-box u-flex u-row-between">
							<view class="daan-item u-flex" v-for="(item,index) in daan6" :key="index" @click="open(6,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu6[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							7、对于有腹胀病史患者，曾经或者正在进行的治疗方法有哪些？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan7" :key="index" @click="open(7,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu7[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							8、对于新发腹胀患者，您的治疗一线药物是？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan8" :key="index" @click="open(8,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu8[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							9、哪种腹胀类型的患者，您会优先考虑祛泡剂？
						</view>
						<view class="daan-box">
							<view class="daan-item" style="width: 100%;height: 128rpx;">
								<textarea v-model="timu9" class="timu-input" style="width: 100%;height: 128rpx;padding: 10rpx 0;box-sizing: border-box;"></textarea>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							10、您认为祛泡剂对这类患者最大的优势是什么？
						</view>
						<view class="daan-box">
							<view class="daan-item" style="width: 100%;height: 128rpx;">
								<textarea v-model="timu10" class="timu-input" style="width: 100%;height: 128rpx;padding: 10rpx 0;box-sizing: border-box;"></textarea>
							</view>
						</view>
					</view>
				</view>
				<view class="u-flex u-row-between timu-tijiao">
					<text class="text1" @click="show2 = false">上一页</text>
					<text class="text2" @click="tijiao(2)" v-if="changeshowbg(1) || changeshowbg(2)">下一页</text>
					<text class="text2" @click="tijiao(4)" v-else>提交</text>
				</view>
			</view>
		</u-popup>
		<u-popup mode="right" height="100vh" v-model="show3">
			<view class="timu-box">
				<image src="../../static/img/bg@2x.png" style="position: fixed;top: 0;left: 0;width: 750rpx;height: 100vh;z-index: -1;" mode=""></image>
				<view class="timu-bg">
					<view class="timu-type">
						腹痛患者调研
					</view>
					<view class="timu-row">
						<view class="timu-text">
							11、本次门诊中存在腹痛症状患者，以下部位腹痛发生的比例是？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan11" :key="index" @click="open(11,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu11[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							12、在本次门诊诊断肠易激综合征（IBS）时，您是否会考虑患者的IBS亚型？如考虑，不同亚型的占比都是多少？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;height: 128rpx;">
								<view class="title u-flex-col">
									<text>A. 不考虑，认为亚型与治疗方案关系不大 </text>
									<u-radio-group v-model="daan12radio" @change="radioGroupChange12">
										<u-radio name="是">
											是
										</u-radio>
										<u-radio name="否">
											否
										</u-radio>
									</u-radio-group>
								</view>
							</view>
							<view class="daan-item u-flex" :style="{opacity: daan12radio == '是' ? '0.3' : 1,width: '100%'}" v-for="(item,index) in daan12" :key="index" @click="open(12,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu12[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							13、有证据表明解痉剂可改善肠易激综合征（IBS）的症状，对腹痛的疗效显著。若选择奥替溴铵治疗IBS相关的腹痛，您会考虑给以下哪些亚型的肠易激综合征（IBS）患者使用奥替溴铵？
						</view>
						<view class="daan-box">
							<view :class="timu13[index] ? 'daan-item u-flex daan-item1' : 'daan-item u-flex'" :style="{opacity: check13(item,index),width: '100%'}" v-for="(item,index) in daan13" :key="index" @click="change13(item,index)">
								<text class="title u-flex-1">{{item}}</text>
								<!-- <input type="text" v-model="timu13[index]" class="timu-input" :disabled="true">
								<text class="title">%</text> -->
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							14、您认为奥替溴铵对肠易激综合征（IBS）患者最大的优势是什么？
						</view>
						<view class="daan-box">
							<view class="daan-item" :style="{opacity: timu13[5] ? 0.3 : 1,width: '100%',height: '128rpx'}">
								<textarea v-model="timu14" :disabled="timu13[5]" class="timu-input" style="width: 100%;height: 128rpx;padding: 10rpx 0;box-sizing: border-box;"></textarea>
							</view>
						</view>
					</view>
				</view>
				<view class="u-flex u-row-between timu-tijiao">
					<text class="text1" @click="show3 = false">上一页</text>
					<text class="text2" @click="tijiao(3)" v-if="changeshowbg(2)">下一页</text>
					<text class="text2" @click="tijiao(4)" v-else>提交</text>
				</view>
			</view>
		</u-popup>
		<u-popup mode="right" height="100vh" v-model="show4">
			<view class="timu-box">
				<image src="../../static/img/bg@2x.png" style="position: fixed;top: 0;left: 0;width: 750rpx;height: 100vh;z-index: -1;" mode=""></image>
				<view class="timu-bg">
					<view class="timu-type">
						炎症性肠病患者调研
					</view>
					<view class="timu-row">
						<view class="timu-text">
							15、本次门诊溃疡性结肠炎(UC)患者群中，按疾病程度分类，分别占比多少？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan15" :key="index" @click="open(15,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu15[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan16" :key="index" @click="open(16,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu16[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<view class="timu-row">
						<view class="timu-text">
							17、本次门诊针对溃疡性结肠炎（UC）患者所使用的不同治疗方案的占比？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex" style="width: 100%;" v-for="(item,index) in daan17" :key="index" @click="open(17,index)">
								<text class="title u-flex-1">{{item}}</text>
								<input type="text" v-model="timu17[index]" class="timu-input" :disabled="true">
								<text class="title">%</text>
							</view>
						</view>
					</view>
					<!-- <view class="timu-row">
						<view class="timu-text">
							18、针对本次门诊中使用不同剂型美沙拉秦类药物的患者数？
						</view>
						<view class="daan-box">
							<view class="daan-item u-flex u-row-between" style="width: 100%;">
								<text class="title" style="width:160rpx">A. 缓释片剂</text>
								<view class="u-flex">
									<text class="title">剂量</text>
									<input type="number" v-model="timu181" style="width: 85rpx;" class="timu-input">
								</view>
								<view class="u-flex" @click="open(18,0)">
									<text class="title">人数</text>
									<input type="text" v-model="timu18[0]" style="width: 85rpx;" class="timu-input" :disabled="true">
									<text class="title">%</text>
								</view>
							</view>
							<view class="daan-item u-flex u-row-between" style="width: 100%;">
								<text class="title" style="width:160rpx">B. 缓释颗粒</text>
								<view class="u-flex">
									<text class="title">剂量</text>
									<input type="number" v-model="timu182" style="width: 85rpx;" class="timu-input">
								</view>
								<view class="u-flex" @click="open(18,1)">
									<text class="title">人数</text>
									<input type="text" v-model="timu18[1]" style="width: 85rpx;" class="timu-input" :disabled="true">
									<text class="title">%</text>
								</view>
							</view>
							<view class="daan-item u-flex u-row-between" style="width: 100%;">
								<text class="title" style="width:160rpx">C. 栓剂</text>
								<view class="u-flex">
									<text class="title">剂量</text>
									<input type="number" v-model="timu183" style="width: 85rpx;" class="timu-input">
								</view>
								<view class="u-flex" @click="open(18,2)">
									<text class="title">人数</text>
									<input type="text" v-model="timu18[2]" style="width: 85rpx;" class="timu-input" :disabled="true">
									<text class="title">%</text>
								</view>
							</view>
						</view>
					</view> -->
					<view class="timu-row">
						<view class="timu-text">
							18、您认为美沙拉秦对溃疡性结肠炎(UC)患者最大的优势是什么？
						</view>
						<view class="daan-box">
							<view class="daan-item" style="width: 100%;height: 128rpx;">
								<textarea v-model="timu18" class="timu-input" style="width: 100%;height: 128rpx;padding: 10rpx 0;box-sizing: border-box;"></textarea>
							</view>
						</view>
					</view>
				</view>
				<view class="u-flex u-row-between timu-tijiao">
					<text class="text1" @click="show4 = false">上一页</text>
					<text class="text2" @click="tijiao(4)">提交</text>
				</view>
			</view>
		</u-popup>
		<u-picker v-model="showtime" mode="time" :params="params" @confirm="changetime"></u-picker>
		<u-picker mode="selector" v-model="shownum" :default-selector="defaulenum" :range="numlist" @confirm="changenum"></u-picker>
	</view>
</template>

<script>
	import timu from "../../common/timu.js"
	var numlist = timu.getNumber(100)
	export default {
		data() {
			return {
				yiyuan: '',
				name: '',
				time: {
					year: "",
					month: "",
					day: ""
				},
				count: '',

				timu1: ['', ''],
				daan1: ['男', '女'],

				timu2: ['', '', '', ''],
				daan2: ['A. 医保(新农合)', 'B. 商业保险', 'C. 自费', 'D. 其他'],

				timu3: ['', '', '', ''],
				daan3: ['A. 小于18岁', 'B. 18-40岁', 'C. 41-60岁', 'D. 61岁及以上'],

				timu4: ['', '', '', '', '', '', '', ''],
				daan4: ['A. 肠易激综合征（IBS）', 'B. 溃疡性结肠炎', 'C. 克罗恩病', 'D. 功能性消化不良', 'E. 功能性腹胀', 'F. 肠炎', 'G. 胃炎', 'H. 其他待查'],

				timu5: [''],

				timu6: ['', ''],
				daan6: ['A. 新发腹胀', 'B. 有腹胀病史'],

				timu7: ['', '', '', '', '', '', '', '', '', '', '', ''],
				daan7: ['A. 饮食干预', 'B. 促动力药物', 'C. 消化酶', 'D. 益生菌', 'E. 祛泡剂', 'F. 抗生素', 'G. 神经调节剂', 'H. 解痉药', 'I. 中药治疗', 'J. 生物反馈治疗', 'K. 其他', 'L. 不干预'],

				timu8: ['', '', '', '', '', '', '', ''],
				daan8: ['A. 促动力药物', 'B. 消化酶', 'C. 益生菌', 'D. 祛泡剂', 'E. 抗生素', 'F. 神经调节剂', 'G. 解痉药', 'H. 中药治疗'],

				timu9: '',
				timu10: '',

				timu11: ['', '', '', '', '', '', '', '', '', ''],
				daan11: ['A. 中上腹', 'B. 左上腹', 'C. 右上腹', 'D. 下腹', 'E. 左下腹', 'F. 右下腹', 'G. 脐周', 'H. 全腹', 'I. 不固定', 'J. 说不清部位'],

				daan12radio: '',
				timu12: ['', '', '', ''],
				daan12: ['B. IBS便秘型（IBS-C）', 'C. IBS腹泻型（IBS-D）', 'D. IBS混合型（IBS-M）', 'E. IBS不定型（IBS-U）'],

				daan13radio1: '',
				daan13radio2: '',
				timu13: [false, false, false, false, false, false],
				daan13: ['A. 不考虑亚型，只要有腹痛症状即使用', 'B. IBS便秘型（IBS-C）', 'C. IBS腹泻型（IBS-D）', 'D. IBS混合型（IBS-M）', 'E. IBS不定型（IBS-U）', 'F. 不使用奥替溴铵'],

				timu14: '',

				timu15: ['', '', ''],
				daan15: ['A. 轻度', 'B. 轻中度', 'C. 中重度'],

				timu16: ['', '', '', '', ''],
				daan16: ['A. 疾病活动期', 'B. 便血', 'C. 长期用药出现副作用', 'D. 原治疗方案使用不方便', 'E. 维持期定期复诊'],

				timu17: ['', '', '', '', '', ''],
				daan17: ['A. 氨基水杨酸制剂', 'B. 激素类', 'C. 硫嘌呤类药物', 'D. 沙利度胺', 'E. 生物制剂类', 'F. 其他方案'],

				// timu18: ['', '', ''],
				// timu181: '',
				// timu182: '',
				// timu183: '',

				timu18: '',

				showtime: false,
				params: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				shownum: false,
				numlist: [],
				defaulenum: [0],
				timuindex: '',
				daanindex: '',

				show1: false,
				show2: false,
				show3: false,
				show4: false,
			}
		},
		onLoad() {
			this.getuser()
		},
		methods: {
			getuser() {
				this.$http.getUserInfo().then(res => {
					if (res.data.code == 200) {
						// this.userdata = res.data.result
						this.name = res.data.result.phone || ''
						this.yiyuan = res.data.result.dwname || ''
					}
				})
			},
			change13(item, index) {
				if (this.check13(item, index) == 1) {
					this.timu13[index] = this.timu13[index] ? false : true
					this.timu13 = JSON.parse(JSON.stringify(this.timu13))
				}
				if (index == 0 && this.timu13[index]) {
					this.timu13 = JSON.parse(JSON.stringify([true, false, false, false, false, false]))
				}
				if (index == 5 && this.timu13[index]) {
					this.timu13 = JSON.parse(JSON.stringify([false, false, false, false, false, true]))
					this.timu14 = ''
				}
			},
			check13(item, index) {
				if (index != 0 && index != 5) {
					if (this.timu13[0] || this.timu13[5]) {
						return 0.3
					} else {
						return 1
					}
				} else {
					if (this.timu13[0] && index == 5) {
						return 0.3
					}
					if (this.timu13[5] && index == 0) {
						return 0.3
					}
					return 1
				}
			},
			start() {
				if (!this.time.year) {
					this.$u.toast("请选择门诊时间")
					return
				}
				// if (!this.yiyuan) {
				// 	this.$u.toast("请输入医院名字")
				// 	return
				// }
				// if (!this.name) {
				// 	this.$u.toast("请输入手机号")
				// 	return
				// }
				if (!this.count) {
					this.$u.toast("请输入门诊人数")
					return
				}
				this.show1 = true
			},
			tijiao(type) {
				var topic = []
				var topicTwo = []
				var b = []
				var bTwo = []
				// --------------------------------------------------第一部分--------------------------------------------------
				var timu1bili = 0
				this.timu1.forEach((val, key) => {
					timu1bili = timu1bili + Number(val)
					b.push(`${this.daan1[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				if (timu1bili < 100) {
					this.$u.toast("第1题比例加起来需为100%")
					return
				}
				topic.push({
					topicT: '1、本次门诊患者群中，男性和女性患者比例分别是多少？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '1、本次门诊患者群中，男性和女性患者比例分别是多少？',
					topicD: bTwo.join(",")
				})

				var timu2bili = 0
				b = []
				bTwo = []
				this.timu2.forEach((val, key) => {
					timu2bili = timu2bili + Number(val)
					b.push(`${this.daan2[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				if (timu2bili < 100) {
					this.$u.toast("第2题比例加起来需为100%")
					return
				}
				topic.push({
					topicT: '2、本次门诊患者群中，医疗保险分布情况如何？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '2、本次门诊患者群中，医疗保险分布情况如何？',
					topicD: bTwo.join(",")
				})

				var timu3bili = 0
				b = []
				bTwo = []
				this.timu3.forEach((val, key) => {
					timu3bili = timu3bili + Number(val)
					b.push(`${this.daan3[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				if (timu3bili < 100) {
					this.$u.toast("第3题比例加起来需为100%")
					return
				}
				topic.push({
					topicT: '3、本次门诊患者群中，年龄层次分布如何？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '3、本次门诊患者群中，年龄层次分布如何？',
					topicD: bTwo.join(",")
				})

				b = []
				bTwo = []
				this.timu4.forEach((val, key) => {
					b.push(`${this.daan4[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				topic.push({
					topicT: '4、本次门诊患者疾病分类及具体比例分别是多少？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '4、本次门诊患者疾病分类及具体比例分别是多少？',
					topicD: bTwo.join(",")
				})

				if (type == 1) {
					this.show2 = true
					return
				}

				// --------------------------------------------------第二部分--------------------------------------------------
				topic.push({
					topicT: '5、本次门诊就诊患者群中，有腹胀症状（包括患者主诉）的患者比例有多少？',
					topicD: `${this.timu5[0] || 0}%`
				})
				topicTwo.push({
					topicT: '5、本次门诊就诊患者群中，有腹胀症状（包括患者主诉）的患者比例有多少？',
					topicD: `${this.timu5[0] || 0}%`
				})

				var timu6bili = 0
				b = []
				bTwo = []
				this.timu6.forEach((val, key) => {
					timu6bili = timu6bili + Number(val)
					b.push(`${this.daan6[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				if (timu6bili < 100) {
					this.$u.toast("第6题比例加起来需为100%")
					return
				}
				topic.push({
					topicT: '6、以上有腹胀症状的患者中，新发腹胀和有腹胀病史的患者比例分别占比多少？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '6、以上有腹胀症状的患者中，新发腹胀和有腹胀病史的患者比例分别占比多少？',
					topicD: bTwo.join(",")
				})

				b = []
				bTwo = []
				this.timu7.forEach((val, key) => {
					b.push(`${this.daan7[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				topic.push({
					topicT: '7、对于有腹胀病史患者，曾经或者正在进行的治疗方法有哪些？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '7、对于有腹胀病史患者，曾经或者正在进行的治疗方法有哪些？',
					topicD: bTwo.join(",")
				})

				b = []
				bTwo = []
				this.timu8.forEach((val, key) => {
					b.push(`${this.daan8[key]}${val || 0}%`)
					bTwo.push(`${val || 0}%`)
				})
				topic.push({
					topicT: '8、对于新发腹胀患者，您的治疗一线药物是？',
					topicD: b.join(",")
				})
				topicTwo.push({
					topicT: '8、对于新发腹胀患者，您的治疗一线药物是？',
					topicD: bTwo.join(",")
				})

				if (!this.timu9) {
					this.$u.toast("请填写第9题")
					return
				}
				var timu9 = "";
				for (var i = 0; i < this.timu9.length; i++) {
					timu9 = timu9 + (this.timu9[i] == "\n" ? '' : this.timu9[i])
				}
				topic.push({
					topicT: '9、哪种腹胀类型的患者，您会优先考虑祛泡剂？',
					topicD: timu9
				})
				topicTwo.push({
					topicT: '9、哪种腹胀类型的患者，您会优先考虑祛泡剂？',
					topicD: timu9
				})

				if (!this.timu10) {
					this.$u.toast("请填写第10题")
					return
				}
				var timu10 = "";
				for (var i = 0; i < this.timu10.length; i++) {
					timu10 = timu10 + (this.timu10[i] == "\n" ? '' : this.timu10[i])
				}
				topic.push({
					topicT: '10、您认为祛泡剂对这类患者最大的优势是什么？',
					topicD: timu10
				})
				topicTwo.push({
					topicT: '10、您认为祛泡剂对这类患者最大的优势是什么？',
					topicD: timu10
				})

				if (type == 2) {
					if (this.changeshowbg(1)) {
						this.show3 = true
						return
					}
					if (this.changeshowbg(2)) {
						this.show4 = true
						return
					}
					return
				}

				// --------------------------------------------------第三部分--------------------------------------------------

				if (Number(this.timu4[0]) > 0) {
					b = []
					bTwo = []
					this.timu11.forEach((val, key) => {
						b.push(`${this.daan11[key]}${val || 0}%`)
						bTwo.push(`${val || 0}%`)
					})
					topic.push({
						topicT: '11、本次门诊中存在腹痛症状患者，以下部位腹痛发生的比例是？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '11、本次门诊中存在腹痛症状患者，以下部位腹痛发生的比例是？',
						topicD: bTwo.join(",")
					})

					b = []
					bTwo = []
					if (!this.daan12radio) {
						this.$u.toast("请选择第12题")
						return
					}
					b.push(`A 不考虑，认为亚型与治疗方案关系不大 (${this.daan12radio})`)
					bTwo.push(`${this.daan12radio}`)
					if (this.daan12radio == '否') {
						var timu12bili = 0
						this.timu12.forEach((val, key) => {
							timu12bili = timu12bili + Number(val)
							b.push(`${this.daan12[key]}${val || 0}%`)
							bTwo.push(`${val || 0}%`)
						})
						if (timu12bili < 100) {
							this.$u.toast("第12题比例加起来需为100%")
							return
						}
					}
					topic.push({
						topicT: '12、在本次门诊诊断肠易激综合征（IBS）时，您是否会考虑患者的IBS亚型？如考虑，不同亚型的占比都是多少？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '12、在本次门诊诊断肠易激综合征（IBS）时，您是否会考虑患者的IBS亚型？如考虑，不同亚型的占比都是多少？',
						topicD: bTwo.join(",")
					})

					b = []
					bTwo = []
					if (!this.timu13[0] && !this.timu13[5]) {
						if (this.timu13.indexOf(true) == -1) {
							this.$u.toast("请选择第13题")
							return
						}
					}
					this.timu13.forEach((val, key) => {
						b.push(`${this.daan13[key]}${val ? '是' : '否'}`)
						bTwo.push(`${val ? '是' : '否'}`)
					})

					topic.push({
						topicT: '13、有证据表明解痉剂可改善肠易激综合征（IBS）的症状，对腹痛的疗效显著。若选择奥替溴铵治疗IBS相关的腹痛，您会考虑给以下哪些亚型的肠易激综合征（IBS）患者使用奥替溴铵？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '13、有证据表明解痉剂可改善肠易激综合征（IBS）的症状，对腹痛的疗效显著。若选择奥替溴铵治疗IBS相关的腹痛，您会考虑给以下哪些亚型的肠易激综合征（IBS）患者使用奥替溴铵？',
						topicD: bTwo.join(",")
					})

					if (!this.timu14 && !this.timu13[5]) {
						this.$u.toast("请填写第14题")
						return
					}
					var timu14 = "";
					for (var i = 0; i < this.timu14.length; i++) {
						timu14 = timu14 + (this.timu14[i] == "\n" ? '' : this.timu14[i])
					}
					topic.push({
						topicT: '14、您认为奥替溴铵对肠易激综合征（IBS）患者最大的优势是什么？',
						topicD: timu14
					})
					topicTwo.push({
						topicT: '14、您认为奥替溴铵对肠易激综合征（IBS）患者最大的优势是什么？',
						topicD: timu14
					})

					if (type == 3) {
						if (this.changeshowbg(2)) {
							this.show4 = true
							return
						}
						return
					}
				}

				// --------------------------------------------------第四部分--------------------------------------------------

				if ((Number(this.timu4[1]) + Number(this.timu4[2])) > 0) {
					b = []
					bTwo = []
					var timu15bili = 0
					this.timu15.forEach((val, key) => {
						timu15bili = timu15bili + Number(val)
						b.push(`${this.daan15[key]}${val || 0}%`)
						bTwo.push(`${val || 0}%`)
					})
					if (timu15bili < 100) {
						this.$u.toast("第15题比例加起来需为100%")
						return
					}
					topic.push({
						topicT: '15、本次门诊溃疡性结肠炎(UC)患者群中，按疾病程度分类，分别占比多少？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '15、本次门诊溃疡性结肠炎(UC)患者群中，按疾病程度分类，分别占比多少？',
						topicD: bTwo.join(",")
					})

					b = []
					bTwo = []
					this.timu16.forEach((val, key) => {
						b.push(`${this.daan16[key]}${val || 0}%`)
						bTwo.push(`${val || 0}%`)
					})
					topic.push({
						topicT: '16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '16、本次门诊溃疡性结肠炎(UC)患者就诊原因占比？',
						topicD: bTwo.join(",")
					})

					b = []
					bTwo = []
					this.timu17.forEach((val, key) => {
						b.push(`${this.daan17[key]}${val || 0}%`)
						bTwo.push(`${val || 0}%`)
					})
					topic.push({
						topicT: '17、本次门诊针对溃疡性结肠炎（UC）患者所使用的不同治疗方案的占比？',
						topicD: b.join(",")
					})
					topicTwo.push({
						topicT: '17、本次门诊针对溃疡性结肠炎（UC）患者所使用的不同治疗方案的占比？',
						topicD: bTwo.join(",")
					})

					// b = []
					// bTwo = []
					// if (!this.timu181 || Number(this.timu18[0]) == 0 || !this.timu182 || Number(this.timu18[1]) == 0 || !this.timu183 || Number(this.timu18[2]) == 0) {
					// 	this.$u.toast("请完善第18题")
					// 	return
					// }
					// b.push(`A. 缓释片剂 剂量 ${this.timu181} 人数 ${this.timu18[0]}`)
					// bTwo.push(`${this.timu181}|${this.timu18[0]}`)
					// b.push(`B. 缓释颗粒 剂量 ${this.timu182} 人数 ${this.timu18[1]}`)
					// bTwo.push(`${this.timu182}|${this.timu18[1]}`)
					// b.push(`C. 栓剂 剂量 ${this.timu183} 人数 ${this.timu18[2]}`)
					// bTwo.push(`${this.timu183}|${this.timu18[2]}`)
					// topic.push({
					// 	topicT: '18、针对本次门诊中使用不同剂型美沙拉秦类药物的患者数？',
					// 	topicD: b.join(",")
					// })
					// topicTwo.push({
					// 	topicT: '18、针对本次门诊中使用不同剂型美沙拉秦类药物的患者数？',
					// 	topicD: bTwo.join(",")
					// })

					if (!this.timu18) {
						this.$u.toast("请填写第18题")
						return
					}
					var timu18 = "";
					for (var i = 0; i < this.timu18.length; i++) {
						timu18 = timu18 + (this.timu18[i] == "\n" ? '' : this.timu18[i])
					}
					topic.push({
						topicT: '18、您认为美沙拉秦对溃疡性结肠炎(UC)患者最大的优势是什么？',
						topicD: timu18
					})
					topicTwo.push({
						topicT: '18、您认为美沙拉秦对溃疡性结肠炎(UC)患者最大的优势是什么？',
						topicD: timu18
					})
				}
				// --------------------------------------------------完成--------------------------------------------------
				uni.showLoading({
					mask: true,
					title: "请稍后"
				})
				this.$http.topicAdd({
					topicTop: `本次门诊时间 ${this.time.year} 年 ${this.time.month} 月 ${this.time.day} 日   本次门诊人数 ${this.count}（人）`,
					topic: JSON.stringify(topic),
					topicTwo: JSON.stringify(topicTwo),
					phone: this.name,
					hospital: this.yiyuan,
					outpatientServiceTime: `${this.time.year}-${this.time.month}-${this.time.day}`
				}).then(res => {
					uni.hideLoading()
					this.$u.toast(res.data.message)
					if (res.data.code == 200) {
						setTimeout(() => {
							uni.navigateBack()
						}, 800)
					}
				})
			},
			changeshowbg(type) {
				if (type == 1) {
					if (this.timu4[0] > 0) {
						return true
					} else {
						return false
					}
				}
				if (type == 2) {
					if ((Number(this.timu4[1]) + Number(this.timu4[2])) > 0) {
						return true
					} else {
						return false
					}
				}
			},
			checkradio131() {
				if (this.daan13radio2 == '是') {
					return true
				}
				return false
			},
			radioGroupChange12(e) {
				if (e == '是') {
					this.timu12 = ['', '', '', '']
				}
			},
			changenum(e) {
				if ([1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 15, 16, 17, 18].includes(this.timuindex)) {
					if (this.timuindex == 18) {
						this[`timu${this.timuindex}`][this.daanindex] = e[0] + 1
					} else if (this.timuindex == 1 || this.timuindex == 6) {
						this[`timu${this.timuindex}`][this.daanindex] = e[0]
						if (this.daanindex == 0) {
							this[`timu${this.timuindex}`][1] = 100 - e[0]
						} else {
							this[`timu${this.timuindex}`][0] = 100 - e[0]
						}
					} else {
						this[`timu${this.timuindex}`][this.daanindex] = e[0]
					}
				}

				if (this.timuindex == 12) {
					this.daan12radio = '否'
				}
			},
			open(index, type) {
				this.timuindex = index
				this.daanindex = type
				if ([2, 3, 12, 15].includes(this.timuindex)) {
					var num = 0
					this[`timu${index}`].forEach((val, key) => {
						if (type != key) {
							num = num + Number(val)
						}
					})
					this.numlist = timu.getNumber(100 - num)
				} else {
					this.numlist = JSON.parse(JSON.stringify(numlist))
					if (index == 18) {
						this.numlist.shift()
					}
				}

				if (this[`timu${index}`][type]) {
					if (index == 18) {
						this.defaulenum = [this[`timu${index}`][type] - 1]
					} else {
						this.defaulenum = [this[`timu${index}`][type]]
					}
				} else {
					this.defaulenum = [0]
				}
				if (index == 12 && this.daan12radio == '是') {
					return
				}
				this.shownum = true
			},
			changetime(e) {
				this.time = e
			}
		}
	}
</script>

<style lang="scss">
	.wenjuan {
		padding: 1rpx 0;

		.tijiao-btn {
			width: 686rpx;
			line-height: 96rpx;
			background: #167FFF;
			border-radius: 48rpx;
			text-align: center;
			margin: 40rpx auto;
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
		}

		.timu-box {
			position: relative;
			z-index: 1;
			width: 750rpx;
			padding: 1rpx 0;

			.timu-tijiao {
				width: 750rpx;
				height: 166rpx;
				background: #FFFFFF;
				box-shadow: 0px -2px 0px 0px rgba(0, 0, 0, 0.03);
				padding: 10rpx 30rpx 0 30rpx;

				.text1 {
					width: 330rpx;
					line-height: 88rpx;
					background: rgba(22, 127, 255, 0.2);
					border-radius: 12rpx;
					font-size: 32rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #167FFF;
					text-align: center;
					margin-right: 30rpx;
				}

				.text2 {
					flex: 1;
					line-height: 88rpx;
					background: #167FFF;
					border-radius: 12rpx;
					text-align: center;
					font-size: 32rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
				}
			}

			.timu-bg {
				width: 690rpx;
				background: rgba(255, 255, 255, 0.6);
				border-radius: 20rpx;
				border: 2rpx solid #FFFFFF;
				backdrop-filter: blur(4px);
				margin: 20rpx auto;
				padding: 26rpx 20rpx;

				.timu-type {
					padding: 0 12rpx;
					line-height: 44rpx;
					background: #167FFF;
					border-radius: 6rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					margin-bottom: 32rpx;
					display: inline-block;
				}
			}

			.timu-row {
				position: relative;
				padding: 1rpx 0;

				.timu-text {
					font-size: 28rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
					margin-bottom: 24rpx;
				}

				.daan-box {
					.daan-item {
						width: 312rpx;
						margin-bottom: 26rpx;
						height: 68rpx;
						border-radius: 12rpx;
						border: 1rpx solid #167FFF;
						padding: 0 20rpx;

						.timu-input {
							width: 44rpx;
						}

						.title {
							font-size: 28rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: rgba(0, 0, 0, 0.8);
						}
					}

					.daan-item1 {
						background-color: #167FFF;
						color: #fff;

						.title {
							color: #fff;
						}
					}

				}
			}
		}


		input {
			border-bottom: 1rpx solid #333333;
			height: 30rpx;
			font-size: 24rpx;
			// padding: 0 10rpx;
			box-sizing: border-box;
			text-align: center;
		}

		.wenjuan-header {
			width: 690rpx;
			// height: 580rpx;
			background: rgba(255, 255, 255, 0.6);
			border-radius: 20rpx;
			border: 2rpx solid #FFFFFF;
			backdrop-filter: blur(4px);
			margin: 0 auto;
			padding: 88rpx 60rpx 74rpx 60rpx;

			.row-tips {
				width: 400rpx;
				text-align: center;
				font-size: 20rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #131415;
				margin: 44rpx auto 0 auto;
			}

			.header-start {
				width: 450rpx;
				line-height: 84rpx;
				background: #167FFF;
				border-radius: 16rpx;
				text-align: center;
				font-size: 34rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				margin: 0 auto;
			}

			.header-count {
				margin-bottom: 112rpx;

				.title {
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #131415;
				}

				.input1 {
					width: 150rpx;
				}
			}

			.header-text {
				margin-bottom: 44rpx;

				.title {
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #131415;
				}

				.input1 {
					width: 150rpx;
				}
			}

			.header-time {
				margin-bottom: 44rpx;

				.title {
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #131415;
				}

				.wj-time {
					width: 84rpx;
				}
			}
		}


		.wenjian-tips {
			padding: 0 50rpx;
			font-size: 22rpx;
			margin-bottom: 34rpx;

			.text {
				font-size: 60rpx;
				font-family: HYYaKuHei-85J, HYYaKuHei;
				font-weight: normal;
				color: #167FFF;
				margin: 54rpx 0 30rpx 0;
			}

			.text1 {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #167FFF;
			}

		}
	}
</style>