| | |
| | | this.formobj = {}; |
| | | }, |
| | | |
| | | handleClick(row) { |
| | | /* handleClick(row) { |
| | | this.qingkong(); |
| | | this.$refs.Pre.open = false; |
| | | this.tableAll = row; |
| | |
| | | // 没有强制进入弹框,直接开启加载和弹框 |
| | | this.isLoading = true; |
| | | this.drawer = true; |
| | | // 先调用异常结果,等待其完成后再继续后续逻辑 |
| | | this.yichangjieguo().then(() => { |
| | | // 如果异常结果为空,左边数据加载完成后就关闭加载框 |
| | | if (!this.yichangList || this.yichangList.length === 0) { |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getModifiedState(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | | this.changedate = response.data; |
| | | if (this.changedate) { |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | this.initialTotalCheckAdvice = this.textarea1; |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | // 异常结果有数据,等待左右两边都加载完成 |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getModifiedState(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | | this.changedate = response.data; |
| | | if (this.changedate) { |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | this.initialTotalCheckAdvice = this.textarea1; |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | // 直接在handleClick中实现并行加载 |
| | | this.loadDataInHandleClick(); |
| | | } else { |
| | | this.$confirm( |
| | | "" + this.status.name + "正在修改该信息, 是否强制进去?", |
| | |
| | | // 用户确认强制进入,开启加载和弹框 |
| | | this.isLoading = true; |
| | | this.drawer = true; |
| | | // 先调用异常结果,等待其完成后再继续后续逻辑 |
| | | this.yichangjieguo().then(() => { |
| | | // 如果异常结果为空,左边数据加载完成后就关闭加载框 |
| | | if (!this.yichangList || this.yichangList.length === 0) { |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getforceIn(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | | this.changedate = response.data; |
| | | if (this.changedate) { |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | // 异常结果有数据,等待左右两边都加载完成 |
| | | getInfo().then((response) => { |
| | | this.userId = response.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getforceIn(data).then((res) => { |
| | | this.MsgId = res.msg; |
| | | getupdateCheckType(this.tjNumber).then((response) => { |
| | | this.isLoading = false; // 关闭加载框 |
| | | this.changedate = response.data; |
| | | if (this.changedate) { |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | // 直接在handleClick中实现并行加载(强制进入模式) |
| | | this.loadDataInHandleClick(true); |
| | | }) |
| | | .catch(() => { |
| | | this.isLoading = false; // 取消时也要关闭加载框 |
| | |
| | | } |
| | | } |
| | | }); |
| | | }, */ |
| | | |
| | | handleClick(row) { |
| | | this.qingkong(); |
| | | this.$refs.Pre.open = false; |
| | | this.tableAll = row; |
| | | let dict = "dict_tjtype"; |
| | | getDicts(dict).then((res) => { |
| | | if (res.code == 200) { |
| | | res.data.forEach((item) => { |
| | | if (this.tableAll.tjCategory == item.dictValue) { |
| | | this.tableAll.tjCategory = item.dictLabel; |
| | | } |
| | | }); |
| | | } else { |
| | | throw new Error("获取体检类型字典失败"); |
| | | } |
| | | }); |
| | | this.tjproject = "0"; |
| | | this.tjNumber = this.tableAll.tjNumber; |
| | | |
| | | getState(this.tjNumber).then((res) => { |
| | | this.status = res.data; |
| | | if (this.status) { |
| | | if (this.status.status === "1") { |
| | | // 开启加载和弹框 |
| | | this.isLoading = true; |
| | | this.drawer = true; |
| | | |
| | | // 并行执行异常结果、用户信息获取和体检项目数据获取 |
| | | Promise.all([ |
| | | this.yichangjieguo(), |
| | | getInfo(), |
| | | getupdateCheckType(this.tjNumber), |
| | | ]) |
| | | .then(([yichangResult, userInfo, checkTypeResult]) => { |
| | | this.userId = userInfo.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getModifiedState(data) |
| | | .then((res) => { |
| | | this.MsgId = res.msg; |
| | | // 所有数据都已加载完成,关闭loading |
| | | this.isLoading = false; |
| | | |
| | | this.changedate = checkTypeResult.data; |
| | | if (this.changedate) { |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | this.initialTotalCheckAdvice = this.textarea1; |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | console.error("修改状态失败:", error); |
| | | this.$message.error("修改状态失败"); |
| | | }); |
| | | } else { |
| | | this.isLoading = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | console.error("并行加载数据失败:", error); |
| | | this.$message.error("加载数据失败,请重试"); |
| | | }); |
| | | } else { |
| | | this.$confirm( |
| | | "" + this.status.name + "正在修改该信息, 是否强制进去?", |
| | | "提示", |
| | | { |
| | | confirmButtonText: "是", |
| | | cancelButtonText: "否", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // 开启加载和弹框 |
| | | this.isLoading = true; |
| | | this.drawer = true; |
| | | |
| | | // 并行执行异常结果、用户信息获取和体检项目数据获取 |
| | | Promise.all([ |
| | | this.yichangjieguo(), |
| | | getInfo(), |
| | | getupdateCheckType(this.tjNumber), |
| | | ]) |
| | | .then(([yichangResult, userInfo, checkTypeResult]) => { |
| | | this.userId = userInfo.user.userId; |
| | | if (this.userId) { |
| | | let data = { |
| | | userId: this.userId, |
| | | tjNumber: this.tjNumber, |
| | | state: 0, |
| | | }; |
| | | getforceIn(data) |
| | | .then((res) => { |
| | | this.MsgId = res.msg; |
| | | // 所有数据都已加载完成,关闭loading |
| | | this.isLoading = false; |
| | | |
| | | this.changedate = checkTypeResult.data; |
| | | if (this.changedate) { |
| | | for (let i = 0; i < this.changedate.length; i++) { |
| | | this.remark = this.changedate[i].remark; |
| | | } |
| | | this.initialState = JSON.parse( |
| | | JSON.stringify(this.changedate) |
| | | ); |
| | | this.changedate.forEach((item) => { |
| | | this.textarea1 = item.checkAdvice || ""; |
| | | }); |
| | | // 回显 zhiyeJl 和 zhiyeJg |
| | | this.zhiyeJl = this.changedate[0].zhiyejl || ""; |
| | | this.zhiyeJg = |
| | | this.changedate[0].zhiyejg || "未发现目标性疾病"; |
| | | } else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "该客户没有体检项目数据", |
| | | }); |
| | | // 如果没有数据,清空字段 |
| | | this.zhiyeJl = ""; |
| | | this.zhiyeJg = "未发现目标性疾病"; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | console.error("强制进入失败:", error); |
| | | this.$message.error("强制进入失败"); |
| | | }); |
| | | } else { |
| | | this.isLoading = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | console.error("并行加载数据失败:", error); |
| | | this.$message.error("加载数据失败,请重试"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "已取消进入", |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | handleClose(done) { |