| | |
| | | }, |
| | | |
| | | determine() { |
| | | let tjNumber = this.tableAll.tjNumber; |
| | | let tjh = this.tableAll.tjNumber; |
| | | let advice = this.textarea1; |
| | | let data = { |
| | | checkAdvice: this.textarea1, |
| | | proIds: this.changedate.map(item => item.proId), |
| | | remarks: this.changedate.map(item => item.remark), |
| | | jgbxs: this.changedate.map(item => item.jgbx), |
| | | tjNumber: this.tjNumber, |
| | | tjNumber, |
| | | advice, |
| | | checkStatus: 1, |
| | | }; |
| | | |
| | | addOrder(data).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success('提交成功'); |
| | | this.drawer = false; |
| | | this.submitForm(); |
| | | } else { |
| | | this.$message.error('提交失败'); |
| | | } |
| | | }).catch((error) => { |
| | | console.error('提交失败:', error); |
| | | this.$message.error('提交失败'); |
| | | }); |
| | | console.log(this.yichangList, 6644); |
| | | |
| | | let dataList = this.yichangList |
| | | .map((item) => { |
| | | return item.sone.map((soneItem) => ({ |
| | | tjh, |
| | | parentName: item.proName, |
| | | jcxm: soneItem.proName, |
| | | map: soneItem.advices, |
| | | jyjc: item.jyjc, |
| | | jcjg: soneItem.proResult, |
| | | ckfw: soneItem.stanId, |
| | | dw: soneItem.proAdvice, |
| | | })); |
| | | }) |
| | | .flat(); // 使用 flat() 方法将嵌套数组展平 |
| | | |
| | | getTjdetailList(data) |
| | | .then((response) => { |
| | | if (response.code === 200) { |
| | | this.$modal.msgSuccess("提交成功"); |
| | | |
| | | // 准备生成报告的请求数据 |
| | | let reportData = { |
| | | userId: this.userId, |
| | | tjNumber: tjNumber, |
| | | state: 1, |
| | | id: this.MsgId, |
| | | }; |
| | | |
| | | // 调用 addOrderPromise |
| | | console.log(dataList, 5555); |
| | | |
| | | addOrder(dataList) |
| | | .then((res) => { |
| | | console.log(res, 999); |
| | | if (res.code == 200) { |
| | | gettoPdf(tjNumber) |
| | | .then((res) => { |
| | | this.$modal.msgSuccess( |
| | | "已生成报告!请前往报告核收页面确认!" |
| | | ); |
| | | }) |
| | | .catch(() => { |
| | | this.$modal.msgError( |
| | | "打印报告失败,请前往报告打印页面补打报告!" |
| | | ); |
| | | }); |
| | | const statePromise = getfiedState(reportData).then(() => { |
| | | this.drawer = false; |
| | | }); |
| | | const updatePromises = this.changedate.map((item) => { |
| | | this.proIds = item.parentId; |
| | | let remarks = item.remark; |
| | | let updateOrderRemarkVos = [ |
| | | { |
| | | tjNumber, |
| | | proId: this.proIds.toString(), |
| | | remarks, |
| | | }, |
| | | ]; |
| | | return getModified(updateOrderRemarkVos); // 返回 Promise |
| | | }); |
| | | |
| | | // 等待所有请求完成 |
| | | Promise.all([statePromise, ...updatePromises]) |
| | | .then(() => { |
| | | // 所有请求完成,关闭 loading |
| | | this.loading = false; |
| | | // 更新分页信息 |
| | | this.queryParams.page = 1; |
| | | this.queryParams.pageSize = 10; |
| | | this.submitForm(); |
| | | this.$forceUpdate(); |
| | | }) |
| | | .catch((error) => { |
| | | // 处理错误情况 |
| | | this.loading = false; |
| | | console.error("发生错误:", error); |
| | | }); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | // 如果 addOrderPromise 失败,处理错误 |
| | | this.loading = false; |
| | | console.error("addOrderPromise 失败:", error); |
| | | }); |
| | | } else { |
| | | // 提交失败,关闭 loading |
| | | this.loading = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | // 提交请求失败,关闭 loading |
| | | this.loading = false; |
| | | console.error("提交请求失败:", error); |
| | | }); |
| | | }, |
| | | |
| | | getRevoke(row) { |