<template>
    <el-container>
        <el-aside width="280px">
          <PatientBaseList  @selectPatientInfo="selectPatientInfo"></PatientBaseList>
        </el-aside>
        <el-container>
            <el-header style="height: 100px">
                <PatientInfo :patientInfo="patientInfo"></PatientInfo>
            </el-header>
            <div>
                <div style="width: 100%;height: 20px;padding-left: 10px;" >
                    <el-button icon="Search" type="primary" @click="queryInfo">查询</el-button>
                    <el-button @click="addHlInfo" icon="Edit" type="primary">新增</el-button>
                    <el-button icon="Delete" type="danger" @click="delInfo">删除</el-button>
                    <el-button icon="Printer" type="success" @click="daYingClick">打印</el-button>
                    <el-button icon="Search" type="primary" @click="bingAnShouYe">病案首页信息</el-button>
                </div>
                <div style="width: 100%;height: 40px;padding-left: 10px;">
                    <div style="float: left;margin-right: 10px;padding-top: 15px">
                        <el-select v-model="queryParam.typeFlag" @change="selectCxtj" style="width: 80px;"  size="small">
                            <el-option
                                    key="0"
                                    label="全部"
                                    value="0"
                            />
                            <el-option
                                    key="1"
                                    label="其他"
                                    value="1"
                            />
                        </el-select>
                        <span v-if="cxtjFlag">
                        录入日期:
                        <el-date-picker
                                v-model="queryParam.recDateStr"
                                type="date"
                                size="small"
                                :clearable="clearable"
                                format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100px;"
                        ></el-date-picker>
                        时段
                        <el-time-picker  v-model="queryParam.startRecTime" style="width: 100px"/>
                        至
                        <el-time-picker  v-model="queryParam.endRecTime" style="width: 100px"/>
                            </span>
                        <el-select v-model="queryParam.type" style="width: 60px;" @change="selectTongKong" size="small">
                            <el-option
                                    key="0"
                                    label="普通"
                                    value="0"
                            />
                            <el-option
                                    key="1"
                                    label="瞳孔"
                                    value="1"
                            />
                        </el-select>
                            护理单类型:
                            <el-select  filterable v-model="queryParam.hldType" style="width: 150px;" size="small" @change="selectHlType">
                                <el-option v-for="item in hldTypeList" :key="item.code" :label="item.name" :value="item.code">
                                    <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
                                    <el-divider direction="vertical"></el-divider>
                                    <span>{{ item.name }}</span>
                                </el-option>
                            </el-select>
                    </div>
                </div>
            </div>
            <el-main>
                <el-tabs
                        v-model="activeTableName"
                        type="card"
                >
                    <el-tab-pane label="编辑页面" name="first">
                        <h1 style="text-align: center;">{{hldTableTitle}}</h1>
                        <div style="height: 60px;">
                            <div  style="float: left;width: 58%;padding-top: 30px;">
                                <ul class="nav" >
                                    <li>姓名：{{patientInfo.name}}</li>
                                    <li>科室：{{patientInfo.admissWardName}}</li>
                                    <li>床号：{{patientInfo.bedNo}}</li>
                                    <li>住院病历号: {{patientInfo.inpatientNo}}</li>
                                    <li>入院时间：{{getFormatDatetime(patientInfo.admissDate,'yyyy-MM-DD')}}</li>
                                </ul>
                            </div>
                            <div style="float: right;width: 35%;height:38px; margin-top: 20px;">
                                {{titleNameTiShi}}
                            </div>
                        </div>
                        <el-table v-if="queryParam.hldType=='1' || queryParam.hldType=='5' " @row-click="selectOne" @row-dblclick="dbClick" :data="hldDataList" highlight-current-row stripe border :header-cell-style="{'text-align':'center'}"
                                  height="480"   style="width: 100%;" >
                            <el-table-column prop="recDateStr" label="日期" width="45" align="center" />
                            <el-table-column prop="recTimeStr" label="时间" width="40" align="center"/>
                            <el-table-column prop="patientState" label="病情" width="25" align="center"/>
                            <el-table-column  label="体温" width="40" >
                                <el-table-column prop="temperature1Str" label="℃" width="40" align="center"/>
                            </el-table-column>
                            <el-table-column  label="次/min">
                                <el-table-column prop="heart" label="心率" width="40" align="center"/>
                                <el-table-column prop="pulse1" label="脉搏" width="40" align="center"/>
                            </el-table-column>
                            <el-table-column prop="breathe1" label="呼吸" width="40" align="center"/>
                            <el-table-column  label="血压"  >
                                <el-table-column prop="pressureAmPm" label="mmHg" width="50" align="center"/>
                            </el-table-column>
                            <el-table-column  label="SpO2"  >
                                <el-table-column prop="spo2" label="%" width="50" align="center"/>
                            </el-table-column>
                            <el-table-column v-if="queryParam.hldType=='5'"  prop="mind"  label="神志" width="50"  align="center"/>
                            <el-table-column v-else  prop="mind"  label="意识" width="50"  align="center"/>
                            <el-table-column  label="瞳孔" v-if="tongKongFlag && queryParam.hldType !='5'" width="50" align="center" >
                                <template #default="scope">
                                            <span v-if="scope.row.rpupil">
                                                {{scope.row.pupilr}} {{scope.row.pupil}} <br/> o{{scope.row.pupilbj}}o <br/> {{scope.row.rpupil}} {{scope.row.lpupil}}
                                            </span>
                                </template>
                            </el-table-column>
                            <el-table-column v-if="queryParam.hldType=='5'"  label="阴道流血" align="center">
                                <el-table-column prop="outputDblood" label="ml" width="40" align="center" >
                                    <template #default="scope">
                                        {{getOutputDbloodName(scope.row.outputDblood)}}
                                    </template>
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  label="入量">
                                <el-table-column prop="col1Name" label="名称"  align="center"/>
                                <el-table-column prop="col1Am" label="ml" width="30" align="center"/>
                            </el-table-column>
                            <el-table-column  label="出量"  >
                                <el-table-column prop="col2Name" label="名称" width="80" align="center"/>
                                <el-table-column prop="col2Am" label="ml"  width="30" align="center"/>
                                <el-table-column  prop="urineColor" label="颜色"  width="40" align="center"/>
                                <el-table-column  prop="shitShape" label="性状"  width="40" align="center"/>
                            </el-table-column>
                            <el-table-column  prop="skin"  label="皮肤情况" width="60" align="center">
                            </el-table-column>
                            <el-table-column  label="管道">
                                <el-table-column prop="tubesName" label="名称" width="80" align="center"/>
                                <el-table-column prop="tubesStatus" label="情况" width="40" align="center"/>
                            </el-table-column>
                            <el-table-column v-if="queryParam.hldType=='1'"  prop="glu"  label="血糖" width="40" align="center"/>
                            <el-table-column  prop="otherInfo"  label="病情观察、护理措施及效果" width="280" >
                                <template #default="scope">
                                    <div style="text-align: left;line-height: 13px">{{scope.row.otherInfo}} </div>
                                </template>
                            </el-table-column>

                            <el-table-column  prop="useridName"  label="护士签名" width="65">
                            </el-table-column>
                        </el-table>

                        <el-table v-if="queryParam.hldType=='2'" :data="hldDataList" highlight-current-row stripe border :header-cell-style="{'text-align':'center'}"
                                  :cell-style="{'text-align':'center'}"    height="550" @row-click="selectOne" @row-dblclick="dbClick"   style="width: 100%;" >
                            <el-table-column prop="recDateStr" label="日期" width="45"/>
                            <el-table-column prop="recTimeStr" label="时间" width="40" />
                            <el-table-column prop="patientState" label="病情" width="25" align="center"/>
                            <el-table-column prop="boxTemp" label="箱(室)温" width="30" />
                            <el-table-column prop="boxHumi" label="湿度" width="25" />
                            <el-table-column prop="temperature1Str" label="T" width="40" />
                            <el-table-column prop="urineQuanAm" label="HR" width="25" />
                            <el-table-column prop="breathe1" label="R" width="30" />
                            <el-table-column prop="pressureAmPm" label="BP" width="50" />
                            <el-table-column prop="spo2" label="Spo2" width="40" />

                            <el-table-column  label="入量(ml)">
                                <el-table-column prop="col1Name" label="项目" width="70" />
                                <el-table-column prop="col1Am" label="量" width="30" />
                            </el-table-column>
                            <el-table-column  label="出量(ml)"  >
                                <el-table-column prop="col2Name" label="项目" width="70" />
                                <el-table-column prop="urineQuanAm" label="量"  width="35" />
                                <el-table-column  prop="urineColor" label="色"  width="35" />
                                <el-table-column prop="shitOther" label="项目" width="70" />
                                <el-table-column prop="shitQuan" label="次" width="35" />
                                <el-table-column  prop="shitShape" label="性状"  width="40" />
                            </el-table-column>
                            <el-table-column  label="护理">
                                <el-table-column prop="isEyes" label="眼" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isEyes)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isMouthpiece" label="口" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isMouthpiece)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="bellybuttonFlag" label="脐" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.bellybuttonFlag)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="buttocksFlag" label="臀" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.buttocksFlag)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="showerFlag" label="沐浴" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.showerFlag)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="spongeBathFlag" label="擦澡" width="25" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.spongeBathFlag)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="decubitus" label="体位" width="25" >
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  label="病情观察"  >
                                <el-table-column prop="skin" label="皮肤" width="40" />
                                <el-table-column prop="infoCry" label="哭声"  width="25" />
                                <el-table-column  prop="infoSuck" label="吸吮"  width="40" />
                                <el-table-column prop="infoSleep" label="睡眠" width="25" />
                                <el-table-column prop="infoActivity" label="自主活动" width="25">
                                    <template #default="scope">
                                        <div>{{scope.row.infoActivity}} </div>
                                    </template>
                                </el-table-column>>
                                <el-table-column  prop="acraStatus" label="肢端"  width="25" />
                            </el-table-column>
                            <el-table-column  prop="otherInfo"  label="病情观察、护理措施及效果" width="215" >
                                <template #default="scope">
                                    <div style="text-align: left;line-height: 13px;">{{scope.row.otherInfo}} </div>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="useridName"  label="护士签名" >
                            </el-table-column>
                        </el-table>

                        <el-table v-if="queryParam.hldType=='3'" :data="hldDataList" highlight-current-row stripe border :header-cell-style="{'text-align':'center'}"
                                  height="550"  @row-click="selectOne" @row-dblclick="dbClick"   :cell-style="{'text-align':'center'}" style="width: 100%;">
                            <el-table-column prop="recDateStr" label="日期" width="45"/>
                            <el-table-column prop="recTimeStr" label="时段" width="40" />
                            <el-table-column  prop="mind"  label="意识" width="35"  />
                            <el-table-column  label="生命体征" >
                                <el-table-column prop="temperature1Str" label="体温" width="40" />
                                <el-table-column prop="pulse1" label="脉搏" width="40" />
                                <el-table-column prop="breathe1" label="呼吸" width="40" />
                                <el-table-column prop="pressureAmPm" label="血压" width="50" />
                            </el-table-column>
                            <el-table-column prop="spo2" label="Spo2" width="40" />
                            <el-table-column  label="入量(ml)">
                                <el-table-column prop="col1Name" label="项目" width="75" />
                                <el-table-column prop="col1Am" label="量" width="30" />
                            </el-table-column>
                            <el-table-column  label="出量(ml)"  >
                                <el-table-column prop="outputDblood" label="阴道流血" width="40" >
                                    <template #default="scope">
                                        {{getOutputDbloodName(scope.row.outputDblood)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="urineQuanAm" label="尿液"  width="40" />
                                <el-table-column  prop="outputOther" label="其他"  width="40" />
                            </el-table-column>
                            <el-table-column  label="各种管道">
                                <el-table-column prop="tubesName" label="名称" width="75" />
                                <el-table-column prop="tubesStatus" label="情况" width="35" />
                            </el-table-column>
                            <el-table-column  prop="fheartSoundStr"  label="胎心音(次/min)" width="50" >
                                <template #default="scope">
                                    {{scope.row.fheartSoundStr}} {{scope.row.fheartSound}}
                                </template>
                            </el-table-column>
                            <el-table-column prop="fetalBreak" label="胎膜破否" width="35" >
                                <template #default="scope">
                                    {{taimopofor(scope.row.fetalBreak)}}
                                </template>
                            </el-table-column>
                            <el-table-column prop="uterineOpen" label="宫口开大(cm)" width="35" />
                            <el-table-column prop="uterineStatus" label="宫缩状况(秒/分)" width="40" />
                            <el-table-column prop="uterineHigh" label="宫底高度" width="35" />
                            <el-table-column prop="uterineMove" label="子宫收缩状态" width="35" />

                            <el-table-column label="伤口">
                                <el-table-column prop="outBlood" label="渗血" width="35" />
                                <el-table-column prop="redHurt" label="红肿" width="35" />
                            </el-table-column>
                            <el-table-column prop="anusAir" label="肛门排气" width="35" />
                            <el-table-column prop="suckleFun" label="喂哺技巧指导" width="45" />
                            <el-table-column  prop="otherInfo"  label="病情观察、护理措施及效果" width="270">
                                <template #default="scope">
                                    <div style="text-align: left;line-height: 13px">{{scope.row.otherInfo}} </div>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="useridName"  label="护士签名" width="50" >
                            </el-table-column>
                        </el-table>

                        <el-table v-if="queryParam.hldType=='4'" :data="hldDataList" highlight-current-row stripe border :header-cell-style="{'text-align':'center'}"
                                  height="550"  @row-click="selectOne" @row-dblclick="dbClick"    style="width: 100%;">
                            <el-table-column prop="recDateStr" label="日期" width="45" align="center"/>
                            <el-table-column prop="recTimeStr" label="时段" width="40"  align="center" />
                            <el-table-column  prop="faceColour"  label="面色" width="40"   align="center"/>
                            <el-table-column  label="体温" >
                                <el-table-column prop="temperature1Str" label="℃" width="40"  align="center"/>
                            </el-table-column>
                            <el-table-column prop="breath" label="呼吸状况" width="40"  align="center"/>
                            <el-table-column prop="bodyWeight" label="体重(kg)" width="40"  align="center"/>
                            <el-table-column  label="皮肤">
                                <el-table-column prop="skinColour" label="颜色" width="35"  align="center"/>
                                <el-table-column prop="skinStatus" label="状况" width="35"  align="center"/>
                            </el-table-column>
                            <el-table-column  label="脐部情况">
                                <el-table-column prop="outBlood" label="渗血" width="35"  align="center"/>
                                <el-table-column prop="redHurt" label="红肿" width="35"  align="center"/>
                            </el-table-column>
                            <el-table-column  label="喂养情况">
                                <el-table-column prop="intakeBreastMilk" label="母乳(次数)" width="65" align="center" />
                                <el-table-column prop="intakeMilk" label="配方奶(ml)" width="70"  align="center"/>
                                <el-table-column prop="intakeWater" label="糖水(ml)" width="55"  align="center"/>
                            </el-table-column>
                            <el-table-column prop="shit" label="大便次数" width="40"  align="center"/>
                            <el-table-column prop="urineQuan" label="小便次数"  width="40"  align="center"/>
                            <el-table-column prop="spo2" label="Spo2" width="40"  align="center"/>
                            <el-table-column  prop="glu"  label="血糖" width="40"  align="center"/>
                            <el-table-column  prop="otherInfo"  label="病情观察、护理措施及效果">
                                <template #default="scope">
                                    <div style="text-align: left;line-height: 13px">{{scope.row.otherInfo}} </div>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="useridName"  label="护士签名" width="50"   align="center">
                            </el-table-column>
                        </el-table>

                        <el-table v-if="queryParam.hldType=='6'" :data="hldDataList" highlight-current-row stripe border :header-cell-style="{'text-align':'center'}"
                                  :cell-style="{'text-align':'center'}"      height="550" @row-click="selectOne" @row-dblclick="dbClick"    style="width: 100%;">
                            <el-table-column prop="recDateStr" label="日期" width="45"/>
                            <el-table-column prop="recTimeStr" label="时间" width="40" />
                            <el-table-column  label="体温" >
                                <el-table-column prop="temperature1Str" label="℃" width="40" />
                            </el-table-column>
                            <el-table-column  label="生命体征" >
                                <el-table-column label="体温" >
                                    <el-table-column prop="temperature1Str" label="℃" width="40" />
                                </el-table-column>
                                <el-table-column label="次/min" >
                                    <el-table-column prop="heart" label="心率" width="40" />
                                    <el-table-column prop="breathe1" label="呼吸" width="40" />
                                </el-table-column>
                                <el-table-column label="mmHg">
                                    <el-table-column prop="pressureAmPm" label="血压" width="50" />
                                    <el-table-column prop="map" label="MAP" width="40" />
                                </el-table-column>
                                <el-table-column   prop="mind"  label="神志" width="50"  />
                                <el-table-column label="瞳孔">
                                    <el-table-column prop="pupil" label="mm" width="50" align="center" >
                                        <template #default="scope">
                                            <span v-if="scope.row.rpupil">
                                                {{scope.row.pupilr}} {{scope.row.pupil}} <br/> o{{scope.row.pupilbj}}o <br/> {{scope.row.rpupil}} {{scope.row.lpupil}}
                                            </span>
                                        </template>
                                    </el-table-column>
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  label="入量">
                                <el-table-column  label="项目" width="90" >
                                    <el-table-column prop="col1Name" label="ml.g" width="30" />
                                </el-table-column>
                                <el-table-column  label="量" width="90" >
                                    <el-table-column prop="col1Am" label="ml" width="30" />
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  label="出量"  >
                                <el-table-column prop="col2Name" label="项目"  width="50" />
                                <el-table-column label="量"  width="30" >
                                    <el-table-column  prop="col2Am" label="ml"  width="40" />
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  label="监测项目" >
                                <el-table-column prop="spo2" label="Spo2" width="40" />
                                <el-table-column prop="cvp" label="CVP" width="40" />
                                <el-table-column prop="etcho2" label="ETCO2" width="35" />
                                <el-table-column prop="gcs" label="GCS" width="40" />
                                <el-table-column prop="rass" label="RASS" width="35" />
                                <el-table-column prop="glu"  label="血糖" width="40" />
                                <el-table-column prop="othJc"  label="其他" width="40" />
                            </el-table-column>
                            <el-table-column   label="病情观察、护理措施及效果"  >
                                <el-table-column prop="position" label="体位" width="30" />
                                <el-table-column prop="isSputum" label="吸痰" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isSputum)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isAtomization" label="雾化" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isAtomization)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isBreath" label="气道护理" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isBreath)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isMouthpiece" label="口腔护理" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isMouthpiece)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isHuiyin" label="会阴护理" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isHuiyin)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isBed" label="床上擦浴" width="30" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isBed)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="isAV" label="A-V护理" width="35" >
                                    <template #default="scope">
                                        {{isForXuanZhong(scope.row.isAV)}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="otherInfo" label="其他"  >
                                    <template #default="scope">
                                        <div style="text-align: left;line-height: 13px">{{scope.row.otherInfo}} </div>
                                    </template>
                                </el-table-column>
                            </el-table-column>
                            <el-table-column  prop="useridName"  label="护士签名" width="50" >
                            </el-table-column>
                        </el-table>
                    </el-tab-pane>
                    <el-tab-pane label="打印页面" name="second">
                        <el-scrollbar height="580px">
                        <div id="cqYz" >
                            <table id="pageTable">
                                <thead>
                                <tr>
                                    <td :colspan="titleColspan" style="width: 100%; text-align: center; padding: 16px 0; border: none;font-size: 27px;font-weight:bold">{{hldTableTitle}}</td>
                                </tr>
                                <tr>
                                    <td :colspan="titleColspan" style="border: none">
                                        <div style="float: left;width: 55%;margin-top: 25px;">
                                            <ul class="nav" >
                                                <li>姓名：{{patientInfo.name}}</li>
                                                <li>科室：{{patientInfo.admissWardName}}</li>
                                                <li>床号：{{patientInfo.bedNo}}</li>
                                                <li>住院病历号: {{patientInfo.inpatientNo}}</li>
                                                <li>入院时间：{{getFormatDatetime(patientInfo.admissDate,'yyyy-MM-DD')}}</li>
                                            </ul>
                                        </div>
                                        <div style="float: right;width: 40%;">
                                            {{titleNameTiShi}}
                                        </div>
                                    </td>
                                </tr>
                                <tr v-if="queryParam.hldType=='5' || queryParam.hldType=='1'">
                                    <th rowspan="2" >日期</th>
                                    <th rowspan="2" >时间</th>
                                    <th rowspan="2" >病情</th>
                                    <th >体温</th>
                                    <th >心率</th>
                                    <th >脉搏</th>
                                    <th rowspan="2" >呼吸</th>
                                    <th >血压</th>
                                    <th >SpO2</th>
                                    <th rowspan="2" >{{queryParam.hldType=='5'?'神志':'意识'}}</th>
                                    <th  v-if="tongKongFlag && queryParam.hldType !='5'">瞳孔</th>
                                    <th  v-if="queryParam.hldType =='5'">阴道流血</th>
                                    <th colspan="2" >入量</th>
                                    <th colspan="4" >出量</th>
                                    <th rowspan="2" >皮肤情况</th>
                                    <th colspan="2" >管道名称</th>
                                    <th v-if="queryParam.hldType =='1'" rowspan="2" >血糖</th>
                                    <th rowspan="2">病情观察、护理措施及效果</th>
                                    <th rowspan="2">护士签名</th>
                                </tr>
                                <tr v-if="queryParam.hldType=='5' || queryParam.hldType=='1'">
                                    <th>℃</th>
                                    <th colspan="2">次/min</th>
                                    <th >mmHg</th>
                                    <th >%</th>
                                    <th v-if="tongKongFlag && queryParam.hldType !='5'">mm</th>
                                    <th v-if="queryParam.hldType =='5'">阴道流血</th>
                                    <th >名称</th>
                                    <th >ml</th>
                                    <th >名称</th>
                                    <th >ml</th>
                                    <th >颜色</th>
                                    <th >性状</th>
                                    <th >名称</th>
                                    <th >情况</th>
                                </tr>
                                <tr v-if="queryParam.hldType=='2'">
                                    <th rowspan="2" >日期</th>
                                    <th rowspan="2" >时间</th>
                                    <th rowspan="2" >病情</th>
                                    <th rowspan="2" >箱(室)温</th>
                                    <th rowspan="2" >湿度</th>
                                    <th rowspan="2" >T</th>
                                    <th rowspan="2" >HR</th>
                                    <th rowspan="2" >R</th>
                                    <th rowspan="2" >BP</th>
                                    <th rowspan="2" >SpO2</th>
                                    <th colspan="2" >入量(ml)</th>
                                    <th colspan="6" >出量(ml)</th>
                                    <th colspan="7" >出量(ml)</th>
                                    <th colspan="6" >出量(ml)</th>
                                    <th rowspan="2" >病情观察、护理措施及效果</th>
                                    <th rowspan="2" >护士签名</th>
                                </tr>
                                    <tr  v-if="queryParam.hldType=='2'">
                                        <th>项目</th>
                                        <th>量</th>
                                        <th>项目</th>
                                        <th>量</th>
                                        <th>色</th>
                                        <th>项目</th>
                                        <th>次</th>
                                        <th>性状</th>
                                        <th>眼</th>
                                        <th>口</th>
                                        <th>脐</th>
                                        <th>臀</th>
                                        <th>沐浴</th>
                                        <th>擦澡</th>
                                        <th>体位</th>
                                        <th>皮肤</th>
                                        <th>哭声</th>
                                        <th>吸吮</th>
                                        <th>睡眠</th>
                                        <th>自主活动</th>
                                        <th>肢端</th>
                                    </tr>

                                    <tr v-if="queryParam.hldType=='3'">
                                        <th rowspan="2"  >日期</th>
                                        <th rowspan="2" >时段</th>
                                        <th rowspan="2" >意识</th>
                                        <th colspan="4" >生命体征</th>
                                        <th rowspan="2" >SpO2</th>
                                        <th colspan="2" >入量(ml)</th>
                                        <th colspan="3" >出量(ml)</th>
                                        <th colspan="2" >各种管道</th>
                                        <th rowspan="2" >胎心音(次/min)</th>
                                        <th rowspan="2" >胎膜破否</th>
                                        <th rowspan="2" >宫口开大(cm)</th>
                                        <th rowspan="2" >宫缩状况(秒/分)</th>
                                        <th rowspan="2" >宫底高度</th>
                                        <th rowspan="2" >子宫收缩状态</th>
                                        <th colspan="2" >伤口</th>
                                        <th rowspan="2" >肛门排气</th>
                                        <th rowspan="2" >喂哺技巧指导</th>
                                        <th rowspan="2" >病情观察、护理措施及效果</th>
                                        <th rowspan="2" >护士签名</th>
                                    </tr>
                                    <tr v-if="queryParam.hldType=='3'">
                                        <th >体温</th>
                                        <th >脉搏</th>
                                        <th >呼吸</th>
                                        <th >血压</th>
                                        <th >项目</th>
                                        <th >量</th>
                                        <th >阴道流血</th>
                                        <th >尿液</th>
                                        <th >其他</th>
                                        <th >名称</th>
                                        <th >情况</th>
                                        <th >渗血</th>
                                        <th >红肿</th>
                                    </tr>

                                    <tr v-if="queryParam.hldType=='4'">
                                        <th rowspan="2"  >日期</th>
                                        <th rowspan="2" >时间</th>
                                        <th rowspan="2" >面色</th>
                                        <th >体温</th>
                                        <th rowspan="2" >呼吸状况</th>
                                        <th rowspan="2" >体重(kg)</th>
                                        <th colspan="2" >皮肤</th>
                                        <th colspan="2" >脐部情况</th>
                                        <th colspan="3" >喂养情况</th>
                                        <th rowspan="2" >大便次数</th>
                                        <th rowspan="2" >小便次数</th>
                                        <th rowspan="2" >Spo2</th>
                                        <th rowspan="2" >血糖</th>
                                        <th rowspan="2" >病情观察、护理措施及效果</th>
                                        <th rowspan="2" >护士签名</th>
                                    </tr>
                                    <tr v-if="queryParam.hldType=='4'">
                                        <th  >℃</th>
                                        <th  >颜色</th>
                                        <th  >状况</th>
                                        <th  >渗血</th>
                                        <th  >红肿</th>
                                        <th  >母乳(次数)</th>
                                        <th  >配方奶(ml)</th>
                                        <th  >糖水(ml)</th>
                                    </tr>

                                    <tr  v-if="queryParam.hldType=='6'">
                                        <th rowspan="3">日期</th>
                                        <th rowspan="3">时间</th>
                                        <th colspan="7">生命体征</th>
                                        <th colspan="2">入量</th>
                                        <th colspan="2">出量</th>
                                        <th colspan="7">监测项目</th>
                                        <th colspan="9">监测项目</th>
                                        <th rowspan="3">护士签名</th>
                                    </tr>
                                    <tr  v-if="queryParam.hldType=='6'">
                                        <th>体温</th>
                                        <th>心率</th>
                                        <th>呼吸</th>
                                        <th>血压</th>
                                        <th>MAP</th>
                                        <th rowspan="2">神志</th>
                                        <th >瞳孔</th>
                                        <th>项目</th>
                                        <th>量</th>
                                        <th rowspan="2">项目</th>
                                        <th >量</th>
                                        <th rowspan="2" style="width: 25px">Spo2</th>
                                        <th rowspan="2" style="width: 25px">CVP</th>
                                        <th rowspan="2" style="width: 25px">ETCO2</th>
                                        <th rowspan="2" style="width: 25px">GCS</th>
                                        <th rowspan="2" style="width: 25px">RASS</th>
                                        <th rowspan="2" style="width: 25px">血糖</th>
                                        <th rowspan="2" style="width: 25px">其他</th>
                                        <th rowspan="2" style="width: 25px">体位</th>
                                        <th rowspan="2" style="width: 25px">吸痰</th>
                                        <th rowspan="2" style="width: 25px">雾化</th>
                                        <th rowspan="2" style="width: 25px">气道护理</th>
                                        <th rowspan="2">口腔护理</th>
                                        <th rowspan="2">会阴护理</th>
                                        <th rowspan="2">床上擦浴</th>
                                        <th rowspan="2">A-V护理</th>
                                        <th rowspan="2" style="width: 100px">其他</th>
                                    </tr>
                                    <tr  v-if="queryParam.hldType=='6'">
                                        <th>℃</th>
                                        <th colspan="2">次/min</th>
                                        <th colspan="2">mmHg</th>
                                        <th>mm</th>
                                        <th>ml.g</th>
                                        <th>ml</th>
                                        <th >ml</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <tr v-if="queryParam.hldType=='5' || queryParam.hldType=='1'" v-for="(item,index) in hldPrintDataList">
                                    <td style="width: 40px;">{{item.recDateStr}}</td>
                                    <td style="width: 30px">{{item.recTimeStr}}</td>
                                    <td style="width: 25px">{{item.patientState}}</td>
                                    <td style="width: 25px">{{item.temperature1Str}}</td>
                                    <td style="width: 25px">{{item.heart}}</td>
                                    <td style="width: 25px">{{item.pulse1}}</td>
                                    <td style="width: 25px">{{item.breathe1}}</td>
                                    <td style="width: 25px">{{item.pressureAmPm}}</td>
                                    <td style="width: 25px">{{item.spo2}}</td>
                                    <td style="width: 30px">{{item.mind}}</td>
                                    <td style="width: 45px" v-if="tongKongFlag && queryParam.hldType !='5'">
                                 <span v-if="item.rpupil">
                                                {{item.pupilr}} {{item.pupil}} <br/> o{{item.pupilbj}}o <br/> {{item.rpupil}} {{item.lpupil}}
                                 </span>
                                    </td>
                                    <td style="width: 25px" v-if="queryParam.hldType=='5'">{{item.outputDblood}}</td>
                                    <td style="width: 45px">{{item.col1Name}}</td>
                                    <td style="width: 25px">{{item.col1Am}}</td>
                                    <td style="width: 45px">{{item.col2Name}}</td>
                                    <td style="width: 30px">{{item.col2Am}}</td>
                                    <td  style="width: 35px">{{item.urineColor}}</td>
                                    <td  style="width: 35px">{{item.shitShape}}</td>
                                    <td style="width: 30px">{{item.skin}}</td>
                                    <td style="width: 60px">{{item.tubesName}}</td>
                                    <td style="width: 35px">{{item.tubesStatus}}</td>
                                    <td style="width: 30px" v-if="queryParam.hldType =='1'">{{item.glu}}</td>
                                    <td style="width: 240px;text-align: left">{{item.otherInfo}}</td>
                                    <td >{{item.useridName}}</td>
                                </tr>

                                <tr v-if="queryParam.hldType=='2'" v-for="(item,index) in hldPrintDataList">
                                    <td style="width: 40px">{{item.recDateStr}}</td>
                                    <td style="width: 30px">{{item.recTimeStr}}</td>
                                    <td style="width: 25px">{{item.patientState}}</td>
                                    <td style="width: 25px">{{item.boxTemp}}</td>
                                    <td style="width: 25px">{{item.boxHumi}}</td>
                                    <td style="width: 25px">{{item.temperature1Str}}</td>
                                    <td style="width: 25px">{{item.urineQuanAm}}</td>
                                    <td style="width: 25px">{{item.breathe1}}</td>
                                    <td style="width: 25px">{{item.pressureAmPm}}</td>
                                    <td style="width: 25px">{{item.spo2}}</td>
                                    <td style="width: 50px">{{item.col1Name}}</td>
                                    <td style="width: 30px">{{item.col1Am}}</td>
                                    <td style="width: 30px">{{item.col2Name}}</td>
                                    <td style="width: 30px">{{item.urineQuanAm}}</td>
                                    <td style="width: 30px">{{item.urineColor}}</td>
                                    <td style="width: 30px">{{item.shitOther}}</td>
                                    <td style="width: 30px">{{item.shitQuan}}</td>
                                    <td style="width: 30px">{{item.shitShape}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.isEyes)}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.isMouthpiece)}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.bellybuttonFlag)}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.buttocksFlag)}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.showerFlag)}}</td>
                                    <td style="width: 25px"> {{isForXuanZhong(item.spongeBathFlag)}}</td>
                                    <td style="width: 25px">{{item.decubitus}}</td>
                                    <td style="width: 25px">{{item.skin}}</td>
                                    <td style="width: 25px">{{item.infoCry}}</td>
                                    <td style="width: 25px">{{item.infoSuck}}</td>
                                    <td style="width: 25px">{{item.infoSleep}}</td>
                                    <td style="width: 35px">{{item.infoActivity}}</td>
                                    <td style="width: 25px">{{item.acraStatus}}</td>
                                    <td style="width: 230px;text-align: left">{{item.otherInfo}}</td>
                                    <td>{{item.useridName}}</td>
                                </tr>

                                <tr v-if="queryParam.hldType=='3'" v-for="(item,index) in hldPrintDataList">
                                    <td style="width: 40px">{{item.recDateStr}}</td>
                                    <td style="width: 30px">{{item.recTimeStr}}</td>
                                    <td style="width: 35px">{{item.mind}}</td>
                                    <td style="width: 30px">{{item.temperature1Str}}</td>
                                    <td style="width: 30px">{{item.pulse1}}</td>
                                    <td style="width: 25px">{{item.breathe1}}</td>
                                    <td style="width: 25px">{{item.pressureAmPm}}</td>
                                    <td style="width: 30px">{{item.spo2}}</td>
                                    <td style="width: 45px">{{item.col1Name}}</td>
                                    <td style="width: 25px">{{item.col1Am}}</td>
                                    <td style="width: 25px">{{getOutputDbloodName(item.outputDblood)}}</td>
                                    <td style="width: 30px">{{item.urineQuanAm}}</td>
                                    <td style="width: 30px">{{item.outputOther}}</td>
                                    <td style="width: 45px">{{item.tubesName}}</td>
                                    <td style="width: 35px">{{item.tubesStatus}}</td>
                                    <td style="width: 45px"> {{item.fheartSoundStr}} {{item.fheartSound}}</td>
                                    <td style="width: 25px">{{taimopofor(item.fetalBreak)}}</td>
                                    <td style="width: 35px">{{item.uterineOpen}}</td>
                                    <td style="width: 40px">{{item.uterineStatus}}</td>
                                    <td style="width: 25px">{{item.uterineHigh}}</td>
                                    <td style="width: 25px">{{item.uterineMove}}</td>
                                    <td style="width: 25px">{{item.outBlood}}</td>
                                    <td style="width: 25px">{{item.redHurt}}</td>
                                    <td style="width: 25px">{{item.anusAir}}</td>
                                    <td style="width: 40px">{{item.suckleFun}}</td>
                                    <td style="width: 230px;text-align: left">{{item.otherInfo}}</td>
                                    <td >{{item.useridName}}</td>
                                </tr>


                                <tr v-if="queryParam.hldType=='4'" v-for="(item,index) in hldPrintDataList">
                                    <td style="width: 40px">{{item.recDateStr}}</td>
                                    <td style="width: 35px">{{item.recTimeStr}}</td>
                                    <td style="width: 30px">{{item.faceColour}}</td>
                                    <td style="width: 35px">{{item.temperature1Str}}</td>
                                    <td style="width: 25px">{{item.breath}}</td>
                                    <td style="width: 25px">{{item.bodyWeight}}</td>
                                    <td style="width: 35px">{{item.skinColour}}</td>
                                    <td style="width: 40px">{{item.skinStatus}}</td>
                                    <td style="width: 35px">{{item.outBlood}}</td>
                                    <td style="width: 35px">{{item.redHurt}}</td>
                                    <td style="width: 40px">{{item.intakeBreastMilk}}</td>
                                    <td style="width: 40px">{{item.intakeMilk}}</td>
                                    <td style="width: 40px">{{item.intakeWater}}</td>
                                    <td style="width: 35px">{{item.shit}}</td>
                                    <td style="width: 35px">{{item.urineQuan}}</td>
                                    <td style="width: 35px">{{item.spo2}}</td>
                                    <td style="width: 35px">{{item.glu}}</td>
                                    <td style="text-align: left;width: 250px">{{item.otherInfo}}</td>
                                    <td >{{item.useridName}}</td>
                                </tr>


                                <tr  v-if="queryParam.hldType=='6'" v-for="(item,index) in hldPrintDataList">
                                    <td style="width: 40px">{{item.recDateStr}}</td>
                                    <td style="width: 35px">{{item.recTimeStr}}</td>
                                    <td style="width: 25px">{{item.temperature1Str}}</td>
                                    <td style="width: 25px">{{item.heart}}</td>
                                    <td style="width: 25px">{{item.breathe1}}</td>
                                    <td style="width: 25px">{{item.pressureAmPm}}</td>
                                    <td style="width: 25px">{{item.map}}</td>
                                    <td style="width: 25px">{{item.mind}}</td>
                                    <td style="width: 25px">
                                        <span v-if="item.rpupil">
                                                {{item.pupilr}} {{item.pupil}} <br/> o{{item.pupilbj}}o <br/> {{item.rpupil}} {{item.lpupil}}
                                        </span>
                                    </td>
                                    <td style="width: 45px">{{item.col1Name}}</td>
                                    <td style="width: 25px">{{item.col1Am}}</td>
                                    <td style="width: 45px">{{item.col2Name}}</td>
                                    <td style="width: 25px">{{item.col2Am}}</td>
                                    <td style="width: 25px">{{item.spo2}}</td>
                                    <td style="width: 25px">{{item.cvp}}</td>
                                    <td style="width: 20px">{{item.etcho2}}</td>
                                    <td style="width: 20px">{{item.gcs}}</td>
                                    <td style="width: 20px">{{item.rass}}</td>
                                    <td style="width: 20px">{{item.glu}}</td>
                                    <td style="width: 25px">{{item.othJc}}</td>
                                    <td style="width: 20px">{{item.position}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isSputum)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isAtomization)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isBreath)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isMouthpiece)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isHuiyin)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isBed)}}</td>
                                    <td style="width: 20px"> {{isForXuanZhong(item.isAV)}}</td>
                                    <td style="width: 232px;text-align: left"> {{item.otherInfo}}</td>
                                    <td > {{item.useridName}}</td>
                                </tr>
                                </tbody>
                                <tfoot>
                                    <td colspan="36" style="border: none;text-align: right">以上确认并签名:______________________________</td>
                                </tfoot>
                            </table>
                        </div>
                        </el-scrollbar>
                    </el-tab-pane>

                </el-tabs>

        </el-main>
        </el-container>
    </el-container>
    <el-dialog v-model="hulidanDialogFlag"  title="编辑护理记录" destroy-on-close="true"   style="width:60%;height: 95%">
        <FirstHuLiDan @refreshHuLidan="refreshHuLidan" :nursingRecordData="nursingRecordData" @closeHld="closeHld" ></FirstHuLiDan>
    </el-dialog>
</template>

<script setup name='nursingRecord'>
import PatientInfo from "@/components/medical-advice/PatientInfo.vue"
import FirstHuLiDan from "@/components/medical-advice/nursing-manage/FirstHuLiDan.vue"
import PatientBaseList from "@/components/medical-advice/PatientBaseList.vue"
import {getLodop, initLodop} from '@/utils/c-lodop'
import {onMounted,computed,ref} from "vue"
import {stringNotBlank} from "@/utils/blank-utils"
import { getFormatDatetime } from "@/utils/date"
import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
import {queryNursingRecord,queryOrderTime,queyGm,deleteYzTemperature} from "@/api/medical-advice/nursing-manage";
import {ElMessageBox,ElMessage} from "element-plus";
import router from "@/router";
import Sleep from "@/utils/sleep";
import {getNursingEditQuanXian} from "@/components/medical-advice/MedicalAdviceCommonUtil";
import store from '@/store';

const getCode =   store.state.user.info.code
const queryParam =ref({
    recDateStr:getFormatDatetime(new Date(),'YYYY-MM-DD'),
    startRecTime:'',
    endRecTime:'',
    hldType:'1',
    type:'0',
    ward:'',
    bedNo:'',
    typeFlag:'0',
})
//护理单数据
const hldDataList = ref([])
const hldPrintDataList = ref([])

const activeTableName = ref('first')

const ward = ref([
    {code:'8000002',name:'二病室'},
    {code:'8000003',name:'三病室'},
    ])
const hldTypeList = ref([
    {code:'1',name:'普通护理单'},
    {code:'2',name:'新生儿护理单'},
    {code:'3',name:'产科护理单'},
    {code:'4',name:'产科新生儿护理单'},
    {code:'5',name:'妇科护理单'},
    {code:'6',name:'重症监护护理单'},
    ])

// 基本信息
const patientInfo = ref({})
const orderTimeList = ref([])
const hldTableTitle = computed(() => {
    for (let i = 0; i < huTypeNameList.value.length; i++) {
        if(queryParam.value.hldType==(i+1)+''){
             return  '长沙泰和医院' +huTypeNameList.value[i]
        }
    }
    return ''
})
const huTypeNameList = ref([
    '护理记录',
    '新生儿患者护理记录',
    '产科护理记录',
    '产科(新生儿)护理记录',
    '妇科护理记录',
    '重症患者监护记录'
])

const columnShowFlag = ref({
    urineColor:false ,
    shitShape:false
})

const titleNameTiShiList =ref([
    '注意:体温单位为℃,脉搏单位为"次/min",血压单位为"mmHg",Sp02单位为"%",体重单位为"kg",呼吸单位为"次/min",血糖单位"mmol/l"',
    '注意:箱温、体温单位为"℃,心率、呼吸单位为"次/min",血压单位为"mmHg",湿度、血氧饱和和单位为"%"',
    '注意:体温单位为℃,脉搏单位为"次/min",血压单位为"mmHg"，Sp02单位为"%",体重单位为"kg"',
    '注意:体温单位为℃,脉搏单位为"次/min",血压单位为"mmHg"，Sp02单位为"%",体重单位为"kg",呼吸单位为"次/min"',
    '注意:体温单位为℃,脉搏单位为"次/min",血压单位为"mmHg"，Sp02单位为"%",体重单位为"kg",呼吸单位为"次/min",血糖单位"mmol/l",CV单位为"cmH2O",ETCO2单位"mmHg",GCS为Glasgow昏迷评分,单位为"分",RASS为镇静评分,单位为"分"'
]);

const titleNameTiShi = ref('注意:体温单位为℃,脉搏单位为"次/min",血压单位为"mmHg",Sp02单位为"%",体重单位为"kg",呼吸单位为"次/min",血糖单位"mmol/l"')

const selectOneData = ref({})

//编辑
const dbClick = (row)=>{
    if(getCode !=row.userid && !getNursingEditQuanXian()){
        return ElMessage.error('非本人或护士长不得修改此条护理记录')
    }
    nursingRecordData.value=row
    nursingRecordData.value['hldType']=queryParam.value.hldType
    hulidanDialogFlag.value =true
}

const nursingRecordData=ref({})

//选中一条
const selectOne =(row)=>{
    selectOneData.value = row
}

//删除
const delInfo = ()=>{
    if(!selectOneData.value.detailNo){
       return ElMessage.error('请选择一条数据')
    }
    ElMessageBox.confirm('请确认是否删除', {
        cancelButtonText: '取消',
        confirmButtonText: '确定',
    })
        .then(() => {
            deleteYzTemperature(selectOneData.value).then((res) => {
                queryInfo()
            })
        })
        .catch(() => {
        })
}


//病案首页
const bingAnShouYe=() =>{
   console.log('patientInfo.value',patientInfo.value)
    router.push({
        name: 'fillCaseFrontSheet',
        query: {
            patNo: patientInfo.value.inpatientNo,
            deptCode: patientInfo.value.smallDept,
        }
    })
}


const hulidanDialogFlag=ref(false)
//刷新护理单关闭窗口
const refreshHuLidan =async ()=>{
     queryInfo()
    hulidanDialogFlag.value = false
}

const closeHld =()=>{
    hulidanDialogFlag.value = false
}

const titleColspan =ref(36)

//选择护理类型改变列
const selectHlType = (val) =>{
    if(val==='1' || val==='6'){
        titleNameTiShi.value = titleNameTiShiList.value[0]
    }else if(val==='2'){
        // titleColspan.value =33
        titleNameTiShi.value = titleNameTiShiList.value[1]
    }else if(val==='3' || val==='4'){
        // if(val==='3'){
        //     titleColspan.value =27
        // }else {
        //     titleColspan.value =19
        // }

        titleNameTiShi.value = titleNameTiShiList.value[2]
    }else if(val==='5'){
        titleNameTiShi.value = titleNameTiShiList.value[3]
    }else if(val==='6'){
        // titleColspan.value =30
        titleNameTiShi.value = titleNameTiShiList.value[4]
    }
}

const getOutputDbloodName = (val) =>{
    switch (val) {
        case 0:
            return '无'
        default:
            return val
    }
}


const tongKongFlag = ref(false)

const selectTongKong = (val) =>{
    if(val==='0'){
        tongKongFlag.value = false
    }else {
        tongKongFlag.value = true
    }
}

const  cxtjFlag = ref(false)
const selectCxtj = (val) =>{
    console.log(typeof val)
    if(val === '0'){
        cxtjFlag.value = false
    }else {
        cxtjFlag.value =true
    }

}

const companyFunc = (val, company) => {
    if (stringNotBlank(val)) {
        return val + company
    } else {
        return ''
    }
}

const isForXuanZhong = (val) => {
    if (stringNotBlank(val) && (val == '1' || val==1)) {
        return "√"
    }
    else  {
        return ''
    }
}

const taimopofor = (val) => {
    if (stringNotBlank(val) && val == '1') {
        return "已"
    } else if (stringNotBlank(val) && val == '0') {
        return "未"
    }
    else {
        return ''
    }
}



//新增
const addHlInfo = () =>{
    if(patientInfo.value.inpatientNo){
            nursingRecordData.value={}
            nursingRecordData.value['inpatientNo']=patientInfo.value.inpatientNo
            nursingRecordData.value['admissTimes']=patientInfo.value.admissTimes
            nursingRecordData.value['ward']=patientInfo.value.admissWard
            nursingRecordData.value['hldType']=queryParam.value.hldType
            hulidanDialogFlag.value =true
          console.log('nursingRecordData.value',nursingRecordData.value)
    }else {
        return ElMessage.error('请选择一个病人')
    }


}




const yzPrintCss=`
#pageTable tr td, #pageTable tr th {
    border: 1px solid black;
    text-align: center;
    font-size: 12px;
    padding: 0 0;

}
#pageTable tr td{
 height: 27px;
}

#pageTable {
    border-collapse: collapse;
}
.nav{
    margin: 0 auto;
    width: 100%;
}
ul{
    list-style: none;
    width: 100%;
}
.nav li{
    float: left;
    margin-left: 15px;

}

h1{
font-size:32px ;
}

`

const selectPatientInfo=(val)=>{
    patientInfo.value =  val.patientInfo
    queryInfo()
}

const queryInfo=()=>{
    if(patientInfo.value.inpatientNo){

        queryNursingRecord({
            inpatientNo:patientInfo.value.inpatientNo,
            admissTimes:patientInfo.value.admissTimes,
            typeFlag:queryParam.value.typeFlag,
            recDateStr:queryParam.value.recDateStr,
            startRecTime:getFormatDatetime(queryParam.value.startRecTime,'YYYY-MM-DD HH:mm:ss'),
            endRecTime:getFormatDatetime(queryParam.value.endRecTime,'YYYY-MM-DD HH:mm:ss')
        }).then((res) =>{
            hldDataList.value = res
        })
        queryNursingRecord({
            inpatientNo:patientInfo.value.inpatientNo,
            admissTimes:patientInfo.value.admissTimes,
            printFlag:true,
            typeFlag:queryParam.value.typeFlag,
            recDateStr:queryParam.value.recDateStr,
            startRecTime:getFormatDatetime(queryParam.value.startRecTime,'YYYY-MM-DD HH:mm:ss'),
            endRecTime:getFormatDatetime(queryParam.value.endRecTime,'YYYY-MM-DD HH:mm:ss')
        }).then((res) =>{
            hldPrintDataList.value = res
        })

    }else {
        return ElMessage.error('请选择一个病人')
    }


}



onMounted(() => {
    initLodop()

    getAllWards().then((res) =>{
        ward.value = res
    })

})
const daYingClick = () => {
    let LODOP = getLodop()
    LODOP.PRINT_INIT('pagedetail')
    LODOP.SET_PRINT_PAGESIZE(2, '0', '0', 'A4')
    LODOP.SET_PRINT_MODE('RESELECT_PRINTER', true)
    LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width')
    LODOP.ADD_PRINT_TABLE('2mm', '2mm', '290mm', '180mm', '<style>' + yzPrintCss + '</style>' + '<body>' + document.getElementById('cqYz').innerHTML + '</body>')
    LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1)
    LODOP.SET_PRINT_STYLE('ItemType', 3)
    LODOP.ADD_PRINT_TEXT('205mm', '137mm', '20mm', '7mm', '第#页/共&页')
    LODOP.PREVIEW() // 关闭
}


</script>

<style scoped>
.nav{
    margin: 0 auto;
    width: 100%;
}
ul{
    list-style: none;
    width: 100%;
}
.nav li{
    float: left;
    margin-left: 15px;

}
#cqYz {
    width: 1110px;
    padding: 0 0px;
}

#pageTable tr td, #pageTable tr th {
    border: 1px solid black;
    text-align: center;
    font-size: 12px;
}
#pageTable {
    border-collapse: collapse;
}


#pageTable tr  td {
    height: 27px;
}










</style>
