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 |  619 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 309 insertions(+), 310 deletions(-)

diff --git a/src/views/business/course/components/DonationConfirmStage.vue b/src/views/business/course/components/DonationConfirmStage.vue
index 044817c..11fa1c2 100644
--- a/src/views/business/course/components/DonationConfirmStage.vue
+++ b/src/views/business/course/components/DonationConfirmStage.vue
@@ -1,153 +1,90 @@
 <template>
   <div class="confirmation-detail">
+    <!-- <case-basic-info :case-id="caseId" :show-attachment="true":column="3" /> -->
 
     <el-card class="detail-card">
-      <!-- 鍩虹淇℃伅 -->
       <div slot="header" class="clearfix">
         <span class="detail-title">鎹愮尞纭淇℃伅</span>
-
       </div>
 
-      <el-form :model="form" ref="form" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="鍗忚皟鍛�1" prop="coordinatedusernameo">
-              <el-input v-model="form.coordinatedusernameo" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鍗忚皟鍛�2" prop="coordinatedusernamet">
-              <el-input v-model="form.coordinatedusernamet" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="涓氬姟浜哄憳" prop="responsibleusername">
-              <el-input v-model="form.responsibleusername" />
-            </el-form-item>
-          </el-col>
-        </el-row>
+      <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-row :gutter="20">
-          <!-- <el-col :span="8">
-            <el-form-item label="纭鐘舵��" prop="relativeconfirmationsign">
-              <el-select
-                v-model="form.relativeconfirmationsign"
-                style="width: 100%"
+      <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-option label="鏈‘璁�" value="0" />
-                <el-option label="瀹跺睘纭" value="1" />
-                <el-option label="涓嶅悓鎰忔崘鐚�" value="2" />
-              </el-select>
-            </el-form-item>
-          </el-col> -->
-          <el-col :span="8">
-            <el-form-item label="绛惧瓧鏃堕棿" prop="signdate">
-              <el-date-picker
-                v-model="form.signdate"
-                type="datetime"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
-          <!-- <el-col :span="8">
-            <el-form-item label="琛�鍨�" prop="bloodtype">
-              <el-input v-model="form.bloodtype"  />
-            </el-form-item>
-          </el-col> -->
-        </el-row>
+      <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>
 
-        <!-- <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="璇佷欢鍙风爜" prop="idcardno">
-              <el-input v-model="form.idcardno"  />
-            </el-form-item>
-          </el-col>
-        </el-row> -->
+    <!-- 浜插睘纭淇℃伅 -->
+    <el-card class="detail-card">
+      <div slot="header" class="clearfix">
+        <span class="detail-title">浜插睘纭淇℃伅</span>
+      </div>
 
-        <!-- 浜插睘淇℃伅 -->
-        <!-- 浜插睘淇℃伅 -->
-        <el-divider content-position="left">浜插睘纭淇℃伅</el-divider>
-
-        <el-row :gutter="20">
-          <el-col :span="6">
-            <el-form-item label="浜插睘濮撳悕" prop="relativeconfirmationsignname">
-              <el-input
-                v-model="form.relativeconfirmationsignname"
-                placeholder="璇疯緭鍏ヤ翰灞炲鍚�"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="signfamilyrelations">
-              <el-select
-                v-model="form.signfamilyrelations"
-                placeholder="璇烽�夋嫨涓庢崘璧犺�呭叧绯�"
-              >
-                <el-option
-                  v-for="dict in dict.type.sys_FamilyRelation || []"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="浜插睘韬唤璇�" prop="relativeidcardno">
-              <el-input
-                v-model="form.relativeidcardno"
-                placeholder="璇疯緭鍏ヤ翰灞炶瘉浠跺彿鐮�"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="浜插睘鐢佃瘽" prop="relativephone">
-              <el-input
-                v-model="form.relativephone"
-                placeholder="璇疯緭鍏ヤ翰灞炶仈绯荤數璇�"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row>
-          <el-form-item label-width="100px" label="鎹愮尞鍐冲畾">
-            <el-checkbox-group v-model="organdecision">
-              <el-checkbox
-                v-for="item in organselection"
-                :key="item"
-                :label="item"
-                >{{ item }}
-              </el-checkbox>
-            </el-checkbox-group>
-            <el-input
-              v-if="organdecision.includes('鍏朵粬')"
-              v-model="organdecisionOther"
-              placeholder="璇疯緭鍏ュ叾浠栨崘鐚喅瀹氱殑鍏蜂綋鍐呭"
-              style="margin-top: 10px; width: 300px;"
-            ></el-input>
-          </el-form-item>
-        </el-row>
-
-        <el-form-item label="瀹跺睘鎰忚澶囨敞" prop="relativeRemark">
-          <el-input
-            type="textarea"
-            :rows="3"
-            v-model="form.relativeRemark"
-            placeholder="璁板綍瀹跺睘鐨勬剰瑙佸拰娌熼�氭儏鍐�"
-          />
-        </el-form-item>
-      </el-form>
+      <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>
+        <span class="detail-title">鐩稿叧闄勪欢</span>
       </div>
 
-      <!-- 闄勪欢绫诲瀷閫夐」鍗� -->
       <el-tabs v-model="activeAttachmentType" type="card">
         <el-tab-pane
           v-for="type in attachmentTypes"
@@ -156,21 +93,6 @@
           :name="type.value"
         >
           <div class="attachment-section">
-            <div class="attachment-header">
-              <span class="upload-title">{{ type.label }}</span>
-              <el-tooltip content="鐐瑰嚮涓婁紶璇ョ被鍨嬮檮浠�" placement="top">
-                <el-button
-                  size="mini"
-                  type="primary"
-                  icon="el-icon-plus"
-                  @click="openUploadDialog(type.value)"
-                >
-                  娣诲姞闄勪欢
-                </el-button>
-              </el-tooltip>
-            </div>
-
-            <!-- 褰撳墠绫诲瀷鐨勯檮浠跺垪琛� -->
             <div class="attachment-list">
               <el-table
                 :data="getAttachmentsByType(type.value)"
@@ -188,7 +110,7 @@
                   </template>
                 </el-table-column>
 
-                <el-table-column label="鏂囦欢绫诲瀷" width="100" align="center">
+                <el-table-column label="鏂囦欢绫诲瀷" width="90" align="center">
                   <template slot-scope="scope">
                     <el-tag size="small">{{
                       getFileType(scope.row.fileName)
@@ -196,19 +118,19 @@
                   </template>
                 </el-table-column>
 
-                <el-table-column label="鏂囦欢澶у皬" width="100" align="center">
+                <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="160" align="center">
+                <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="150" align="center">
+                <el-table-column label="鎿嶄綔" width="80" align="center">
                   <template slot-scope="scope">
                     <el-button
                       size="mini"
@@ -217,18 +139,10 @@
                     >
                       棰勮
                     </el-button>
-                    <el-button
-                      size="mini"
-                      type="danger"
-                      @click="handleRemoveAttachment(type.value, scope.$index)"
-                    >
-                      鍒犻櫎
-                    </el-button>
                   </template>
                 </el-table-column>
               </el-table>
 
-              <!-- 绌虹姸鎬佹彁绀� -->
               <div
                 v-if="getAttachmentsByType(type.value).length === 0"
                 class="empty-attachment"
@@ -244,46 +158,6 @@
       </el-tabs>
     </el-card>
 
-    <!-- 涓婁紶瀵硅瘽妗� -->
-    <el-dialog
-      :title="`涓婁紶${getCurrentTypeLabel}闄勪欢`"
-      :visible.sync="uploadDialogVisible"
-      width="500px"
-      :close-on-click-modal="false"
-    >
-      <el-upload
-        ref="uploadRef"
-        class="upload-demo"
-        drag
-        action="#"
-        multiple
-        :file-list="tempFileList"
-        :before-upload="beforeUpload"
-        :on-change="handleFileChange"
-        :on-remove="handleTempRemove"
-        :auto-upload="false"
-        :http-request="handleHttpRequest"
-      >
-        <i class="el-icon-upload"></i>
-        <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
-        <div class="el-upload__tip" slot="tip">
-          鏀寔涓婁紶pdf銆乯pg銆乸ng銆乨oc銆乨ocx鏍煎紡鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃10MB
-        </div>
-      </el-upload>
-
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="uploadDialogVisible = false">鍙栨秷</el-button>
-        <el-button
-          type="primary"
-          @click="submitUpload"
-          :loading="uploadLoading"
-          :disabled="tempFileList.length === 0"
-        >
-          纭涓婁紶
-        </el-button>
-      </span>
-    </el-dialog>
-
     <!-- 鏂囦欢棰勮寮圭獥 -->
     <FilePreviewDialog
       :visible="previewVisible"
@@ -298,26 +172,27 @@
 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: "ConfirmationDetail",
   components: {
     FilePreviewDialog,
     CaseBasicInfo
   },
+  mixins: [readonlyDescriptionsMixin],
+  dicts: ["sys_FamilyRelation"],
    props: {
     infoid: {
       type: String,
       default: true
     }
   },
-  dicts: ["sys_FamilyRelation"],
   data() {
     return {
       caseId: null,
-
-      // 鏄惁缂栬緫妯″紡
       isEdit: false,
-      // 琛ㄥ崟鏁版嵁
       form: {
         id: undefined,
         infoid: undefined,
@@ -337,38 +212,50 @@
         relativeidcardno: "",
         relativephone: "",
         relativeRemark: "",
-        assessannex: "" // JSON瀛楃涓插瓨鍌ㄦ墍鏈夐檮浠�
+        assessannex: "",
+        otherFamilyMembers: ""
+      },
+      // 缁熶竴浜插睘鍒楄〃锛堢涓�鏉′负涓昏浜插睘锛屽叾浣欎负鍏朵粬浜插睘锛�
+      familyMemberList: [],
+      // 褰撳墠缂栬緫鐨勫灞烇紙寮圭獥鐢級
+      currentFamilyMember: {
+        name: "",
+        relation: "",
+        phone: "",
+        idcard: "",
+        isMain: false
+      },
+      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: "浜轰綋鍣ㄥ畼鎹愮尞浜插睘纭鐧昏琛�" },
@@ -377,10 +264,8 @@
         { value: "5", label: "鑴戞浜″垽瀹氱煡鎯呭悓鎰忎功" },
         { value: "6", label: "蹇冩浜″垽瀹氱煡鎯呭悓鎰忎功" }
       ],
-
-      // 闄勪欢鏁版嵁缁撴瀯 - 鎸夌被鍨嬪垎寮�瀛樺偍
       attachmentData: {
-        "1": [], // 绫诲瀷1鐨勯檮浠跺垪琛�
+        "1": [],
         "2": [],
         "3": [],
         "4": [],
@@ -398,19 +283,17 @@
     }
   },
   created() {
+    this.infoid = this.infoid;
     this.caseId = this.infoid;
-    this.isEdit = this.$route.query.confirm === "true";
     if (this.infoid) {
       this.getDetail(this.infoid);
     }
   },
   methods: {
-    // 鑾峰彇璇︽儏
     async getDetail(infoid) {
       this.loading = true;
       try {
         const response = await relativesList({ infoid });
-
         if (response.code === 200) {
           this.handleDetailData(response);
         } else {
@@ -424,11 +307,8 @@
       }
     },
 
-    // 澶勭悊璇︽儏鏁版嵁
     handleDetailData(response) {
       let detailData = null;
-
-      // 鏍规嵁鎺ュ彛瀹為檯杩斿洖鐨勬暟鎹粨鏋勮繘琛岃皟鏁�
       if (response.data) {
         if (Array.isArray(response.data)) {
           detailData = response.data[0] || {};
@@ -443,11 +323,10 @@
         detailData = response;
       }
 
-      // 鏄犲皠瀛楁鍒拌〃鍗�
       this.form = {
         ...this.form,
         id: detailData.id || this.$route.query.id,
-        infoid: detailData.infoid || infoid,
+        infoid: detailData.infoid || this.infoid,
         caseNo: detailData.caseNo || "",
         name: detailData.name || "",
         sex: detailData.sex || "",
@@ -468,19 +347,44 @@
         assessannex: detailData.assessannex || ""
       };
 
-      // 澶勭悊鎹愮尞鍐冲畾鏁版嵁
+      // 鍒濆鍖栧灞炲垪琛�
+      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(",");
       }
-      console.log(this.organdecision, "this.organdecision");
 
-      // 澶勭悊闄勪欢鏁版嵁 - 浠巃ssessannex瀛楁瑙f瀽JSON骞舵寜绫诲瀷鍒嗙被
       this.processAssessannexData();
     },
 
-    // 澶勭悊assessannex瀛楁鏁版嵁骞舵寜绫诲瀷鍒嗙被
     processAssessannexData() {
       if (this.form.assessannex) {
         try {
@@ -488,16 +392,12 @@
             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"; // 榛樿鍒扮涓�绉嶇被鍨�
+              const type = attachment.type || "1";
               if (this.attachmentData[type]) {
                 this.attachmentData[type].push(attachment);
               }
@@ -509,12 +409,13 @@
       }
     },
 
-    // 鏍规嵁绫诲瀷鑾峰彇闄勪欢鍒楄〃
     getAttachmentsByType(type) {
+      console.log(type);
+      console.log(this.attachmentData[type]);
+
       return this.attachmentData[type] || [];
     },
 
-    // 鎵撳紑涓婁紶瀵硅瘽妗�
     openUploadDialog(type) {
       this.currentUploadType = type;
       this.tempFileList = [];
@@ -526,7 +427,6 @@
       });
     },
 
-    // 涓婁紶鍓嶆牎楠孾7](@ref)
     beforeUpload(file) {
       const allowedTypes = [
         "application/pdf",
@@ -535,10 +435,7 @@
         "application/msword",
         "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
       ];
-
-      const maxSize = 10 * 1024 * 1024; // 10MB
-
-      // 鏍¢獙鏂囦欢绫诲瀷
+      const maxSize = 10 * 1024 * 1024;
       const isTypeOk =
         allowedTypes.includes(file.type) ||
         file.name.endsWith(".pdf") ||
@@ -547,85 +444,61 @@
         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;
     },
 
-    // 鑷畾涔変笂浼犺姹�
-    handleHttpRequest(options) {
-      return new Promise((resolve, reject) => {
-        this.uploadLoading = true;
+    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');
 
-        // 妯℃嫙涓婁紶杩囩▼
-        setTimeout(() => {
-          const newAttachment = {
-            id: Date.now(),
-            fileName: options.file.name,
-            fileUrl: URL.createObjectURL(options.file),
-            fileSize: options.file.size,
-            fileType: this.getFileExtension(options.file.name),
-            type: this.currentUploadType, // 璁板綍闄勪欢绫诲瀷
-            uploadTime: new Date().toISOString(),
-            uploader: "褰撳墠鐢ㄦ埛"
-          };
-
-          // 娣诲姞鍒板搴旂被鍨嬬殑闄勪欢鍒楄〃
-          if (this.attachmentData[this.currentUploadType]) {
-            this.attachmentData[this.currentUploadType].push(newAttachment);
-          }
-
-          this.uploadLoading = false;
-          this.updateAssessannexField(); // 鏇存柊瀛樺偍瀛楁
-          resolve({ code: 200, data: newAttachment });
-        }, 1500);
-      });
+      this.updateAssessannexField();
+      this.$message.success("涓婁紶鎴愬姛");
+      this.uploadLoading = false;
+      this.uploadDialogVisible = false;
+      this.tempFileList = [];
     },
 
-    // 鎻愪氦涓婁紶
-    async submitUpload() {
+    submitUpload() {
       if (this.tempFileList.length === 0) {
         this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
         return;
       }
-
-      try {
-        for (const file of this.tempFileList) {
-          await this.$refs.uploadRef.submit();
-        }
-
-        this.$message.success("鏂囦欢涓婁紶鎴愬姛");
-        this.uploadDialogVisible = false;
-        this.tempFileList = [];
-      } catch (error) {
-        this.$message.error("鏂囦欢涓婁紶澶辫触");
-        console.error("涓婁紶澶辫触:", error);
-      }
+      this.uploadLoading = true;
+      this.$refs.uploadRef.submit();
     },
 
-    // 鍒犻櫎闄勪欢
     handleRemoveAttachment(type, index) {
       this.$confirm("纭畾瑕佸垹闄よ繖涓檮浠跺悧锛�", "鎻愮ず", {
         confirmButtonText: "纭畾",
@@ -636,25 +509,157 @@
           if (this.attachmentData[type] && this.attachmentData[type][index]) {
             this.attachmentData[type].splice(index, 1);
             this.$message.success("闄勪欢鍒犻櫎鎴愬姛");
-            this.updateAssessannexField(); // 鏇存柊瀛樺偍瀛楁
+            this.updateAssessannexField();
           }
         })
         .catch(() => {});
     },
 
-    // 鏇存柊assessannex瀛樺偍瀛楁
+    // 瀹跺睘鎿嶄綔鏂规硶
+    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,
@@ -664,11 +669,9 @@
       this.previewVisible = true;
     },
 
-    // 鏂囦欢涓嬭浇
     handleDownload(file) {
       const fileUrl = file.fileUrl;
       const fileName = file.fileName;
-
       if (fileUrl) {
         const link = document.createElement("a");
         link.href = fileUrl;
@@ -683,21 +686,18 @@
       }
     },
 
-    // 鑾峰彇鏂囦欢绫诲瀷
     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(".")
@@ -705,7 +705,6 @@
         .toLowerCase();
     },
 
-    // 鏂囦欢澶у皬鏍煎紡鍖�
     formatFileSize(size) {
       if (!size) return "0 B";
       const k = 1024;
@@ -714,26 +713,22 @@
       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)
@@ -752,6 +747,7 @@
         .toString()
         .padStart(2, "0")}`;
     },
+
     accomplish() {
       this.$confirm("鏄惁瀹屾垚璇ユ渚嬫崘鐚‘璁ゆ楠わ紵", "鎻愰啋", {
         confirmButtonText: "纭畾",
@@ -762,17 +758,15 @@
           this.form.state = 3;
           this.handleSave();
         })
-
         .catch(() => {});
     },
 
-    // 淇濆瓨纭淇℃伅
     async handleSave() {
       try {
         await this.$refs.form.validate();
         this.saveLoading = true;
 
-        // 纭繚闄勪欢鏁版嵁鏄渶鏂扮殑
+        this.updateFamilyMemberField();
         this.updateAssessannexField();
 
         const saveData = {
@@ -780,11 +774,11 @@
           infoid: this.infoid,
           organdecision: this.organdecision.join(","),
           organdecisionOther: this.organdecisionOther
-          // assessannex瀛楁宸插湪updateAssessannexField涓洿鏂�
         };
         if (saveData.state == 1 || !saveData.state) {
           saveData.state = 2;
         }
+
         let response = null;
         if (saveData.id) {
           response = await relativesEdit(saveData);
@@ -818,6 +812,11 @@
 
 .detail-card {
   margin-bottom: 20px;
+}
+
+.main-family {
+  font-weight: bold;
+  color: #e6a23c;
 }
 
 .attachment-card {
@@ -855,7 +854,7 @@
 
 .empty-attachment {
   text-align: center;
-  padding: 40px 0;
+  padding: 30px 0;
   color: #909399;
 }
 

--
Gitblit v1.9.3