lkk
3 天以前 761f4ac65d86778b6fcf21db3d6ff78610830a90
src/views/hosp/project/index.vue
@@ -1188,7 +1188,7 @@
  },
  created() {
    // this.getConsumables();
    // this.getDeptList();
    this.getDeptList();
    // this.getDeptTree().then(() => {
    //   this.precomputePinyin();
    // });
@@ -1351,15 +1351,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;
          // this.loading = false;
          this.projectOptions = [];
          const project = { proId: 0, proName: "主类目", children: [] };
          project.children = this.handleTree(response.data.list, "proId");
@@ -1840,6 +1841,9 @@
      // 等待右侧表格刷新
      await this.getList();
      // 立即刷新当前项目数据,确保数据是最新的
      await this.refreshCurrentProjectData();
      this.pageLoading = false; // ✅ 统一加载状态控制
    },
@@ -1852,6 +1856,23 @@
        });
      }
    }, */
    // 刷新当前选中项目的数据
    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;
    },
    submit() {
      this.ChangeList.forEach((item) => {
        this.form.proPrice = item.ckdj;
@@ -1861,6 +1882,10 @@
        this.sfxmId = parseInt(item.id);
      });
      this.dialogTableVisible = false;
      this.getDeptList();
      this.getDeptTree().then(() => {
        this.precomputePinyin();
      });
    },
    handleDelete(row) {
      const proIds = row.proId || this.ids;