<template>
	<div class="app-container">
		<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
			label-width="80px">
			<el-form-item label="" prop="noticeTitle">
				<el-input v-model="queryParams.param.keywords" placeholder="支持姓名、全拼、简拼、手机号吗、证件号码" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="门诊/住院" prop="visitType">
				<el-select v-model="queryParams.param.visitType" placeholder="请选择" clearable>
					<el-option label="门诊" :value="0" />
					<el-option label="住院" :value="1" />
				</el-select>
			</el-form-item>
			<!-- <el-form-item label="姓名" prop="name">
				<el-input v-model="queryParams.param.name" placeholder="请输入" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item> -->
			<el-form-item label="性别" prop="gender">
				<el-select v-model="queryParams.param.gender" placeholder="请选择" clearable>
					<el-option label="男" :value="0" />
					<el-option label="女" :value="1" />
				</el-select>
			</el-form-item>
			<!-- <el-form-item label="手机号码" prop="phone">
				<el-input v-model="queryParams.param.phone" placeholder="请输入" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="证件号码" prop="idCard">
				<el-input v-model="queryParams.param.idCard" placeholder="请输入" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item> -->
			<el-form-item label="年龄范围" prop="createBy">
				<div class="form-item-age">
					<el-input v-model="queryParams.param.startAge" placeholder="最小年龄" clearable
						@keyup.enter.native="handleQuery" />
					<span>—</span>
					<el-input v-model="queryParams.param.endAge" placeholder="最大年龄" clearable
						@keyup.enter.native="handleQuery" />
				</div>
			</el-form-item>
			<el-form-item label="医生" prop="doctor">
				<el-input v-model="queryParams.param.doctor" placeholder="请输入" clearable
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="档案状态" prop="status">
				<el-select v-model="queryParams.param.status" placeholder="请选择" clearable>
					<el-option label="保存" :value="0" />
					<el-option label="待审核" :value="1" />
					<el-option label="通过" :value="2" />
					<el-option label="驳回" :value="3" />
				</el-select>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
				<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
			</el-form-item>
		</el-form>

		<el-row :gutter="10" class="mb8">
			<el-col :span="1.5">
				<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
					@click="handleDelete">删除</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="info" plain icon="el-icon-bottom" size="mini"
					@click="handleDownload">下载模版</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="warning" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入</el-button>
			</el-col>
			<el-col :span="1.5">
				<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
			</el-col>
			<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
		</el-row>

		<el-table v-loading="loading" :data="listDat" @selection-change="handleSelectionChange" max-height="600">
			<el-table-column type="selection" width="55" align="center" />
			<el-table-column fixed label="姓名" align="center" prop="name" min-width="100" />
			<el-table-column fixed label="性别" align="center" prop="gender" show-overflow-tooltip min-width="100">
				<template slot-scope="scope">
					<span v-if="scope.row.gender == 0">男</span>
					<span v-if="scope.row.gender == 1">女</span>
				</template>
			</el-table-column>
			<el-table-column fixed label="年龄" align="center" prop="age" show-overflow-tooltip min-width="80" />
			<el-table-column label="民族" align="center" prop="ethnicity" show-overflow-tooltip min-width="100" />
			<el-table-column label="受教育年限" align="center" prop="educationYears" show-overflow-tooltip min-width="100" />
			<el-table-column label="手机号码" align="center" prop="phone" show-overflow-tooltip min-width="150" />
			<el-table-column label="证件类型" align="center" prop="idCardType" show-overflow-tooltip min-width="200">
				<template slot-scope="scope">
					{{ idCardTypeValue[scope.row.idCardType] }}
				</template>
			</el-table-column>
			<el-table-column label="证件号码" align="center" prop="idCard" show-overflow-tooltip min-width="180" />
			<el-table-column label="门诊/住院" align="center" show-overflow-tooltip min-width="100">
				<template slot-scope="scope">
					<span v-if="scope.row.visitType == 0">门诊</span>
					<span v-if="scope.row.visitType == 1">住院</span>
				</template>
			</el-table-column>
			<el-table-column label="门诊号/住院号" align="center" prop="visitNumber" show-overflow-tooltip min-width="180" />
			<el-table-column label="门诊时间/住院时间" align="center" show-overflow-tooltip min-width="140">
				<template slot-scope="scope">
					<span>
						{{ parseTime(scope.row.visitTime, "{y}-{m}-{d} {h}:{i}") }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="出院时间" align="center" prop="dischargeTime" show-overflow-tooltip min-width="140">
				<template slot-scope="scope">
					<span>
						{{ parseTime(scope.row.dischargeTime, "{y}-{m}-{d} {h}:{i}") }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="责任医生" align="center" prop="doctor" show-overflow-tooltip min-width="100" />
			<el-table-column label="主要诊断" align="center" prop="diagnosisName" show-overflow-tooltip min-width="200" />
			<el-table-column label="建档人" align="center" prop="createBy" show-overflow-tooltip min-width="100" />
			<el-table-column label="建档时间" align="center" min-width="140">
				<template slot-scope="scope">
					<span>
						{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="档案状态" align="center" prop="createBy" show-overflow-tooltip width="100"
				fixed="right">
				<template slot-scope="scope">
					<span>{{ status[scope.row.status] }}</span>
				</template>
			</el-table-column>
			<el-table-column fixed="right" label="随访队列" align="center" prop="" show-overflow-tooltip width="200">
				<template slot-scope="scope">
					<div v-if="scope.row.queueVoList && scope.row.queueVoList.length">
						{{ scope.row.queueVoList.map((i) => i.queueName).join(",") }}
					</div>
				</template>
			</el-table-column>
			<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
				<template slot-scope="scope">
					<el-button size="mini" type="text" icon="el-icon-edit"
						@click="handleUpdate(scope.row)">修改</el-button>
					<el-button size="mini" type="text" icon="el-icon-delete"
						@click="handleDelete(scope.row)">删除</el-button>
					<el-button size="mini" type="text" icon="el-icon-tickets"
						@click="handleDetails(scope.row)">档案详情</el-button>
					<el-button size="mini" type="text" icon="el-icon-notebook-2"
						@click="handleEecorde(scope.row)">随访记录</el-button>
					<el-button :disabled="scope.row.status != 0" size="mini" type="text" icon="el-icon-s-promotion"
						@click="handleExamine(scope.row, 1)">
						提交审核
					</el-button>
				</template>
			</el-table-column>
		</el-table>

		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
			:limit.sync="queryParams.pageSize" @pagination="getList" />

		<!-- 添加或修改公告对话框 -->
		<el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body>
			<el-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep">
				<el-form-item label="姓名" prop="name">
					<el-input v-model="form.name" placeholder="请输入" />
				</el-form-item>
				<el-form-item label="性别" prop="gender">
					<el-radio-group v-model="form.gender">
						<el-radio :label="0">男</el-radio>
						<el-radio :label="1">女</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-form-item label="出生日期" prop="birthDate">
					<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.birthDate" type="date"
						placeholder="选择日期">
					</el-date-picker>
				</el-form-item>
				<el-form-item label="民族" prop="ethnicity">
					<el-input v-model="form.ethnicity" placeholder="请输入" />
				</el-form-item>
				<el-form-item label="受教育年限" prop="educationYears">
					<el-input v-model="form.educationYears" placeholder="请输入" :disabled="formDisabled" />
				</el-form-item>
				<el-form-item label="手机号码" prop="phone">
					<el-input v-model="form.phone" placeholder="请输入" />
				</el-form-item>
				<el-form-item label="证件类型" prop="idCardType">
					<el-select v-model="form.idCardType" placeholder="请选择">
						<el-option v-for="item in idCardType" :key="item.value" :label="item.label" :value="item.value">
						</el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="证件号码" prop="idCard">
					<el-input v-model="form.idCard" placeholder="请输入" />
				</el-form-item>
				<el-form-item label="门诊/住院" prop="visitType">
					<el-radio-group v-model="form.visitType">
						<el-radio :label="0">门诊</el-radio>
						<el-radio :label="1">住院</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-form-item :label=" visitType[form.visitType] + '号'" prop="visitNumber">
					<el-input v-model="form.visitNumber" placeholder="请输入" />
				</el-form-item>
				<el-form-item :label=" visitType[form.visitType] + '时间'" prop="visitTime">
					<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.visitTime" type="date"
						placeholder="选择日期">
					</el-date-picker>
				</el-form-item>
				<el-form-item label="出院时间" v-if='form.visitType == 1' prop="dischargeTime">
					<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.dischargeTime"
						type="date" placeholder="选择日期">
					</el-date-picker>
				</el-form-item>
				<el-form-item label="责任医生" prop="doctor">
					<el-input v-model="form.doctor" placeholder="请输入" />
				</el-form-item>

				<el-form-item label="随访队列" prop="queueIdList">
					<el-select v-model="form.queueIdList" multiple placeholder="请选择">
						<el-option v-for="item in followupList" :key="item.id" :label="item.name" :value="item.id">
						</el-option>
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button type="primary" @click="submitForm">确 定</el-button>
				<el-button @click="cancel">取 消</el-button>
			</div>
		</el-dialog>
		<!-- 档案详情 -->
		<el-drawer title="档案详情" :visible.sync="drawer">
			<div style="padding: 0 16px">
				<el-descriptions class="margin-top" :column="2">
					<el-descriptions-item label="姓名">{{
            form.name
          }}</el-descriptions-item>
					<el-descriptions-item label="性别">
						{{ form.gender == 0 ? "男" : "女" }}
					</el-descriptions-item>
					<el-descriptions-item label="门诊号/住院号">
						{{ form.visitNumber }}
					</el-descriptions-item>
					<el-descriptions-item label="门诊时间/住院时间">
						{{ form.visitTime }}
					</el-descriptions-item>
					<el-descriptions-item label="责任医生">
						{{ form.doctor }}
					</el-descriptions-item>
					<el-descriptions-item label="建档人">
						{{ form.createBy }}
					</el-descriptions-item>
					<el-descriptions-item label="建档时间">
						{{ form.createTime }}
					</el-descriptions-item>
				</el-descriptions>
				<!-- 档案详情-->
				<el-form ref="detailsForm" :model="detailsForm" :rules="rules" class="formStep">
					<div>主要诊断</div>
					<el-form-item class="form-item-zd" label="" prop="JBXX_ZYZD">
						<el-checkbox-group v-model="detailsForm['JBXX_ZYZD']">
							<el-checkbox v-for="(item, index) in medicalHistory" :label="item">
							</el-checkbox>
						</el-checkbox-group>
						<el-input v-model="detailsForm['JBXX_ZYZD_QT']" placeholder="其他" />
					</el-form-item>
					<div>
						<div class="div-title1">评估信息</div>
						<div class="div-title2">人体成分（基本参数）</div>
					</div>
					<div class="human-body">
						<el-form-item label="体重" prop="PG_RTCF_TZ">
							<el-input v-model="detailsForm['PG_RTCF_TZ']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="去脂体重" prop="PG_RTCF_QZTZ">
							<el-input v-model="detailsForm['PG_RTCF_QZTZ']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="肌肉量" prop="PG_RTCF_JRL">
							<el-input v-model="detailsForm['PG_RTCF_JRL']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="总水分（TBW）" prop="PG_RTCF_TBW">
							<el-input v-model="detailsForm['PG_RTCF_TBW']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="蛋白质" prop="PG_RTCF_DBZ">
							<el-input v-model="detailsForm['PG_RTCF_DBZ']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="蛋白质" prop="PG_RTCF_GZ">
							<el-input v-model="detailsForm['PG_RTCF_GZ']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="脂肪" prop="PG_RTCF_ZF">
							<el-input v-model="detailsForm['PG_RTCF_ZF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="体脂百分比（PBF）" prop="PG_RTCF_PBF">
							<el-input v-model="detailsForm['PG_RTCF_PBF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="骨骼肌" prop="PG_RTCF_GGJ">
							<el-input v-model="detailsForm['PG_RTCF_GGJ']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="体质指数（BMI）" prop="PG_RTCF_BMI">
							<el-input v-model="detailsForm['PG_RTCF_BMI']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="腰臀比（WHR）" prop="PG_RTCF_WHR">
							<el-input v-model="detailsForm['PG_RTCF_WHR']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="内脏脂肪水平" prop="PG_RTCF_NZZFSP">
							<el-input v-model="detailsForm['PG_RTCF_NZZFSP']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="身体各成分百分比" prop="PG_RTCF_STGCFBFB">
							<el-input v-model="detailsForm['PG_RTCF_STGCFBFB']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="体型类型" prop="PG_RTCF_TXLX">
							<el-select v-model="detailsForm['PG_RTCF_TXLX']" multiple collapse-tags placeholder="请选择">
								<el-option v-for="(item, index) in systemType" :label="item" :value="item">
								</el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="身体年龄" prop="PG_RTCF_STNL">
							<el-input v-model="detailsForm['PG_RTCF_STNL']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="健康评分" prop="PG_RTCF_JKPF">
							<el-input v-model="detailsForm['PG_RTCF_JKPF']" placeholder="请输入" />
						</el-form-item>
					</div>
					<div class="div-title1">中医体质辨识</div>
					<div class="div-title2">主要体质</div>
					<el-form-item prop="PG_TZBS_ZYTZ">
						<el-radio-group v-model="detailsForm['PG_TZBS_ZYTZ']">
							<el-radio v-for="(item, index) in habitus" :key="index" :label="item">
							</el-radio>
						</el-radio-group>
					</el-form-item>
					<div class="div-title2">兼夹体质</div>
					<el-form-item class="form-item-zd" prop="PG_TZBS_JJTZ">
						<el-checkbox-group v-model="detailsForm['PG_TZBS_JJTZ']">
							<el-checkbox v-for="(item, index) in habitus" :key="index" :label="item">
							</el-checkbox>
						</el-checkbox-group>
					</el-form-item>
					<div class="div-title2">体态评估</div>
					<div class="human-body">
						<el-form-item label="TAPS体态自觉评估得分(3-15分)" prop="PG_TT_TAPS_DF">
							<el-input v-model="detailsForm['PG_TT_TAPS_DF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="TRACE体态临床评估得分(0-12分)" prop="PG_TT_TRACE_DF">
							<el-input v-model="detailsForm['PG_TT_TRACE_DF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="SRS-22问卷评估得分(1~5分)" prop="PG_TT_SRS22_DF">
							<el-input v-model="detailsForm['PG_TT_SRS22_DF']" placeholder="请输入" />
						</el-form-item>
					</div>
					<div class="div-title2">失眠评估</div>
					<div class="human-body">
						<el-form-item label="患者健康问卷（PHQ-9）评估得分(0-27分)" prop="PG_SM_PHQ-9_DF">
							<el-input v-model="detailsForm['PG_SM_PHQ-9_DF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="Epworth嗜睡评估得分(0-24分)" prop="PG_SM_EPSW_DF">
							<el-input v-model="detailsForm['PG_SM_EPSW_DF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="匹兹堡睡眠质量指数（PSQI）评估得分(0~21分)" prop="PG_SM_PSQI_DF">
							<el-input v-model="detailsForm['PG_SM_PSQI_DF']" placeholder="请输入" />
						</el-form-item>
					</div>
					<div class="div-title2">焦虑评估</div>
					<div class="human-body">
						<el-form-item label="汉密尔顿抑郁评估（HAMD-24）得分(0-96分)" prop="PG_JL_HAMD-24_DF">
							<el-input v-model="detailsForm['PG_JL_HAMD-24_DF']" placeholder="请输入" />
						</el-form-item>
						<el-form-item label="焦虑自评（SAS）得分(0-100分)" prop="PG_JL_SAS_DF">
							<el-input v-model="detailsForm['PG_JL_SAS_DF']" placeholder="请输入" />
						</el-form-item>
					</div>
					<el-form-item label="治疗类型" prop="ZLFA_ZLLX">
						<el-radio-group v-model="detailsForm['ZLFA_ZLLX']">
							<el-radio label="中西医结合治疗"> </el-radio>
							<el-radio label="单纯中医治疗"> </el-radio>
						</el-radio-group>
					</el-form-item>
					<div style="font-size: 22px;margin-bottom: 14px" class="div-title1">诊疗方法</div>
					<div style="margin-bottom: 14px;" v-for="(i, ind) in healType" :key="ind">
						<div class="div-title2">{{ i.title }}</div>
						<div v-for="(j, jnd) in i.list" :key="jnd">
							<div v-if="j.title != '针灸疗法'">
								<div class="div-title3">{{ j.title }}</div>
								<span v-if="k.type == 'but'" @click="handleButClick(j, k)" class="span-but" :class="{
                    'span-but-active':
                      detailsForm[j.valueCode] == (k.value || k.title),
                  }" v-for="(k, knd) in j.list" :key="knd">
									{{ k.value || k.title }}
								</span>
								<div v-else class="human-body">
									<el-form-item prop="ZLFA_ZJ_XW_QT">
										<el-input v-model="detailsForm[j.valueCode]"></el-input>
									</el-form-item>
								</div>
							</div>
							<div v-else>
								<div class="div-title3">{{ j.title }}</div>
								<div style="" v-for="(k, knd) in j.list" :key="knd">
									<div class="div-title4">{{ k.title }}</div>
									<span v-if="l.type == 'but'" @click="handleButClick(k, l)" class="span-but" :class="{
                      'span-but-active':
                        detailsForm[k.valueCode] == (l.value || l.title),
                    }" v-for="(l, lnd) in k.list" :key="lnd">
										{{ l.value || l.title }}
									</span>
									<div v-else class="human-body">
										<el-form-item prop="ZLFA_YW_QT">
											<el-input v-model="detailsForm[k.valueCode]"></el-input>
										</el-form-item>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!--  -->
					<div class="human-body"></div>
					<el-form-item label="治理效果" prop="ZLFA_ZLXG">
						<el-radio-group v-model="detailsForm['ZLFA_ZLXG']">
							<el-radio label="治愈"> </el-radio>
							<el-radio label="显效"> </el-radio>
							<el-radio label="好转"> </el-radio>
							<el-radio label="无效"> </el-radio>
						</el-radio-group>
					</el-form-item>
					<div class="div-title2">诊疗费用</div>
					<el-form-item label="总体费用按照区间进行选择" prop="ZLFA_ZTFY">
						<el-radio-group v-model="detailsForm['ZLFA_ZTFY']">
							<el-radio label="<300元" value="<300元"> </el-radio>
							<el-radio label="300 ~ 900元" value="<300元"> </el-radio>
							<el-radio label="900 ~ 2000元" value="<300元"> </el-radio>
							<el-radio label="2000 ~ 5000元" value="<300元"> </el-radio>
							<el-radio label=">5000元" value="<300元"> </el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="检查费用按照区间进行选择" prop="ZLFA_JCFY">
						<el-radio-group v-model="detailsForm['ZLFA_JCFY']">
							<el-radio label="<300元"> </el-radio>
							<el-radio label="300 ~ 900元"> </el-radio>
							<el-radio label="900 ~ 2000元"> </el-radio>
							<el-radio label="2000 ~ 5000元"> </el-radio>
							<el-radio label=">5000元"> </el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="中医治疗费用按照区间进行选择" prop="ZLFA_ZYZLFY">
						<el-radio-group v-model="detailsForm['ZLFA_ZYZLFY']">
							<el-radio label="<300元"> </el-radio>
							<el-radio label="300 ~ 900元"> </el-radio>
							<el-radio label="900 ~ 2000元"> </el-radio>
							<el-radio label="2000 ~ 5000元"> </el-radio>
							<el-radio label=">5000元"> </el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="药物费用按照区间进行选择" prop="ZLFA_YWFY">
						<el-radio-group v-model="detailsForm['ZLFA_YWFY']">
							<el-radio label="<300元"> </el-radio>
							<el-radio label="300 ~ 900元"> </el-radio>
							<el-radio label="900 ~ 2000元"> </el-radio>
							<el-radio label="2000 ~ 5000元"> </el-radio>
							<el-radio label=">5000元"> </el-radio>
						</el-radio-group>
					</el-form-item>
				</el-form>
				<div slot="footer" class="dialog-footer" styl>
					<el-button type="primary" @click="submitDetailsForm">确 定</el-button>
					<el-button @click="cancel">取 消</el-button>
				</div>
			</div>
		</el-drawer>
		<!-- 导入患者信息 -->
		<el-dialog title="导入诊疗档案" :visible.sync="importOpen" width="640px" append-to-body>
			<el-form ref="importform" :model="importform">
				<el-form-item prop="accessUrl">
					<el-upload :limit="1" class="avatar-uploader wj-uploader" :headers="headers"
						:action="uploadFileUrl1" accept=".xlsx, .xls" :before-upload="handleBeforePdfUpload1"
						:on-success="handleUploadPdfAdd1" :file-list="fileList" :show-file-list="true">
						<i class="el-icon-upload"></i>
						<div class="el-upload__text">
							将文件拖到此处，或
							<em>点击上传</em>
						</div>
					</el-upload>
				</el-form-item>
			</el-form>
		</el-dialog>
	</div>
</template>

<script>
	import {
		treatmentQuery,
		treatmentAdd,
		treatmentUpd,
		treatmentDel,
		queryRecord,
		saveAidRecord,
		queueAdd,
	} from "@/api/medicalFile";
	import {
		getToken
	} from "@/utils/auth";
	import {
		followupQuery
	} from "@/api/followupFile";
	export default {
		name: "Notice",
		dicts: ["sys_normal_disable", "sys_user_sex"],
		data() {
			return {
				visitType: {
					0: '门诊',
					1: "住院"
				},
				headers: {
					Authorization: "Bearer " + getToken(),
					deptId: localStorage.getItem("hospitalId"),
				},
				uploadFileUrl1: process.env.VUE_APP_API_QZURL + "/acupuncture/treatment/importTreatment", // 上传的图片服务器地址
				fileList: [],
				followupList: [],
				queueOpen: false,
				// 现病史
				medicalHistory: [
					"肥胖症",
					"失眠病",
					"中风病",
					"面瘫病",
					"项痹病",
					"腰痛病",
					"痉挛性斜颈",
				],
				idCardType: [{
						label: "身份证",
						value: 0,
					},
					{
						label: "护照或外国人永居证",
						value: 1,
					},
					{
						label: "港澳居民来往内地通行",
						value: 2,
					},
					{
						label: "台湾居民来往大陆通行证",
						value: 3,
					},
					{
						label: "其他",
						value: 4,
					},
				],
				idCardTypeValue: {
					0: "身份证",
					1: "护照或外国人永居证",
					2: "港澳居民来往内地通行",
					3: "台湾居民来往大陆通行证",
					4: "其他",
				},
				// 体型类型
				systemType: [
					"隐形肥胖型",
					"脂肪过多型",
					"肥胖型",
					"肌肉不足型",
					"健康匀称型",
					"超重肌肉型",
					"消瘦型",
					"低脂肪型",
					"运动员型",
				],
				// 体质辨识
				habitus: [
					"平和质",
					"气虚质",
					" 阳虚质",
					"阴虚质",
					"痰湿质",
					" 湿热质",
					"血瘀质",
					"气郁质",
					"特禀质",
				],
				// 治疗类型
				healType: [{
						title: "肥胖症",
						list: [{
								title: "行为心理干预",
								valueCode: "ZLFA_XWXLGY",
								list: [{
										title: "行为技能训练：辅导有效的应对压力技巧，避免因情绪波动导致过度进食，训练正念饮食，提高对饥饿和饱足感的感知能力",
										value: "行为技能训练",
										type: "but",
									},
									{
										title: "目标设定与追踪：与患者共同设立短期和长期减重目标，定期进行进度评估，强化正面反馈，提高自我管理能力",
										value: "目标设定与追踪",
										type: "but",
									},
								],
							},
							{
								title: "运动干预",
								valueCode: "ZLFA_YDGY",
								list: [{
										title: "有氧运动：如快走、慢跑、游泳等，建议每周至少进行150分钟中等强度的有氧运动",
										value: "有氧运动",
										type: "but",
									},
									{
										title: "抗阻运动：如举重、俯卧撑等，建议每周进行2-3次抗阻运动",
										value: "抗阻运动",
										type: "but",
									},
								],
							},
							{
								title: "临床营养治疗",
								valueCode: "ZLFA_LCYYZL",
								list: [{
										title: "限能量饮食：在限制能量摄入（日常饮食能量减去30%）的基础上，营养素比例符合平衡膳食的要求",
										value: "限能量饮食",
										type: "but",
									},
									{
										title: "高蛋白饮食：每日蛋白质摄入量超过20%，但一般不高于35%",
										value: "高蛋白饮食",
										type: "but",
									},
									{
										title: "低碳水化合物饮食：碳水化合物供能比一般在20%-40%",
										value: "低碳水化合物饮食",
										type: "but",
									},
									{
										title: "断食：如5+2模式，1周中5天相对正常进食，其他2天摄取平常的1/4能量",
										value: "断食",
										type: "but",
									},
								],
							},
							{
								title: "针灸疗法",
								list: [{
										title: "疗法",
										valueCode: "ZLFA_ZJ_LF",
										list: [{
												title: "毫针/电针疗法",
												type: "but",
											},
											{
												title: "温针疗法",
												type: "but",
											},
											{
												title: "耳穴贴压疗法",
												type: "but",
											},
											{
												title: "穴位埋针法",
												type: "but",
											},
											{
												title: "穴位埋线法",
												type: "but",
											},
										],
									},
									{
										title: "穴位",
										valueCode: "ZLFA_ZJ_XW",
										list: [{
												title: "神门：安神定志，改善睡眠质量",
												value: "神门",
												type: "but",
											},
											{
												title: "三阴交：调理脾胃，养血安神",
												value: "三阴交",
												type: "but",
											},
											{
												title: "百会：调节大脑功能，促进睡眠",
												value: "百会",
												type: "but",
											},
											{
												title: "安眠：直接作用于睡眠中枢，帮助入睡",
												value: "安眠",
												type: "but",
											},
										],
									},
								],
							},
							{
								title: "药物治疗",
								valueCode: "ZLFA_YW",
								list: [{
										title: "奥利司他：通过抑制胃肠道脂肪酶，减少脂肪吸收",
										value: "奥利司他",
										type: "but",
									},
									{
										title: "利拉鲁肽：GLP-1受体激动剂，延缓胃排空，增加饱腹感",
										value: "利拉鲁肽",
										type: "but",
									},
									{
										title: "贝那鲁肽：GLP-1受体激动剂，作用机制与利拉鲁肽类似",
										value: "贝那鲁肽",
										type: "but",
									},
									{
										title: "司美格鲁肽：GLP-1受体激动剂，每周一次给药，减重效果显著",
										value: "司美格鲁肽",
										type: "but",
									},
									{
										title: "替尔泊肽：GLP-1受体激动剂，适用于肥胖症治疗",
										value: "替尔泊肽",
										type: "but",
									},
								],
							},
						],
					},
					{
						title: "失眠症",
						list: [{
								title: "生活习惯",
								valueCode: "ZLFA_SHXG",
								list: [{
										title: "科学膳食：避免午后摄入咖啡、茶、酒精等刺激性饮品，以及睡前过度进食",
										value: "科学膳食",
										type: "but",
									},
									{
										title: "充足日照：增加日间自然光照，减少夜间人工光源，特别是电子产品的使用",
										value: "充足日照",
										type: "but",
									},
									{
										title: "合理运动：推荐瑜伽、太极拳、八段锦等传统运动，有助于改善睡眠质量",
										value: "合理运动",
										type: "but",
									},
								],
							},
							{
								title: "心理调适",
								valueCode: "ZLFA_XLTS",
								list: [{
										title: "放松训练：包括渐进式肌肉放松训练、腹式呼吸、冥想等，可降低紧张与过度警觉，提高睡眠质量",
										value: "放松训练",
										type: "but",
									},
									{
										title: "音乐疗法：轻柔舒缓的音乐可以降低神经系统兴奋性，减轻焦虑情绪从而改善睡眠",
										value: "音乐疗法",
										type: "but",
									},
									{
										title: "认知调整：不灾难化和过分关注失眠，不因偶尔失眠而产生挫败感，培养失眠的耐受性",
										value: "认知调整",
										type: "but",
									},
								],
							},
							{
								title: "针灸疗法",
								list: [{
										title: "疗法",
										valueCode: "ZLFA_ZJ_LF_SMZ",
										list: [{
												title: "毫针/电针疗法",
												type: "but",
											},
											{
												title: "温针疗法",
												type: "but",
											},
											{
												title: "耳穴贴压疗法",
												type: "but",
											},
											{
												title: "穴位埋针法",
												type: "but",
											},
											{
												title: "穴位埋线法",
												type: "but",
											},
										],
									},
									{
										title: "穴位",
										valueCode: "ZLFA_ZJ_XW_SMZ",
										list: [{
												title: "神门：安神定志，改善睡眠质量",
												value: "神门",
												type: "but",
											},
											{
												title: "三阴交：调理脾胃，养血安神",
												value: "三阴交",
												type: "but",
											},
											{
												title: "百会：调节大脑功能，促进睡眠",
												value: "百会",
												type: "but",
											},
											{
												title: "安眠：直接作用于睡眠中枢，帮助入睡",
												value: "安眠",
												type: "but",
											},
										],
									},
								],
							},
							{
								title: "药物治疗",
								valueCode: "ZLFA_YW_SMZ",
								list: [{
										title: "苯二氮䓬受体激动剂（BZRAs）：艾司唑仑、阿普唑仑、劳拉西泮等",
										value: "苯二氮䓬受体激动剂（BZRAs）",
										type: "but",
									},
									{
										title: "非苯二氮䓬类药物（non-BZDs）：唑吡坦、扎来普隆、右佐匹克隆、佐匹克隆",
										value: "非苯二氮䓬类药物（non-BZDs）",
										type: "but",
									},
									{
										title: "褪黑素和褪黑素受体激动剂：调节生物钟，改善睡眠",
										value: "褪黑素和褪黑素受体激动剂",
										type: "but",
									},
									{
										title: "抗抑郁药物：具有镇静作用的抗抑郁药物，如曲唑酮、米氮平等，可用于失眠伴抑郁症状的患者",
										value: "抗抑郁药物",
										type: "but",
									},
									{
										title: "其他药物：选择性食欲素受体拮抗剂苏沃雷生，可用于改善睡眠质量",
										value: "其他药物",
										type: "but",
									},
								],
							},
						],
					},
					{
						title: "其他",
						list: [{
								title: "针灸疗法",
								list: [{
										title: "疗法",
										valueCode: "ZLFA_ZJ_LF_QT",
										list: [{
												title: "毫针/电针疗法",
												type: "but",
											},
											{
												title: "温针疗法",
												type: "but",
											},
											{
												title: "耳穴贴压疗法",
												type: "but",
											},
											{
												title: "穴位埋针法",
												type: "but",
											},
											{
												title: "穴位埋线法",
												type: "but",
											},
										],
									},
									{
										title: "穴位",
										valueCode: "ZLFA_ZJ_XW_QT",
										list: [{
											title: "填写",
											type: "input",
										}, ],
									},
								],
							},
							{
								title: "药物治疗",
								valueCode: "ZLFA_YW_QT",
								list: [{
									title: "填写",
									type: "input",
								}, ],
							},
						],
					},
				],
				status: {
					0: "保存",
					1: "待审核",
					2: "通过",
					3: "驳回",
				},
				loading: false, // 遮罩层
				ids: [], // 选中数组
				single: true, // 非单个禁用
				multiple: true, // 非多个禁用
				showSearch: true, // 显示搜索条件
				total: 0, // 总条数
				listDat: [{}], // 公告表格数据
				title: "", // 弹出层标题
				open: false, // 是否显示弹出层
				drawer: false, // 档案详情
				importOpen: false, // 导入弹窗
				// 查询参数
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					param: {
						keywords: '',
						visitType: '',
						name: '',
						gender: '',
						phone: '',
						idCard: '',
						startAge: '',
						endAge: '',
						doctor: '',
						status: '',
					},
				},
				formDisabled: false,
				importform: {},

				form: {},
				detailsForm: {
					JBXX_ZYZD: [], //主要诊断
					JBXX_ZYZD_QT: "", //主要诊断_其他
					PG_RTCF_TZ: "", //体重
					PG_RTCF_QZTZ: "", //去脂体重
					PG_RTCF_JRL: "", //肌肉量
					PG_RTCF_TBW: "", //总水分（TBW）
					PG_RTCF_DBZ: "", //蛋白质
					PG_RTCF_GZ: "", //骨质量（GZ）
					G_RTCF_ZF: "", //脂肪
					PG_RTCF_PBF: "", //体脂百分比
					PG_RTCF_GGJ: "", //骨骼肌
					PG_RTCF_BMI: "", //体质指数（BMI）
					PG_RTCF_WHR: "", //腰臀比（WHR）
					PG_RTCF_NZZFSP: "", //内脏脂肪水平
					PG_RTCF_STGCFBFB: "", //身体成分脂肪百分比
					PG_RTCF_TXLX: "", //体型类型
					PG_RTCF_STNL: "", //身体年龄
					PG_RTCF_JKPF: "", //健康评分
					PG_TZBS_ZYTZ: "", //主要体质
					PG_TZBS_JJTZ: [], //兼夹体质
					PG_TT_TAPS_DF: "", //体型评分（TAPS）得分
					PG_TT_TRACE_DF: "", //体型评分（TRACE）得分
					PG_TT_SRS22_DF: "", //体型评分（SRS-22）得分
					"PG_SM_PHQ-9_DF": "", // 患者健康问卷（PHQ-9）评估得分
					PG_SM_EPSW_DF: "", //Epworth嗜睡评估得分
					PG_SM_PSQI_DF: "", //匹兹堡睡眠质量指数（PSQI）评估得分
					"PG_JL_HAMD-24_DF": "", //汉密尔顿抑郁评估（HAMD-24）得分
					PG_JL_SAS_DF: "", //焦虑自评量表（SAS）得分
					ZLFA_ZLLX: "", //治疗方式
					ZLFA_XWXLGY: "", // 行为心理干预
					ZLFA_YDGY: "", //运动干预
					ZLFA_ZJ_LF: "", //针灸疗法-疗法
					ZLFA_ZJ_XW: "", //针灸疗法-穴位
					ZLFA_YW: "", //药物治疗
					ZLFA_SHXG: "", // 生活习惯
					ZLFA_XLTS: "", //心理调适

					ZLFA_LCYYZL: "", //临床用药治疗
					ZLFA_ZJ_LF_SMZ: "", // 失眠症-针灸疗法-疗法
					ZLFA_ZJ_XW_SMZ: "", // 失眠症-针灸疗法-穴位
					ZLFA_YW_SMZ: "", // 失眠症-药物治疗
					ZLFA_ZJ_LF_QT: "", // 其他-针灸疗法-疗法
					ZLFA_ZJ_XW_QT: "", // 其他-针灸疗法-穴位
					ZLFA_YW_QT: "", // 其他-药物治疗
				}, // 档案详情表单
				// 表单校验
				rules: {
					name: [{
						required: true,
						message: "患者姓名不能为空",
						trigger: "blur",
					}, ],
					gender: [{
						required: true,
						message: "性别不能为空",
						trigger: "change",
					}, ],
					phone: [{
						required: true,
						message: "手机号码不能为空",
						trigger: "blur",
					}, ],
					ethnicity: [{
						required: true,
						message: "民族不能为空",
						trigger: "blur",
					}, ],
					idCardType: [{
						required: true,
						message: "证件类型不能为空",
						trigger: "blur",
					}, ],
					idCard: [{
						required: true,
						message: "证件号码不能为空",
						trigger: "blur",
					}, ],
					visitType: [{
						required: true,
						message: "诊疗类型不能为空",
						trigger: "blur",
					}, ],
					visitNumber: [{
						required: true,
						message: "门诊号/住院号不能为空",
						trigger: "blur",
					}, ],
					visitTime: [{
						required: true,
						message: "门诊时间/住院时间不能为空",
						trigger: "change",
					}, ],
					dischargeTime: [{
						required: true,
						message: "出院时间不能为空",
						trigger: "change",
					}, ],
					doctor: [{
						required: true,
						message: "责任医生不能为空",
						trigger: "blur",
					}, ],
					educationYears: [{
						required: true,
						message: "受教育年限不能为空",
						trigger: "blur",
					}, ],
					// queueIdList: [{
					// 	required: true,
					// 	message: "随访队列不能为空",
					// 	trigger: "change",
					// }],
					birthDate: [{
						required: true,
						message: "出生日期不能为空",
						trigger: "change",
					}, ],
				},
			};
		},
		created() {
			let idCard = this.$route.query.idCard
			this.queryParams.param.keywords = idCard || ''
			this.getList();
			this.getFollowupQuery();
		},
		methods: {
			// 获取随访队列信息
			getFollowupQuery() {
				followupQuery({
					pageNum: -1,
					param: {
						status: 1
					},
				}).then((res) => {
					this.followupList = res.data.list;
					let commonQueue = JSON.parse(localStorage.getItem('commonQueue'))
					commonQueue?.forEach(i => {
						this.followupList.unshift(i)
					})
				});
			},
			// 诊疗方案点击
			handleButClick(_item, _row) {
				console.log(_item, _row);
				this.detailsForm[_item.valueCode] = _row.value || _row.title;
			},
			// 上传成功回 - pdg
			handleUploadPdfAdd1(res) {
				if (res.code == 200) {
					this.importOpen = false;
					this.getList();
					this.$modal.msgSuccess("导入成功");
				} else {
					this.$message.error(res.msg || "导入失败");
					this.fileList = [];
				}
			},
			// 上传前校检格式和大小 - 图片
			handleBeforeUpload1(file) {
				const isLt2M = file.size / 1024 / 1024 < 100;
				// 校检文件大小
				if (!isLt2M) {
					this.$message.error("上传文件大小不能超过 100MB!");
				}
				return isLt2M;
			},
			// 上传前校检格式和大小 - 文件
			handleBeforePdfUpload1(file) {
				const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
				const whiteList = ["xlsx", "xls"];
				if (whiteList.indexOf(fileSuffix) === -1) {
					this.$message.error("上传文件只能是.xlsx, .xls");
					return false;
				}
			},
			/** 查询公告列表 */
			getList() {
				this.loading = true;
				treatmentQuery(this.queryParams).then((res) => {
					this.listDat = res.data.list;
					this.total = res.data.total;
					this.loading = false;
				});
			},
			// 取消按钮
			cancel() {
				this.open = false;
				this.reset();
			},
			// 表单重置
			reset() {
				this.form = {
					name: "",
					gender: 0,
					birthDate: "",
					ethnicity: "",
					educationYears: "",
					phone: "",
					idCardType: "",
					idCard: "",
					visitType: 0,
					visitNumber: "",
					visitTime: "",
					dischargeTime: "",
					doctor: "",
					status: 0,
					queueIdList: [],
				};
				this.resetForm("form");
			},
			/** 搜索按钮操作 */
			handleQuery() {
				this.queryParams.pageNum = 1;
				this.getList();
			},
			/** 重置按钮操作 */
			resetQuery() {
				this.queryParams.param = {
					keywords: '',
					visitType: '',
					name: '',
					gender: '',
					phone: '',
					idCard: '',
					startAge: '',
					endAge: '',
					doctor: '',
					status: '',
				}
				this.handleQuery();
			},
			// 多选框选中数据
			handleSelectionChange(selection) {
				this.ids = selection.map((item) => item.id);
				this.single = selection.length != 1;
				this.multiple = !selection.length;
			},
			/** 新增按钮操作 */
			handleAdd() {
				this.reset();
				this.open = true;
				this.title = "新增诊疗档案";
			},
			/** 修改按钮操作 */
			handleUpdate(row) {
				this.open = true;
				this.title = "修改诊疗档案";
				let queueList = row.queueVoList?.map((item) => item.queueId) || [];
				this.form = {
					...JSON.parse(JSON.stringify(row)),
					queueIdList: queueList
				}
			},
			/** 提交审核 */
			handleExamine(row, _status) {
				let form = JSON.parse(JSON.stringify(row));
				form.status = _status;
				this.$modal
					.confirm(`是否确认删除提交当前数据的数据（${row.name}）？`)
					.then(function() {
						return treatmentUpd(form);
					})
					.then(() => {
						this.getList();
						this.$modal.msgSuccess("操作成功");
					})
					.catch(() => {});
			},
			/** 随访记录 */
			handleEecorde(row) {
				this.$router.push({
					path: `/followWork?idCard=${row.idCard}`
				})
			},
			/** 详情按钮操作 */
			handleDetails(row) {
				this.getDetailsForm() //重置详情表单
				this.form = JSON.parse(JSON.stringify(row));
				queryRecord({
					treatmentId: row.id
				}).then((res) => {
					let arrList = ["JBXX_ZYZD", "PG_RTCF_TXLX", "PG_TZBS_JJTZ"];
					let recordValDict = res.data.recordValDict;
					for (let key in recordValDict) {
						if (arrList.includes(key)) {
							recordValDict[key] = recordValDict[key][0].answer;
						} else {
							recordValDict[key] = recordValDict[key][0].answer.join(",");
						}
					}
					this.detailsForm = {
						...this.detailsForm,
						...recordValDict
					};
					console.log(" this.detailsForm", this.detailsForm);

					this.drawer = true;
					this.title = "诊疗档案详情";
				});
			},
			
			getDetailsForm(){
				this.detailsForm = {
					JBXX_ZYZD: [], //主要诊断
					JBXX_ZYZD_QT: "", //主要诊断_其他
					PG_RTCF_TZ: "", //体重
					PG_RTCF_QZTZ: "", //去脂体重
					PG_RTCF_JRL: "", //肌肉量
					PG_RTCF_TBW: "", //总水分（TBW）
					PG_RTCF_DBZ: "", //蛋白质
					PG_RTCF_GZ: "", //骨质量（GZ）
					G_RTCF_ZF: "", //脂肪
					PG_RTCF_PBF: "", //体脂百分比
					PG_RTCF_GGJ: "", //骨骼肌
					PG_RTCF_BMI: "", //体质指数（BMI）
					PG_RTCF_WHR: "", //腰臀比（WHR）
					PG_RTCF_NZZFSP: "", //内脏脂肪水平
					PG_RTCF_STGCFBFB: "", //身体成分脂肪百分比
					PG_RTCF_TXLX: "", //体型类型
					PG_RTCF_STNL: "", //身体年龄
					PG_RTCF_JKPF: "", //健康评分
					PG_TZBS_ZYTZ: "", //主要体质
					PG_TZBS_JJTZ: [], //兼夹体质
					PG_TT_TAPS_DF: "", //体型评分（TAPS）得分
					PG_TT_TRACE_DF: "", //体型评分（TRACE）得分
					PG_TT_SRS22_DF: "", //体型评分（SRS-22）得分
					"PG_SM_PHQ-9_DF": "", // 患者健康问卷（PHQ-9）评估得分
					PG_SM_EPSW_DF: "", //Epworth嗜睡评估得分
					PG_SM_PSQI_DF: "", //匹兹堡睡眠质量指数（PSQI）评估得分
					"PG_JL_HAMD-24_DF": "", //汉密尔顿抑郁评估（HAMD-24）得分
					PG_JL_SAS_DF: "", //焦虑自评量表（SAS）得分
					ZLFA_ZLLX: "", //治疗方式
					ZLFA_XWXLGY: "", // 行为心理干预
					ZLFA_YDGY: "", //运动干预
					ZLFA_ZJ_LF: "", //针灸疗法-疗法
					ZLFA_ZJ_XW: "", //针灸疗法-穴位
					ZLFA_YW: "", //药物治疗
					ZLFA_SHXG: "", // 生活习惯
					ZLFA_XLTS: "", //心理调适
				
					ZLFA_LCYYZL: "", //临床用药治疗
					ZLFA_ZJ_LF_SMZ: "", // 失眠症-针灸疗法-疗法
					ZLFA_ZJ_XW_SMZ: "", // 失眠症-针灸疗法-穴位
					ZLFA_YW_SMZ: "", // 失眠症-药物治疗
					ZLFA_ZJ_LF_QT: "", // 其他-针灸疗法-疗法
					ZLFA_ZJ_XW_QT: "", // 其他-针灸疗法-穴位
					ZLFA_YW_QT: "", // 其他-药物治疗
				}
			},
			/** 诊疗档案 */
			submitForm: function() {
				this.$refs["form"].validate((valid) => {
					if (valid) {
						if (this.form.id != undefined) {
							treatmentUpd(this.form).then((response) => {
								this.$modal.msgSuccess("修改成功");
								this.open = false;
								this.getList();
							});
						} else {
							treatmentAdd(this.form).then((response) => {
								this.$modal.msgSuccess("新增成功");
								this.open = false;
								this.getList();
							});
						}
					}
				});
			},
			// 诊疗详情
			submitDetailsForm: function() {
				this.$refs["detailsForm"].validate((valid) => {
					if (valid) {
						let codeAndAnswerList = [];
						for (let key in this.detailsForm) {
							let data = {
								questionCode: key,
								answer: "",
							};
							if (typeof this.detailsForm[key] === "string") {
								data.answer = this.detailsForm[key].split(",");
							} else {
								data.answer = this.detailsForm[key];
							}
							codeAndAnswerList.push(data);
						}

						saveAidRecord({
							treatmentId: this.form.id,
							codeAndAnswerList,
						}).then((response) => {
							this.$modal.msgSuccess("保存成功");
							this.drawer = false;
							this.getList()
						});
					}
				});
			},
			/** 删除按钮操作 */
			handleDelete(row) {
				const idList = row.id ? [row.id] : this.ids;
				this.$modal
					.confirm("是否确认删除当前选择的数据？")
					.then(function() {
						return treatmentDel({
							idList: idList,
						});
					})
					.then(() => {
						this.getList();
						this.$modal.msgSuccess("删除成功");
					})
					.catch(() => {});
			},
			/** 导出按钮操作 */
			handleExport() {
				this.download1(
					"/treatment/exportTreatment", {
						...this.queryParams.params,
					},
					`诊疗档案.xlsx`
				);
			},
			/** 下载按钮操作 */
			handleDownload() {
				window.open(`${process.env.VUE_APP_API_QZURL}/acupuncture/profile/TreamentTemplate.xlsx`)
				// this.download1(
				// 	"/patient/export", {},
				// 	`患者档案导入模版.xlsx`
				// );
			},
			/** 导入按钮操作 */
			handleImport() {
				this.fileList = []
				this.importOpen = true;
			},
		},
	};
</script>
<style scoped src="@/assets/styles/common.css"></style>

<style scoped>
	.div-title1 {
		font-size: 22px;
		font-weight: bold;
		margin-bottom: 10px
	}

	.div-title2 {
		font-size: 20px;
		font-weight: bold;
		margin-bottom: 10px
	}

	.div-title3 {
		font-size: 18px;
		font-weight: bold;
		margin-bottom: 10px
	}

	.span-but {
		display: inline-block;
		border-radius: 4px;
		border: 1px solid #dcdfe6;
		line-height: 32px;
		padding: 0 15px;
		margin: 5px;
	}

	.span-but-active {
		border: 1px solid #1890ff;
	}

	.human-body {
		display: flex;
		flex-wrap: wrap;
	}

	.human-body>>>.el-form-item {
		width: 49%;
		margin-right: 2%;
	}

	.human-body>>>.el-form-item:nth-of-type(2n) {
		margin-right: 0;
	}

	.formStep1>>>.el-form-item__label {}

	.form-item-zd {
		width: 100%;
		text-align: left;
	}

	.form-item-age {
		display: flex;
		align-items: center;
	}

	.form-item-age span {
		margin: 0 10px;
	}

	.form-item-age>>>.el-input {
		width: 100px;
	}

	>>>.el-drawer.rtl {
		width: 50% !important;
	}
</style>