<template>
    <el-container>
        <el-header>
            <el-row>
                    <span style="margin-top: 5px" >本机默认体温类型</span>
                    <el-select style="width: 80px" v-model="temperatureType" clearable placeholder="请选择">
                        <el-option value="x" label="x"></el-option>
                        <el-option value="●" label="●"></el-option>
                        <el-option value="o" label="o"></el-option>
                    </el-select>
                    <el-button size="small" type="success" @click="saveType">保存设置</el-button>
                    <el-button  size="small" type="success" @click="saveHuLiDan">保存</el-button>
                    <el-button  size="small" type="success" @click="closeHld">取消</el-button>
                    <el-button  size="small" type="success" @click="queryDianZiBinLi">电子病历</el-button>
            </el-row>
        </el-header>
        <el-main>
            <el-tabs
                    v-model="activeName"
                    type="card"
                    class="demo-tabs"
                    @tab-click="handleClick"
            >
                <el-tab-pane label="护理记录" name="first">
                    <div v-if="props.nursingRecordData.hldType =='1' || props.nursingRecordData.hldType =='5'">
                        <el-row>
                            <el-col>
                                日期
                                <el-date-picker
                                    v-model="formData.toStringRecDate"
                                    type="date"
                                    size="small"
                                    :clearable="clearable"
                                    format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px"
                                ></el-date-picker>
                                时段
                                <el-time-picker v-model="formData.recTime" style="width: 100px">
                                </el-time-picker>
                                病情
                                <el-select v-model="formData.patientState" clearable placeholder="请选择">
                                    <el-option value="" label=""></el-option>
                                    <el-option value="危" label="危"></el-option>
                                    <el-option value="重" label="重"></el-option>
                                </el-select>
                                呼吸<el-input v-model="formData.breathe1" clearable style="width: 90px"></el-input>次
                                <el-button size="small" type="success" @click="saveHuLiDan(1)">保存继续</el-button>
                                <el-button size="small" icon="Search" type="success" @click="queryScd">获取三测单信息</el-button>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col>
                                体温<el-input v-model="formData.temperature1" clearable style="width: 80px"></el-input>
                                <el-select v-model="formData.temperature1Type" clearable placeholder="请选择" style="width: 80px">
                                <el-option value="x" label="x"></el-option>
                                <el-option value="●" label="●"></el-option>
                                <el-option value="o" label="o"></el-option>
                                </el-select>
                                心率<el-input v-model="formData.heart" clearable style="width: 80px"/>
                                脉搏<el-input v-model="formData.pulse1" clearable style="width: 80px"/>
                                血压<el-input v-model="formData.pressure1Am" clearable style="width: 80px"/>
                                /<el-input v-model="formData.pressure1Pm" clearable style="width: 80px"/>
                                SpO2<el-input v-model="formData.spo2" clearable style="width: 80px"/>
                            </el-col>
                        </el-row>
                        <el-row v-if="props.nursingRecordData.hldType =='1'">
                            <el-col>
                                意识<el-select v-model="formData.mind" style="width: 90px" clearable placeholder="请选择">
                                <el-option value="清醒" label="清醒"></el-option>
                                <el-option value="嗜睡" label="嗜睡"></el-option>
                                <el-option value="昏睡" label="昏睡"></el-option>
                                <el-option value="浅昏迷" label="浅昏迷"></el-option>
                                <el-option value="深昏迷" label="深昏迷"></el-option>
                                <el-option value="镇静状态" label="镇静状态"></el-option>
                                </el-select>
                                右瞳孔<el-input v-model="formData.rpupil" clearable style="width: 90px"/>
                                <el-select v-model="formData.pupilbj" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value=">" label=">"></el-option>
                                    <el-option value="<" label="<"></el-option>
                                    <el-option value="=" label="="></el-option>
                                </el-select>
                                左瞳孔<el-input v-model="formData.lpupil" clearable style="width: 90px"/>
                                对光反射(左)
                                <el-select v-model="formData.pupil" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value="+" label=">"></el-option>
                                    <el-option value="-" label="<"></el-option>
                                    <el-option value="±" label="="></el-option>
                                    <el-option value="+-" label="="></el-option>
                                </el-select>
                                对光反射(右)
                                <el-select v-model="formData.pupilr" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value="+" label=">"></el-option>
                                    <el-option value="-" label="<"></el-option>
                                    <el-option value="±" label="="></el-option>
                                    <el-option value="+-" label="="></el-option>
                                </el-select>
                                血糖<el-input v-model="formData.glu" clearable style="width: 90px"/>
                            </el-col>
                        </el-row>
                        <el-row v-if="props.nursingRecordData.hldType =='5'">
                            <el-col>
                                神志<el-select v-model="formData.mind" style="width: 90px" clearable placeholder="请选择">
                                <el-option value="清醒" label="清醒"></el-option>
                                <el-option value="嗜睡" label="嗜睡"></el-option>
                                <el-option value="模糊" label="模糊"></el-option>
                                <el-option value="昏睡" label="昏睡"></el-option>
                                <el-option value="浅昏迷" label="浅昏迷"></el-option>
                                <el-option value="深昏迷" label="深昏迷"></el-option>
                                <el-option value="镇静" label="镇静"></el-option>
                            </el-select>
                                阴道流血
                                <el-input v-model="formData.outputDblood" clearable style="width: 90px"/>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">入量</div>
                        <el-row>
                           <el-col>
                               项目
                               <el-select v-model="formData.col1Name" clearable placeholder="请选择">
                                   <el-option value="饮水" label="饮水"/>
                                   <el-option value="进食" label="进食"/>
                                   <el-option value="输液" label="输液"/>
                                   <el-option value="24小时总结" label="24小时总结"/>
                                   <el-option value="日间小结" label="日间小结"/>
                                   <el-option value="本班小结" label="本班小结"/>
                                   <el-option value="不足24小时出入量" label="不足24小时出入量"/>
                                   <el-option value="余量" label="余量"/>
                               </el-select>
                               量<el-input v-model="formData.col1Am" clearable style="width: 90px"/>
                               <el-checkbox v-model="checkboxData.inZongJie24">24小时总结</el-checkbox>
                               <el-button size="small"  @click="inputOutSum(1)">入量求和</el-button>
                           </el-col>
                        </el-row>
                        <div class="row-title-sty">出量</div>
                        <el-row :gutter="5">
                            <el-col>
                                项目
                                <el-select v-model="formData.col2Name" clearable placeholder="请选择">
                                    <el-option value="大便" label="大便"/>
                                    <el-option value="小便" label="小便"/>
                                    <el-option value="呕吐物" label="呕吐物"/>
                                    <el-option value="引流物" label="引流物"/>
                                    <el-option value="24小时总结" label="24小时总结"/>
                                    <el-option value="本班小结" label="本班小结"/>
                                    <el-option value="日间小结" label="日间小结"/>
                                    <el-option value="不足24小时出入量" label="不足24小时出入量"/>
                                </el-select>
                                量<el-input v-model="formData.col2Am" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.outZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(2)">出量求和</el-button>
                            </el-col>
                        </el-row>
                        <el-row :gutter="5">
                            <el-col>
                                大便单位
                                <el-input v-model="formData.shitUnit" clearable style="width: 90px"/>
                                颜色
                                <el-select v-model="formData.urineColor" clearable placeholder="请选择">
                                    <el-option value="清亮" label="清亮"/>
                                    <el-option value="淡黄" label="淡黄"/>
                                    <el-option value="黄色" label="黄色"/>
                                    <el-option value="黑色" label="黑色"/>
                                </el-select>
                                性状
                                <el-select v-model="formData.shitShape" clearable placeholder="请选择">
                                    <el-option value="黄糊" label="黄糊"/>
                                    <el-option value="黄稀" label="黄稀"/>
                                    <el-option value="黄软" label="黄软"/>
                                    <el-option value="水状" label="水状"/>
                                    <el-option value="便血" label="便血"/>
                                </el-select>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">其他</div>
                        <el-row :gutter="5">
                            <el-col>
                                皮肤
                                <el-select v-model="formData.skin" clearable placeholder="请选择">
                                    <el-option value="" label=""/>
                                    <el-option value="完好" label="完好"/>
                                    <el-option value="破损" label="破损"/>
                                    <el-option value="压疮" label="压疮"/>
                                    <el-option value="水肿" label="水肿"/>
                                    <el-option value="出血点" label="出血点"/>
                                </el-select>
                                管道
                                <el-select v-model="formData.tubesName" clearable placeholder="请选择">
                                    <el-option value="氧管" label="氧管"/>
                                    <el-option value="胃管" label="胃管"/>
                                    <el-option value="引流管" label="引流管"/>
                                    <el-option value="导尿管" label="导尿管"/>
                                    <el-option value="静脉置管" label="静脉置管"/>
                                </el-select>
                                管道情况
                                <el-select v-model="formData.tubesStatus" clearable placeholder="请选择">
                                    <el-option value="+" label="+"/>
                                    <el-option value="-" label="-"/>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>

                    <div v-if="props.nursingRecordData.hldType =='2'">
                        <el-row>
                            <el-col>
                                日期
                                <el-date-picker
                                        v-model="formData.toStringRecDate"
                                        type="date"
                                        size="small"
                                        :clearable="clearable"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px"
                                ></el-date-picker>
                                时段
                                <el-time-picker v-model="formData.recTime" style="width: 100px">
                                </el-time-picker>
                                箱(温度)
                                <el-input v-model="formData.boxTemp" clearable style="width: 80px"></el-input>℃
                                箱(湿度)<el-input v-model="formData.boxHumi" clearable style="width: 90px"></el-input>
                                <el-button size="small" type="success" @click="saveType">保存继续</el-button>
                                <el-button size="small" icon="Search" type="success" @click="saveType">获取三测单信息</el-button>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col>
                                体温<el-input v-model="formData.temperature1" clearable style="width: 80px"></el-input>
                                <el-select v-model="formData.temperature1Type" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="x" label="x"></el-option>
                                    <el-option value="●" label="●"></el-option>
                                    <el-option value="o" label="o"></el-option>
                                </el-select>
                                心率<el-input v-model="formData.heart" clearable style="width: 80px"/>
                                呼吸<el-input v-model="formData.breathe1" clearable style="width: 80px"/>
                                血压<el-input v-model="formData.pressure1Am" clearable style="width: 80px"/>
                                /<el-input v-model="formData.pressure1Pm" clearable style="width: 80px"/>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col>
                            SpO2<el-input v-model="formData.spo2" clearable style="width: 80px"/>
                            病情
                            <el-select v-model="formData.patientState" clearable placeholder="请选择" style="width: 80px">
                                <el-option value="" label=""></el-option>
                                <el-option value="危" label="危"></el-option>
                                <el-option value="重" label="重"></el-option>
                            </el-select>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">入量</div>
                        <el-row>
                            <el-col>
                                项目
                                <el-select v-model="formData.col1Name" clearable placeholder="请选择" style="width: 110px">
                                    <el-option value="配方奶" label="饮水"/>
                                    <el-option value="早产儿奶" label="进食"/>
                                    <el-option value="腹泻奶" label="本班小结"/>
                                    <el-option value="24小时总结" label="24小时总结"/>
                                    <el-option value="日间小结" label="日间小结"/>
                                </el-select>
                                量<el-input v-model="formData.col1Am" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.inZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(1)">入量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">出量</div>
                        <el-row :gutter="5">
                            <el-col>
                                项目
                                <el-select v-model="formData.col2Name" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="小便" label="小便"/>
                                </el-select>
                                量<el-input v-model="formData.urineQuanAm" clearable style="width: 90px"/>
                                色
                                <el-select v-model="formData.urineColor" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="清亮" label="清亮"/>
                                    <el-option value="淡黄" label="淡黄"/>
                                </el-select>
                            </el-col>
                        </el-row>
                        <el-row :gutter="5">
                            <el-col>
                                项目
                                <el-select v-model="formData.shitOther" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="大便" label="大便"/>
                                </el-select>
                                次<el-input v-model="formData.shitQuan" clearable style="width: 90px"/>
                                性状
                                <el-select v-model="formData.shitShape" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="黄糊" label="黄糊"/>
                                    <el-option value="黄稀" label="黄稀"/>
                                    <el-option value="黄软" label="黄软"/>
                                    <el-option value="水状" label="水状"/>
                                    <el-option value="便血" label="便血"/>
                                    <el-option value="墨绿" label="墨绿"/>
                                </el-select>
                                <el-checkbox v-model="checkboxData.outZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(2)">出量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">护理</div>
                        <el-row :gutter="5">
                            <el-col>
                                体位
                                <el-select v-model="formData.decubitus" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="" label=""/>
                                    <el-option value="左" label="完好"/>
                                    <el-option value="右" label="破损"/>
                                    <el-option value="俯" label="压疮"/>
                                    <el-option value="仰" label="水肿"/>
                                </el-select>
                                <el-checkbox v-model="checkboxData.isMouthpiece">口护</el-checkbox>
                                <el-checkbox v-model="checkboxData.isEyes">眼护</el-checkbox>
                                <el-checkbox v-model="checkboxData.bellybuttonFlag">脐护</el-checkbox>
                                <el-checkbox v-model="checkboxData.buttocksFlag">臀护</el-checkbox>
                                <el-checkbox v-model="checkboxData.showerFlag">沐浴</el-checkbox>
                                <el-checkbox v-model="checkboxData.spongeBathFlag">擦澡</el-checkbox>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">病情观察</div>
                        <el-row>
                            <el-col>
                                皮肤
                                <el-select v-model="formData.skin" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="红润" label="完好"/>
                                    <el-option value="黄染" label="破损"/>
                                    <el-option value="稍黄" label="压疮"/>
                                    <el-option value="苍白" label="水肿"/>
                                </el-select>
                                哭声
                                <el-select v-model="formData.infoCry" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="大" label="有力"/>
                                    <el-option value="小" label="差"/>
                                    <el-option value="无" label="差"/>
                                </el-select>
                                吸吮
                                <el-select v-model="formData.infoSuck" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="有力" label="有力"/>
                                    <el-option value="差" label="差"/>
                                </el-select>
                                睡眠
                                <el-select v-model="formData.infoSleep" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="好" label="好"/>
                                    <el-option value="差" label="差"/>
                                    <el-option value="昏迷" label="昏迷"/>
                                </el-select>
                                自主活动
                                <el-select v-model="formData.infoActivity" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="有" label="有"/>
                                    <el-option value="无" label="无"/>
                                </el-select>
                                肢端情况
                                <el-select v-model="formData.acraStatus" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="温" label="温"/>
                                    <el-option value="凉" label="凉"/>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>

                    <div v-if="props.nursingRecordData.hldType =='3'">
                        <el-row>
                            <el-col>
                                日期
                                <el-date-picker
                                        v-model="formData.toStringRecDate"
                                        type="date"
                                        size="small"
                                        :clearable="clearable"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px"
                                ></el-date-picker>
                                时段
                                <el-time-picker v-model="formData.recTime" style="width: 100px">
                                </el-time-picker>
                                呼吸<el-input v-model="formData.breathe1" clearable style="width: 90px"></el-input>次
                                <el-button size="small" type="success" @click="saveType">保存继续</el-button>
                                <el-button size="small" icon="Search" type="success" @click="saveType">获取三测单信息</el-button>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col>
                                体温<el-input v-model="formData.temperature1" clearable style="width: 80px"></el-input>
                                <el-select v-model="formData.temperature1Type" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="x" label="x"></el-option>
                                    <el-option value="●" label="●"></el-option>
                                    <el-option value="o" label="o"></el-option>
                                </el-select>
                                脉搏<el-input v-model="formData.pulse1" clearable style="width: 80px"/>
                                血压<el-input v-model="formData.pressure1Am" clearable style="width: 80px"/>
                                /<el-input v-model="formData.pressure1Pm" clearable style="width: 80px"/>
                                SpO2<el-input v-model="formData.spo2" clearable style="width: 80px"/>
                                意识<el-select v-model="formData.mind" style="width: 90px" clearable placeholder="请选择">
                                <el-option value="清醒" label="清醒"></el-option>
                                <el-option value="嗜睡" label="嗜睡"></el-option>
                                <el-option value="模糊" label="模糊"></el-option>
                                <el-option value="昏睡" label="昏睡"></el-option>
                                <el-option value="浅昏迷" label="浅昏迷"></el-option>
                                <el-option value="深昏迷" label="深昏迷"></el-option>
                            </el-select>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">入量</div>
                        <el-row>
                            <el-col>
                                项目 <el-input v-model="formData.col1Name" clearable style="width: 80px"/>
                                量<el-input v-model="formData.col1Am" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.inZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(1)">入量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">出量</div>
                        <el-row :gutter="5">
                            <el-col>
                                尿液<el-input v-model="formData.urineQuanAm" clearable style="width: 90px"/>
                                阴道流血<el-input v-model="formData.outputDblood" clearable style="width: 90px"/>
                                其他<el-input v-model="formData.outputOther" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.outZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(2)">出量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">护理</div>
                        <el-row :gutter="5">
                            <el-col>
                                胎心音
                                <el-select v-model="formData.fheartSoundStr" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="ox" label="ox"/>
                                    <el-option value="xo" label="xo"/>
                                </el-select>
                                /<el-input v-model="formData.fheartSound" clearable style="width: 90px"/>
                                胎膜破否
                                <el-select v-model="formData.fetalBreak" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="1" label="已"/>
                                    <el-option value="0" label="未"/>
                                </el-select>
                                宫口开大<el-input v-model="formData.uterineOpen"  clearable style="width: 90px"/>cm
                                宫缩状况(秒/分)<el-select v-model="formData.uterineStatus" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="“/ ‘" label="“/ ‘"/>
                                    <el-option value="无" label="无"/>
                                    <el-option value="不规则" label="不规则"/>
                                </el-select>
                                渗血<el-select v-model="formData.outBlood" style="width: 90px" clearable placeholder="请选择">
                                <el-option value="无" label="无"/>
                                <el-option value="有" label="有"/>
                            </el-select>
                                红肿<el-select v-model="formData.redHurt" style="width: 90px" clearable placeholder="请选择">
                                <el-option value="无" label="无"/>
                                <el-option value="有" label="有"/>
                                <el-option value="" label=""/>
                            </el-select>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col>
                                管道
                                <el-select v-model="formData.tubesName" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="导尿管" label="导尿管"/>
                                    <el-option value="氧管" label="氧管"/>
                                    <el-option value="胃管" label="胃管"/>
                                    <el-option value="引流管" label="引流管"/>
                                    <el-option value="静脉置管" label="静脉置管"/>
                                    <el-option value="PICC置管" label="PICC置管"/>
                                    <el-option value="PCA" label="PCA"/>
                                    <el-option value="输液管" label="输液管"/>
                                </el-select>
                                管道情况
                                <el-select v-model="formData.tubesStatus" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="+" label="+"/>
                                    <el-option value="-" label="-"/>
                                </el-select>
                                肛门排气
                                <el-select v-model="formData.anusAir" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="已" label="已"/>
                                    <el-option value="未" label="未"/>
                                </el-select>
                                喂哺技巧指导
                                <el-select v-model="formData.suckleFun" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="手法挤奶" label="手法挤奶"/>
                                    <el-option value="侧卧位" label="侧卧位"/>
                                    <el-option value="环抱式" label="环抱式"/>
                                    <el-option value="坐位" label="坐位"/>
                                    <el-option value="再评估" label="再评估"/>
                                </el-select>
                                宫底高度(脐下指)<el-input v-model="formData.uterineHigh" clearable style="width: 90px"/>
                                子宫收缩状态
                                <el-select v-model="formData.uterineMove" style="width: 90px" clearable placeholder="请选择">
                                    <el-option value="佳" label="佳"/>
                                    <el-option value="良" label="良"/>
                                    <el-option value="乏力" label="乏力"/>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>



                    <div v-if="props.nursingRecordData.hldType =='4'">
                        <el-row>
                            <el-col>
                                日期
                                <el-date-picker
                                        v-model="formData.toStringRecDate"
                                        type="date"
                                        size="small"
                                        :clearable="clearable"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px"
                                ></el-date-picker>
                                时段
                                <el-time-picker v-model="formData.recTime" style="width: 100px">
                                </el-time-picker>
                                面色
                                <el-select v-model="formData.faceColour" clearable placeholder="请选择">
                                    <el-option value="红润" label="红润"/>
                                    <el-option value="黄染" label="黄染"/>
                                    <el-option value="苍白" label="苍白"/>
                                    <el-option value="稍黄" label="稍黄"/>
                                </el-select>
                                <el-button size="small" type="success" @click="saveType">保存继续</el-button>
                                <el-button size="small" icon="Search" type="success" @click="saveType">获取三测单信息</el-button>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col>
                                体温<el-input v-model="formData.temperature1" clearable style="width: 80px"></el-input>
                                <el-select v-model="formData.temperature1Type" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="x" label="x"></el-option>
                                    <el-option value="●" label="●"></el-option>
                                    <el-option value="o" label="o"></el-option>
                                </el-select>
                                呼吸状况
                                <el-select v-model="formData.breath" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="平稳" label="平稳"></el-option>
                                    <el-option value="急促" label="急促"></el-option>
                                </el-select>
                                体重<el-input v-model="formData.bodyWeight" clearable style="width: 80px"/>kg
                                血糖<el-input v-model="formData.glu" clearable style="width: 80px"/>
                                SpO2<el-input v-model="formData.spo2" clearable style="width: 80px"/>
                                皮肤颜色
                                <el-select v-model="formData.skinColour" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="红润" label="红润"></el-option>
                                    <el-option value="黄染" label="黄染"></el-option>
                                    <el-option value="苍白" label="苍白"></el-option>
                                </el-select>
                                皮肤状况
                                <el-select v-model="formData.skinStatus" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="完好" label="完好"></el-option>
                                    <el-option value="破损" label="破损"></el-option>
                                    <el-option value="水肿" label="水肿"></el-option>
                                    <el-option value="压疮" label="压疮"></el-option>
                                    <el-option value="出血点" label="出血点"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>

                        <div class="row-title-sty">入量</div>
                        <el-row>
                            <el-col>
                                母乳<el-input v-model="formData.intakeBreastMilk" clearable style="width: 80px"/>
                                糖水<el-input v-model="formData.intakeWater" clearable style="width: 80px"/>
                                配方奶<el-input v-model="formData.intakeMilk" clearable style="width: 80px"/>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">出量</div>
                        <el-row :gutter="5">
                            <el-col>
                                小便次数<el-input v-model="formData.urineQuan" clearable style="width: 90px"/>
                                大便次数<el-input v-model="formData.shit" clearable style="width: 90px"/>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">护理</div>
                        <el-row :gutter="5">
                            <el-col>
                                脐部情况: 渗血
                                <el-select v-model="formData.outBlood" clearable placeholder="请选择">
                                    <el-option value="无" label="无"/>
                                    <el-option value="有" label="有"/>
                                    <el-option value="" label=""/>
                                </el-select>
                                红肿
                                <el-select v-model="formData.redHurt" clearable placeholder="请选择">
                                    <el-option value="无" label="无"/>
                                    <el-option value="有" label="有"/>
                                    <el-option value="" label=""/>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>
                    <div v-if="props.nursingRecordData.hldType =='6'">
                        <el-row>
                            <el-col>
                                日期
                                <el-date-picker
                                        v-model="formData.toStringRecDate"
                                        type="date"
                                        size="small"
                                        :clearable="clearable"
                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 120px"
                                ></el-date-picker>
                                时段
                                <el-time-picker v-model="formData.recTime" style="width: 100px">
                                </el-time-picker>
                                血压<el-input v-model="formData.pressure1Am" clearable style="width: 80px"/>
                                /<el-input v-model="formData.pressure1Pm" clearable style="width: 80px"/>
                                MAP<el-input v-model="formData.map" clearable style="width: 80px"/>
                                <el-button size="small" type="success" @click="saveType">保存继续</el-button>
                                <el-button size="small" icon="Search" type="success" @click="saveType">获取三测单信息</el-button>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col>
                                体温<el-input v-model="formData.temperature1" clearable style="width: 80px"></el-input>
                                <el-select v-model="formData.temperature1Type" clearable placeholder="请选择" style="width: 80px">
                                    <el-option value="x" label="x"></el-option>
                                    <el-option value="●" label="●"></el-option>
                                    <el-option value="o" label="o"></el-option>
                                </el-select>
                                心率<el-input v-model="formData.heart" clearable style="width: 80px"/>
                                呼吸<el-input v-model="formData.breathe1" clearable style="width: 90px"></el-input>
                                神志<el-select v-model="formData.mind" style="width: 80px" clearable placeholder="请选择">
                                    <el-option value="清醒" label="清醒"/>
                                    <el-option value="嗜睡" label="嗜睡"/>
                                    <el-option value="昏睡" label="昏睡"/>
                                    <el-option value="麻醉未醒" label="浅昏迷"/>
                                    <el-option value="镇静" label="镇静状态"/>
                                    <el-option value="昏迷" label="深昏迷"/>
                                </el-select>
                            </el-col>
                        </el-row>

                        <el-row >
                            <el-col>
                                左瞳孔<el-input v-model="formData.lpupil" clearable style="width: 90px"/>
                                <el-select v-model="formData.pupilbj" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value=">" label=">"></el-option>
                                    <el-option value="<" label="<"></el-option>
                                    <el-option value="=" label="="></el-option>
                                </el-select>
                                右瞳孔<el-input v-model="formData.rpupil" clearable style="width: 90px"/>
                                对光反射(左)
                                <el-select v-model="formData.pupil" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value="+" label=">"></el-option>
                                    <el-option value="-" label="<"></el-option>
                                    <el-option value="±" label="="></el-option>
                                    <el-option value="+-" label="="></el-option>
                                </el-select>
                                对光反射(右)
                                <el-select v-model="formData.pupilr" clearable placeholder="请选择" style="width: 60px">
                                    <el-option value="+" label=">"></el-option>
                                    <el-option value="-" label="<"></el-option>
                                    <el-option value="±" label="="></el-option>
                                    <el-option value="+-" label="="></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">入量</div>
                        <el-row>
                            <el-col>
                                项目
                                <el-select v-model="formData.col1Name" clearable placeholder="请选择">
                                    <el-option value="饮水" label="饮水"/>
                                    <el-option value="进食" label="进食"/>
                                    <el-option value="输液" label="输液"/>
                                    <el-option value="24小时总结" label="24小时总结"/>
                                    <el-option value="日间小结" label="日间小结"/>
                                    <el-option value="本班小结" label="本班小结"/>
                                    <el-option value="不足24小时出入量" label="不足24小时出入量"/>
                                    <el-option value="余量" label="余量"/>
                                </el-select>
                                量<el-input v-model="formData.col1Am" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.inZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(1)">入量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">出量</div>
                        <el-row :gutter="5">
                            <el-col>
                                项目
                                <el-select v-model="formData.col2Name" clearable placeholder="请选择">
                                    <el-option value="大便" label="大便"/>
                                    <el-option value="小便" label="小便"/>
                                    <el-option value="呕吐物" label="呕吐物"/>
                                    <el-option value="引流物" label="引流物"/>
                                    <el-option value="24小时总结" label="24小时总结"/>
                                    <el-option value="本班小结" label="本班小结"/>
                                    <el-option value="日间小结" label="日间小结"/>
                                    <el-option value="不足24小时出入量" label="不足24小时出入量"/>
                                </el-select>
                                量<el-input v-model="formData.col2Am" clearable style="width: 90px"/>
                                <el-checkbox v-model="checkboxData.outZongJie24">24小时总结</el-checkbox>
                                <el-button size="small"  @click="inputOutSum(2)">出量求和</el-button>
                            </el-col>
                        </el-row>
                        <div class="row-title-sty">检测项目</div>
                        <el-row :gutter="5">
                            <el-col>
                                SpO2<el-input v-model="formData.spo2" clearable style="width: 80px"/>
                                GVP<el-input v-model="formData.cvp" clearable style="width: 80px"/>
                                ETCO2<el-input v-model="formData.etcho2" clearable style="width: 80px"/>
                                GCS<el-input v-model="formData.gcs" clearable style="width: 80px"/>
                                RASS<el-input v-model="formData.rass" clearable style="width: 80px"/>
                                血糖<el-input v-model="formData.glu" clearable style="width: 80px"/>
                                其他<el-input v-model="formData.othJc" clearable style="width: 80px"/>
                            </el-col>
                        </el-row>
                    </div>


                    <div class="row-title-sty">病情观察、护理措施及效果</div>
                         <el-row v-if="props.nursingRecordData.hldType =='6'">
                             <el-col>
                                 体位<el-input v-model="formData.position" clearable style="width: 80px"/>
                                 <el-checkbox v-model="checkboxData.isSputum">吸痰</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isAtomization">雾化</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isBreath">气道护理</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isMouthpiece">口腔护理</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isHuiyin">会阴护理</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isBed">床上擦浴</el-checkbox>
                                 <el-checkbox v-model="checkboxData.isAV">A-V护理</el-checkbox>
                             </el-col>
                         </el-row>
                        <div style="width: 100%;text-align: right">
                            <el-button size="small"  @click="saveOtherInfoModel">存模板</el-button>
                            <el-button size="small"  @click="openOtherInfoModel">取模板</el-button>
                        </div>
                    <el-row>
                        <el-input :rows="4" style="width: 98%" type="textarea"
                                  v-model="formData.otherInfo"/>
                    </el-row>

                    <el-row>
                        <div style="margin-bottom: 20px">
                            过敏信息填写
                        <el-button  type="primary" @click="onAdd">+</el-button>
                        <el-button  type="primary" @click="onReduce">-</el-button>
                        </div>
                        <div style="width: 100%">
                            <el-input v-for="(item,i) of formData.gmItems" v-model="formData.gmItems[i]" :key="i" clearable style="width: 150px"  placeholder=""></el-input>
                        </div>
                    </el-row>
                </el-tab-pane>
                <el-tab-pane label="医嘱" name="second">
                    <YzTable :patientInfo="nursingRecordData">
                    </YzTable>
                </el-tab-pane>

            </el-tabs>
        </el-main>
    </el-container>
    <el-dialog v-model="hlmbFlag"  title="护理模板" destroy-on-close="true"   style="width:60%;height: 80%">
        <el-container>
            <el-header>
                <div style="width:100%;text-align: right;">
                <el-button size="small" type="success" @click="delhlmb">删除</el-button>
                <el-button size="small" type="success" @click="queRenHlmb">确认</el-button>
                <el-button size="small" type="success" @click="hlmbFlag=false">退出</el-button>
                </div>
            </el-header>
            <el-container>
                <el-aside>
                    <el-table :height="588" highlight-current-row :data="hlmbData" @row-click="selectOneHlmb">
                        <el-table-column property="hlName" label="模板名称" width="240" />
                        <el-table-column property="opName" label="创建人" width="80" />
                    </el-table>
                </el-aside>
                <el-main>
                    <el-input :rows="6" style="width: 98%" type="textarea" :disabled="true"
                              v-model="hlmbText"/>
                </el-main>
            </el-container>
        </el-container>

    </el-dialog>

</template>

<script setup name='firstHuLiDan'>
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,saveYzTemperature,
    queryScdYzTemperature,calInputOutSum,queryyzHlMb,saveHlMb,delHlMb
} from "@/api/medical-advice/nursing-manage";
import {ElMessageBox,ElMessage} from "element-plus";
import YzTable from "@/components/medical-advice/YzTable";
import {getEmrUrl,getInEmrUrl,emrStateEnum} from '@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init';
//刷新
const emit = defineEmits(['refreshHuLidan','closeHld']);

const props = defineProps({
    nursingRecordData: {
        type: Object,
        default:{}
    },

})


const checkboxData = ref({
    isEyes:false,
    isMouthpiece:false,
    bellybuttonFlag:false,
    buttocksFlag:false,
    showerFlag:false,
    spongeBathFlag:false,

    isSputum:false,
    isAtomization:false,
    isBreath:false,
    isMouthpiece:false,
    isHuiyin:false,
    isBed:false,
    isAV:false,


    inZongJie24:false,
    outZongJie24:false,
})


const formData = ref({
    inpatientNo:'',
    admissTimes:null,
    toStringRecDate:getFormatDatetime(new Date(),'YYYY-MM-DD'),
    recTime:'',
    faceColour:'',
    patientState:'',
    temperature1:'',
    temperature1Type:'x',
    breath:'',
    skinColour:'',
    skinStatus:'',
    intakeBreastMilk:null,
    intakeMilk:null,
    intakeWater:null,
    urineQuan:null,
    shit:null,
    heart:null,
    bodyWeight:null,
    pulse1:null,
    breathe1:null,
    pressure1Am:null,
    pressure1Pm:null,
    map:null,
    spo2:null,
    cvp:null,
    etcho2:null,
    gcs:null,
    rass:null,
    othJc:null,
    mind:'',
    position:'',
    pupilr:'',
    pupil:'',
    pupilbj:'',
    rpupil:'',
    lpupil:'',
    outputDblood:null,
    outputOther:null,
    fheartSoundStr:'',
    fheartSound:'',
    fetalBreak:'',
    uterineOpen:'',
    uterineStatus:'',
    outBlood:'',
    redHurt:'',
    col1Name:'',
    col1Am:null,
    col2Name:'',
    col2Am:null,
    urineColor:'',
    shitShape:'',
    skin:'',
    tubesName:'',
    tubesStatus:'',
    anusAir:'',
    suckleFun:'',
    uterineHigh:'',
    uterineMove:'',
    otherInfo:'',
    glu:null,
    shitUnit:'',
    shitOther:'',
    shitQuan:'',
    urineQuanAm:'',
    ward:'',

    boxTemp:'',
    boxHumi:'',
    decubitus:'',
    isEyes:null,
    isMouthpiece:null,
    bellybuttonFlag:null,
    buttocksFlag:null,
    showerFlag:null,
    spongeBathFlag:null,
    infoCry:'',
    infoSuck:'',
    infoSleep:'',
    infoActivity:'',
    acraStatus:'',
    isSputum:null,
    isAtomization:null,
    isBreath:null,
    isMouthpiece:null,
    isHuiyin:null,
    isBed:null,
    isAV:null,
    intakeFlag:null,
    outtakeFlag:null,
    inputOutSum:null,


    gmItems:[]
})

const temperatureType=ref('x')

const isMouthpiece = ref(false)
//保存体温类型
const saveType = ()=>{

}
//关闭窗口
const closeHld =()=>{
    emit('closeHld')
}

//保存护理单
const saveHuLiDan=(val)=>{
    setFormData(formData.value)
    saveYzTemperature(formData.value).then((res)=>{
        if(val != 1){
            //保存
            emit('refreshHuLidan')
        }
    })
}

//跳转电子病历
const queryDianZiBinLi=()=>{
    window.open(getEmrUrl(formData.value.inpatientNo,formData.value.admissTimes,emrStateEnum.在院只读),'_blank')
}






const setFormData=(val)=>{
    formData.value.recTime =getFormatDatetime(formData.value.recTime,'YYYY-MM-DD HH:mm:ss')
    if(checkboxData.value.isEyes){
        formData.value.isEyes=1
    }
    if(checkboxData.value.isMouthpiece){
        formData.value.isMouthpiece=1
    }
    if(checkboxData.value.bellybuttonFlag){
        formData.value.bellybuttonFlag=1
    }
    if(checkboxData.value.buttocksFlag){
        formData.value.buttocksFlag=1
    }
    if(checkboxData.value.showerFlag){
        formData.value.showerFlag=1
    }
    if(checkboxData.value.spongeBathFlag){
        formData.value.spongeBathFlag=1
    }

    if(checkboxData.value.isSputum){
        formData.value.isSputum=1
    }
    if(checkboxData.value.isAtomization){
        formData.value.isAtomization=1
    }
    if(checkboxData.value.isBreath){
        formData.value.isBreath=1
    }
    if(checkboxData.value.isMouthpiece){
        formData.value.isMouthpiece=1
    }
    if(checkboxData.value.isHuiyin){
        formData.value.isHuiyin=1
    }
    if(checkboxData.value.isBed){
        formData.value.isBed=1
    }
    if(checkboxData.value.isAV){
        formData.value.isAV=1
    }

    if(checkboxData.value.inZongJie24){
        formData.value.intakeFlag='1'
    }
    if(checkboxData.value.outZongJie24){
        formData.value.outtakeFlag='1'
    }

}

//获取三测单信息
const  queryScd = ()=>{
    setFormData(formData.value)
    queryScdYzTemperature(formData.value).then((res)=>{
        formData.value.temperature1 = res.temperature1
        formData.value.pulse1 = res.pulse1
        formData.value.breathe1 = res.breathe1
        formData.value.heart = res.heart
        formData.value.pressure1Am = res.pressure1Am
        formData.value.pressure1Pm = res.pressure1Pm
    })
}

//入出量求和 1入量 2出量
const inputOutSum=(type)=>{
    setFormData(formData.value)
    formData.value['inputOutSum']=type
    calInputOutSum(formData.value).then((res)=>{
        console.log('res.col2Am',res.col2Am)
        console.log('props.nursingRecordData.hldType',props.nursingRecordData.hldType)
        if(type==1){
            formData.value.col1Am = res.col1Am
        }else {
            if(props.nursingRecordData.hldType=='1' || props.nursingRecordData.hldType=='5' || props.nursingRecordData.hldType=='6'){
                formData.value.col2Am = res.col2Am
            }else if(props.nursingRecordData.hldType=='2'){
                formData.value.urineQuanAm =res.urineQuanAm
            }else if(props.nursingRecordData.hldType=='3'){
                formData.value.urineQuanAm =res.urineQuanAm
                formData.value.outputDblood =res.outputDblood
                formData.value.outputOther =res.outputOther
            }
        }
    })
}

//存模板
const saveOtherInfoModel=()=>{
    ElMessageBox.prompt('请输入模板标题', '标题', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
    })
        .then(({ value }) => {
            if(stringNotBlank(value)){
                let params = {
                    hlName:value,
                    hlText:formData.value.otherInfo,
                    deptCode:formData.value.ward
                }
                saveHlMb(params).then((res)=>{
                })
            }else {
                ElMessage.error('模板标题不能为空')
            }
        })
        .catch(() => {

        })
}




//护理模板
const hlmbFlag = ref(false)
//取魔板
const openOtherInfoModel = ()=>{
    hlmbText.value = ''
    let params = {
        deptCode:formData.value.ward
    }
    queryyzHlMb(params).then((res)=>{
        hlmbData.value =res
        hlmbFlag.value = true
    })
}

const selectionHlmb = ref({})
//选中一条护理魔板
const selectOneHlmb = (row)=>{
    selectionHlmb.value = row
    hlmbText.value = row.hlText
}
//确认选中模板
const  queRenHlmb=()=>{
    formData.value.otherInfo =hlmbText.value
    hlmbFlag.value = false
}


//删除护理模板
const delhlmb =()=>{
    let param = []
    param.push(selectionHlmb.value)
    delHlMb(param).then((res)=>{
        openOtherInfoModel()
    })
}


const  hlmbData = ref([]);

const hlmbText = ref('')



const activeName = ref('first')



const onAdd = ()=>{
    formData.value.gmItems.push('')
}

const onReduce = ()=>{
    formData.value.gmItems.pop()
}

onMounted(()=>{
    console.log('props.value',props)

    if(props.nursingRecordData.detailNo){
        formData.value = props.nursingRecordData
        setCheckBoxData(props.nursingRecordData)
    }else {
        formData.value.inpatientNo =  props.nursingRecordData.inpatientNo
        formData.value.admissTimes =  props.nursingRecordData.admissTimes
        formData.value.ward =  props.nursingRecordData.ward
    }
    queyGm(formData.value).then((res) => {
        formData.value.gmItems = res
    })

})


const setCheckBoxData=(val)=>{

  checkboxData.value.isEyes = (val.isEyes==1)
  checkboxData.value.isMouthpiece = (val.isMouthpiece==1)
  checkboxData.value.bellybuttonFlag = (val.bellybuttonFlag==1)
  checkboxData.value.buttocksFlag = (val.buttocksFlag==1)
  checkboxData.value.showerFlag = (val.showerFlag==1)
  checkboxData.value.spongeBathFlag = (val.spongeBathFlag==1)

  checkboxData.value.isSputum = (val.isSputum==1)
  checkboxData.value.isAtomization = (val.isAtomization==1)
  checkboxData.value.isBreath = (val.isBreath==1)
  checkboxData.value.isMouthpiece = (val.isMouthpiece==1)
  checkboxData.value.isHuiyin = (val.isHuiyin==1)
  checkboxData.value.isBed = (val.isBed==1)
  checkboxData.value.isAV = (val.isAV==1)

  checkboxData.value.inZongJie24 =  (val.intakeFlag=='1')
  checkboxData.value.outZongJie24 =  (val.outtakeFlag=='1')

}

</script>

<style scoped>
.el-row {
    margin-bottom: 20px;

}
/*.el-col{*/
/*    padding-left: 15px;*/
/*}*/
.row-title-sty {
    text-align: center;
    width: 100%;font-size: 18px;
    color: #1294fb;
    border-top: 1px solid black;
    margin-bottom: 10px;
}

</style>