WXL (wul)
3 天以前 a78c4c8208a4a05dd54781443c08336f142a2dd6
src/views/sfstatistics/percentage/index.vue
@@ -1,37 +1,6 @@
<template>
  <div class="Questionnairemanagement">
    <!-- 左侧栏 -->
    <!-- <div class="sidecolumn">
      <div class="sidecolumn-top">
        <div class="top-wj">患者范围</div>
      </div>
      <div class="bottom-fl">
        <el-tabs
          tab-position="right"
          v-model="activeName"
          @tab-click="handleClick"
        >
          <el-tab-pane label="全部" name="first"></el-tab-pane>
          <el-tab-pane label="住院" name="bhospitalized"></el-tab-pane>
          <el-tab-pane label="在院" name="Inhospital"></el-tab-pane>
          <el-tab-pane label="门诊" name="outpatient"></el-tab-pane>
          <el-tab-pane label="体检" name="physical"></el-tab-pane>
        </el-tabs>
      </div>
    </div> -->
    <!-- 右侧数据 -->
    <div class="leftvlue">
      <!-- <div class="leftvlue-top">
        <el-tabs v-model="topactiveName" @tab-click="tophandleClick">
          <el-tab-pane name="Local">
            <span class="mulsz" slot="label">按出院病区统计 </span>
          </el-tab-pane>
          <el-tab-pane name="sharing">
            <span class="mulsz" slot="label">按出院科室统计 </span>
          </el-tab-pane>
        </el-tabs>
      </div> -->
      <div class="leftvlue-bg">
        <el-row :gutter="20">
          <!--标签数据-->
@@ -44,46 +13,60 @@
              v-show="showSearch"
              label-width="98px"
            >
              <!-- <el-form-item label="医院" prop="userName">
                <el-select v-model="queryParams.value1" placeholder="请选择">
              <el-form-item label="统计类型" prop="userName">
                <el-select
                  v-model="queryParams.statisticaltype"
                  placeholder="请选择统计类型"
                >
                  <el-option
                    v-for="item in options"
                    v-for="item in Statisticallist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item> -->
              <el-form-item label="出院病区" prop="userName">
                <!-- <el-select v-model="queryParams.leavehospitaldistrictcodes" placeholder="请选择">
                  <el-option
                    v-for="item in flatArray"
                    :key="item.deptCode"
                    :label="item.label"
                    :value="item.deptCode"
                  >
                  </el-option>
                </el-select> -->
                <el-select
                  style="margin-left: 10px"
                  v-if="queryParams.statisticaltype == 1"
                  v-model="queryParams.leavehospitaldistrictcodes"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择病区"
                >
                <el-option
                    v-for="item in flatArray"
                    :key="item.deptCode"
                  <el-option
                    v-for="item in flatArrayhospit"
                    :key="item.value"
                    :label="item.label"
                    :value="item.deptCode"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
                <el-select
                  v-else-if="queryParams.statisticaltype == 2"
                  v-model="queryParams.deptcodes"
                  size="medium"
                  multiple
                  filterable
                  placeholder="请选择科室"
                >
                  <el-option
                    v-for="item in flatArraydept"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <!-- <el-form-item label="管理方案" prop="userName">
                <el-select v-model="queryParams.value3" placeholder="请选择">
              <el-form-item label="服务类型" prop="userName">
                <el-select
                  v-model="queryParams.serviceType"
                  multiple
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.value"
@@ -92,24 +75,20 @@
                  >
                  </el-option>
                </el-select>
              </el-form-item> -->
              <!-- <el-form-item label="出院日期" prop="userName">
                <el-date-picker
                  v-model="queryParams.valuetime1"
                  align="right"
                  type="date"
                  placeholder="选择日期"
                  :picker-options="pickerOptionsa"
                >
                </el-date-picker>
              </el-form-item> -->
              <el-form-item label="统计日期" prop="userName">
              </el-form-item>
              <el-form-item
                label-width="200"
                label="应随访时间范围"
                prop="userName"
              >
                <el-date-picker
                  v-model="queryParams.dateRange"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                  :default-time="['00:00:00', '23:59:59']"
                >
                </el-date-picker>
              </el-form-item>
@@ -129,312 +108,814 @@
                  >重置</el-button
                >
              </el-form-item>
              <el-button
                type="warning"
                plain
                icon="el-icon-download"
                size="medium"
                @click="exportTable"
                >导出</el-button
              >
              <el-button
                type="primary"
                plain
                icon="el-icon-data-line"
                size="medium"
                @click="showChartDialog"
                >统计趋势图</el-button
              >
            </el-form>
            <el-row :gutter="10" class="mb8">
              <el-col :span="1.5">
                <el-button
                  type="primary"
                  plain
                  icon="el-icon-plus"
                  size="medium"
                  @click="addladeltag"
                  v-hasPermi="['system:user:add']"
                  >新增</el-button
                >
              </el-col>
            <!-- 新增:Tab标签页 -->
            <el-tabs v-model="activeTab" @tab-click="handleTabClick">
              <el-tab-pane label="首次随访" name="first">
                <div class="your-table-container">
                  <el-table
                    ref="exportTable"
                    id="exportTableid"
                    v-loading="loading"
                    :data="firstFollowUpList"
                    :border="true"
                    @selection-change="handleSelectionChange"
                    @expand-change="handleRowClick"
                    :row-key="getRowKey"
                    show-summary
                    :summary-method="getSummaries"
                    :expand-row-keys="expands"
                  >
                    <!-- 展开行箭头列 -->
                    <el-table-column type="expand">
                      <template slot-scope="props">
                        <el-table
                          :data="props.row.doctorStats"
                          border
                          style="width: 95%; margin: 0 auto"
                          class="inner-table"
                          show-summary
                          :summary-method="getInnerSummaries"
                        >
                          <el-table-column
                            label="医生姓名"
                            prop="drname"
                            align="center"
                          />
                          <el-table-column
                            label="科室"
                            width="120"
                            prop="deptname"
                            align="center"
                          />
                          <el-table-column
                            label="出院人次"
                            prop="dischargeCount"
                            align="center"
                          />
                          <el-table-column
                            label="出院人次"
                            align="center"
                            key="dischargeCount"
                            prop="dischargeCount"
                          >
                          </el-table-column>
              <el-col :span="1.5">
                <el-button
                  type="danger"
                  plain
                  icon="el-icon-delete"
                  size="medium"
                  :disabled="multiple"
                  @click="handleDelete"
                  v-hasPermi="['system:user:remove']"
                  >删除</el-button
                >
              </el-col>
              <el-col :span="1.5">
                <div class="documentf">
                  <div class="document">
                    <el-button
                      type="warning"
                      plain
                      icon="el-icon-download"
                      size="medium"
                      @click="handleExport"
                      v-hasPermi="['system:user:export']"
                      >导出</el-button
                          <el-table-column
                            label="无需随访人次"
                            align="center"
                            width="100"
                            key="nonFollowUp"
                            prop="nonFollowUp"
                          >
                          </el-table-column>
                          <el-table-column
                            label="应随访人次"
                            align="center"
                            width="100"
                            key="followUpNeeded"
                            prop="followUpNeeded"
                          >
                          </el-table-column>
                          <el-table-column align="center" label="首次出院随访">
                            <el-table-column
                              label="需随访"
                              align="center"
                              key="needFollowUp"
                              prop="needFollowUp"
                            >
                            </el-table-column>
                            <el-table-column
                              label="待随访"
                              align="center"
                              key="pendingFollowUp"
                              prop="pendingFollowUp"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访成功"
                              align="center"
                              key="followUpSuccess"
                              prop="followUpSuccess"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访失败"
                              align="center"
                              key="followUpFail"
                              prop="followUpFail"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访率"
                              align="center"
                              width="120"
                              key="followUpRate"
                              prop="followUpRate"
                            >
                            </el-table-column>
                            <el-table-column
                              v-if="orgname != '丽水市中医院'"
                              label="及时率"
                              align="center"
                              width="120"
                              key="rate"
                              prop="rate"
                            >
                              <template slot-scope="scope">
                                <el-button
                                  size="medium"
                                  type="text"
                                  @click="Seedetails(scope.row)"
                                  ><span class="button-zx"
                                    >{{
                                      (Number(scope.row.rate) * 100).toFixed(2)
                                    }}%</span
                                  ></el-button
                                >
                              </template>
                            </el-table-column>
                            <el-table-column
                              label="人工"
                              align="center"
                              key="manual"
                              prop="manual"
                            >
                            </el-table-column>
                            <el-table-column
                              label="短信"
                              align="center"
                              key="sms"
                              prop="sms"
                            >
                            </el-table-column>
                            <el-table-column
                              label="微信"
                              align="center"
                              key="weChat"
                              prop="weChat"
                            >
                            </el-table-column>
                          </el-table-column>
                        </el-table>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="出院病区"
                      align="center"
                      sortable
                      key="leavehospitaldistrictname"
                      prop="leavehospitaldistrictname"
                      width="150"
                      :show-overflow-tooltip="true"
                      :sort-method="sortChineseNumber"
                    />
                    <el-table-column
                      label="科室"
                      align="center"
                      key="deptname"
                      prop="deptname"
                      :show-overflow-tooltip="true"
                    />
                    <el-table-column
                      label="出院人次"
                      align="center"
                      key="dischargeCount"
                      prop="dischargeCount"
                    >
                  </div>
                    </el-table-column>
                    <el-table-column
                      label="无需随访人次"
                      align="center"
                      width="100"
                      key="nonFollowUp"
                      prop="nonFollowUp"
                    >
                    </el-table-column>
                    <el-table-column
                      label="应随访人次"
                      align="center"
                      width="100"
                      key="followUpNeeded"
                      prop="followUpNeeded"
                    >
                    </el-table-column>
                    <el-table-column align="center" label="首次出院随访">
                      <el-table-column
                        label="需随访"
                        align="center"
                        key="needFollowUp"
                        prop="needFollowUp"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.needFollowUpInfo,
                                scope.row.leavehospitaldistrictname +
                                  '需随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.needFollowUp
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="待随访"
                        align="center"
                        key="pendingFollowUp"
                        prop="pendingFollowUp"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.pendingFollowUpInfo,
                                scope.row.leavehospitaldistrictname +
                                  '待随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.pendingFollowUp
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访成功"
                        align="center"
                        key="followUpSuccess"
                        prop="followUpSuccess"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.followUpSuccessInfo,
                                scope.row.leavehospitaldistrictname +
                                  '随访成功列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.followUpSuccess
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访失败"
                        align="center"
                        key="followUpFail"
                        prop="followUpFail"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.followUpFailInfo,
                                scope.row.leavehospitaldistrictname +
                                  '随访失败列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.followUpFail
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访率"
                        align="center"
                        width="120"
                        key="followUpRate"
                        prop="followUpRate"
                      >
                      </el-table-column>
                      <el-table-column
                        v-if="orgname != '丽水市中医院'"
                        label="及时率"
                        align="center"
                        width="120"
                        key="rate"
                        prop="rate"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="Seedetails(scope.row)"
                            ><span class="button-zx"
                              >{{
                                (Number(scope.row.rate) * 100).toFixed(2)
                              }}%</span
                            ></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="人工"
                        align="center"
                        key="manual"
                        prop="manual"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.manualInfo,
                                scope.row.leavehospitaldistrictname +
                                  '人工随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.manual
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="短信"
                        align="center"
                        key="sms"
                        prop="sms"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.smsInfo,
                                scope.row.leavehospitaldistrictname +
                                  '短信随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.sms
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="微信"
                        align="center"
                        key="weChat"
                        prop="weChat"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.weChatInfo,
                                scope.row.leavehospitaldistrictname +
                                  '微信随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.weChat
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                    </el-table-column>
                    <!-- 随访情况列(仅丽水市中医院显示) -->
                    <el-table-column
                      v-if="orgname == '丽水市中医院'"
                      align="center"
                      label="随访情况"
                    >
                      <el-table-column
                        label="正常语音"
                        align="center"
                        width="100"
                        key="taskSituation1"
                        prop="taskSituation1"
                      >
                      </el-table-column
                      ><el-table-column
                        label="患者拒接或拒访"
                        align="center"
                        width="100"
                        key="taskSituation2"
                        prop="taskSituation2"
                      >
                      </el-table-column
                      ><el-table-column
                        label="面访或者接诊"
                        align="center"
                        width="100"
                        key="taskSituation3"
                        prop="taskSituation3"
                      >
                      </el-table-column
                      ><el-table-column
                        label="微信随访"
                        align="center"
                        width="100"
                        key="taskSituation4"
                        prop="taskSituation4"
                      >
                      </el-table-column
                      ><el-table-column
                        label="随访电话不正确"
                        align="center"
                        width="100"
                        key="taskSituation5"
                        prop="taskSituation5"
                      >
                      </el-table-column
                      ><el-table-column
                        label="其他情况不宜随访"
                        align="center"
                        width="100"
                        key="taskSituation6"
                        prop="taskSituation6"
                      >
                      </el-table-column>
                    </el-table-column>
                  </el-table>
                </div>
              </el-col>
              </el-tab-pane>
              <!-- <el-col :span="1.5"> </el-col> -->
            </el-row>
            <!-- <right-toolbar
          :showSearch.sync="showSearch"
          @queryTable="getList"
          :columns="columns"
        ></right-toolbar> -->
            <el-table
              v-loading="loading"
              :data="userList"
              :border="true"
              @selection-change="handleSelectionChange"
            >
              <el-table-column type="selection" width="50" align="center" />
              <!-- <el-table-column
                fixed
                label="序号"
                align="center"
                key="tagid"
                prop="tagid"
                width="50"
              /> -->
              <el-table-column
                fixed
                label="出院病区"
                align="center"
                key="leavehospitaldistrictname"
                prop="leavehospitaldistrictname"
                width="100"
                :show-overflow-tooltip="true"
              />
              <el-table-column
                label="服务总量"
                align="center"
                key="serviceCount"
                prop="serviceCount"
              >
                <template slot-scope="scope">
                  <span
                    >{{ scope.row.updateBy }}
                    <p>{{ scope.row.serviceCount }}</p></span
              <el-tab-pane label="再次随访" name="second">
                <div class="your-table-container">
                  <el-table
                    ref="exportTableSecond"
                    id="exportTableidSecond"
                    v-loading="loadingSecond"
                    :data="secondFollowUpList"
                    :border="true"
                    @selection-change="handleSelectionChangeSecond"
                    @expand-change="handleRowClickSecond"
                    :row-key="getRowKey"
                    show-summary
                    :summary-method="getSummariesSecond"
                    :expand-row-keys="expandsSecond"
                  >
                </template>
              </el-table-column>
                    <!-- 展开行箭头列 -->
                    <el-table-column type="expand">
                      <template slot-scope="props">
                        <el-table
                          :data="props.row.doctorStats"
                          border
                          style="width: 95%; margin: 0 auto"
                          class="inner-table"
                          show-summary
                          :summary-method="getInnerSummariesSecond"
                        >
                          <el-table-column
                            label="医生姓名"
                            prop="drname"
                            align="center"
                          />
                          <el-table-column
                            label="科室"
                            width="120"
                            prop="deptname"
                            align="center"
                          />
                          <el-table-column
                            label="出院人次"
                            prop="dischargeCount"
                            align="center"
                          />
                          <el-table-column
                            label="出院人次"
                            align="center"
                            key="dischargeCount"
                            prop="dischargeCount"
                          >
                          </el-table-column>
              <el-table-column
                label="患者过滤数量"
                align="center"
                width="120"
                key="bzxCount"
                prop="bzxCount"
              >
              </el-table-column>
              <el-table-column
                label="应随访量"
                align="center"
                key="ysfCount"
                prop="ysfCount"
              >
              </el-table-column
              ><el-table-column
                label="发送失败"
                align="center"
                key="fssbCount"
                prop="fssbCount"
              >
              </el-table-column
              ><el-table-column
                label="待发送"
                align="center"
                key="dfsCount"
                prop="dfsCount"
              >
              </el-table-column
              ><el-table-column
                label="已发送"
                align="center"
                key="yfsCount"
                prop="yfsCount"
              >
              </el-table-column>
              <el-table-column
                label="已完成"
                align="center"
                key="ywcCount"
                prop="ywcCount"
              >
              </el-table-column>
              <el-table-column
                label="随访完成率"
                align="center"
                width="120"
                key="sfwcl"
                prop="sfwcl"
              >
              <template slot-scope="scope">
                  <span>{{ Number(scope.row.sfwcl)*100 }}%</span>
                </template>
              </el-table-column>
              <!-- <el-table-column
                label="公众号发送次数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="公众号随访完成数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="公众号随访完成率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column> -->
              <el-table-column
                label="短信发送次数"
                align="center"
                width="120"
                key="dxfscs"
                prop="dxfscs"
              >
              </el-table-column>
              <el-table-column
                label="短信随访完成数"
                align="center"
                width="120"
                key="dxsfwccs"
                prop="dxsfwccs"
              >
              </el-table-column>
              <el-table-column
                label="短信随访完成率"
                align="center"
                width="120"
                key="dxsfwcl"
                prop="dxsfwcl"
              >
              </el-table-column>
              <!-- <el-table-column
                label="人工随访次数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="人工随访完成数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="人工随访完成率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column> -->
              <!-- <el-table-column
                label="失访数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="失访率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="失访率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              > -->
              <!-- </el-table-column> -->
              <el-table-column
                label="异常总数"
                align="center"
                key="yczs"
                prop="yczs"
              >
                <template slot-scope="scope">
                  <el-button
                    size="medium"
                    type="danger"
                    plain
                    @click="routerErr(scope.row)"
                    ><span class="button-zx"
                      >{{scope.row.yczs}}</span
                    ></el-button
                  >
                </template>
              </el-table-column>
              <!-- <el-table-column
                label="总异常率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column> -->
              <el-table-column
                label="回复异常数"
                align="center"
                width="100"
                key="hfycs"
                prop="hfycs"
              >
              </el-table-column>
              <!-- <el-table-column
                label="回复异常及时处理数"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column>
              <el-table-column
                label="回复异常及时处理率"
                align="center"
                key="tagdescription"
                prop="tagdescription"
              >
              </el-table-column> -->
                          <el-table-column
                            label="无需随访人次"
                            align="center"
                            width="100"
                            key="nonFollowUp"
                            prop="nonFollowUp"
                          >
                          </el-table-column>
                          <el-table-column
                            label="应随访人次"
                            align="center"
                            width="100"
                            key="followUpNeeded"
                            prop="followUpNeeded"
                          >
                          </el-table-column>
                          <el-table-column align="center" label="再次出院随访">
                            <el-table-column
                              label="需随访"
                              align="center"
                              key="needFollowUpAgain"
                              prop="needFollowUpAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="待随访"
                              align="center"
                              key="pendingFollowUpAgain"
                              prop="pendingFollowUpAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访成功"
                              align="center"
                              key="followUpSuccessAgain"
                              prop="followUpSuccessAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访失败"
                              align="center"
                              key="followUpFailAgain"
                              prop="followUpFailAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="随访率"
                              align="center"
                              width="120"
                              key="followUpRateAgain"
                              prop="followUpRateAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="人工"
                              align="center"
                              key="manualAgain"
                              prop="manualAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="短信"
                              align="center"
                              key="smsAgain"
                              prop="smsAgain"
                            >
                            </el-table-column>
                            <el-table-column
                              label="微信"
                              align="center"
                              key="weChatAgain"
                              prop="weChatAgain"
                            >
                            </el-table-column>
                          </el-table-column>
                        </el-table>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="出院病区"
                      align="center"
                      sortable
                      key="leavehospitaldistrictname"
                      prop="leavehospitaldistrictname"
                      width="150"
                      :show-overflow-tooltip="true"
                      :sort-method="sortChineseNumber"
                    />
                    <el-table-column
                      label="科室"
                      align="center"
                      key="deptname"
                      prop="deptname"
                      :show-overflow-tooltip="true"
                    />
                    <el-table-column
                      label="出院人次"
                      align="center"
                      key="dischargeCount"
                      prop="dischargeCount"
                    >
                    </el-table-column>
              <!-- <el-table-column
                label="操作"
                align="center"
                width="300"
                class-name="small-padding fixed-width"
              >
                <template slot-scope="scope">
                  <el-button
                    size="medium"
                    type="text"
                    @click="handleUpdate(scope.row)"
                    v-hasPermi="['system:user:edit']"
                    ><span class="button-textxg"
                      ><i class="el-icon-edit"></i>修改</span
                    ></el-button
                  >
                  <el-button
                    size="medium"
                    type="text"
                    @click="handleDelete(scope.row)"
                    v-hasPermi="['system:user:remove']"
                    ><span class="button-textsc"
                      ><i class="el-icon-delete"></i>删除</span
                    ></el-button
                  >
                </template>
              </el-table-column> -->
            </el-table>
                    <el-table-column
                      label="无需随访人次"
                      align="center"
                      width="100"
                      key="nonFollowUp"
                      prop="nonFollowUp"
                    >
                    </el-table-column>
                    <el-table-column
                      label="应随访人次"
                      align="center"
                      width="100"
                      key="followUpNeeded"
                      prop="followUpNeeded"
                    >
                    </el-table-column>
                    <el-table-column align="center" label="再次出院随访">
                      <el-table-column
                        label="需随访"
                        align="center"
                        key="needFollowUpAgain"
                        prop="needFollowUpAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.needFollowUpAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访需随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.needFollowUpAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="待随访"
                        align="center"
                        key="pendingFollowUpAgain"
                        prop="pendingFollowUpAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.pendingFollowUpAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访待随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.pendingFollowUpAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访成功"
                        align="center"
                        key="followUpSuccessAgain"
                        prop="followUpSuccessAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.followUpSuccessAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访随访成功列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.followUpSuccessAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访失败"
                        align="center"
                        key="followUpFailAgain"
                        prop="followUpFailAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.followUpFailAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访随访失败列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.followUpFailAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="随访率"
                        align="center"
                        width="120"
                        key="followUpRateAgain"
                        prop="followUpRateAgain"
                      >
                      </el-table-column>
                      <el-table-column
                        label="人工"
                        align="center"
                        key="manualAgain"
                        prop="manualAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.manualAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访人工随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.manualAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="短信"
                        align="center"
                        key="smsAgain"
                        prop="smsAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.smsAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访短信随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.smsAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="微信"
                        align="center"
                        key="weChatAgain"
                        prop="weChatAgain"
                      >
                        <template slot-scope="scope">
                          <el-button
                            size="medium"
                            type="text"
                            @click="
                              viewDetails(
                                scope.row.weChatAgainInfo,
                                scope.row.leavehospitaldistrictname +
                                  '再次随访微信随访列表'
                              )
                            "
                            ><span class="button-zx">{{
                              scope.row.weChatAgain
                            }}</span></el-button
                          >
                        </template>
                      </el-table-column>
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
            </el-tabs>
            <!-- 原来的分页组件保留(如果需要) -->
            <!-- <pagination
              v-show="total > 0"
              :total="total"
@@ -446,6 +927,481 @@
        </el-row>
      </div>
    </div>
    <!-- 统计趋势图弹窗 -->
    <el-dialog
      title="随访统计趋势图"
      :visible.sync="chartDialogVisible"
      width="80%"
      :close-on-click-modal="false"
    >
      <div class="chart-container">
        <el-row :gutter="20">
          <el-col :span="12">
            <div class="chart-title">随访状态分布</div>
            <div id="pieChart" style="width: 100%; height: 400px"></div>
          </el-col>
          <el-col :span="12">
            <div class="chart-title">随访趋势分析</div>
            <div id="barLineChart" style="width: 100%; height: 400px"></div>
          </el-col>
        </el-row>
      </div>
    </el-dialog>
    <el-dialog
      title="未及时随访患者服务"
      :visible.sync="SeedetailsVisible"
      v-loading="Seedloading"
      width="70%"
      :close-on-click-modal="false"
    >
      <div class="examine-jic">
        <div class="jic-value">
          <el-row :gutter="20">
            <!--用户数据-->
            <el-form
              :model="patientqueryParams"
              ref="queryForm"
              size="small"
              :inline="true"
              label-width="98px"
            >
              <el-form-item label="患者:">
                <el-input
                  v-model="patientqueryParams.name"
                  @keyup.enter.native="handleQuery"
                ></el-input>
              </el-form-item>
              <el-form-item label="患者诊断:">
                <el-input
                  v-model="patientqueryParams.leavediagname"
                  @keyup.enter.native="handleQuery"
                ></el-input>
              </el-form-item>
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="handleQuery"
                  >搜索</el-button
                >
                <el-button
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >取消创建</el-button
                >
              </el-form-item>
            </el-form>
            <!-- 选择患者列表 -->
            <el-table :data="logsheetlist" style="width: 100%">
              <el-table-column
                prop="sendname"
                align="center"
                label="姓名"
                width="100"
              >
              </el-table-column>
              <el-table-column
                prop="taskName"
                align="center"
                width="200"
                show-overflow-tooltip
                label="任务名称"
              >
              </el-table-column>
              <el-table-column
                prop="sendstate"
                align="center"
                width="200"
                label="任务状态"
              >
                <template slot-scope="scope">
                  <div v-if="scope.row.sendstate == 1">
                    <el-tag type="primary" :disable-transitions="false"
                      >表单已领取</el-tag
                    >
                  </div>
                  <div v-if="scope.row.sendstate == 2">
                    <el-tag type="primary" :disable-transitions="false"
                      >待随访</el-tag
                    >
                  </div>
                  <div v-if="scope.row.sendstate == 3">
                    <el-tag type="success" :disable-transitions="false"
                      >表单已发送</el-tag
                    >
                  </div>
                  <div v-if="scope.row.sendstate == 4">
                    <el-tag type="info" :disable-transitions="false"
                      >不执行</el-tag
                    >
                  </div>
                  <div v-if="scope.row.sendstate == 5">
                    <el-tag type="danger" :disable-transitions="false"
                      >发送失败</el-tag
                    >
                  </div>
                  <div v-if="scope.row.sendstate == 6">
                    <el-tag type="success" :disable-transitions="false"
                      >已完成</el-tag
                    >
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="visitTime"
                align="center"
                label="应随访时间"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="finishtime"
                align="center"
                label="随访完成时间"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                label="出院日期"
                width="200"
                align="center"
                key="endtime"
                prop="endtime"
              >
                <template slot-scope="scope">
                  <span>{{ formatTime(scope.row.endtime) }}</span>
                </template></el-table-column
              >
              <el-table-column
                label="责任护士"
                width="120"
                align="center"
                key="nurseName"
                prop="nurseName"
              />
              <el-table-column
                label="主治医生"
                width="120"
                align="center"
                key="drname"
                prop="drname"
              />
              <el-table-column
                label="结果状态"
                align="center"
                key="excep"
                prop="excep"
                width="120"
              >
                <template slot-scope="scope">
                  <dict-tag
                    :options="dict.type.sys_yujing"
                    :value="scope.row.excep"
                  />
                </template>
              </el-table-column>
              <el-table-column
                label="处理意见"
                align="center"
                key="suggest"
                prop="suggest"
                width="120"
              >
                <template slot-scope="scope">
                  <dict-tag
                    :options="dict.type.sys_suggest"
                    :value="scope.row.suggest"
                  />
                </template>
              </el-table-column>
              <el-table-column
                prop="templatename"
                align="center"
                label="服务模板"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="remark"
                align="center"
                label="服务记录"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="bankcardno"
                align="center"
                label="呼叫状态"
                width="210"
              >
              </el-table-column>
              <el-table-column
                label="操作"
                fixed="right"
                align="center"
                width="200"
                class-name="small-padding fixed-width"
              >
                <template slot-scope="scope">
                  <el-button
                    size="medium"
                    type="text"
                    @click="SeedetailsgGo(scope.row)"
                    ><span class="button-zx"
                      ><i class="el-icon-s-order"></i>查看</span
                    ></el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </el-row>
          <pagination
            v-show="patienttotal > 0 && this.patientqueryParams.allhosp != 6"
            :total="patienttotal"
            :page.sync="patientqueryParams.pn"
            :limit.sync="patientqueryParams.ps"
            @pagination="Seedetailstion"
          />
        </div>
      </div>
    </el-dialog>
    <!-- 各类详情 -->
    <el-dialog
      :title="infotitle"
      :visible.sync="infotitleVisible"
      v-loading="infotitloading"
      width="70%"
      :close-on-click-modal="false"
    >
      <div style="margin-bottom: 16px; display: flex; align-items: center">
        <span style="margin-right: 10px; font-weight: bold">患者姓名查询:</span>
        <el-input
          v-model="searchName"
          placeholder="请输入患者姓名进行筛选"
          clearable
          style="width: 300px"
          @input="handleSearch"
          @clear="handleSearch"
        >
        </el-input>
        <span
          style="margin-left: 10px; color: rgb(35, 81, 233); font-size: 16px"
        >
          共 {{ infotitlelist.length }} 条记录
        </span>
      </div>
      <div class="examine-jic">
        <div class="jic-value">
          <el-row :gutter="20">
            <!-- 选择患者列表 -->
            <div
              class="data-list"
              ref="dataList"
              @scroll="handleScroll"
              v-loading="infotitloading"
            >
              <el-table
                :data="currentDisplayList"
                height="660"
                style="width: 100%"
              >
                <el-table-column
                  prop="sendname"
                  align="center"
                  label="姓名"
                  width="100"
                >
                </el-table-column>
                <el-table-column
                  prop="taskName"
                  align="center"
                  width="200"
                  show-overflow-tooltip
                  label="任务名称"
                >
                </el-table-column>
                <el-table-column
                  prop="sendstate"
                  align="center"
                  width="200"
                  label="任务状态"
                >
                  <template slot-scope="scope">
                    <div v-if="scope.row.sendstate == 1">
                      <el-tag type="primary" :disable-transitions="false"
                        >表单已领取</el-tag
                      >
                    </div>
                    <div v-if="scope.row.sendstate == 2">
                      <el-tag type="primary" :disable-transitions="false"
                        >待随访</el-tag
                      >
                    </div>
                    <div v-if="scope.row.sendstate == 3">
                      <el-tag type="success" :disable-transitions="false"
                        >表单已发送</el-tag
                      >
                    </div>
                    <div v-if="scope.row.sendstate == 4">
                      <el-tag type="info" :disable-transitions="false"
                        >不执行</el-tag
                      >
                    </div>
                    <div v-if="scope.row.sendstate == 5">
                      <el-tag type="danger" :disable-transitions="false"
                        >发送失败</el-tag
                      >
                    </div>
                    <div v-if="scope.row.sendstate == 6">
                      <el-tag type="success" :disable-transitions="false"
                        >已完成</el-tag
                      >
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  label="任务执行方式"
                  align="center"
                  key="preachform"
                  prop="preachform"
                  width="160"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <span v-for="item in scope.row.preachform"
                      >{{ item }}、
                    </span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="visitTime"
                  align="center"
                  label="应随访时间"
                  width="200"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="finishtime"
                  align="center"
                  label="随访完成时间"
                  width="200"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  label="出院日期"
                  width="200"
                  align="center"
                  key="endtime"
                  prop="endtime"
                >
                  <template slot-scope="scope">
                    <span>{{ formatTime(scope.row.endtime) }}</span>
                  </template></el-table-column
                >
                <el-table-column
                  label="责任护士"
                  width="120"
                  align="center"
                  key="nurseName"
                  prop="nurseName"
                />
                <el-table-column
                  label="主治医生"
                  width="120"
                  align="center"
                  key="drname"
                  prop="drname"
                />
                <el-table-column
                  label="结果状态"
                  align="center"
                  key="excep"
                  prop="excep"
                  width="120"
                >
                  <template slot-scope="scope">
                    <dict-tag
                      :options="dict.type.sys_yujing"
                      :value="scope.row.excep"
                    />
                  </template>
                </el-table-column>
                <el-table-column
                  label="处理意见"
                  align="center"
                  key="suggest"
                  prop="suggest"
                  width="120"
                >
                  <template slot-scope="scope">
                    <dict-tag
                      :options="dict.type.sys_suggest"
                      :value="scope.row.suggest"
                    />
                  </template>
                </el-table-column>
                <el-table-column
                  prop="templatename"
                  align="center"
                  label="服务模板"
                  width="200"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="remark"
                  align="center"
                  label="服务记录"
                  width="200"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="bankcardno"
                  align="center"
                  label="呼叫状态"
                  width="210"
                >
                </el-table-column>
                <el-table-column
                  label="操作"
                  fixed="right"
                  align="center"
                  width="200"
                  class-name="small-padding fixed-width"
                >
                  <template slot-scope="scope">
                    <el-button
                      size="medium"
                      type="text"
                      @click="SeedetailsgGo(scope.row)"
                      ><span class="button-zx"
                        ><i class="el-icon-s-order"></i>查看</span
                      ></el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-row>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
@@ -453,21 +1409,18 @@
import {
  toamendtag,
  addapitag,
  detailstag,
  deletetag,
  changetagcategory,
  toamendtagcategory,
  addtagcategory,
  deletetagcategory,
  listtag,
  tagclassifylist,
} from "@/api/system/label";
import {
  getSfStatistics,deptTreeSelect
} from "@/api/system/user";
import store from "@/store";
import { getSfStatistics, selectTimelyRate } from "@/api/system/user";
import * as XLSX from "xlsx";
import FileSaver from "file-saver";
import ExcelJS from "exceljs";
import { saveAs } from "file-saver";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
const shortcuts = [
  {
    text: "今天",
@@ -492,34 +1445,76 @@
    },
  },
];
export default {
  name: "questionnaire",
  name: "Percentage",
  dicts: ["sys_normal_disable", "sys_user_sex"],
  components: { Treeselect },
  data() {
    return {
      topactiveName: "Local", //顶部选择
      activeName: "first", //侧边选择
      // 遮罩层
      loading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      // 新增:Tab标签页控制
      activeTab: "first", // 当前激活的tab,first-首次随访,second-再次随访
      // 分离的数据列表
      firstFollowUpList: [], // 首次随访数据
      secondFollowUpList: [], // 再次随访数据
      // 分离的加载状态
      loading: false, // 首次随访表格加载状态
      loadingSecond: false, // 再次随访表格加载状态
      // 分离的展开状态
      expands: [], // 首次随访表格展开行
      expandsSecond: [], // 再次随访表格展开行
      // 分离的选择状态
      ids: [], // 首次随访选中项
      idsSecond: [], // 再次随访选中项
      orgname: "",
      infotitlelist: [],
      currentDisplayList: [],
      loadIndex: 0,
      pageSize: 100,
      isLoading: false,
      Seedloading: false,
      chartDialogVisible: false,
      infotitleVisible: false,
      searchName: "",
      infotitloading: false,
      infotitle: "",
      pieChart: null,
      barLineChart: null,
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      idds: "", //分类id
      // 总条数
      idds: "",
      total: 0,
      flatArray:[],
      amendtag: false, //是否修改类别
      lstamendtag: false, //是否修改标签
      scavisible: false, //删除弹框
      deleteVisible: false, //分类删除弹框
      deletefenl: "高血压", //删除项
      //修改添加标签弹框数据
      flatArrayhospit: [],
      flatArraydept: [],
      patienttotal: 0,
      logsheetlist: [],
      Statisticallist: [
        {
          label: "病区统计",
          value: 1,
        },
        {
          label: "科室统计",
          value: 2,
        },
      ],
      patientqueryParams: {
        pn: 1,
        ps: 10,
      },
      amendtag: false,
      lstamendtag: false,
      scavisible: false,
      deleteVisible: false,
      deletefenl: "高血压",
      tagform: {
        isupload: "",
        tagname: "",
@@ -529,48 +1524,26 @@
      classifyform: {
        categoryname: "",
      },
      // 标签表格数据
      userList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 日期范围
      dateRange: [],
      // 岗位选项
      postOptions: [],
      // 角色选项
      roleOptions: [],
      // 表单参数
      allDeptCodes: [],
      allWardCodes: [],
      checkboxlist: [],
      form: {},
      forms: {
        name: "",
      },
      numberlb: 22,
      dialogFormVisible: false, //添加、修改类别弹框
      lstamendtagVisible: false, //添加、修改标签弹框
      goQRCodeVisible: false, //二维码弹框
      sidecolumnval: "", //类别搜索
      dialogFormVisible: false,
      lstamendtagVisible: false,
      goQRCodeVisible: false,
      sidecolumnval: "",
      propss: { multiple: true },
      options: [
        {
          value: 1,
          label: "东南",
        },
        {
          value: 2,
          label: "西北",
        },
        {
          value: 3,
          label: "仨仨仨",
        },
        {
          value: 4,
          label: "六飒飒飒",
        },
      ],
      SeedetailsVisible: false,
      options: store.getters.tasktypes,
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 3600 * 1000 * 24;
@@ -583,14 +1556,14 @@
        },
        shortcuts: shortcuts,
      },
      // 查询标签列表参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        serviceType:[2],
        serviceType: [2],
        dateRange: [],
        statisticaltype: 1,
        leavehospitaldistrictcodes: ["all"],
        deptcodes: [],
        visitCount: 1, // 新增:随访次数参数,1-首次,2-再次
      },
      // 列信息
      columns: [
        { key: 0, label: `标签编号`, visible: true },
        { key: 1, label: `标签名称`, visible: true },
@@ -604,18 +1577,473 @@
  },
  watch: {},
  created() {
    this.getList();
this.getDeptTree();
    this.getDeptTree();
    this.getFirstFollowUpList(); // 默认加载首次随访数据
    this.checkboxlist = store.getters.checkboxlist;
    this.orgname = localStorage.getItem("orgname");
  },
  methods: {
    /** 查询标签列表 */
    getList() {
      getSfStatistics(this.queryParams).then((response) => {
        console.log(response);
        // this.total = response.total;
        this.userList = response.data;
    /** 查询首次随访列表 */
    async getFirstFollowUpList() {
      this.loading = true;
      this.queryParams.visitCount = 1; // 设置随访次数为首次
      const params = {
        ...this.queryParams,
        leavehospitaldistrictcodes:
          this.queryParams.leavehospitaldistrictcodes.includes("all")
            ? this.allWardCodes
            : this.queryParams.leavehospitaldistrictcodes,
        deptcodes: this.queryParams.deptcodes.includes("all")
          ? this.allDeptCodes
          : this.queryParams.deptcodes,
      };
      delete params.leavehospitaldistrictcodes.all;
      delete params.deptcodes.all;
      try {
        const response = await getSfStatistics(params);
        this.firstFollowUpList = this.customSort(response.data);
        this.total = response.total;
      } catch (error) {
        console.error("获取首次随访数据失败:", error);
        this.$message.error("获取首次随访数据失败");
      } finally {
        this.loading = false;
      }
    },
    /** 查询再次随访列表 */
    async getSecondFollowUpList() {
      this.loadingSecond = true;
      this.queryParams.visitCount = 2; // 设置随访次数为再次
      const params = {
        ...this.queryParams,
        leavehospitaldistrictcodes:
          this.queryParams.leavehospitaldistrictcodes.includes("all")
            ? this.allWardCodes
            : this.queryParams.leavehospitaldistrictcodes,
        deptcodes: this.queryParams.deptcodes.includes("all")
          ? this.allDeptCodes
          : this.queryParams.deptcodes,
      };
      delete params.leavehospitaldistrictcodes.all;
      delete params.deptcodes.all;
      try {
        const response = await getSfStatistics(params);
        this.secondFollowUpList = this.customSort(response.data);
        this.total = response.total;
      } catch (error) {
        console.error("获取再次随访数据失败:", error);
        this.$message.error("获取再次随访数据失败");
      } finally {
        this.loadingSecond = false;
      }
    },
    /** Tab切换事件 */
    handleTabClick(tab) {
      if (tab.name === "first") {
        if (this.firstFollowUpList.length === 0) {
          this.getFirstFollowUpList();
        }
      } else if (tab.name === "second") {
        if (this.secondFollowUpList.length === 0) {
          this.getSecondFollowUpList();
        }
      }
    },
    sortChineseNumber(aRow, bRow) {
      const a = aRow.leavehospitaldistrictname;
      const b = bRow.leavehospitaldistrictname;
      // 中文数字到阿拉伯数字的映射(扩展到45)
      const chineseNumMap = {
        一: 1,
        二: 2,
        三: 3,
        四: 4,
        五: 5,
        六: 6,
        七: 7,
        八: 8,
        九: 9,
        十: 10,
        十一: 11,
        十二: 12,
        十三: 13,
        十四: 14,
        十五: 15,
        十六: 16,
        十七: 17,
        十八: 18,
        十九: 19,
        二十: 20,
        二十一: 21,
        二十二: 22,
        二十三: 23,
        二十四: 24,
        二十五: 25,
        二十六: 26,
        二十七: 27,
        二十八: 28,
        二十九: 29,
        三十: 30,
        三十一: 31,
        三十二: 32,
        三十三: 33,
        三十四: 34,
        三十五: 35,
        三十六: 36,
        三十七: 37,
        三十八: 38,
        三十九: 39,
        四十: 40,
        四十一: 41,
        四十二: 42,
        四十三: 43,
        四十四: 44,
        四十五: 45,
      };
      // 提取中文数字
      const getNumberFromText = (text) => {
        if (!text || typeof text !== "string") return -1;
        // 匹配中文数字,支持一到四十五
        const match = text.match(/^([一二三四五六七八九十]+)/);
        if (match && match[1]) {
          const chineseNum = match[1];
          return chineseNumMap[chineseNum] !== undefined
            ? chineseNumMap[chineseNum]
            : -1;
        }
        // 如果没有匹配到中文数字,尝试匹配阿拉伯数字
        const arabicMatch = text.match(/^(\d+)/);
        if (arabicMatch && arabicMatch[1]) {
          const num = parseInt(arabicMatch[1], 10);
          return num >= 1 && num <= 45 ? num : -1;
        }
        return -1;
      };
      const numA = getNumberFromText(a);
      const numB = getNumberFromText(b);
      // 处理无法解析的情况
      if (numA === -1 && numB === -1) {
        return (a || "").localeCompare(b || "");
      }
      if (numA === -1) return 1;
      if (numB === -1) return -1;
      return numA - numB;
    },
    // 搜索处理函数
    handleSearch() {
      if (!this.searchName.trim()) {
        // 如果搜索框为空,显示所有数据
        this.currentDisplayList = [...this.infotitlelist];
      } else {
        // 根据患者姓名进行筛选(不区分大小写)
        const keyword = this.searchName.toLowerCase();
        this.currentDisplayList = this.infotitlelist.filter((item) => {
          return item.sendname && item.sendname.toLowerCase().includes(keyword);
        });
      }
    },
    customSort(data) {
      // 定义您期望的病区顺序(扩展到四十五)
      const order = [
        "一",
        "二",
        "三",
        "四",
        "五",
        "六",
        "七",
        "八",
        "九",
        "十",
        "十一",
        "十二",
        "十三",
        "十四",
        "十五",
        "十六",
        "十七",
        "十八",
        "十九",
        "二十",
        "二十一",
        "二十二",
        "二十三",
        "二十四",
        "二十五",
        "二十六",
        "二十七",
        "二十八",
        "二十九",
        "三十",
        "三十一",
        "三十二",
        "三十三",
        "三十四",
        "三十五",
        "三十六",
        "三十七",
        "三十八",
        "三十九",
        "四十",
        "四十一",
        "四十二",
        "四十三",
        "四十四",
        "四十五",
      ];
      return data.sort((a, b) => {
        // 提取病区名称中的中文数字部分
        const getIndex = (name) => {
          if (!name || typeof name !== "string") return -1;
          // 匹配中文数字
          const chineseMatch = name.match(/^([一二三四五六七八九十]+)/);
          if (chineseMatch && chineseMatch[1]) {
            return order.indexOf(chineseMatch[1]);
          }
          // 匹配阿拉伯数字
          const arabicMatch = name.match(/^(\d+)/);
          if (arabicMatch && arabicMatch[1]) {
            const num = parseInt(arabicMatch[1], 10);
            if (num >= 1 && num <= 45) {
              return num - 1; // 因为数组索引从0开始
            }
          }
          return -1;
        };
        const indexA = getIndex(a.leavehospitaldistrictname);
        const indexB = getIndex(b.leavehospitaldistrictname);
        // 排序逻辑
        if (indexA === -1 && indexB === -1) {
          return (a.leavehospitaldistrictname || "").localeCompare(
            b.leavehospitaldistrictname || ""
          );
        }
        if (indexA === -1) return 1;
        if (indexB === -1) return -1;
        return indexA - indexB;
      });
    },
    getRowKey(row) {
      return row.statisticaltype === 1
        ? row.leavehospitaldistrictcode
        : row.deptcode;
    },
    // 处理行点击展开
    handleRowClick(row) {
      console.log(row, "row");
      // 如果已经展开则收起
      if (this.expands.includes(this.getRowKey(row))) {
        this.expands = [];
        return;
      }
      // 处理查询参数
      const params = {
        ...this.queryParams,
        // 如果选择了"全部",则传所有病区/科室代码
        deptcodes: this.queryParams.deptcodes.includes("all")
          ? this.allDeptCodes
          : this.queryParams.deptcodes,
        leavehospitaldistrictcodes: [row.leavehospitaldistrictcode],
        drcode: "1",
        visitCount: 1, // 设置为首次随访
      };
      // 移除可能存在的"all"值
      delete params.leavehospitaldistrictcodes.all;
      delete params.deptcodes.all;
      // 如果该行还没有加载医生数据,则加载
      if (!row.doctorStats) {
        this.loading = true;
        getSfStatistics(params).then((res) => {
          this.$set(row, "doctorStats", res.data);
          this.expands = [this.getRowKey(row)];
          this.loading = false;
        });
      } else {
        this.expands = [this.getRowKey(row)];
      }
    },
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (index === 1 || index === 2) {
          sums[index] = "/";
          return;
        }
        // 对百分比字段特殊处理 - 取平均值
        if (
          column.property === "followUpRate" ||
          column.property === "rate" ||
          column.property === "followUpRateAgain"
        ) {
          // 提取所有有效百分比值并转换为小数
          const percentageValues = data
            .map((item) => {
              const value = item[column.property];
              if (!value || value === "-" || value === "0%") return null;
              // 处理带百分号的数据
              if (typeof value === "string" && value.includes("%")) {
                // 去除百分号并转换为小数
                const numValue = parseFloat(value.replace("%", "")) / 100;
                return isNaN(numValue) ? null : numValue;
              } else {
                // 处理已经是小数的数据
                const numValue = parseFloat(value);
                return isNaN(numValue) ? null : numValue;
              }
            })
            .filter((value) => value !== null && value !== 0); // 过滤掉null和0值
          if (percentageValues.length > 0) {
            const average =
              percentageValues.reduce((sum, value) => sum + value, 0) /
              percentageValues.length;
            sums[index] = (average * 100).toFixed(2) + "%";
          } else {
            sums[index] = "0.00%";
          }
        } else {
          // 普通数字字段 - 求和
          const values = data.map((item) => {
            const value = item[column.property];
            if (value === "-" || value === "" || value === null) return 0;
            return Number(value) || 0;
          });
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => prev + curr, 0);
            sums[index] = this.formatNumber(sums[index]);
          } else {
            sums[index] = "-";
          }
        }
      });
      return sums;
    },
    // 内部表格合计行计算方法
    getInnerSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "小计";
          return;
        }
        if (column.property === "drname" || column.property === "deptname") {
          sums[index] = "-";
          return;
        }
        // 对百分比字段特殊处理 - 取平均值
        if (column.property === "followUpRate" || column.property === "rate") {
          // 提取所有有效百分比值并转换为小数
          const percentageValues = data
            .map((item) => {
              const value = item[column.property];
              if (!value || value === "-" || value === "0%") return null;
              // 处理带百分号的数据
              if (typeof value === "string" && value.includes("%")) {
                // 去除百分号并转换为小数
                const numValue = parseFloat(value.replace("%", "")) / 100;
                return isNaN(numValue) ? null : numValue;
              } else {
                // 处理已经是小数的数据
                const numValue = parseFloat(value);
                return isNaN(numValue) ? null : numValue;
              }
            })
            .filter((value) => value !== null && value !== 0);
          if (percentageValues.length > 0) {
            const average =
              percentageValues.reduce((sum, value) => sum + value, 0) /
              percentageValues.length;
            sums[index] = (average * 100).toFixed(2) + "%";
          } else {
            sums[index] = "0.00%";
          }
        } else {
          // 普通数字字段 - 求和
          const values = data.map((item) => {
            const value = item[column.property];
            if (value === "-" || value === "" || value === null) return 0;
            return Number(value) || 0;
          });
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => prev + curr, 0);
            sums[index] = this.formatNumber(sums[index]);
          } else {
            sums[index] = "-";
          }
        }
      });
      return sums;
    },
    // 辅助方法:提取百分比数值
    extractPercentageValue(value) {
      if (!value) return null;
      if (typeof value === "string") {
        // 处理带百分号的字符串
        if (value.includes("%")) {
          const num = parseFloat(value.replace("%", ""));
          return isNaN(num) ? null : num / 100;
        }
        // 处理纯数字字符串
        const num = parseFloat(value);
        return isNaN(num) ? null : num;
      }
      // 处理数字类型
      return typeof value === "number" ? value : null;
    },
    // 数字格式化方法
    formatNumber(num) {
      if (isNaN(num)) return "-";
      return Number.isInteger(num) ? num.toString() : num.toFixed(0);
    },
    /** 修改标签 */
    handleUpdate(row) {
@@ -633,13 +2061,31 @@
    // 获取科室树
    getDeptTree() {
      // 科室列表
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
        console.log( this.deptOptions,' this.deptOptions');
        this.flatArray = this.flattenArray(response.data);
        console.log(this.flatArray,'this.flatArray');
      this.flatArraydept = store.getters.belongDepts.map((dept) => {
        return {
          label: dept.deptName,
          value: dept.deptCode,
        };
      });
      // 存储所有科室代码
      this.allDeptCodes = store.getters.belongDepts.map(
        (dept) => dept.deptCode
      );
      // 病区列表
      this.flatArrayhospit = store.getters.belongWards.map((ward) => {
        return {
          label: ward.districtName,
          value: ward.districtCode,
        };
      });
      // 存储所有病区代码
      this.allWardCodes = store.getters.belongWards.map(
        (ward) => ward.districtCode
      );
      this.flatArraydept.push({ label: "全部", value: "all" });
      this.flatArrayhospit.push({ label: "全部", value: "all" });
    },
    flattenArray(multiArray) {
      let result = [];
@@ -671,6 +2117,110 @@
        tagid: "",
      };
    },
    Seedetails(row) {
      this.SeedetailsVisible = true;
      this.Seedloading = true;
      this.patientqueryParams.starttime = this.parseTime(
        this.queryParams.dateRange[0]
      );
      this.patientqueryParams.endtime = this.parseTime(
        this.queryParams.dateRange[1]
      );
      this.patientqueryParams.deptcode = row.deptcode;
      selectTimelyRate(this.patientqueryParams).then((response) => {
        this.logsheetlist = response.data.detail;
        this.patienttotal = response.data.total;
        this.Seedloading = false;
      });
    },
    Seedetailstion() {
      selectTimelyRate(this.patientqueryParams).then((response) => {
        this.logsheetlist = response.data.detail;
        this.patienttotal = response.data.total;
        this.Seedloading = false;
      });
    },
    viewDetails(row, title) {
      this.infotitleVisible = true;
      this.infotitle = title;
      this.infotitlelist = row; // 假设row就是需要展示的详细数组
      console.log(this.infotitlelist, "this.infotitlelist");
      this.infotitlelist.forEach((item) => {
        let idArray = null;
        if (item.preachform) {
          if (item.endtime) {
            item.preachformson = item.preachform;
            idArray = item.preachform.split(",");
          }
          item.preachform = idArray.map((value) => {
            // 查找id对应的对象
            const item = this.checkboxlist.find((item) => item.value == value);
            // 如果找到对应的id,返回label值,否则返回null
            return item ? item.label : null;
          });
        }
      });
      // 初始化加载
      this.loadIndex = 0;
      this.currentDisplayList = [];
      this.$nextTick(() => {
        this.loadMoreData();
      });
    },
    loadMoreData() {
      if (this.isLoading) return;
      this.isLoading = true;
      // 模拟异步加载,实际可能是直接切片本地数据
      setTimeout(() => {
        console.log(this.infotitlelist, "this.infotitlelist");
        const nextChunk = this.infotitlelist.slice(
          this.loadIndex,
          this.loadIndex + this.pageSize
        );
        this.currentDisplayList = this.currentDisplayList.concat(nextChunk);
        this.loadIndex += this.pageSize;
        this.isLoading = false;
      }, 200);
    },
    handleScroll(event) {
      const scrollContainer = event.target;
      // 判断是否滚动到底部
      const isAtBottom =
        scrollContainer.scrollTop + scrollContainer.clientHeight >=
        scrollContainer.scrollHeight - 10;
      if (
        isAtBottom &&
        !this.isLoading &&
        this.loadIndex < this.infotitlelist.length
      ) {
        this.loadMoreData();
      }
    },
    SeedetailsgGo(row) {
      this.SeedetailsVisible = false;
      let type = "";
      if (row.preachformson && row.preachformson.includes("3")) {
        type = 1;
      }
      setTimeout(() => {
        this.$router.push({
          path: "/followvisit/record/detailpage/",
          query: {
            taskid: row.taskid,
            patid: row.patid,
            id: row.id,
            Voicetype: type,
            // visitCount: this.topqueryParams.visitCount,
          },
        });
      }, 300);
    },
    // 添加/修改标签
    Maintenancetag() {
      if (this.lstamendtag) {
@@ -693,7 +2243,7 @@
      };
    },
    routerErr(row) {
      console.log(row,'跳转异常');
      console.log(row, "跳转异常");
      this.$router.push({
        path: "/followvisit/discharge",
        query: {
@@ -737,18 +2287,33 @@
          row.isupload = row.isupload === "0" ? "1" : "0";
        });
    },
    /** 搜索按钮操作 */
    /** 搜索按钮操作 - 修改为搜索当前激活的tab数据 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      console.log();
      this.queryParams.startTime = this.parseTime(this.queryParams.dateRange[0]);
      if (!this.queryParams.dateRange) this.queryParams.dateRange = [];
      if (this.queryParams.statisticaltype == 1) {
        this.queryParams.deptcodes = [];
      } else if (this.queryParams.statisticaltype == 2) {
        this.queryParams.leavehospitaldistrictcodes = [];
      }
      this.queryParams.startTime = this.parseTime(
        this.queryParams.dateRange[0]
      );
      this.queryParams.endTime = this.parseTime(this.queryParams.dateRange[1]);
      this.getList();
      // 根据当前激活的tab加载对应数据
      if (this.activeTab === "first") {
        this.getFirstFollowUpList();
      } else {
        this.getSecondFollowUpList();
      }
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams.dateRange = [];
      this.queryParams.leavehospitaldistrictcodes=[];
      this.queryParams.leavehospitaldistrictcodes = [];
      this.handleQuery();
    },
    // 多选框选中数据
@@ -779,21 +2344,1130 @@
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "base/tag/export",
        {
          ...this.queryParams,
    // 导出方法
    async exportTable() {
      try {
        // 1. 获取并格式化日期范围
        let dateRangeString = "";
        let sheetNameSuffix = "";
        if (
          this.queryParams.dateRange &&
          this.queryParams.dateRange.length === 2
        ) {
          const startDateStr = this.queryParams.dateRange[0];
          const endDateStr = this.queryParams.dateRange[1];
          const formatDateForDisplay = (dateTimeStr) => {
            return dateTimeStr.split(" ")[0];
          };
          const startDateFormatted = formatDateForDisplay(startDateStr);
          const endDateFormatted = formatDateForDisplay(endDateStr);
          dateRangeString = `${startDateFormatted}至${endDateFormatted}`;
          sheetNameSuffix = `${startDateFormatted}至${endDateFormatted}`;
        } else {
          const now = new Date();
          const currentMonth = now.getMonth() + 1;
          dateRangeString = `${currentMonth}月`;
          sheetNameSuffix = `${currentMonth}月`;
        }
        // 2. 根据当前激活的tab确定导出的数据
        const isFirstFollowUp = this.activeTab === "first";
        let excelName, worksheetName, dataToExport;
        if (isFirstFollowUp) {
          excelName = `首次出院随访统计表_${dateRangeString}.xlsx`;
          worksheetName = `首次随访统计_${sheetNameSuffix}`;
          dataToExport = this.firstFollowUpList;
          if (!dataToExport || dataToExport.length === 0) {
            this.$message.warning("暂无首次随访数据可导出");
            return false;
          }
        } else {
          excelName = `再次出院随访统计表_${dateRangeString}.xlsx`;
          worksheetName = `再次随访统计_${sheetNameSuffix}`;
          dataToExport = this.secondFollowUpList;
          if (!dataToExport || dataToExport.length === 0) {
            this.$message.warning("暂无再次随访数据可导出");
            return false;
          }
        }
        // 3. 创建工作簿和工作表
        const workbook = new ExcelJS.Workbook();
        const worksheet = workbook.addWorksheet(worksheetName);
        // 4. 构建表格
        if (isFirstFollowUp) {
          this.buildFirstFollowUpExportSheet(
            worksheet,
            dataToExport,
            sheetNameSuffix
          );
        } else {
          this.buildSecondFollowUpExportSheet(
            worksheet,
            dataToExport,
            sheetNameSuffix
          );
        }
        // 5. 生成并下载文件
        const buffer = await workbook.xlsx.writeBuffer();
        const blob = new Blob([buffer], {
          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        });
        saveAs(blob, excelName);
        this.$message.success("导出成功");
        return true;
      } catch (error) {
        console.error("导出失败:", error);
        this.$message.error(`导出失败: ${error.message}`);
        return false;
      }
    },
    /** 构建首次随访导出表格 */
    buildFirstFollowUpExportSheet(worksheet, data, sheetNameSuffix) {
      const titleStyle = {
        font: {
          name: "微软雅黑",
          size: 16,
          bold: true,
          color: { argb: "FF000000" },
        },
        `user_${new Date().getTime()}.xlsx`
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFE6F3FF" },
        },
        alignment: { vertical: "middle", horizontal: "center", wrapText: true },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const headerStyle = {
        font: {
          name: "微软雅黑",
          size: 11,
          bold: true,
          color: { argb: "FF000000" },
        },
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFF5F7FA" },
        },
        alignment: { vertical: "middle", horizontal: "center", wrapText: true },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const cellStyle = {
        font: { name: "宋体", size: 10, color: { argb: "FF000000" } },
        alignment: { vertical: "middle", horizontal: "center" },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const summaryStyle = {
        font: {
          name: "宋体",
          size: 10,
          bold: true,
          color: { argb: "FF409EFF" },
        },
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFF5F7FA" },
        },
        alignment: { vertical: "middle", horizontal: "center" },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      // 1. 添加总标题行
      worksheet.mergeCells(1, 1, 1, 16); // 合并A1到P1
      const titleCell = worksheet.getCell(1, 1);
      titleCell.value = `首次出院随访统计表_${sheetNameSuffix}`;
      titleCell.style = titleStyle;
      worksheet.getRow(1).height = 35;
      // 2. 创建表头
      const secondRowHeaders = [
        "", // A2 展开列占位
        "出院病区",
        "科室",
        "出院人次",
        "无需随访人次",
        "应随访人次", // B2 to F2
        // 首次出院随访子表头
        "需随访",
        "待随访",
        "随访成功",
        "随访失败",
        "随访率",
        "及时率",
        "人工",
        "短信",
        "微信",
      ];
      // 添加第二行
      secondRowHeaders.forEach((header, index) => {
        const cell = worksheet.getCell(3, index + 1);
        cell.value = header;
        cell.style = headerStyle;
      });
      // 3. 合并单元格
      // 合并 A2:A3, B2:B3, C2:C3, D2:D3, E2:E3, F2:F3
      for (let i = 1; i <= 6; i++) {
        worksheet.mergeCells(2, i, 3, i);
        const cell = worksheet.getCell(2, i);
        cell.style = headerStyle;
      }
      // 设置第一行合并单元格的值
      worksheet.getCell(2, 1).value = "";
      worksheet.getCell(2, 2).value = "出院病区";
      worksheet.getCell(2, 3).value = "科室";
      worksheet.getCell(2, 4).value = "出院人次";
      worksheet.getCell(2, 5).value = "无需随访人次";
      worksheet.getCell(2, 6).value = "应随访人次";
      // 4. 合并"首次出院随访"标题
      worksheet.mergeCells(2, 7, 2, 15); // G2:O2
      worksheet.getCell(2, 7).value = "首次出院随访";
      worksheet.getCell(2, 7).style = headerStyle;
      // 5. 设置行高
      worksheet.getRow(2).height = 28;
      worksheet.getRow(3).height = 25;
      // 6. 添加数据行
      data.forEach((item, rowIndex) => {
        const dataRow = worksheet.addRow(
          [
            "", // 展开列
            item.leavehospitaldistrictname || "",
            item.deptname || "",
            item.dischargeCount || 0,
            item.nonFollowUp || 0,
            item.followUpNeeded || 0,
            // 首次出院随访数据
            item.needFollowUp || 0,
            item.pendingFollowUp || 0,
            item.followUpSuccess || 0,
            item.followUpFail || 0,
            item.followUpRate || "0%",
            item.rate ? (Number(item.rate) * 100).toFixed(2) + "%" : "0%",
            item.manual || 0,
            item.sms || 0,
            item.weChat || 0,
          ],
          rowIndex + 4
        );
        // 应用数据行样式
        dataRow.eachCell((cell) => {
          cell.style = cellStyle;
        });
        dataRow.height = 24;
      });
      // 7. 添加合计行
      const summaries = this.getFirstFollowUpSummaries(data);
      const summaryRow = worksheet.addRow(summaries);
      summaryRow.eachCell((cell, colNumber) => {
        cell.style = summaryStyle;
        if (colNumber === 1) {
          cell.value = "合计";
        }
      });
      summaryRow.height = 28;
      // 8. 设置列宽
      worksheet.columns = [
        { width: 8 }, // 展开列
        { width: 20 }, // 出院病区
        { width: 15 }, // 科室
        { width: 12 }, // 出院人次
        { width: 12 }, // 无需随访人次
        { width: 12 }, // 应随访人次
        // 首次出院随访列
        { width: 10 }, // 需随访
        { width: 10 }, // 待随访
        { width: 10 }, // 随访成功
        { width: 10 }, // 随访失败
        { width: 12 }, // 随访率
        { width: 12 }, // 及时率
        { width: 8 }, // 人工
        { width: 8 }, // 短信
        { width: 8 }, // 微信
      ];
    },
    /** 首次随访数据合计行计算 */
    getFirstFollowUpSummaries(data) {
      const summaries = [
        "合计",
        "/",
        "/",
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        "0%",
        "0%",
        0,
        0,
        0,
      ];
      data.forEach((item) => {
        // 数值字段求和
        summaries[3] += Number(item.dischargeCount) || 0;
        summaries[4] += Number(item.nonFollowUp) || 0;
        summaries[5] += Number(item.followUpNeeded) || 0;
        summaries[6] += Number(item.needFollowUp) || 0;
        summaries[7] += Number(item.pendingFollowUp) || 0;
        summaries[8] += Number(item.followUpSuccess) || 0;
        summaries[9] += Number(item.followUpFail) || 0;
        summaries[12] += Number(item.manual) || 0;
        summaries[13] += Number(item.sms) || 0;
        summaries[14] += Number(item.weChat) || 0;
      });
      // 计算百分比字段的平均值
      const followUpRateValues = data
        .map((item) => this.extractPercentageValue(item.followUpRate))
        .filter((value) => value !== null);
      const rateValues = data
        .map((item) => this.extractPercentageValue(item.rate))
        .filter((value) => value !== null);
      if (followUpRateValues.length > 0) {
        const avgFollowUpRate =
          followUpRateValues.reduce((sum, val) => sum + val, 0) /
          followUpRateValues.length;
        summaries[10] = (avgFollowUpRate * 100).toFixed(2) + "%";
      }
      if (rateValues.length > 0) {
        const avgRate =
          rateValues.reduce((sum, val) => sum + val, 0) / rateValues.length;
        summaries[11] = (avgRate * 100).toFixed(2) + "%";
      }
      // 格式化数字
      summaries[3] = this.formatNumber(summaries[3]);
      summaries[4] = this.formatNumber(summaries[4]);
      summaries[5] = this.formatNumber(summaries[5]);
      summaries[6] = this.formatNumber(summaries[6]);
      summaries[7] = this.formatNumber(summaries[7]);
      summaries[8] = this.formatNumber(summaries[8]);
      summaries[9] = this.formatNumber(summaries[9]);
      summaries[12] = this.formatNumber(summaries[12]);
      summaries[13] = this.formatNumber(summaries[13]);
      summaries[14] = this.formatNumber(summaries[14]);
      return summaries;
    },
    /** 构建再次随访导出表格 */
    buildSecondFollowUpExportSheet(worksheet, data, sheetNameSuffix) {
      const titleStyle = {
        font: {
          name: "微软雅黑",
          size: 16,
          bold: true,
          color: { argb: "FF000000" },
        },
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFE6F3FF" },
        },
        alignment: { vertical: "middle", horizontal: "center", wrapText: true },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const headerStyle = {
        font: {
          name: "微软雅黑",
          size: 11,
          bold: true,
          color: { argb: "FF000000" },
        },
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFF5F7FA" },
        },
        alignment: { vertical: "middle", horizontal: "center", wrapText: true },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const cellStyle = {
        font: { name: "宋体", size: 10, color: { argb: "FF000000" } },
        alignment: { vertical: "middle", horizontal: "center" },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      const summaryStyle = {
        font: {
          name: "宋体",
          size: 10,
          bold: true,
          color: { argb: "FF409EFF" },
        },
        fill: {
          type: "pattern",
          pattern: "solid",
          fgColor: { argb: "FFF5F7FA" },
        },
        alignment: { vertical: "middle", horizontal: "center" },
        border: {
          top: { style: "thin", color: { argb: "FFD0D0D0" } },
          left: { style: "thin", color: { argb: "FFD0D0D0" } },
          bottom: { style: "thin", color: { argb: "FFD0D0D0" } },
          right: { style: "thin", color: { argb: "FFD0D0D0" } },
        },
      };
      // 1. 添加总标题行
      worksheet.mergeCells(1, 1, 1, 15); // 合并A1到O1
      const titleCell = worksheet.getCell(1, 1);
      titleCell.value = `再次出院随访统计表_${sheetNameSuffix}`;
      titleCell.style = titleStyle;
      worksheet.getRow(1).height = 35;
      // 2. 创建表头
      const secondRowHeaders = [
        "", // A2 展开列占位
        "出院病区",
        "科室",
        "出院人次",
        "无需随访人次",
        "应随访人次", // B2 to F2
        // 再次出院随访子表头
        "需随访",
        "待随访",
        "随访成功",
        "随访失败",
        "随访率",
        "人工",
        "短信",
        "微信",
      ];
      // 添加第二行
      secondRowHeaders.forEach((header, index) => {
        const cell = worksheet.getCell(3, index + 1);
        cell.value = header;
        cell.style = headerStyle;
      });
      // 3. 合并单元格
      // 合并 A2:A3, B2:B3, C2:C3, D2:D3, E2:E3, F2:F3
      for (let i = 1; i <= 6; i++) {
        worksheet.mergeCells(2, i, 3, i);
        const cell = worksheet.getCell(2, i);
        cell.style = headerStyle;
      }
      // 设置第一行合并单元格的值
      worksheet.getCell(2, 1).value = "";
      worksheet.getCell(2, 2).value = "出院病区";
      worksheet.getCell(2, 3).value = "科室";
      worksheet.getCell(2, 4).value = "出院人次";
      worksheet.getCell(2, 5).value = "无需随访人次";
      worksheet.getCell(2, 6).value = "应随访人次";
      // 4. 合并"再次出院随访"标题
      worksheet.mergeCells(2, 7, 2, 14); // G2:N2
      worksheet.getCell(2, 7).value = "再次出院随访";
      worksheet.getCell(2, 7).style = headerStyle;
      // 5. 设置行高
      worksheet.getRow(2).height = 28;
      worksheet.getRow(3).height = 25;
      // 6. 添加数据行
      data.forEach((item, rowIndex) => {
        const dataRow = worksheet.addRow(
          [
            "", // 展开列
            item.leavehospitaldistrictname || "",
            item.deptname || "",
            item.dischargeCount || 0,
            item.nonFollowUp || 0,
            item.followUpNeeded || 0,
            // 再次出院随访数据
            item.needFollowUpAgain || 0,
            item.pendingFollowUpAgain || 0,
            item.followUpSuccessAgain || 0,
            item.followUpFailAgain || 0,
            item.followUpRateAgain || "0%",
            item.manualAgain || 0,
            item.smsAgain || 0,
            item.weChatAgain || 0,
          ],
          rowIndex + 4
        );
        // 应用数据行样式
        dataRow.eachCell((cell) => {
          cell.style = cellStyle;
        });
        dataRow.height = 24;
      });
      // 7. 添加合计行
      const summaries = this.getSecondFollowUpSummaries(data);
      const summaryRow = worksheet.addRow(summaries);
      summaryRow.eachCell((cell, colNumber) => {
        cell.style = summaryStyle;
        if (colNumber === 1) {
          cell.value = "合计";
        }
      });
      summaryRow.height = 28;
      // 8. 设置列宽
      worksheet.columns = [
        { width: 8 }, // 展开列
        { width: 20 }, // 出院病区
        { width: 15 }, // 科室
        { width: 12 }, // 出院人次
        { width: 12 }, // 无需随访人次
        { width: 12 }, // 应随访人次
        // 再次出院随访列
        { width: 10 }, // 需随访
        { width: 10 }, // 待随访
        { width: 10 }, // 随访成功
        { width: 10 }, // 随访失败
        { width: 12 }, // 随访率
        { width: 8 }, // 人工
        { width: 8 }, // 短信
        { width: 8 }, // 微信
      ];
    },
    /** 再次随访数据合计行计算 */
    getSecondFollowUpSummaries(data) {
      const summaries = ["合计", "/", "/", 0, 0, 0, 0, 0, 0, 0, "0%", 0, 0, 0];
      data.forEach((item) => {
        // 数值字段求和
        summaries[3] += Number(item.dischargeCount) || 0;
        summaries[4] += Number(item.nonFollowUp) || 0;
        summaries[5] += Number(item.followUpNeeded) || 0;
        summaries[6] += Number(item.needFollowUpAgain) || 0;
        summaries[7] += Number(item.pendingFollowUpAgain) || 0;
        summaries[8] += Number(item.followUpSuccessAgain) || 0;
        summaries[9] += Number(item.followUpFailAgain) || 0;
        summaries[11] += Number(item.manualAgain) || 0;
        summaries[12] += Number(item.smsAgain) || 0;
        summaries[13] += Number(item.weChatAgain) || 0;
      });
      // 计算随访率百分比字段的平均值
      const followUpRateAgainValues = data
        .map((item) => this.extractPercentageValue(item.followUpRateAgain))
        .filter((value) => value !== null);
      if (followUpRateAgainValues.length > 0) {
        const avgFollowUpRateAgain =
          followUpRateAgainValues.reduce((sum, val) => sum + val, 0) /
          followUpRateAgainValues.length;
        summaries[10] = (avgFollowUpRateAgain * 100).toFixed(2) + "%";
      }
      // 格式化数字
      summaries[3] = this.formatNumber(summaries[3]);
      summaries[4] = this.formatNumber(summaries[4]);
      summaries[5] = this.formatNumber(summaries[5]);
      summaries[6] = this.formatNumber(summaries[6]);
      summaries[7] = this.formatNumber(summaries[7]);
      summaries[8] = this.formatNumber(summaries[8]);
      summaries[9] = this.formatNumber(summaries[9]);
      summaries[11] = this.formatNumber(summaries[11]);
      summaries[12] = this.formatNumber(summaries[12]);
      summaries[13] = this.formatNumber(summaries[13]);
      return summaries;
    },
    /** 再次随访表格的合计行计算方法 */
    getSummariesSecond(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        if (index === 1 || index === 2) {
          sums[index] = "/";
          return;
        }
        if (column.property === "followUpRateAgain") {
          const percentageValues = data
            .map((item) => {
              const value = item[column.property];
              if (!value || value === "-" || value === "0%") return null;
              if (typeof value === "string" && value.includes("%")) {
                const numValue = parseFloat(value.replace("%", "")) / 100;
                return isNaN(numValue) ? null : numValue;
              } else {
                const numValue = parseFloat(value);
                return isNaN(numValue) ? null : numValue;
              }
            })
            .filter((value) => value !== null && value !== 0);
          if (percentageValues.length > 0) {
            const average =
              percentageValues.reduce((sum, value) => sum + value, 0) /
              percentageValues.length;
            sums[index] = (average * 100).toFixed(2) + "%";
          } else {
            sums[index] = "0.00%";
          }
        } else {
          const values = data.map((item) => {
            const value = item[column.property];
            if (value === "-" || value === "" || value === null) return 0;
            return Number(value) || 0;
          });
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => prev + curr, 0);
            sums[index] = this.formatNumber(sums[index]);
          } else {
            sums[index] = "-";
          }
        }
      });
      return sums;
    },
    /** 再次随访内部表格合计行计算方法 */
    getInnerSummariesSecond(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "小计";
          return;
        }
        if (column.property === "drname" || column.property === "deptname") {
          sums[index] = "-";
          return;
        }
        if (column.property === "followUpRateAgain") {
          const percentageValues = data
            .map((item) => {
              const value = item[column.property];
              if (!value || value === "-" || value === "0%") return null;
              if (typeof value === "string" && value.includes("%")) {
                const numValue = parseFloat(value.replace("%", "")) / 100;
                return isNaN(numValue) ? null : numValue;
              } else {
                const numValue = parseFloat(value);
                return isNaN(numValue) ? null : numValue;
              }
            })
            .filter((value) => value !== null && value !== 0);
          if (percentageValues.length > 0) {
            const average =
              percentageValues.reduce((sum, value) => sum + value, 0) /
              percentageValues.length;
            sums[index] = (average * 100).toFixed(2) + "%";
          } else {
            sums[index] = "0.00%";
          }
        } else {
          const values = data.map((item) => {
            const value = item[column.property];
            if (value === "-" || value === "" || value === null) return 0;
            return Number(value) || 0;
          });
          if (!values.every((value) => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => prev + curr, 0);
            sums[index] = this.formatNumber(sums[index]);
          } else {
            sums[index] = "-";
          }
        }
      });
      return sums;
    },
    /** 再次随访表格的行点击展开 */
    handleRowClickSecond(row) {
      if (this.expandsSecond.includes(this.getRowKey(row))) {
        this.expandsSecond = [];
        return;
      }
      const params = {
        ...this.queryParams,
        deptcodes: this.queryParams.deptcodes.includes("all")
          ? this.allDeptCodes
          : this.queryParams.deptcodes,
        leavehospitaldistrictcodes: [row.leavehospitaldistrictcode],
        drcode: "1",
        visitCount: 2, // 设置为再次随访
      };
      delete params.leavehospitaldistrictcodes.all;
      delete params.deptcodes.all;
      if (!row.doctorStats) {
        this.loadingSecond = true;
        getSfStatistics(params).then((res) => {
          this.$set(row, "doctorStats", res.data);
          this.expandsSecond = [this.getRowKey(row)];
          this.loadingSecond = false;
        });
      } else {
        this.expandsSecond = [this.getRowKey(row)];
      }
    },
    /** 再次随访表格的多选框选中数据 */
    handleSelectionChangeSecond(selection) {
      this.idsSecond = selection.map((item) => item.tagid);
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    // 显示图表弹窗
    showChartDialog() {
      this.chartDialogVisible = true;
      this.$nextTick(() => {
        this.initPieChart();
        this.initBarLineChart();
      });
    },
    // 在methods中修改统计方法
    showChartDialog() {
      this.chartDialogVisible = true;
      this.$nextTick(() => {
        console.log(this.userList, "this.userList");
        this.initCharts();
      });
    },
    // 新增初始化图表方法
    initCharts() {
      this.initPieChart();
      this.initBarLineChart();
    },
    // 初始化饼图
    initPieChart() {
      const echarts = require("echarts");
      const pieDom = document.getElementById("pieChart");
      if (!pieDom) return;
      if (this.pieChart) {
        this.pieChart.dispose();
      }
      this.pieChart = echarts.init(pieDom);
      // 计算饼图数据
      const followUpData = {
        pending: 0,
        success: 0,
        fail: 0,
      };
      this.userList.forEach((item) => {
        followUpData.pending += item.pendingFollowUp || 0;
        followUpData.success += item.followUpSuccess || 0;
        followUpData.fail += item.followUpFail || 0;
      });
      // 使用更美观的颜色方案
      const pieOption = {
        title: {
          text: "随访状态分布",
          left: "center",
          textStyle: {
            color: "#333",
            fontSize: 16,
          },
        },
        tooltip: {
          trigger: "item",
          formatter: "{a} <br/>{b}: {c} ({d}%)",
        },
        legend: {
          orient: "vertical",
          left: "left",
          data: ["待随访", "随访成功", "随访失败"],
          textStyle: {
            color: "#666",
          },
        },
        color: ["#FF9D4D", "#36B37E", "#FF5C5C"], // 新的配色方案
        series: [
          {
            name: "随访状态",
            type: "pie",
            radius: ["40%", "70%"],
            avoidLabelOverlap: true,
            itemStyle: {
              borderRadius: 10,
              borderColor: "#fff",
              borderWidth: 2,
            },
            label: {
              show: true,
              formatter: "{b}: {c} ({d}%)",
              color: "#333",
            },
            emphasis: {
              label: {
                show: true,
                fontSize: "18",
                fontWeight: "bold",
              },
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            data: [
              {
                value: followUpData.pending,
                name: "待随访",
              },
              {
                value: followUpData.success,
                name: "随访成功",
              },
              {
                value: followUpData.fail,
                name: "随访失败",
              },
            ],
          },
        ],
      };
      this.pieChart.setOption(pieOption);
      window.addEventListener("resize", this.resizePieChart);
    },
    // 初始化柱状折线图
    initBarLineChart() {
      const echarts = require("echarts");
      const barDom = document.getElementById("barLineChart");
      if (!barDom) return;
      if (this.barLineChart) {
        this.barLineChart.dispose();
      }
      this.barLineChart = echarts.init(barDom);
      // 准备数据
      const categories = this.userList.map(
        (item) => item.leavehospitaldistrictname || item.deptname
      );
      const dischargeData = this.userList.map(
        (item) => item.dischargeCount || 0
      );
      const followUpData = this.userList.map(
        (item) => item.followUpNeeded || 0
      );
      // 新增两条折线数据
      const followUpRateData = this.userList.map((item) => {
        if (!item.followUpRate) return 0;
        // 去掉百分号并转为数字
        const rateStr = String(item.followUpRate).replace("%", "");
        return parseFloat(rateStr) || 0;
      });
      const timelyRateData = this.userList.map((item) =>
        item.rate ? (Number(item.rate) * 100).toFixed(2) : 0
      );
      const option = {
        title: {
          text: "科室/病区随访趋势",
          left: "center",
          textStyle: {
            color: "#333",
            fontSize: 16,
          },
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            crossStyle: {
              color: "#999",
            },
          },
        },
        legend: {
          data: ["出院人次", "应随访人次", "随访率(%)", "及时率(%)"],
          top: "bottom",
          textStyle: {
            color: "#666",
          },
        },
        color: ["#5470C6", "#91CC75", "#EE6666", "#9A60B4"], // 新增紫色用于及时率
        xAxis: {
          type: "category",
          data: categories,
          axisLabel: {
            interval: 0,
            rotate: 30,
            color: "#666",
          },
          axisLine: {
            lineStyle: {
              color: "#ddd",
            },
          },
        },
        yAxis: [
          {
            type: "value",
            name: "人次",
            min: 0,
            axisLabel: {
              color: "#666",
            },
            axisLine: {
              lineStyle: {
                color: "#ddd",
              },
            },
            splitLine: {
              lineStyle: {
                color: "#f0f0f0",
              },
            },
          },
          {
            type: "value",
            name: "百分比(%)",
            min: 0,
            max: 100,
            axisLabel: {
              color: "#666",
              formatter: "{value}%",
            },
            axisLine: {
              lineStyle: {
                color: "#ddd",
              },
            },
            splitLine: {
              show: false,
            },
          },
        ],
        series: [
          {
            name: "出院人次",
            type: "bar",
            barWidth: "25%",
            data: dischargeData,
            itemStyle: {
              borderRadius: [4, 4, 0, 0],
            },
          },
          {
            name: "应随访人次",
            type: "bar",
            barWidth: "25%",
            data: followUpData,
            itemStyle: {
              borderRadius: [4, 4, 0, 0],
            },
          },
          {
            name: "随访率(%)",
            type: "line",
            yAxisIndex: 1,
            data: followUpRateData,
            symbolSize: 8,
            lineStyle: {
              width: 3,
            },
            markLine: {
              silent: true,
              data: [
                {
                  yAxis: 80,
                  lineStyle: {
                    color: "#EE6666",
                    type: "dashed",
                  },
                  // label: {
                  //   position: 'end',
                  //   formatter: '目标80%'
                  // }
                },
              ],
            },
          },
          {
            name: "及时率(%)",
            type: "line",
            yAxisIndex: 1,
            data: timelyRateData,
            symbolSize: 8,
            lineStyle: {
              width: 3,
              type: "dotted", // 使用虚线区分
            },
            markLine: {
              silent: true,
              data: [
                {
                  yAxis: 90,
                  lineStyle: {
                    color: "#9A60B4",
                    type: "dashed",
                  },
                  // label: {
                  //   position: 'end',
                  //   formatter: '目标90%'
                  // }
                },
              ],
            },
          },
        ],
        grid: {
          top: "15%",
          left: "3%",
          right: "4%",
          bottom: "15%",
          containLabel: true,
        },
      };
      this.barLineChart.setOption(option);
      window.addEventListener("resize", this.resizeBarLineChart);
    },
    // 图表响应式调整方法
    resizePieChart() {
      if (this.pieChart) {
        this.pieChart.resize();
      }
    },
    resizeBarLineChart() {
      if (this.barLineChart) {
        this.barLineChart.resize();
      }
    },
    // 在组件销毁时清理
    beforeDestroy() {
      // 移除事件监听
      window.removeEventListener("resize", this.resizePieChart);
      window.removeEventListener("resize", this.resizeBarLineChart);
      // 销毁图表实例
      if (this.pieChart) {
        this.pieChart.dispose();
        this.pieChart = null;
      }
      if (this.barLineChart) {
        this.barLineChart.dispose();
        this.barLineChart = null;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-tabs__header {
  margin-bottom: 20px;
}
::v-deep .el-tabs__item {
  font-size: 16px;
  padding: 0 20px;
  height: 40px;
  line-height: 40px;
}
::v-deep .el-tabs__active-bar {
  height: 3px;
}
/* Tab内容区域样式 */
.el-tab-pane {
  .your-table-container {
    margin-top: 10px;
  }
}
.sidecolumn {
  width: 180px;
  min-height: 100vh;
@@ -869,6 +3543,53 @@
  text-align: left;
  font-size: 20px;
}
// 美化合计行样式
::v-deep .el-table__footer {
  .el-table__cell {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #409eff;
    .cell {
      font-weight: 600;
      color: #409eff;
    }
  }
}
// 内部表格合计行样式
::v-deep .inner-table .el-table__footer {
  .el-table__cell {
    background-color: #ecf5ff;
    font-weight: 500;
    color: #67c23a;
    .cell {
      font-weight: 500;
      color: #67c23a;
    }
  }
}
// 百分比字段特殊样式
.your-table-container
  ::v-deep
  .el-table__footer
  .el-table__cell[data-field="followUpRate"]
  .cell,
.your-table-container
  ::v-deep
  .el-table__footer
  .el-table__cell[data-field="rate"]
  .cell,
.your-table-container
  ::v-deep
  .el-table__footer
  .el-table__cell[data-field="followUpRateAgain"]
  .cell {
  color: #e6a23c !important;
  font-weight: 700 !important;
}
.leftvlue {
  //   display: flex;
@@ -885,10 +3606,60 @@
    font-size: 20px;
  }
}
/* 使行有手型指针 */
.el-table__row {
  cursor: pointer;
}
/* 内层医生表格样式 */
.inner-table {
  // 表头背景色
  ::v-deep .el-table__header-wrapper {
    background-color: #f0f7ff !important;
    th {
      background-color: #f0f7ff !important;
    }
  }
  // 表格行背景色
  ::v-deep .el-table__body-wrapper {
    tr {
      background-color: #f9fbfe !important;
      &:hover {
        background-color: #e6f1ff !important;
      }
    }
  }
  // 边框颜色
  ::v-deep .el-table--border {
    border-color: #d9e8ff !important;
    td,
    th {
      border-color: #d9e8ff !important;
    }
  }
  // 斑马纹效果
  ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
    background-color: #f5f9ff !important;
  }
}
/* 展开行样式 */
.el-table__expanded-cell {
  padding: 10px 0 !important;
  background: #f8f8f8;
}
.document {
  width: 100px;
  height: 50px;
}
.data-list {
  max-height: 800px;
  overflow-y: auto;
}
.documentf {
  display: flex;
  justify-content: flex-end;