From 26a983e0c22f1fe54c91c66c2b52888858e52cd1 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 31 七月 2025 17:57:28 +0800 Subject: [PATCH] qx --- src/views/doctor/checkAll/index.vue | 57 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue index 8235084..1d5cb4d 100644 --- a/src/views/doctor/checkAll/index.vue +++ b/src/views/doctor/checkAll/index.vue @@ -2010,7 +2010,6 @@ flags: false, jianqianwenzhendata: [], jianqians: false, - adviceLoading: false, sex: true, activeName: "1", hosproy: true, @@ -2067,7 +2066,7 @@ const end = new Date(); const start = new Date(); start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); - picker.$emit("pick", [start, end]); + picker.$adviceLoading("pick", [start, end]); }, }, { @@ -2543,14 +2542,26 @@ }, getConfigKey() { - getconfigKey("sfkqtwbg").then((res) => { + // 浣跨敤姝g‘鐨� getConfigKey 鍑芥暟锛堥渶瑕佸弬鏁帮級 + getConfigKey("sfkqtwbg").then((res) => { this.msgtuwen = res.msg; + }).catch((error) => { + console.warn("鑾峰彇閰嶇疆椤� sfkqtwbg 澶辫触:", error); + this.msgtuwen = ""; // 璁剧疆榛樿鍊� }); - getconfigKey("sfkqjqwz").then((res) => { + + getConfigKey("sfkqjqwz").then((res) => { this.msgjianqian = res.msg; + }).catch((error) => { + console.warn("鑾峰彇閰嶇疆椤� sfkqjqwz 澶辫触:", error); + this.msgjianqian = ""; // 璁剧疆榛樿鍊� }); - getconfigKey("kcf").then((res) => { + + getConfigKey("kcf").then((res) => { this.msgkcf = res.msg; + }).catch((error) => { + console.warn("鑾峰彇閰嶇疆椤� kcf 澶辫触:", error); + this.msgkcf = ""; // 璁剧疆榛樿鍊� }); }, @@ -2583,6 +2594,7 @@ yichangjieguo() { this.loading = true; + this.isLoading = true; this.status1 = 0; getConfigKey("kzycxmsfzk").then((res) => { this.shouldExpand = res.msg; @@ -2593,11 +2605,20 @@ this.expends = []; } }); - yichang({ - tjNum: this.tjNumber, - }) - .then((res) => { - this.yichangList = res.data; + return new Promise((resolve, reject) => { + yichang({ + tjNum: this.tjNumber, + }).then((res) => { + const data = res.data; + + if (!data || data.length === 0) { + this.$message.warning("鏆傛棤寮傚父鎶ュ憡"); + this.loading = false; + this.isLoading = false; // 鍏抽棴鏁翠綋鍔犺浇妗� + resolve(); // 杩斿洖 Promise锛屼絾涓嶇户缁悗缁�昏緫 + return; + } + this.yichangList = data; this.yichangList.forEach((item) => { item.sone.forEach((soneItem) => { if ( @@ -2611,24 +2632,32 @@ if (!this.yichangList) { this.$message.warning("鏆傛棤寮傚父鎶ュ憡"); } + resolve(); // 鎴愬姛瀹屾垚 // 杩欓噷涔熷彲浠ユ牴鎹畇houldExpand鍐嶈皟鐢ㄤ竴娆etExpends锛岀‘淇濇暟鎹凡鍔犺浇 if (this.shouldExpand === "Y" || this.shouldExpand === "y") { this.getExpends(); } else { this.expends = []; } - }) + }); + }) .catch((error) => { this.isLoading = false; + this.loading = false; console.error("鑾峰彇寮傚父缁撴灉澶辫触:", error); this.$message.error("鑾峰彇寮傚父缁撴灉澶辫触"); + reject(error); // 杩斿洖閿欒 }) .finally(() => { - this.isLoading = false; - this.loading = false; + // 鍙湪娌℃湁鎻愬墠杩斿洖鐨勬儏鍐典笅鍏抽棴鍔犺浇妗� + if (this.isLoading) { + this.isLoading = false; + } + if (this.loading) { + this.loading = false; + } }); }, - fuchaxiangmu() { this.loading = true; -- Gitblit v1.8.0