From c23f36651066083237e973298a9dfa011f107ce2 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Wed, 17 Apr 2024 22:43:26 +0800 Subject: [PATCH] doctor --- src/views/doctorCheck/doctorCheck.vue | 98 ++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 9 deletions(-) diff --git a/src/views/doctorCheck/doctorCheck.vue b/src/views/doctorCheck/doctorCheck.vue index 866eb6a..0e1f234 100644 --- a/src/views/doctorCheck/doctorCheck.vue +++ b/src/views/doctorCheck/doctorCheck.vue @@ -391,23 +391,103 @@ export default { return } - //更新明细 - this.updateCheckItemList(); + // //更新明细 + // this.updateCheckItemList(); - //更新检查项目与医生 - this.updateDoctorCheck(); + // //更新检查项目与医生 + // this.updateDoctorCheck(); - //更新小结 - this.saveCheckSummary(); + // //更新小结 + // this.saveCheckSummary(); + + // //更新建议 + // this.saveCheckSuggestion(true); + + // 合并成一个事务 + // { + // "registerCheckId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + // "checkDoctorId": "string", + // "checkDate": "2024-04-17T14:13:24.889Z", + // "registerCheckItems": [ + // { + // "itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + // "result": "string", + // "criticalValue": "string", + // "checkDoctorName": "string", + // "checkDate": "string" + // } + // ], + // "summarys": [ + // { + // "summary": "string", + // "summaryFlag": "string" + // } + // ], + // "suggestions": [ + // { + // "suggestion": "string" + // } + // ] + // } + let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date(); + checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD HH:mm:ss'); //yyyy-MM-DD HH:mm:ss + let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user"); + let registerCheckId = this.doctorCheck.RegisterCheckEdit.id + // 明细 + let registerCheckItems = [] + this.doctorCheck.checkItemList.forEach(e => { + registerCheckItems.push({ + itemId: e.itemId, + result: e.result, + checkDoctorName: checkDoctorId, + checkDate, + }) + }); + // 小结 + let summarys = [] + this.doctorCheck.checkSummaryList.forEach(item => { + summarys.push({ + summary: item.summary, + summaryFlag: item.summaryFlag, + }) + }); + // 建议 + let suggestions = [] + this.doctorCheck.checkSuggestionList.forEach(item => { + suggestions.push({ + suggestion: item.suggestion + }) + }); + + let body = { + registerCheckId, + checkDoctorId, + checkDate, + registerCheckItems, + summarys, + suggestions + } + + postapi('/api/app/registercheck/UpdateCheckResult', body) + .then(res => { + if (res.code > -1) { + this.doctorCheck.RegisterCheckEdit.completeFlag = '1'; + //更新组合项目列表记录状态 + let lfind = arrayExistObj(this.doctorCheck.RegisterCheckList, 'id', body.registerCheckId) + if (lfind > -1) this.doctorCheck.RegisterCheckList[lfind].completeFlag = '1' + + console.log('操作成功') + } else { + this.$message.error({ showClose: true, message: res.message }) + } + }) - //更新建议 - this.saveCheckSuggestion(true); }, //更新检查医生 updateDoctorCheck(successTip) { let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date(); - checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD'); //yyyy-MM-DD HH:mm:ss + checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD HH:mm:ss'); //yyyy-MM-DD HH:mm:ss let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user"); let body = {