diff --git a/src/views/trials/trials-panel/reading/mim-medical-audit/components/ChatForm.vue b/src/views/trials/trials-panel/reading/mim-medical-audit/components/ChatForm.vue index f7b81faf..5ec149be 100644 --- a/src/views/trials/trials-panel/reading/mim-medical-audit/components/ChatForm.vue +++ b/src/views/trials/trials-panel/reading/mim-medical-audit/components/ChatForm.vue @@ -209,24 +209,28 @@ export default { }, methods: { // 初始化聊天信息 - getMessageList() { - this.loading = true - var param = { - taskMedicalReviewId: this.taskMedicalReviewId - } - getMedicalReviewDialog(param).then(res => { + async getMessageList() { + try { + this.loading = true + var param = { + taskMedicalReviewId: this.taskMedicalReviewId + } + let res = await getMedicalReviewDialog(param) this.otherInfo = res.OtherInfo this.recordContent = res.Result this.setScrollHeight() this.loading = false - }).catch(() => { + } catch(e) { + console.log(e) this.loading = false - }) + } }, setScrollHeight() { setTimeout(() => { var container = document.querySelectorAll('.chat-content')[0] - container.scrollTop = container.scrollHeight + if (container && container.scrollHeight) { + container.scrollTop = container.scrollHeight + } }, 100) }, // 回复质疑 diff --git a/src/views/trials/trials-panel/reading/mim-medical-audit/components/CloseQC.vue b/src/views/trials/trials-panel/reading/mim-medical-audit/components/CloseQC.vue index 1d271ea3..39696883 100644 --- a/src/views/trials/trials-panel/reading/mim-medical-audit/components/CloseQC.vue +++ b/src/views/trials/trials-panel/reading/mim-medical-audit/components/CloseQC.vue @@ -80,26 +80,32 @@ export default { handleClose() { this.$emit('close') }, - handleSave() { - this.$refs['closeQCForm'].validate((valid) => { - if (!valid) return - this.loading = true - this.form.TaskMedicalReviewId = this.taskMedicalReviewId - this.form.IsClosedDialog = true - closedMedicalReviewDialog(this.form) - .then(res => { - this.loading = false - if (res.IsSuccess) { - // 关闭成功! - this.$message.success(this.$t('trials:qcQuality:message:closedSuccessfully')) - this.$emit('close') - this.$emit('refresh') - } - }).catch(() => { - this.loading = false - }) - }) - } + async handleSave() { + let validate = await this.$refs['closeQCForm'].validate() + if (!validate) return + this.form.TaskMedicalReviewId = this.taskMedicalReviewId + this.form.IsClosedDialog = true + this.$emit('closeAndSign', this.form) + }, + // handleSave() { + // this.$refs['closeQCForm'].validate((valid) => { + // if (!valid) return + // this.loading = true + // this.form.TaskMedicalReviewId = this.taskMedicalReviewId + // this.form.IsClosedDialog = true + // closedMedicalReviewDialog(this.form) + // .then(res => { + // this.loading = false + // if (res.IsSuccess) { + // // 关闭成功! + // this.$message.success(this.$t('trials:qcQuality:message:closedSuccessfully')) + // this.$emit('refresh') + // } + // }).catch(() => { + // this.loading = false + // }) + // }) + // } } } diff --git a/src/views/trials/trials-panel/reading/mim-medical-audit/index.vue b/src/views/trials/trials-panel/reading/mim-medical-audit/index.vue index 621824f6..e708ecd3 100644 --- a/src/views/trials/trials-panel/reading/mim-medical-audit/index.vue +++ b/src/views/trials/trials-panel/reading/mim-medical-audit/index.vue @@ -553,8 +553,8 @@ > @@ -645,7 +645,8 @@ export default { signCode: null, currentUser: zzSessionStorage.getItem('userName'), signVisible: false, - timeList: [] + timeList: [], + closeObj: null } }, watch: { @@ -697,6 +698,12 @@ export default { this.TrialReadingCriterionId = this.trialCriterionList[0].TrialReadingCriterionId }).catch(() => {}) }, + closeAndSign(obj) { + this.closeObj = Object.assign({}, obj) + const { MedicalAudit } = const_.processSignature + this.signCode = MedicalAudit + this.signVisible = true + }, // 关闭签名框并设置确认状态 closeSignDialog(isSign, signInfo) { if (isSign) { @@ -706,38 +713,39 @@ export default { } }, // 签名确认 - signConfirm(signInfo) { - this.loading = true - const params = { - data: { - taskMedicalReviewId: this.currentRow.Id - }, - signInfo: signInfo - } - FinishMedicalReview(params).then(res => { + async signConfirm(signInfo) { + try { + this.loading = true + const params = { + data: { + taskMedicalReviewId: this.currentRow.Id, + isClosedDialog: this.closeObj.IsClosedDialog, + medicalDialogCloseEnum: this.closeObj.MedicalDialogCloseEnum, + dialogCloseReason: this.closeObj.DialogCloseReason, + }, + signInfo: signInfo + } + let res = await FinishMedicalReview(params) if (res.IsSuccess) { + await this.$refs['chatForm'].getMessageList() this.$message.success(this.$t('common:message:savedSuccessfully')) this.$refs['signForm'].btnLoading = false this.signVisible = false this.$nextTick(() => { + this.closeQuestionVisible = false this.chatForm.visible = false }) + await this.getList() + this.$emit('nextTask', this.taskMedicalReviewId) } this.loading = false - this.getList() - .then(() => { - this.loading = true - this.$emit('nextTask', this.taskMedicalReviewId) - }) - .catch(action => { - }) - }).catch(_ => { + } catch(e) { this.loading = false if (this.$refs['signForm']) { this.$refs['signForm'].btnLoading = false } - }) + } }, changeTimeList() { if (this.timeList) {