From c4599aa279fd2f90b741608392e056fbae2282d5 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 20 八月 2026 17:16:54 +0800
Subject: [PATCH] 各表单布局调整

---
 src/views/business/course/components/DonationConfirmStage.vue | 1008 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 828 insertions(+), 180 deletions(-)

diff --git a/src/views/business/course/components/DonationConfirmStage.vue b/src/views/business/course/components/DonationConfirmStage.vue
index d608417..11fa1c2 100644
--- a/src/views/business/course/components/DonationConfirmStage.vue
+++ b/src/views/business/course/components/DonationConfirmStage.vue
@@ -1,217 +1,865 @@
 <template>
-  <base-stage :stage-data="stageData" :case-info="caseInfo">
-    <template #header>
-      <el-alert
-        :title="`鎹愮尞纭 - ${getStatusText()}`"
-        :type="getAlertType()"
-        :description="getAlertDescription()"
-        show-icon
-        :closable="false"
-      />
-    </template>
+  <div class="confirmation-detail">
+    <!-- <case-basic-info :case-id="caseId" :show-attachment="true":column="3" /> -->
 
-    <el-row :gutter="20" style="margin-top: 20px;">
-      <el-col :span="8">
-        <el-card>
-          <div slot="header" class="card-header">
-            <span>纭淇℃伅姒傝</span>
-          </div>
-          <div class="confirm-overview">
-            <div class="overview-item">
-              <span class="label">纭鐘舵��:</span>
-              <el-tag :type="getStatusTag(confirmationDetails.status)">
-                {{ getStatusText(confirmationDetails.status) }}
-              </el-tag>
-            </div>
-            <div class="overview-item">
-              <span class="label">纭鏃堕棿:</span>
-              <span>{{ formatTime(confirmationDetails.confirmTime) }}</span>
-            </div>
-            <div class="overview-item">
-              <span class="label">纭鏂瑰紡:</span>
-              <span>{{ confirmationDetails.method }}</span>
-            </div>
-            <div class="overview-item">
-              <span class="label">鍗忚皟鍛�:</span>
-              <span>{{ confirmationDetails.coordinator }}</span>
-            </div>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="8">
-        <el-card>
-          <div slot="header" class="card-header">
-            <span>瀹跺睘鍚屾剰鎯呭喌</span>
-          </div>
-          <el-descriptions :column="1" size="small">
-            <el-descriptions-item label="涓昏瀹跺睘">
-              {{ familyConsent.mainRelative }}
-            </el-descriptions-item>
-            <el-descriptions-item label="鍚屾剰鐘舵��">
-              <el-tag :type="familyConsent.consented ? 'success' : 'warning'">
-                {{ familyConsent.consented ? '宸插悓鎰�' : '寰呯‘璁�' }}
-              </el-tag>
-            </el-descriptions-item>
-            <el-descriptions-item label="绛惧瓧鏃堕棿">
-              {{ formatTime(familyConsent.signTime) }}
-            </el-descriptions-item>
-            <el-descriptions-item label="鍏崇郴璇佹槑">
-              {{ familyConsent.relationshipProof }}
-            </el-descriptions-item>
-          </el-descriptions>
-        </el-card>
-      </el-col>
-
-      <el-col :span="8">
-        <el-card>
-          <div slot="header" class="card-header">
-            <span>娉曞緥鏂囦欢</span>
-          </div>
-          <div class="document-list">
-            <div v-for="doc in legalDocuments" :key="doc.name" class="document-item">
-              <div class="doc-info">
-                <i :class="doc.icon" style="color: #409EFF; margin-right: 8px;"></i>
-                <span>{{ doc.name }}</span>
-              </div>
-              <el-tag :type="doc.status === 'completed' ? 'success' : 'warning'" size="small">
-                {{ doc.status === 'completed' ? '宸茬缃�' : '寰呯缃�' }}
-              </el-tag>
-            </div>
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-
-    <el-card style="margin-top: 20px;">
-      <div slot="header" class="card-header">
-        <span>鎹愮尞鎰忔効纭涔�</span>
+    <el-card class="detail-card">
+      <div slot="header" class="clearfix">
+        <span class="detail-title">鎹愮尞纭淇℃伅</span>
       </div>
-      <div class="consent-content">
-        <p>鏈汉/瀹跺睘纭锛屽湪鍏呭垎浜嗚В鍣ㄥ畼鎹愮尞鐨勭浉鍏充俊鎭悗锛岃嚜鎰垮悓鎰忚繘琛屽櫒瀹樻崘鐚��</p>
-        <el-divider />
-        <el-descriptions :column="2" border>
-          <el-descriptions-item label="鎹愮尞鑰呭鍚�">{{ caseInfo.donorName }}</el-descriptions-item>
-          <el-descriptions-item label="鎹愮尞鑰呰韩浠借瘉鍙�">{{ confirmationDetails.idNumber }}</el-descriptions-item>
-          <el-descriptions-item label="鎹愮尞鍣ㄥ畼绫诲瀷">{{ confirmationDetails.organs }}</el-descriptions-item>
-          <el-descriptions-item label="鎹愮尞鐢ㄩ��">{{ confirmationDetails.purpose }}</el-descriptions-item>
-          <el-descriptions-item label="绛惧瓧浜�">{{ familyConsent.mainRelative }}</el-descriptions-item>
-          <el-descriptions-item label="绛惧瓧鏃ユ湡">{{ formatTime(familyConsent.signTime) }}</el-descriptions-item>
-        </el-descriptions>
-      </div>
+
+      <el-descriptions title="鍗忚皟鍛樹俊鎭�" :column="descriptionColumn" border size="small">
+        <el-descriptions-item label="鍗忚皟鍛�1">{{ form.coordinatedusernameo || '-' }}</el-descriptions-item>
+        <el-descriptions-item label="鍗忚皟鍛�2">{{ form.coordinatedusernamet || '-' }}</el-descriptions-item>
+      </el-descriptions>
+
+      <el-descriptions title="鎹愮尞鍐冲畾" :column="descriptionColumn" border size="small" style="margin-top: 16px;">
+        <el-descriptions-item label="鎹愮尞鍐冲畾">
+          <template v-if="organdecision && organdecision.length">
+            <el-tag v-for="(item, i) in organdecision" :key="i" size="small" style="margin-right: 8px;">{{ item }}</el-tag>
+          </template>
+          <template v-else>-</template>
+        </el-descriptions-item>
+        <el-descriptions-item v-if="organdecision && organdecision.includes('鍏朵粬')" label="鍏朵粬鎹愮尞鍐冲畾">
+          {{ organdecisionOther || '-' }}
+        </el-descriptions-item>
+      </el-descriptions>
+
+      <el-descriptions title="瀹跺睘鎰忚澶囨敞" :column="1" border size="small" style="margin-top: 16px;">
+        <el-descriptions-item label="瀹跺睘鎰忚澶囨敞">{{ form.relativeRemark || '-' }}</el-descriptions-item>
+      </el-descriptions>
     </el-card>
-  </base-stage>
+
+    <!-- 浜插睘纭淇℃伅 -->
+    <el-card class="detail-card">
+      <div slot="header" class="clearfix">
+        <span class="detail-title">浜插睘纭淇℃伅</span>
+      </div>
+
+      <el-table :data="familyMemberList" size="small" border>
+        <el-table-column label="搴忓彿" width="60" align="center">
+          <template slot-scope="scope">
+            {{ scope.$index + 1 }}
+          </template>
+        </el-table-column>
+        <el-table-column label="濮撳悕" prop="name" min-width="120">
+          <template slot-scope="scope">
+            <span :class="{ 'main-family': scope.$index === 0 }">{{
+              scope.row.name
+            }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="涓庢崘璧犺�呭叧绯�" prop="relation" min-width="140">
+          <template slot-scope="scope">
+            <dict-tag
+              :options="dict.type.sys_FamilyRelation"
+              :value="scope.row.relation"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column label="韬唤璇佸彿" prop="idcard" min-width="180">
+          <template slot-scope="scope">
+            <span v-if="scope.$index === 0">{{ scope.row.idcard }}</span>
+            <span v-else style="color: #909399;">-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="鑱旂郴鐢佃瘽" prop="phone" min-width="130">
+          <template slot-scope="scope">
+            <span v-if="scope.$index === 0">{{ scope.row.phone }}</span>
+            <span v-else style="color: #909399;">-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="绫诲瀷" width="70" align="center">
+          <template slot-scope="scope">
+            <el-tag v-if="scope.$index === 0" type="warning" size="small"
+              >涓昏</el-tag
+            >
+            <el-tag v-else type="info" size="small">鍏朵粬</el-tag>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-card>
+
+    <!-- 闄勪欢淇℃伅 - 鎸夌被鍨嬪垎绫� -->
+    <el-card class="attachment-card">
+      <div slot="header" class="clearfix">
+        <span class="detail-title">鐩稿叧闄勪欢</span>
+      </div>
+
+      <el-tabs v-model="activeAttachmentType" type="card">
+        <el-tab-pane
+          v-for="type in attachmentTypes"
+          :key="type.value"
+          :label="type.label"
+          :name="type.value"
+        >
+          <div class="attachment-section">
+            <div class="attachment-list">
+              <el-table
+                :data="getAttachmentsByType(type.value)"
+                size="small"
+                v-loading="attachmentLoading"
+                style="width: 100%;"
+              >
+                <el-table-column label="鏂囦欢鍚�" min-width="200">
+                  <template slot-scope="scope">
+                    <i
+                      class="el-icon-document"
+                      style="color: #409EFF; margin-right: 8px;"
+                    ></i>
+                    <span class="file-name">{{ scope.row.fileName }}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column label="鏂囦欢绫诲瀷" width="90" align="center">
+                  <template slot-scope="scope">
+                    <el-tag size="small">{{
+                      getFileType(scope.row.fileName)
+                    }}</el-tag>
+                  </template>
+                </el-table-column>
+
+                <el-table-column label="鏂囦欢澶у皬" width="90" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ formatFileSize(scope.row.fileSize) }}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column label="涓婁紶鏃堕棿" width="155" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ formatDateTime(scope.row.uploadTime) }}</span>
+                  </template>
+                </el-table-column>
+
+                <el-table-column label="鎿嶄綔" width="80" align="center">
+                  <template slot-scope="scope">
+                    <el-button
+                      size="mini"
+                      type="primary"
+                      @click="handlePreview(scope.row)"
+                    >
+                      棰勮
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+
+              <div
+                v-if="getAttachmentsByType(type.value).length === 0"
+                class="empty-attachment"
+              >
+                <el-empty
+                  :description="`鏆傛棤${type.label}闄勪欢`"
+                  :image-size="80"
+                ></el-empty>
+              </div>
+            </div>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </el-card>
+
+    <!-- 鏂囦欢棰勮寮圭獥 -->
+    <FilePreviewDialog
+      :visible="previewVisible"
+      :file="currentPreviewFile"
+      @close="previewVisible = false"
+      @download="handleDownload"
+    />
+  </div>
 </template>
 
 <script>
-import BaseStage from './BaseStage.vue';
+import { relativesList, relativesEdit, relativesAdd } from "@/api/businessApi";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
+import CaseBasicInfo from "@/components/CaseBasicInfo";
+import { getToken } from "@/utils/auth";
+import readonlyDescriptionsMixin from "./readonlyDescriptionsMixin";
 
 export default {
-  name: 'DonationConfirmStage',
-  components: { BaseStage },
-  props: {
-    stageData: {
-      type: Object,
-      default: () => ({})
-    },
-    caseInfo: {
-      type: Object,
-      default: () => ({})
+  name: "ConfirmationDetail",
+  components: {
+    FilePreviewDialog,
+    CaseBasicInfo
+  },
+  mixins: [readonlyDescriptionsMixin],
+  dicts: ["sys_FamilyRelation"],
+   props: {
+    infoid: {
+      type: String,
+      default: true
     }
   },
   data() {
     return {
-      confirmationDetails: {
-        status: 'completed',
-        confirmTime: '2023-12-03 11:00:00',
-        method: '瀹跺睘涔﹂潰鍚屾剰',
-        coordinator: '璧靛崗璋冨憳',
-        idNumber: '110101199001011234',
-        organs: '蹇冭剰銆佽倽鑴忋�佽偩鑴忋�佽鑶�',
-        purpose: '涓村簥绉绘'
+      caseId: null,
+      isEdit: false,
+      form: {
+        id: undefined,
+        infoid: undefined,
+        caseNo: "",
+        name: "",
+        sex: "",
+        age: "",
+        diagnosisname: "",
+        treatmenthospitalname: "",
+        coordinatedusernameo: "",
+        coordinatedusernamet: "",
+        responsibleusername: "",
+        relativeconfirmationsign: "0",
+        signdate: "",
+        relativeconfirmationsignname: "",
+        signfamilyrelations: "",
+        relativeidcardno: "",
+        relativephone: "",
+        relativeRemark: "",
+        assessannex: "",
+        otherFamilyMembers: ""
       },
-      familyConsent: {
-        mainRelative: '寮犱笁鐖朵翰',
-        consented: true,
-        signTime: '2023-12-03 10:45:00',
-        relationshipProof: '鎴峰彛鏈叧绯昏瘉鏄�'
+      // 缁熶竴浜插睘鍒楄〃锛堢涓�鏉′负涓昏浜插睘锛屽叾浣欎负鍏朵粬浜插睘锛�
+      familyMemberList: [],
+      // 褰撳墠缂栬緫鐨勫灞烇紙寮圭獥鐢級
+      currentFamilyMember: {
+        name: "",
+        relation: "",
+        phone: "",
+        idcard: "",
+        isMain: false
       },
-      legalDocuments: [
-        { name: '鍣ㄥ畼鎹愮尞鍚屾剰涔�', icon: 'el-icon-document', status: 'completed' },
-        { name: '瀹跺睘鍏崇郴璇佹槑', icon: 'el-icon-document', status: 'completed' },
-        { name: '鍖荤枟鍏嶈矗澹版槑', icon: 'el-icon-document', status: 'completed' },
-        { name: '闅愮淇濇姢鍗忚', icon: 'el-icon-document', status: 'completed' }
-      ]
+      isEditFamilyMember: false,
+      editFamilyMemberIndex: -1,
+      familyDialogVisible: false,
+      familyDialogTitle: "娣诲姞瀹跺睘",
+
+      uploadAction: process.env.VUE_APP_BASE_API + "/common/upload",
+      headers: {
+        Authorization: "Bearer " + getToken()
+      },
+      organdecision: [],
+      organdecisionOther: "",
+      organselection: [
+        "鑲濊剰",
+        "鑲捐剰",
+        "蹇冭剰",
+        "鑲鸿剰",
+        "鑳拌吅",
+        "灏忚偁",
+        "鐪艰鑶�",
+        "鍏朵粬"
+      ],
+      loading: false,
+      saveLoading: false,
+      activeAttachmentType: "1",
+      attachmentLoading: false,
+      uploadDialogVisible: false,
+      uploadLoading: false,
+      tempFileList: [],
+      currentUploadType: "",
+      previewVisible: false,
+      currentPreviewFile: null,
+      attachmentTypes: [
+        { value: "1", label: "浜轰綋鍣ㄥ畼娼滃湪鎹愮尞鑰呯櫥璁拌〃" },
+        { value: "2", label: "浜轰綋鍣ㄥ畼鎹愮尞浜插睘纭鐧昏琛�" },
+        { value: "3", label: "鎹愮尞鑰呭強鐩寸郴浜插睘韬唤璇併�佹埛鍙g翱鐩稿叧璇佹槑" },
+        { value: "4", label: "鍏皯韬晠鍚庝汉浣撳櫒瀹橈紙瑙掕啘锛夐仐浣撴崘鐚憡鐭ヤ功" },
+        { value: "5", label: "鑴戞浜″垽瀹氱煡鎯呭悓鎰忎功" },
+        { value: "6", label: "蹇冩浜″垽瀹氱煡鎯呭悓鎰忎功" }
+      ],
+      attachmentData: {
+        "1": [],
+        "2": [],
+        "3": [],
+        "4": [],
+        "5": [],
+        "6": []
+      }
     };
   },
+  computed: {
+    getCurrentTypeLabel() {
+      const type = this.attachmentTypes.find(
+        t => t.value === this.currentUploadType
+      );
+      return type ? type.label : "";
+    }
+  },
+  created() {
+    this.infoid = this.infoid;
+    this.caseId = this.infoid;
+    if (this.infoid) {
+      this.getDetail(this.infoid);
+    }
+  },
   methods: {
-    getStatusText() {
-      const status = this.stageData.status;
-      return status === 'completed' ? '宸插畬鎴�' :
-             status === 'in_progress' ? '杩涜涓�' : '鏈紑濮�';
+    async getDetail(infoid) {
+      this.loading = true;
+      try {
+        const response = await relativesList({ infoid });
+        if (response.code === 200) {
+          this.handleDetailData(response);
+        } else {
+          this.$message.error("鑾峰彇璇︽儏澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+        }
+      } catch (error) {
+        console.error("鑾峰彇鎹愮尞纭璇︽儏澶辫触:", error);
+        this.$message.error("鑾峰彇璇︽儏澶辫触");
+      } finally {
+        this.loading = false;
+      }
     },
-    getAlertType() {
-      const status = this.stageData.status;
-      return status === 'completed' ? 'success' :
-             status === 'in_progress' ? 'warning' : 'info';
-    },
-    getAlertDescription() {
-      const status = this.stageData.status;
-      return status === 'completed' ? '鎹愮尞纭娴佺▼宸插畬鎴愶紝鎵�鏈夋硶寰嬫枃浠跺凡绛剧讲' :
-             status === 'in_progress' ? '鎹愮尞纭娴佺▼姝e湪杩涜涓�' : '绛夊緟寮�濮嬫崘鐚‘璁ゆ祦绋�';
-    },
-    getStatusTag(status) {
-      const map = {
-        'completed': 'success',
-        'in_progress': 'warning',
-        'pending': 'info'
+
+    handleDetailData(response) {
+      let detailData = null;
+      if (response.data) {
+        if (Array.isArray(response.data)) {
+          detailData = response.data[0] || {};
+        } else if (response.data.rows && Array.isArray(response.data.rows)) {
+          detailData = response.data.rows[0] || {};
+        } else if (Array.isArray(response.data.list)) {
+          detailData = response.data.list[0] || {};
+        } else {
+          detailData = response.data;
+        }
+      } else {
+        detailData = response;
+      }
+
+      this.form = {
+        ...this.form,
+        id: detailData.id || this.$route.query.id,
+        infoid: detailData.infoid || this.infoid,
+        caseNo: detailData.caseNo || "",
+        name: detailData.name || "",
+        sex: detailData.sex || "",
+        age: detailData.age || "",
+        diagnosisname: detailData.diagnosisname || "",
+        treatmenthospitalname: detailData.treatmenthospitalname || "",
+        coordinatedusernameo: detailData.coordinatedusernameo || "",
+        coordinatedusernamet: detailData.coordinatedusernamet || "",
+        responsibleusername: detailData.responsibleusername || "",
+        relativeconfirmationsign: detailData.relativeconfirmationsign || "0",
+        signdate: detailData.signdate,
+        relativeconfirmationsignname:
+          detailData.relativeconfirmationsignname || "",
+        signfamilyrelations: detailData.signfamilyrelations || "",
+        relativeidcardno: detailData.relativeidcardno || "",
+        relativephone: detailData.relativephone || "",
+        relativeRemark: detailData.relativeRemark || "",
+        assessannex: detailData.assessannex || ""
       };
-      return map[status] || 'info';
+
+      // 鍒濆鍖栧灞炲垪琛�
+      this.familyMemberList = [];
+      if (detailData.relativeconfirmationsignname) {
+        this.familyMemberList.push({
+          name: detailData.relativeconfirmationsignname,
+          relation: detailData.signfamilyrelations || "",
+          phone: detailData.relativephone || "",
+          idcard: detailData.relativeidcardno || ""
+        });
+      }
+      if (detailData.otherFamilyMembers) {
+        try {
+          const otherMembers =
+            typeof detailData.otherFamilyMembers === "string"
+              ? JSON.parse(detailData.otherFamilyMembers)
+              : detailData.otherFamilyMembers || [];
+          otherMembers.forEach(member => {
+            this.familyMemberList.push({
+              name: member.name,
+              relation: member.relation,
+              phone: member.phone || "",
+              idcard: member.idcard || ""
+            });
+          });
+        } catch (e) {
+          console.warn("瑙f瀽鍏朵粬瀹跺睘鏁版嵁澶辫触:", e);
+        }
+      }
+
+      if (detailData.organdecision) {
+        this.organdecision = Array.isArray(detailData.organdecision)
+          ? detailData.organdecision
+          : detailData.organdecision.split(",");
+      }
+
+      this.processAssessannexData();
+    },
+
+    processAssessannexData() {
+      if (this.form.assessannex) {
+        try {
+          const annexData =
+            typeof this.form.assessannex === "string"
+              ? JSON.parse(this.form.assessannex)
+              : this.form.assessannex;
+          Object.keys(this.attachmentData).forEach(key => {
+            this.attachmentData[key] = [];
+          });
+          if (Array.isArray(annexData)) {
+            annexData.forEach(attachment => {
+              const type = attachment.type || "1";
+              if (this.attachmentData[type]) {
+                this.attachmentData[type].push(attachment);
+              }
+            });
+          }
+        } catch (error) {
+          console.warn("assessannex鏁版嵁瑙f瀽澶辫触:", error);
+        }
+      }
+    },
+
+    getAttachmentsByType(type) {
+      console.log(type);
+      console.log(this.attachmentData[type]);
+
+      return this.attachmentData[type] || [];
+    },
+
+    openUploadDialog(type) {
+      this.currentUploadType = type;
+      this.tempFileList = [];
+      this.uploadDialogVisible = true;
+      this.$nextTick(() => {
+        if (this.$refs.uploadRef) {
+          this.$refs.uploadRef.clearFiles();
+        }
+      });
+    },
+
+    beforeUpload(file) {
+      const allowedTypes = [
+        "application/pdf",
+        "image/jpeg",
+        "image/png",
+        "application/msword",
+        "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+      ];
+      const maxSize = 10 * 1024 * 1024;
+      const isTypeOk =
+        allowedTypes.includes(file.type) ||
+        file.name.endsWith(".pdf") ||
+        file.name.endsWith(".jpg") ||
+        file.name.endsWith(".jpeg") ||
+        file.name.endsWith(".png") ||
+        file.name.endsWith(".doc") ||
+        file.name.endsWith(".docx");
+      if (!isTypeOk) {
+        this.$message.error(
+          "鏂囦欢鏍煎紡涓嶆敮鎸侊紝璇蜂笂浼爌df銆乯pg銆乸ng銆乨oc鎴杁ocx鏍煎紡鏂囦欢"
+        );
+        return false;
+      }
+      if (file.size > maxSize) {
+        this.$message.error("鏂囦欢澶у皬涓嶈兘瓒呰繃10MB");
+        return false;
+      }
+      return true;
+    },
+
+    handleFileChange(file, fileList) {
+      this.tempFileList = fileList;
+    },
+
+    handleTempRemove(file, fileList) {
+      this.tempFileList = fileList;
+    },
+
+    handleUploadSuccess(response, file) {
+      if (response.code !== 200) {
+        this.$message.error(response.msg || "涓婁紶澶辫触");
+        return;
+      }
+      const newAttachment = {
+        id: Date.now(),
+        fileName: file.name,
+        fileUrl: response.url,
+        fileSize: file.size,
+        fileType: this.getFileExtension(file.name),
+        type: this.currentUploadType,
+        uploadTime: this.getCurrentTime(),
+        uploader: "褰撳墠鐢ㄦ埛"
+      };
+      this.attachmentData[this.currentUploadType].push(newAttachment);
+      console.log(this.attachmentData,'this.attachmentData');
+
+      this.updateAssessannexField();
+      this.$message.success("涓婁紶鎴愬姛");
+      this.uploadLoading = false;
+      this.uploadDialogVisible = false;
+      this.tempFileList = [];
+    },
+
+    submitUpload() {
+      if (this.tempFileList.length === 0) {
+        this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
+        return;
+      }
+      this.uploadLoading = true;
+      this.$refs.uploadRef.submit();
+    },
+
+    handleRemoveAttachment(type, index) {
+      this.$confirm("纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          if (this.attachmentData[type] && this.attachmentData[type][index]) {
+            this.attachmentData[type].splice(index, 1);
+            this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
+            this.updateAssessannexField();
+          }
+        })
+        .catch(() => {});
+    },
+
+    // 瀹跺睘鎿嶄綔鏂规硶
+    openFamilyDialog(isMain) {
+      this.isEditFamilyMember = false;
+      this.editFamilyMemberIndex = -1;
+      this.familyDialogTitle = "娣诲姞鍏朵粬瀹跺睘";
+
+      // 濡傛灉杩樻病鏈変换浣曞灞烇紝鍒欐坊鍔犱富瑕佷翰灞�
+      if (this.familyMemberList.length === 0) {
+        this.currentFamilyMember = {
+          name: "",
+          relation: "",
+          phone: "",
+          idcard: "",
+          isMain: true
+        };
+        this.familyDialogTitle = "娣诲姞涓昏浜插睘";
+      } else {
+        this.currentFamilyMember = {
+          name: "",
+          relation: "",
+          phone: "",
+          idcard: "",
+          isMain: false
+        };
+      }
+
+      this.familyDialogVisible = true;
+    },
+
+    editFamilyMember(index) {
+      this.isEditFamilyMember = true;
+      this.editFamilyMemberIndex = index;
+      const member = this.familyMemberList[index];
+      this.currentFamilyMember = {
+        name: member.name,
+        relation: member.relation,
+        phone: member.phone || "",
+        idcard: member.idcard || "",
+        isMain: index === 0
+      };
+      this.familyDialogTitle = index === 0 ? "缂栬緫涓昏浜插睘" : "缂栬緫鍏朵粬瀹跺睘";
+      this.familyDialogVisible = true;
+    },
+
+    deleteFamilyMember(index) {
+      if (index === 0) {
+        this.$message.warning("涓昏浜插睘涓嶅彲鍒犻櫎");
+        return;
+      }
+      this.$confirm("纭鍒犻櫎璇ュ灞烇紵", "鎻愮ず", { type: "warning" })
+        .then(() => {
+          this.familyMemberList.splice(index, 1);
+          this.updateFamilyMemberField();
+        })
+        .catch(() => {});
+    },
+
+    saveFamilyMember() {
+      if (!this.currentFamilyMember.name) {
+        this.$message.warning("璇疯緭鍏ュ鍚�");
+        return;
+      }
+      if (!this.currentFamilyMember.relation) {
+        this.$message.warning("璇烽�夋嫨涓庢崘璧犺�呭叧绯�");
+        return;
+      }
+
+      // 濡傛灉鏄富瑕佷翰灞烇紝楠岃瘉韬唤璇佸拰鐢佃瘽
+      if (this.currentFamilyMember.isMain) {
+        if (!this.currentFamilyMember.idcard) {
+          this.$message.warning("璇疯緭鍏ヤ富瑕佷翰灞炵殑韬唤璇佸彿");
+          return;
+        }
+        if (
+          !/^(\d{15}|\d{18}|\d{17}(\d|X|x))$/.test(
+            this.currentFamilyMember.idcard
+          )
+        ) {
+          this.$message.warning("璇疯緭鍏ユ纭殑韬唤璇佸彿");
+          return;
+        }
+        if (!this.currentFamilyMember.phone) {
+          this.$message.warning("璇疯緭鍏ヤ富瑕佷翰灞炵殑鑱旂郴鐢佃瘽");
+          return;
+        }
+        if (!/^1[3-9]\d{9}$/.test(this.currentFamilyMember.phone)) {
+          this.$message.warning("璇疯緭鍏ユ纭殑鎵嬫満鍙�");
+          return;
+        }
+      }
+
+      const memberData = {
+        name: this.currentFamilyMember.name,
+        relation: this.currentFamilyMember.relation,
+        phone: this.currentFamilyMember.isMain
+          ? this.currentFamilyMember.phone
+          : "",
+        idcard: this.currentFamilyMember.isMain
+          ? this.currentFamilyMember.idcard
+          : ""
+      };
+
+      if (this.isEditFamilyMember) {
+        this.familyMemberList.splice(this.editFamilyMemberIndex, 1, memberData);
+      } else {
+        this.familyMemberList.push(memberData);
+      }
+
+      this.updateFamilyMemberField();
+      this.familyDialogVisible = false;
+      this.$message.success(this.isEditFamilyMember ? "缂栬緫鎴愬姛" : "娣诲姞鎴愬姛");
+    },
+
+    updateFamilyMemberField() {
+      if (this.familyMemberList.length > 0) {
+        const mainMember = this.familyMemberList[0];
+        this.form.relativeconfirmationsignname = mainMember.name;
+        this.form.signfamilyrelations = mainMember.relation;
+        this.form.relativeidcardno = mainMember.idcard || "";
+        this.form.relativephone = mainMember.phone || "";
+
+        const otherMembers = this.familyMemberList.slice(1).map(member => ({
+          name: member.name,
+          relation: member.relation,
+          phone: member.phone || "",
+          idcard: member.idcard || ""
+        }));
+        this.form.otherFamilyMembers = JSON.stringify(otherMembers);
+      } else {
+        this.form.relativeconfirmationsignname = "";
+        this.form.signfamilyrelations = "";
+        this.form.relativeidcardno = "";
+        this.form.relativephone = "";
+        this.form.otherFamilyMembers = "[]";
+      }
+    },
+
+    updateAssessannexField() {
+      const allAttachments = [];
+      Object.values(this.attachmentData).forEach(attachments => {
+        allAttachments.push(...attachments);
+      });
+      this.form.assessannex = JSON.stringify(allAttachments);
+    },
+
+    handlePreview(file) {
+      this.currentPreviewFile = {
+        fileName: file.fileName,
+        fileUrl: file.fileUrl,
+        fileType: this.getFileType(file.fileName)
+      };
+      this.previewVisible = true;
+    },
+
+    handleDownload(file) {
+      const fileUrl = file.fileUrl;
+      const fileName = file.fileName;
+      if (fileUrl) {
+        const link = document.createElement("a");
+        link.href = fileUrl;
+        link.download = fileName;
+        link.style.display = "none";
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        this.$message.success("寮�濮嬩笅杞芥枃浠�");
+      } else {
+        this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
+      }
+    },
+
+    getFileType(fileName) {
+      if (!fileName) return "other";
+      const extension = this.getFileExtension(fileName);
+      const imageTypes = ["jpg", "jpeg", "png"];
+      const pdfTypes = ["pdf"];
+      const officeTypes = ["doc", "docx"];
+      if (imageTypes.includes(extension)) return "image";
+      if (pdfTypes.includes(extension)) return "pdf";
+      if (officeTypes.includes(extension)) return "office";
+      return "other";
+    },
+
+    getFileExtension(filename) {
+      return filename
+        .split(".")
+        .pop()
+        .toLowerCase();
+    },
+
+    formatFileSize(size) {
+      if (!size) return "0 B";
+      const k = 1024;
+      const sizes = ["B", "KB", "MB", "GB"];
+      const i = Math.floor(Math.log(size) / Math.log(k));
+      return parseFloat((size / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
+    },
+
+    formatDateTime(dateTime) {
+      if (!dateTime) return "";
+      try {
+        const date = new Date(dateTime);
+        if (isNaN(date.getTime())) return dateTime;
+        const year = date.getFullYear();
+        const month = String(date.getMonth() + 1).padStart(2, "0");
+        const day = String(date.getDate()).padStart(2, "0");
+        const hours = String(date.getHours()).padStart(2, "0");
+        const minutes = String(date.getMinutes()).padStart(2, "0");
+        return `${year}-${month}-${day} ${hours}:${minutes}`;
+      } catch (error) {
+        return dateTime;
+      }
+    },
+
+    getCurrentTime() {
+      const now = new Date();
+      return `${now.getFullYear()}-${(now.getMonth() + 1)
+        .toString()
+        .padStart(2, "0")}-${now
+        .getDate()
+        .toString()
+        .padStart(2, "0")} ${now
+        .getHours()
+        .toString()
+        .padStart(2, "0")}:${now
+        .getMinutes()
+        .toString()
+        .padStart(2, "0")}:${now
+        .getSeconds()
+        .toString()
+        .padStart(2, "0")}`;
+    },
+
+    accomplish() {
+      this.$confirm("鏄惁瀹屾垚璇ユ渚嬫崘鐚‘璁ゆ楠わ紵", "鎻愰啋", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          this.form.state = 3;
+          this.handleSave();
+        })
+        .catch(() => {});
+    },
+
+    async handleSave() {
+      try {
+        await this.$refs.form.validate();
+        this.saveLoading = true;
+
+        this.updateFamilyMemberField();
+        this.updateAssessannexField();
+
+        const saveData = {
+          ...this.form,
+          infoid: this.infoid,
+          organdecision: this.organdecision.join(","),
+          organdecisionOther: this.organdecisionOther
+        };
+        if (saveData.state == 1 || !saveData.state) {
+          saveData.state = 2;
+        }
+
+        let response = null;
+        if (saveData.id) {
+          response = await relativesEdit(saveData);
+        } else {
+          response = await relativesAdd(saveData);
+        }
+
+        if (response.code === 200) {
+          this.$message.success("淇濆瓨鎴愬姛");
+          this.$router.push("/case/affirm");
+        } else {
+          this.$message.error("淇濆瓨澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+        }
+      } catch (error) {
+        if (error !== "cancel") {
+          console.error("淇濆瓨澶辫触:", error);
+          this.$message.error("淇濆瓨澶辫触");
+        }
+      } finally {
+        this.saveLoading = false;
+      }
     }
   }
 };
 </script>
 
 <style scoped>
-.confirm-overview {
-  padding: 10px 0;
+.confirmation-detail {
+  padding: 20px;
 }
 
-.overview-item {
+.detail-card {
+  margin-bottom: 20px;
+}
+
+.main-family {
+  font-weight: bold;
+  color: #e6a23c;
+}
+
+.attachment-card {
+  margin-bottom: 20px;
+}
+
+.detail-title {
+  font-size: 16px;
+  font-weight: bold;
+  margin-right: 20px;
+}
+
+.attachment-section {
+  padding: 15px;
+}
+
+.attachment-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 15px;
-  padding: 8px 0;
-  border-bottom: 1px solid #f0f0f0;
+  padding-bottom: 10px;
+  border-bottom: 1px solid #ebeef5;
 }
 
-.overview-item .label {
+.upload-title {
+  font-size: 14px;
+  font-weight: 600;
+  color: #303133;
+}
+
+.attachment-list {
+  margin-top: 15px;
+}
+
+.empty-attachment {
+  text-align: center;
+  padding: 30px 0;
+  color: #909399;
+}
+
+.file-name {
+  font-size: 13px;
   color: #606266;
-  font-weight: 500;
-}
-
-.document-list {
-  padding: 10px 0;
-}
-
-.document-item {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 12px;
-  padding: 8px 12px;
-  border: 1px solid #e4e7ed;
-  border-radius: 4px;
-}
-
-.doc-info {
-  display: flex;
-  align-items: center;
-}
-
-.consent-content {
-  padding: 20px;
-  line-height: 1.6;
 }
 </style>

--
Gitblit v1.9.3