소스 검색

Merge branch 'master' of http://47.107.245.0:3000/xiongxing/kyj-yanglao-web-new

xiongxing 1 주 전
부모
커밋
9b5b888893

+ 260 - 0
src/components/DoorCardComponent/index.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="door-card-container">
+    <!-- 门头卡主体 -->
+    <div class="door-card">
+      <table class="door-card-table">
+        <tr>
+          <td class="label-cell">姓&nbsp;&nbsp;&nbsp;&nbsp;名</td>
+          <td class="value-cell">{{ maskedElderName || '--' }}</td>
+        </tr>
+        <tr>
+          <td class="label-cell">性&nbsp;&nbsp;&nbsp;&nbsp;别</td>
+          <td class="value-cell">{{ patientData.elderSex || '--' }}</td>
+        </tr>
+        <tr>
+          <td class="label-cell">年&nbsp;&nbsp;&nbsp;&nbsp;龄</td>
+          <td class="value-cell">{{ patientData.elderAge || '--' }}</td>
+        </tr>
+        <tr>
+          <td class="label-cell">照护等级</td>
+          <td class="value-cell">{{ patientData.careLevel || '--' }}</td>
+        </tr>
+      </table>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, computed } from 'vue'
+
+declare global {
+  interface Window {
+    __GlobalZipManager?: any
+  }
+}
+import { ElMessage } from 'element-plus'
+import html2canvas from 'html2canvas'
+import JSZip from 'jszip'
+
+// Props定义
+defineProps<{
+  patientData?: any
+}>()
+
+// 患者数据
+const patientData = reactive({
+  elderName: '',
+  elderSex: '',
+  elderAge: '',
+  careLevel: ''
+})
+
+// 姓名脱敏:2个字隐藏后面,3个字及以上隐藏中间保留头尾
+const maskName = (name: string): string => {
+  if (!name) return '--'
+  const str = String(name).trim()
+  const len = [...str].length
+  if (len <= 1) return str
+  if (len === 2) return str.charAt(0) + '*'
+  const chars = [...str]
+  const first = chars[0]
+  const last = chars[len - 1]
+  const stars = '*'.repeat(len - 2)
+  return first + stars + last
+}
+
+const maskedElderName = computed(() => maskName(patientData.elderName))
+
+// 全局Zip管理器
+if (!(window as any).__GlobalZipManager) {
+  ;(window as any).__GlobalZipManager = {
+    instance: null as JSZip | null,
+    count: 0,
+
+    getZip: function (): JSZip {
+      if (!this.instance) {
+        this.instance = new JSZip()
+        this.count = 0
+        console.log('创建了新的全局JSZip单例实例')
+      }
+      return this.instance
+    },
+
+    incrementCount: function (): void {
+      this.count++
+    },
+
+    getCount: function (): number {
+      return this.count
+    },
+
+    reset: function (): void {
+      this.instance = null
+      this.count = 0
+      console.log('已重置全局JSZip单例实例')
+    },
+
+    getFileList: function (): string[] {
+      if (!this.instance) return []
+      return Object.keys(this.instance.files)
+    }
+  }
+}
+
+const GlobalZipManager = (window as any).__GlobalZipManager
+const fileCount = ref(0)
+
+// 导出门头卡
+const exportAsImage = async (type: number) => {
+  try {
+    const element = document.querySelector('.door-card')
+    if (!element) return
+
+    const w = (element as HTMLElement).offsetWidth
+    const h = (element as HTMLElement).offsetHeight
+    const canvas = await html2canvas(element as HTMLElement, {
+      scale: 3,
+      useCORS: true,
+      backgroundColor: null as any,
+      logging: false,
+      allowTaint: true,
+      foreignObjectRendering: false,
+      imageTimeout: 0,
+      removeContainer: true,
+      scrollX: 0,
+      scrollY: 0,
+      x: 0,
+      y: 0,
+      width: w,
+      height: h,
+      windowWidth: w + 10,
+      windowHeight: h + 10
+    })
+
+    const fileName = `${patientData.elderName}门头卡.png`
+    const imageBase64 = canvas.toDataURL('image/png', 1.0)
+    const base64Data = imageBase64.split(',')[1]
+
+    if (type === 2) {
+      const zipInstance = GlobalZipManager.getZip()
+      zipInstance.file(fileName, base64Data, { base64: true })
+      GlobalZipManager.incrementCount()
+      fileCount.value = GlobalZipManager.getCount()
+    } else if (type === 3) {
+      const zipInstance = GlobalZipManager.getZip()
+      zipInstance.file(fileName, base64Data, { base64: true })
+      GlobalZipManager.incrementCount()
+      fileCount.value = GlobalZipManager.getCount()
+      const fileNames = GlobalZipManager.getFileList()
+      const content = await zipInstance.generateAsync({ type: 'blob' })
+      const link = document.createElement('a')
+      link.href = URL.createObjectURL(content)
+      link.download = `门头卡压缩包_${new Date().getTime()}.zip`
+      link.click()
+      GlobalZipManager.reset()
+      fileCount.value = 0
+      ElMessage.success(`门头卡压缩包导出成功,共包含${fileNames.length}个文件`)
+    } else {
+      const link = document.createElement('a')
+      link.href = imageBase64
+      link.download = fileName
+      link.click()
+      ElMessage.success('门头卡导出成功')
+    }
+  } catch (error) {
+    console.error('导出失败:', error)
+    ElMessage.error('导出失败,请稍后重试')
+    if (type === 2 || type === 3) {
+      GlobalZipManager.reset()
+      fileCount.value = 0
+    }
+  }
+}
+
+// 更新患者数据的方法
+const updatePatientData = (data: any) => {
+  Object.assign(patientData, data)
+  console.log('门头卡收到数据:', data)
+}
+
+// 重置临时zip数据
+const resetTempZip = () => {
+  GlobalZipManager.reset()
+  fileCount.value = 0
+  console.log('已重置临时zip数据')
+}
+
+// 暴露方法给父组件
+defineExpose({
+  updatePatientData,
+  exportAsImage,
+  resetTempZip
+})
+</script>
+
+<style scoped>
+.door-card-container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 20px;
+}
+
+.door-card {
+  width: 400px;
+  /* 用 padding + 背景色作为外框,避免 html2canvas 裁切 border 导致左右/上下不均匀 */
+  box-sizing: border-box;
+  background-color: #5a3216;
+  padding: 2px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+  overflow: hidden;
+}
+
+.door-card-table {
+  width: 100%;
+  border-collapse: separate;
+  border-spacing: 0;
+  font-size: 22px;
+  background-color: #5a3216;
+}
+
+.door-card-table td {
+  box-sizing: border-box;
+}
+
+/* 用 border-spacing=0 + 每格指定单一边缘边框,避免 collapse 合并后粗细不均 */
+.door-card-table td.label-cell {
+  border-right: 1.5px solid #5a3216;
+  border-bottom: 1.5px solid #5a3216;
+}
+
+.door-card-table td.value-cell {
+  border-bottom: 1.5px solid #5a3216;
+}
+
+.door-card-table tr:last-child td.label-cell,
+.door-card-table tr:last-child td.value-cell {
+  border-bottom: none;
+}
+
+.label-cell {
+  width: 40%;
+  padding: 22px 16px;
+  text-align: center;
+  font-weight: bold;
+  color: #ffffff;
+  background-color: #a05a3c;
+  letter-spacing: 4px;
+  font-size: 24px;
+}
+
+.value-cell {
+  width: 60%;
+  padding: 22px 20px;
+  text-align: center;
+  color: #333333;
+  background-color: #e8c9a8;
+  font-weight: 500;
+  font-size: 28px;
+}
+</style>

+ 160 - 0
src/components/DoorCardModal/index.vue

@@ -0,0 +1,160 @@
+<template>
+  <el-dialog
+    v-model="visible"
+    :title="title"
+    :width="width"
+    :close-on-click-modal="closeOnClickModal"
+    @close="handleClose"
+  >
+    <div class="dialog-content">
+      <slot>
+        <DoorCardComponent ref="doorCardRef" :patientData="patientData" />
+      </slot>
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="handleImport" type="danger" style="margin-left: auto">导出门头卡</el-button>
+        <el-button @click="handleClose" style="margin-left: 30px">{{ closeText }}</el-button>
+        <slot name="footer-extra"></slot>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup lang="ts">
+import { ref, watch, nextTick } from 'vue'
+import DoorCardComponent from '@/components/DoorCardComponent/index.vue'
+
+// 定义组件属性并设置默认值
+const props = withDefaults(
+  defineProps<{
+    modelValue: boolean
+    title?: string
+    width?: string
+    patientData?: any
+    description?: string
+    closeText?: string
+    closeOnClickModal?: boolean
+  }>(),
+  {
+    title: '门头卡预览',
+    width: '600px',
+    description: '',
+    closeText: '关闭预览',
+    closeOnClickModal: false
+  }
+)
+
+// 定义事件
+const emit = defineEmits<{
+  'update:modelValue': [value: boolean]
+  close: []
+  importCard: []
+}>()
+
+// 门头卡组件引用
+const doorCardRef = ref(null)
+
+// 控制弹窗显示的响应式数据
+const visible = ref(props.modelValue)
+
+// 监听props变化,同步visible值
+watch(
+  () => props.modelValue,
+  (newVal) => {
+    visible.value = newVal
+    if (newVal) {
+      updatePatientData({})
+    }
+  }
+)
+
+// 监听visible变化,向父组件发送更新事件
+watch(visible, (newVal) => {
+  emit('update:modelValue', newVal)
+})
+
+// 格式化日期时间的辅助函数
+const formatDate = (date, format) => {
+  if (!date) return '--'
+  try {
+    const d = typeof date === 'string' ? new Date(date) : date
+    if (isNaN(d.getTime())) return '--'
+    const year = d.getFullYear()
+    const month = String(d.getMonth() + 1).padStart(2, '0')
+    const day = String(d.getDate()).padStart(2, '0')
+    return format
+      .replace('YYYY', year)
+      .replace('yyyy', year)
+      .replace('MM', month)
+      .replace('DD', day)
+  } catch (_) {}
+  return '--'
+}
+
+const formatTime = (date, format) => {
+  return formatDate(date, format)
+}
+
+// 更新患者数据
+const updatePatientData = async (data) => {
+  await nextTick()
+  const sourceData = data && Object.keys(data).length > 0 ? data : props.patientData
+  if (doorCardRef.value && typeof doorCardRef.value.updatePatientData === 'function' && sourceData) {
+    const patientData = {
+      elderName: sourceData.elderName || '--',
+      elderSex: sourceData.elderSex?.toString() === '1' ? '男' : sourceData.elderSex?.toString() === '2' ? '女' : sourceData.elderSex || '--',
+      elderAge: sourceData.elderAge || '--',
+      careLevel: sourceData.nurseLevelName || sourceData.careLevel || '--'
+    }
+    console.log('门头卡组装数据:', patientData)
+    doorCardRef.value.updatePatientData(patientData)
+  }
+}
+
+// 关闭弹窗
+const handleClose = () => {
+  visible.value = false
+  emit('close')
+}
+
+const handleImport = () => {
+  emit('importCard')
+}
+
+// 显示弹窗
+const show = () => {
+  visible.value = true
+}
+
+// 隐藏弹窗
+const hide = () => {
+  visible.value = false
+}
+
+// 暴露方法给父组件
+defineExpose({
+  show,
+  hide,
+  updatePatientData
+})
+</script>
+
+<style scoped>
+.dialog-content {
+  display: flex;
+  justify-content: center;
+}
+
+.dialog-footer {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  margin-bottom: 10px;
+}
+
+.dialog-description {
+  text-align: start;
+  color: #909399;
+}
+</style>

+ 48 - 7
src/utils/outBedCard.ts

@@ -27,12 +27,17 @@ const getSaveAs = async () => {
   return saveAsFn
 }
 
-//导出床头卡
-export const importCard = async (healthRecord,dataElder,type=1) => {
+//导出卡片(床头卡/分享卡/门头卡)
+// cardType: 1-床头卡(默认,healthRecord有值时), 2-分享卡(默认,healthRecord无值时), 3-门头卡
+export const importCard = async (healthRecord,dataElder,type=1, cardType?: number) => {
   // try {
-  // 动态加载BedCardComponent
+  // 动态加载Component
   let component = undefined
-  if(healthRecord){
+  const useDoorCard = cardType === 3
+  if(useDoorCard){
+    const { default: DoorCardComponent } = await import('@/components/DoorCardComponent/index.vue');
+    component = DoorCardComponent;
+  } else if(healthRecord){
     const { default: BedCardComponent } = await import('@/components/BedCardComponent/index.vue');
     component = BedCardComponent;
   }else {
@@ -41,9 +46,13 @@ export const importCard = async (healthRecord,dataElder,type=1) => {
   }
 
   const patientData = ref({})
-  // 使用封装的方法获取床头卡数据
-  patientData.value = getPatientData(healthRecord||{},dataElder);
-  console.log("导出床头卡组装数据:",patientData.value)
+  // 使用封装的方法获取卡片数据
+  if (useDoorCard) {
+    patientData.value = getDoorCardPatientData(dataElder);
+  } else {
+    patientData.value = getPatientData(healthRecord||{},dataElder);
+  }
+  console.log("导出卡片组装数据:",patientData.value)
 
   // 创建临时容器
   const tempContainer = document.createElement('div');
@@ -89,6 +98,38 @@ export const importCard = async (healthRecord,dataElder,type=1) => {
 }
 
 const dataForm = ref({})
+
+// 封装门头卡数据的方法
+export const getDoorCardPatientData = (dataElder) => {
+  try {
+    console.log('门头卡原始长者详情数据:', dataElder)
+    const elderSex = dataElder.idCard
+      ? getInfo(dataElder.idCard).sex == 1
+        ? '男'
+        : '女'
+      : dataElder.elderSex?.toString() == '1'
+        ? '男'
+        : '女'
+
+    const result = {
+      elderName: dataElder.elderName || '--',
+      elderSex: elderSex || '--',
+      elderAge: dataElder.elderAge || '--',
+      careLevel: dataElder.nurseLevelName || '--'
+    }
+    console.log('门头卡组装后数据:', result)
+    return result
+  } catch (error) {
+    console.error('处理门头卡数据时发生错误:', error)
+    return {
+      elderName: dataElder?.elderName || '--',
+      elderSex: dataElder?.elderSex?.toString() == '1' ? '男' : dataElder?.elderSex?.toString() == '2' ? '女' : '--',
+      elderAge: dataElder?.elderAge || '--',
+      careLevel: dataElder?.nurseLevelName || '--'
+    }
+  }
+}
+
 // 封装床头卡数据的方法
 export const getPatientData = (data,dataElder) => {
   try {

+ 0 - 568
src/views/elderly/contracts/接口返回值.txt

@@ -1,568 +0,0 @@
-{
-    "code": 0,
-    "data": {
-        "status": 2,
-        "processInstanceId": null,
-        "elderId": "19107",
-        "elderName": "哇哇哇2",
-        "elderAge": 0,
-        "elderSex": 2,
-        "idCard": "111",
-        "relativesList": [],
-        "elderlyContractDO": {
-            "id": 4900,
-            "elderId": 19107,
-            "contractNumber": "789",
-            "elderName": "哇哇哇2",
-            "beginTime": 1779321600000,
-            "expireTime": 1810166400000,
-            "createdTime": 1779335796000,
-            "status": 1,
-            "contractTerm": "",
-            "details": null,
-            "times": null,
-            "inStatusType": null
-        },
-        "bedId": "13142",
-        "bedName": "测试楼-2层-202-2",
-        "bedType": "单人间",
-        "type": 9,
-        "contractJson": null,
-        "monthlyExpensesJson": null,
-        "oneTimeExpensesJson": null,
-        "stageExpensesJson": null,
-        "totalAmount": 14687,
-        "remark": "1231",
-        "monthlyExpenses": [
-            {
-                "id": 25607,
-                "expenseId": 6410,
-                "itemId": "1803357950676460884",
-                "itemCategoryId": 195,
-                "itemCategoryName": "杂费",
-                "itemName": "药品管理费",
-                "amount": 80,
-                "actualAmount": 78,
-                "isDiscount": 1,
-                "discount": "9.75",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 78,
-                "type": null,
-                "discountAmount": 2,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25608,
-                "expenseId": 6410,
-                "itemId": "1803357950676459746",
-                "itemCategoryId": 82,
-                "itemCategoryName": "床位费",
-                "itemName": "单人间",
-                "amount": 1000,
-                "actualAmount": 923,
-                "isDiscount": 1,
-                "discount": "9.23",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 923,
-                "type": 1,
-                "discountAmount": 77,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25609,
-                "expenseId": 6410,
-                "itemId": "1803357950676459749",
-                "itemCategoryId": 83,
-                "itemCategoryName": "护理费",
-                "itemName": "一级护理",
-                "amount": 2000,
-                "actualAmount": 1935,
-                "isDiscount": 1,
-                "discount": "9.675",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 1935,
-                "type": 2,
-                "discountAmount": 65,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25610,
-                "expenseId": 6410,
-                "itemId": "1803357950676459752",
-                "itemCategoryId": 84,
-                "itemCategoryName": "餐饮费",
-                "itemName": "普通餐费",
-                "amount": 1200,
-                "actualAmount": 1101,
-                "isDiscount": 1,
-                "discount": "9.175",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 1101,
-                "type": 3,
-                "discountAmount": 99,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25611,
-                "expenseId": 6410,
-                "itemId": "1803357950676459758",
-                "itemCategoryId": 90,
-                "itemCategoryName": "服务费",
-                "itemName": "服务费",
-                "amount": 500,
-                "actualAmount": 500,
-                "isDiscount": 0,
-                "discount": null,
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 500,
-                "type": 7,
-                "discountAmount": 0,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            }
-        ],
-        "oneTimeExpenses": [
-            {
-                "id": 25612,
-                "expenseId": 6410,
-                "itemId": "1803357950676459757",
-                "itemCategoryId": 85,
-                "itemCategoryName": "押金",
-                "itemName": "保证金",
-                "amount": 10000,
-                "actualAmount": 10000,
-                "isDiscount": 0,
-                "discount": "",
-                "isMonthlyExpense": 0,
-                "isOneTimeFee": 1,
-                "isDeposit": 1,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 10000,
-                "type": null,
-                "discountAmount": 0,
-                "tenantId": 0,
-                "changeStartDate": null,
-                "changeEndDate": null,
-                "changeFlag": 0,
-                "createTime": 1779335795000,
-                "isDayCalculate": 0
-            }
-        ],
-        "stageExpenses": [
-            {
-                "id": 25613,
-                "expenseId": 6410,
-                "itemId": "1803357950676460885",
-                "itemCategoryId": 241,
-                "itemCategoryName": "优惠费用",
-                "itemName": "洗衣服",
-                "amount": 150,
-                "actualAmount": 25,
-                "isDiscount": 0,
-                "discount": "",
-                "isMonthlyExpense": 0,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 1,
-                "hirePurchaseNumber": 6,
-                "hirePurchaseAmount": 25,
-                "count": 1,
-                "totalAmount": 150,
-                "type": null,
-                "discountAmount": 0,
-                "tenantId": 195,
-                "changeStartDate": null,
-                "changeEndDate": null,
-                "changeFlag": 0,
-                "createTime": 1779335795000,
-                "isDayCalculate": 0
-            }
-        ],
-        "expenseItems": [
-            {
-                "id": 25612,
-                "expenseId": 6410,
-                "itemId": "1803357950676459757",
-                "itemCategoryId": 85,
-                "itemCategoryName": "押金",
-                "itemName": "保证金",
-                "amount": 10000,
-                "actualAmount": 10000,
-                "isDiscount": 0,
-                "discount": "",
-                "isMonthlyExpense": 0,
-                "isOneTimeFee": 1,
-                "isDeposit": 1,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 10000,
-                "type": null,
-                "discountAmount": 0,
-                "tenantId": 0,
-                "changeStartDate": null,
-                "changeEndDate": null,
-                "changeFlag": 0,
-                "createTime": 1779335795000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25613,
-                "expenseId": 6410,
-                "itemId": "1803357950676460885",
-                "itemCategoryId": 241,
-                "itemCategoryName": "优惠费用",
-                "itemName": "洗衣服",
-                "amount": 150,
-                "actualAmount": 25,
-                "isDiscount": 0,
-                "discount": "",
-                "isMonthlyExpense": 0,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 1,
-                "hirePurchaseNumber": 6,
-                "hirePurchaseAmount": 25,
-                "count": 1,
-                "totalAmount": 150,
-                "type": null,
-                "discountAmount": 0,
-                "tenantId": 195,
-                "changeStartDate": null,
-                "changeEndDate": null,
-                "changeFlag": 0,
-                "createTime": 1779335795000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25607,
-                "expenseId": 6410,
-                "itemId": "1803357950676460884",
-                "itemCategoryId": 195,
-                "itemCategoryName": "杂费",
-                "itemName": "药品管理费",
-                "amount": 80,
-                "actualAmount": 78,
-                "isDiscount": 1,
-                "discount": "9.75",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 78,
-                "type": null,
-                "discountAmount": 2,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25608,
-                "expenseId": 6410,
-                "itemId": "1803357950676459746",
-                "itemCategoryId": 82,
-                "itemCategoryName": "床位费",
-                "itemName": "单人间",
-                "amount": 1000,
-                "actualAmount": 923,
-                "isDiscount": 1,
-                "discount": "9.23",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 923,
-                "type": 1,
-                "discountAmount": 77,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25609,
-                "expenseId": 6410,
-                "itemId": "1803357950676459749",
-                "itemCategoryId": 83,
-                "itemCategoryName": "护理费",
-                "itemName": "一级护理",
-                "amount": 2000,
-                "actualAmount": 1935,
-                "isDiscount": 1,
-                "discount": "9.675",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 1935,
-                "type": 2,
-                "discountAmount": 65,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25610,
-                "expenseId": 6410,
-                "itemId": "1803357950676459752",
-                "itemCategoryId": 84,
-                "itemCategoryName": "餐饮费",
-                "itemName": "普通餐费",
-                "amount": 1200,
-                "actualAmount": 1101,
-                "isDiscount": 1,
-                "discount": "9.175",
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 1101,
-                "type": 3,
-                "discountAmount": 99,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            },
-            {
-                "id": 25611,
-                "expenseId": 6410,
-                "itemId": "1803357950676459758",
-                "itemCategoryId": 90,
-                "itemCategoryName": "服务费",
-                "itemName": "服务费",
-                "amount": 500,
-                "actualAmount": 500,
-                "isDiscount": 0,
-                "discount": null,
-                "isMonthlyExpense": 1,
-                "isOneTimeFee": 0,
-                "isDeposit": 0,
-                "isFreeGift": 0,
-                "freeStartTime": null,
-                "freeEndTime": null,
-                "isHirePurchase": 0,
-                "hirePurchaseNumber": null,
-                "hirePurchaseAmount": null,
-                "count": 1,
-                "totalAmount": 500,
-                "type": 7,
-                "discountAmount": 0,
-                "tenantId": 195,
-                "changeStartDate": [
-                    2026,
-                    5,
-                    21
-                ],
-                "changeEndDate": [
-                    2026,
-                    6,
-                    4
-                ],
-                "changeFlag": 0,
-                "createTime": 1780907524000,
-                "isDayCalculate": 0
-            }
-        ],
-        "checkInTime": "2026-05-21",
-        "checkInDeadlineTime": "2027-05-13",
-        "nurseLevelId": 15,
-        "nurseLevelName": "三级护理",
-        "isPrivateRoom": 0,
-        "specialCareNotes": null,
-        "bpmStatus": 5,
-        "tenantId": 195
-    },
-    "msg": ""
-}

+ 212 - 135
src/views/elderly/elder/elder-file/Detail.vue

@@ -1,105 +1,123 @@
 <template>
   <el-form ref="formRef" :model="dataForm" label-width="100px" :toggleType="2">
-      <div class="elder-detail-wrap">
-        <div class="left" :style="infoStyle">
-          <ContentWrap class="elderInfo" >
-            <div class="header">
-              <h4 class="title">长者信息</h4>
-              <div>
-                <el-button @click="showCardBad" type="warning" size="small">床头卡</el-button>
-                <el-button @click="showCardShare" type="success" size="small">分享卡</el-button>
-              </div>
-            </div>
-            <div class="info-wrap">
-
-              <el-image :src="dataForm.elderCover" style="width: 80px;height: 80px;">
-                <template #placeholder>
-                  <div >
-                    <img src="@/assets/imgs/old_man.png" style="width: 80px;height: 80px;" alt=""/>
-                  </div>
-                </template>
-                <template #error>
-                  <div >
-                    <img src="@/assets/imgs/old_man.png" style="width: 80px;height: 80px;" alt=""/>
-                  </div>
-                </template>
-              </el-image>
-
-              <div class="info">
-                <div class="top">
-                  <span class="f600">{{ dataForm.elderName }}</span>
-                  <span class="grey">{{
-                    getDictLabel(DICT_TYPE.SYSTEM_USER_SEX, dataForm.elderSex)
-                  }}</span>
-                  <span class="grey">{{ dataForm.elderAge }}</span>
+    <div class="elder-detail-wrap">
+      <div class="left" :style="infoStyle">
+        <ContentWrap class="elderInfo">
+          <div class="header">
+            <h4 class="title">长者信息</h4>
+          </div>
+          <div style="margin-top: 10px">
+            <el-button @click="showCardBad" type="warning" size="small">床头卡</el-button>
+            <el-button @click="showCardDoor" type="danger" size="small">门头卡</el-button>
+            <el-button @click="showCardShare" type="success" size="small">分享卡</el-button>
+          </div>
+
+          <div class="info-wrap">
+            <el-image :src="dataForm.elderCover" style="width: 80px; height: 80px">
+              <template #placeholder>
+                <div>
+                  <img src="@/assets/imgs/old_man.png" style="width: 80px; height: 80px" alt="" />
                 </div>
+              </template>
+              <template #error>
                 <div>
-                  <el-tag type="warning">中度失能</el-tag>
-                  <el-tag type="primary" class="ml3">{{ dataForm.nurseLevelName }}</el-tag>
+                  <img src="@/assets/imgs/old_man.png" style="width: 80px; height: 80px" alt="" />
                 </div>
+              </template>
+            </el-image>
+
+            <div class="info">
+              <div class="top">
+                <span class="f600">{{ dataForm.elderName }}</span>
+                <span class="grey">{{
+                  getDictLabel(DICT_TYPE.SYSTEM_USER_SEX, dataForm.elderSex)
+                }}</span>
+                <span class="grey">{{ dataForm.elderAge }}</span>
+              </div>
+              <div>
+                <el-tag type="warning">中度失能</el-tag>
+                <el-tag type="primary" class="ml3">{{ dataForm.nurseLevelName }}</el-tag>
               </div>
             </div>
+          </div>
 
-            <div class="detail">
-              <div class="bed">
-                <span class="room">床号/房号:</span>
-                <span>{{ dataForm.bedName }}</span>
+          <div class="detail">
+            <div class="bed">
+              <span class="room">床号/房号:</span>
+              <span>{{ dataForm.bedName }}</span>
+            </div>
+            <div class="box">
+              <div class="colomn">
+                <span class="f500">{{
+                  dataForm.checkInTime ? formatTime(dataForm.checkInTime, 'yyyy-MM-dd') : ''
+                }}</span>
+                <span class="f12">入住日期</span>
               </div>
-              <div class="box">
-                <div class="colomn">
-                  <span class="f500">{{
-                    dataForm.checkInTime ? formatTime(dataForm.checkInTime, 'yyyy-MM-dd') : ''
-                  }}</span>
-                  <span class="f12">入住日期</span>
-                </div>
-                <div class="colomn">
-                  <span class="f500">{{ dataForm.stayDay }}天</span>
-                  <span class="f12">在院天数</span>
-                </div>
-                <div class="colomn">
-                  <span class="f500">{{ dataForm.stayNumber }}次</span>
-                  <span class="f12">入住次数</span>
-                </div>
+              <div class="colomn">
+                <span class="f500">{{ dataForm.stayDay }}天</span>
+                <span class="f12">在院天数</span>
               </div>
-              <el-progress :percentage="dataForm.infoPercentage">
-                <template> </template>
-              </el-progress>
-              <div class="desc">
-                <span class="grey">信息完善程度</span>
-                <div>
-                  {{ dataForm.infoPercentage }}%
-                  <!-- <span class="num">{{ dataForm.infoFieldCount }}</span>/{{ dataForm.totalInfoFieldCount }} -->
-                </div>
+              <div class="colomn">
+                <span class="f500">{{ dataForm.stayNumber }}次</span>
+                <span class="f12">入住次数</span>
               </div>
-              <div class="contract"> 档案号:{{ dataForm.fileNumber }} </div>
             </div>
-            <div class="scene">
-              <div class="title">业务场景</div>
-              <div v-for="(item, index) in arr" :key="item.name" class="scene-item">
-                <span class="line" v-if="index == 0 || index == arr.length - 1"></span>
-                <div class="timeline-item__tail" v-if="index > 0"></div>
-                {{ item.name }}
+            <el-progress :percentage="dataForm.infoPercentage">
+              <template> </template>
+            </el-progress>
+            <div class="desc">
+              <span class="grey">信息完善程度</span>
+              <div>
+                {{ dataForm.infoPercentage }}%
+                <!-- <span class="num">{{ dataForm.infoFieldCount }}</span>/{{ dataForm.totalInfoFieldCount }} -->
               </div>
             </div>
-            <div class="btns">
-              <el-button class="btn" type="primary" v-for="(item, index) in routeArr" :key="index" :disabled="item.show" plain
-                @click="handleTo(item)">{{
-                  item.label }}</el-button>
+            <div class="contract"> 档案号:{{ dataForm.fileNumber }} </div>
+          </div>
+          <div class="scene">
+            <div class="title">业务场景</div>
+            <div v-for="(item, index) in arr" :key="item.name" class="scene-item">
+              <span class="line" v-if="index == 0 || index == arr.length - 1"></span>
+              <div class="timeline-item__tail" v-if="index > 0"></div>
+              {{ item.name }}
             </div>
-          </ContentWrap>
-        </div>
-        <div class="right" :style="contentStyle">
-          <ContentWrap>
-            <el-tabs class="demo-tabs" v-model="activeName" @tab-change="handleTabChange">
-              <ElScrollbar :height="!smallerThanLg ? '78.5vh' : ''" class="tab-content">
-                <el-tab-pane v-for="(item, index) in tabs" :key="index" :label="item.label" :name="item.value" style="padding-top: 14px">
-                  <component :is="item.comp" :dataForm="dataForm" :ref="(el) => setFormRef(el, index)" />
-                </el-tab-pane>
-              </ElScrollbar>
-            </el-tabs>
-          </ContentWrap>
-        </div>
+          </div>
+          <div class="btns">
+            <el-button
+              class="btn"
+              type="primary"
+              v-for="(item, index) in routeArr"
+              :key="index"
+              :disabled="item.show"
+              plain
+              @click="handleTo(item)"
+              >{{ item.label }}</el-button
+            >
+          </div>
+        </ContentWrap>
+      </div>
+      <div class="right" :style="contentStyle">
+        <ContentWrap>
+          <el-tabs class="demo-tabs" v-model="activeName" @tab-change="handleTabChange">
+            <ElScrollbar :height="!smallerThanLg ? '78.5vh' : ''" class="tab-content">
+              <el-tab-pane
+                v-for="(item, index) in tabs"
+                :key="index"
+                :label="item.label"
+                :name="item.value"
+                style="padding-top: 14px"
+              >
+                <component
+                  :is="item.comp"
+                  :dataForm="dataForm"
+                  :ref="(el) => setFormRef(el, index)"
+                />
+              </el-tab-pane>
+            </ElScrollbar>
+          </el-tabs>
+        </ContentWrap>
       </div>
+    </div>
   </el-form>
 
   <!-- 使用通用床头卡弹窗组件 -->
@@ -122,17 +140,28 @@
     :width="'900px'"
     @close="handleDialogClose"
   />
+  <!-- 门头卡弹窗组件 -->
+  <DoorCardModal
+    ref="doorCardModalRef"
+    v-model="dialogVisibleDoor"
+    :patientData="dataForm"
+    @import-card="importCardDoorFun"
+    :title="'门头卡预览'"
+    :width="'600px'"
+    @close="handleDialogClose"
+  />
 </template>
 <script setup lang="ts">
 import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
 import { ElScrollbar } from 'element-plus'
 import BedCardModal from '@/components/BedCardModal/index.vue'
 import ShareCardModal from '@/components/ShareCardModal/index.vue'
+import DoorCardModal from '@/components/DoorCardModal/index.vue'
 import { getElderInfoById } from '@/api/elderly/elder/elderly-Info'
 import { useAppStore } from '@/store/modules/app'
 import { usePermissionStore } from '@/store/modules/permission'
 import { findTreeNode } from '@/utils/tree'
-import {getPatientData, importCard} from '@/utils/outBedCard'
+import { getPatientData, importCard, getDoorCardPatientData } from '@/utils/outBedCard'
 import First from './First.vue'
 import Second from './Second.vue'
 import Third from './Third.vue'
@@ -148,22 +177,23 @@ import carePlanTab from './carePlanTab.vue'
 import healthRecordTab from './healthRecordTab.vue'
 import { formatTime } from '@/utils'
 
-import {getElderHealthRecordById} from "@/api/elderly/elder/health-record";
-import { getDictLabel, DICT_TYPE } from '@/utils/dict';
+import { getElderHealthRecordById } from '@/api/elderly/elder/health-record'
+import { getDictLabel, DICT_TYPE } from '@/utils/dict'
 defineOptions({ name: 'ElderFileDetail' })
 const formRef = ref() // 表单 Ref
 const bed = ref() // 表单 Ref
 const dataForm = ref<{
-  elderName?: string,
-  elderSex?: string,
-  elderAge?: string,
-  nurseLevelName?: string,
-  bedName?: string,
-  checkInTime?: Date,
-  stayDay?: string,
-  stayNumber?: string,
-  infoPercentage?: number,
-  fileNumber?: string }>({})
+  elderName?: string
+  elderSex?: string
+  elderAge?: string
+  nurseLevelName?: string
+  bedName?: string
+  checkInTime?: Date
+  stayDay?: string
+  stayNumber?: string
+  infoPercentage?: number
+  fileNumber?: string
+}>({})
 const router = useRouter()
 const permissionStore = usePermissionStore()
 const appStore = useAppStore()
@@ -181,7 +211,7 @@ const tabs = [
   { label: '健康档案', value: 10, comp: healthRecordTab },
   { label: '入住适应服务', value: 11, comp: adaptationTab },
   { label: '楼层活动记录', value: 12, comp: floorActivityTab },
-  { label: '长者照顾计划', value: 13, comp: carePlanTab },
+  { label: '长者照顾计划', value: 13, comp: carePlanTab }
 ]
 const arr = [
   { name: '入住' },
@@ -197,36 +227,75 @@ const routers = computed(() =>
 )
 
 const routeArr = [
-  { label: '床位变更', value: '/elderly/bed-change',  show: findTreeNode(routers.value, 'bed-change', 'path') ? false: true},
-  { label: '餐饮变更', value: '/elderly/changes/ChangeFood/index', show: findTreeNode(routers.value, 'changes/ChangeFood/index', 'path') ? false: true },
-  { label: '护理变更', value: '/elderly/nurse-change', show: findTreeNode(routers.value, 'nurse-change', 'path') ? false: true  },
-  { label: '价格变更', value: '/elderly/price-change', show: findTreeNode(routers.value, 'price-change', 'path') ? false: true  },
-  { label: '日常费用', value: '/fee/daily-fee', show: findTreeNode(routers.value, 'daily-fee', 'path') ? false: true  },
-  { label: '能力评估', value: '/apply/synthetic-ability', show: findTreeNode(routers.value, 'synthetic-ability', 'path') ? false: true  },
-  { label: '长者押金', value: '/fee/deposit', show: findTreeNode(routers.value, 'deposit', 'path') ? false: true  },
-  { label: '缴费管理', value: '/fee/bill-pay', show: findTreeNode(routers.value, 'bill-pay', 'path') ? false: true  },
-  { label: '生活护理计划', value: '/nursing/life-care-plan', show: findTreeNode(routers.value, 'life-care-plan', 'path') ? false: true  },
-  { label: '医疗护理计划', value: '/nursing/medical-care-plan', show: findTreeNode(routers.value, 'medical-care-plan', 'path') ? false: true  }
+  {
+    label: '床位变更',
+    value: '/elderly/bed-change',
+    show: findTreeNode(routers.value, 'bed-change', 'path') ? false : true
+  },
+  {
+    label: '餐饮变更',
+    value: '/elderly/changes/ChangeFood/index',
+    show: findTreeNode(routers.value, 'changes/ChangeFood/index', 'path') ? false : true
+  },
+  {
+    label: '护理变更',
+    value: '/elderly/nurse-change',
+    show: findTreeNode(routers.value, 'nurse-change', 'path') ? false : true
+  },
+  {
+    label: '价格变更',
+    value: '/elderly/price-change',
+    show: findTreeNode(routers.value, 'price-change', 'path') ? false : true
+  },
+  {
+    label: '日常费用',
+    value: '/fee/daily-fee',
+    show: findTreeNode(routers.value, 'daily-fee', 'path') ? false : true
+  },
+  {
+    label: '能力评估',
+    value: '/apply/synthetic-ability',
+    show: findTreeNode(routers.value, 'synthetic-ability', 'path') ? false : true
+  },
+  {
+    label: '长者押金',
+    value: '/fee/deposit',
+    show: findTreeNode(routers.value, 'deposit', 'path') ? false : true
+  },
+  {
+    label: '缴费管理',
+    value: '/fee/bill-pay',
+    show: findTreeNode(routers.value, 'bill-pay', 'path') ? false : true
+  },
+  {
+    label: '生活护理计划',
+    value: '/nursing/life-care-plan',
+    show: findTreeNode(routers.value, 'life-care-plan', 'path') ? false : true
+  },
+  {
+    label: '医疗护理计划',
+    value: '/nursing/medical-care-plan',
+    show: findTreeNode(routers.value, 'medical-care-plan', 'path') ? false : true
+  }
 ]
 
 const route = useRoute()
 const healthRecord = ref({})
-onMounted(async ()=>{
+onMounted(async () => {
   const { id } = route.params
   activeName.value = 1
   // 获取长者详情
   try {
     const res = await getElderInfoById(id)
-    console.log("长者详情:",res)
+    console.log('长者详情:', res)
     dataForm.value = res
-  } catch (e) { }
+  } catch (e) {}
 
   try {
     const res = await getElderHealthRecordById(id)
-    console.log("长者健康档案:",res)
+    console.log('长者健康档案:', res)
     healthRecord.value = res
-  } catch (e) { }
-
+  } catch (e) {}
 })
 
 const activeName = ref(1)
@@ -240,25 +309,33 @@ const handleTabChange = (tab) => {
 // 床头卡弹窗控制
 const dialogVisible = ref(false)
 const dialogVisibleShare = ref(false)
+const dialogVisibleDoor = ref(false)
 const bedCardModalRef = ref()
 const shareCardModalRef = ref()
+const doorCardModalRef = ref()
 
 // 显示床头卡弹窗
 const showCardBad = () => {
   dialogVisible.value = true
-  nextTick(()=>{
-    bedCardModalRef.value.updatePatientData(getPatientData(healthRecord.value,dataForm.value))
+  nextTick(() => {
+    bedCardModalRef.value.updatePatientData(getPatientData(healthRecord.value, dataForm.value))
   })
-
 }
 
 // 显示分享卡弹窗
 const showCardShare = () => {
   dialogVisibleShare.value = true
-  nextTick(()=>{
-    shareCardModalRef.value.updatePatientData(getPatientData(healthRecord.value,dataForm.value))
+  nextTick(() => {
+    shareCardModalRef.value.updatePatientData(getPatientData(healthRecord.value, dataForm.value))
   })
+}
 
+// 显示门头卡弹窗
+const showCardDoor = () => {
+  dialogVisibleDoor.value = true
+  nextTick(() => {
+    doorCardModalRef.value.updatePatientData(getDoorCardPatientData(dataForm.value))
+  })
 }
 
 // 处理弹窗关闭事件
@@ -266,13 +343,14 @@ const handleDialogClose = () => {
   console.log('床头卡弹窗已关闭')
 }
 
-
-
 const importCardFun = () => {
-    importCard(healthRecord.value,dataForm.value)
+  importCard(healthRecord.value, dataForm.value)
 }
 
-
+const importCardDoorFun = () => {
+  // cardType = 3 表示门头卡
+  importCard(undefined, dataForm.value, 1, 3)
+}
 
 const fcFormRefs = ref<HTMLElement[]>([])
 const setFormRef = (el, index) => {
@@ -284,32 +362,31 @@ const setFormRef = (el, index) => {
 const handleTo = (item) => {
   router.push({
     path: item.value,
-    query: {elderName: dataForm.value.elderName}
+    query: { elderName: dataForm.value.elderName }
   })
 }
 
 const breakpoints = useBreakpoints(breakpointsTailwind)
 const smallerThanLg = breakpoints.smaller('lg')
-const infoStyle = computed(()=>{
-  if(!smallerThanLg.value){
+const infoStyle = computed(() => {
+  if (!smallerThanLg.value) {
     return { width: '300px' }
-  }else {
+  } else {
     return { width: '100%' }
   }
 })
 const contentStyle = computed(() => {
-  if(!smallerThanLg.value){
+  if (!smallerThanLg.value) {
     return { width: 'calc(100% - 320px)', marginLeft: '20px' }
-  }else {
+  } else {
     return { width: '100%' }
   }
 })
-
 </script>
 <style lang="scss" scoped>
-.elder-detail-wrap{
+.elder-detail-wrap {
   display: flex;
-  .left{
+  .left {
     display: inline-block;
     .elderInfo {
       .header {
@@ -480,7 +557,7 @@ const contentStyle = computed(() => {
       }
     }
   }
-  .right{
+  .right {
     display: inline-block;
     font-size: 16px;
   }

+ 16 - 3
src/views/elderly/elder/elder-file/index.vue

@@ -96,6 +96,9 @@
         <el-button type="primary" color="indigo" plain @click="handleImportCard(2)">
           <Icon icon="ep:upload" class="mr-5px" /> 批量导出分享卡
         </el-button>
+        <el-button type="danger" plain @click="handleImportCard(3)">
+          <Icon icon="ep:upload" class="mr-5px" /> 批量导出门头卡
+        </el-button>
         <el-button type="success" plain @click="handleExportFormat" v-show="false" :loading="exportLoading">
           <Icon icon="ep:download" class="mr-5px" /> 导出为特定格式
         </el-button>
@@ -139,7 +142,7 @@
   <!-- 导出床头卡弹窗 -->
   <el-dialog
     v-model="dialogVisible"
-    :title="`批量导出${type == 1 ? '床头卡' : '分享卡'}`"
+    :title="`批量导出${type == 1 ? '床头卡' : type == 2 ? '分享卡' : '门头卡'}`"
     :close-on-press-escape="false"
     :close-on-click-modal="false"
     width="28vw"
@@ -289,7 +292,8 @@ const startExport = async () => {
 
   try {
     // 批次 1 时记录基准导出数量;后续批次按该数量计算起始偏移,避免修改数量后出现重复
-    const storageKey = `bed_card_export_${type.value}`
+    // type: 1-床头卡, 2-分享卡, 3-门头卡
+    const storageKey = `card_export_${type.value}`
     let baseCount = exportCount.value
     if (exportBitch.value === 1) {
       window.sessionStorage.setItem(storageKey, String(exportCount.value))
@@ -340,13 +344,22 @@ const startExport = async () => {
           await importCard(res || {}, item, param)
         } catch (e) {}
       }
-    } else {
+    } else if (type.value == 2) {
       for (const [index, item] of exportList.entries()) {
         try {
           const param = index === exportList.length - 1 ? 3 : 2
           await importCard(undefined, item, param)
         } catch (e) {}
       }
+    } else {
+      // type == 3: 门头卡批量导出
+      for (const [index, item] of exportList.entries()) {
+        try {
+          const param = index === exportList.length - 1 ? 3 : 2
+          // cardType = 3 表示门头卡
+          await importCard(undefined, item, param, 3)
+        } catch (e) {}
+      }
     }
 
     loadingImport.value = false