<template>
  <div class="checkInspection" style="margin-top: -200px">
    <div class="headline">检验检查</div>
    <div class="allCheck">
      <div class="example1">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 血常规</el-button>

          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="xcg_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="xcgChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left1"></div>

        <div class="right">
          <div class="rightOne">
            <p class="title">白细胞</p>
            <el-input placeholder="请输入内容" v-model="bxb" :disabled="true">
            </el-input>
            <p class="unit">×10^9/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="bxb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血红蛋白</p>
            <el-input placeholder="请输入内容" v-model="xhdb" :disabled="true">
            </el-input>
            <p class="unit">g/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xhdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">红细胞计数</p>
            <el-input placeholder="请输入内容" v-model="hxbjs" :disabled="true">
            </el-input>
            <p class="unit">×10^12/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hxbjs"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">红细胞压积</p>
            <el-input placeholder="请输入内容" v-model="hxbyj" :disabled="true">
            </el-input>
            <p class="unit">%</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hxbyj"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">网织红细胞计数</p>
            <el-input
              placeholder="请输入内容"
              v-model="wzhxbjs"
              :disabled="true"
            >
            </el-input>
            <p class="unit">%</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="wzhxbjs"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne noBottom">
            <p class="title">血小板</p>
            <el-input placeholder="请输入内容" v-model="xxb" :disabled="true">
            </el-input>
            <p class="unit">×10^9/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xxb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>

      <div class="example1 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 骨矿物质代谢</el-button>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="gkwz_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="gkwzChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left1"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title">血总钙</p>
            <el-input placeholder="请输入内容" v-model="xzg" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xzg"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">游离钙</p>
            <el-input placeholder="请输入内容" v-model="ylg" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="ylg"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血磷</p>
            <el-input placeholder="请输入内容" v-model="xl" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xl"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">钙磷乘积</p>
            <el-input placeholder="请输入内容" :disabled="true"> </el-input>

            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy=""
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div>
            <div class="rightOne noBottom">
              <p class="title">全段甲状旁腺激素(IPTH)</p>
              <el-input
                placeholder="请输入内容"
                v-model="ipth"
                :disabled="true"
              >
              </el-input>
              <p class="unit">pg/ml</p>
              <el-button
                type="primary"
                class="copy"
                v-clipboard:copy="ipth"
                v-clipboard:success="onCopy"
                v-clipboard:error="onError"
                >复制</el-button
              >
            </div>
            <div class="rightOne">
              <p class="title">AKP(ALP碱性磷酸酶)</p>
              <el-input placeholder="请输入内容" v-model="akp" :disabled="true">
              </el-input>
              <p class="unit">pg/ml</p>
              <el-button
                type="primary"
                class="copy"
                v-clipboard:copy="akp"
                v-clipboard:success="onCopy"
                v-clipboard:error="onError"
                >复制</el-button
              >
            </div>
          </div>
        </div>
      </div>
      <div class="example2 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 铁代谢</el-button>
          <div class="next"></div>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="tdx_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="tdxChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left2"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title">血清铁</p>
            <el-input placeholder="请输入内容" v-model="xqt" :disabled="true">
            </el-input>
            <p class="unit">μmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xqt"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">总铁结合力</p>
            <el-input placeholder="请输入内容" v-model="ztjhl" :disabled="true">
            </el-input>
            <p class="unit">μmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="ztjhl"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>

          <div class="rightOne">
            <p class="title">转铁饱和度</p>
            <el-input placeholder="请输入内容" v-model="ztbhd" :disabled="true">
            </el-input>
            <p class="unit">μg/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="ztbhd"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne noBottom">
            <p class="title">铁蛋白</p>
            <el-input placeholder="请输入内容" v-model="tdb" :disabled="true">
            </el-input>
            <p class="unit">μg/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="tdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>
      <div class="example3 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 生化检查(透析前)</el-button>
          <div class="next"></div>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="shjc_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="shjcChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left3"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title">尿素</p>
            <el-input placeholder="请输入内容" v-model="ns" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="ns"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">肌酐</p>
            <el-input placeholder="请输入内容" v-model="jg" :disabled="true">
            </el-input>
            <p class="unit">μmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="jg"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血尿酸</p>
            <el-input placeholder="请输入内容" v-model="xns" :disabled="true">
            </el-input>
            <p class="unit">μmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xns"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血总蛋白</p>
            <el-input placeholder="请输入内容" v-model="xzdb" :disabled="true">
            </el-input>
            <p class="unit">g/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xzdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div>
            <div class="rightOne noBottom">
              <p class="title">血白蛋白</p>
              <el-input
                placeholder="请输入内容"
                v-model="xbdb"
                :disabled="true"
              >
              </el-input>
              <p class="unit">g/L</p>
              <el-button
                type="primary"
                class="copy"
                v-clipboard:copy="xbdb"
                v-clipboard:success="onCopy"
                v-clipboard:error="onError"
                >复制</el-button
              >
            </div>
            <div class="rightOne">
              <p class="title">丙氨酸氨基转移酶(ALT)</p>
              <el-input placeholder="请输入内容" v-model="alt" :disabled="true">
              </el-input>
              <p class="unit">IU/L</p>
              <el-button
                type="primary"
                class="copy"
                v-clipboard:copy="alt"
                v-clipboard:success="onCopy"
                v-clipboard:error="onError"
                >复制</el-button
              >
            </div>
          </div>
          <div class="rightOne">
            <p class="title">总胆红素</p>
            <el-input placeholder="请输入内容" v-model="zdhs" :disabled="true">
            </el-input>
            <p class="unit">μmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="zdhs"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">甘油三酯</p>
            <el-input placeholder="请输入内容" v-model="gysz" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="gysz"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>

          <div class="rightOne">
            <p class="title">低密度脂蛋白</p>
            <el-input
              placeholder="请输入内容"
              v-model="dmdzdb"
              :disabled="true"
            >
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="dmdzdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">高密度脂蛋白</p>
            <el-input
              placeholder="请输入内容"
              v-model="gmdzdb"
              :disabled="true"
            >
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="gmdzdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血糖</p>
            <el-input placeholder="请输入内容" v-model="xt" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xt"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血钾</p>
            <el-input placeholder="请输入内容" v-model="xj" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xj"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血钠</p>
            <el-input placeholder="请输入内容" v-model="xn" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xn"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血氯</p>
            <el-input placeholder="请输入内容" v-model="xc" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xc"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血镁</p>
            <el-input placeholder="请输入内容" v-model="xm" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xm"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">血沉</p>
            <el-input placeholder="请输入内容" v-model="xchen" :disabled="true">
            </el-input>
            <p class="unit">mm/h</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xchen"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne noBottom">
            <p class="title">二氧化碳</p>
            <el-input placeholder="请输入内容" v-model="xe" :disabled="true">
            </el-input>
            <p class="unit">mmol/L</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="xe"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>
      <div class="example4 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 营养与炎症</el-button>
          <div class="next"></div>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="yyyyz_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="yyyyzChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left4"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title">C反应蛋白</p>
            <el-input placeholder="请输入内容" v-model="cfydb" :disabled="true">
            </el-input>
            <p class="unit">mg/dL</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="cfydb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">前白蛋白</p>
            <el-input placeholder="请输入内容" v-model="qbdb" :disabled="true">
            </el-input>
            <p class="unit">mg/dL</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="qbdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>

          <div class="rightOne noBottom">
            <p class="title">β2微白蛋白</p>
            <el-input placeholder="请输入内容" v-model="b2wdb" :disabled="true">
            </el-input>
            <p class="unit">mg/dL</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="b2wdb"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>
      <div class="example5 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 传染病学指标</el-button>
          <div class="next"></div>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="crbxzb_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="crbxzbChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left5"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title1">乙型肝炎病毒表面抗原<br />(HBsAg)</p>
            <el-input placeholder="请输入内容" v-model="hbsag" :disabled="true">
            </el-input>

            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hbsag"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">乙型肝炎病毒表面抗体<br />(AntiHBs)</p>
            <el-input
              placeholder="请输入内容"
              v-model="antihbs"
              :disabled="true"
            >
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="antihbs"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">乙型肝炎病毒E坑抗原<br />(HBeAg)</p>
            <el-input placeholder="请输入内容" v-model="hbeag" :disabled="true">
            </el-input>

            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hbeag"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">乙型肝炎病毒E抗体<br />(AntiHBe)</p>
            <el-input
              placeholder="请输入内容"
              v-model="antihbe"
              :disabled="true"
            >
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="antihbe"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">乙型肝炎病毒核心抗体<br />(AntiHBc)</p>
            <el-input
              placeholder="请输入内容"
              v-model="antihbc"
              :disabled="true"
            >
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="antihbc"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">乙肝病毒DNA测定<br />(HBVDNA)</p>
            <el-input
              placeholder="请输入内容"
              v-model="hbvdna"
              :disabled="true"
            >
            </el-input>
            <p class="unit">copies/mL</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hbvdna"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">丙型肝炎病毒抗体<br />(AntiHCV)</p>
            <el-input
              placeholder="请输入内容"
              v-model="antihcv"
              :disabled="true"
            >
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="antihcv"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title1">丙肝病毒RNA测定<br />(HCVRNA)</p>
            <el-input
              placeholder="请输入内容"
              v-model="hcvrna"
              :disabled="true"
            >
            </el-input>
            <p class="unit">copies/mL</p>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hcvrna"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne">
            <p class="title">HV抗体</p>
            <el-input placeholder="请输入内容" v-model="hivkt" :disabled="true">
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="hivkt"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne noBottom">
            <p class="title">梅毒</p>
            <el-input placeholder="请输入内容" v-model="md" :disabled="true">
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="md"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>
      <div class="example6 noTop">
        <div class="mainTitle">
          <el-button type="primary" class="word">| 结核</el-button>
          <div class="next"></div>
          <div style="float: right">
            <p class="checkDate">检查日期</p>
            <el-date-picker
              v-model="jh_date"
              type="monthrange"
              style="width: 80%;"
              range-separator="-"
              value-format="timestamp"
              start-placeholder="开始月份"
              @change="jhChange"
              end-placeholder="结束月份"
            >
            </el-date-picker>
          </div>
        </div>
        <div class="left6"></div>
        <div class="right">
          <div class="rightOne">
            <p class="title">结核抗体</p>
            <el-input placeholder="请输入内容" v-model="jhkt" :disabled="true">
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="jhkt"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
          <div class="rightOne noBottom">
            <p class="title">结核菌素试验</p>
            <el-input
              placeholder="请输入内容"
              v-model="jhjssy"
              :disabled="true"
            >
            </el-input>
            <el-button
              type="primary"
              class="copy"
              v-clipboard:copy="jhjssy"
              v-clipboard:success="onCopy"
              v-clipboard:error="onError"
              >复制</el-button
            >
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getDataConfig } from "@/utils/data";
import { uParseTime } from "@/utils/tools";
import { GetUploadInspections, GetInitInspections } from "@/api/inspection";

export default {
  name: "Two",
  components: {},

  data() {
    return {
      value1: "",
      input: "",
      radio: "",

      xcg_date: [],
      gkwz_date: [],
      tdx_date: [],
      shjc_date: [],
      yyyyz_date: [],
      crbxzb_date: [],
      jh_date: [],

      routine_blood_test: [],
      bone_mineral_metabolism: [],
      iron_metabolism: [],
      biochemical_test: [],
      inflammation: [],
      contagion: [],
      phthisis: [],
      inspection_reference: [],

      bxb: "",
      xhdb: "",
      hxbjs: "",
      hxbyj: "",
      wzhxbjs: "",
      xxb: "",

      xzg: "",
      ylg: "",
      xl: "",
      ipth: "",
      akp: "",

      xqt: "",
      ztjhl: "",
      ztbhd: "",
      tdb: "",

      ns: "",
      jg: "",
      xns: "",
      xzdb: "",
      xbdb: "",
      alt: "",
      zdhs: "",
      gysz: "",
      dmdzdb: "",
      gmdzdb: "",
      xt: "",
      xj: "",
      xn: "",
      xc: "",
      xm: "",
      xchen: "",
      xe: "",

      cfydb: "",
      qbdb: "",
      b2wdb: "",

      hbsag: "",
      antihbs: "",
      hbeag: "",
      antihbe: "",
      antihbc: "",
      hbvdna: "",
      antihcv: "",
      hcvrna: "",
      hivkt: "",
      md: "",

      jhkt: "",
      jhjssy: "",

      patient_id: 0
    };
  },
  created() {
    var start_time = new Date(
      this.getQuarterStartDate().replace(/-/g, "/")
    ).getTime();
    var end_time = new Date(
      this.getQuarterEndDate().replace(/-/g, "/")
    ).getTime();
    this.xcg_date.push(start_time, end_time);
    this.gkwz_date.push(start_time, end_time);
    this.tdx_date.push(start_time, end_time);
    this.shjc_date.push(start_time, end_time);
    this.yyyyz_date.push(start_time, end_time);
    this.crbxzb_date.push(start_time, end_time);
    this.jh_date.push(start_time, end_time);
  },
  methods: {
    GetInitInspections() {
      GetInitInspections()
        .then(response => {
          if (response.data.state == 1) {
            this.inspection_reference = response.data.data.references;
          } else {
            // this.$notify.error({
            //   title: '错误',
            //   message: '网络异常'
            // })
          }
        })
        .catch(err => {
          // this.$notify.error({
          //   title: '错误',
          //   message: '网络异常'
          // })
        });
    },
    getTime(val) {
      return uParseTime(val, "{y}年{m}月{d}日");
    },
    GetUploadInspections(id, start_time, end_time, type, project) {
      this.patient_id = id;

      let params = {
        patient: id,
        project_id: project,
        start_time: start_time,
        end_time: end_time,
        type: type,
        project: project
      };
      GetUploadInspections(params)
        .then(response => {
          if (response.data.state === 1) {
            switch (response.data.data.type) {
              case 1:
                if (response.data.data.inspections != null) {
                  if (response.data.data.inspections.length > 0) {
                    this.bxb = response.data.data.inspections[0].inspect_value;
                    this.xhdb = response.data.data.inspections[3].inspect_value;
                    this.hxbjs =
                      response.data.data.inspections[6].inspect_value;
                    this.hxbyj =
                      response.data.data.inspections[7].inspect_value;
                    this.wzhxbjs =
                      response.data.data.inspections[5].inspect_value;
                    this.xxb = response.data.data.inspections[8].inspect_value;
                  }
                } else {
                  this.bxb = "";
                  this.xhdb = "";
                  this.hxbjs = "";
                  this.hxbyj = "";
                  this.wzhxbjs = "";
                  this.xxb = "";
                }
                break;
              case 2:
                if (response.data.data.inspections_one != null) {
                  if (response.data.data.inspections_one.length > 0) {
                    this.akp =
                      response.data.data.inspections_one[4].inspect_value;
                  }
                } else {
                  this.akp = "";
                }

                if (response.data.data.inspections_two != null) {
                  if (response.data.data.inspections_two.length > 0) {
                    this.xzg =
                      response.data.data.inspections_two[7].inspect_value;
                    this.ylg =
                      response.data.data.inspections_two[2].inspect_value;
                    this.xl =
                      response.data.data.inspections_two[9].inspect_value;
                  }
                } else {
                  this.xzg = "";
                  this.ylg = "";
                  this.xl = "";
                }

                if (response.data.data.inspections_three != null) {
                  if (response.data.data.inspections_three.length > 0) {
                    this.ipth =
                      response.data.data.inspections_three[1].inspect_value;
                  }
                } else {
                  this.ipth = "";
                }

                break;
              case 3:
                if (response.data.data.inspections != null) {
                  if (response.data.data.inspections.length > 0) {
                    this.xqt = response.data.data.inspections[0].inspect_value;
                    this.ztjhl =
                      response.data.data.inspections[2].inspect_value;
                    this.ztbhd =
                      response.data.data.inspections[3].inspect_value;
                    this.tdb = response.data.data.inspections[1].inspect_value;
                  }
                } else {
                  this.xqt = "";
                  this.ztjhl = "";
                  this.ztbhd = "";
                  this.tdb = "";
                }
                break;
              case 4:
                if (response.data.data.inspections_one != null) {
                  if (response.data.data.inspections_one.length > 0) {
                    this.xzdb =
                      response.data.data.inspections_one[3].inspect_value;
                    this.xbdb =
                      response.data.data.inspections_one[5].inspect_value;
                    this.alt =
                      response.data.data.inspections_one[0].inspect_value;
                    this.zdhs =
                      response.data.data.inspections_one[6].inspect_value;
                  }
                } else {
                  this.xzdb = "";
                  this.xbdb = "";
                  this.alt = "";
                  this.zdhs = "";
                }

                if (response.data.data.inspections_two != null) {
                  if (response.data.data.inspections_two.length > 0) {
                    this.xj =
                      response.data.data.inspections_two[4].inspect_value;
                    this.xn =
                      response.data.data.inspections_two[5].inspect_value;
                    this.xc =
                      response.data.data.inspections_two[6].inspect_value;
                    this.xm =
                      response.data.data.inspections_two[0].inspect_value;
                    this.xchen =
                      response.data.data.inspections_two[1].inspect_value;
                    this.xe =
                      response.data.data.inspections_two[3].inspect_value;
                  }
                } else {
                  this.xj = "";
                  this.xn = "";
                  this.xc = "";
                  this.xm = "";
                  this.xchen = "";
                  this.xe = "";
                }

                if (response.data.data.inspections_three != null) {
                  if (response.data.data.inspections_three.length > 0) {
                    this.ns =
                      response.data.data.inspections_three[0].inspect_value;
                    this.jg =
                      response.data.data.inspections_three[3].inspect_value;
                    this.xns =
                      response.data.data.inspections_three[1].inspect_value;
                  }
                } else {
                  this.ns = "";
                  this.jg = "";
                  this.xns = "";
                }

                if (response.data.data.inspections_four != null) {
                  if (response.data.data.inspections_four.length > 0) {
                    this.gysz =
                      response.data.data.inspections_four[0].inspect_value;
                    this.dmdzdb =
                      response.data.data.inspections_four[3].inspect_value;
                    this.gmdzdb =
                      response.data.data.inspections_four[2].inspect_value;
                  }
                } else {
                  this.gysz = "";
                  this.gmdzdb = "";
                  this.dmdzdb = "";
                }

                if (response.data.data.inspections_five != null) {
                  if (response.data.data.inspections_five.length > 0) {
                    this.xt =
                      response.data.data.inspections_five[0].inspect_value;
                  }
                } else {
                  this.xt = "";
                }

                break;
              case 5:
                if (response.data.data.inspections_one != null) {
                  if (response.data.data.inspections_one.length > 0) {
                    this.b2wdb =
                      response.data.data.inspections_one[2].inspect_value;
                  }
                } else {
                  this.b2wdb = "";
                }

                if (response.data.data.inspections_two != null) {
                  if (response.data.data.inspections_two.length > 0) {
                    this.cfydb =
                      response.data.data.inspections_two[0].inspect_value;
                    this.qbdb =
                      response.data.data.inspections_two[1].inspect_value;
                  }
                } else {
                  this.cfydb = "";
                  this.qbdb = "";
                }

                break;
              case 6:
                if (response.data.data.inspections != null) {
                  if (response.data.data.inspections.length > 0) {
                    this.hbsag =
                      response.data.data.inspections[1].inspect_value;
                    this.antihbs =
                      response.data.data.inspections[2].inspect_value;
                    this.hbeag =
                      response.data.data.inspections[3].inspect_value;
                    this.antihbe =
                      response.data.data.inspections[4].inspect_value;
                    this.antihbc =
                      response.data.data.inspections[5].inspect_value;
                    this.hbvdna =
                      response.data.data.inspections[8].inspect_value;
                    this.antihcv =
                      response.data.data.inspections[0].inspect_value;
                    this.hcvrna =
                      response.data.data.inspections[9].inspect_value;
                    this.hivkt =
                      response.data.data.inspections[6].inspect_value;
                    this.md = response.data.data.inspections[7].inspect_value;

                    //
                  }
                } else {
                  this.hbsag = "";
                  this.antihbs = "";
                  this.hbeag = "";
                  this.antihbe = "";
                  this.antihbc = "";
                  this.hbvdna = "";
                  this.antihcv = "";
                  this.hcvrna = "";
                  this.hivkt = "";
                  this.md = "";
                }
                break;
              case 7:
                if (response.data.data.inspections != null) {
                  if (response.data.data.inspections.length > 0) {
                    this.jhkt = response.data.data.inspections[0].inspect_value;
                    this.jhjssy =
                      response.data.data.inspections[1].inspect_value;
                  }
                } else {
                  this.jhkt = "";
                  this.jhjssy = "";
                }
                break;
            }
          } else {
            // this.$notify.error({
            //   title: '错误',
            //   message: '网络异常'
            // })
          }
        })
        .catch(err => {
          // this.$notify.error({
          //   title: '错误',
          //   message: '网络异常'
          // })
        });
    },
    getMaritalType(id) {
      for (let i = 0; i < this.maritalOptions.length; i++) {
        if (this.maritalOptions[i].id == id) {
          return this.maritalOptions[i].name;
        }
      }
    },
    getEducationType(id) {
      for (let i = 0; i < this.educationOptions.length; i++) {
        if (this.educationOptions[i].id == id) {
          return this.educationOptions[i].name;
        }
      }
    },
    getProfessionType(id) {
      for (let i = 0; i < this.professionOptions.length; i++) {
        if (this.professionOptions[i].id == id) {
          return this.professionOptions[i].name;
        }
      }
    },
    onCopy() {
      this.$message.success("复制成功");
    },
    onError() {
      this.$message.success("复制失败,请重试");
    },
    xcgChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        1,
        "1"
      );
    },
    gkwzChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        2,
        "2-4-20"
      );
    },
    tdxChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        3,
        "21"
      );
    },
    shjcChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        4,
        "2-4-15-24-25"
      );
    },
    yyyyzChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        5,
        "15-23"
      );
    },
    crbxzbChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        6,
        "14"
      );
    },
    jhChange(val) {
      this.GetUploadInspections(
        this.patient_id,
        val[0] / 1000,
        val[1] / 1000,
        7,
        "22"
      );
    },
    getQuarterStartDate: function() {
      var now = new Date(); //当前日期
      var nowYear = now.getFullYear(); //当前年
      nowYear += nowYear < 2000 ? 1900 : 0;

      var quarterStartDate = new Date(nowYear, this.getQuarterStartMonth(), 1);
      return this.formatDate(quarterStartDate);
    },
    getQuarterEndDate: function() {
      var now = new Date(); //当前日期
      var nowYear = now.getFullYear(); //当前年
      nowYear += nowYear < 2000 ? 1900 : 0;
      var quarterEndMonth = this.getQuarterStartMonth() + 2;
      var quarterStartDate = new Date(
        nowYear,
        quarterEndMonth,
        this.getMonthDays(quarterEndMonth)
      );
      return this.formatDate(quarterStartDate);
    },
    formatDate: function(date) {
      var myyear = date.getFullYear();
      var mymonth = date.getMonth() + 1;
      var myweekday = date.getDate();

      if (mymonth < 10) {
        mymonth = "0" + mymonth;
      }
      if (myweekday < 10) {
        myweekday = "0" + myweekday;
      }
      return myyear + "-" + mymonth + "-" + myweekday;
    },
    getQuarterStartMonth: function() {
      var now = new Date(); //当前日期
      var nowMonth = now.getMonth(); //当前月

      var quarterStartMonth = 0;
      if (nowMonth < 3) {
        quarterStartMonth = 0;
      }
      if (2 < nowMonth && nowMonth < 6) {
        quarterStartMonth = 3;
      }
      if (5 < nowMonth && nowMonth < 9) {
        quarterStartMonth = 6;
      }
      if (nowMonth > 8) {
        quarterStartMonth = 9;
      }
      return quarterStartMonth;
    }, //获得某月的天数
    getMonthDays(myMonth) {
      var now = new Date(); //当前日期
      var nowYear = now.getYear(); //当前年
      nowYear += nowYear < 2000 ? 1900 : 0;
      var monthStartDate = new Date(nowYear, myMonth, 1);
      var monthEndDate = new Date(nowYear, myMonth + 1, 1);
      var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
      return days;
    }
  }
};
</script>

<style lang="scss">
.checkInspection {
  float: left;
  width: 86%;
  padding-left: 20px;
  .headline {
    height: 30px;
    line-height: 30px;
    margin-bottom: 10px;
  }

  .example1 {
    width: 100%;
    height: 350px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .example2 {
    width: 100%;
    height: 250px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .example3 {
    width: 100%;
    height: 950px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .example4 {
    width: 100%;
    height: 200px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .example5 {
    width: 100%;
    height: 550px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .example6 {
    width: 100%;
    height: 150px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
  }
  .mainTitle {
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .word {
      float: left;
    }
    .next {
      float: right;
    }
  }
  .left1 {
    float: left;
    width: 18%;
    height: 300px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .left2 {
    float: left;
    width: 18%;
    height: 200px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .left3 {
    float: left;
    width: 18%;
    height: 900px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .left4 {
    float: left;
    width: 18%;
    height: 150px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .left5 {
    float: left;
    width: 18%;
    height: 500px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .left6 {
    float: left;
    width: 18%;
    height: 100px;
    border-right: 1px solid #ccc;
    padding-top: 10px;
  }
  .checkDate {
    float: left;
    height: 36px;
    line-height: 36px;
    font-size: 12px;
    margin-right: 10px;
  }
  .el-date-editor {
    float: left;
    width: 130px;
  }
  .hint {
    width: 130px;
    font-size: 12px;
    float: right;
    margin-right: 8px;
    margin-top: 2px;
  }
  .right {
    float: left;
    width: 82%;
    // height: 100%;
    overflow: hidden;
    .rightOne {
      height: 50px;
      border-bottom: 1px solid #ccc;
    }
    .noBottom {
      border-bottom: none;
    }
    .title {
      float: left;
      width: 20%;
      font-size: 12px;
      padding-left: 10px;
      line-height: 50px;
    }
    .title1 {
      float: left;
      width: 20%;
      font-size: 12px;
      padding-left: 10px;
      margin-top: 12px;
    }
    .el-input {
      float: left;
      width: 38%;
      line-height: 50px;
    }
    .unit {
      float: left;
      margin-left: 20px;
      font-size: 12px;
      width: 16%;
      line-height: 50px;
    }
    .unidentified {
      float: left;
      font-size: 12px;
      line-height: 50px;
    }
    .unidentified1 {
      float: left;
      font-size: 12px;
      line-height: 50px;
      margin-left: 151px;
    }
    .copy {
      float: left;
      margin-left: 20px !important;
      margin-top: 6px;
    }
    .copy1 {
      margin-left: 194px;
    }
    .copy2 {
      margin-left: 44px;
    }
    .el-radio {
      margin-right: 0 !important;
    }
    .el-radio__label {
      font-size: 12px;
    }
  }

  .noTop {
    border-top: none;
  }
}
</style>
