| | |
| | | |
| | | yichangjieguo() { |
| | | this.loading = true; |
| | | this.isLoading = true; // 确保整体加载框开启 |
| | | this.status1 = 0; |
| | | this.yichangList = []; |
| | | |
| | |
| | | if (!data || data.length === 0) { |
| | | this.$message.warning("暂无异常报告"); |
| | | this.loading = false; |
| | | this.isLoading = false; // 关闭整体加载框 |
| | | resolve(); // 返回 Promise,但不继续后续逻辑 |
| | | return; |
| | | } |
| | |
| | | resolve(); // 成功完成 |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | this.loading = false; |
| | | console.error("获取异常结果失败:", error); |
| | | this.$message.error("获取异常结果失败"); |
| | | reject(error); // 返回错误 |
| | | }) |
| | | .finally(() => { |
| | | // 只在没有提前返回的情况下关闭加载框 |
| | | if (this.isLoading) { |
| | | this.isLoading = false; |
| | | } |
| | | if (this.loading) { |
| | | this.loading = false; |
| | | } |
| | |
| | | |
| | | handleClick(row) { |
| | | this.qingkong(); |
| | | this.isLoading = true; // 开始整体加载 |
| | | this.$refs.Pre.open = false; |
| | | this.tableAll = row; |
| | | let dict = "dict_tjtype"; |
| | |
| | | if (this.status.status === "1") { |
| | | // 先调用异常结果,等待其完成后再继续后续逻辑 |
| | | this.yichangjieguo().then(() => { |
| | | // 无论异常结果是否有数据,都继续后续逻辑 |
| | | // 如果异常结果为空,立即关闭加载框并打开抽屉 |
| | | if (!this.yichangList || this.yichangList.length === 0) { |
| | | this.isLoading = false; |
| | | this.drawer = true; |
| | | return; |
| | | } |
| | | |
| | | // 异常结果有数据,继续后续逻辑 |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | |
| | | }; |
| | | getModifiedState(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | // 只有当异常结果有数据时才开启加载框 |
| | | if (this.yichangList && this.yichangList.length > 0) { |
| | | this.isLoading = true; |
| | | } |
| | | this.drawer = true; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | |
| | | .then(() => { |
| | | // 先调用异常结果,等待其完成后再继续后续逻辑 |
| | | this.yichangjieguo().then(() => { |
| | | // 无论异常结果是否有数据,都继续后续逻辑 |
| | | // 如果异常结果为空,立即关闭加载框并打开抽屉 |
| | | if (!this.yichangList || this.yichangList.length === 0) { |
| | | this.isLoading = false; |
| | | this.drawer = true; |
| | | return; |
| | | } |
| | | |
| | | // 异常结果有数据,继续后续逻辑 |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | |
| | | }; |
| | | getforceIn(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | // 只有当异常结果有数据时才开启加载框 |
| | | if (this.yichangList && this.yichangList.length > 0) { |
| | | this.isLoading = true; |
| | | } |
| | | this.drawer = true; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.isLoading = false; // 取消时也要关闭加载框 |
| | | this.$message({ |
| | | type: "info", |
| | | message: "已取消进入", |