From dc082351978a1e9f75d7a1471a0ca7ebeac552a5 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 01 六月 2026 11:07:50 +0800
Subject: [PATCH] opo维护

---
 src/views/business/affirm/affirmInfo.vue |  336 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 232 insertions(+), 104 deletions(-)

diff --git a/src/views/business/affirm/affirmInfo.vue b/src/views/business/affirm/affirmInfo.vue
index 2d9be0c..abd3036 100644
--- a/src/views/business/affirm/affirmInfo.vue
+++ b/src/views/business/affirm/affirmInfo.vue
@@ -1,59 +1,30 @@
 <template>
   <div class="confirmation-detail">
+    <case-basic-info :case-id="caseId" :show-attachment="true" />
+
     <el-card class="detail-card">
       <!-- 鍩虹淇℃伅 -->
       <div slot="header" class="clearfix">
-        <span class="detail-title">鎹愮尞纭鍩烘湰淇℃伅</span>
+        <span class="detail-title">鎹愮尞纭淇℃伅</span>
         <el-button
-          type="success"
-          style="float: right;"
+          type="primary"
+          style="float: right;margin-left: 20px;"
           @click="handleSave"
           :loading="saveLoading"
         >
           淇濆瓨纭淇℃伅
         </el-button>
+        <el-button
+          type="success"
+          style="float: right;margin-left: 20px;"
+          @click="accomplish"
+          :loading="saveLoading"
+        >
+          纭瀹屾垚
+        </el-button>
       </div>
 
       <el-form :model="form" ref="form" label-width="120px">
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="浣忛櫌鍙�" prop="caseNo">
-              <el-input v-model="form.caseNo" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎹愮尞鑰呭鍚�" prop="name">
-              <el-input v-model="form.name" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎬у埆" prop="sex">
-              <el-select v-model="form.sex" style="width: 100%">
-                <el-option label="鐢�" value="1" />
-                <el-option label="濂�" value="2" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="骞撮緞" prop="age">
-              <el-input v-model="form.age" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鐤剧梾璇婃柇" prop="diagnosisname">
-              <el-input v-model="form.diagnosisname" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎵�鍦ㄥ尰鐤楁満鏋�" prop="treatmenthospitalname">
-              <el-input v-model="form.treatmenthospitalname" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
         <el-row :gutter="20">
           <el-col :span="8">
             <el-form-item label="鍗忚皟鍛�1" prop="coordinatedusernameo">
@@ -91,7 +62,6 @@
               <el-date-picker
                 v-model="form.signdate"
                 type="datetime"
-                value-format="yyyy-MM-dd"
                 style="width: 100%"
               />
             </el-form-item>
@@ -125,9 +95,9 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="familyrelations">
+            <el-form-item label="涓庢崘璧犺�呭叧绯�" prop="signfamilyrelations">
               <el-select
-                v-model="form.familyrelations"
+                v-model="form.signfamilyrelations"
                 placeholder="璇烽�夋嫨涓庢崘璧犺�呭叧绯�"
               >
                 <el-option
@@ -156,7 +126,48 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row style="margin-bottom: 10px;">
+          <el-button
+            type="primary"
+            size="mini"
+            icon="el-icon-plus"
+            @click="openOtherFamilyDialog()"
+          >
+            娣诲姞鍏朵粬瀹跺睘
+          </el-button>
+        </el-row>
+        <el-table :data="otherFamilyList" size="small" border>
+          <el-table-column label="濮撳悕" prop="name" />
+          <el-table-column label="涓庢崘璧犺�呭叧绯�" prop="relation">
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.sys_FamilyRelation"
+                :value="scope.row.relation"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column label="鑱旂郴鐢佃瘽" prop="phone" />
 
+          <el-table-column label="鎿嶄綔" width="120" align="center">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                @click="editOtherFamily(scope.$index)"
+              >
+                缂栬緫
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                style="color:red"
+                @click="deleteOtherFamily(scope.$index)"
+              >
+                鍒犻櫎
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
         <el-row>
           <el-form-item label-width="100px" label="鎹愮尞鍐冲畾">
             <el-checkbox-group v-model="organdecision">
@@ -289,7 +300,38 @@
         </el-tab-pane>
       </el-tabs>
     </el-card>
+    <!-- 鍏朵粬瀹跺睘寮圭獥 -->
+    <el-dialog
+      :title="isEditOtherFamily ? '缂栬緫鍏朵粬瀹跺睘' : '娣诲姞鍏朵粬瀹跺睘'"
+      :visible.sync="otherFamilyDialogVisible"
+      width="400px"
+    >
+      <el-form :model="currentOtherFamily" label-width="100px">
+        <el-form-item label="濮撳悕" prop="name">
+          <el-input v-model="currentOtherFamily.name" />
+        </el-form-item>
 
+        <el-form-item label="鍏崇郴" prop="relation">
+          <el-select v-model="currentOtherFamily.relation" style="width:100%">
+            <el-option
+              v-for="dict in dict.type.sys_FamilyRelation"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="鐢佃瘽" prop="phone">
+          <el-input v-model="currentOtherFamily.phone" />
+        </el-form-item>
+      </el-form>
+
+      <span slot="footer">
+        <el-button @click="otherFamilyDialogVisible = false">鍙栨秷</el-button>
+        <el-button type="primary" @click="saveOtherFamily">纭畾</el-button>
+      </span>
+    </el-dialog>
     <!-- 涓婁紶瀵硅瘽妗� -->
     <el-dialog
       :title="`涓婁紶${getCurrentTypeLabel}闄勪欢`"
@@ -301,14 +343,15 @@
         ref="uploadRef"
         class="upload-demo"
         drag
-        action="#"
+        :action="uploadAction"
+        :headers="headers"
         multiple
         :file-list="tempFileList"
         :before-upload="beforeUpload"
         :on-change="handleFileChange"
         :on-remove="handleTempRemove"
+        :on-success="handleUploadSuccess"
         :auto-upload="false"
-        :http-request="handleHttpRequest"
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
@@ -341,17 +384,22 @@
 </template>
 
 <script>
-import { relativesList, relativesEdit } from "@/api/businessApi";
+import { relativesList, relativesEdit, relativesAdd } from "@/api/businessApi";
 import FilePreviewDialog from "@/components/FilePreviewDialog";
+import CaseBasicInfo from "@/components/CaseBasicInfo";
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "ConfirmationDetail",
   components: {
-    FilePreviewDialog
+    FilePreviewDialog,
+    CaseBasicInfo
   },
   dicts: ["sys_FamilyRelation"],
   data() {
     return {
+      caseId: null,
+
       // 鏄惁缂栬緫妯″紡
       isEdit: false,
       // 琛ㄥ崟鏁版嵁
@@ -370,30 +418,49 @@
         relativeconfirmationsign: "0",
         signdate: "",
         relativeconfirmationsignname: "",
-        familyrelations: "",
+        signfamilyrelations: "",
         relativeidcardno: "",
         relativephone: "",
         relativeRemark: "",
-        assessannex: "" // JSON瀛楃涓插瓨鍌ㄦ墍鏈夐檮浠�
+        assessannex: "", // JSON瀛楃涓插瓨鍌ㄦ墍鏈夐檮浠�
+        otherFamilyMembers: "" // 鉁� 鏂板
       },
+      uploadAction: process.env.VUE_APP_BASE_API + "/common/upload",
+      headers: {
+        Authorization: "Bearer " + getToken()
+      },
+      // 鍏朵粬瀹跺睘琛ㄦ牸鏁版嵁
+      otherFamilyList: [],
+
+      // 褰撳墠缂栬緫鐨勫叾浠栧灞烇紙寮圭獥鐢級
+      currentOtherFamily: {
+        name: "",
+        relation: "",
+        phone: ""
+      },
+
+      // 鏄惁缂栬緫妯″紡锛堝叾浠栧灞烇級
+      isEditOtherFamily: false,
+      editOtherFamilyIndex: -1,
+
+      // 鍏朵粬瀹跺睘寮圭獥
+      otherFamilyDialogVisible: false,
       organdecision: [],
       organdecisionOther: "",
       organselection: [
         "鑲濊剰",
-        "鍙岃偩",
-        "宸﹁偩",
-        "鍙宠偩",
+        "鑲捐剰",
         "蹇冭剰",
         "鑲鸿剰",
         "鑳拌吅",
         "灏忚偁",
-        "鍙岀溂缁勭粐",
-        "閬椾綋",
+        "鐪艰鑶�",
         "鍏朵粬"
       ],
       // 鍔犺浇鐘舵��
       loading: false,
       saveLoading: false,
+      infoid: null,
       // 闄勪欢鐩稿叧鏁版嵁
       activeAttachmentType: "1",
       attachmentLoading: false,
@@ -435,10 +502,11 @@
     }
   },
   created() {
-    const infoid = this.$route.query.infoid;
+    this.infoid = this.$route.query.infoid;
+    this.caseId = this.$route.query.infoid;
     this.isEdit = this.$route.query.confirm === "true";
-    if (infoid) {
-      this.getDetail(infoid);
+    if (this.infoid) {
+      this.getDetail(this.infoid);
     }
   },
   methods: {
@@ -479,7 +547,17 @@
       } else {
         detailData = response;
       }
-
+      // 澶勭悊鍏朵粬瀹跺睘鏁版嵁
+      if (detailData.otherFamilyMembers) {
+        try {
+          this.otherFamilyList =
+            typeof detailData.otherFamilyMembers === "string"
+              ? JSON.parse(detailData.otherFamilyMembers)
+              : detailData.otherFamilyMembers || [];
+        } catch (e) {
+          this.otherFamilyList = [];
+        }
+      }
       // 鏄犲皠瀛楁鍒拌〃鍗�
       this.form = {
         ...this.form,
@@ -498,7 +576,7 @@
         signdate: detailData.signdate,
         relativeconfirmationsignname:
           detailData.relativeconfirmationsignname || "",
-        familyrelations: detailData.familyrelations || "",
+        signfamilyrelations: detailData.signfamilyrelations || "",
         relativeidcardno: detailData.relativeidcardno || "",
         relativephone: detailData.relativephone || "",
         relativeRemark: detailData.relativeRemark || "",
@@ -511,6 +589,7 @@
           ? detailData.organdecision
           : detailData.organdecision.split(",");
       }
+      console.log(this.organdecision, "this.organdecision");
 
       // 澶勭悊闄勪欢鏁版嵁 - 浠巃ssessannex瀛楁瑙f瀽JSON骞舵寜绫诲瀷鍒嗙被
       this.processAssessannexData();
@@ -610,55 +689,40 @@
       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;
+      }
 
-        // 妯℃嫙涓婁紶杩囩▼
-        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: "褰撳墠鐢ㄦ埛"
-          };
+      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: "褰撳墠鐢ㄦ埛"
+      };
 
-          // 娣诲姞鍒板搴旂被鍨嬬殑闄勪欢鍒楄〃
-          if (this.attachmentData[this.currentUploadType]) {
-            this.attachmentData[this.currentUploadType].push(newAttachment);
-          }
+      this.attachmentData[this.currentUploadType].push(newAttachment);
+      this.updateAssessannexField();
 
-          this.uploadLoading = false;
-          this.updateAssessannexField(); // 鏇存柊瀛樺偍瀛楁
-          resolve({ code: 200, data: newAttachment });
-        }, 1500);
-      });
+      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(); // 鉁� 鍙皟鐢ㄤ竴娆�
     },
 
     // 鍒犻櫎闄勪欢
@@ -677,7 +741,51 @@
         })
         .catch(() => {});
     },
+    openOtherFamilyDialog(index) {
+      this.isEditOtherFamily = typeof index === "number";
+      this.editOtherFamilyIndex = index || -1;
 
+      this.currentOtherFamily = this.isEditOtherFamily
+        ? { ...this.otherFamilyList[index] }
+        : { name: "", relation: "", phone: "" };
+
+      this.otherFamilyDialogVisible = true;
+    },
+    editOtherFamily(index) {
+      this.openOtherFamilyDialog(index);
+    },
+    deleteOtherFamily(index) {
+      this.$confirm("纭鍒犻櫎璇ュ灞烇紵", "鎻愮ず", { type: "warning" }).then(
+        () => {
+          this.otherFamilyList.splice(index, 1);
+          this.updateOtherFamilyField();
+        }
+      );
+    },
+    saveOtherFamily() {
+      if (
+        !this.currentOtherFamily.name ||
+        !this.currentOtherFamily.relation ||
+        !this.currentOtherFamily.phone
+      ) {
+        this.$message.warning("璇峰~鍐欏畬鏁翠俊鎭�");
+        return;
+      }
+
+      if (this.isEditOtherFamily) {
+        this.otherFamilyList.splice(this.editOtherFamilyIndex, 1, {
+          ...this.currentOtherFamily
+        });
+      } else {
+        this.otherFamilyList.push({ ...this.currentOtherFamily });
+      }
+
+      this.updateOtherFamilyField();
+      this.otherFamilyDialogVisible = false;
+    },
+    updateOtherFamilyField() {
+      this.form.otherFamilyMembers = JSON.stringify(this.otherFamilyList);
+    },
     // 鏇存柊assessannex瀛樺偍瀛楁
     updateAssessannexField() {
       // 灏嗘墍鏈夌被鍨嬬殑闄勪欢鍚堝苟涓轰竴涓暟缁�
@@ -788,6 +896,19 @@
         .toString()
         .padStart(2, "0")}`;
     },
+    accomplish() {
+      this.$confirm("鏄惁瀹屾垚璇ユ渚嬫崘鐚‘璁ゆ楠わ紵", "鎻愰啋", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          this.form.state = 3;
+          this.handleSave();
+        })
+
+        .catch(() => {});
+    },
 
     // 淇濆瓨纭淇℃伅
     async handleSave() {
@@ -795,17 +916,24 @@
         await this.$refs.form.validate();
         this.saveLoading = true;
 
-        // 纭繚闄勪欢鏁版嵁鏄渶鏂扮殑
+        this.updateOtherFamilyField();
         this.updateAssessannexField();
-
         const saveData = {
           ...this.form,
+          infoid: this.infoid,
           organdecision: this.organdecision.join(","),
           organdecisionOther: this.organdecisionOther
           // assessannex瀛楁宸插湪updateAssessannexField涓洿鏂�
         };
-
-        const response = await relativesEdit(saveData);
+        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("淇濆瓨鎴愬姛");

--
Gitblit v1.9.3