| 
					
				 | 
			
			
				@@ -0,0 +1,188 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  <CyDialog 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    title="历史病案导出" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    confirm-text="导出" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    body-width="600px" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    :confirm-click="executeExport" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <div class="layout_container history-sheet-export"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div class="flex-line"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="label">文件名</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="value"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          {{ fileName }} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div class="flex-line"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="label">出院日期</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="value"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <CyDateRange style="width: 320px"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div class="flex-line"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="label">导出诊断</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="value"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-radio-group v-model="inquiry.needAllDiagnoses"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-radio :value="true">导出全部诊断</el-radio> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-radio :value="false">只导出主诊断</el-radio> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-radio-group> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div class="flex-line"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="label">导出手术</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="value"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <el-radio-group v-model="inquiry.needAllSurgeries"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-radio :value="true" >导出全部手术</el-radio> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-radio :value="false" >只导出主手术</el-radio> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </el-radio-group> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div class="flex-line"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="label">选择表头</div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <div class="value"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <div class="with-border"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <div class="check-all"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <el-checkbox 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  v-model="checkAll" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  :indeterminate="isIndeterminate" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  @change="handleCheckAllChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                选择全部 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </el-checkbox> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <div class="field-check"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <el-checkbox-group 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  v-model="checkedFields" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  @change="handleCheckedFieldsChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <div v-for="code in fieldCodeList" class="check-single"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  <el-checkbox 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                      :key="code" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                      :value="code" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  > 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    {{fieldMap[code]}} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                  </el-checkbox> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </el-checkbox-group> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  </CyDialog> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<script setup lang="ts"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import CyDialog from "@/components/cy/dialog/src/CyDialog.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import useDateRange from "@/utils/cy-use/useDateRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {fieldMap} from "@/views/hospitalization/case-front-sheet/common"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {downloadExcel} from "@/utils/excel"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const {CyDateRange, dateRange} = useDateRange({shortcutsIndex: 5, clearable: false}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const fileName = computed(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  return `病案历史记录(${dateRange.value.start.split(' ')[0]} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+   至 ${dateRange.value.end.split(' ')[0]}).xlsx` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const inquiry = reactive({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  needAllDiagnoses: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  needAllSurgeries: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  start: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  end: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const checkAll = ref(false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const isIndeterminate = ref(true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const fieldCodeList = ref([]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const checkedFields = ref([]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function handleCheckAllChange(val) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  checkedFields.value = val ? fieldCodeList.value : [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  isIndeterminate.value = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function handleCheckedFieldsChange(val) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const checkedCount = val.length 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  checkAll.value = checkedCount === fieldCodeList.value.length 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  isIndeterminate.value = checkedCount > 0 && checkedCount < fieldCodeList.value.length 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function executeExport() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  inquiry.start = dateRange.value.start.split(" ")[0] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  inquiry.end = dateRange.value.end.split(" ")[0] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  inquiry.field = generateFields() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  downloadExcel({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    param: inquiry, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    url: '/frontSheetExport/getHistorySheets', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fileName: fileName.value 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+function generateFields() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  let temp = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  checkedFields.value.forEach(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    temp.push({code:item, name: fieldMap[item]}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  return temp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+onMounted(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  inquiry.start = dateRange.value.start.split(" ")[0] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  inquiry.end = dateRange.value.end.split(" ")[0] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  for (let key in fieldMap) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fieldCodeList.value.push(key) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  checkedFields.value = ['bah','admissTimes',"name"] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<style lang="scss"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+.history-sheet-export { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  .flex-line { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    display: flex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    width: 100%; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    align-items: center; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    margin-bottom: 12px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    > .label { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      flex: 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      font-size: 14px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      font-weight: bold; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      text-align: right; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      padding-right: 20px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    > .value { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      flex: 3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      text-align: left; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      .el-radio { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        margin-right: 20px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      .field-check { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        height: 260px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        overflow-y: scroll; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      > div { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        width: 320px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      .check-all { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        background-color: #ededed; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        padding: 2px 12px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .el-checkbox__label { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          font-weight: bold; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          color: #353535; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      .check-single { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        padding: 0 12px; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .el-checkbox__label { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          color: #353535; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      .el-checkbox__inner { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        border-radius: 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    .with-border { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      border: 1px solid #dfdfdf; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+</style> 
			 |