Bläddra i källkod

居家添加档案上传

chenjun 1 dag sedan
förälder
incheckning
c3f0d325b7

+ 1 - 1
src/App.vue

@@ -60,7 +60,7 @@ const setDefaultTheme = () => {
   if (isDarkTheme === null) {
     isDarkTheme = false
   }
-  appStore.setIsDark(isDarkTheme)
+  appStore.setIsDark(false)
 }
 setDefaultTheme()
 

+ 18 - 2
src/views/living-home/elderlyManage/elderly-person-file-in/Form.vue

@@ -1326,7 +1326,7 @@
         </div>
         <div class="info-wrap">
           <el-form-item label="其他附件" prop="extraFile">
-            <SelectUpload
+            <TableUpload
               fun-name="其他附件"
               v-model="dataForm.extraFile"
               :elder="{ elderId: dataForm.id, elderName: dataForm.elderName }"
@@ -1426,7 +1426,7 @@ let dataForm = reactive({
   disease: '',
   diseaseList: [],
   medicalHistory: '',
-  extraFile: '',
+  extraFile: [],
   // 紧急联系人
   emergencyPerson: {
     id: 0,
@@ -1832,6 +1832,16 @@ const open = async (id?: string | number, detail?: boolean, tId?: number) => {
       if (res.disease) {
         dataForm.diseaseList = res.disease.split(',')
       }
+      // 处理附件数据
+      if (res.extraFile) {
+        try {
+          dataForm.extraFile = JSON.parse(res.extraFile)
+        } catch (e) {
+          dataForm.extraFile = []
+        }
+      } else {
+        dataForm.extraFile = []
+      }
       
       // 处理字典字段类型转换(将数字转为字符串,确保下拉框正确回显)
       if (res.idCardType !== undefined && res.idCardType !== null) {
@@ -1896,6 +1906,12 @@ const getSubmitData = () => {
     params.disease = params.diseaseList.join(',')
   }
   delete params.diseaseList
+  // 处理附件数据
+  if (params.extraFile && params.extraFile.length > 0) {
+    params.extraFile = JSON.stringify(params.extraFile)
+  } else {
+    params.extraFile = ''
+  }
   // 处理区域数据
   if (Array.isArray(params.currentLiveArea)) {
     params.currentLiveArea = params.currentLiveArea.join('/')

+ 17 - 7
src/views/system/little-tools/index.vue

@@ -59,18 +59,28 @@ const handleExportStatistics = async () => {
     const data = await getOtherFilesStatistics({ tenantIds: tenantIds.join(',') })
     console.log('getOtherFilesStatistics 返回:', data)
     if (data && data.length > 0) {
-      // 处理数据,添加已上传档案数
-      const processedData = data.map((item: any) => ({
-        ...item,
-        uploadedOtherFilesCount: item.totalCount - item.emptyOtherFilesCount
-      }))
-      
+      // 处理数据,添加已上传档案数,并计算已完成占比
+      const processedData = data.map((item: any) => {
+        const totalCount = item.totalCount || 0
+        const emptyOtherFilesCount = item.emptyOtherFilesCount || 0
+        const uploadedOtherFilesCount = totalCount - emptyOtherFilesCount
+        return {
+          ...item,
+          uploadedOtherFilesCount,
+          emptyOtherFilesPercentage: totalCount > 0
+            ? Number(((uploadedOtherFilesCount / totalCount) * 100).toFixed(2))
+            : 0
+        }
+      })
+
+      console.log('processedData:', processedData)
+
       const headers = [
         { key: 'tenantName', title: '机构名称', width: 45 },
         { key: 'totalCount', title: '长者总数', width: 12 },
         { key: 'uploadedOtherFilesCount', title: '已上传档案数', width: 15 },
         { key: 'emptyOtherFilesCount', title: '未上传档案数', width: 15 },
-        { key: 'emptyOtherFilesPercentage', title: '档案为空占比', width: 15 }
+        { key: 'emptyOtherFilesPercentage', title: '档案已完成占比', width: 15 }
       ]
       console.log('准备导出的数据:', processedData)
       await exportWithCustomHeaders(processedData, headers, '各院档案及数据完整率.xlsx')