<template>
  <page-layer>
    <template #header>
      <el-select v-model="inquiry.visitType" style="width: 60px" @change="handleVisitTypeChange">
        <el-option label="门诊" value="OUTPATIENT"></el-option>
        <el-option label="住院" value="INPATIENT"></el-option>
      </el-select>
      <el-date-picker type="daterange" v-model="dateRange" style="width: 200px" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
      <el-divider direction="vertical"></el-divider>
      <el-checkbox v-model="inquiry.onlyShowUnsatisfied" @change="handleSatisfiedChange">只看含有“不满意”的问卷</el-checkbox>
      <el-button icon="Search" type="primary" @click="fetchAssessments" style="margin-left: 4px">检索</el-button>
      <el-button icon="DataAnalysis" type="success" @click="executeAssessmentAnalyse" style="margin-left: 12px">问卷分析</el-button>
      <el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
    </template>
    <template #main>
      <el-table v-if="inquiry.visitType === 'OUTPATIENT'" :data="assessments.list" stripe :height="tableHeight" highlight-current-row>
        <el-table-column prop="item11" label="门急诊导诊及护理"></el-table-column>
        <el-table-column prop="item13" label="门急诊医生"></el-table-column>
        <el-table-column prop="item1" label="药剂科"></el-table-column>
        <el-table-column prop="item3" label="放射科"></el-table-column>
        <el-table-column prop="item5" label="超声影像科"></el-table-column>
        <el-table-column prop="item7" label="检验科"></el-table-column>
        <el-table-column prop="item9" label="收费窗口"></el-table-column>
        <el-table-column prop="item15" label="医保科"></el-table-column>
        <el-table-column prop="item1002" label="选择我院的原因"></el-table-column>
        <el-table-column prop="item1004" label="是否会再次选择我院"></el-table-column>
        <el-table-column prop="item1006" label="整体评价"></el-table-column>
        <el-table-column prop="satisfyStaff" label="满意的医生护士"></el-table-column>
        <el-table-column prop="suggestion" label="意见和建议"></el-table-column>
        <el-table-column prop="createDatetime" label="问卷时间"></el-table-column>
        <el-table-column label="操作">
          <template #default="scope">
            <el-button v-if="scope.row.deleted === 0" icon="Delete" type="danger" @click="changeAssessmentStatus(scope.row, 1)">删除</el-button>
            <el-button v-else icon="Refresh" type="success" @click="changeAssessmentStatus(scope.row, 0)">恢复</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-table v-else :data="assessments.list" stripe :height="tableHeight" highlight-current-row>
        <el-table-column prop="item1" label="护理人员"></el-table-column>
        <el-table-column prop="item3" label="科室医生"></el-table-column>
        <el-table-column prop="item5" label="环境卫生"></el-table-column>
        <el-table-column prop="item7" label="食堂"></el-table-column>
        <el-table-column prop="item9" label="药剂科"></el-table-column>
        <el-table-column prop="item11" label="放射科"></el-table-column>
        <el-table-column prop="item13" label="超声影像科"></el-table-column>
        <el-table-column prop="item15" label="检验科"></el-table-column>
        <el-table-column prop="item17" label="收费窗口"></el-table-column>
        <el-table-column prop="item19" label="门诊医护"></el-table-column>
        <el-table-column prop="item21" label="急诊医护"></el-table-column>
        <el-table-column prop="item23" label="医保科"></el-table-column>
        <el-table-column prop="item1002" label="选择我院的原因"></el-table-column>
        <el-table-column prop="item1004" label="是否会再次选择我院"></el-table-column>
        <el-table-column prop="item1006" label="整体评价"></el-table-column>
        <el-table-column prop="satisfyStaff" label="满意的医生护士"></el-table-column>
        <el-table-column prop="suggestion" label="意见和建议"></el-table-column>
        <el-table-column prop="createDatetime" label="问卷时间"></el-table-column>
        <el-table-column label="操作">
          <template #default="scope">
            <el-button v-if="scope.row.deleted === 0" icon="Delete" type="danger" @click="changeAssessmentStatus(scope.row, 1)">删除</el-button>
            <el-button v-else icon="Refresh" type="success" @click="changeAssessmentStatus(scope.row, 0)">恢复</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="inquiry.pageNum"
          :page-sizes="[30, 50, 70, 100]"
          :page-size="inquiry.pageSize"
          layout="total, sizes, prev, pager, next"
          :total="assessments.totalSize"
          style="margin-top: 5px"
      ></el-pagination>
      <el-dialog v-model="showAnalyzeResult" :title="titleOfAnalyze" width="95%" :close-on-click-modal="false">
        <div style="font-size: 14px; font-weight: bold; color: black; margin-top: -12px;border-bottom: 2px solid black;padding-bottom: 8px">
          所有问卷总量：{{ analyzeResult.totalAssessmentsCount }}
          <el-divider direction="vertical"></el-divider>
          所有含有“不满意”的问卷量：{{ analyzeResult.totalUnsatisfiedCount }}（{{ analyzeResult.totalUnsatisfiedPercentage }}）
        </div>
        <div style="width: 100%; display: flex; flex-wrap: nowrap">
          <div style="width: 80%">
            <div style="margin-top: 12px; color: red; font-weight: bold">
              * 以下所有统计均不包含“未接触”
            </div>
            <div style="font-size: 14px; font-weight: bold; color: black; margin-top: 8px;border-bottom: 1px dashed lightgray;padding-bottom: 8px">
              问卷选项总量：{{ analyzeResult.totalOptionCount }}
              <el-divider direction="vertical"></el-divider>
              “不满意”选项数量：{{ analyzeResult.totalUnsatisfiedOptionCount }}（{{ analyzeResult.totalUnsatisfiedOptionPercentage }}）
            </div>
            <div>
              <div v-if="inquiry.visitType==='INPATIENT'" class="flex-line">
                <div class="flex-child">
                  <div class="department-name">● 护理人员</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.hlryAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.hlryUnsatisfiedCount}}&nbsp;({{analyzeResult.hlryUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.hlryUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.hlryUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.hlryUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">技术水平</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.jsspCount }}（{{analyzeResult.hlryUnsatisfiedOption.jsspPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">隐私保护</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.ysbhCount }}（{{analyzeResult.hlryUnsatisfiedOption.ysbhPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.fwtdCount }}（{{analyzeResult.hlryUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.gtjsCount }}（{{analyzeResult.hlryUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">病情巡视</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.bqxsCount }}（{{analyzeResult.hlryUnsatisfiedOption.bqxsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.fzlyCount }}（{{analyzeResult.hlryUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">其他</span>不满意数量：{{ analyzeResult.hlryUnsatisfiedOption.qtCount }}（{{analyzeResult.hlryUnsatisfiedOption.qtPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 科室医生</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.ksysAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.ksysUnsatisfiedCount}}&nbsp;({{analyzeResult.ksysUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.ksysUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.ksysUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.ksysUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">技术水平</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.jsspCount }}（{{analyzeResult.ksysUnsatisfiedOption.jsspPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">隐私保护</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.ysbhCount }}（{{analyzeResult.ksysUnsatisfiedOption.ysbhPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.fwtdCount }}（{{analyzeResult.ksysUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.gtjsCount }}（{{analyzeResult.ksysUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">按时查房</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.ascfCount }}（{{analyzeResult.ksysUnsatisfiedOption.ascfPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.fzlyCount }}（{{analyzeResult.ksysUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">其他</span>不满意数量：{{ analyzeResult.ksysUnsatisfiedOption.qtCount }}（{{analyzeResult.ksysUnsatisfiedOption.qtPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 环境卫生</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.hjwsAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.hjwsUnsatisfiedCount}}&nbsp;({{analyzeResult.hjwsUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.hjwsUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.hjwsUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.hjwsUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">卫生情况</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.wsqkCount }}（{{analyzeResult.hjwsUnsatisfiedOption.wsqkPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">布局不合理</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.bjbhlCount }}（{{analyzeResult.hjwsUnsatisfiedOption.bjbhlPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.fwtdCount }}（{{analyzeResult.hjwsUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">舒适度</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.ssdCount }}（{{analyzeResult.hjwsUnsatisfiedOption.ssdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">按时清理</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.asqlCount }}（{{analyzeResult.hjwsUnsatisfiedOption.asqlPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.fzlyCount }}（{{analyzeResult.hjwsUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">其他</span>不满意数量：{{ analyzeResult.hjwsUnsatisfiedOption.qtCount }}（{{analyzeResult.hjwsUnsatisfiedOption.qtPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 食堂</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.stAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.stUnsatisfiedCount}}&nbsp;({{analyzeResult.stUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.stUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.stUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.stUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">卫生情况</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.wsqkCount }}（{{analyzeResult.stUnsatisfiedOption.wsqkPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">口味</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.kwCount }}（{{analyzeResult.stUnsatisfiedOption.kwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">菜品</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.cpCount }}（{{analyzeResult.stUnsatisfiedOption.cpPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.fwtdCount }}（{{analyzeResult.stUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.fzlyCount }}（{{analyzeResult.stUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">其他</span>不满意数量：{{ analyzeResult.stUnsatisfiedOption.qtCount }}（{{analyzeResult.stUnsatisfiedOption.qtPercentage}}）</div>
                </div>
              </div>
              <div class="flex-line">

                <div class="flex-child">
                  <div class="department-name">● 药剂科</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.yjkAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.yjkUnsatisfiedCount}}&nbsp;({{analyzeResult.yjkUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.yjkUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.yjkUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.yjkUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.jhfwCount }}（{{analyzeResult.yjkUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.ddscCount }}（{{analyzeResult.yjkUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.fwtdCount }}（{{analyzeResult.yjkUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.gtjsCount }}（{{analyzeResult.yjkUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.jsxyCount }}（{{analyzeResult.yjkUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.fzlyCount }}（{{analyzeResult.yjkUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.yjkUnsatisfiedOption.zqlCount }}（{{analyzeResult.yjkUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 放射科</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.fskAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.fskUnsatisfiedCount}}&nbsp;({{analyzeResult.fskUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.fskUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.fskUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.fskUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div v-if="inquiry.visitType==='OUTPATIENT'">
                    <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.jhfwCount }}（{{analyzeResult.fskUnsatisfiedOption.jhfwPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.ddscCount }}（{{analyzeResult.fskUnsatisfiedOption.ddscPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.fwtdCount }}（{{analyzeResult.fskUnsatisfiedOption.fwtdPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.gtjsCount }}（{{analyzeResult.fskUnsatisfiedOption.gtjsPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.jsxyCount }}（{{analyzeResult.fskUnsatisfiedOption.jsxyPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.fzlyCount }}（{{analyzeResult.fskUnsatisfiedOption.fzlyPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.zqlCount }}（{{analyzeResult.fskUnsatisfiedOption.zqlPercentage}}）</div>
                  </div>
                  <div v-else>
                    <div class="option-detail"><span class="option-name">技术水平</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.jsspCount }}（{{analyzeResult.fskUnsatisfiedOption.jsspPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">隐私保护</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.ysbhCount }}（{{analyzeResult.fskUnsatisfiedOption.ysbhPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.fwtdCount }}（{{analyzeResult.fskUnsatisfiedOption.fwtdPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.gtjsCount }}（{{analyzeResult.fskUnsatisfiedOption.gtjsPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">按时查房</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.ascfCount }}（{{analyzeResult.fskUnsatisfiedOption.ascfPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.fzlyCount }}（{{analyzeResult.fskUnsatisfiedOption.fzlyPercentage}}）</div>
                    <div class="option-detail"><span class="option-name">其他</span>不满意数量：{{ analyzeResult.fskUnsatisfiedOption.qtCount }}（{{analyzeResult.fskUnsatisfiedOption.qtPercentage}}）</div>
                  </div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 超声影像科</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.csyxkAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.csyxkUnsatisfiedCount}}&nbsp;({{analyzeResult.csyxkUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.csyxkUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.csyxkUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.csyxkUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.jhfwCount }}（{{analyzeResult.csyxkUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.ddscCount }}（{{analyzeResult.csyxkUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.fwtdCount }}（{{analyzeResult.csyxkUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.gtjsCount }}（{{analyzeResult.csyxkUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.jsxyCount }}（{{analyzeResult.csyxkUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.fzlyCount }}（{{analyzeResult.csyxkUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.csyxkUnsatisfiedOption.zqlCount }}（{{analyzeResult.csyxkUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 检验科</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.jykAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.jykUnsatisfiedCount}}&nbsp;({{analyzeResult.jykUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.jykUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.jykUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.jykUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.jhfwCount }}（{{analyzeResult.jykUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.ddscCount }}（{{analyzeResult.jykUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.fwtdCount }}（{{analyzeResult.jykUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.gtjsCount }}（{{analyzeResult.jykUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.jsxyCount }}（{{analyzeResult.jykUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.fzlyCount }}（{{analyzeResult.jykUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.jykUnsatisfiedOption.zqlCount }}（{{analyzeResult.jykUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
              </div>
              <div style="width: 100%; height: 1px; margin: 12px 0 2px 0; border-bottom: 1px dashed lightgray"></div>
              <div class="flex-line">
                <div class="flex-child">
                  <div class="department-name">● 收费窗口</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.sfckAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.sfckUnsatisfiedCount}}&nbsp;({{analyzeResult.sfckUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.sfckUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.sfckUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.sfckUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.jhfwCount }}（{{analyzeResult.sfckUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.ddscCount }}（{{analyzeResult.sfckUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.fwtdCount }}（{{analyzeResult.sfckUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.gtjsCount }}（{{analyzeResult.sfckUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.jsxyCount }}（{{analyzeResult.sfckUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.fzlyCount }}（{{analyzeResult.sfckUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.sfckUnsatisfiedOption.zqlCount }}（{{analyzeResult.sfckUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
                <div v-if="inquiry.visitType === 'INPATIENT'" class="flex-child">
                  <div class="department-name">● 急诊医护人员</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.jzyhAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.jzyhUnsatisfiedCount}}&nbsp;({{analyzeResult.jzyhUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.jzyhUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.jzyhUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.jzyhUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.jhfwCount }}（{{analyzeResult.jzyhUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.ddscCount }}（{{analyzeResult.jzyhUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.fwtdCount }}（{{analyzeResult.jzyhUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.gtjsCount }}（{{analyzeResult.jzyhUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.jsxyCount }}（{{analyzeResult.jzyhUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.fzlyCount }}（{{analyzeResult.jzyhUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.jzyhUnsatisfiedOption.zqlCount }}（{{analyzeResult.jzyhUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
                <div v-else class="flex-child">
                  <div class="department-name">● 门急诊导诊及护理人员</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.mjzdzhlAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.mjzdzhlUnsatisfiedCount}}&nbsp;({{analyzeResult.mjzdzhlUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.mjzdzhlUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.mjzdzhlUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.mjzdzhlUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">技术水平</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.jsspCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.jsspPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">隐私保护</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.ysbhCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.ysbhPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.fwtdCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.gtjsCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">病情巡视</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.bqxsCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.bqxsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.mjzdzhlUnsatisfiedOption.fzlyCount }}（{{analyzeResult.mjzdzhlUnsatisfiedOption.fzlyPercentage}}）</div>
                </div>

                <div v-if="inquiry.visitType === 'INPATIENT'" class="flex-child">
                  <div class="department-name">● 门诊医护人员</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.mzyhAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.mzyhUnsatisfiedCount}}&nbsp;({{analyzeResult.mzyhUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.mzyhUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.mzyhUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.mzyhUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">叫号服务</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.jhfwCount }}（{{analyzeResult.mzyhUnsatisfiedOption.jhfwPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">等待时长</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.ddscCount }}（{{analyzeResult.mzyhUnsatisfiedOption.ddscPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.fwtdCount }}（{{analyzeResult.mzyhUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.gtjsCount }}（{{analyzeResult.mzyhUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">及时响应</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.jsxyCount }}（{{analyzeResult.mzyhUnsatisfiedOption.jsxyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.fzlyCount }}（{{analyzeResult.mzyhUnsatisfiedOption.fzlyPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">准确率</span>不满意数量：{{ analyzeResult.mzyhUnsatisfiedOption.zqlCount }}（{{analyzeResult.mzyhUnsatisfiedOption.zqlPercentage}}）</div>
                </div>
                <div v-else class="flex-child">
                  <div class="department-name">● 门急诊医生</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.mjzysAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.mjzysUnsatisfiedCount}}&nbsp;({{analyzeResult.mjzysUnsatisfiedPercentage}})
                    <div>
                      指标总量：{{analyzeResult.mjzysUnsatisfiedOption.totalOptionSize}}，
                      不满意指标量：{{analyzeResult.mjzysUnsatisfiedOption.checkedOptionSize}}&nbsp;
                      ({{analyzeResult.mjzysUnsatisfiedOption.checkedOptionPercentage}})
                    </div>
                  </div>
                  <div class="option-summary">- 不满意指标详情</div>
                  <div class="option-detail"><span class="option-name">技术水平</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.jsspCount }}（{{analyzeResult.mjzysUnsatisfiedOption.jsspPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">隐私保护</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.ysbhCount }}（{{analyzeResult.mjzysUnsatisfiedOption.ysbhPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务态度</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.fwtdCount }}（{{analyzeResult.mjzysUnsatisfiedOption.fwtdPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">沟通解释</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.gtjsCount }}（{{analyzeResult.mjzysUnsatisfiedOption.gtjsPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">按时坐诊</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.aszzCount }}（{{analyzeResult.mjzysUnsatisfiedOption.aszzPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服装礼仪</span>不满意数量：{{ analyzeResult.mjzysUnsatisfiedOption.fzlyCount }}（{{analyzeResult.mjzysUnsatisfiedOption.fzlyPercentage}}）</div>
                </div>

                <div class="flex-child">
                  <div class="department-name">● 医保科</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.ybkAssessmentCount}}，
                    不满意问卷量：{{analyzeResult.ybkUnsatisfiedCount}}&nbsp;({{analyzeResult.ybkUnsatisfiedPercentage}})
                    <div>
                      指标总量：无，
                      不满意指标量：无&nbsp;
                    </div>
                  </div>
                </div>
              </div>
              <div style="width: 100%; height: 1px; margin: 12px 0 2px 0; border-bottom: 1px dashed lightgray"></div>
              <div class="flex-line">
                <div class="flex-child">
                  <div class="department-name">● 选择我院的原因</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.whyChooseHere.totalCount}}
                  </div>
                  <div class="option-summary">- 原因详情</div>
                  <div class="option-detail"><span class="option-name">慕名而来</span>数量：{{ analyzeResult.whyChooseHere.mmelCount }}（{{analyzeResult.whyChooseHere.mmelPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">就近选择</span>数量：{{ analyzeResult.whyChooseHere.jjxzCount }}（{{analyzeResult.whyChooseHere.jjxzPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">朋友推荐</span>数量：{{ analyzeResult.whyChooseHere.pytjCount }}（{{analyzeResult.whyChooseHere.pytjPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">网络查询</span>数量：{{ analyzeResult.whyChooseHere.wlcxCount }}（{{analyzeResult.whyChooseHere.wlcxPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">服务水平</span>数量：{{ analyzeResult.whyChooseHere.fwspCount }}（{{analyzeResult.whyChooseHere.fwspPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">环境设备</span>数量：{{ analyzeResult.whyChooseHere.hjsbCount }}（{{analyzeResult.whyChooseHere.hjsbPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">医疗价格</span>数量：{{ analyzeResult.whyChooseHere.yljgCount }}（{{analyzeResult.whyChooseHere.yljgPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 是否会再次选择我院</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.willComeAgain.totalCount}}
                  </div>
                  <div class="option-summary">- 结果详情</div>
                  <div class="option-detail"><span class="option-name">会</span>数量：{{ analyzeResult.willComeAgain.yesCount }}（{{analyzeResult.willComeAgain.yesPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">不会</span>数量：{{ analyzeResult.willComeAgain.noCount }}（{{analyzeResult.willComeAgain.noPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">不一定</span>数量：{{ analyzeResult.willComeAgain.bydCount }}（{{analyzeResult.willComeAgain.bydPercentage}}）</div>
                </div>
                <div class="flex-child">
                  <div class="department-name">● 整体评价(1-10分)</div>
                  <div class="department-summary">
                    问卷总量：{{analyzeResult.gradeNum.totalCount}}
                  </div>
                  <div class="option-summary">- 评分详情</div>
                  <div class="option-detail"><span class="option-name">1分</span>数量：{{ analyzeResult.gradeNum.oneCount }}（{{analyzeResult.gradeNum.onePercentage}}）</div>
                  <div class="option-detail"><span class="option-name">2分</span>数量：{{ analyzeResult.gradeNum.twoCount }}（{{analyzeResult.gradeNum.twoPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">3分</span>数量：{{ analyzeResult.gradeNum.threeCount }}（{{analyzeResult.gradeNum.threePercentage}}）</div>
                  <div class="option-detail"><span class="option-name">4分</span>数量：{{ analyzeResult.gradeNum.fourCount }}（{{analyzeResult.gradeNum.fourPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">5分</span>数量：{{ analyzeResult.gradeNum.fiveCount }}（{{analyzeResult.gradeNum.fivePercentage}}）</div>
                  <div class="option-detail"><span class="option-name">6分</span>数量：{{ analyzeResult.gradeNum.sixCount }}（{{analyzeResult.gradeNum.sixPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">7分</span>数量：{{ analyzeResult.gradeNum.sevenCount }}（{{analyzeResult.gradeNum.sevenPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">8分</span>数量：{{ analyzeResult.gradeNum.eightCount }}（{{analyzeResult.gradeNum.eightPercentage}}）</div>
                  <div class="option-detail"><span class="option-name">9分</span>数量：{{ analyzeResult.gradeNum.nineCount }}（{{analyzeResult.gradeNum.ninePercentage}}）</div>
                  <div class="option-detail"><span class="option-name">10分</span>数量：{{ analyzeResult.gradeNum.tenCount }}（{{analyzeResult.gradeNum.tenPercentage}}）</div>
                </div>
              </div>
            </div>
          </div>
          <div style="width: 20%; height: 600px;">
            <div style="font-size: 14px; font-weight: bold; color: black; margin: 4px 0 4px 8px;border-bottom: 1px dashed lightgray;padding-bottom: 4px">
              建议与意见
            </div>
            <div style="height: 580px; overflow-y: auto; padding: 0 8px 0 8px;">
              <div v-for="item in analyzeResult.suggestions">
                <div style="color: black">{{item.suggestion}}</div>
                <div style="width: 100%; text-align: right; padding: 4px 8px 0 0;color: #54545b;font-size: 12px">
                  <span v-if="inquiry.visitType === 'INPATIENT'">{{item.deptName}}&nbsp;/&nbsp;</span>
                  {{item.patientId}}&nbsp;/&nbsp;{{item.patName}}&nbsp;/&nbsp;{{item.createDatetime}}
                </div>
                <div style="width: 100%; height: 2px;border-bottom: 1px dashed #6b778c;margin-bottom: 4px"></div>
              </div>
            </div>
          </div>
        </div>
      </el-dialog>
    </template>
  </page-layer>
</template>
<script setup>
import PageLayer from "@/layout/PageLayer.vue";
import {
  getSatisfiedBodies,
  updateAssessmentStatus,
  assessmentsAnalyse,
  getAllSatisfiedBodies
} from "@/api/outpatient/clinic-satisfied";
import store from "@/store";
import {ElMessage} from "element-plus";
import {Export} from "@/utils/ExportExcel";
import {getDateRangeFormatDate} from "@/utils/date";

const windowSize = store.state.app.windowSize
const tableHeight = windowSize.h - 55

const dateRange = ref([])

const formatDateRange = () => {
  if (dateRange.value.length === 2) {
    const format = getDateRangeFormatDate(dateRange.value)
    inquiry.start = format.startTime
    inquiry.end = format.endTime
  }
}

const inquiry = reactive({
  visitType: 'OUTPATIENT',
  start: null,
  end: null,
  pageNum: 1,
  pageSize: 30,
  onlyShowUnsatisfied: false
})

const assessments = reactive({
  totalSize: 0,
  list: []
})

const showAnalyzeResult = ref(false)
const analyzeResult = ref({})

const titleOfAnalyze = computed(() => {
  return inquiry.visitType === 'OUTPATIENT' ?
      '门诊满意度调查分析' : '住院满意度调查分析'
})

const handleVisitTypeChange = () => {
  assessments.totalSize = 0
  assessments.list = []
}

const fetchAssessments = () => {
  formatDateRange()
  getSatisfiedBodies(inquiry).then(res => {
    assessments.totalSize = res.totalSize
    assessments.list = res.list
  }).catch(() => {
    assessments.totalSize = 0
    assessments.list = []
  })
}

const executeAssessmentAnalyse = () => {
  formatDateRange()
  assessmentsAnalyse(inquiry).then(res => {
    analyzeResult.value = res
    showAnalyzeResult.value = true
    console.log(res)
  })
}

const handleSatisfiedChange = () =>　{
  inquiry.pageNum = 1
  fetchAssessments()
}

const handleSizeChange = (val) => {
  inquiry.pageSize = val
  fetchAssessments()
}
const handleCurrentChange = (val) => {
  inquiry.pageNum = val
  fetchAssessments()
}

const changeAssessmentStatus = (row, deleted) => {
  const params = {
    visitType: inquiry.visitType,
    id: row.id,
    deleted: deleted,
  }
  updateAssessmentStatus(params).then(res => {
    row.deleted = deleted
    ElMessage({
      message: res,
      type: 'success',
      showClose: true,
      duration: 2000
    })
  })
}

const exportExcel = () => {
  let fields;
  if (inquiry.visitType === 'OUTPATIENT') {
    fields = {
      item1: '对药剂科工作人员',
      item3: '对放射科工作人员',
      item5: '对超声影像科工作人员',
      item7: '对检验科工作人员',
      item9: '对收费窗口工作人员',
      item11: '对门急诊导诊及护理人员',
      item13: '对门急诊医生',
      item15: '对医保科',
      item1002: '选择我院的原因',
      item1004: '是否会再次选择我院',
      item1006: '整体评价（1-10分）',
      satisfyStaff: '最满意的医生护士',
      suggestion: '建议与意见'
    };
  } else {
    fields = {
      item1: '对护理人员',
      item3: '对科室医生',
      item5: '对环境卫生',
      item7: '对食堂',
      item9: '对药剂科工作人员',
      item11: '对放射科工作人员',
      item13: '对超声影像科工作人员',
      item15: '对检验科工作人员',
      item17: '对收费窗口工作人员',
      item19: '对门诊医护人员',
      item21: '对急诊医护人员',
      item23: '对医保科',
      item1002: '选择我院的原因',
      item1004: '是否会再次选择我院',
      item1006: '整体评价（1-10分）',
      satisfyStaff: '最满意的医生护士',
      suggestion: '建议与意见'
    };
  }
  formatDateRange();
  getAllSatisfiedBodies(inquiry).then(res => {
    Export(res, fields, titleOfAnalyze.value)
  })
}

</script>

<style scoped>
.flex-line {
  display: flex;
}
.flex-child {
  width: 25%;
}
.department-name {
  font-weight: bold;
  margin-top: 12px;
}
.department-summary {
  margin-top: 4px;
  padding-left: 10px;
  color: darkred;
}
.option-summary {
  margin-top: 4px;
  padding-left: 10px;
  font-weight: bold;
}
.option-detail {
  margin-top: 4px;
  padding-left: 18px;
}
.option-name {
  color: #222222;
  font-weight: bold;
}
</style>