From c12ce4c405d92c0bf11e876468108d1edb134ff2 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期四, 31 七月 2025 17:55:10 +0800
Subject: [PATCH] 1

---
 src/views/hosp/project/index.vue |   43 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue
index 863591b..3a457bc 100644
--- a/src/views/hosp/project/index.vue
+++ b/src/views/hosp/project/index.vue
@@ -1193,7 +1193,7 @@
   },
   created() {
     // this.getConsumables();
-    // this.getDeptList();
+    this.getDeptList();
     // this.getDeptTree().then(() => {
     //   this.precomputePinyin();
     // });
@@ -1383,12 +1383,16 @@
       this.form.hisXmbm = "";
       this.form.hisXmmc = "";
       this.form.hisdj = "";
-      this.loading = true;
+      // this.loading = true;
       this.proParent = false;
       this.form.proPrice = 0.0;
       this.form.proName = "";
       this.form.proId = null;
       this.form.resultType = "1";
+      
+      // 鍏堣幏鍙栫瀹ゅ垪琛ㄦ暟鎹�
+      this.getDeptList();
+      
       getlist().then((response) => {
         if (response.code == 200) {
           this.loading = false;
@@ -1543,10 +1547,10 @@
     getDeptList() {
       listDept(this.queryParams).then((response) => {
         this.parentNameList = response.data;
-        this.deptList = this.handleTree(response.data, "proId");
+        this.deptList = this.handleTree(response.data, "deptId");
       });
     },
-    getDeptTree() {
+    /* getDeptTree() {
       this.loadings = true;
       return deptTree111()
         .then((response) => {
@@ -1564,7 +1568,7 @@
         .finally(() => {
           this.loadings = false; // 鏃犺鎴愬姛鎴栧け璐ワ紝缁撴潫鍔犺浇
         });
-    },
+    }, */
     handleNodeClick(date) {
       this.treeDate = date;
       this.xiugaiList = {};
@@ -1810,6 +1814,32 @@
         });
       });
     },
+    // 鍒锋柊褰撳墠閫変腑椤圭洰鐨勬暟鎹�
+    async refreshCurrentProjectData() {
+      if (this.id) {
+        try {
+          const response = await getInfoByProId(this.id);
+          this.xiugaiList = response.data;
+          console.log("鍒锋柊椤圭洰鏁版嵁鎴愬姛:", this.xiugaiList);
+          return response.data;
+        } catch (error) {
+          console.error("鍒锋柊椤圭洰鏁版嵁澶辫触:", error);
+          this.$message.error("鍒锋柊椤圭洰鏁版嵁澶辫触");
+          this.xiugaiList = null; // 鍒锋柊澶辫触鏃堕噸缃负 null
+          return null;
+        }
+      }
+      return null;
+    },
+    // 璋冭瘯鏂规硶锛氭鏌ュ綋鍓嶆暟鎹姸鎬�
+    debugDataState() {
+      console.log("=== 鏁版嵁鐘舵�佽皟璇� ===");
+      console.log("褰撳墠ID:", this.id);
+      console.log("xiugaiList:", this.xiugaiList);
+      console.log("form:", this.form);
+      console.log("treeDate:", this.treeDate);
+      console.log("==================");
+    },
     getSelectValue(val) {
       this.form.consumablesList.forEach((formitem) => {
         if (formitem.makings === val) {
@@ -1912,6 +1942,9 @@
 
       // 绛夊緟鍙充晶琛ㄦ牸鍒锋柊
       await this.getList();
+      
+      // 绔嬪嵆鍒锋柊褰撳墠椤圭洰鏁版嵁锛岀‘淇濇暟鎹槸鏈�鏂扮殑
+      await this.refreshCurrentProjectData();
 
       this.pageLoading = false; // 鉁� 缁熶竴鍔犺浇鐘舵�佹帶鍒�
     },

--
Gitblit v1.8.0