WXL
9 天以前 98b9fdc80abc60b5e57370328ea51cf06365bab0
src/views/patient/patient/profile/index.vue
@@ -6,14 +6,27 @@
        <el-col :span="18">
          <div class="headportrait">
            <div class="text-center">
              <img v-imgError="require('@/assets/common/head.jpg')" src="" />
              <img
                v-imgError="require('@/assets/images/shoushuzhudaoyisheng.png')"
                src=""
              />
            </div>
            <div style="margin-left: 10px">吴大龙</div>
            <div style="margin-left: 10px" class="text-title">男</div>
            <div style="margin-left: 10px" class="text-title">66岁</div>
            <div style="margin-left: 10px" class="text-title">1999.12.18</div>
            <div style="margin-left: 10px" class="text-title">汉族</div>
            <div style="margin-left: 10px" class="text-title">河南信阳</div>
            <div style="margin-left: 10px">{{ userform.name }}</div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.sex == 1 ? "男" : "女" }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.age }}岁
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.birthdate }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.nation }}
            </div>
            <div style="margin-left: 10px" class="text-title">
              {{ userform.birthplace }}
            </div>
          </div></el-col
        >
      </el-row>
@@ -29,21 +42,15 @@
        <span class="mulsz" slot="label"
          ><i class="el-icon-s-management"></i> 医疗档案</span
        >
        <el-tabs v-model="sonactiveName" @tab-click="handleClick">
        <el-tabs v-model="sonactiveName" @tab-click="handleClickson">
          <el-tab-pane name="outpatient"
            ><span class="mulsz" slot="label"
              >门诊({{ mznumber }})</span
            ></el-tab-pane
            ><span class="mulsz" slot="label">门诊</span></el-tab-pane
          >
          <el-tab-pane name="inhospital"
            ><span class="mulsz" slot="label"
              >住院({{ zynumber }})
            </span></el-tab-pane
            ><span class="mulsz" slot="label">在院 </span></el-tab-pane
          >
          <el-tab-pane name="checkout"
            ><span class="mulsz" slot="label"
              >体检({{ jynumber }})
            </span></el-tab-pane
            ><span class="mulsz" slot="label">出院 </span></el-tab-pane
          >
        </el-tabs>
      </el-tab-pane>
@@ -52,8 +59,8 @@
          ><i class="el-icon-s-data"></i> 健康监测</span
        >
        <el-tabs v-model="sontwoactiveName" @tab-click="handleClick">
          <el-tab-pane name="blood"
        <el-tabs v-model="sontwoactiveName">
          <!-- <el-tab-pane name="blood"
            ><span class="mulsz" slot="label"
              ><i class="el-icon-s-operation"></i> 血压</span
            ></el-tab-pane
@@ -62,13 +69,13 @@
            ><span class="mulsz" slot="label"
              ><i class="el-icon-odometer"></i>血糖
            </span></el-tab-pane
          >
          > -->
          <el-tab-pane name="weight"
            ><span class="mulsz" slot="label"
              ><i class="el-icon-s-data"></i>体重
              ><i class="el-icon-s-data"></i>身高头围趋势
            </span></el-tab-pane
          >
          <el-tab-pane name="heartrate"
          <!-- <el-tab-pane name="heartrate"
            ><span class="mulsz" slot="label"
              ><i class="el-icon-s-operation"></i>心率
            </span></el-tab-pane
@@ -82,9 +89,9 @@
            ><span class="mulsz" slot="label"
              ><i class="el-icon-s-opportunity"></i>体温
            </span></el-tab-pane
          >
        </el-tabs></el-tab-pane
      >
          > -->
        </el-tabs>
      </el-tab-pane>
      <el-tab-pane name="serve">
        <span class="mulsz" slot="label"
          ><i class="el-icon-s-custom"></i> 服务记录</span
@@ -95,89 +102,114 @@
    <!-- 健康档案模块 -->
    <div class="information-content" v-if="activeName == 'health'">
      <div class="top-message">
        <div class="headline">基础信息</div>
        <div class="headlines">
          <div>基础信息</div>
          <el-button type="primary" @click="savefile">保存患者档案</el-button>
        </div>
        <div class="detailed">
          <el-row :gutter="20">
            <el-col :span="12"
              ><div class="grid-content bg-purple">
                患者姓名:<span class="spanvalue">王大美</span>
              </div></el-col
            >
            <el-col :span="12"
              ><div class="grid-content bg-purple">
                联系电话:<span class="spanvalue">13803963330</span>
              </div></el-col
            >
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"
              ><div class="grid-content bg-purple">
                出生地:<span class="spanvalue"
                  >浙江省杭州市余杭区余杭街道</span
                >
              </div></el-col
            >
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"
              ><div class="grid-content bg-purple">
                居住地:<span class="spanvalue"
                  >浙江省杭州市余杭区余杭街道</span
                >
              </div></el-col
            >
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"
              ><div class="xinz-inf">
                <el-tag
                  :key="tag"
                  type="success"
                  v-for="tag in dynamicTags"
                  closable
                  :disable-transitions="false"
                  @close="handleClose(tag)"
                >
                  {{ tag }}
                </el-tag>
                <el-select
                  v-model="inputValue"
                  v-if="inputVisible"
                  @change="handleInputConfirm"
                  filterable
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.label"
                    :label="item.label"
                    :value="item.label"
                  >
                  </el-option>
                </el-select>
          <el-form
            ref="userform"
            :model="userform"
            :rules="rules"
            label-width="100px"
          >
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="患者姓名" prop="name">
                  <el-input
                    v-model="userform.name"
                    placeholder="请输入姓名"
                    maxlength="30"
                    disabled
                  ></el-input> </el-form-item
              ></el-col>
              <el-col :span="12"
                ><el-form-item label="联系方式" prop="telcode">
                  <el-input
                    v-model="userform.telcode"
                    placeholder="请输入联系方式"
                    maxlength="30"
                  /> </el-form-item
              ></el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="24">
                <el-form-item label="出生地" prop="birthplace">
                  <el-input
                    v-model="userform.birthplace"
                    placeholder="国、省、地市、区县、街道等详细信息"
                    maxlength="50"
                  /> </el-form-item
              ></el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="24"
                ><el-form-item label="居住地" prop="placeOfResidence">
                  <el-input
                    v-model="userform.placeOfResidence"
                    placeholder="国、省、地市、区县、街道等详细信息"
                    maxlength="50"
                  /> </el-form-item
              ></el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="24">
                <el-form-item label="标签" prop="desc">
                  <div class="xinz-inf">
                    <el-tag
                      :key="tag.tagname"
                      type="success"
                      v-for="tag in dynamicTags"
                      v-if="tag.isoperation != 3"
                      closable
                      :disable-transitions="false"
                      @close="handleClose(tag)"
                    >
                      {{ tag.tagname }}
                    </el-tag>
                    <el-select
                      v-if="inputVisible"
                      v-model="inputValue"
                      @change="handleInputConfirm"
                      filterable
                      remote
                      :remote-method="remoteMethod"
                      allow-create
                      default-first-option
                      placeholder="请选择/查询"
                    >
                      <el-option
                        v-for="item in options"
                        :key="item.tagid"
                        :label="item.tagname"
                        :value="item.tagname"
                      >
                      </el-option>
                    </el-select>
                <el-button
                  v-else
                  class="button-new-tag"
                  size="small"
                  @click="showInput"
                  >+ 新增标签</el-button
                >
              </div></el-col
            >
          </el-row>
                    <el-button
                      v-else
                      class="button-new-tag"
                      size="small"
                      @click="showInput"
                      >+ 新增标签</el-button
                    >
                  </div>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </div>
      <div class="top-message">
        <div class="headline">病史</div>
        <div class="detailed">
          <el-form ref="form" :model="form" :rules="rules" label-width="100px">
          <el-form :model="form" label-width="100px">
            <el-row>
              <el-col :span="8">
                <el-form-item label="过往疾病" prop="name">
                  <el-input
                    v-model="form.name"
                    v-model="form.pastIllnesses"
                    placeholder="请输入"
                    maxlength="30"
                  />
@@ -186,7 +218,7 @@
              <el-col :span="8">
                <el-form-item label="药物过敏" prop="sex">
                  <el-input
                    v-model="form.name"
                    v-model="form.drugAllergy"
                    placeholder="请输入具体药物/无"
                    maxlength="30"
                  />
@@ -195,7 +227,7 @@
              <el-col :span="8">
                <el-form-item label="家族病史" prop="age">
                  <el-input
                    v-model="form.age"
                    v-model="form.familyHistory"
                    placeholder="请输入具体疾病/无"
                    maxlength="30"
                  />
@@ -206,7 +238,7 @@
              <el-col :span="8">
                <el-form-item label="手术史" prop="name">
                  <el-input
                    v-model="form.name"
                    v-model="form.surgicalHistory"
                    placeholder="请输入手术/无"
                    maxlength="30"
                  />
@@ -215,62 +247,62 @@
              <el-col :span="8">
                <el-form-item label="生育史" prop="age">
                  <el-input
                    v-model="form.age"
                    v-model="form.reproductiveHistory"
                    placeholder="请输入胎数/无"
                    maxlength="30"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="月经史" prop="telcode">
                  <el-radio-group v-model="form.radio">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="月经史" prop="menstrualHistory">
                  <el-radio-group v-model="form.menstrualHistory">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="吸烟情况" prop="iccardtype">
                  <el-radio-group v-model="form.radio">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="吸烟情况" prop="smoking">
                  <el-radio-group v-model="form.smoking">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="饮酒情况" prop="iccardno">
                  <el-radio-group v-model="form.radios">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="饮酒情况" prop="drink">
                  <el-radio-group v-model="form.drink">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="运动情况" prop="iccardno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">有</el-radio>
                    <el-radio :label="2">无</el-radio>
                <el-form-item label="运动情况" prop="motion">
                  <el-radio-group v-model="form.motion">
                    <el-radio label="1">有</el-radio>
                    <el-radio label="2">无</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="饮食情况" prop="iccardno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">多度饮食</el-radio>
                    <el-radio :label="2">正常饮食</el-radio>
                    <el-radio :label="2">食欲不振</el-radio>
                <el-form-item label="饮食情况" prop="diet">
                  <el-radio-group v-model="form.diet">
                    <el-radio label="1">过度饮食</el-radio>
                    <el-radio label="2">正常饮食</el-radio>
                    <el-radio label="3">食欲不振</el-radio>
                  </el-radio-group>
                </el-form-item> </el-col
              ><el-col :span="12">
                <el-form-item label="心理情况" prop="iccardno">
                  <el-radio-group v-model="form.radiosa">
                    <el-radio :label="1">心情愉悦</el-radio>
                    <el-radio :label="2">轻微焦虑</el-radio>
                    <el-radio :label="2">抑郁</el-radio>
                <el-form-item label="心理情况" prop="psychology">
                  <el-radio-group v-model="form.psychology">
                    <el-radio label="1">心情愉悦</el-radio>
                    <el-radio label="2">轻微焦虑</el-radio>
                    <el-radio label="3">抑郁</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>
@@ -281,20 +313,22 @@
      <!-- 联系电话 -->
      <div class="bottom-message">
        <div class="headline">
          号码维护
          <el-button type="primary" @click="AddanumberVisible = true"
            >+新增</el-button
          >
          亲属号码维护<span style="margin-right: 60px">&nbsp;&nbsp;</span>
          <el-button type="primary" @click="addcompiletb">+新增</el-button>
        </div>
        <div class="Table-screen">
          <el-table :data="tableData" style="width: 100%">
          <el-table
            :data="tableData"
            style="width: 100%"
            :row-class-name="tableRowClassName"
          >
            <el-table-column prop="id" label="序号" width="180">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="180">
            <el-table-column prop="contactname" label="姓名" width="180">
            </el-table-column>
            <el-table-column prop="phonenumber" label="联系方式" width="180">
            <el-table-column prop="contactway" label="联系方式" width="180">
            </el-table-column>
            <el-table-column prop="concern" label="关系"> </el-table-column>
            <el-table-column prop="relation" label="关系"> </el-table-column>
            <el-table-column
              label-class-name="columcz"
              fixed="right"
@@ -302,11 +336,22 @@
              width="300"
            >
              <template slot-scope="scope">
                <el-button type="success" size="small"
                <el-button
                  type="success"
                  size="small"
                  @click="defaulttb(scope.row)"
                  >设为默认联系方式</el-button
                >
                <el-button type="warning" size="small">编辑</el-button>
                <el-button type="danger" size="small">删除</el-button>
                <el-button
                  @click="compiletb(scope.row)"
                  type="warning"
                  size="small"
                  >编辑</el-button
                >
                <el-button @click="deltb(scope.row)" type="danger" size="small"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
@@ -318,24 +363,83 @@
      <!-- 门诊 -->
      <div v-if="sonactiveName == 'outpatient'">
        <el-table :data="serviceData" style="width: 100%">
          <el-table-column prop="daya" label="就诊日期" width="180">
          <el-table-column
            label="就诊时间"
            align="center"
            key="createTime"
            prop="createTime"
            width="160"
          >
            <template slot-scope="scope">
              <span>{{ formatTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="administrative" label="就诊科室" width="180">
          </el-table-column>
          <el-table-column prop="doctor" label="医生"> </el-table-column>
          <el-table-column prop="result" label="疾病诊断"> </el-table-column>
          <el-table-column prop="administrative" label="检验">
          </el-table-column>
          <el-table-column prop="administrative" label="检查">
          </el-table-column>
          <el-table-column prop="administrative" label="手术">
          </el-table-column>
          <el-table-column prop="administrative" label="用药">
          </el-table-column>
          <el-table-column prop="columcz" label="医嘱" width="200">
          </el-table-column>
        </el-table>
          <el-table-column
            label="门诊号"
            align="center"
            key="patid"
            prop="patid"
          />
          <el-table-column
            label="姓名"
            align="center"
            key="patname"
            prop="patname"
          />
          <el-table-column
            label="联系电话"
            align="center"
            key="telcode"
            prop="telcode"
            width="120"
          />
          <el-table-column
            label="入院诊断"
            align="center"
            key="diagname"
            prop="diagname"
            width="190"
          />
          <el-table-column
            label="出院诊断"
            align="center"
            key="leavediagname"
            prop="leavediagname"
            width="190"
          />
          <el-table-column
            label="就诊科室"
            align="center"
            key="deptname"
            prop="deptname"
            width="120"
          />
          <el-table-column
            label="所在病区"
            align="center"
            key="leavehospitaldistrictname"
            prop="leavehospitaldistrictname"
            width="120"
          />
          <!-- <el-table-column
            label="主治医生"
            align="center"
            key="drname"
            prop="drname"
            width="120"
          />
          <el-table-column
            label="责任护士"
            align="center"
            key="nurseName"
            prop="nurseName"
            width="120"
          /> -->
        </el-table>
        <pagination
          v-show="total > 0"
          :total="total"
@@ -346,41 +450,155 @@
      </div>
      <!-- 住院 -->
      <div v-if="sonactiveName == 'inhospital'">
        <el-table :data="serviceData" style="width: 100%">
          <el-table-column prop="godaya" label="入院日期"> </el-table-column>
          <el-table-column prop="hospitalname" label="出院时间">
          </el-table-column>
          <el-table-column prop="administrative" label="病区">
          </el-table-column>
          <el-table-column prop="result" label="主治医师"> </el-table-column>
          <el-table-column prop="bed" label="管床护士"> </el-table-column>
          <el-table-column prop="doctor" label="出院疾病诊断">
          </el-table-column>
          <el-table-column prop="today" label="检验"> </el-table-column>
          <el-table-column prop="administrative" label="检查">
          </el-table-column>
          <el-table-column prop="administrative" label="手术">
          </el-table-column>
          <el-table-column prop="administrative" label="用药">
          </el-table-column>
          <el-table-column prop="columcz" label="出院小结" width="200">
          </el-table-column>
        <el-table :data="serviceDatary" style="width: 100%">
          <el-table-column
            label="住院号"
            align="center"
            key="patno"
            prop="patno"
            width="180"
          />
          <el-table-column
            label="姓名"
            align="center"
            key="patname"
            prop="patname"
          />
          <el-table-column
            label="联系电话"
            align="center"
            key="telcode"
            prop="telcode"
            width="120"
          />
          <el-table-column
            label="入院诊断"
            align="center"
            key="diagname"
            prop="diagname"
            width="190"
          />
          <el-table-column
            label="出院诊断"
            align="center"
            key="leavediagname"
            prop="leavediagname"
            width="190"
          />
          <el-table-column
            label="就诊科室"
            align="center"
            key="deptname"
            prop="deptname"
            width="120"
          />
          <el-table-column
            label="所在病区"
            align="center"
            key="leavehospitaldistrictname"
            prop="leavehospitaldistrictname"
            width="120"
          />
          <el-table-column
            label="主治医生"
            align="center"
            key="drname"
            prop="drname"
            width="120"
          />
          <el-table-column
            label="责任护士"
            align="center"
            key="nurseName"
            prop="nurseName"
            width="120"
          />
          <el-table-column
            label="床位号"
            align="center"
            key="bedNo"
            prop="bedNo"
            width="120"
          />
        </el-table>
      </div>
      <!-- 体检 -->
      <!-- 出院 -->
      <div v-if="sonactiveName == 'checkout'">
        <el-table :data="serviceData" style="width: 100%">
          <el-table-column prop="godaya" label="体检类型"> </el-table-column>
          <el-table-column prop="hospitalname" label="体检套餐名称">
          </el-table-column>
          <el-table-column prop="result" label="体检预约日期">
          </el-table-column>
          <el-table-column prop="administrative" label="体检项目">
          </el-table-column>
          <el-table-column prop="administrative" label="体检报告日">
          </el-table-column>
          <el-table-column prop="administrative" label="体检总检报告">
          </el-table-column>
        <el-table :data="serviceDatacy" style="width: 100%">
          <el-table-column
            label="住院号"
            align="center"
            key="patno"
            prop="patno"
            width="120"
          />
          <el-table-column
            label="姓名"
            align="center"
            key="patname"
            prop="patname"
          />
          <el-table-column
            label="联系电话"
            align="center"
            key="telcode"
            prop="telcode"
            width="120"
          />
          <el-table-column
            label="入院诊断"
            align="center"
            key="diagname"
            prop="diagname"
            width="190"
          />
          <el-table-column
            label="出院诊断"
            align="center"
            key="leavediagname"
            prop="leavediagname"
            width="190"
          />
          <el-table-column
            label="就诊科室"
            align="center"
            key="deptname"
            prop="deptname"
            width="120"
          />
          <el-table-column
            label="所在病区"
            align="center"
            key="leavehospitaldistrictname"
            prop="leavehospitaldistrictname"
            width="120"
          />
          <el-table-column
            label="主治医生"
            align="center"
            key="drname"
            prop="drname"
            width="120"
          />
          <el-table-column
            label="责任护士"
            align="center"
            key="nurseName"
            prop="nurseName"
            width="120"
          />
          <el-table-column
            label="床位号"
            align="center"
            key="bedNo"
            prop="bedNo"
            width="120"
          />
        </el-table>
      </div>
    </div>
@@ -401,23 +619,38 @@
              border-left: 4px solid rgb(190, 65, 134);
            "
          >
            {{ item.name }}
            <span v-if="item.serviceType == 2">出院随访</span>
            <span v-if="item.serviceType == 1">监测评估</span>
            <span v-if="item.serviceType == 3">门诊随访</span>
            <span v-if="item.serviceType == 4">宣教关怀</span>
          </div>
          <el-divider></el-divider>
          <div style="margin-top: 10px">
            随访状态:已终止<span style="color: #2775b6"
              >(终止原因:患者痊愈回访结束,终止时间:2023-12-18 12:00)</span
            >
            服务名称:<span style="color: #2775b6">{{
              item.templatename
            }}</span>
          </div>
          <div style="margin-top: 10px">
            随访发送时间:<span style="color: #2775b6">2023-11-23 12:00</span>
            创建时间:<span style="color: #2775b6">{{ item.createTime }}</span>
          </div>
          <div style="margin-top: 10px">
            随访完成时间:<span style="color: #2775b6">2023-12-18 12:00</span>
            完成时间:<span style="color: #2775b6">{{ item.finishtime }}</span>
          </div>
          <div style="margin-top: 10px">
            疼痛程度:<span style="color: #2775b6">中度</span>
            <el-row :gutter="20">
              <el-col :span="12"
                >科室:
                <span style="color: #2775b6">{{ item.deptname }}</span></el-col
              >
              <el-col :span="12"
                >病区:
                <span style="color: #2775b6">{{
                  item.leavehospitaldistrictname
                }}</span></el-col
              >
            </el-row>
          </div>
          <div
            style="
              font-size: 20px;
@@ -426,35 +659,39 @@
              border-left: 4px solid rgb(65, 161, 190);
            "
          >
            人工随访记录
            人工记录
          </div>
          <div style="margin-top: 10px">
            <el-row :gutter="20">
              <el-col :span="6"
                >随访日期:
                <span style="color: #2775b6">2023-11-22 11:22</span></el-col
                >负责人:
                <span style="color: #2775b6">{{ item.createBy }}</span></el-col
              >
              <el-col :span="6"
                >随访人: <span style="color: #2775b6">吴小龙</span></el-col
                >主治医生:
                <span style="color: #2775b6">{{ item.drname }}</span></el-col
              >
              <el-col :span="6"
                >患者配合度: <span style="color: #2775b6">高</span></el-col
                >责任护士
                <span style="color: #2775b6">{{ item.nurseName }}</span></el-col
              >
            </el-row>
          </div>
          <div style="margin-top: 10px">
            随访结果: <span style="color: #2775b6">患者痊愈,身体倍棒</span>
            结果状态:
            <span style="color: #2775b6" v-if="item.excep == 0">服务正常</span>
            <span style="color: #b55e54" v-if="item.excep == 1">异常</span>
          </div>
          <div style="margin-top: 10px">
            随访备注: <span style="color: #2775b6">提醒注意饮食健康</span>
          </div>
          <!-- <div style="margin-top: 10px">
            备注:
            <span style="color: #2775b6">提醒注意饮食健康</span>
          </div> -->
        </el-card>
      </div>
    </div>
    <!-- 健康监测 -->
    <div class="medical-record" v-show="activeName == 'monitor'">
      <!-- 血压图标 -->
      <div v-show="sontwoactiveName == 'blood'" style="display: flex">
      <!-- <div v-show="sontwoactiveName == 'blood'" style="display: flex">
        <div
          id="xyeCharts"
          class="sontwoactiveName"
@@ -470,9 +707,8 @@
            />
          </el-card>
        </div>
      </div>
      <!-- 血糖 -->
      <div v-show="sontwoactiveName == 'glucose'" style="display: flex">
      </div> -->
      <!-- <div v-show="sontwoactiveName == 'glucose'" style="display: flex">
        <div
          id="xteCharts"
          class="sontwoactiveName"
@@ -488,8 +724,7 @@
            />
          </el-card>
        </div>
      </div>
      <!-- 体重 -->
      </div> -->
      <div v-show="sontwoactiveName == 'weight'" style="display: flex">
        <div
          id="tzeCharts"
@@ -498,17 +733,20 @@
        ></div>
        <div style="width: 400px">
          <el-card class="box-card">
            <el-button @click="borninfoVisible = true" type="success" round
              >添加数据</el-button
            >
            <SFtable
              :currentList="tableDatalist"
              :currentList="borninfooptions"
              :tableLabel="tableLabeltz"
              :serialnumber="false"
              :center="false"
              :multiplechoice="false"
            />
          </el-card>
        </div>
      </div>
      <!-- 心率 -->
      <div v-show="sontwoactiveName == 'heartrate'" style="display: flex">
      <!-- <div v-show="sontwoactiveName == 'heartrate'" style="display: flex">
        <div
          id="xleCharts"
          class="sontwoactiveName"
@@ -524,9 +762,8 @@
            />
          </el-card>
        </div>
      </div>
      <!-- 血氧 -->
      <div v-show="sontwoactiveName == 'bloodoxygen'" style="display: flex">
      </div> -->
      <!-- <div v-show="sontwoactiveName == 'bloodoxygen'" style="display: flex">
        <div
          id="xueyangeCharts"
          class="sontwoactiveName"
@@ -542,9 +779,8 @@
            />
          </el-card>
        </div>
      </div>
      <!-- 体温 -->
      <div v-show="sontwoactiveName == 'animalheat'" style="display: flex">
      </div> -->
      <!-- <div v-show="sontwoactiveName == 'animalheat'" style="display: flex">
        <div
          id="tweCharts"
          class="sontwoactiveName"
@@ -560,24 +796,66 @@
            />
          </el-card>
        </div>
      </div>
      </div> -->
    </div>
    <el-dialog title="新增联系方式" :visible.sync="AddanumberVisible">
    <el-dialog :title="titletb" :visible.sync="AddanumberVisible">
      <el-form :model="numberform" label-width="100px">
        <el-form-item label="姓名">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.contactname"></el-input>
        </el-form-item>
        <el-form-item label="联系电话">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.telcode"></el-input>
        </el-form-item>
        <el-form-item label="关系">
          <el-input v-model="numberform.name"></el-input>
          <el-input v-model="numberform.relation"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="AddanumberVisible = false">取 消</el-button>
        <el-button type="primary" @click="Addanumber">确 定</el-button>
        <el-button type="primary" @click="archivecontact">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="新生儿数据新增" :visible.sync="borninfoVisible">
      <el-form
        :rules="borninforules"
        ref="borninfoform"
        :model="borninfoform"
        label-width="120px"
      >
        <!-- 身高 -->
        <el-form-item label="身高(cm)" prop="height">
          <el-input
            v-model.number="borninfoform.height"
            autocomplete="off"
            placeholder="请输入身高(30-120cm)"
          >
          </el-input>
        </el-form-item>
        <!-- 头围 -->
        <el-form-item label="头围(cm)" prop="headCir">
          <el-input
            v-model.number="borninfoform.headCir"
            autocomplete="off"
            placeholder="请输入头围(20-60cm)"
          >
          </el-input>
        </el-form-item>
        <!-- 胎龄 -->
        <el-form-item label="胎龄(周)" prop="age">
          <el-input
            v-model.number="borninfoform.age"
            autocomplete="off"
            placeholder="请输入胎龄"
          >
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="borninfoVisible = false">取 消</el-button>
        <el-button type="primary" @click="newborninfoadd">确 定</el-button>
      </div>
    </el-dialog>
  </div>
@@ -589,16 +867,35 @@
import resetPwd from "./resetPwd";
import * as echarts from "echarts";
import SFtable from "@/components/SFtable"; //表格组件
import { listtag } from "@/api/system/label";
import {
  messagelistpatient,
  addmedicalhistory,
  getmedicalhistory,
  editmedicalhistory,
  addcontactinformation,
  editcontactinformation,
  getcontactinformation,
  delcontactinformation,
  listcontactinformation,
  alterpatient,
  Patientclinic,
} from "@/api/patient/homepage";
import { getUserProfile } from "@/api/system/user";
import { listJob } from "@/api/monitor/job"; //获取列表接口待定
import { getsearchrResults, getTaskservelist } from "@/api/AiCentre/index";
import {
  listPatouthosp,
  newborninfoadd,
  newborninfolist,
} from "@/api/smartor/patouthosp";
import { listpatient } from "@/api/patient/record";
export default {
  name: "Profile",
  components: { userAvatar, userInfo, resetPwd, SFtable },
  data() {
    return {
      user: {},
      userform: {},
      roleGroup: {},
      postGroup: {},
      form: {},
@@ -609,22 +906,100 @@
      tjnumber: 12,
      yynumber: 12,
      total: 0, // 总条数
      borninfoVisible: false,
      titletb: "新增联系方式",
      activeTab: "userinfo",
      id: "",
      loading: false,
      activeName: "health", //一类导航
      sonactiveName: "outpatient", //健康监测导航
      sontwoactiveName: "blood", //医疗档案导航
      dynamicTags: ["标签一", "标签二", "标签三"],
      sonactiveName: "inhospital", //健康监测导航
      sontwoactiveName: "weight", //医疗档案导航
      dynamicTags: [],
      borninforules: {
        height: [
          { required: true, message: "身高不能为空", trigger: "blur" },
          {
            type: "number",
            message: "必须为数字值",
            trigger: "blur",
          },
          {
            validator: (rule, value, callback) => {
              // 新生儿身高一般范围:30-120cm
              if (value < 30 || value > 120) {
                callback(new Error("请输入30-120cm之间的合理身高值"));
              } else if (!/^[0-9]+(\.[0-9]{1})?$/.test(value)) {
                callback(new Error("最多保留一位小数"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],
        headCir: [
          { required: true, message: "头围不能为空", trigger: "blur" },
          { type: "number", message: "必须为数字值" },
          {
            validator: (rule, value, callback) => {
              // 新生儿头围一般范围:20-60cm
              if (value < 20 || value > 60) {
                callback(new Error("请输入20-60cm之间的合理头围值"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],
        age: [
          { required: true, message: "胎龄不能为空", trigger: "blur" },
          { type: "integer", message: "必须为整数周数" },
          {
            validator: (rule, value, callback) => {
              // 检查是否已存在该周数数据
              if (this.checkAgeExists(value)) {
                callback(new Error("该周数数据已存在,请勿重复添加"));
              } else {
                callback();
              }
            },
            trigger: "blur",
          },
        ],
      },
      record: [
        {
          name: "宣教任务",
          serviceType: "4",
          templatename: "管饲宣教一期",
          createTime: "2024-11-10",
          finishtime: "2024-11-12",
          createBy: "王政",
          drname: "刘明",
          nurseName: "张淑琴",
          excep: "0",
          deptname: "呼吸科",
          leavehospitaldistrictname: "五病区",
        },
        {
          name: "通知任务",
          name: "随访任务",
          serviceType: "2",
          templatename: "心血管随访一期",
          createTime: "2024-11-11",
          finishtime: "2024-11-14",
          createBy: "章程",
          drname: "刘明",
          nurseName: "李丽",
          excep: "0",
          deptname: "呼吸科",
          leavehospitaldistrictname: "五病区",
        },
        {
          name: "问卷调查",
        },
        // {
        //   name: "问卷调查",
        // },
      ],
      borninfoform: {},
      inputVisible: false,
      AddanumberVisible: false,
      inputValue: "",
@@ -640,28 +1015,7 @@
      echartdom: {},
      xtechartdom: {},
      tzechartdom: {},
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      tableData: [],
      tableDatalist: [
        {
          id: 12,
@@ -682,15 +1036,9 @@
          address: "89",
        },
      ],
      serviceData: [
        {
          daya: "2023-12-12",
          hospitalname: "协和",
          result: "韧带拉伤",
          administrative: "骨科",
          doctor: "吴大龙",
        },
      ],
      serviceData: [],
      serviceDatary: [],
      serviceDatacy: [],
      options: [
        {
          value: "1",
@@ -709,6 +1057,7 @@
          label: "体检",
        },
      ],
      borninfooptions: [],
      tableLabelxy: [
        { label: "测量时间", width: "", prop: "name" },
        { label: "收缩压", width: "", prop: "sex" },
@@ -720,10 +1069,9 @@
        { label: "舒张压", width: "", prop: "age" },
      ],
      tableLabeltz: [
        { label: "测量时间", width: "", prop: "name" },
        { label: "身高", width: "", prop: "sex" },
        { label: "体重", width: "", prop: "age" },
        { label: "BMI指数", width: "", prop: "update_by" },
        { label: "责任医生", width: "", prop: "doctor" },
        { label: "身高", width: "", prop: "height" },
        { label: "头围", width: "", prop: "headCir" },
      ],
      tableLabelxl: [
        { label: "测量时间", width: "", prop: "name" },
@@ -737,59 +1085,365 @@
        { label: "测量时间", width: "", prop: "name" },
        { label: "体温", width: "", prop: "sex" },
      ],
      // 表单校验
      rules: {
        name: [
          { required: true, message: "用户名称不能为空", trigger: "blur" },
          {
            min: 2,
            max: 20,
            message: "用户名称长度必须介于 2 和 20 之间",
            trigger: "blur",
          },
        ],
        sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
        age: [{ required: true, message: "年龄不能为空", trigger: "blur" }],
        nation: [{ required: true, message: "民族不能为空", trigger: "blur" }],
        telcode: [
          { required: true, message: "联系方式不能为空", trigger: "blur" },
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur",
          },
        ],
        idcardtype: [
          { required: true, message: "证件类型不能为空", trigger: "blur" },
        ],
        idcardno: [
          { required: true, message: "证件号能为空", trigger: "blur" },
        ],
        placeOfResidence: [
          { required: true, message: "居住地不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.$nextTick(function () {
      this.echartdom = document.getElementById("xyeCharts");
      this.xtechartdom = document.getElementById("xteCharts");
      this.tzechartdom = document.getElementById("tzeCharts");
      this.xlechartdom = document.getElementById("xleCharts");
      this.xueyangechartdom = document.getElementById("xueyangeCharts");
      this.twechartdom = document.getElementById("tweCharts");
      this.echartsInit();
      this.xtechartsInit();
      this.tzechartsInit();
      this.xlechartsInit();
      this.xueyangechartsInit();
      this.twechartsInit();
    });
    this.getList();
    this.id = this.$route.query.id;
    this.getuserinfo();
    this.gettabList();
  },
  methods() {},
  methods: {
    // 查询列表
    getList() {
    // 查询医疗档案各列表信息
    getList(type) {
      this.loading = true;
      listJob(this.queryParams).then((response) => {
        this.jobList = 1;
        this.total = 1;
        this.loading = false;
      if (type == 0) {
        // 门诊记录
        listPatouthosp({ patid: this.id }).then((response) => {
          if (response.code == 200) {
            // this.serviceData = response.rows;
            this.serviceData = [];
          }
        });
      } else if (type == 1) {
        listpatient({ patid: this.id, cry: 0 }).then((response) => {
          if (response.code == 200) {
            this.serviceDatary = response.rows;
          }
        });
      } else if (type == 2) {
        listpatient({ patid: this.id, cry: 1 }).then((response) => {
          if (response.code == 200) {
            this.serviceDatacy = response.rows;
            console.log(this.serviceDatacy);
            this.$forceUpdate();
          }
        });
      }
    },
    checkAgeExists(newAge) {
      // 假设已有数据存储在 this.existingData 中
      return this.borninfooptions.some((item) => item.age === parseInt(newAge));
    },
    getcontactlist() {
      listcontactinformation({ patid: this.id }).then((response) => {
        this.tableData = response.rows;
      });
    },
    processElement(element) {
      return { ...element, isoperation: null };
    },
    // 获取基础信息
    getuserinfo() {
      const queryParams = {
        pid: Number(this.id),
        allhosp: "0",
        pageNum: 1,
      };
      // 患者基础信息
      messagelistpatient(queryParams).then((response) => {
        this.userform = response.rows[0];
        // this.dynamicTags = response.rows[0].tagList;
        this.dynamicTags = response.rows[0].tagList.map(this.processElement);
        console.log(this.dynamicTags);
      });
      // 病史信息
      getmedicalhistory({ pid: this.id }).then((res) => {
        if (res.code == 200 && res.rows[0]) {
          this.form = res.rows[0];
        }
      });
      // 联系信息
      this.getcontactlist();
    },
    // 保存患者档案
    savefile() {
      this.$refs["userform"].validate((valid) => {
        if (valid) {
          this.userform.isoperation = 2;
          this.userform.tagList = this.dynamicTags;
          alterpatient(this.userform).then((res) => {
            if (res.code == 200) {
              this.$modal.msgSuccess("基础信息保存成功");
            } else {
              this.$modal.msgError("基础信息修改失败");
            }
          });
          // 病史
          this.medicalhistory();
        }
      });
    },
    // 病史
    medicalhistory() {
      if (this.form.id) {
        editmedicalhistory(this.form).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("病史保存成功");
          } else {
            this.$modal.msgError("病史修改失败");
          }
        });
      } else {
        this.form.pid = this.id;
        addmedicalhistory(this.form).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("病史保存成功");
          } else {
            this.$modal.msgError("病史修改失败");
          }
        });
      }
    },
    // 联系方式---------------
    archivecontact() {
      if (this.numberform.id) {
        editcontactinformation(this.numberform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("联系方式修改成功");
            this.getcontactlist();
            this.AddanumberVisible = false;
          } else {
            this.$modal.msgError("联系方式修改失败");
          }
        });
      } else {
        this.numberform.patid = this.id;
        addcontactinformation(this.numberform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("联系方式新增成功");
            this.getcontactlist();
            this.AddanumberVisible = false;
          } else {
            this.$modal.msgError("联系方式新增失败");
          }
        });
      }
      this.numberform = {};
    },
    deltb(row) {
      this.$modal
        .confirm("是否确认删除该数据项?")
        .then(() => {
          if (row.id) {
            delcontactinformation(row.id).then((res) => {
              if (res.code == 200) {
                this.$modal.msgSuccess("联系方式删除成功");
                this.getcontactlist();
              } else {
                this.$modal.msgError("联系方式删除失败");
              }
            });
          } else {
            let index = this.tableData.indexOf(obj);
            this.tableData.splice(index, 1);
          }
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    addcompiletb() {
      this.titletb = "新增联系方式";
      this.AddanumberVisible = true;
    },
    compiletb(row) {
      this.numberform = row;
      this.titletb = "修改联系方式";
      this.AddanumberVisible = true;
    },
    defaulttb(row) {
      this.$modal
        .confirm("是否确认设置该数据项为默认联系人?")
        .then(() => {
          this.tableData.forEach((obj, index) => {
            if (obj === row) {
              obj.isdefault = 1;
              this.numberform = obj;
              this.archivecontact();
            } else if (obj.isdefault == 1) {
              obj.isdefault = 0;
              this.numberform = obj;
              this.archivecontact();
            } else {
              obj.isdefault = 0;
            }
          });
          this.$modal.msgSuccess("设置成功");
        })
        .catch(() => {});
    },
    tableRowClassName({ row, rowIndex }) {
      if (row.isdefault == "1") {
        return "warning-row";
      }
      return "";
    },
    // tab切换
    handleClick(tab, event) {
      console.log(tab, event);
      if (tab.index == "1") {
        this.getList(1);
      } else if (tab.index == "2") {
        this.newbornList();
      } else if (tab.index == "3") {
        this.handleClickfw();
      }
    },
    handleClickson(tab, event) {
      console.log(tab, "son");
      this.getList(tab.index);
    },
    // 查询服务记录
    handleClickfw() {
      getTaskservelist({
        patid: this.id,
      }).then((res) => {
        if (res.code == 200) {
          this.record = res.rows[0].serviceSubtaskList;
        }
      });
    },
    // 联系方式新增
    Addanumber() {},
    // 标签--------------------------
    /** 查询标签列表 */
    gettabList() {
      const tagqueryParams = {
        pageNum: 1,
        pageSize: 10000,
        tagcategoryid: "0",
      };
      listtag(tagqueryParams).then((response) => {
        this.options = response.rows;
        console.log(this.options, "标签");
      });
    },
    newcharts() {
      this.$nextTick(function () {
        // this.echartdom = document.getElementById("xyeCharts");
        // this.xtechartdom = document.getElementById("xteCharts");
        this.tzechartdom = document.getElementById("tzeCharts");
        // this.xlechartdom = document.getElementById("xleCharts");
        // this.xueyangechartdom = document.getElementById("xueyangeCharts");
        // this.twechartdom = document.getElementById("tweCharts");
        // this.echartsInit();
        // this.xtechartsInit();
        this.tzechartsInit();
        // this.xlechartsInit();
        // this.xueyangechartsInit();
        // this.twechartsInit();
      });
    },
    // 保存指标数据
    newborninfoadd() {
      this.$refs["borninfoform"].validate((valid) => {
        if (valid) {
          this.borninfoform.patId = this.id;
          newborninfoadd(this.borninfoform).then((res) => {
            if (res.code == 200) {
              this.$modal.msgSuccess("新增成功");
              this.newbornList();
              this.borninfoVisible = false;
            } else {
              this.$modal.msgError("新增失败");
              this.newbornList();
              this.borninfoVisible = false;
            }
          });
        }
      });
    },
    remoteMethod(value) {
      console.log("触发");
      const illnessqueryParams = {
        pageNum: 1,
        pageSize: 100,
        tagname: value,
        tagcategoryid: "0",
      };
      this.loading = true;
      setTimeout(() => {
        this.loading = false;
        listtag(illnessqueryParams).then((response) => {
          this.options = response.rows;
        });
      }, 200);
    },
    handleClose(tag) {
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      const lindex = this.dynamicTags.indexOf(tag);
      // this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      this.dynamicTags[lindex].isoperation = 3;
    },
    showInput() {
      this.inputVisible = true;
      this.$nextTick((_) => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
      console.log("展示");
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      let tagvalue = {};
      let tagname = this.inputValue;
      if (tagname) {
        listtag({
          pageNum: 1,
          pageSize: 1000,
          tagcategoryid: "0",
          tagname: tagname,
        }).then((res) => {
          if (res.rows[0]) {
            tagvalue = res.rows[0];
            tagvalue.isoperation = 1;
          } else {
            tagvalue = {
              tagname: tagname,
              isoperation: 1,
            };
          }
          console.log(tagvalue);
          // this.userform.tagList.push(tagvalue);
          this.dynamicTags.push(tagvalue);
          console.log(this.userform.tagList);
          console.log(this.dynamicTags);
        });
      }
      console.log("关了");
      this.inputVisible = false;
      this.inputValue = "";
    },
@@ -870,10 +1524,8 @@
    // 血糖图表
    xtechartsInit() {
      // 基于准备好的dom,初始化echarts实例
      // console.log(echarts);
      console.log(this.xtechartdom);
      var myxyChart = echarts.init(this.xtechartdom);
      console.log(myxyChart);
      const data = [
        ["2000-06-05", 116],
        ["2000-06-06", 129],
@@ -964,74 +1616,184 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
    // 体重图表
    tzechartsInit() {
      // 基于准备好的dom,初始化echarts实例
      console.log(echarts);
      console.log(this.tzechartdom);
      var myxyChart = echarts.init(this.tzechartdom);
      var option = {
        title: {
          text: "体重指标图",
        },
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["身高", "体重", "BMI指数"],
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        toolbox: {
          feature: {
            saveAsImage: {},
          },
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: "身高",
            type: "line",
            stack: "Total",
            data: [120, 132, 101, 134, 90, 230, 210],
          },
          {
            name: "体重",
            type: "line",
            stack: "Total",
            data: [220, 182, 191, 234, 290, 330, 310],
          },
      // 获取数据集合
      this.newbornList()
        .then(() => {
          // 检查数据有效性
          if (!this.borninfooptions || this.borninfooptions.length === 0) {
            console.warn("没有可用的新生儿数据");
            return;
          }
          // 找出最大的age值(确定X轴范围)
          const maxAge = Math.max(
            ...this.borninfooptions.map((item) => parseInt(item.age) || 0)
          );
          if (maxAge <= 0) {
            console.error("无效的周数数据");
            return;
          }
          {
            name: "BMI指数",
            type: "line",
            stack: "Total",
            data: [320, 332, 301, 334, 390, 330, 320],
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
          // 动态生成xAxis数据(从1周到最大周)
          const xAxisData = Array.from(
            { length: maxAge },
            (_, i) => `${i + 1}周`
          );
          // 初始化数据数组
          const heightData = Array(maxAge).fill(null);
          const headCirData = Array(maxAge).fill(null);
          // 遍历所有数据点,填充到对应位置
          this.borninfooptions.forEach((item) => {
            try {
              const age = parseInt(item.age);
              const height = parseFloat(item.height);
              const headCir = parseFloat(item.headCir);
              // 确保数据有效且周数在范围内
              if (age > 0 && age <= maxAge) {
                const weekIndex = age - 1;
                if (!isNaN(height)) heightData[weekIndex] = height;
                if (!isNaN(headCir)) headCirData[weekIndex] = headCir;
              }
            } catch (e) {
              console.error("数据处理错误:", e);
            }
          });
          // 获取患者姓名(使用第一条有效数据)
          const patientName = this.borninfooptions[0]?.name || "未知";
          // 初始化图表
          const myxyChart = echarts.init(this.tzechartdom);
          const option = {
            title: {
              text: `${patientName}生长发育指标图`,
              left: "center",
            },
            tooltip: {
              trigger: "axis",
              formatter: function (params) {
                let result = params[0].axisValue + "<br/>";
                params.forEach((item) => {
                  const value = item.value !== null ? item.value : "暂无数据";
                  result += `${item.marker} ${item.seriesName}: ${value}<br/>`;
                });
                return result;
              },
            },
            legend: {
              data: ["身高(cm)", "头围(cm)"],
              bottom: 10,
            },
            grid: {
              left: "3%",
              right: "4%",
              bottom: "15%", // 为图例留出空间
              containLabel: true,
            },
            toolbox: {
              feature: {
                saveAsImage: {
                  title: "保存图片",
                  pixelRatio: 2,
                },
                dataView: {
                  title: "数据视图",
                  readOnly: true,
                },
              },
              right: 20,
            },
            xAxis: {
              type: "category",
              boundaryGap: false,
              data: xAxisData,
              axisLabel: {
                interval: 0, // 显示所有标签
                rotate: 30, // 标签旋转防止重叠
              },
            },
            yAxis: {
              type: "value",
              axisLabel: {
                formatter: "{value} cm",
              },
            },
            series: [
              {
                name: "身高",
                type: "line",
                data: heightData,
                symbol: "circle",
                symbolSize: 8,
                itemStyle: {
                  color: "#5470C6",
                },
                lineStyle: {
                  width: 3,
                },
                connectNulls: true, // 连接空值
              },
              {
                name: "头围",
                type: "line",
                data: headCirData,
                symbol: "circle",
                symbolSize: 8,
                itemStyle: {
                  color: "#91CC75",
                },
                lineStyle: {
                  width: 3,
                },
                connectNulls: true, // 连接空值
              },
            ],
            animationDuration: 1000, // 动画时长
          };
          // 使用配置项显示图表
          myxyChart.setOption(option);
          // 窗口大小变化时重新调整图表大小
          const resizeHandler = () => myxyChart.resize();
          window.addEventListener("resize", resizeHandler);
          // 在组件销毁时移除事件监听(如果是Vue/React组件)
          this.$once("hook:beforeDestroy", () => {
            window.removeEventListener("resize", resizeHandler);
            myxyChart.dispose();
          });
        })
        .catch((error) => {
          console.error("加载数据失败:", error);
        });
    },
    // 获取新生儿数据
    newbornList() {
      return newborninfolist({ patId: this.id })
        .then((response) => {
          this.borninfooptions = response.rows || [];
          this.newcharts();
          console.log("加载的新生儿数据:", this.borninfooptions);
          return Promise.resolve();
        })
        .catch((error) => {
          console.error("请求数据失败:", error);
          this.borninfooptions = [];
          return Promise.reject(error);
        });
    },
    // 心率
    xlechartsInit() {
      var myxyChart = echarts.init(this.xlechartdom);
      console.log(myxyChart);
      const data = [
        ["2000-06-05", 116],
        ["2000-06-06", 129],
@@ -1104,7 +1866,6 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1176,14 +1937,13 @@
                },
                {
                  offset: 1,
                  color: "#c4d7d6"
                  color: "#c4d7d6",
                },
              ]),
            },
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1195,12 +1955,12 @@
        ["2000-06-05", 36.8],
        ["2000-06-06", 36.2],
        ["2000-06-07", 37.8],
        ["2000-06-08",37.8],
        ["2000-06-09",37.2],
        ["2000-06-10",36.2],
        ["2000-06-11",37.8],
        ["2000-06-12",36.9],
        ["2000-06-13",36.8],
        ["2000-06-08", 37.8],
        ["2000-06-09", 37.2],
        ["2000-06-10", 36.2],
        ["2000-06-11", 37.8],
        ["2000-06-12", 36.9],
        ["2000-06-13", 36.8],
        ["2000-06-14", 36.4],
        ["2000-06-15", 37.1],
        ["2000-06-16", 36.9],
@@ -1210,7 +1970,7 @@
        ["2000-06-20", 36.6],
        ["2000-06-21", 36.8],
        ["2000-06-22", 36.2],
        ["2000-06-23",37.8],
        ["2000-06-23", 37.8],
      ];
      const dateList = data.map(function (item) {
        return item[0];
@@ -1231,7 +1991,7 @@
            max: 400,
          },
        ],
        tooltip: {
          trigger: "axis",
        },
@@ -1249,7 +2009,6 @@
          },
        ],
      };
      console.log("ss");
      // 使用刚指定的配置项和数据显示图表。
      myxyChart.setOption(option);
    },
@@ -1261,7 +2020,7 @@
.personages {
  height: 88px;
  width: 100%;
  background-color: #2486b9;
  background-color: #5e86f9;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 10px;
@@ -1290,7 +2049,7 @@
}
.xinz-inf {
  font-size: 18px;
  white-space: nowrap;
  // white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
@@ -1351,6 +2110,15 @@
    margin-bottom: 10px;
    border-left: 8px solid rgb(65, 161, 190);
  }
  .headlines {
    font-size: 25px;
    display: flex;
    width: 88%;
    justify-content: space-between;
    padding-left: 5px;
    margin-bottom: 10px;
    border-left: 8px solid rgb(65, 161, 190);
  }
  .bottom-message {
    margin-bottom: 25px;
    margin-left: 100px;
@@ -1376,7 +2144,7 @@
.sontwoactiveName {
  margin: 0 auto;
}
// .columcz {
//   align-items: center!important;
// }
::v-deep.el-table .warning-row {
  background: oldlace;
}
</style>