Переглянути джерело

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

DESKTOP-MINPJAU\Administrator 3 роки тому
батько
коміт
09114000ce

+ 9 - 0
src/api/medical-insurance/si-ybkf.js

@@ -62,3 +62,12 @@ export function selectTreeData(data) {
     data,
   })
 }
+
+// 查询树所有数据
+export function selectTreeAllData(data) {
+  return request({
+    url: '/ybQuery/selectTreeAllData',
+    method: 'post',
+    data,
+  })
+}

+ 248 - 271
src/views/examination/TjReportInfo.vue

@@ -1,182 +1,164 @@
 <template>
-  <el-container>
-    <el-header>
-      <el-input v-model="tjid" style="width: 260px" clearable placeholder="请输入患者体检编号"><template #prepend>体检号</template></el-input>
+  <page-layer>
+    <template #header>
+      <el-input v-model="tjid" style="width: 260px" clearable placeholder="请输入患者体检编号"><template #prepend>体检号</template>
+      </el-input>
       <el-button type="primary" icon="Search" style="margin-left: 16px" @click="queryTjData">查询</el-button>
-    </el-header>
-    <el-main>
-      <el-row :gutter="6">
-        <el-col :span="6">
-          <el-table :data="inspectionIndex" :height="tableHeight" stripe highlight-current-row @row-click="queryDetail">
-            <el-table-column prop="time" label="报告日期" width="140"></el-table-column>
-            <el-table-column prop="name" label="报告内容"></el-table-column>
-          </el-table>
-        </el-col>
-        <el-col :span="18">
-          <div id="reportDetail" style="width: 100%; height: 100%; padding: 0 2px; background-color: white">
-            <div v-if="tjxm === '首页'">
-              <div style="text-align: right; height: 77px; margin-bottom: 20px">
-                <svg id="barcode" v-if="tjid"></svg>
-              </div>
-              <div style="text-align: right; margin-bottom: 200px">
-                <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">长&emsp;沙&emsp;泰&emsp;和&emsp;医&emsp;院</h1>
-                <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">体&emsp;检&emsp;报&emsp;告</h1>
-              </div>
-              <div style="width: 100%; font-size: 18px">
-                <el-row :gutter="6">
-                  <el-col :span="6"></el-col>
-                  <el-col :span="6">体检编号:{{ tjReportDetail.reportHeader.条码号 }}</el-col>
-                  <el-col :span="6">
-                    <el-checkbox-group v-model="checkboxList"><el-checkbox label="个人"></el-checkbox><el-checkbox label="团体"></el-checkbox></el-checkbox-group>
-                  </el-col>
-                  <el-col :span="6"></el-col>
-                </el-row>
-                <el-row :gutter="6" style="margin-bottom: 8px">
-                  <el-col :span="6"></el-col>
-                  <el-col :span="6">姓&emsp;&emsp;名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
-                  <el-col :span="6">性&emsp;&emsp;别:{{ filterSex(tjReportDetail.reportHeader.性别) }}</el-col>
-                  <el-col :span="6">年&emsp;&emsp;龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
-                  <!-- <el-col :span="6"></el-col> -->
-                </el-row>
-                <el-row :gutter="6" style="margin-bottom: 8px">
-                  <el-col :span="6"></el-col>
-                  <el-col :span="12">单&emsp;&emsp;位:{{ tjReportDetail.reportHeader.工作单位 }}</el-col>
-                  <el-col :span="6"></el-col>
-                </el-row>
-                <el-row :gutter="6" style="margin-bottom: 8px">
-                  <el-col :span="6"></el-col>
-                  <el-col :span="12">部&emsp;&emsp;门:{{ tjReportDetail.reportHeader.所在部门 }}</el-col>
-                  <el-col :span="6"></el-col>
-                </el-row>
-                <el-row :gutter="6" style="margin-bottom: 160px">
-                  <el-col :span="6"></el-col>
-                  <el-col :span="6">体检日期:{{ filterDate(tjReportDetail.reportHeader.登记日期) }}</el-col>
-                  <el-col :span="6">电&emsp;&emsp;话:{{ tjReportDetail.reportHeader.手机 }}</el-col>
-                  <el-col :span="6"></el-col>
-                </el-row>
-                <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-                <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">长沙泰和医院</h5>
-                <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">咨询电话:0731-88518508</h5>
-                <h4 style="width: 100%; text-align: center; font-weight: bold; height: 5px; line-height: 5px">本体检报告仅供临床参考,不作为诊断依据,谢谢你的光临!</h4>
-              </div>
-            </div>
-            <div v-else-if="tjxm === '体检总结'">
-              <el-row :gutter="6" style="text-align: center; padding-top: 10px">
-                <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
-                <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
-                <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
-                <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
-              </el-row>
-              <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <el-row :gutter="6" style="padding-bottom: 6px; margin: 0 20px 0 20px">
-                <span style="font-weight: bold">
-                  尊敬的用户:<br />
-                  &emsp;&emsp;您好! 欢迎您莅临长沙泰和医院体检中心。身体健康是学习和工作的基础,注意健康是生活和事业发展的必须。世界卫生组织(WHO)提出:“健康是人的生
-                  理、心里和社会的完美状态,而不仅仅是指无疾病或非体弱的状态”。通过体检,检查和发现影响健康的有关因素,成为促进您身心健康的重要措施和保证。为了
-                  您的健康,我们真诚的建议您定期进行健康体检。
-                </span>
-              </el-row>
-              <el-row :gutter="6" style="padding-bottom: 6px; margin: 0 20px 0 20px">
-                <span style="font-weight: bold"> 祝您身体健康,工作顺利! </span>
-              </el-row>
-              <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <el-row :gutter="6" style="padding-bottom: 12px; margin: 0 20px 0 20px">
-                <div>
-                  <span style="font-size: 16px"><b>一丶体检结论及健康建议</b></span>
-                </div>
-              </el-row>
-              <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 40px">
-                <el-col :span="24">
-                  <span style="font-size: 12px; font-weight: bold">
-                    <p v-html="tjReportDetail.reportSummary.汇总建议"></p>
-                  </span>
-                </el-col>
-              </el-row>
-              <el-row :gutter="6" style="margin: 0 20px 0 20px">
-                <el-col :span="6"></el-col>
-                <el-col :span="6"></el-col>
-                <el-col :span="6"
-                  ><span style="font-size: 18px"
-                    ><b>汇总:{{ tjReportDetail.reportSummary.汇总医生 }}</b></span
-                  ></el-col
-                >
-                <el-col :span="6"
-                  ><span style="font-size: 18px"
-                    ><b>主检:{{ tjReportDetail.reportSummary.审核医生 }}</b></span
-                  ></el-col
-                >
-              </el-row>
-              <!-- <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
-                <el-col :span="6"></el-col>
-                <el-col :span="6"></el-col>
-                <el-col :span="6"></el-col>
-                <el-col :span="6"
-                  ><span style="font-size: 18px"
-                    ><b>主检:{{ tjReportDetail.reportSummary.审核医生 }}</b></span
-                  ></el-col
-                >
-              </el-row> -->
+    </template>
+    <template #aside>
+      <el-table :data="inspectionIndex" :height="tableHeight" stripe highlight-current-row @row-click="queryDetail">
+        <el-table-column prop="time" label="报告日期" width="140"></el-table-column>
+        <el-table-column prop="name" label="报告内容"></el-table-column>
+      </el-table>
+    </template>
+    <template #main>
+      <div id="reportDetail" style="width: 100%; height: 100%; padding: 0 2px; background-color: white">
+        <div v-if="tjxm === '首页'">
+          <div style="text-align: right; height: 77px; margin-bottom: 20px">
+            <svg id="barcode" v-if="tjid"></svg>
+          </div>
+          <div style="text-align: right; margin-bottom: 200px">
+            <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
+              长&emsp;沙&emsp;泰&emsp;和&emsp;医&emsp;院</h1>
+            <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
+              体&emsp;检&emsp;报&emsp;告</h1>
+          </div>
+          <div style="width: 100%; font-size: 18px">
+            <el-row :gutter="6">
+              <el-col :span="6"></el-col>
+              <el-col :span="6">体检编号:{{ tjReportDetail.reportHeader.条码号 }}</el-col>
+              <el-col :span="6">
+                <el-checkbox-group v-model="checkboxList">
+                  <el-checkbox label="个人"></el-checkbox>
+                  <el-checkbox label="团体"></el-checkbox>
+                </el-checkbox-group>
+              </el-col>
+              <el-col :span="6"></el-col>
+            </el-row>
+            <el-row :gutter="6" style="margin-bottom: 8px">
+              <el-col :span="6"></el-col>
+              <el-col :span="6">姓&emsp;&emsp;名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
+              <el-col :span="6">性&emsp;&emsp;别:{{ filterSex(tjReportDetail.reportHeader.性别) }}</el-col>
+              <el-col :span="6">年&emsp;&emsp;龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
+              <!-- <el-col :span="6"></el-col> -->
+            </el-row>
+            <el-row :gutter="6" style="margin-bottom: 8px">
+              <el-col :span="6"></el-col>
+              <el-col :span="12">单&emsp;&emsp;位:{{ tjReportDetail.reportHeader.工作单位 }}</el-col>
+              <el-col :span="6"></el-col>
+            </el-row>
+            <el-row :gutter="6" style="margin-bottom: 8px">
+              <el-col :span="6"></el-col>
+              <el-col :span="12">部&emsp;&emsp;门:{{ tjReportDetail.reportHeader.所在部门 }}</el-col>
+              <el-col :span="6"></el-col>
+            </el-row>
+            <el-row :gutter="6" style="margin-bottom: 160px">
+              <el-col :span="6"></el-col>
+              <el-col :span="6">体检日期:{{ filterDate(tjReportDetail.reportHeader.登记日期) }}</el-col>
+              <el-col :span="6">电&emsp;&emsp;话:{{ tjReportDetail.reportHeader.手机 }}</el-col>
+              <el-col :span="6"></el-col>
+            </el-row>
+            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+            <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">长沙泰和医院</h5>
+            <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">咨询电话:0731-88518508</h5>
+            <h4 style="width: 100%; text-align: center; font-weight: bold; height: 5px; line-height: 5px">
+              本体检报告仅供临床参考,不作为诊断依据,谢谢你的光临!</h4>
+          </div>
+        </div>
+        <div v-else-if="tjxm === '体检总结'">
+          <el-row :gutter="6" style="text-align: center; padding-top: 10px">
+            <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
+            <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
+            <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
+            <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
+          </el-row>
+          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+          <el-row :gutter="6" style="padding-bottom: 6px; margin: 0 20px 0 20px">
+            <span style="font-weight: bold">
+              尊敬的用户:<br />
+              &emsp;&emsp;您好! 欢迎您莅临长沙泰和医院体检中心。身体健康是学习和工作的基础,注意健康是生活和事业发展的必须。世界卫生组织(WHO)提出:“健康是人的生
+              理、心里和社会的完美状态,而不仅仅是指无疾病或非体弱的状态”。通过体检,检查和发现影响健康的有关因素,成为促进您身心健康的重要措施和保证。为了
+              您的健康,我们真诚的建议您定期进行健康体检。
+            </span>
+          </el-row>
+          <el-row :gutter="6" style="padding-bottom: 6px; margin: 0 20px 0 20px">
+            <span style="font-weight: bold"> 祝您身体健康,工作顺利! </span>
+          </el-row>
+          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+          <el-row :gutter="6" style="padding-bottom: 12px; margin: 0 20px 0 20px">
+            <div>
+              <span style="font-size: 16px"><b>一丶体检结论及健康建议</b></span>
             </div>
-            <div v-else>
-              <el-row :gutter="6" style="text-align: center; padding-top: 10px">
-                <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
-                <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
-                <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
-                <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
-              </el-row>
-              <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
-                <div style="text-align: center">
-                  <h2>{{ tjxm }}</h2>
-                </div>
-              </el-row>
-              <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
-                <el-table :data="inspectionItems.slice(pageSize * (currentPage - 1), pageSize * currentPage)" :height="tableHeight1" stripe highlight-current-row>
-                  <el-table-column prop="no" label="序号" width="70px"></el-table-column>
-                  <el-table-column prop="item" label="体检项目"></el-table-column>
-                  <el-table-column label="体检结果">
-                    <template #default="scope">
-                      {{ scope.row.result }}
-                      <span style="color: #f56c6c; font-size: 18px">
-                        <b>{{ scope.row.diffset }} </b>
-                      </span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="unit" label="单位"></el-table-column>
-                  <el-table-column prop="norm" label="参考值或范围"></el-table-column>
-                </el-table>
-                <el-pagination
-                  :current-page="currentPage"
-                  :page-size="pageSize"
-                  :page-sizes="[15, 30, 45, 60]"
-                  :total="inspectionItems.length"
-                  layout="total, sizes, prev, pager, next, jumper"
-                  style="margin-top: 5px"
-                  @size-change="handleSizeChange"
-                  @current-change="handleCurrentChange"
-                ></el-pagination>
-              </el-row>
-              <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px" v-if="itemResult.诊断内容">
-                <h3>
-                  科室小结:<span style="color: blue">{{ itemResult.诊断内容 }}</span>
-                </h3>
-              </el-row>
-              <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
-                <el-col :span="6"></el-col>
-                <el-col :span="6"></el-col>
-                <el-col :span="6">检验:{{ itemResult.检查医生签名 }}</el-col>
-                <el-col :span="6">审核:{{ itemResult.审核医生签名 }}</el-col>
-              </el-row>
-              <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
-                <h5>注:此检验报告只对本次标本负责,如有疑问请七日内复查。</h5>
-              </el-row>
+          </el-row>
+          <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 40px">
+            <el-col :span="24">
+              <span style="font-size: 12px; font-weight: bold">
+                <p v-html="tjReportDetail.reportSummary.汇总建议"></p>
+              </span>
+            </el-col>
+          </el-row>
+          <el-row :gutter="6" style="margin: 0 20px 0 20px">
+            <el-col :span="6"></el-col>
+            <el-col :span="6"></el-col>
+            <el-col :span="6"><span style="font-size: 18px"><b>汇总:{{ tjReportDetail.reportSummary.汇总医生 }}</b></span>
+            </el-col>
+            <el-col :span="6"><span style="font-size: 18px"><b>主检:{{ tjReportDetail.reportSummary.审核医生 }}</b></span>
+            </el-col>
+          </el-row>
+        </div>
+        <div v-else>
+          <el-row :gutter="6" style="text-align: center; padding-top: 10px">
+            <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
+            <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
+            <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
+            <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
+          </el-row>
+          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+          <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
+            <div style="text-align: center">
+              <h2>{{ tjxm }}</h2>
             </div>
-          </div>
-        </el-col>
-      </el-row>
-    </el-main>
-  </el-container>
+          </el-row>
+          <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
+            <el-table :data="inspectionItems.slice(pageSize * (currentPage - 1), pageSize * currentPage)"
+              :height="tableHeight1" stripe highlight-current-row>
+              <el-table-column prop="no" label="序号" width="70px"></el-table-column>
+              <el-table-column prop="item" label="体检项目"></el-table-column>
+              <el-table-column label="体检结果">
+                <template #default="scope">
+                  {{ scope.row.result }}
+                  <span style="color: #f56c6c; font-size: 18px">
+                    <b>{{ scope.row.diffset }} </b>
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="unit" label="单位"></el-table-column>
+              <el-table-column prop="norm" label="参考值或范围"></el-table-column>
+            </el-table>
+            <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[15, 30, 45, 60]"
+              :total="inspectionItems.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+              @size-change="handleSizeChange" @current-change="handleCurrentChange">
+            </el-pagination>
+          </el-row>
+          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+          <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px" v-if="itemResult.诊断内容">
+            <h3>
+              科室小结:<span style="color: blue">{{ itemResult.诊断内容 }}</span>
+            </h3>
+          </el-row>
+          <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
+            <el-col :span="6"></el-col>
+            <el-col :span="6"></el-col>
+            <el-col :span="6">检验:{{ itemResult.检查医生签名 }}</el-col>
+            <el-col :span="6">审核:{{ itemResult.审核医生签名 }}</el-col>
+          </el-row>
+          <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
+            <h5>注:此检验报告只对本次标本负责,如有疑问请七日内复查。</h5>
+          </el-row>
+        </div>
+      </div>
+    </template>
+  </page-layer>
 </template>
 <script>
 import { reactive, ref, onMounted } from 'vue'
@@ -184,150 +166,144 @@ import store from '@/store'
 import { getTjReportData } from '@/api/tj-report/tj-report'
 import JsBarcode from 'jsbarcode'
 import { ElMessage } from 'element-plus'
+import PageLayer from '@/layout/PageLayer.vue'
 export default {
   setup() {
-    const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h - 45
-    const tableHeight1 = windowSize.h - 360
-    const inspectionIndex = ref([])
-    const inspectionItems = ref([])
-    const itemResult = ref({})
-    const barcodeValue = ref('')
-    const tjid = ref('')
-    const tjxm = ref('首页')
-    const checkboxList = ref([])
-    const pageSize = ref(30)
-    const currentPage = ref(1)
+    const windowSize = store.state.app.windowSize;
+    const tableHeight = windowSize.h / 1.02;
+    const tableHeight1 = windowSize.h - 360;
+    const inspectionIndex = ref([]);
+    const inspectionItems = ref([]);
+    const itemResult = ref({});
+    const barcodeValue = ref("");
+    const tjid = ref("");
+    const tjxm = ref("首页");
+    const checkboxList = ref([]);
+    const pageSize = ref(30);
+    const currentPage = ref(1);
     const handleSizeChange = (val) => {
-      pageSize.value = val
-    }
+      pageSize.value = val;
+    };
     const handleCurrentChange = (val) => {
-      currentPage.value = val
-    }
+      currentPage.value = val;
+    };
     const tjReportDetail = reactive({
       reportHeader: {},
       reportItems: [],
       reportSummary: {},
-    })
-
+    });
     onMounted(() => {
-      inspectionIndex.value = [{ name: '首页' }, { name: '体检总结' }]
-    })
-
+      inspectionIndex.value = [{ name: "首页" }, { name: "体检总结" }];
+    });
     const queryDetail = (row) => {
-      let item = row.name
-      tjxm.value = item
-
-      if (tjxm.value && item === '首页') {
+      let item = row.name;
+      tjxm.value = item;
+      if (tjxm.value && item === "首页") {
         nextTick(() => {
-          JsBarcode('#barcode', tjid.value, {
-            lineColor: '#333', //线条颜色
-            width: 2, //线宽
-            height: 35, //条码高度
+          JsBarcode("#barcode", tjid.value, {
+            lineColor: "#333",
+            width: 2,
+            height: 35,
             displayValue: true, //是否显示文字信息
-          })
-        })
-      } else if (item != '首页' && item != '体检总结') {
-        let items = []
-        inspectionItems.value = []
+          });
+        });
+      }
+      else if (item != "首页" && item != "体检总结") {
+        let items = [];
+        inspectionItems.value = [];
         for (let i = 0; i < tjReportDetail.reportItems.length; i++) {
           if (tjReportDetail.reportItems[i][item]) {
-            items = tjReportDetail.reportItems[i][item]
+            items = tjReportDetail.reportItems[i][item];
           }
         }
-
         // 解析获取的检查结果(过滤没有结果的检查等)
-        let resultItems = []
+        let resultItems = [];
         if (items) {
-          let no = 1
+          let no = 1;
           for (let i = 0; i < items.length; i++) {
             if (i == items.length - 1) {
-              itemResult.value = items[i]
+              itemResult.value = items[i];
             }
-
-            if (!items[i]['结果']) {
-              continue
+            if (!items[i]["结果"]) {
+              continue;
             }
-
-            let _item = { no: '', item: '', result: '', unit: '', norm: '', diffset: '' }
-            _item.no = no
-            _item.item = items[i]['检查项目']
-            _item.result = items[i]['结果']
-            if (items[i]['阳性标识']) {
-              _item.diffset = items[i]['阳性标识']
+            let _item = { no: "", item: "", result: "", unit: "", norm: "", diffset: "" };
+            _item.no = no;
+            _item.item = items[i]["检查项目"];
+            _item.result = items[i]["结果"];
+            if (items[i]["阳性标识"]) {
+              _item.diffset = items[i]["阳性标识"];
             }
-            _item.unit = items[i]['单位']
-            _item.norm = items[i]['参考范围显示效果']
-
-            resultItems.push(_item)
-            no = no + 1
+            _item.unit = items[i]["单位"];
+            _item.norm = items[i]["参考范围显示效果"];
+            resultItems.push(_item);
+            no = no + 1;
           }
         }
-        inspectionItems.value = resultItems
+        inspectionItems.value = resultItems;
       }
-    }
-
+    };
     const queryTjData = () => {
       if (!tjid.value) {
         ElMessage({
-          message: '请输入患者体检编号。',
-          type: 'warning',
+          message: "请输入患者体检编号。",
+          type: "warning",
           duration: 2000,
           showClose: true,
-        })
-        return
+        });
+        return;
       }
-
-      JsBarcode('#barcode', tjid.value, {
-        lineColor: '#333', //线条颜色
-        width: 2, //线宽
-        height: 35, //条码高度
+      JsBarcode("#barcode", tjid.value, {
+        lineColor: "#333",
+        width: 2,
+        height: 35,
         displayValue: true, //是否显示文字信息
-      })
-
+      });
       const param = {
         tjid: tjid.value,
-      }
+      };
       getTjReportData(param)
         .then((res) => {
           if (!res || res.length == 0) {
             ElMessage({
-              message: '没有体检报告数据',
-              type: 'warning',
+              message: "没有体检报告数据",
+              type: "warning",
               duration: 2000,
               showClose: true,
-            })
-            return
+            });
+            return;
           }
-
-          inspectionIndex.value = [{ name: '首页' }, { name: '体检总结' }]
+          inspectionIndex.value = [{ name: "首页" }, { name: "体检总结" }];
           for (const key in res) {
             if (res[key].reportHeader) {
-              tjReportDetail.reportHeader = res[key].reportHeader
-            } else if (res[key].reportItems) {
-              inspectionIndex.value = inspectionIndex.value.concat(res[key].reportItems)
-            } else if (res[key].reportSummary) {
-              tjReportDetail.reportSummary = res[key].reportSummary
-            } else {
-              tjReportDetail.reportItems.push(res[key])
+              tjReportDetail.reportHeader = res[key].reportHeader;
+            }
+            else if (res[key].reportItems) {
+              inspectionIndex.value = inspectionIndex.value.concat(res[key].reportItems);
+            }
+            else if (res[key].reportSummary) {
+              tjReportDetail.reportSummary = res[key].reportSummary;
+            }
+            else {
+              tjReportDetail.reportItems.push(res[key]);
             }
           }
-
-          barcodeValue.value = tjReportDetail.reportHeader.条码号
-          tjid.value = tjReportDetail.reportHeader.条码号
-          if (tjReportDetail.reportHeader.团体or个人 === '0') {
-            checkboxList.value = ['团体']
-          } else if (tjReportDetail.reportHeader.团体or个人 === '1') {
-            checkboxList.value = ['个人']
-          } else {
-            checkboxList.value = []
+          barcodeValue.value = tjReportDetail.reportHeader.条码号;
+          tjid.value = tjReportDetail.reportHeader.条码号;
+          if (tjReportDetail.reportHeader.团体or个人 === "0") {
+            checkboxList.value = ["团体"];
+          }
+          else if (tjReportDetail.reportHeader.团体or个人 === "1") {
+            checkboxList.value = ["个人"];
+          }
+          else {
+            checkboxList.value = [];
           }
         })
         .catch((e) => {
-          console.log(e)
-        })
-    }
-
+          console.log(e);
+        });
+    };
     return {
       barcodeValue,
       tableHeight,
@@ -347,8 +323,9 @@ export default {
       filterDate,
       handleCurrentChange,
       handleSizeChange,
-    }
+    };
   },
+  components: { PageLayer }
 }
 
 function filterSex(val) {

+ 256 - 265
src/views/medical-insurance/allpatient/InsurIncomeAnalysis.vue

@@ -2,16 +2,9 @@
   <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="请选择险种"
-      >
+        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>
@@ -23,51 +16,33 @@
     <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 :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="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="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%">
+            :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 :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>
@@ -76,10 +51,8 @@
               <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="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>
@@ -100,51 +73,26 @@
               <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-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"/>
+            <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 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>
+          <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"
-              >
+              <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"
-              >
+              <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">
@@ -152,13 +100,14 @@
               </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">
+            :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>
@@ -184,7 +133,7 @@
         </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">
+            :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>
@@ -237,10 +186,10 @@
 </template>
 
 <script>
-import {computed, onMounted, reactive, ref, watch} from 'vue'
-import {useStore} from 'vuex'
+import { computed, onMounted, reactive, ref, watch } from 'vue'
+import { useStore } from 'vuex'
 import store from '@/store'
-import {getDateRangeFormatDate, formatDatetime} from '@/utils/date'
+import { getDateRangeFormatDate, formatDatetime } from '@/utils/date'
 import {
   selectYbStatInfo,
   selectYbStatRatio,
@@ -250,14 +199,14 @@ import {
   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 { 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 { selectSmallDept, selectDoctor } from '@/api/medical-insurance/si-yb-util'
 import PageLayer from "@/layout/PageLayer";
 
 export default {
@@ -301,43 +250,43 @@ export default {
 
       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)
-              }
+        .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)
+            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)
-            })
+            dataBar.push(d)
           })
-          .catch(() => {
-            barChangeData.value = []
+          nextTick(() => {
+            barUtilsThree(hightChart, '总费用(TOP' + num + ')', months, dataBar, num - 1, unit)
           })
+        })
+        .catch(() => {
+          barChangeData.value = []
+        })
     }
 
     const querySearchDept = async (str, cb) => {
-      let results = await selectSmallDept({str})
+      let results = await selectSmallDept({ str })
       if (results) {
         // 调用 callback 返回建议列表的数据
         cb(results)
@@ -345,7 +294,7 @@ export default {
     }
 
     const querySearchDoctor = async (str, cb) => {
-      let results = await selectDoctor({str})
+      let results = await selectDoctor({ str })
       if (results) {
         // 调用 callback 返回建议列表的数据
         cb(results)
@@ -425,13 +374,13 @@ export default {
       let selectInfo = clone(setlCondition)
       selectInfo.insurType = row.insurType
       selectYbStatDetail(selectInfo)
-          .then((res) => {
-            setldetails.value = res
-            showSetldetails.value = true
-          })
-          .catch(() => {
-            setldetails.value = []
-          })
+        .then((res) => {
+          setldetails.value = res
+          showSetldetails.value = true
+        })
+        .catch(() => {
+          setldetails.value = []
+        })
     }
 
     const filterDialogTitle = computed(() => {
@@ -495,20 +444,20 @@ export default {
 
       if (setlCondition.selectType === 'first') {
         selectYbStatInfo(setlCondition)
-            .then((res) => {
-              setlinfos.value = res
-            })
-            .catch(() => {
-              setlinfos.value = []
-            })
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
       } else {
         selectYbStatRatio(setlCondition)
-            .then((res) => {
-              setlinfos.value = res
-            })
-            .catch(() => {
-              setlinfos.value = []
-            })
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
       }
     }
 
@@ -619,66 +568,66 @@ export default {
     }
 
     watch(
-        () => chartData.value,
-        () => {
-          let nameText
-          let barTitles = ['总费用', '全部基金', '药品费', '耗材费']
-          if (setlCondition.setlType === '21') {
-            nameText = '住院'
+      () => 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 {
-            nameText = '门诊'
+            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)
           }
-          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)
-        }
+        })
+        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) => {
@@ -713,20 +662,20 @@ export default {
 
       if (setlCondition.selectType === 'first') {
         selectYbStatInfo(setlCondition)
-            .then((res) => {
-              setlinfos.value = res
-            })
-            .catch(() => {
-              setlinfos.value = []
-            })
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
       } else {
         selectYbStatRatio(setlCondition)
-            .then((res) => {
-              setlinfos.value = res
-            })
-            .catch(() => {
-              setlinfos.value = []
-            })
+          .then((res) => {
+            setlinfos.value = res
+          })
+          .catch(() => {
+            setlinfos.value = []
+          })
       }
     }
 
@@ -814,7 +763,7 @@ export default {
     }
 
     const getSummaries1 = (param) => {
-      const {columns, data} = param
+      const { columns, data } = param
       const sums = []
       // 住院人次下标
       let psnCountIndex = 0
@@ -1042,25 +991,25 @@ export default {
             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(() => {
-              })
+            .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 + '环比'
@@ -1078,25 +1027,25 @@ export default {
             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(() => {
-              })
+            .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(() => {
+            })
         }
       }
     }
@@ -1106,18 +1055,18 @@ export default {
         return
       }
       this.$confirm('确定要提交表单吗?')
-          .then((_) => {
-            this.loading = true
-            this.timer = setTimeout(() => {
-              done()
-              // 动画关闭需要一定的时间
-              setTimeout(() => {
-                this.loading = false
-              }, 400)
-            }, 2000)
-          })
-          .catch((_) => {
-          })
+        .then((_) => {
+          this.loading = true
+          this.timer = setTimeout(() => {
+            done()
+            // 动画关闭需要一定的时间
+            setTimeout(() => {
+              this.loading = false
+            }, 400)
+          }, 2000)
+        })
+        .catch((_) => {
+        })
     }
 
     const cancelForm = () => {
@@ -1132,6 +1081,47 @@ export default {
       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,
@@ -1161,6 +1151,7 @@ export default {
       showBarChart,
       showTreeChart,
       selectTreeChart,
+      exportTreeRs,
       selectChart,
       handleSelect,
       querySearchDept,

+ 209 - 259
src/views/medical-insurance/statistical/CssybBzTj.vue

@@ -1,50 +1,34 @@
 <template>
-  <el-container>
-    <el-header height="35px" style="margin-top: 10px">
-      <template #prepend>结算时间</template>
-      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
-      <el-autocomplete
-        v-model="dept"
-        value-key="name"
-        :fetch-suggestions="querySearchDept"
-        :trigger-on-focus="false"
-        clearable
-        class="inline-input w-50 m-2"
-        style="width: 200px"
-        placeholder="请输入关键字"
-        @select="handleSelect"
-      >
-        <template #prepend>科室</template>
-      </el-autocomplete>
-      <el-select v-model="insurId" style="width: 180px" clearable placeholder="请选择险种">
-        <el-option label="长沙市城职普通住院" value="1"></el-option>
-        <el-option label="长沙市城居普通住院" value="2"></el-option>
-      </el-select>
-      <el-input v-model="bzmc" clearable style="width: 220px" class="w-50 m-2" placeholder="请输入关键字">
-        <template #prepend>病种名称</template>
-      </el-input>
-      <el-autocomplete
-        v-model="doctor"
-        value-key="name"
-        :fetch-suggestions="querySearchDoctor"
-        :trigger-on-focus="false"
-        clearable
-        class="inline-input w-50 m-2"
-        style="width: 220px"
-        placeholder="请输入关键字"
-        @select="handleSelect"
-      >
-        <template #prepend>管床医生</template>
-      </el-autocomplete>
-      <el-select v-model="yk" style="width: 140px" clearable placeholder="请选择状况">
-        <el-option label="盈余" value="y"></el-option>
-        <el-option label="亏损" value="k"></el-option>
-      </el-select>
-      <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
-      <el-button type="primary" icon="Download" @click="exportBz" style="margin-left: 5px">导出</el-button>
-    </el-header>
-    <el-main>
-      <el-table :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" :height="tableHeight" highlight-current-row stripe>
+  <PageLayer>
+    <template #header>
+        <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
+          end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
+        <el-autocomplete v-model="dept" value-key="name" :fetch-suggestions="querySearchDept" :trigger-on-focus="false"
+          clearable class="inline-input w-50 m-2" style="width: 200px" placeholder="请输入关键字" @select="handleSelect">
+          <template #prepend>科室</template>
+        </el-autocomplete>
+        <el-select v-model="insurId" style="width: 180px" clearable placeholder="请选择险种">
+          <el-option label="长沙市城职普通住院" value="1"></el-option>
+          <el-option label="长沙市城居普通住院" value="2"></el-option>
+        </el-select>
+        <el-input v-model="bzmc" clearable style="width: 220px" class="w-50 m-2" placeholder="请输入关键字">
+          <template #prepend>病种名称</template>
+        </el-input>
+        <el-autocomplete v-model="doctor" value-key="name" :fetch-suggestions="querySearchDoctor"
+          :trigger-on-focus="false" clearable class="inline-input w-50 m-2" style="width: 220px" placeholder="请输入关键字"
+          @select="handleSelect">
+          <template #prepend>管床医生</template>
+        </el-autocomplete>
+        <el-select v-model="yk" style="width: 140px" clearable placeholder="请选择状况">
+          <el-option label="盈余" value="y"></el-option>
+          <el-option label="亏损" value="k"></el-option>
+        </el-select>
+        <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
+        <el-button type="primary" icon="Download" @click="exportBz" style="margin-left: 5px">导出</el-button>
+    </template>
+    <template #main>
+      <el-table :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" :height="tableHeight"
+        highlight-current-row stripe>
         <el-table-column type="expand">
           <template #default="props">
             <el-table :data="props.row.children" v-show="props.row.isChildren">
@@ -81,96 +65,79 @@
         </el-table-column>
       </el-table>
       <el-footer style="height: 40px">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[15, 30, 50, 100]"
-          :page-size="pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="returnData.length"
-          style="margin-top: 5px"
-        ></el-pagination>
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+          :page-sizes="[15, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+          :total="returnData.length" style="margin-top: 5px"></el-pagination>
       </el-footer>
-    </el-main>
-    <el-dialog v-model="showBzXq" :close-on-click-modal="false" title="病种对比信息" width="80%">
-      <el-table :data="fetchBzdbDetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)" height="560" highlight-current-row stripe @row-dblclick="openBzBrMx">
-        <el-table-column label="科室" prop="dept"></el-table-column>
-        <el-table-column label="医生" prop="doctor"></el-table-column>
-        <el-table-column label="病种名称" prop="zdmc" width="160"></el-table-column>
-        <el-table-column label="治疗方案" prop="zlfs"></el-table-column>
-        <el-table-column label="申报类型" prop="sblx"></el-table-column>
-        <el-table-column label="医保类型" prop="insurName"></el-table-column>
-        <el-table-column label="总费用" prop="zfy" align="right"></el-table-column>
-        <el-table-column label="医保预计支付" prop="yjzf" align="right"></el-table-column>
-        <el-table-column label="医保统筹支付" prop="tczf" align="right"></el-table-column>
-        <el-table-column label="盈亏额" prop="bal" align="right">
-          <template #default="scope">
-            <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
-            <span v-else>{{ scope.row.bal }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="人次" prop="rs" align="right"></el-table-column>
-        <el-table-column label="人均总费用" prop="cjzfy" align="right"></el-table-column>
-        <el-table-column label="人均医保预计支付(元)" prop="cjyjzf" align="right"></el-table-column>
-        <el-table-column label="人均医保统筹支付(元)" prop="cjtczf" align="right"></el-table-column>
-      </el-table>
-      <el-footer style="height: 40px">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[15, 30, 50, 100]"
-          :page-size="pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="fetchBzdbDetails.length"
-          style="margin-top: 5px"
-        ></el-pagination>
-      </el-footer>
-    </el-dialog>
-    <el-dialog v-model="showBzBrXq" :close-on-click-modal="false" title="病种对比病人信息" width="80%">
-      <el-table :data="fetchBzdbBrDetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)" height="560" highlight-current-row stripe>
-        <el-table-column fixed label="科室" prop="dept"></el-table-column>
-        <el-table-column fixed label="医生" prop="doctor"></el-table-column>
-        <el-table-column fixed label="住院号" prop="zyh"></el-table-column>
-        <el-table-column label="姓名" prop="xm"></el-table-column>
-        <el-table-column label="主要诊断" prop="zdmc" width="180" show-overflow-tooltip>
-          <template #default="scope"> {{ scope.row.zdmc }}<span>(</span>{{ scope.row.zdbm }}<span>)</span> </template>
-        </el-table-column>
-        <el-table-column label="主要手术" prop="ssmc" width="180" show-overflow-tooltip>
-          <template #default="scope">
-            <span v-if="scope.row.ssmc">{{ scope.row.ssmc }}<span>(</span>{{ scope.row.ssbm }}<span>)</span></span>
-          </template>
-        </el-table-column>
-        <el-table-column label="治疗方案" prop="zlfs" width="120"></el-table-column>
-        <el-table-column label="申报类型" prop="sblx"></el-table-column>
-        <el-table-column label="医保类型" prop="yblx" width="120"></el-table-column>
-        <el-table-column label="总费用" prop="zfy" align="right"></el-table-column>
-        <el-table-column label="医保预计支付" prop="yjzf" align="right"></el-table-column>
-        <el-table-column label="医保统筹支付" prop="tczf" align="right"></el-table-column>
-        <el-table-column label="盈亏额" prop="bal" align="right">
-          <template #default="scope">
-            <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
-            <span v-else>{{ scope.row.bal }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="分值" prop="fz" align="right"></el-table-column>
-        <el-table-column label="结算时间" prop="jssj" width="140" align="center"></el-table-column>
-      </el-table>
-      <el-footer style="height: 40px">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[15, 30, 50, 100]"
-          :page-size="pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="fetchBzdbBrDetails.length"
-          style="margin-top: 5px"
-        ></el-pagination>
-      </el-footer>
-    </el-dialog>
-  </el-container>
+    </template>
+  </PageLayer>
+
+  <el-dialog v-model="showBzXq" :close-on-click-modal="false" title="病种对比信息" width="80%">
+    <el-table :data="fetchBzdbDetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)" height="560"
+      highlight-current-row stripe @row-dblclick="openBzBrMx">
+      <el-table-column label="科室" prop="dept"></el-table-column>
+      <el-table-column label="医生" prop="doctor"></el-table-column>
+      <el-table-column label="病种名称" prop="zdmc" width="160"></el-table-column>
+      <el-table-column label="治疗方案" prop="zlfs"></el-table-column>
+      <el-table-column label="申报类型" prop="sblx"></el-table-column>
+      <el-table-column label="医保类型" prop="insurName"></el-table-column>
+      <el-table-column label="总费用" prop="zfy" align="right"></el-table-column>
+      <el-table-column label="医保预计支付" prop="yjzf" align="right"></el-table-column>
+      <el-table-column label="医保统筹支付" prop="tczf" align="right"></el-table-column>
+      <el-table-column label="盈亏额" prop="bal" align="right">
+        <template #default="scope">
+          <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
+          <span v-else>{{ scope.row.bal }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="人次" prop="rs" align="right"></el-table-column>
+      <el-table-column label="人均总费用" prop="cjzfy" align="right"></el-table-column>
+      <el-table-column label="人均医保预计支付(元)" prop="cjyjzf" align="right"></el-table-column>
+      <el-table-column label="人均医保统筹支付(元)" prop="cjtczf" align="right"></el-table-column>
+    </el-table>
+    <el-footer style="height: 40px">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[15, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="fetchBzdbDetails.length" style="margin-top: 5px"></el-pagination>
+    </el-footer>
+  </el-dialog>
+  <el-dialog v-model="showBzBrXq" :close-on-click-modal="false" title="病种对比病人信息" width="80%">
+    <el-table :data="fetchBzdbBrDetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)" height="560"
+      highlight-current-row stripe>
+      <el-table-column fixed label="科室" prop="dept"></el-table-column>
+      <el-table-column fixed label="医生" prop="doctor"></el-table-column>
+      <el-table-column fixed label="住院号" prop="zyh"></el-table-column>
+      <el-table-column label="姓名" prop="xm"></el-table-column>
+      <el-table-column label="主要诊断" prop="zdmc" width="180" show-overflow-tooltip>
+        <template #default="scope"> {{ scope.row.zdmc }}<span>(</span>{{ scope.row.zdbm }}<span>)</span> </template>
+      </el-table-column>
+      <el-table-column label="主要手术" prop="ssmc" width="180" show-overflow-tooltip>
+        <template #default="scope">
+          <span v-if="scope.row.ssmc">{{ scope.row.ssmc }}<span>(</span>{{ scope.row.ssbm }}<span>)</span></span>
+        </template>
+      </el-table-column>
+      <el-table-column label="治疗方案" prop="zlfs" width="120"></el-table-column>
+      <el-table-column label="申报类型" prop="sblx"></el-table-column>
+      <el-table-column label="医保类型" prop="yblx" width="120"></el-table-column>
+      <el-table-column label="总费用" prop="zfy" align="right"></el-table-column>
+      <el-table-column label="医保预计支付" prop="yjzf" align="right"></el-table-column>
+      <el-table-column label="医保统筹支付" prop="tczf" align="right"></el-table-column>
+      <el-table-column label="盈亏额" prop="bal" align="right">
+        <template #default="scope">
+          <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
+          <span v-else>{{ scope.row.bal }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="分值" prop="fz" align="right"></el-table-column>
+      <el-table-column label="结算时间" prop="jssj" width="140" align="center"></el-table-column>
+    </el-table>
+    <el-footer style="height: 40px">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[15, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="fetchBzdbBrDetails.length" style="margin-top: 5px"></el-pagination>
+    </el-footer>
+  </el-dialog>
+
 </template>
 <script>
 import { reactive, ref } from '@vue/reactivity'
@@ -181,174 +148,156 @@ import { formatDate, getDateRangeFormatDate } from '@/utils/date'
 import { selectSmallDept, selectDoctor } from '@/api/medical-insurance/si-yb-util'
 import { selectCssYbBzTj, selectBzDbDetail, selectBzDbBrDetail } from '@/api/ybkf/yb-cssybtj'
 import { Export } from '@/utils/ExportExcel'
+import PageLayer from "@/layout/PageLayer";
 
 export default {
   setup() {
-    const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h / 1.2
-
-    const start = formatDate(seltYearAndNowLast[0].value[0])
-    const end = formatDate(seltYearAndNowLast[1].value[1])
-
-    const insurId = ref('')
-    const dept = ref('')
-    const doctor = ref('')
-    const bzmc = ref('')
-    const yk = ref('')
-
+    const windowSize = store.state.app.windowSize;
+    const tableHeight = windowSize.h / 1.08;
+    const start = formatDate(seltYearAndNowLast[0].value[0]);
+    const end = formatDate(seltYearAndNowLast[1].value[1]);
+    const insurId = ref("");
+    const dept = ref("");
+    const doctor = ref("");
+    const bzmc = ref("");
+    const yk = ref("");
     const queryTerm = reactive({
-      startTime: '',
-      endTime: '',
-      insurName: '',
-      dept: '',
-      doctor: '',
-      bzmc: '',
-      yk: '',
-      zlfs: '',
-      sblx: '',
-    })
+      startTime: "",
+      endTime: "",
+      insurName: "",
+      dept: "",
+      doctor: "",
+      bzmc: "",
+      yk: "",
+      zlfs: "",
+      sblx: "",
+    });
     onMounted(() => {
-      queryTerm.startTime = start
-      queryTerm.endTime = end + ' 23:59:59'
-      dateRange.value = [start, end]
-    })
-
-    const handleSelect = (item) => {}
-
+      queryTerm.startTime = start;
+      queryTerm.endTime = end + " 23:59:59";
+      dateRange.value = [start, end];
+    });
+    const handleSelect = (item) => { };
     const querySearchDept = async (str, cb) => {
-      let results = await selectSmallDept({ str })
+      let results = await selectSmallDept({ str });
       if (results) {
         // 调用 callback 返回建议列表的数据
-        cb(results)
+        cb(results);
       }
-    }
-
+    };
     const querySearchDoctor = async (str, cb) => {
-      let results = await selectDoctor({ str })
+      let results = await selectDoctor({ str });
       if (results) {
         // 调用 callback 返回建议列表的数据
-        cb(results)
+        cb(results);
       }
-    }
-
+    };
     const handleSizeChange = (val) => {
-      pageSize.value = val
-    }
-
+      pageSize.value = val;
+    };
     const handleCurrentChange = (val) => {
-      currentPage.value = val
-    }
-
-    const currentPage = ref(1)
-    const pageSize = ref(30)
-
-    const dateRange = ref([])
-    const returnData = ref([])
-
+      currentPage.value = val;
+    };
+    const currentPage = ref(1);
+    const pageSize = ref(30);
+    const dateRange = ref([]);
+    const returnData = ref([]);
     const query = () => {
       if (dateRange.value) {
-        let dateS = getDateRangeFormatDate(dateRange.value)
-        queryTerm.startTime = dateS.startTime
-        queryTerm.endTime = dateS.endTime
-      } else {
-        queryTerm.startTime = start
-        queryTerm.endTime = end
-
+        let dateS = getDateRangeFormatDate(dateRange.value);
+        queryTerm.startTime = dateS.startTime;
+        queryTerm.endTime = dateS.endTime;
+      }
+      else {
+        queryTerm.startTime = start;
+        queryTerm.endTime = end;
         ElMessage({
-          type: 'info',
-          message: '默认查询本月的数据',
+          type: "info",
+          message: "默认查询本月的数据",
           duration: 2500,
           showClose: true,
-        })
+        });
       }
-
-      queryTerm.insurName = filterInsurName()
-      queryTerm.dept = dept.value
-      queryTerm.doctor = doctor.value
-      queryTerm.bzmc = bzmc.value
-      queryTerm.yk = yk.value
-
+      queryTerm.insurName = filterInsurName();
+      queryTerm.dept = dept.value;
+      queryTerm.doctor = doctor.value;
+      queryTerm.bzmc = bzmc.value;
+      queryTerm.yk = yk.value;
       selectCssYbBzTj(queryTerm)
         .then((res) => {
-          returnData.value = res
+          returnData.value = res;
         })
         .catch(() => {
-          returnData.value = []
-        })
-      returnData.value = []
-    }
-
+          returnData.value = [];
+        });
+      returnData.value = [];
+    };
     const filterInsurName = () => {
-      if (insurId.value == '1') {
-        return '长沙市城职普通住院'
-      } else if (insurId.value == '2') {
-        return '长沙市城居普通住院'
-      } else {
-        return ''
+      if (insurId.value == "1") {
+        return "长沙市城职普通住院";
       }
-    }
-
+      else if (insurId.value == "2") {
+        return "长沙市城居普通住院";
+      }
+      else {
+        return "";
+      }
+    };
     // ----------------------展开数据列-------------------------
     // 操作
-    const showBzXq = ref(false)
-    const fetchBzdbDetails = ref([])
-
+    const showBzXq = ref(false);
+    const fetchBzdbDetails = ref([]);
     const cz = (row) => {
-      let selectBzInfo = clone(queryTerm)
-      selectBzInfo.bzmc = row.zdmc
-      selectBzInfo.zlfs = row.zlfs
-      selectBzInfo.sblx = row.sblx
-
+      let selectBzInfo = clone(queryTerm);
+      selectBzInfo.bzmc = row.zdmc;
+      selectBzInfo.zlfs = row.zlfs;
+      selectBzInfo.sblx = row.sblx;
       selectBzDbDetail(selectBzInfo)
         .then((res) => {
-          fetchBzdbDetails.value = res
-          showBzXq.value = true
+          fetchBzdbDetails.value = res;
+          showBzXq.value = true;
         })
         .catch(() => {
-          fetchBzdbDetails.value = []
-        })
-    }
-
+          fetchBzdbDetails.value = [];
+        });
+    };
     // ----------------------病种对比明细情况-----------------------
-    const showBzBrXq = ref(false)
-    const fetchBzdbBrDetails = ref({})
-
+    const showBzBrXq = ref(false);
+    const fetchBzdbBrDetails = ref({});
     const openBzBrMx = (row) => {
-      let selectBzInfo = clone(queryTerm)
-      selectBzInfo.bzmc = row.zdmc
-      selectBzInfo.zlfs = row.zlfs
-      selectBzInfo.sblx = row.sblx
-      selectBzInfo.dept = row.dept
-      selectBzInfo.doctor = row.doctor
-      selectBzInfo.insurName = row.insurName
-
+      let selectBzInfo = clone(queryTerm);
+      selectBzInfo.bzmc = row.zdmc;
+      selectBzInfo.zlfs = row.zlfs;
+      selectBzInfo.sblx = row.sblx;
+      selectBzInfo.dept = row.dept;
+      selectBzInfo.doctor = row.doctor;
+      selectBzInfo.insurName = row.insurName;
       selectBzDbBrDetail(selectBzInfo).then((res) => {
-        fetchBzdbBrDetails.value = res
-        showBzBrXq.value = true
-      })
-    }
-
+        fetchBzdbBrDetails.value = res;
+        showBzBrXq.value = true;
+      });
+    };
     // ----------------导出--------------------
     const exportBz = () => {
       if (returnData.value.length === 0) {
         ElMessage({
-          message: '没有可以导出的数据!',
-          type: 'warning',
+          message: "没有可以导出的数据!",
+          type: "warning",
           duration: 2500,
           showClose: true,
-        })
-      } else {
+        });
+      }
+      else {
         const title = {
-          zdmc: '病种名称',
-          cjyjzf: '人均医保预计支付(元)',
-          cjtczf: '人均医保统筹支付(元)',
-          rs: '人次',
-          bal: '盈亏额',
-        }
-        Export(returnData.value, title, '市医保病种统计')
+          zdmc: "病种名称",
+          cjyjzf: "人均医保预计支付(元)",
+          cjtczf: "人均医保统筹支付(元)",
+          rs: "人次",
+          bal: "盈亏额",
+        };
+        Export(returnData.value, title, "市医保病种统计");
       }
-    }
-
+    };
     return {
       dateRange,
       shortcuts,
@@ -375,8 +324,9 @@ export default {
       exportBz,
       handleSizeChange,
       handleCurrentChange,
-    }
+    };
   },
+  components: { PageLayer }
 }
 </script>
 <style scoped>

+ 144 - 177
src/views/medical-insurance/statistical/CssybCsTj.vue

@@ -1,37 +1,24 @@
 <template>
-  <el-container>
-    <el-header height="35px" style="margin-top: 10px">
-      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
-      <el-autocomplete
-        v-model="dept"
-        value-key="name"
-        :fetch-suggestions="querySearchDept"
-        :trigger-on-focus="false"
-        clearable
-        class="inline-input w-50 m-2"
-        style="width: 240px"
-        placeholder="请输入关键字"
-        @select="handleSelect"
-      >
+  <page-layer>
+    <template #header>
+      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
+        end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
+      <el-autocomplete v-model="dept" 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-input v-model="zyh" style="width: 240px" clearable placeholder="请输入住院号"><template #prepend>住院号</template></el-input>
+      <el-input v-model="zyh" style="width: 240px" clearable placeholder="请输入住院号"><template #prepend>住院号</template>
+      </el-input>
       <el-select v-model="insurId" style="width: 200px" clearable>
         <el-option label="长沙市城职普通住院" value="1"></el-option>
         <el-option label="长沙市城居普通住院" value="2"></el-option>
       </el-select>
       <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
       <el-button type="primary" icon="Download" @click="exportCycs" style="margin-left: 5px">导出</el-button>
-    </el-header>
-    <el-main>
-      <el-table
-        :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
-        :height="tableHeight"
-        stripe
-        highlight-current-row
-        show-summary
-        :summary-method="getSummaries"
-      >
+    </template>
+    <template #main>
+      <el-table :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" :height="tableHeight"
+        stripe highlight-current-row show-summary :summary-method="getSummaries">
         <el-table-column fixed prop="cyks" label="科室" width="130"></el-table-column>
         <el-table-column fixed prop="zyh" label="住院号" width="80" align="center"></el-table-column>
         <el-table-column prop="doctor" label="医生" width="80" align="center"></el-table-column>
@@ -62,20 +49,13 @@
         <el-table-column prop="cyks" label="出院科室" width="130"></el-table-column>
         <el-table-column prop="jssj" label="结算时间" width="140" align="center"></el-table-column>
       </el-table>
-    </el-main>
-    <el-footer style="height: 40px">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[20, 30, 40, 50, 100]"
-        :page-size="pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="returnData.length"
-        style="margin-top: 5px"
-      ></el-pagination>
-    </el-footer>
-  </el-container>
+    </template>
+  </page-layer>
+  <el-footer style="height: 40px">
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+      :page-sizes="[20, 30, 40, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+      :total="returnData.length" style="margin-top: 5px"></el-pagination>
+  </el-footer>
 </template>
 <script>
 import { reactive, ref } from '@vue/reactivity'
@@ -87,196 +67,182 @@ import { selectCssYbCsTj } from '@/api/ybkf/yb-cssybtj'
 import { ElMessage } from 'element-plus'
 import store from '@/store'
 import { Export } from '@/utils/ExportExcel'
+import PageLayer from "@/layout/PageLayer";
 
 export default {
   setup() {
-    const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h / 1.15
-
-    let start = formatDate(clockinShortcuts[0].value[0])
-    let end = formatDate(clockinShortcuts[0].value[1])
-
-    const handleSelect = (item) => {}
-
+    const windowSize = store.state.app.windowSize;
+    const tableHeight = windowSize.h / 1.02;
+    let start = formatDate(clockinShortcuts[0].value[0]);
+    let end = formatDate(clockinShortcuts[0].value[1]);
+    const handleSelect = (item) => { };
     const querySearchDept = async (str, cb) => {
-      let results = await selectSmallDept({ str })
+      let results = await selectSmallDept({ str });
       if (results) {
         // 调用 callback 返回建议列表的数据
-        cb(results)
+        cb(results);
       }
-    }
-
-    const insurId = ref('')
-    const dept = ref('')
-    const zyh = ref('')
-
+    };
+    const insurId = ref("");
+    const dept = ref("");
+    const zyh = ref("");
     const queryTerm = reactive({
-      startTime: '',
-      endTime: '',
-      insurName: '',
-      dept: '',
-      zyh: '',
-    })
+      startTime: "",
+      endTime: "",
+      insurName: "",
+      dept: "",
+      zyh: "",
+    });
     onMounted(() => {
-      queryTerm.startTime = start
-      queryTerm.endTime = end + ' 23:59:59'
-      dateRange.value = [start, end]
-    })
-
-    const dateRange = ref([])
-    const returnData = ref([])
-
-    const pageSize = ref(30)
-    const currentPage = ref(1)
-
+      queryTerm.startTime = start;
+      queryTerm.endTime = end + " 23:59:59";
+      dateRange.value = [start, end];
+    });
+    const dateRange = ref([]);
+    const returnData = ref([]);
+    const pageSize = ref(30);
+    const currentPage = ref(1);
     const handleSizeChange = (val) => {
-      pageSize.value = val
-    }
+      pageSize.value = val;
+    };
     const handleCurrentChange = (val) => {
-      currentPage.value = val
-    }
-
+      currentPage.value = val;
+    };
     const query = () => {
       if (dateRange.value) {
-        let dateS = getDateRangeFormatDate(dateRange.value)
-        queryTerm.startTime = dateS.startTime
-        queryTerm.endTime = dateS.endTime
-      } else {
-        queryTerm.startTime = start
-        queryTerm.endTime = end
+        let dateS = getDateRangeFormatDate(dateRange.value);
+        queryTerm.startTime = dateS.startTime;
+        queryTerm.endTime = dateS.endTime;
+      }
+      else {
+        queryTerm.startTime = start;
+        queryTerm.endTime = end;
         ElMessage({
-          type: 'info',
-          message: '默认查询上个月的数据',
+          type: "info",
+          message: "默认查询上个月的数据",
           duration: 2500,
           showClose: true,
-        })
+        });
       }
-
-      queryTerm.insurName = filterInsurName()
-      queryTerm.dept = dept.value
-      queryTerm.zyh = zyh.value
-
+      queryTerm.insurName = filterInsurName();
+      queryTerm.dept = dept.value;
+      queryTerm.zyh = zyh.value;
       selectCssYbCsTj(queryTerm)
         .then((res) => {
-          returnData.value = res
+          returnData.value = res;
         })
         .catch(() => {
-          returnData.value = []
-        })
-      returnData.value = []
-    }
-
+          returnData.value = [];
+        });
+      returnData.value = [];
+    };
     const filterInsurName = () => {
-      if (insurId.value == '1') {
-        return '长沙市城职普通住院'
-      } else if (insurId.value == '2') {
-        return '长沙市城居普通住院'
-      } else {
-        return ''
+      if (insurId.value == "1") {
+        return "长沙市城职普通住院";
       }
-    }
-
-    let sum = {}
-
+      else if (insurId.value == "2") {
+        return "长沙市城居普通住院";
+      }
+      else {
+        return "";
+      }
+    };
+    let sum = {};
     const getSummaries = (param) => {
-      const { columns, data } = param
-      const sums = []
-      let bxblIndex, zfyIndex, tczfIndex
-
+      const { columns, data } = param;
+      const sums = [];
+      let bxblIndex, zfyIndex, tczfIndex;
       columns.forEach((column, index) => {
         if (index === 0) {
-          sums[index] = '合计'
-          return
+          sums[index] = "合计";
+          return;
         }
-
-        if (column.property === 'doctor' || column.property === 'zyh' || column.property === 'zlfs' || column.property === 'ssmc') {
-          sums[index] = ''
-          return
+        if (column.property === "doctor" || column.property === "zyh" || column.property === "zlfs" || column.property === "ssmc") {
+          sums[index] = "";
+          return;
         }
-
-        if (column.property === 'bxbl') {
-          bxblIndex = index
+        if (column.property === "bxbl") {
+          bxblIndex = index;
         }
-        if (column.property === 'zfy') {
-          zfyIndex = index
+        if (column.property === "zfy") {
+          zfyIndex = index;
         }
-        if (column.property === 'tczf') {
-          tczfIndex = index
+        if (column.property === "tczf") {
+          tczfIndex = index;
         }
-
-        const values = data.map((item) => Number(item[column.property]))
+        const values = data.map((item) => Number(item[column.property]));
         if (!values.every((value) => isNaN(value))) {
           let hj = values.reduce((prev, curr) => {
-            const value = Number(curr)
+            const value = Number(curr);
             if (!isNaN(value)) {
-              return prev + curr
-            } else {
-              return prev
+              return prev + curr;
             }
-          }, 0)
-
-          let reg = /rs$/
+            else {
+              return prev;
+            }
+          }, 0);
+          let reg = /rs$/;
           if (!reg.test(column.property)) {
-            sums[index] = hj.toFixed(2)
-          } else {
-            sums[index] = hj
+            sums[index] = hj.toFixed(2);
+          }
+          else {
+            sums[index] = hj;
           }
-        } else {
-          sums[index] = ''
         }
-      })
-      sums[bxblIndex] = ((sums[tczfIndex] / sums[zfyIndex]) * 100).toFixed(2)
-      sum = sums
-      return sums
-    }
-
+        else {
+          sums[index] = "";
+        }
+      });
+      sums[bxblIndex] = ((sums[tczfIndex] / sums[zfyIndex]) * 100).toFixed(2);
+      sum = sums;
+      return sums;
+    };
     // ----------------导出--------------------
     const exportCycs = () => {
       if (returnData.value.length === 0) {
         ElMessage({
-          message: '没有可以导出的数据!',
-          type: 'warning',
+          message: "没有可以导出的数据!",
+          type: "warning",
           duration: 2500,
           showClose: true,
-        })
-      } else {
+        });
+      }
+      else {
         const title = {
-          cyks: '科室',
-          zyh: '住院号',
-          doctor: '医生',
-          xm: '姓名',
-          yblx: '险种',
-          zfy: '总费用',
-          yjzf: '预计支付',
-          tczf: '统筹支付',
-          bal: '盈亏额',
-          bxbl: '报销比例(%)',
-          score: '分值',
-          zlfs: '治疗方式',
-          sblx: '申报类型',
-          zdmc: '主要诊断',
-          zdbm: '诊断编码',
-          ssmc: '主要手术',
-          ssbm: '手术编码',
-          ryks: '入院科室',
-          cyks: '出院科室',
-          jssj: '结算时间',
-        }
-
+          cyks: "科室",
+          zyh: "住院号",
+          doctor: "医生",
+          xm: "姓名",
+          yblx: "险种",
+          zfy: "总费用",
+          yjzf: "预计支付",
+          tczf: "统筹支付",
+          bal: "盈亏额",
+          bxbl: "报销比例(%)",
+          score: "分值",
+          zlfs: "治疗方式",
+          sblx: "申报类型",
+          zdmc: "主要诊断",
+          zdbm: "诊断编码",
+          ssmc: "主要手术",
+          ssbm: "手术编码",
+          ryks: "入院科室",
+          cyks: "出院科室",
+          jssj: "结算时间",
+        };
         let hj = {
-          cyks: '合计',
+          cyks: "合计",
           zfy: sum[5],
           yjzf: sum[6],
           tczf: sum[7],
           bal: sum[8],
           bxbl: sum[9],
           score: sum[10],
-        }
-        returnData.value.push(hj)
-        Export(returnData.value, title, '市医保测算统计')
+        };
+        returnData.value.push(hj);
+        Export(returnData.value, title, "市医保测算统计");
       }
-    }
-
+    };
     return {
       dateRange,
       shortcuts,
@@ -295,8 +261,9 @@ export default {
       exportCycs,
       handleSizeChange,
       handleCurrentChange,
-    }
+    };
   },
+  components: { PageLayer }
 }
 </script>
 <style scoped>

+ 130 - 134
src/views/medical-insurance/statistical/CssybJsTj.vue

@@ -1,17 +1,20 @@
 <template>
-  <el-container>
-    <el-header height="30px" style="margin-top: 10px">
-      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
+  <page-layer>
+    <template #header>
+      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
+        end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
       <el-select v-model="insurId" style="width: 200px" clearable>
         <el-option label="长沙市城职普通住院" value="1"></el-option>
         <el-option label="长沙市城居普通住院" value="2"></el-option>
       </el-select>
       <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
-      <el-button type="primary" icon="Download" @click="exportKsDetailExcel" style="margin-left: 5px">导出Excel</el-button>
+      <el-button type="primary" icon="Download" @click="exportKsDetailExcel" style="margin-left: 5px">导出Excel
+      </el-button>
       <el-button type="primary" icon="Upload" @click="cssybImort" style="margin-left: 5px">决算数据导入</el-button>
-    </el-header>
-    <el-main>
-      <el-table :data="returnData" :height="tableHeight" stripe highlight-current-row show-summary :summary-method="getSummaries" @row-dblclick="ysJsdetails">
+    </template>
+    <template #main>
+      <el-table :data="returnData" :height="tableHeight" stripe highlight-current-row show-summary
+        :summary-method="getSummaries" @row-dblclick="ysJsdetails">
         <el-table-column fixed prop="deptName" label="科室" width="120"></el-table-column>
         <el-table-column prop="zfy" label="总费用" width="100" align="right" sortable></el-table-column>
         <el-table-column prop="yjzf" label="预计支付" width="100" align="right" sortable></el-table-column>
@@ -72,131 +75,122 @@
         </el-table-column>
         <el-table-column prop="dlrs" label="单列" width="80" align="right" sortable></el-table-column>
       </el-table>
-      <el-dialog v-model="showYsSetldetails" :close-on-click-modal="false" :close-on-press-escape="false" :title="filterYsDialogTitle" width="90%">
-        <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
-          <el-button icon="Download" type="primary" @click="exportYsDetailExcel">导出Excel</el-button>
-        </div>
-        <el-table :data="setlYsdetails" :height="tableHeight - 160" show-summary :summary-method="getSummaries" highlight-current-row stripe @row-dblclick="brJsdetails">
-          <el-table-column fixed prop="deptName" label="科室" width="120"></el-table-column>
-          <el-table-column fixed prop="doctor" label="医生" width="80" align="center"></el-table-column>
-          <el-table-column prop="zfy" label="总费用" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="yjzf" label="预计支付" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="tczf" label="统筹支付" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="bal" label="盈亏额" width="100" align="right" sortable>
-            <template #default="scope">
-              <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
-              <span v-else>{{ scope.row.bal }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="bxbl" label="报销比例(%)" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="zrs" label="总人数" width="80" align="right" sortable></el-table-column>
-          <el-table-column prop="zfz" label="总分值" width="100" align="right" sortable></el-table-column>
-          <el-table-column label="有对照" header-align="center">
-            <el-table-column prop="ydzrs" label="人数" width="80" align="right" sortable />
-            <el-table-column prop="ydzbal" label="盈亏额" width="100" align="right" sortable>
-              <template #default="scope">
-                <span v-if="scope.row.ydzbal < 0" style="color: red">{{ scope.row.ydzbal }}</span>
-                <span v-else>{{ scope.row.ydzbal }}</span>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column label="无对照" header-align="center">
-            <el-table-column prop="wdzrs" label="人数" width="80" align="right" sortable />
-            <el-table-column prop="wdzbal" label="盈亏额" width="100" align="right" sortable>
-              <template #default="scope">
-                <span v-if="scope.row.wdzbal < 0" style="color: red">{{ scope.row.wdzbal }}</span>
-                <span v-else>{{ scope.row.wdzbal }}</span>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column label="难度系数" header-align="center">
-            <el-table-column prop="ndxsrs" label="人数" width="80" align="right" sortable />
-            <el-table-column prop="ndxsbal" label="盈亏额" width="100" align="right" sortable>
-              <template #default="scope">
-                <span v-if="scope.row.ndxsbal < 0" style="color: red">{{ scope.row.ndxsbal }}</span>
-                <span v-else>{{ scope.row.ndxsbal }}</span>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column label="治疗未完成" header-align="center">
-            <el-table-column prop="wwcrs" label="人数" width="80" align="right" sortable />
-            <el-table-column prop="wwcbal" label="盈亏额" width="100" align="right" sortable>
-              <template #default="scope">
-                <span v-if="scope.row.wwcbal < 0" style="color: red">{{ scope.row.wwcbal }}</span>
-                <span v-else>{{ scope.row.wwcbal }}</span>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column label="转科" header-align="center">
-            <el-table-column prop="zkrs" label="人数" width="80" align="right" sortable />
-            <el-table-column prop="zkbal" label="盈亏额" width="100" align="right" sortable>
-              <template #default="scope">
-                <span v-if="scope.row.zkbal < 0" style="color: red">{{ scope.row.zkbal }}</span>
-                <span v-else>{{ scope.row.zkbal }}</span>
-              </template>
-            </el-table-column>
-          </el-table-column>
-          <el-table-column prop="dlrs" label="单列" width="100" align="right" sortable></el-table-column>
-        </el-table>
-      </el-dialog>
-      <el-dialog v-model="showBrSetldetails" :close-on-click-modal="false" :close-on-press-escape="false" :title="filterBrDialogTitle" width="90%">
-        <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
-          <el-button icon="Download" type="primary" @click="exportBrDetailExcel">导出Excel</el-button>
-        </div>
-        <el-table
-          :data="setlBrdetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
-          :height="tableHeight - 160"
-          show-summary
-          :summary-method="getSummaries"
-          highlight-current-row
-          stripe
-        >
-          <el-table-column fixed prop="deptName" label="科室" width="100"></el-table-column>
-          <el-table-column fixed prop="doctor" label="医生" width="80" align="center"></el-table-column>
-          <el-table-column prop="zyh" label="住院号" width="80" align="center"></el-table-column>
-          <el-table-column prop="xm" label="姓名" width="80" align="center"></el-table-column>
-          <el-table-column prop="yblx" label="险种" width="100" align="center"></el-table-column>
-          <el-table-column prop="zfy" label="总费用" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="yjzf" label="预计支付" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="tczf" label="统筹支付" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="bal" label="盈亏额" width="100" align="right" sortable>
-            <template #default="scope">
-              <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
-              <span v-else>{{ scope.row.bal }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="bxbl" label="报销比例(%)" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="zfz" label="总分值" width="100" align="right" sortable></el-table-column>
-          <el-table-column prop="zlfs" label="治疗方式" width="100" align="left"></el-table-column>
-          <el-table-column prop="sblx" label="申报类型" width="100" align="left"></el-table-column>
-          <el-table-column prop="zdmc" label="主要诊断" width="200" align="left" show-overflow-tooltip>
-            <template #default="scope"> {{ scope.row.zdmc }}<span>(</span>{{ scope.row.zdbm }}<span>)</span> </template>
-          </el-table-column>
-          <el-table-column prop="ssmc" label="主要手术" width="200" align="left" show-overflow-tooltip>
-            <template #default="scope">
-              <span v-if="scope.row.ssmc">{{ scope.row.ssmc }}<span>(</span>{{ scope.row.ssbm }}<span>)</span></span>
-            </template>
-          </el-table-column>
-          <el-table-column prop="jssj" label="结算时间" width="140" align="center"></el-table-column>
-        </el-table>
-        <el-footer style="height: 40px">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[15, 30, 50, 100]"
-            :page-size="pageSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="setlBrdetails.length"
-            style="margin-top: 5px"
-          ></el-pagination>
-        </el-footer>
-      </el-dialog>
-    </el-main>
-    <el-dialog v-model="showImportYb" :close-on-click-modal="false" title="市医保数据导入" width="50%" top="20px">
-      <YbImport :ybkf="ybImportData" />
-    </el-dialog>
-  </el-container>
+    </template>
+  </page-layer>
+  <el-dialog v-model="showYsSetldetails" :close-on-click-modal="false" :close-on-press-escape="false"
+    :title="filterYsDialogTitle" width="90%" top="40px">
+    <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
+      <el-button icon="Download" type="primary" @click="exportYsDetailExcel">导出Excel</el-button>
+    </div>
+    <el-table :data="setlYsdetails" :height="tableHeight - 160" show-summary :summary-method="getSummaries"
+      highlight-current-row stripe @row-dblclick="brJsdetails">
+      <el-table-column fixed prop="deptName" label="科室" width="120"></el-table-column>
+      <el-table-column fixed prop="doctor" label="医生" width="80" align="center"></el-table-column>
+      <el-table-column prop="zfy" label="总费用" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="yjzf" label="预计支付" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="tczf" label="统筹支付" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="bal" label="盈亏额" width="100" align="right" sortable>
+        <template #default="scope">
+          <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
+          <span v-else>{{ scope.row.bal }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="bxbl" label="报销比例(%)" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="zrs" label="总人数" width="80" align="right" sortable></el-table-column>
+      <el-table-column prop="zfz" label="总分值" width="100" align="right" sortable></el-table-column>
+      <el-table-column label="有对照" header-align="center">
+        <el-table-column prop="ydzrs" label="人数" width="80" align="right" sortable />
+        <el-table-column prop="ydzbal" label="盈亏额" width="100" align="right" sortable>
+          <template #default="scope">
+            <span v-if="scope.row.ydzbal < 0" style="color: red">{{ scope.row.ydzbal }}</span>
+            <span v-else>{{ scope.row.ydzbal }}</span>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column label="无对照" header-align="center">
+        <el-table-column prop="wdzrs" label="人数" width="80" align="right" sortable />
+        <el-table-column prop="wdzbal" label="盈亏额" width="100" align="right" sortable>
+          <template #default="scope">
+            <span v-if="scope.row.wdzbal < 0" style="color: red">{{ scope.row.wdzbal }}</span>
+            <span v-else>{{ scope.row.wdzbal }}</span>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column label="难度系数" header-align="center">
+        <el-table-column prop="ndxsrs" label="人数" width="80" align="right" sortable />
+        <el-table-column prop="ndxsbal" label="盈亏额" width="100" align="right" sortable>
+          <template #default="scope">
+            <span v-if="scope.row.ndxsbal < 0" style="color: red">{{ scope.row.ndxsbal }}</span>
+            <span v-else>{{ scope.row.ndxsbal }}</span>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column label="治疗未完成" header-align="center">
+        <el-table-column prop="wwcrs" label="人数" width="80" align="right" sortable />
+        <el-table-column prop="wwcbal" label="盈亏额" width="100" align="right" sortable>
+          <template #default="scope">
+            <span v-if="scope.row.wwcbal < 0" style="color: red">{{ scope.row.wwcbal }}</span>
+            <span v-else>{{ scope.row.wwcbal }}</span>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column label="转科" header-align="center">
+        <el-table-column prop="zkrs" label="人数" width="80" align="right" sortable />
+        <el-table-column prop="zkbal" label="盈亏额" width="100" align="right" sortable>
+          <template #default="scope">
+            <span v-if="scope.row.zkbal < 0" style="color: red">{{ scope.row.zkbal }}</span>
+            <span v-else>{{ scope.row.zkbal }}</span>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column prop="dlrs" label="单列" width="100" align="right" sortable></el-table-column>
+    </el-table>
+  </el-dialog>
+  <el-dialog v-model="showBrSetldetails" :close-on-click-modal="false" :close-on-press-escape="false"
+    :title="filterBrDialogTitle" width="90%" top="40px">
+    <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
+      <el-button icon="Download" type="primary" @click="exportBrDetailExcel">导出Excel</el-button>
+    </div>
+    <el-table :data="setlBrdetails.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
+      :height="tableHeight - 160" show-summary :summary-method="getSummaries" highlight-current-row stripe>
+      <el-table-column fixed prop="deptName" label="科室" width="100"></el-table-column>
+      <el-table-column fixed prop="doctor" label="医生" width="80" align="center"></el-table-column>
+      <el-table-column prop="zyh" label="住院号" width="80" align="center"></el-table-column>
+      <el-table-column prop="xm" label="姓名" width="80" align="center"></el-table-column>
+      <el-table-column prop="yblx" label="险种" width="100" align="center"></el-table-column>
+      <el-table-column prop="zfy" label="总费用" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="yjzf" label="预计支付" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="tczf" label="统筹支付" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="bal" label="盈亏额" width="100" align="right" sortable>
+        <template #default="scope">
+          <span v-if="scope.row.bal < 0" style="color: red">{{ scope.row.bal }}</span>
+          <span v-else>{{ scope.row.bal }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="bxbl" label="报销比例(%)" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="zfz" label="总分值" width="100" align="right" sortable></el-table-column>
+      <el-table-column prop="zlfs" label="治疗方式" width="100" align="left"></el-table-column>
+      <el-table-column prop="sblx" label="申报类型" width="100" align="left"></el-table-column>
+      <el-table-column prop="zdmc" label="主要诊断" width="200" align="left" show-overflow-tooltip>
+        <template #default="scope"> {{ scope.row.zdmc }}<span>(</span>{{ scope.row.zdbm }}<span>)</span> </template>
+      </el-table-column>
+      <el-table-column prop="ssmc" label="主要手术" width="200" align="left" show-overflow-tooltip>
+        <template #default="scope">
+          <span v-if="scope.row.ssmc">{{ scope.row.ssmc }}<span>(</span>{{ scope.row.ssbm }}<span>)</span></span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="jssj" label="结算时间" width="140" align="center"></el-table-column>
+    </el-table>
+    <el-footer style="height: 40px">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-sizes="[15, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="setlBrdetails.length" style="margin-top: 5px">
+      </el-pagination>
+    </el-footer>
+  </el-dialog>
+  <el-dialog v-model="showImportYb" :close-on-click-modal="false" title="市医保数据导入" width="50%" top="40px">
+    <YbImport :ybkf="ybImportData" />
+  </el-dialog>
 </template>
 <script>
 import { reactive, ref } from '@vue/reactivity'
@@ -209,14 +203,16 @@ import { selectCssYbJsTj, selectYsJsTj, selectBrJsTj } from '@/api/ybkf/yb-cssyb
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { downloadExcel } from '@/utils/excel'
 import store from '@/store'
+import PageLayer from '@/layout/PageLayer.vue'
 
 export default {
   components: {
     YbImport,
+    PageLayer
   },
   setup() {
     const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h / 1.13
+    const tableHeight = windowSize.h / 1.03
 
     const start = formatDate(seltYearAndNowLast[0].value[0])
     const end = formatDate(seltYearAndNowLast[1].value[1])
@@ -453,7 +449,7 @@ export default {
             downloadExcel(data)
           }, 500)
         })
-        .catch(() => {})
+        .catch(() => { })
     }
 
     // ------------------ 医保数据导入 ------------------

+ 119 - 156
src/views/reports/bedDays.vue

@@ -1,64 +1,39 @@
 <template>
-  <el-container>
-    <el-header height="35px" style="margin-top: 10px">
-      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
+  <page-layer>
+    <template #header>
+      <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
+        end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
       <el-button type="primary" icon="Search" @click="query" style="margin-left: 5px">查询</el-button>
       <el-button type="primary" v-if="returnData.length > 0" icon="Download" @click="exportExcel">导出excel </el-button>
-    </el-header>
-    <el-main>
-      <el-table
-        :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)"
-        :height="tableHeight"
-        stripe
-        highlight-current-row
-        show-summary
-        :summary-method="getSummaries"
-        @row-dblclick="ysDaysdetails"
-      >
+    </template>
+    <template #main>
+      <el-table :data="returnData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" :height="tableHeight"
+        stripe highlight-current-row show-summary :summary-method="getSummaries" @row-dblclick="ysDaysdetails">
         <el-table-column prop="ryks" label="科室"></el-table-column>
         <el-table-column prop="days" label="管床日数" sortable></el-table-column>
       </el-table>
-      <el-dialog v-model="showSetldetails" :close-on-click-modal="false" :close-on-press-escape="false" :title="filterDialogTitle" width="70%">
+      <el-dialog v-model="showSetldetails" :close-on-click-modal="false" :close-on-press-escape="false"
+        :title="filterDialogTitle" width="70%">
         <div style="width: 130px; height: 36px; position: absolute; top: 16px; right: 60px">
           <el-button icon="Download" type="primary" @click="exportDetailExcel">导出Excel</el-button>
         </div>
-        <el-table
-          :data="setldetails.slice(pageSize * (currentPage - 1), pageSize * currentPage)"
-          height="560"
-          highlight-current-row
-          stripe
-          show-summary
-          :summary-method="getSummaries"
-        >
+        <el-table :data="setldetails.slice(pageSize * (currentPage - 1), pageSize * currentPage)" height="560"
+          highlight-current-row stripe show-summary :summary-method="getSummaries">
           <el-table-column prop="ryks" label="科室"></el-table-column>
           <el-table-column prop="doctor" label="医生"></el-table-column>
           <el-table-column prop="days" label="管床日数" sortable></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-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-main>
-    <el-footer style="height: 40px">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[20, 30, 40, 50, 100]"
-        :page-size="pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="returnData.length"
-        style="margin-top: 5px"
-      ></el-pagination>
-    </el-footer>
-  </el-container>
+    </template>
+  </page-layer>
+  <el-footer style="height: 40px">
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+      :page-sizes="[20, 30, 40, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+      :total="returnData.length" style="margin-top: 5px"></el-pagination>
+  </el-footer>
 </template>
 <script>
 import { reactive, ref } from '@vue/reactivity'
@@ -71,156 +46,143 @@ import store from '@/store'
 import { clone } from '@/utils/clone'
 import { selectBedDays, selectYsDaysDetails } from '@/api/reports/bedDays'
 import { ExcelName, Export } from '@/utils/ExportExcel'
+import PageLayer from '@/layout/PageLayer.vue'
 
 export default {
   setup() {
-    const windowSize = store.state.app.windowSize
-    const tableHeight = windowSize.h / 1.2
-
-    const start = formatDate(clockinShortcuts[1].value[0])
-    const end = formatDate(clockinShortcuts[1].value[1])
-
+    const windowSize = store.state.app.windowSize;
+    const tableHeight = windowSize.h / 1.02;
+    const start = formatDate(clockinShortcuts[1].value[0]);
+    const end = formatDate(clockinShortcuts[1].value[1]);
     const queryTerm = reactive({
-      startTime: '',
-      endTime: '',
-      deptId: '',
-    })
+      startTime: "",
+      endTime: "",
+      deptId: "",
+    });
     onMounted(() => {
-      queryTerm.startTime = start
-      queryTerm.endTime = end + ' 23:59:59'
-      dateRange.value = [start, end]
-    })
-
-    const dateRange = ref([])
-    const returnData = ref([])
-
+      queryTerm.startTime = start;
+      queryTerm.endTime = end + " 23:59:59";
+      dateRange.value = [start, end];
+    });
+    const dateRange = ref([]);
+    const returnData = ref([]);
     const query = () => {
       if (dateRange.value) {
-        let dateS = getDateRangeFormatDate(dateRange.value)
-        queryTerm.startTime = dateS.startTime
-        queryTerm.endTime = dateS.endTime
-      } else {
-        queryTerm.startTime = start
-        queryTerm.endTime = end
+        let dateS = getDateRangeFormatDate(dateRange.value);
+        queryTerm.startTime = dateS.startTime;
+        queryTerm.endTime = dateS.endTime;
+      }
+      else {
+        queryTerm.startTime = start;
+        queryTerm.endTime = end;
         ElMessage({
-          type: 'info',
-          message: '默认查询本月的数据',
+          type: "info",
+          message: "默认查询本月的数据",
           duration: 2500,
           showClose: true,
-        })
+        });
       }
       selectBedDays(queryTerm)
         .then((res) => {
-          returnData.value = res
+          returnData.value = res;
         })
         .catch(() => {
-          returnData.value = []
-        })
-    }
-
-    const setldetails = ref([])
-    const showSetldetails = ref(false)
+          returnData.value = [];
+        });
+    };
+    const setldetails = ref([]);
+    const showSetldetails = ref(false);
     const ysDaysdetails = (row) => {
-      let selectInfo = clone(queryTerm)
-      selectInfo.deptId = row.deptId
+      let selectInfo = clone(queryTerm);
+      selectInfo.deptId = row.deptId;
       selectYsDaysDetails(selectInfo)
         .then((res) => {
-          setldetails.value = res
-          showSetldetails.value = true
+          setldetails.value = res;
+          showSetldetails.value = true;
         })
         .catch(() => {
-          setldetails.value = []
-        })
-    }
-
+          setldetails.value = [];
+        });
+    };
     const filterDialogTitle = computed(() => {
-      return '管床日数医生明细'
-    })
-
+      return "管床日数医生明细";
+    });
     const handleSizeChange = (val) => {
-      pageSize.value = val
-    }
-
+      pageSize.value = val;
+    };
     const handleCurrentChange = (val) => {
-      currentPage.value = val
-    }
-
-    const currentPage = ref(1)
-    const pageSize = ref(20)
-
-    let sum = {}
-
+      currentPage.value = val;
+    };
+    const currentPage = ref(1);
+    const pageSize = ref(20);
+    let sum = {};
     const getSummaries = (param) => {
-      const { columns, data } = param
-      const sums = []
-
+      const { columns, data } = param;
+      const sums = [];
       columns.forEach((column, index) => {
         if (index === 0) {
-          sums[index] = '合计'
-          return
+          sums[index] = "合计";
+          return;
         }
-
-        if (column.property === 'doctor') {
-          sums[index] = ''
-          return
+        if (column.property === "doctor") {
+          sums[index] = "";
+          return;
         }
-
-        const values = data.map((item) => Number(item[column.property]))
+        const values = data.map((item) => Number(item[column.property]));
         if (!values.every((value) => isNaN(value))) {
           sums[index] = values.reduce((prev, curr) => {
-            const value = Number(curr)
+            const value = Number(curr);
             if (!isNaN(value)) {
-              return prev + curr
-            } else {
-              return prev
+              return prev + curr;
             }
-          }, 0)
-        } else {
-          sums[index] = 0
+            else {
+              return prev;
+            }
+          }, 0);
         }
-      })
-
-      sum = sums
-      return sums
-    }
-
+        else {
+          sums[index] = 0;
+        }
+      });
+      sum = sums;
+      return sums;
+    };
     const exportExcel = () => {
       let title = {
-        ryks: '科室',
-        days: '管床日数',
-      }
-      const data = clone(returnData.value)
-      let dd = { ryks: '', days: '' }
-      dd.ryks = sum[0]
-      dd.days = sum[1]
-      data.push(dd)
-      ExcelName(data, title)
-    }
-
+        ryks: "科室",
+        days: "管床日数",
+      };
+      const data = clone(returnData.value);
+      let dd = { ryks: "", days: "" };
+      dd.ryks = sum[0];
+      dd.days = sum[1];
+      data.push(dd);
+      ExcelName(data, title);
+    };
     const exportDetailExcel = () => {
       if (setldetails.value.length === 0) {
         ElMessage({
-          message: '没有可以导出的数据!',
-          type: 'warning',
+          message: "没有可以导出的数据!",
+          type: "warning",
           duration: 2500,
           showClose: true,
-        })
-      } else {
+        });
+      }
+      else {
         const title = {
-          ryks: '科室',
-          doctor: '医生',
-          days: '管床日数',
-        }
-        const data = clone(setldetails.value)
-        let dd = { ryks: '', doctor: '', days: '' }
-        dd.ryks = sum[0]
-        dd.doctor = ''
-        dd.days = sum[2]
-        data.push(dd)
-        Export(data, title, filterDialogTitle.value)
+          ryks: "科室",
+          doctor: "医生",
+          days: "管床日数",
+        };
+        const data = clone(setldetails.value);
+        let dd = { ryks: "", doctor: "", days: "" };
+        dd.ryks = sum[0];
+        dd.doctor = "";
+        dd.days = sum[2];
+        data.push(dd);
+        Export(data, title, filterDialogTitle.value);
       }
-    }
-
+    };
     return {
       dateRange,
       shortcuts,
@@ -239,7 +201,8 @@ export default {
       ysDaysdetails,
       handleSizeChange,
       handleCurrentChange,
-    }
+    };
   },
+  components: { PageLayer }
 }
 </script>