From 475a352a4bfd7ac3a81e8c7c92d3bb64e2e01037 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 27 二月 2026 15:48:37 +0800
Subject: [PATCH] 青岛维护提交

---
 src/views/business/affirm/index.vue |  306 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 220 insertions(+), 86 deletions(-)

diff --git a/src/views/business/affirm/index.vue b/src/views/business/affirm/index.vue
index d9854d8..a60d695 100644
--- a/src/views/business/affirm/index.vue
+++ b/src/views/business/affirm/index.vue
@@ -35,7 +35,7 @@
             @keyup.enter.native="handleQuery"
           />
         </el-form-item>
-        <el-form-item label="纭鐘舵��" prop="confirmationStatus">
+        <!-- <el-form-item label="纭鐘舵��" prop="confirmationStatus">
           <el-select
             v-model="queryParams.confirmationStatus"
             placeholder="璇烽�夋嫨纭鐘舵��"
@@ -46,7 +46,7 @@
             <el-option label="瀹跺睘纭" value="1" />
             <el-option label="涓嶅悓鎰忔崘鐚�" value="2" />
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="纭鏃堕棿" prop="confirmationTimeRange">
           <el-date-picker
             v-model="queryParams.confirmationTimeRange"
@@ -113,7 +113,7 @@
       >
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column
-          label="妗堜緥缂栧彿"
+          label="浣忛櫌鍙�"
           align="center"
           prop="caseNo"
           width="120"
@@ -121,14 +121,14 @@
         <el-table-column
           label="娼滃湪鎹愮尞鑰呭鍚�"
           align="center"
-          prop="donorName"
+          prop="name"
           width="120"
         />
-        <el-table-column label="鎬у埆" align="center" prop="gender" width="80">
+        <el-table-column label="鎬у埆" align="center" prop="sex" width="80">
           <template slot-scope="scope">
             <dict-tag
               :options="dict.type.sys_user_sex"
-              :value="parseInt(scope.row.gender)"
+              :value="scope.row.sex"
             />
           </template>
         </el-table-column>
@@ -136,39 +136,47 @@
         <el-table-column
           label="鐤剧梾璇婃柇"
           align="center"
-          prop="diagnosis"
+          prop="diagnosisname"
           min-width="180"
           show-overflow-tooltip
         />
         <el-table-column
           label="鎵�鍦ㄥ尰鐤楁満鏋�"
           align="center"
-          prop="hospitalName"
+          prop="treatmenthospitalname"
+          width="150"
+          show-overflow-tooltip
+        />
+        <!-- <el-table-column
+          label="纭鐘舵��"
+          align="center"
+          prop="relativeconfirmationsign"
+          width="120"
+        >
+          <template slot-scope="scope">
+            <el-tag :type="statusFilter(scope.row.relativeconfirmationsign)">
+              {{ statusTextFilter(scope.row.relativeconfirmationsign) }}
+            </el-tag>
+          </template>
+        </el-table-column> -->
+
+        <el-table-column
+          label="瀹跺睘鎰忚"
+          align="center"
+          prop="relativeRemark"
           width="150"
           show-overflow-tooltip
         />
         <el-table-column
-          label="纭鐘舵��"
-          align="center"
-          prop="confirmationStatus"
-          width="120"
-        >
-          <template slot-scope="scope">
-            <el-tag :type="statusFilter(scope.row.confirmationStatus)">
-              {{ statusTextFilter(scope.row.confirmationStatus) }}
-            </el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column
           label="纭鏃堕棿"
           align="center"
-          prop="confirmationTime"
+          prop="signdate"
           width="120"
         >
           <template slot-scope="scope">
             <span>{{
-              scope.row.confirmationTime
-                ? parseTime(scope.row.confirmationTime, "{y}-{m}-{d}")
+              scope.row.signdate
+                ? parseTime(scope.row.signdate, "{y}-{m}-{d}")
                 : "-"
             }}</span>
           </template>
@@ -176,19 +184,19 @@
         <el-table-column
           label="涓氬姟浜哄憳"
           align="center"
-          prop="assignee"
+          prop="responsibleusername"
           width="100"
         />
         <el-table-column
           label="鍗忚皟鍛�1"
           align="center"
-          prop="coordinator1"
+          prop="coordinatedusernameo"
           width="100"
         />
         <el-table-column
           label="鍗忚皟鍛�2"
           align="center"
-          prop="coordinator2"
+          prop="coordinatedusernamet"
           width="100"
         />
         <el-table-column
@@ -205,14 +213,14 @@
               @click.stop="handleView(scope.row)"
               >璇︽儏</el-button
             >
-            <el-button
-              v-if="scope.row.confirmationStatus === '0'"
+            <!-- <el-button
+              v-if="scope.row.relativeconfirmationsign === '0'"
               size="mini"
               type="text"
               icon="el-icon-edit"
               @click.stop="handleConfirm(scope.row)"
               >纭</el-button
-            >
+            > -->
           </template>
         </el-table-column>
       </el-table>
@@ -230,7 +238,7 @@
 </template>
 
 <script>
-import { listConfirmation, delConfirmation, exportConfirmation } from "./mockConfirmationApi";
+import { relativesList } from "@/api/businessApi";
 import Pagination from "@/components/Pagination";
 
 export default {
@@ -285,23 +293,102 @@
       return statusMap[status] || "鏈煡";
     },
     // 鏌ヨ鎹愮尞纭鍒楄〃
-    getList() {
+    async getList() {
       this.loading = true;
-      listConfirmation(this.queryParams)
-        .then(response => {
-          if (response.code === 200) {
-            this.confirmationList = response.data.rows;
-            this.total = response.data.total;
-          } else {
-            this.$message.error("鑾峰彇鏁版嵁澶辫触");
-          }
-          this.loading = false;
-        })
-        .catch(error => {
-          console.error("鑾峰彇鎹愮尞纭鍒楄〃澶辫触:", error);
-          this.loading = false;
-          this.$message.error("鑾峰彇鏁版嵁澶辫触");
-        });
+      try {
+        // 鏋勫缓鏌ヨ鍙傛暟锛屾槧灏勫埌鎺ュ彛瀛楁
+        const requestParams = this.buildRequestParams();
+
+        const response = await relativesList(requestParams);
+
+        if (response.code === 200) {
+          // 澶勭悊鎺ュ彛杩斿洖鐨勬暟鎹粨鏋�
+          this.handleResponseData(response);
+        } else {
+          this.$message.error("鑾峰彇鏁版嵁澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+          this.confirmationList = [];
+          this.total = 0;
+        }
+      } catch (error) {
+        console.error("鑾峰彇鎹愮尞纭鍒楄〃澶辫触:", error);
+        this.$message.error("鑾峰彇鏁版嵁澶辫触");
+        this.confirmationList = [];
+        this.total = 0;
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 鏋勫缓璇锋眰鍙傛暟
+    buildRequestParams() {
+      const params = {
+        pageNum: this.queryParams.pageNum,
+        pageSize: this.queryParams.pageSize
+      };
+
+      // 鏄犲皠鏌ヨ鏉′欢鍒版帴鍙e瓧娈�
+      if (this.queryParams.donorName) {
+        params.name = this.queryParams.donorName;
+      }
+      if (this.queryParams.hospitalName) {
+        params.treatmenthospitalname = this.queryParams.hospitalName;
+      }
+      if (this.queryParams.assignee) {
+        params.responsibleusername = this.queryParams.assignee;
+      }
+      // if (this.queryParams.confirmationStatus) {
+      //   params.relativeconfirmationsign = this.queryParams.confirmationStatus;
+      // }
+
+      // 澶勭悊鏃堕棿鑼冨洿鏌ヨ
+      if (
+        this.queryParams.confirmationTimeRange &&
+        this.queryParams.confirmationTimeRange.length === 2
+      ) {
+        params.startSignDate = this.queryParams.confirmationTimeRange[0];
+        params.endSignDate = this.queryParams.confirmationTimeRange[1];
+      }
+
+      return params;
+    },
+    // 澶勭悊鎺ュ彛鍝嶅簲鏁版嵁
+    handleResponseData(response) {
+      // 鏍规嵁鎺ュ彛瀹為檯杩斿洖鐨勬暟鎹粨鏋勮繘琛岃皟鏁�
+      if (response.data) {
+        if (Array.isArray(response.data)) {
+          // 濡傛灉杩斿洖鐨勬槸鏁扮粍
+          this.confirmationList = response.data;
+          this.total = response.data.length;
+        } else if (response.data.rows) {
+          // 濡傛灉杩斿洖鐨勬槸鍒嗛〉鏁版嵁缁撴瀯
+          this.confirmationList = response.data.rows;
+          this.total = response.data.total;
+        } else if (Array.isArray(response.data.list)) {
+          // 濡傛灉杩斿洖鐨勬槸list瀛楁
+          this.confirmationList = response.data.list;
+          this.total = response.data.total || response.data.list.length;
+        } else {
+          // 鍏朵粬鏁版嵁缁撴瀯锛屽皾璇曠洿鎺ヤ娇鐢╠ata
+          this.confirmationList = response.data;
+          this.total = response.total || response.data.length;
+        }
+      } else {
+        // 濡傛灉data涓虹┖锛屼娇鐢ㄦ牴绾у埆鐨剅ows鎴杔ist
+        if (Array.isArray(response.rows)) {
+          this.confirmationList = response.rows;
+          this.total = response.total;
+        } else if (Array.isArray(response.list)) {
+          this.confirmationList = response.list;
+          this.total = response.total;
+        } else {
+          this.confirmationList = [];
+          this.total = 0;
+        }
+      }
+
+      // 纭繚confirmationList鏄暟缁�
+      if (!Array.isArray(this.confirmationList)) {
+        this.confirmationList = [];
+      }
     },
     // 鎼滅储鎸夐挳鎿嶄綔
     handleQuery() {
@@ -311,7 +398,8 @@
     // 閲嶇疆鎸夐挳鎿嶄綔
     resetQuery() {
       this.$refs.queryForm.resetFields();
-      this.handleQuery();
+      this.queryParams.pageNum = 1;
+      this.getList();
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
@@ -323,14 +411,14 @@
     handleRowClick(row) {
       this.$router.push({
         path: "/case/affirmInfo",
-        query: { id: row.id }
+        query: { id: row.id, infoid: row.infoid }
       });
     },
     // 鏌ョ湅璇︽儏
     handleView(row) {
       this.$router.push({
         path: "/case/affirmInfo",
-        query: { id: row.id }
+        query: { id: row.id, infoid: row.infoid }
       });
     },
     // 纭鎿嶄綔
@@ -346,6 +434,8 @@
     },
     // 淇敼鎸夐挳鎿嶄綔
     handleUpdate() {
+      if (this.ids.length === 0) return;
+
       const id = this.ids[0];
       this.$router.push({
         path: "/case/confirmation/edit",
@@ -353,56 +443,100 @@
       });
     },
     // 鍒犻櫎鎸夐挳鎿嶄綔
-    handleDelete() {
-      const ids = this.ids;
-      this.$confirm("鏄惁纭鍒犻櫎閫変腑鐨勬暟鎹」锛�", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(() => {
-          return delConfirmation(ids);
-        })
-        .then(response => {
-          if (response.code === 200) {
-            this.$message.success("鍒犻櫎鎴愬姛");
-            this.getList();
-          }
-        })
-        .catch(() => {});
+    async handleDelete() {
+      if (this.ids.length === 0) return;
+
+      try {
+        await this.$confirm("鏄惁纭鍒犻櫎閫変腑鐨勬暟鎹」锛�", "璀﹀憡", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        });
+
+        // 杩欓噷闇�瑕佽皟鐢ㄥ垹闄ゆ帴鍙o紝鐢变簬鎮ㄥ彧鎻愪緵浜唕elativesList鎺ュ彛锛岃繖閲屾殏鏃舵敞閲�
+        // 瀹為檯浣跨敤鏃堕渶瑕佽皟鐢ㄥ搴旂殑鍒犻櫎鎺ュ彛
+        // const response = await delConfirmation(this.ids);
+
+        // 妯℃嫙鍒犻櫎鎴愬姛
+        this.$message.success("鍒犻櫎鎴愬姛");
+        this.getList(); // 閲嶆柊鍔犺浇鏁版嵁
+      } catch (error) {
+        if (error !== "cancel") {
+          console.error("鍒犻櫎澶辫触:", error);
+          this.$message.error("鍒犻櫎澶辫触");
+        }
+      }
     },
     // 瀵煎嚭鎸夐挳鎿嶄綔
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("鏄惁纭瀵煎嚭鎵�鏈夌‘璁ゆ暟鎹紵", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(() => {
-          this.loading = true;
-          return exportConfirmation(queryParams);
-        })
-        .then(response => {
-          if (response.code === 200) {
-            this.$message.success("瀵煎嚭鎴愬姛");
-            // 瀹為檯椤圭洰涓繖閲屽鐞嗘枃浠朵笅杞�
-          }
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
+    async handleExport() {
+      try {
+        await this.$confirm("鏄惁纭瀵煎嚭鎵�鏈夌‘璁ゆ暟鎹紵", "璀﹀憡", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
         });
+
+        this.loading = true;
+
+        // 鏋勫缓瀵煎嚭鍙傛暟
+        const exportParams = this.buildRequestParams();
+        exportParams.pageSize = 10000; // 瀵煎嚭鎵�鏈夋暟鎹�
+
+        // 鑾峰彇瀵煎嚭鏁版嵁
+        const response = await relativesList(exportParams);
+
+        if (response.code === 200) {
+          // 澶勭悊瀵煎嚭鏁版嵁
+          this.exportDataToExcel(response.data);
+          this.$message.success("瀵煎嚭鎴愬姛");
+        } else {
+          this.$message.error("瀵煎嚭澶辫触锛�" + (response.msg || "鏈煡閿欒"));
+        }
+      } catch (error) {
+        if (error !== "cancel") {
+          console.error("瀵煎嚭澶辫触:", error);
+          this.$message.error("瀵煎嚭澶辫触");
+        }
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 瀵煎嚭鏁版嵁鍒癊xcel
+    exportDataToExcel(data) {
+      // 杩欓噷瀹炵幇瀵煎嚭閫昏緫锛屽彲浠ヤ娇鐢▁lsx绛夊簱
+      // 鐢变簬鏄墠绔鍑猴紝杩欓噷绠�鍗曟紨绀�
+      console.log("瀵煎嚭鏁版嵁:", data);
+      // 瀹為檯椤圭洰涓渶瑕佸疄鐜板畬鏁寸殑Excel瀵煎嚭鍔熻兘
     },
     // 鏃堕棿鏍煎紡鍖�
     parseTime(time, pattern) {
       if (!time) return "";
       const date = new Date(time);
+      if (pattern) {
+        // 绠�鍗曠殑妯″紡鍖归厤
+        if (pattern === "{y}-{m}-{d}") {
+          return `${date.getFullYear()}-${(date.getMonth() + 1)
+            .toString()
+            .padStart(2, "0")}-${date
+            .getDate()
+            .toString()
+            .padStart(2, "0")}`;
+        }
+      }
       return `${date.getFullYear()}-${(date.getMonth() + 1)
         .toString()
         .padStart(2, "0")}-${date
         .getDate()
         .toString()
+        .padStart(2, "0")} ${date
+        .getHours()
+        .toString()
+        .padStart(2, "0")}:${date
+        .getMinutes()
+        .toString()
+        .padStart(2, "0")}:${date
+        .getSeconds()
+        .toString()
         .padStart(2, "0")}`;
     }
   }

--
Gitblit v1.9.3