Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

xiaochan 2 years ago
parent
commit
5abfd8f056

+ 7 - 0
src/api/dictionary/fetch-dictionaries.js

@@ -20,3 +20,10 @@ export function fetchRelationDictionary() {
     method: 'get',
   })
 }
+
+export function fetchPsnCertTypeDictionary() {
+  return request({
+    url: '/fetchDictionaries/psnCertType',
+    method: 'get',
+  })
+}

+ 15 - 0
src/api/medical-insurance/si-manage.js

@@ -79,4 +79,19 @@ export function siUploadSheets(data) {
     data,
     jdtTitle: '病案首页上传',
   })
+}
+
+export function queryDeptInfo() {
+  return request({
+    url: '/siManage/queryDeptInfo',
+    method: 'post',
+  })
+}
+
+export function queryMedStaffInfo(data) {
+  return request({
+    url: '/siManage/queryMedStaffInfo',
+    method: 'post',
+    data
+  })
 }

+ 17 - 2
src/router/modules/dashboard.js

@@ -203,7 +203,7 @@ const route = [
             },
             {
                 path: 'qryManage/catalogue',
-                component: createNameComponent(() => import('@/views/medical-insurance/allpatient/Catalogue.vue')),
+                component: createNameComponent(() => import('@/views/medical-insurance/management/Catalogue.vue')),
                 meta: {title: '目录管理'},
             },
             {
@@ -256,9 +256,24 @@ const route = [
             },
             {
                 path: 'qryManage/logAnalyse',
-                component: createNameComponent(() => import('@/views/medical-insurance/allpatient/LogAnalyse.vue')),
+                component: createNameComponent(() => import('@/views/medical-insurance/management/LogAnalyse.vue')),
                 meta: {title: '日志分析'},
             },
+            {
+                path: 'qryManage/catalogue',
+                component: createNameComponent(() => import('@/views/medical-insurance/management/Catalogue.vue')),
+                meta: {title: '目录管理'},
+            },
+            {
+                path: 'qryManage/supplementary',
+                component: createNameComponent(() => import('@/views/medical-insurance/management/SupplementaryInquiry.vue')),
+                meta: {title: '辅助查询'},
+            },
+            {
+                path: 'qryManage/recordManagement',
+                component: createNameComponent(() => import('@/views/medical-insurance/management/RecordManagement.vue')),
+                meta: {title: '备案管理'},
+            },
             {
                 path: 'qryManage/insurIncomeAnalysis',
                 component: createNameComponent(() => import('@/views/medical-insurance/allpatient/InsurIncomeAnalysis.vue')),

+ 0 - 0
src/views/medical-insurance/allpatient/Catalogue.vue → src/views/medical-insurance/management/Catalogue.vue


+ 0 - 0
src/views/medical-insurance/allpatient/LogAnalyse.vue → src/views/medical-insurance/management/LogAnalyse.vue


+ 594 - 0
src/views/medical-insurance/management/RecordManagement.vue

@@ -0,0 +1,594 @@
+<template>
+  <page-layer>
+      <template #header>
+          <el-select v-model="recordType" style="width: 120px">
+              <el-option v-for="item in allRecordTypes" :label="item.label" :value="item.value"></el-option>
+          </el-select>&nbsp;&nbsp;
+          <el-input v-model="psnIdNumber" placeholder="人员身份证号" clearable style="width: 180px"></el-input>
+          <el-divider direction="vertical"></el-divider>
+          <el-button type="success" @click="queryPsnBaseInfo">参保信息</el-button>
+          <el-button type="primary" @click="startApplyRecord"> 开始备案 </el-button>
+          <el-button type="primary" @click="revokeRecord"> 撤销备案 </el-button>
+          <span v-if="recordType === '2503'" style="margin-left: 12px">
+              <el-button type="success" @click="querySpecialDiseaseRecords"> 备案查询 </el-button>
+              <el-button type="success" @click="displayDateRange"> 用药记录 </el-button>
+              <el-button type="warning" @click="beforeFetchAllSpecialDiseaseRecords"> 备案统计 </el-button>
+          </span>
+      </template>
+      <template #main>
+          <el-tag type="success">人员基本信息</el-tag>
+          <el-descriptions :column="4" border>
+              <el-descriptions-item>
+                  <template #label> 姓名 </template>
+                  {{ baseinfo.psnName }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 性别 </template>
+                  {{ baseinfo.gendName }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 证件类型 </template>
+                  {{ baseinfo.psnCertTypeName }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 证件号码 </template>
+                  {{ baseinfo.certno }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 出生日期 </template>
+                  {{ baseinfo.brdy }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 年龄 </template>
+                  {{ baseinfo.age }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 民族 </template>
+                  {{ baseinfo.natyName }}
+              </el-descriptions-item>
+              <el-descriptions-item>
+                  <template #label> 人员编号 </template>
+                  {{ baseinfo.psnNo }}
+              </el-descriptions-item>
+          </el-descriptions>
+          <div style="height: 12px"></div>
+          <el-tag type="">人员参保信息</el-tag>
+          <el-table :data="baseinfo.insuinfo" stripe highlight-current-row @row-click="handleClickInsuinfo">
+              <el-table-column property="balc" label="余额" width="50"></el-table-column>
+              <el-table-column prop="insutypeName" label="险种类型"></el-table-column>
+              <el-table-column prop="psnTypeName" label="人员类别" width="120"></el-table-column>
+              <el-table-column prop="psnInsuStasName" label="参保状态" width="80"></el-table-column>
+              <el-table-column property="psnInsuDate" label="个人参保日期" width="100"></el-table-column>
+              <el-table-column property="pausInsuDate" label="暂停参保日期" width="100"></el-table-column>
+              <el-table-column property="cvlservFlagName" label="公务员标志" width="100"></el-table-column>
+              <el-table-column property="insuplcAdmdvs" label="参保地医保区划" width="120"></el-table-column>
+              <el-table-column property="insuplcAdmdvsName" label="参保地名称"></el-table-column>
+              <el-table-column property="empName" label="单位名称"></el-table-column>
+          </el-table>
+          <div style="height: 12px"></div>
+          <el-tag color="#66FFCC">人员身份信息</el-tag>
+          <el-table :data="baseinfo.idetinfo">
+              <el-table-column label="人员身份类别" prop="psnIdetTypeName"></el-table-column>
+              <el-table-column label="人员类别等级" prop="psnTypeLv"></el-table-column>
+              <el-table-column label="备注" prop="memo"></el-table-column>
+              <el-table-column label="开始时间" prop="begntime"></el-table-column>
+              <el-table-column label="结束时间" prop="endtime"></el-table-column>
+          </el-table>
+
+          <el-dialog v-model="showSpecialDiseaseRecords" title="慢特病备案信息">
+              <el-table :data="specialDiseaseRecords" stripe>
+                  <el-table-column property="begndate" label="开始日期"></el-table-column>
+                  <el-table-column prop="enddate" label="结束日期"></el-table-column>
+                  <el-table-column prop="opspDiseCode" label="病种编码"></el-table-column>
+                  <el-table-column prop="opspDiseName" label="病种名称"></el-table-column>
+                  <el-table-column prop="ideFixmedinsName" label="备案机构"></el-table-column>
+              </el-table>
+          </el-dialog>
+          <el-dialog v-model="showSpecialDiseaseUsedMedicines" title="慢特病用药记录">
+              <el-table :data="specialDiseaseUsedMedicines" stripe height="360">
+                  <el-table-column prop="fixmedinsCode" label="定点医药机构编号"></el-table-column>
+                  <el-table-column prop="fixmedinsName" label="定点医药机构名称"></el-table-column>
+                  <el-table-column prop="cnt" label="数量"></el-table-column>
+                  <el-table-column prop="pric" label="单价"></el-table-column>
+                  <el-table-column prop="hilistCode" label="医保目录编码"></el-table-column>
+                  <el-table-column prop="hilistName" label="医保目录名称"></el-table-column>
+                  <el-table-column prop="medListCodg" label="医疗目录编码"></el-table-column>
+                  <el-table-column prop="medinsListCodg" label="医药机构目录编码"></el-table-column>
+                  <el-table-column prop="medinsListName" label="医药机构目录名称"></el-table-column>
+                  <el-table-column prop="prodname" label="商品名"></el-table-column>
+                  <el-table-column prop="spec" label="规格"></el-table-column>
+                  <el-table-column prop="dosformName" label="剂型"></el-table-column>
+              </el-table>
+          </el-dialog>
+          <el-dialog v-model="showDateRange" title="请选择时间范围" width="320px">
+              <el-date-picker
+                  v-model="dateRange"
+                  type="daterange"
+                  :shortcuts="maxHalfYear"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  size="small"
+                  style="width: 260px"
+              ></el-date-picker>
+              <div style="width: 260px; text-align: right; margin-top: 24px">
+                  <el-button type="primary" @click="querySpecialDiseaseUsedMedicines" icon="Check">确定</el-button>
+              </div>
+          </el-dialog>
+          <el-dialog v-model="showFetchAllSpecialDiseaseRecords" title="门特备案记录" width="70%">
+              <el-date-picker
+                  v-model="fetchAllSpecialDiseaseRecordsDateRange"
+                  type="daterange"
+                  :shortcuts="maxHalfYear"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  size="small"
+                  style="width: 240px"
+              ></el-date-picker>
+              <el-divider direction="vertical"></el-divider>
+              <el-button type="primary" icon="Check" @click="fetchAllSpecialDiseaseRecords">查询</el-button>
+              <el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
+              <el-table :data="allSpecialDiseaseRecords" height="400" stripe highlight-current-row>
+                  <el-table-column prop="psnName" label="人员姓名"></el-table-column>
+                  <el-table-column prop="psnNo" label="人员编码"></el-table-column>
+                  <el-table-column prop="socialNo" label="身份证号"></el-table-column>
+                  <el-table-column prop="opspDiseCode" label="病种编码"></el-table-column>
+                  <el-table-column prop="opspDiseName" label="病种名称"></el-table-column>
+                  <el-table-column prop="ideFixmedinsName" label="鉴定机构"></el-table-column>
+                  <el-table-column prop="hospIdeDate" label="鉴定日期"></el-table-column>
+                  <el-table-column prop="diagDrName" label="诊断医师"></el-table-column>
+                  <el-table-column prop="begndate" label="开始日期"></el-table-column>
+                  <el-table-column prop="enddate" label="结束日期"></el-table-column>
+                  <el-table-column prop="trtDclaDetlSn" label="备案流水号"></el-table-column>
+              </el-table>
+          </el-dialog>
+
+          <el-dialog v-model="showApplySpecialDiseaseRecord" width="70%" title="人员慢特病备案申请">
+              <i style="color: red">* </i>人员类别:&nbsp;&nbsp;
+              <el-radio v-model="perstype" :label="1">职工</el-radio>
+              <el-radio v-model="perstype" :label="2">居民</el-radio>
+              <div style="height: 20px"></div>
+              <el-row :gutter="5">
+                  <el-col :span="8">
+                      人员编号:
+                      <el-input v-model="tempSpecialDiseaseRecord.psnNo" disabled style="width: 160px"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                      险种类型:
+                      <el-input v-model="tempSpecialDiseaseRecord.insutypeName" disabled style="width: 160px"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                      联系电话:
+                      <el-input v-model="tempSpecialDiseaseRecord.tel" style="width: 160px"></el-input>
+                  </el-col>
+              </el-row>
+              <div style="height: 12px"></div>
+              <el-row :gutter="5">
+                  <el-col :span="8">
+                      联系地址:
+                      <el-input v-model="tempSpecialDiseaseRecord.addr" style="width: 160px"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                      参保地区:
+                      <el-input v-model="tempSpecialDiseaseRecord.insuOptinsName" disabled style="width: 160px"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                      鉴定日期:
+                      <el-date-picker v-model="tempSpecialDiseaseRecord.hospIdeDate" style="width: 160px"></el-date-picker>
+                  </el-col>
+              </el-row>
+              <div style="height: 12px"></div>
+              <el-row :gutter="5">
+                  <el-col :span="8">
+                      开始日期:
+                      <el-date-picker v-model="tempSpecialDiseaseRecord.begndate" style="width: 160px"></el-date-picker>
+                  </el-col>
+                  <el-col :span="8">
+                      结束日期:
+                      <el-date-picker v-model="tempSpecialDiseaseRecord.enddate" style="width: 160px"></el-date-picker>
+                  </el-col>
+                  <el-col :span="8">
+                      <div style="display: flex">
+                          <div>病种名称:</div>
+                          <div>
+                              <el-autocomplete v-model="tempSpecialDiseaseRecord.opspDiseName"
+                                               :fetch-suggestions="searchDiag" placeholder="请输入名称" clearable
+                                               @select="handleSelectDiag">
+                                  <template #default="{ item }">
+                                      <div style="height: 40px">
+                                          <div style="height: 16px; margin-top: 4px; font-size: 12px; color: #8492a6">
+                                              {{ item.code }}
+                                          </div>
+                                          <div style="height: 16px">{{ item.name }}</div>
+                                      </div>
+                                  </template>
+                              </el-autocomplete>
+                          </div>
+                      </div>
+                  </el-col>
+              </el-row>
+              <div style="height: 12px"></div>
+              <el-row :gutter="5">
+                  <el-col :span="8">
+                      病种编码:
+                      <el-input v-model="tempSpecialDiseaseRecord.opspDiseCode" disabled style="width: 160px"></el-input>
+                  </el-col>
+                  <el-col :span="8">
+                      <div style="display: flex">
+                          <div>医师姓名:</div>
+                          <div>
+                              <el-autocomplete v-model="tempSpecialDiseaseRecord.diagDrName" :fetch-suggestions="searchPhysician" placeholder="请输入姓名" clearable @select="handleSelectPhysician">
+                                  <template #default="{ item }">
+                                      <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
+                                      <el-divider direction="vertical"></el-divider>
+                                      <span>{{ item.name }}</span>
+                                  </template>
+                              </el-autocomplete>
+                          </div>
+                      </div>
+                  </el-col>
+                  <el-col :span="8">
+                      医师编码:
+                      <el-input v-model="tempSpecialDiseaseRecord.diagDrCodg" disabled style="width: 160px"></el-input>
+                  </el-col>
+              </el-row>
+              <div style="margin-top: 24px; width: 100%; text-align: right">
+                  <el-button plain icon="Close" @click="showApplySpecialDiseaseRecord = false">放弃备案</el-button>
+                  <el-button type="primary" icon="Check" @click="submitSpecialDiseaseRecord">提交备案</el-button>
+              </div>
+              <div style="height: 12px"></div>
+          </el-dialog>
+          <el-dialog v-model="showAllAppliedSpecicalDiseaseRecords" title="请选择要撤销的备案" width="70%">
+              <div style="height: 12px"></div>
+              <el-table :data="allAppliedSpecialDiseaseRecords" stripe highlight-current-row @row-click="handleSelectAppliedSpecialDiseaseRecord">
+                  <el-table-column prop="opspDiseCode" label="病种编码"></el-table-column>
+                  <el-table-column prop="opspDiseName" label="病种名称"></el-table-column>
+                  <el-table-column prop="hospIdeDate" label="鉴定日期"></el-table-column>
+                  <el-table-column prop="diagDrName" label="鉴定医生"></el-table-column>
+                  <el-table-column prop="begndate" label="开始日期"></el-table-column>
+                  <el-table-column prop="enddate" label="结束日期"></el-table-column>
+              </el-table>
+              <div style="margin-top: 24px; width: 100%; text-align: right">
+                  <el-button plain icon="Close" @click="abortRevokeSpecialDiseaseRecord">放弃</el-button>
+                  <el-button type="primary" icon="RefreshLeft" @click="confirmRevokeSpecialDiseaseRecord">撤销备案</el-button>
+              </div>
+              <div style="height: 12px"></div>
+          </el-dialog>
+      </template>
+  </page-layer>
+</template>
+<script setup>
+import PageLayer from "@/layout/PageLayer.vue";
+import {
+    obtainBasicPersonInfo,
+    querySpecialChronicDiseasesAccreditation,
+    querySpecialChronicDiseasesMedicalRecord
+} from "@/api/medical-insurance/si-query";
+import {ElMessage, ElMessageBox} from "element-plus";
+import {formatDate, formatDatetime} from "@/utils/date";
+import {maxHalfYear} from "@/data/shortcuts";
+import {
+    getAllSpcChrRcdsByPsnNo, revokeSpecialChronicDiseasesRecord,
+    selectAllSpcSlwRcds,
+    specialChronicDiseasesRecord
+} from "@/api/medical-insurance/si-psn-rcd";
+import {Export} from "@/utils/ExportExcel";
+import {searchData} from "@/api/inpatient/dictionary";
+
+const allRecordTypes = [
+    { value: '2503', label: '慢特病备案' },
+    { value: '2505', label: '定点备案' },
+    { value: '2507', label: '意外伤害备案' },
+    { value: '2501', label: '转院备案' },
+]
+const recordType = ref('2503')
+const psnIdNumber = ref('43012219480925362X')
+
+const baseinfo = ref({})
+const currentInsuinfo = ref({})
+const perstype = ref(1)
+const specialDiseaseRecords = ref([])
+const showSpecialDiseaseRecords = ref(false)
+const specialDiseaseUsedMedicines = ref([])
+const showSpecialDiseaseUsedMedicines = ref(false)
+const dateRange = ref(null)
+const showDateRange = ref(false)
+const showFetchAllSpecialDiseaseRecords = ref(false)
+const fetchAllSpecialDiseaseRecordsDateRange = ref(null)
+const allSpecialDiseaseRecords = ref([])
+const showApplySpecialDiseaseRecord = ref(false)
+const tempSpecialDiseaseRecord = reactive({})
+
+const nullIdNumber = () => {
+    if (!psnIdNumber.value) {
+        ElMessage({
+            message: '请输入患者身份证号!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    return false
+}
+
+const queryPsnBaseInfo = () => {
+    if (nullIdNumber()) {
+        return
+    }
+    const param = {
+        socialNo: psnIdNumber.value,
+        onlyQry: 1,
+    }
+    obtainBasicPersonInfo(param).then((res) => {
+        baseinfo.value = res
+    }).catch(() => {
+        baseinfo.value = {}
+    })
+}
+
+const nullBaseinfo = (needInsuinfo) => {
+    if (!baseinfo.value.psnNo) {
+        ElMessage({
+            message: '请先查询参保信息!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    if (needInsuinfo && !currentInsuinfo.value.insutype) {
+        ElMessage({
+            message: '请选择一条参保信息!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    return false
+}
+
+const nullDateRange = () => {
+    if (!dateRange.value) {
+        ElMessage({
+            message: '请选择日期范围!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    return false
+}
+
+const handleClickInsuinfo = (row) => {
+    currentInsuinfo.value = row
+    if (row.insutype === '310') {
+        perstype.value = 1
+    } else if (row.insutype === '390') {
+        perstype.value = 2
+    }
+}
+
+const querySpecialDiseaseRecords = () => {
+    if (nullBaseinfo(true)) {
+        return
+    }
+    querySpecialChronicDiseasesAccreditation({
+        psnNo: baseinfo.value.psnNo,
+        admdvs: currentInsuinfo.value.insuplcAdmdvs,
+        needAllRcd: 1,
+    }).then((res) => {
+        specialDiseaseRecords.value = res
+        showSpecialDiseaseRecords.value = true
+    })
+}
+
+const displayDateRange = () => {
+    showDateRange.value = true
+}
+
+const querySpecialDiseaseUsedMedicines = () => {
+    if (nullBaseinfo(false)) {
+        return
+    }
+    if (nullDateRange()) {
+        return
+    }
+    const param = {
+        psnNo: baseinfo.value.psnNo,
+        begntime: formatDatetime(dateRange.value[0]),
+        endtime: formatDatetime(dateRange.value[1]),
+    }
+    querySpecialChronicDiseasesMedicalRecord(param).then((res) => {
+        showDateRange.value = false
+        specialDiseaseUsedMedicines.value = res
+        showSpecialDiseaseUsedMedicines.value = true
+    })
+}
+
+const beforeFetchAllSpecialDiseaseRecords = () => {
+    showFetchAllSpecialDiseaseRecords.value = true
+}
+
+const fetchAllSpecialDiseaseRecords = () => {
+    if (!fetchAllSpecialDiseaseRecordsDateRange.value) {
+        ElMessage({
+            message: '请选择日期范围!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    const begntime = formatDate(fetchAllSpecialDiseaseRecordsDateRange.value[0])
+    const endtime = formatDate(fetchAllSpecialDiseaseRecordsDateRange.value[1])
+    selectAllSpcSlwRcds(begntime, endtime).then((res) => {
+        allSpecialDiseaseRecords.value = res
+    })
+}
+
+const exportExcel = () => {
+    if (allSpecialDiseaseRecords.value.length === 0) {
+        ElMessage({
+            message: '没有可以导出的数据。',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return true
+    }
+    const title = {
+        psnName: '人员姓名',
+        psnNo: '人员编码',
+        socialNo: '身份证号',
+        opspDiseCode: '病种编码',
+        opspDiseName: '病种名称',
+        ideFixmedinsName: '鉴定机构',
+        hospIdeDate: '鉴定日期',
+        diagDrName: '诊断医师',
+        begndate: '开始日期',
+        enddate: '结束日期',
+        trtDclaDetlSn: '备案流水号',
+    }
+    Export(allSpecialDiseaseRecords.value, title, '门特备案详情')
+}
+
+const searchDiag = (queryString, cb) => {
+    if (queryString && queryString.length > 1) {
+        const param = {
+            method: 'name',
+            content: queryString,
+            target: 'slwspcdiag',
+            perstype: perstype.value,
+            medType: '14',
+        }
+        searchData(param).then((res) => {
+            cb(res)
+        })
+    }
+}
+
+const handleSelectDiag = (item) => {
+    tempSpecialDiseaseRecord.opspDiseCode = item.code
+    tempSpecialDiseaseRecord.opspDiseName = item.name
+}
+
+const searchPhysician = (queryString, cb) => {
+    if (queryString && queryString.length > 1) {
+        const param = {
+            method: 'name',
+            content: queryString,
+            target: 'physician',
+            medType: '14',
+        }
+        searchData(param).then((res) => {
+            cb(res)
+        })
+    }
+}
+const handleSelectPhysician = (item) => {
+    tempSpecialDiseaseRecord.diagDrCodg = item.code
+    tempSpecialDiseaseRecord.diagDrName = item.name
+}
+
+const startApplyRecord = () => {
+    if (nullBaseinfo(true)) {
+        return
+    }
+    switch (recordType.value) {
+        case '2503':
+            beforeApplySpecialDiseaseRecord()
+            break
+    }
+}
+
+const beforeApplySpecialDiseaseRecord = () => {
+    tempSpecialDiseaseRecord.psnNo = baseinfo.value.psnNo
+    tempSpecialDiseaseRecord.psnName = baseinfo.value.psnName
+    tempSpecialDiseaseRecord.socialNo = baseinfo.value.certno
+    tempSpecialDiseaseRecord.insutype = currentInsuinfo.value.insutype
+    tempSpecialDiseaseRecord.insutypeName = currentInsuinfo.value.insutypeName
+    tempSpecialDiseaseRecord.insuOptins = currentInsuinfo.value.insuplcAdmdvs
+    tempSpecialDiseaseRecord.insuOptinsName = currentInsuinfo.value.insuplcAdmdvsName
+    showApplySpecialDiseaseRecord.value = true
+}
+const submitSpecialDiseaseRecord = () => {
+    specialChronicDiseasesRecord(tempSpecialDiseaseRecord).then((res) => {
+        ElMessageBox.alert(res, {
+            type: 'success',
+            confirmButtonText: '确定',
+        }).then(() => {
+            showApplySpecialDiseaseRecord.value = false
+        })
+    })
+}
+
+const revokeRecord = () => {
+    if (nullBaseinfo(false)) {
+        return
+    }
+    switch (recordType.value) {
+        case '2503':
+            beforeRevokeSpecialDiseaseRecord()
+            break
+    }
+}
+
+const allAppliedSpecialDiseaseRecords = ref([])
+const showAllAppliedSpecicalDiseaseRecords = ref(false)
+const beforeRevokeSpecialDiseaseRecord = () => {
+    getAllSpcChrRcdsByPsnNo(baseinfo.value.psnNo).then((res) => {
+        allAppliedSpecialDiseaseRecords.value = res
+        showAllAppliedSpecicalDiseaseRecords.value = true
+    })
+}
+
+const currentAppliedSpecialDiseaseRecord = ref({})
+const handleSelectAppliedSpecialDiseaseRecord = (row) => {
+    currentAppliedSpecialDiseaseRecord.value = row
+}
+
+const abortRevokeSpecialDiseaseRecord = () => {
+    currentAppliedSpecialDiseaseRecord.value = {}
+    showAllAppliedSpecicalDiseaseRecords.value = false
+}
+
+const confirmRevokeSpecialDiseaseRecord = () => {
+    if (!currentAppliedSpecialDiseaseRecord.value.psnNo) {
+        ElMessage({
+            message: '请选择要撤销的备案!',
+            type: 'warning',
+            duration: 2000,
+            showClose: true,
+        })
+        return
+    }
+    ElMessageBox.prompt('请填写撤销原因:', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        inputPattern: /\S/,
+        inputErrorMessage: '撤销原因为必填项!',
+    }).then(({ value }) => {
+        currentAppliedSpecialDiseaseRecord.value.memo = value
+        const param = {
+            id: currentAppliedSpecialDiseaseRecord.value.id,
+            psnNo: currentAppliedSpecialDiseaseRecord.value.psnNo,
+            trtDclaDetlSn: currentAppliedSpecialDiseaseRecord.value.trtDclaDetlSn,
+            memo: value,
+        }
+        revokeSpecialChronicDiseasesRecord(param).then((res) => {
+            ElMessage({
+                message: res,
+                type: 'success',
+                duration: 2000,
+                showClose: true,
+            })
+            abortRevokeSpecialDiseaseRecord()
+        })
+    }).catch(() => {})
+}
+</script>

+ 179 - 0
src/views/medical-insurance/management/SupplementaryInquiry.vue

@@ -0,0 +1,179 @@
+<template>
+    <page-layer>
+        <template #header>
+            <el-select v-model="fncode" style="width: 135px">
+                <el-option label="科室信息查询" value="5101"></el-option>
+                <el-option label="医执人员信息查询" value="5102"></el-option>
+            </el-select>&nbsp;&nbsp;
+            <span v-show="fncode === '5102'">
+                <el-select v-model="staffParams.pracPsnType" style="width: 135px">
+                    <el-option label="医师" value="1"></el-option>
+                    <el-option label="护士" value="2"></el-option>
+                    <el-option label="药师" value="3"></el-option>
+                    <el-option label="医技人员" value="4"></el-option>
+                </el-select>&nbsp;&nbsp;
+                <el-select v-model="staffParams.psnCertType" placeholder="证件类型" clearable style="width: 165px">
+                    <el-option v-for="item in allPsnCertTypes" :label="item.name" :value="item.code"></el-option>
+                </el-select>&nbsp;&nbsp;
+                <el-input v-model="staffParams.certno" placeholder="证件号码" clearable style="width: 170px"></el-input>
+            </span>
+            <el-divider direction="vertical"></el-divider>
+            <el-button type="primary" icon="Search" @click="handleClickSearch">查询</el-button>
+        </template>
+        <template #main>
+            <div v-if="fncode === '5101'">
+                <el-table :data="deptList" stripe highlight-current-row :height="tableHeight + 30">
+                    <el-table-column prop="hosp_dept_codg" label="医院科室编码"></el-table-column>
+                    <el-table-column prop="hosp_dept_name" label="医院科室名称"></el-table-column>
+                    <el-table-column prop="begntime" label="开始时间"></el-table-column>
+                    <el-table-column prop="endtime" label="结束时间"></el-table-column>
+                    <el-table-column prop="itro" label="简介"></el-table-column>
+                    <el-table-column prop="dept_resper_name" label="科室负责人姓名"></el-table-column>
+                    <el-table-column prop="dept_resper_tel" label="科室负责人电话"></el-table-column>
+                    <el-table-column prop="dept_med_serv_scp" label="科室医疗服务范围"></el-table-column>
+                    <el-table-column prop="caty" label="科别"></el-table-column>
+                    <el-table-column prop="dept_estbdat" label="科室成立日期"></el-table-column>
+                    <el-table-column prop="aprv_bed_cnt" label="批准床位数量"></el-table-column>
+                    <el-table-column prop="hi_crtf_bed_cnt" label="医保认可床位数"></el-table-column>
+                    <el-table-column prop="poolarea_no" label="统筹区编号"></el-table-column>
+                    <el-table-column prop="dr_psncnt" label="医师人数"></el-table-column>
+                    <el-table-column prop="phar_psncnt" label="药师人数"></el-table-column>
+                    <el-table-column prop="nurs_psncnt" label="护士人数"></el-table-column>
+                    <el-table-column prop="tecn_psncnt" label="技师人数"></el-table-column>
+                    <el-table-column prop="memo" label="备注"></el-table-column>
+                </el-table>
+            </div>
+            <div v-else>
+                <el-table :data="staffList.slice((currentStaffPage - 1) * staffPageSize, currentStaffPage * staffPageSize)"
+                          stripe highlight-current-row :height="tableHeight">
+                    <el-table-column label="人员证件类型">
+                        <template #default="scope">
+                            {{filterPsnCertType(scope.row.psn_cert_type)}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="certno" label="人员证件号码"></el-table-column>
+                    <!--                <el-table-column prop="prac_psn_no" label="执业人员自编号"></el-table-column>-->
+                    <el-table-column prop="prac_psn_code" label="执业人员代码"></el-table-column>
+                    <el-table-column prop="prac_psn_name" label="人员姓名" width="100"></el-table-column>
+                    <el-table-column label="人员分类" width="100">
+                        <template #default="scope">
+                            {{filterPracPsnTypeName(scope.row.prac_psn_type)}}
+                        </template>
+                    </el-table-column>
+                    <!--                <el-table-column prop="prac_psn_cert" label="资格证书编码"></el-table-column>-->
+                    <el-table-column prop="prac_cert_no" label="执业证书编号"></el-table-column>
+                    <el-table-column label="医保医师" width="70">
+                        <template #default="scope">
+                            {{filterHiDrFlag(scope.row.hi_dr_flag)}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="开始时间">
+                        <template #default="scope">
+                            {{formatDateValue(scope.row.begntime)}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="结束时间">
+                        <template #default="scope">
+                            {{formatDateValue(scope.row.endtime)}}
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="chg_rea" label="变更原因"></el-table-column>
+                </el-table>
+                <el-pagination
+                    :current-page="currentStaffPage"
+                    :page-size="staffPageSize"
+                    :total="staffList.length"
+                    layout="total,prev, pager, next"
+                    @current-change="handleCurrentStaffPageChange"
+                ></el-pagination>
+            </div>
+        </template>
+    </page-layer>
+</template>
+<script setup>
+import PageLayer from "@/layout/PageLayer.vue";
+import {fetchPsnCertTypeDictionary} from '@/api/dictionary/fetch-dictionaries.js'
+import {queryDeptInfo, queryMedStaffInfo} from '@/api/medical-insurance/si-manage.js'
+import {useStore} from "vuex";
+
+const store = useStore()
+const tableHeight = store.state.app.windowSize.h - 50
+
+const fncode = ref('5101')
+const allPsnCertTypes = ref([])
+const staffParams = reactive({
+    pracPsnType: '1',
+    psnCertType: '',
+    certno: ''
+})
+
+const handleClickSearch = () => {
+    fncode.value === '5101' ? fetchDeptInfo() : fetchStaffInfo()
+}
+
+const deptList = ref([])
+const fetchDeptInfo = () => {
+    queryDeptInfo().then(res => {
+        deptList.value = res
+    })
+}
+
+const staffList = ref([])
+const currentStaffPage = ref(1)
+const staffPageSize = 20
+const handleCurrentStaffPageChange = (val) => {
+    currentStaffPage.value = val
+}
+const fetchStaffInfo = () => {
+    queryMedStaffInfo(staffParams).then(res => {
+        staffList.value = res
+    }).catch(() => {
+        staffList.value = []
+    })
+}
+
+const filterPsnCertType = (val) => {
+    for (let i = 0; i < allPsnCertTypes.value.length; i++) {
+        const certType = allPsnCertTypes.value[i]
+        if (val === certType.code) {
+            return certType.name
+        }
+    }
+    return ''
+}
+
+const filterPracPsnTypeName = (val) => {
+    switch (val) {
+        case '1':
+            return '医师'
+        case '2':
+            return '护士'
+        case '3':
+            return '药师'
+        default:
+            return '医技人员'
+    }
+}
+
+const filterHiDrFlag = (val) => {
+    return val === '1' ? '是' : '否'
+}
+
+const formatDateValue = (val) => {
+    if (!val) {
+        return ''
+    }
+    const date = new Date(val);
+    const year = date.getFullYear()
+    const month = date.getMonth() + 1
+    const day = date.getDate()
+    return year + '-' + ('0' + month).slice(-2) + '-' + ('0' + day).slice(-2)
+}
+
+onMounted(() => {
+    fetchPsnCertTypeDictionary().then(res => {
+        allPsnCertTypes.value = res
+    })
+})
+
+</script>

+ 13 - 22
src/views/medical-insurance/outpatient/SpcChrRcd.vue

@@ -316,7 +316,7 @@ export default {
       }
       return false
     }
-    const nullBaseinfo = () => {
+    const nullBaseinfo = (needInsuinfo) => {
       if (!baseinfo.value.psnNo) {
         ElMessage({
           message: '请先查询参保信息!',
@@ -326,17 +326,14 @@ export default {
         })
         return true
       }
-      return false
-    }
-    const nullInsuinfo = () => {
-      if (!currentInsuinfo.value.insutype) {
-        ElMessage({
-          message: '备案前,请选择一条参保信息!',
-          type: 'warning',
-          duration: 2000,
-          showClose: true,
-        })
-        return true
+      if (needInsuinfo && !currentInsuinfo.value.insutype) {
+          ElMessage({
+              message: '请选择一条参保信息!',
+              type: 'warning',
+              duration: 2000,
+              showClose: true,
+          })
+          return true
       }
       return false
     }
@@ -372,10 +369,7 @@ export default {
     }
 
     const qrySpcChrRcd = () => {
-      if (nullBaseinfo()) {
-        return
-      }
-      if (nullInsuinfo()) {
+      if (nullBaseinfo(true)) {
         return
       }
       querySpecialChronicDiseasesAccreditation({
@@ -393,7 +387,7 @@ export default {
     }
 
     const qryMedUseRcd = () => {
-      if (nullBaseinfo()) {
+      if (nullBaseinfo(false)) {
         return
       }
       if (nullDateRange()) {
@@ -411,10 +405,7 @@ export default {
     }
 
     const beforeSlwSpcChrRcd = () => {
-      if (nullBaseinfo()) {
-        return
-      }
-      if (nullInsuinfo()) {
+      if (nullBaseinfo(true)) {
         return
       }
       slwSpcChrRcd.value.psnNo = baseinfo.value.psnNo
@@ -439,7 +430,7 @@ export default {
     }
 
     const beforeRvkSlwSpcChrRcd = () => {
-      if (nullBaseinfo()) {
+      if (nullBaseinfo(false)) {
         return
       }
       getAllSpcChrRcdsByPsnNo(baseinfo.value.psnNo).then((res) => {

+ 1316 - 0
src/views/medical-insurance/statistical/InsurIncomeAnalysis.vue

@@ -0,0 +1,1316 @@
+<template>
+  <page-layer>
+    <template #header>
+      <el-date-picker v-model="dateRange" type="monthrange" range-separator="至" start-placeholder="开始月份"
+        end-placeholder="结束月份" style="width: 220px"></el-date-picker>
+      <el-cascader v-model="setlCondition.dataInfo" :options="setlCondition.options" :props="{ expandTrigger: 'hover' }"
+        @change="handleChange" :clearable="true" :filterable="true" placeholder="请选择险种">
+      </el-cascader>
+      <el-divider direction="vertical"></el-divider>
+      <el-button icon="Search" type="primary" @click="fetchSetlinfos">查询</el-button>
+      <el-button icon="Download" type="primary" @click="exportSetlinfoExcel">导出Excel</el-button>
+      <el-button icon="TrendCharts" type="primary" @click="selectChart">分析图</el-button>
+      <el-button icon="Histogram" type="primary" @click="showBarChart">费用趋势图</el-button>
+      <el-button icon="TrendCharts" type="primary" @click="showTreeChart">人数树状图</el-button>
+    </template>
+    <template #main>
+      <el-tabs type="border-card" v-model="setlCondition.selectType" @tab-click="handleClick">
+        <el-tab-pane label="数据" name="first">
+          <el-table :data="setlinfos" :height="tableHeight" border highlight-current-row row-key="childKey" show-summary
+            :summary-method="getSummaries1" stripe @row-dblclick="fetchSetldetails">
+            <el-table-column label="险种类型" prop="insurName" fixed header-align="center" width="130"></el-table-column>
+            <el-table-column label="住院人次" prop="psnCount" align="center" header-align="center"></el-table-column>
+            <el-table-column label="住院天数" prop="inDays" align="center" header-align="center"></el-table-column>
+            <el-table-column label="平均住院日" prop="avgInDays" align="right" header-align="center"></el-table-column>
+            <el-table-column label="总费用" prop="totalFee" align="right" header-align="center"></el-table-column>
+            <el-table-column label="药品费用" prop="drugFee" align="right" header-align="center"></el-table-column>
+            <el-table-column label="药品占比(%)" prop="drugFeeRatio" align="right" header-align="center"></el-table-column>
+            <el-table-column label="耗材费用" prop="matFee" align="right" header-align="center"></el-table-column>
+            <el-table-column label="耗材占比(%)" prop="matFeeRatio" align="right" header-align="center"></el-table-column>
+            <el-table-column label="基本医疗统筹金额" prop="fundPooling" align="right" header-align="center"></el-table-column>
+            <el-table-column label="大病基金" prop="bigIllFundPooling" align="right" header-align="center">
+            </el-table-column>
+            <el-table-column label="公务员基金支付" prop="civilServiceFund" align="right" header-align="center">
+            </el-table-column>
+            <el-table-column label="其他基金" prop="otherFunds" align="right" header-align="center"></el-table-column>
+            <el-table-column label="全部基金" prop="allFunds" align="right" header-align="center"></el-table-column>
+            <el-table-column label="个人账户支出" prop="acctPay" align="right" header-align="center"></el-table-column>
+          </el-table>
+          <el-dialog v-model="showSetldetails" :close-on-click-modal="false" :close-on-press-escape="false"
+            :title="filterDialogTitle" width="80%">
+            <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
+              <el-button icon="Download" type="primary" @click="exportYbDetailExcel">导出Excel</el-button>
+            </div>
+            <el-table :data="setldetails.slice(pageSize * (currentPage - 1), pageSize * currentPage)" height="560"
+              highlight-current-row stripe @row-dblclick="openSetlinfoComponent">
+              <el-table-column fixed label="序号" type="index" width="40"></el-table-column>
+              <el-table-column fixed label="姓名" prop="psnName" width="60"></el-table-column>
+              <el-table-column fixed label="住院号" prop="patNo" width="70"></el-table-column>
+              <el-table-column label="次数" prop="times" width="40"></el-table-column>
+              <el-table-column label="科室" prop="psnCertType" width="100"></el-table-column>
+              <el-table-column label="性别" prop="gendName" width="50"></el-table-column>
+              <el-table-column label="出生日期" prop="brdy"></el-table-column>
+              <el-table-column label="身份证" prop="certno"></el-table-column>
+              <el-table-column label="主要诊断" prop="mainDiagnosis" width="120" show-overflow-tooltip></el-table-column>
+              <el-table-column label="主要手术" prop="mainOperation" width="120" show-overflow-tooltip></el-table-column>
+              <el-table-column label="参保地区" prop="insuplcAdmdvsName"></el-table-column>
+              <el-table-column label="险种类型" prop="insutypeName"></el-table-column>
+              <el-table-column label="人员类别" prop="psnTypeName"></el-table-column>
+              <el-table-column label="就诊ID" prop="mdtrtId"></el-table-column>
+              <el-table-column label="结算ID" prop="setlId"></el-table-column>
+              <el-table-column label="入院时间" prop="begntime"></el-table-column>
+              <el-table-column label="出院时间" prop="endtime"></el-table-column>
+              <el-table-column label="结算时间" prop="setlTime"></el-table-column>
+              <el-table-column label="医疗类别" prop="medTypeName"></el-table-column>
+              <el-table-column label="总医疗费用" prop="medfeeSumamt"></el-table-column>
+              <el-table-column label="总报销金额" prop="fundPaySumamt"></el-table-column>
+              <el-table-column label="医疗救助" prop="mafPay"></el-table-column>
+              <el-table-column label="个人账户支出" prop="acctPay"></el-table-column>
+              <el-table-column label="个人现金支出" prop="psnCashPay"></el-table-column>
+              <el-table-column label="大病支出" prop="hifmiPay"></el-table-column>
+              <el-table-column label="西药费" prop="chargeWesternMedicine"></el-table-column>
+              <el-table-column label="中成药费" prop="chargePatentMedicine"></el-table-column>
+              <el-table-column label="中药饮片费" prop="chargeHerbal"></el-table-column>
+              <el-table-column label="耗材费" prop="chargeSanitaryMaterial"></el-table-column>
+            </el-table>
+            <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[15, 30, 45, 60]"
+              :total="setldetails.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+              @size-change="handleSizeChange" @current-change="handleCurrentChange"></el-pagination>
+          </el-dialog>
+          <el-dialog v-model="showSetlinfoComponent" :close-on-click-modal="false" title="结算信息" width="70%">
+            <Setlinfo :setlinfo="currentSetldetail" />
+          </el-dialog>
+          <el-dialog v-model="showChart" :close-on-click-modal="false" title="费用趋势图" width="70%" top="40px" draggable>
+            <BarChart :ybkf="barChangeData" />
+          </el-dialog>
+          <el-dialog v-model="treeChart" :close-on-click-modal="false" title="人数树状图" width="70%" top="40px" draggable>
+            <div style="height: 35px">
+              <el-autocomplete v-model="deptNo" value-key="name" :fetch-suggestions="querySearchDept"
+                :trigger-on-focus="false" clearable class="inline-input w-50 m-2" style="width: 240px"
+                placeholder="请输入关键字" @select="handleSelect">
+                <template #prepend>科室</template>
+              </el-autocomplete>
+              <el-autocomplete v-model="doctorId" value-key="name" :fetch-suggestions="querySearchDoctor"
+                :trigger-on-focus="false" clearable class="inline-input w-50 m-2" style="width: 240px"
+                placeholder="请输入关键字" @select="handleSelect">
+                <template #prepend>管床医生</template>
+              </el-autocomplete>
+              <el-input v-model="insurCode" clearable style="width: 240px" class="w-50 m-2">
+                <template #prepend>医保类别</template>
+              </el-input>
+              <el-divider direction="vertical"></el-divider>
+              <el-button icon="Search" type="primary" @click="selectTreeChart">查询</el-button>
+              <el-button icon="Download" type="primary" @click="exportTreeRs">导出</el-button>
+            </div>
+            <div style="width: 100%; height: 700px" id="treedsf"></div>
+          </el-dialog>
+        </el-tab-pane>
+        <el-tab-pane label="同比" name="second">
+          <el-table :data="setlinfos" :height="tableHeight" border highlight-current-row row-key="childKey" show-summary
+            :summary-method="getSummaries1">
+            <el-table-column label="月份" prop="month" fixed align="center" header-align="center"></el-table-column>
+            <el-table-column label="总费用" prop="zfy" header-align="center">
+              <el-table-column label="今年" prop="zfy_jn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="去年" prop="zfy_qn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="同比" prop="zfy_tb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="全部基金" prop="zjj" header-align="center">
+              <el-table-column label="今年" prop="zjj_jn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="去年" prop="zjj_qn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="同比" prop="zjj_tb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="药品费用" prop="ypf" header-align="center">
+              <el-table-column label="今年" prop="ypf_jn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="去年" prop="ypf_qn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="同比" prop="ypf_tb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="耗材费用" prop="clf" header-align="center">
+              <el-table-column label="今年" prop="clf_jn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="去年" prop="clf_qn" align="right" header-align="center"></el-table-column>
+              <el-table-column label="同比" prop="clf_tb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="环比" name="third">
+          <el-table :data="setlinfos" :height="tableHeight" border highlight-current-row row-key="childKey" show-summary
+            :summary-method="getSummaries1">
+            <el-table-column label="月份" prop="month" align="center" fixed header-align="center"></el-table-column>
+            <el-table-column label="总费用" prop="zfys" header-align="center">
+              <el-table-column label="费用" prop="zfy" align="right" header-align="center"></el-table-column>
+              <el-table-column label="环比" prop="zfy_hb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="全部基金" prop="zjjs" header-align="center">
+              <el-table-column label="费用" prop="zjj" align="right" header-align="center"></el-table-column>
+              <el-table-column label="环比" prop="zjj_hb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="药品费用" prop="ypfs" header-align="center">
+              <el-table-column label="费用" prop="ypf" align="right" header-align="center"></el-table-column>
+              <el-table-column label="环比" prop="ypf_hb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+            <el-table-column label="耗材费用" prop="clfs" header-align="center">
+              <el-table-column label="费用" prop="clf" align="right" header-align="center"></el-table-column>
+              <el-table-column label="环比" prop="clf_hb" align="right" header-align="center"></el-table-column>
+            </el-table-column>
+          </el-table>
+        </el-tab-pane>
+      </el-tabs>
+      <el-drawer :title="titleChart" v-model="qxtDrawer" size="80%">
+        <el-row :gutter="10">
+          <el-col :span="6">
+            <div style="width: 100%; height: 400px" id="zfyDst"></div>
+          </el-col>
+          <el-col :span="6">
+            <div style="width: 100%; height: 400px" id="zjjDst"></div>
+          </el-col>
+          <el-col :span="6">
+            <div style="width: 100%; height: 400px" id="ypfDst"></div>
+          </el-col>
+          <el-col :span="6">
+            <div style="width: 100%; height: 400px" id="clfDst"></div>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="8">
+            <div style="width: 100%; height: 400px" id="rcpie"></div>
+          </el-col>
+          <el-col :span="8">
+            <div style="width: 100%; height: 400px" id="zytsPie"></div>
+          </el-col>
+          <el-col :span="8">
+            <div style="width: 100%; height: 400px" id="zfyPie"></div>
+          </el-col>
+        </el-row>
+      </el-drawer>
+    </template>
+  </page-layer>
+</template>
+
+<script>
+import { computed, onMounted, reactive, ref, watch } from 'vue'
+import { useStore } from 'vuex'
+import store from '@/store'
+import { getDateRangeFormatDate, formatDatetime } from '@/utils/date'
+import {
+  selectYbStatInfo,
+  selectYbStatRatio,
+  selectYbChart,
+  selectYbStatDetail,
+  querySettlementInfo,
+  selectBarChangeData,
+  selectTreeData
+} from '@/api/medical-insurance/si-ybkf'
+import { clone } from '@/utils/clone'
+import { Export } from '@/utils/ExportExcel'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { downloadExcel } from '@/utils/excel'
+import { pieUtilsOne, barUtilsTwo, barUtilsThree, treeChartRoot } from '@/utils/echarts-utils'
+import Setlinfo from '../../../components/medical-insurance/setlinfo/Index.vue'
+import BarChart from '../../../components/medical-insurance/ybkf/BarChart.vue'
+import { selectSmallDept, selectDoctor } from '@/api/medical-insurance/si-yb-util'
+import PageLayer from "@/layout/PageLayer";
+
+export default {
+  components: {
+    PageLayer,
+    Setlinfo,
+    BarChart,
+  },
+  setup() {
+    const storeU = useStore()
+    const windowSize = storeU.state.app.windowSize
+    const tableHeight = windowSize.h - 120
+    const dateRange = ref([])
+    const dateS = getDateRangeFormatDate(dateRange.value)
+
+    const setlinfos = ref([])
+
+    const qxtDrawer = ref(false)
+    const titleChart = ref('图形')
+    const chartData = ref([])
+    const pieChartData = reactive({
+      selectPie: '1',
+    })
+
+    const deptNo = ref('')
+    const doctorId = ref('')
+    const insurCode = ref('')
+
+    const showChart = ref(false)
+    const barChangeData = ref([])
+    const showBarChart = (val) => {
+      if (setlCondition.setlType === '11') {
+        ElMessage({
+          message: '门诊不参与排名!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      let selectInfo = clone(setlCondition)
+      selectBarChangeData(selectInfo)
+        .then((res) => {
+          barChangeData.value = res
+          showChart.value = true
+
+          //月份
+          let months = []
+          //数据
+          let dataBar = []
+          //显示排名前几名
+          let num = 15
+          //单位
+          let unit = '元'
+
+          barChangeData.value.forEach((item) => {
+            let d = []
+
+            if (months.length === 0 || months[months.length - 1] !== item.yf) {
+              months.push(item.yf)
+            }
+
+            d.push(item.totalFee)
+            d.push(item.medins_type)
+            d.push(item.yf)
+
+            dataBar.push(d)
+          })
+          nextTick(() => {
+            barUtilsThree(hightChart, '总费用(TOP' + num + ')', months, dataBar, num - 1, unit)
+          })
+        })
+        .catch(() => {
+          barChangeData.value = []
+        })
+    }
+
+    const querySearchDept = async (str, cb) => {
+      let results = await selectSmallDept({ str })
+      if (results) {
+        // 调用 callback 返回建议列表的数据
+        cb(results)
+      }
+    }
+
+    const querySearchDoctor = async (str, cb) => {
+      let results = await selectDoctor({ str })
+      if (results) {
+        // 调用 callback 返回建议列表的数据
+        cb(results)
+      }
+    }
+
+    const handleSelect = (item) => {
+    }
+
+    const treeChart = ref(false)
+    const treeData = ref([])
+    const showTreeChart = (val) => {
+      if (setlCondition.setlType === '11') {
+        ElMessage({
+          message: '门诊不参与统计!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        treeChart.value = false
+        return
+      }
+
+      let selectData = clone(setlCondition)
+      if (!selectData.startTime) {
+        ElMessage({
+          message: '请选择时间范围!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        treeChart.value = false
+        return
+      }
+      treeChart.value = true
+
+      selectTreeData(selectData).then((res) => {
+        treeData.value = res
+        deptNo.value = ''
+        doctorId.value = ''
+        insurCode.value = ''
+        nextTick(() => {
+          treeChartRoot(treedsf, '树', treeData.value, [])
+        })
+      })
+    }
+
+    const selectTreeChart = (val) => {
+      treeChart.value = true
+      let selectData = clone(setlCondition)
+      selectData.dept = deptNo.value
+      selectData.doctor = doctorId.value
+      selectData.insurType = insurCode.value
+      selectTreeData(selectData).then((res) => {
+        treeData.value = res
+        let searchData = [deptNo.value, doctorId.value, insurCode.value]
+        nextTick(() => {
+          treeChartRoot(treedsf, '树', treeData.value, searchData)
+        })
+      })
+    }
+
+    const setldetails = ref([])
+    const showSetldetails = ref(false)
+
+    const setlCondition = reactive({
+      startTime: dateS.startTime,
+      endTime: dateS.endTime,
+      setlType: '21',
+      selectType: 'first',
+      insurType: null,
+      dataInfo: null,
+      options: initInsurOptions(),
+    })
+
+    const fetchSetldetails = (row) => {
+      let selectInfo = clone(setlCondition)
+      selectInfo.insurType = row.insurType
+      selectYbStatDetail(selectInfo)
+        .then((res) => {
+          setldetails.value = res
+          showSetldetails.value = true
+        })
+        .catch(() => {
+          setldetails.value = []
+        })
+    }
+
+    const filterDialogTitle = computed(() => {
+      let yearL = setlCondition.startTime.substr(0, 4)
+      const setlTypeName = filterSetlTypeName()
+      return yearL + setlTypeName + '结算明细'
+    })
+
+    const showSetlinfoComponent = ref(false)
+    const currentSetldetail = ref({})
+    const openSetlinfoComponent = (row) => {
+      const param = {
+        psnNo: row.psnNo,
+        mdtrtId: row.mdtrtId,
+      }
+      querySettlementInfo(param).then((res) => {
+        currentSetldetail.value = res
+        showSetlinfoComponent.value = true
+      })
+    }
+
+    const fetchSetlinfos = () => {
+      if (!dateRange.value) {
+        ElMessage({
+          message: '请选择时间范围!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      if (!setlCondition.dataInfo) {
+        ElMessage({
+          message: '请选择险种!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      setlCondition.setlType = setlCondition.dataInfo[0]
+      setlCondition.insurType = setlCondition.dataInfo[1]
+
+      setlCondition.startTime = formatDatetime(dateRange.value[0])
+      setlCondition.endTime = formatDatetime(dateRange.value[1])
+
+      let yearL = setlCondition.startTime.substr(0, 4)
+      let yearR = setlCondition.endTime.substr(0, 4)
+
+      if (yearL != yearR) {
+        ElMessage({
+          message: '请选择同一年份!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      if (setlCondition.selectType === 'first') {
+        selectYbStatInfo(setlCondition)
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
+      } else {
+        selectYbStatRatio(setlCondition)
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
+      }
+    }
+
+    const exportYbDetailExcel = () => {
+      if (setldetails.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      } else {
+        const title = {
+          patNo: '住院号',
+          times: '住院次数',
+          psnCertType: '科室',
+          psnName: '姓名',
+          gendName: '性别',
+          brdy: '出生日期',
+          certno: '身份证',
+          mainDiagnosis: '主要诊断',
+          mainOperation: '主要手术',
+          insuplcAdmdvsName: '参保地名称',
+          insutypeName: '险种类型',
+          medTypeName: '医疗类别',
+          psnTypeName: '人员类别',
+          mdtrtId: '就诊ID',
+          setlId: '结算ID',
+          begntime: '入院时间',
+          endtime: '出院时间',
+          setlTime: '结算时间',
+          medfeeSumamt: '总医疗费用',
+          fundPaySumamt: '总报销金额',
+          mafPay: '医疗救助',
+          acctPay: '个人账户支出',
+          psnCashPay: '个人现金支出',
+          hifmiPay: '大病支出',
+          chargeWesternMedicine: '西药费',
+          chargePatentMedicine: '中成药费',
+          chargeHerbal: '中药饮片费',
+          chargeSanitaryMaterial: '耗材费',
+        }
+        Export(setldetails.value, title, filterDialogTitle.value)
+      }
+    }
+
+    const handleChange = (value) => {
+    }
+
+    const pageSize = ref(30)
+    const currentPage = ref(1)
+    const handleSizeChange = (val) => {
+      pageSize.value = val
+    }
+    const handleCurrentChange = (val) => {
+      currentPage.value = val
+    }
+
+    const selectChart = async () => {
+      if (!dateRange.value) {
+        ElMessage({
+          message: '请选择时间范围!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      if (!setlCondition.dataInfo) {
+        ElMessage({
+          message: '请选择险种!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      setlCondition.setlType = setlCondition.dataInfo[0]
+      setlCondition.insurType = setlCondition.dataInfo[1]
+
+      setlCondition.startTime = formatDatetime(dateRange.value[0])
+      setlCondition.endTime = formatDatetime(dateRange.value[1])
+
+      let yearL = setlCondition.startTime.substr(0, 4)
+      let yearR = setlCondition.endTime.substr(0, 4)
+
+      if (yearL != yearR) {
+        ElMessage({
+          message: '请选择同一年份!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      qxtDrawer.value = true
+      titleChart.value = yearL + '年医保收入分析图'
+
+      let data = []
+      data = await selectYbChart(setlCondition)
+      let setlCondition1 = clone(setlCondition)
+      setlCondition1.selectType = 'first'
+      data = data.concat(await selectYbStatInfo(setlCondition1))
+      chartData.value = data
+    }
+
+    watch(
+      () => chartData.value,
+      () => {
+        let nameText
+        let barTitles = ['总费用', '全部基金', '药品费', '耗材费']
+        if (setlCondition.setlType === '21') {
+          nameText = '住院'
+        } else {
+          nameText = '门诊'
+        }
+        nameText = titleChart.value + '(' + nameText + ')-'
+        let yAxisName = '单位:百万元'
+        let tipUnit = '元'
+
+        let echartsXdata = []
+        let zfy = []
+        let zjj = []
+        let ypf = []
+        let clf = []
+        let pieRc = []
+        let pieZyts = []
+        let pieZfy = []
+
+        chartData.value.forEach((item) => {
+          if (item.month) {
+            zfy.push(item.zfy_jn)
+            zjj.push(item.zjj_jn)
+            if (item.ypf_jn > 0.0) {
+              ypf.push(item.ypf_jn)
+            }
+            if (item.clf_jn > 0.0) {
+              clf.push(item.clf_jn)
+            }
+            echartsXdata.push(item.month)
+          } else {
+            let dataRc = {}
+            let dataZyts = {}
+            let dataZfy = {}
+            dataRc.value = item.psnCount
+            dataRc.name = item.insurName
+            dataRc.unit = '人'
+            pieRc.push(dataRc)
+            dataZyts.value = item.inDays
+            dataZyts.name = item.insurName
+            dataZyts.unit = '天'
+            pieZyts.push(dataZyts)
+            dataZfy.value = item.totalFee
+            dataZfy.name = item.insurName
+            dataZfy.unit = '元'
+            pieZfy.push(dataZfy)
+          }
+        })
+        barUtilsTwo(zfyDst, nameText + barTitles[0], echartsXdata, zfy, barTitles[0], yAxisName, tipUnit)
+        barUtilsTwo(zjjDst, nameText + barTitles[1], echartsXdata, zjj, barTitles[1], yAxisName, tipUnit)
+        barUtilsTwo(ypfDst, nameText + barTitles[2], echartsXdata, ypf, barTitles[2], yAxisName, tipUnit)
+        barUtilsTwo(clfDst, nameText + barTitles[3], echartsXdata, clf, barTitles[3], yAxisName, tipUnit)
+
+        pieUtilsOne(rcpie, '住院人次', pieRc)
+        pieUtilsOne(zytsPie, '住院天数', pieZyts)
+        pieUtilsOne(zfyPie, '总费用', pieZfy)
+      }
+    )
+
+    const handleClick = (tab, event) => {
+      if (!dateRange.value) {
+        ElMessage({
+          message: '请选择时间范围!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      if (!setlCondition.dataInfo) {
+        ElMessage({
+          message: '请选择险种!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+        return
+      }
+
+      setlCondition.setlType = setlCondition.dataInfo[0]
+      setlCondition.insurType = setlCondition.dataInfo[1]
+
+      setlCondition.startTime = formatDatetime(dateRange.value[0])
+      setlCondition.endTime = formatDatetime(dateRange.value[1])
+
+      // 查询哪个tab页面
+      setlCondition.selectType = tab.props.name
+
+      if (setlCondition.selectType === 'first') {
+        selectYbStatInfo(setlCondition)
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
+      } else {
+        selectYbStatRatio(setlCondition)
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
+      }
+    }
+
+    const getSummaries = () => {
+      if (setlCondition.selectType === 'first') {
+        let sums1 = {
+          insurName: '',
+          psnCount: 0,
+          inDays: 0,
+          avgInDays: 0,
+          totalFee: 0,
+          drugFee: 0,
+          drugFeeRatio: 0,
+          matFee: 0,
+          matFeeRatio: 0,
+          fundPooling: 0,
+          bigIllFundPooling: 0,
+          civilServiceFund: 0,
+          otherFunds: 0,
+          allFunds: 0,
+          acctPay: 0,
+        }
+        setlinfos.value.forEach((itm) => {
+          for (let k in sums1) {
+            sums1[k] = Number(sums1[k]) + Number(itm[k])
+          }
+        })
+        sums1.insurName = '合计'
+        sums1.avgInDays = (sums1.inDays / sums1.psnCount).toFixed(2)
+        sums1.drugFeeRatio = ((sums1.drugFee / sums1.totalFee) * 100).toFixed(2)
+        sums1.matFeeRatio = ((sums1.matFee / sums1.totalFee) * 100).toFixed(2)
+
+        return sums1
+      } else if (setlCondition.selectType === 'second') {
+        let sums2 = {
+          month: '',
+          zfy_jn: 0,
+          zfy_qn: 0,
+          zfy_tb: 0,
+          zjj_jn: 0,
+          zjj_qn: 0,
+          zjj_tb: 0,
+          ypf_jn: 0,
+          ypf_qn: 0,
+          ypf_tb: 0,
+          clf_jn: 0,
+          clf_qn: 0,
+          clf_tb: 0,
+        }
+        setlinfos.value.forEach((itm) => {
+          for (let k in sums2) {
+            sums2[k] = Number(sums2[k]) + Number(itm[k])
+          }
+        })
+        sums2.month = '合计'
+        sums2.zfy_tb = (((sums2.zfy_jn - sums2.zfy_qn) / sums2.zfy_qn) * 100).toFixed(2) + '%'
+        sums2.zjj_tb = (((sums2.zjj_jn - sums2.zjj_qn) / sums2.zjj_qn) * 100).toFixed(2) + '%'
+        sums2.ypf_tb = (((sums2.ypf_jn - sums2.ypf_qn) / sums2.ypf_qn) * 100).toFixed(2) + '%'
+        sums2.clf_tb = (((sums2.clf_jn - sums2.clf_qn) / sums2.clf_qn) * 100).toFixed(2) + '%'
+        return sums2
+      } else {
+        let sums3 = {
+          month: '',
+          zfy: 0,
+          zfy_hb: 0,
+          zjj: 0,
+          zjj_hb: 0,
+          ypf: 0,
+          ypf_hb: 0,
+          clf: 0,
+          clf_hb: 0,
+        }
+        setlinfos.value.forEach((itm) => {
+          for (let k in sums3) {
+            sums3[k] = Number(sums3[k]) + Number(itm[k])
+          }
+        })
+        sums3.month = '合计'
+        sums3.zfy_hb = ''
+        sums3.zjj_hb = ''
+        sums3.ypf_hb = ''
+        sums3.clf_hb = ''
+        return sums3
+      }
+    }
+
+    const getSummaries1 = (param) => {
+      const { columns, data } = param
+      const sums = []
+      // 住院人次下标
+      let psnCountIndex = 0
+      // 住院天数下标
+      let inDaysIndex = 0
+      // 总费用下标
+      let zfyIndex = 0
+      // 药品费下标
+      let ypfIndex = 0
+      // 材料费下标
+      let clfIndex = 0
+      // 今年总费用下标
+      let jn_zfy = 0
+      // 去年总费用下标
+      let qn_zfy = 0
+      // 今年总基金下标
+      let jn_zjj = 0
+      // 去年总基金下标
+      let qn_zjj = 0
+      // 今年药品费下标
+      let jn_ypf = 0
+      // 去年药品费下标
+      let qn_ypf = 0
+      // 今年耗材费下标
+      let jn_clf = 0
+      // 去年耗材费下标
+      let qn_clf = 0
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        if (column.property === 'psnCount') {
+          psnCountIndex = index
+        }
+        if (column.property === 'inDays') {
+          inDaysIndex = index
+        }
+        if (column.property === 'totalFee') {
+          zfyIndex = index
+        }
+        if (column.property === 'drugFee') {
+          ypfIndex = index
+        }
+        if (column.property === 'matFee') {
+          clfIndex = index
+        }
+        if (column.property === 'jn_zfy') {
+          jn_zfy = index
+        }
+        if (column.property === 'qn_zfy') {
+          qn_zfy = index
+        }
+        if (column.property === 'jn_zjj') {
+          jn_zjj = index
+        }
+        if (column.property === 'qn_zjj') {
+          qn_zjj = index
+        }
+        if (column.property === 'jn_ypf') {
+          jn_ypf = index
+        }
+        if (column.property === 'qn_ypf') {
+          qn_ypf = index
+        }
+        if (column.property === 'jn_clf') {
+          jn_clf = index
+        }
+        if (column.property === 'qn_clf') {
+          qn_clf = index
+        }
+        const values = data.map((item) => Number(item[column.property]))
+        if (column.property === 'avgInDays') {
+          sums[index] = (sums[inDaysIndex] / sums[psnCountIndex]).toFixed(2)
+        } else if (column.property === 'drugFeeRatio') {
+          if (sums[zfyIndex] > 0) {
+            sums[index] = ((sums[ypfIndex] / sums[zfyIndex]) * 100).toFixed(2)
+          } else {
+            sums[index] = 0.0
+          }
+        } else if (column.property === 'matFeeRatio') {
+          if (sums[zfyIndex] > 0) {
+            sums[index] = ((sums[clfIndex] / sums[zfyIndex]) * 100).toFixed(2)
+          } else {
+            sums[index] = 0.0
+          }
+        } else if (column.property === 'zfy_tb') {
+          if (sums[qn_zfy] > 0) {
+            sums[index] = (((sums[jn_zfy] - sums[qn_zfy]) / sums[qn_zfy]) * 100).toFixed(2) + '%'
+          } else {
+            sums[index] = 0.0 + '%'
+          }
+        } else if (column.property === 'zjj_tb') {
+          if (sums[qn_zjj] > 0) {
+            sums[index] = (((sums[jn_zjj] - sums[qn_zjj]) / sums[qn_zjj]) * 100).toFixed(2) + '%'
+          } else {
+            sums[index] = 0.0 + '%'
+          }
+        } else if (column.property === 'ypf_tb') {
+          if (sums[qn_ypf] > 0) {
+            sums[index] = (((sums[jn_ypf] - sums[qn_ypf]) / sums[qn_ypf]) * 100).toFixed(2) + '%'
+          } else {
+            sums[index] = 0.0 + '%'
+          }
+        } else if (column.property === 'clf_tb') {
+          if (sums[qn_clf] > 0) {
+            sums[index] = (((sums[jn_clf] - sums[qn_clf]) / sums[qn_clf]) * 100).toFixed(2) + '%'
+          } else {
+            sums[index] = 0.0 + '%'
+          }
+        } else if (column.property === 'zfy_hb') {
+          sums[index] = ''
+        } else if (column.property === 'zjj_hb') {
+          sums[index] = ''
+        } else if (column.property === 'ypf_hb') {
+          sums[index] = ''
+        } else if (column.property === 'clf_hb') {
+          sums[index] = ''
+        } else if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          //合计特殊处理
+          if (column.property === 'psnCount' || column.property === 'inDays') {
+            sums[index] = sums[index].toFixed(0)
+          } else {
+            sums[index] = sums[index].toFixed(2)
+          }
+        } else {
+          sums[index] = 0
+        }
+      })
+
+      sums.avgInDays = (sums.inDays / sums.psnCount).toFixed(2)
+      sums.drugFeeRatio = ((sums.drugFee / sums.totalFee) * 100).toFixed(2)
+      sums.matFeeRatio = ((sums.matFee / sums.totalFee) * 100).toFixed(2)
+
+      return sums
+    }
+
+    const filterSetlTypeName = () => {
+      if ('21' === setlCondition.setlType) {
+        return setlCondition.options[0].label
+      } else {
+        return setlCondition.options[1].label
+      }
+
+      return ''
+    }
+
+    const filterInsurTypeName = () => {
+      if ('21' === setlCondition.setlType) {
+        for (let i = 0; i < setlCondition.options[0].children.length; i++) {
+          if (setlCondition.options[0].children[i].value === setlCondition.insurType) {
+            return setlCondition.options[0].children[i].label
+          }
+        }
+      } else {
+        for (let i = 0; i < setlCondition.options[1].children.length; i++) {
+          if (setlCondition.options[1].children[i].value === setlCondition.insurType) {
+            return setlCondition.options[1].children[i].label
+          }
+        }
+      }
+
+      return ''
+    }
+
+    const exportSetlinfoExcel = () => {
+      let year = setlCondition.startTime.substr(0, 4) + '年'
+      if (setlinfos.value.length === 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      } else {
+        const data = clone(setlinfos.value)
+        data.push(getSummaries())
+
+        // 增加导出正在进行中状态
+        store.commit('app/setLoading', true)
+
+        if (setlCondition.selectType === 'first') {
+          const title = {
+            insurName: '险种类型',
+            psnCount: '住院人次',
+            inDays: '住院天数',
+            avgInDays: '平均住院日',
+            totalFee: '总费用',
+            drugFee: '药品费用',
+            drugFeeRatio: '药品占比(%)',
+            matFee: '耗材费用',
+            matFeeRatio: '耗材占比(%)',
+            fundPooling: '基本医疗统筹金额',
+            bigIllFundPooling: '大病基金',
+            civilServiceFund: '公务员基金支付',
+            otherFunds: '其他基金',
+            allFunds: '全部基金',
+            acctPay: '个人账户支出',
+          }
+          const setlTypeName = filterSetlTypeName()
+          const insurTypeName = filterInsurTypeName()
+          Export(data, title, `【${year}】【${setlTypeName}】【${insurTypeName}】`)
+        } else if (setlCondition.selectType === 'second') {
+          const setlTypeName = filterSetlTypeName()
+          const exportName = year + setlTypeName + '同比'
+          if (setlinfos.value.length <= 0) {
+            ElMessage({
+              message: '没有可以导出的数据!',
+              type: 'warning',
+              duration: 2500,
+              showClose: true,
+            })
+          }
+          ElMessageBox.prompt('导出文件名字', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            inputPattern: /\S/,
+            inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
+          })
+            .then(({ value }) => {
+              const data = {
+                param: {
+                  startTime: setlCondition.startTime,
+                  endTime: setlCondition.endTime,
+                  setlType: setlCondition.setlType,
+                  insurType: setlCondition.insurType,
+                  selectType: setlCondition.selectType,
+                  exportName: exportName,
+                },
+                url: '/ybQuery/exportYbStatRatioExcel',
+                fileName: value + '.xlsx',
+              }
+              setTimeout(() => {
+                downloadExcel(data)
+              }, 500)
+            })
+            .catch(() => {
+            })
+        } else {
+          const setlTypeName = filterSetlTypeName()
+          const exportName = year + setlTypeName + '环比'
+          if (setlinfos.value.length <= 0) {
+            ElMessage({
+              message: '没有可以导出的数据!',
+              type: 'warning',
+              duration: 2500,
+              showClose: true,
+            })
+          }
+          ElMessageBox.prompt('导出文件名字', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            inputPattern: /\S/,
+            inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
+          })
+            .then(({ value }) => {
+              const data = {
+                param: {
+                  startTime: setlCondition.startTime,
+                  endTime: setlCondition.endTime,
+                  setlType: setlCondition.setlType,
+                  insurType: setlCondition.insurType,
+                  selectType: setlCondition.selectType,
+                  exportName: exportName,
+                },
+                url: '/ybQuery/exportYbStatRatioExcel',
+                fileName: value + '.xlsx',
+              }
+              setTimeout(() => {
+                downloadExcel(data)
+              }, 500)
+            })
+            .catch(() => {
+            })
+        }
+      }
+    }
+
+    const handleClose = (done) => {
+      if (this.loading) {
+        return
+      }
+      this.$confirm('确定要提交表单吗?')
+        .then((_) => {
+          this.loading = true
+          this.timer = setTimeout(() => {
+            done()
+            // 动画关闭需要一定的时间
+            setTimeout(() => {
+              this.loading = false
+            }, 400)
+          }, 2000)
+        })
+        .catch((_) => {
+        })
+    }
+
+    const cancelForm = () => {
+      this.loading = false
+      this.dialog = false
+      clearTimeout(this.timer)
+    }
+
+    onMounted(() => {
+      // 初始化数据
+      setlCondition.selectType = 'first'
+      deptNo.value = ''
+    })
+
+    const exportTreeRs = () => {
+      let year = setlCondition.startTime.substr(0, 4) + '年'
+      const setlTypeName = filterSetlTypeName()
+      const exportName = year + setlTypeName + '人数'
+      if (treeData.value.length <= 0) {
+        ElMessage({
+          message: '没有可以导出的数据!',
+          type: 'warning',
+          duration: 2500,
+          showClose: true,
+        })
+      }
+      ElMessageBox.prompt('导出文件名字', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputPattern: /\S/,
+        inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
+      })
+        .then(({ value }) => {
+          const data = {
+            param: {
+              startTime: setlCondition.startTime,
+              endTime: setlCondition.endTime,
+              setlType: setlCondition.setlType,
+              selectType: setlCondition.selectType,
+              dept: deptNo.value,
+              doctor: doctorId.value,
+              insurType: insurCode.value,
+              exportName: exportName,
+            },
+            url: '/ybQuery/selectTreeAllData',
+            fileName: value + '.xlsx',
+          }
+          setTimeout(() => {
+            downloadExcel(data)
+          }, 500)
+        })
+        .catch(() => {
+        })
+    }
+
+    return {
+      tableHeight,
+      deptNo,
+      doctorId,
+      insurCode,
+      dateRange,
+      setlCondition,
+      setlinfos,
+      qxtDrawer,
+      titleChart,
+      chartData,
+      pieChartData,
+      showChart,
+      treeChart,
+      barChangeData,
+      treeData,
+      pageSize,
+      currentPage,
+      filterDialogTitle,
+      setldetails,
+      showSetldetails,
+      showSetlinfoComponent,
+      currentSetldetail,
+      handleCurrentChange,
+      handleSizeChange,
+      fetchSetldetails,
+      showBarChart,
+      showTreeChart,
+      selectTreeChart,
+      exportTreeRs,
+      selectChart,
+      handleSelect,
+      querySearchDept,
+      querySearchDoctor,
+      handleClose,
+      cancelForm,
+      getSummaries1,
+      exportSetlinfoExcel,
+      exportYbDetailExcel,
+      handleChange,
+      handleClick,
+      openSetlinfoComponent,
+      fetchSetlinfos,
+    }
+  },
+}
+
+function initInsurOptions() {
+  return [
+    {
+      value: '21',
+      label: '住院',
+      children: [
+        {
+          value: 99,
+          label: '全部',
+        },
+        {
+          value: 43010031001,
+          label: '长沙市城职',
+        },
+        {
+          value: 43010039001,
+          label: '长沙市城居',
+        },
+        {
+          value: 43010034001,
+          label: '长沙市离休',
+        },
+        {
+          value: 43010051052,
+          label: '长沙市生育',
+        },
+        {
+          value: 43012131001,
+          label: '长沙县城职',
+        },
+        {
+          value: 43012139001,
+          label: '长沙县城居',
+        },
+        {
+          value: 43012134001,
+          label: '长沙县离休',
+        },
+        {
+          value: 43012151052,
+          label: '长沙县生育',
+        },
+        {
+          value: 43018131001,
+          label: '浏阳市城职',
+        },
+        {
+          value: 43018139001,
+          label: '浏阳市城居',
+        },
+        {
+          value: 43018134001,
+          label: '浏阳市离休',
+        },
+        {
+          value: 43018151052,
+          label: '浏阳市生育',
+        },
+        {
+          value: 43990031001,
+          label: '湖南省城职',
+        },
+        {
+          value: 43990034001,
+          label: '湖南省离休',
+        },
+        {
+          value: 43990051052,
+          label: '湖南省生育',
+        },
+        {
+          value: 43990001,
+          label: '省内异地',
+        },
+        {
+          value: 43990002,
+          label: '省外异地',
+        },
+        {
+          value: 4301002102,
+          label: '市单病种',
+        },
+        {
+          value: 4399002102,
+          label: '省单病种',
+        },
+        {
+          value: 4399012102,
+          label: '省内单病种',
+        },
+      ],
+    },
+    {
+      value: '11',
+      label: '门诊',
+      children: [
+        {
+          value: 99,
+          label: '全部',
+        },
+        {
+          value: 11,
+          label: '普通门诊',
+        },
+        {
+          value: 14,
+          label: '特殊门诊',
+        },
+        {
+          value: 51,
+          label: '生育门诊',
+        },
+      ],
+    },
+  ]
+}
+</script>
+
+<style scoped>
+:deep(.el-table .children-row) {
+  background: rgba(145, 247, 145, 0.5);
+}
+
+:deep(.el-table--border td:first-child .cell, .el-table--border th:first-child .cell) {
+  padding-left: 4px;
+}
+
+:deep(.el-table) {
+  --el-table-row-hover-background-color: #85dbfd7a;
+}
+
+:deep(.el-table__footer-wrapper tbody td) {
+  background: #df4a25;
+  color: white;
+  font-weight: bold;
+}
+
+:deep(.el-main) {
+  padding: 0 5px;
+}
+
+:deep(.el-dialog__header) {
+  margin-right: 2px;
+}
+</style>