diff --git a/src/views/trials/trials-panel/reading/ad-review/index.vue b/src/views/trials/trials-panel/reading/ad-review/index.vue index 0d44bab1..593bef07 100644 --- a/src/views/trials/trials-panel/reading/ad-review/index.vue +++ b/src/views/trials/trials-panel/reading/ad-review/index.vue @@ -424,48 +424,58 @@ export default { } }, methods: { - getAdInfo() { + async getAdInfo() { this.loading = true - getJudgeReadingInfo({ visitTaskId: this.visitTaskId }).then(res => { - var judgeQS = [] - if (res.Result.VisitInfoList.length > 0) { - res.Result.VisitInfoList[0].VisitTaskInfoList.map((v, index) => { - var qsObj = { armEnum: v.ArmEnum, judgeQuestionList: [], index: index } - v.JudgeQuestionList.map(q => { - if (q.QuestionType === 1) { - qsObj.judgeQuestionList.push(q.QuestionName) - } else if (q.QuestionType === 3 && this.criterionType === 10) { - qsObj.judgeQuestionList.push(this.$t('trials:globalReview:table:visitRemark')) - } else { - qsObj.judgeQuestionList.push(this.$fd('JudgeReadingQuestionType', q.QuestionType)) - } + try { + const res = await getJudgeReadingInfo({ visitTaskId: this.visitTaskId }) + if (res.IsSuccess) { + var judgeQS = [] + if (res.Result.VisitInfoList.length > 0) { + res.Result.VisitInfoList[0].VisitTaskInfoList.map((v, index) => { + var qsObj = { armEnum: v.ArmEnum, judgeQuestionList: [], index: index } + v.JudgeQuestionList.map(q => { + if (q.QuestionType === 1) { + qsObj.judgeQuestionList.push(q.QuestionName) + } else if (q.QuestionType === 3 && this.criterionType === 10) { + qsObj.judgeQuestionList.push(this.$t('trials:globalReview:table:visitRemark')) + } else { + qsObj.judgeQuestionList.push(this.$fd('JudgeReadingQuestionType', q.QuestionType)) + } + }) + judgeQS.push(qsObj) }) - judgeQS.push(qsObj) - }) - } - this.judgeQuestion = judgeQS - this.isFixed = this.judgeQuestion.length > 0 && this.judgeQuestion[0].judgeQuestionList.length > 4 - this.adInfo = res.Result - this.adForm.judgeResultTaskId = res.Result.JudgeResultTaskId + } + this.judgeQuestion = judgeQS + this.isFixed = this.judgeQuestion.length > 0 && this.judgeQuestion[0].judgeQuestionList.length > 4 + this.adInfo = res.Result + this.adForm.judgeResultTaskId = res.Result.JudgeResultTaskId - this.adForm.judgeResultRemark = res.Result.JudgeResultRemark - this.fileList = [] - if (res.Result.JudgeResultImagePathList) { - res.Result.JudgeResultImagePathList.map(url => { - if (url) { this.fileList.push({ name: '', url: url }) } - }) - this.adForm.judgeResultImagePathList = res.Result.JudgeResultImagePathList + this.adForm.judgeResultRemark = res.Result.JudgeResultRemark + this.fileList = [] + if (res.Result.JudgeResultImagePathList) { + res.Result.JudgeResultImagePathList.map(url => { + if (url) { this.fileList.push({ name: '', url: url }) } + }) + this.adForm.judgeResultImagePathList = res.Result.JudgeResultImagePathList + } + this.visitTaskArmList = res.Result.VisitTaskArmList } - this.visitTaskArmList = res.Result.VisitTaskArmList this.loading = false - }).catch(() => { this.loading = false }) + } catch (e) { + this.loading = false + } }, - getPriorAdList() { + async getPriorAdList() { this.priorLoading = true - getReadingPastResultList({ visitTaskId: this.visitTaskId }).then(res => { - this.priorADList = res.Result + try { + const res = await getReadingPastResultList({ visitTaskId: this.visitTaskId }) + if (res.IsSuccess) { + this.priorADList = res.Result + } this.priorLoading = false - }).catch(() => { this.priorLoading = false }) + } catch (e) { + this.priorLoading = false + } }, handleVisitTaskArmChange(v) { var i = this.visitTaskArmList.findIndex(i => i.VisitTaskId === v) @@ -491,33 +501,32 @@ export default { }) window.open(routeData.href, '_blank') }, - handleSave() { - this.$refs['adForm'].validate((valid) => { - if (!valid) return - this.loading = true - var paths = [] - this.fileList.map(file => { - if (file.url) { - paths.push(file.url) - } - }) - this.adForm.judgeResultImagePathList = paths - this.adForm.visitTaskId = this.visitTaskId - saveJudgeVisitTaskResult(this.adForm).then(res => { - this.$message.success(this.$t('common:message:savedSuccessfully')) - this.loading = false - }).catch(() => { - this.loading = false - }) + async handleSave() { + const valid = await this.$refs['adForm'].validate() + if (!valid) return + this.loading = true + var paths = [] + this.fileList.map(file => { + if (file.url) { + paths.push(file.url) + } }) + this.adForm.judgeResultImagePathList = paths + this.adForm.visitTaskId = this.visitTaskId + try { + await saveJudgeVisitTaskResult(this.adForm) + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.loading = false + } catch (e) { + this.loading = false + } }, - handleSubmit() { - this.$refs['adForm'].validate((valid) => { - if (!valid) return - const { ImageAssessmentReportConfirmation } = const_.processSignature - this.signCode = ImageAssessmentReportConfirmation - this.signVisible = true - }) + async handleSubmit() { + const valid = await this.$refs['adForm'].validate() + if (!valid) return + const { ImageAssessmentReportConfirmation } = const_.processSignature + this.signCode = ImageAssessmentReportConfirmation + this.signVisible = true }, // 关闭签名框 closeSignDialog(isSign, signInfo) { @@ -528,7 +537,7 @@ export default { } }, // 签名并确认 - signConfirm(signInfo) { + async signConfirm(signInfo) { this.loading = true var paths = [] this.fileList.map(file => { @@ -543,7 +552,8 @@ export default { }, signInfo: signInfo } - submitJudgeVisitTaskResult(params).then(async res => { + try { + const res = await submitJudgeVisitTaskResult(params) if (res.IsSuccess) { this.$message.success(this.$t('common:message:savedSuccessfully')) this.isEdit = false @@ -553,38 +563,34 @@ export default { // window.opener.postMessage('refreshTaskList', window.location) // 设置当前任务阅片状态为已读 this.adInfo.ReadingTaskState = 2 - var isAutoTask = await this.getAutoTaskVal() + const res = await getAutoCutNextTask() + var isAutoTask = res.Result.AutoCutNextTask if (isAutoTask) { store.dispatch('reading/resetVisitTasks') DicomEvent.$emit('getNextTask') } else { // '当前阅片任务已完成,是否进入下一个阅片任务?' - this.$confirm(this.$t('trials:adReview:title:msg2'), { - type: 'warning', - distinguishCancelAndClose: true - }) - .then(() => { - store.dispatch('reading/resetVisitTasks') - DicomEvent.$emit('getNextTask') - }) - .catch(action => { - changeURLStatic('visitTaskId', this.visitTaskId) - }) + const confirm = await this.$confirm( + this.$t('trials:adReview:title:msg2'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm === 'confirm') { + store.dispatch('reading/resetVisitTasks') + DicomEvent.$emit('getNextTask') + } else { + changeURLStatic('visitTaskId', this.visitTaskId) + } } window.opener.postMessage('refreshTaskList', window.location) } this.loading = false - }).catch(_ => { + } catch (e) { this.loading = false this.$refs['signForm'].btnLoading = false - }) - }, - getAutoTaskVal() { - return new Promise((resolve, reject) => { - getAutoCutNextTask().then(res => { - resolve(res.Result.AutoCutNextTask) - }).catch(() => { reject() }) - }) + } }, handleViewDetail(visitTaskId) { if (this.openWindow) { diff --git a/src/views/trials/trials-panel/reading/global-review/components/IRecistTable.vue b/src/views/trials/trials-panel/reading/global-review/components/IRecistTable.vue index 93e6589a..8398ff07 100644 --- a/src/views/trials/trials-panel/reading/global-review/components/IRecistTable.vue +++ b/src/views/trials/trials-panel/reading/global-review/components/IRecistTable.vue @@ -372,9 +372,10 @@ export default { return lesion ? lesion.Count : 0 }, handleSave(isPrompt = true) { - return new Promise((resolve, reject) => { - this.$refs['globalRuleForm'].validate(valid => { - if (valid) { + return new Promise(async (resolve, reject) => { + let valid = await this.$refs['globalRuleForm'].validate() + + if (valid) { this.loading = true var visitTaskAnswerList = [] this.globalForm.taskList.forEach((item, index) => { @@ -403,7 +404,8 @@ export default { trialId: this.globalInfo.trialId, visitTaskAnswerList } - batchSubmitGlobalReadingInfo(params).then(res => { + try { + await batchSubmitGlobalReadingInfo(params) this.loading = false if (isPrompt) { console.log(isPrompt) @@ -411,14 +413,13 @@ export default { } this.$emit('getGlInfo') resolve() - }).catch(() => { + } catch (e) { this.loading = false reject() - }) + } } else { reject() } - }) }) }, getBeforeAnswer(qsId, row) { diff --git a/src/views/trials/trials-panel/reading/global-review/components/LuganoTable.vue b/src/views/trials/trials-panel/reading/global-review/components/LuganoTable.vue index cc1e6d96..5f6d0e95 100644 --- a/src/views/trials/trials-panel/reading/global-review/components/LuganoTable.vue +++ b/src/views/trials/trials-panel/reading/global-review/components/LuganoTable.vue @@ -376,9 +376,9 @@ export default { return lesion ? lesion.Count : 0 }, handleSave(isPrompt = true) { - return new Promise((resolve, reject) => { - this.$refs['globalRuleForm'].validate(valid => { - if (valid) { + return new Promise(async (resolve, reject) => { + let valid = await this.$refs['globalRuleForm'].validate() + if (valid) { this.loading = true var visitTaskAnswerList = [] this.globalForm.taskList.forEach((item, index) => { @@ -407,7 +407,8 @@ export default { trialId: this.globalInfo.trialId, visitTaskAnswerList } - batchSubmitGlobalReadingInfo(params).then(res => { + try { + await batchSubmitGlobalReadingInfo(params) this.loading = false if (isPrompt) { console.log(isPrompt) @@ -415,14 +416,14 @@ export default { } this.$emit('getGlInfo') resolve() - }).catch(() => { + } catch (e) { this.loading = false reject() - }) + } } else { reject() } - }) + }) }, getBeforeAnswer(qsId, row) { diff --git a/src/views/trials/trials-panel/reading/global-review/components/PCWG3Table.vue b/src/views/trials/trials-panel/reading/global-review/components/PCWG3Table.vue index 52392390..fe2ae121 100644 --- a/src/views/trials/trials-panel/reading/global-review/components/PCWG3Table.vue +++ b/src/views/trials/trials-panel/reading/global-review/components/PCWG3Table.vue @@ -219,9 +219,9 @@ export default { this.$emit('handleView', row) }, handleSave(isPrompt = true) { - return new Promise((resolve, reject) => { - this.$refs['globalRuleForm'].validate(valid => { - if (valid) { + return new Promise(async (resolve, reject) => { + let valid = await this.$refs['globalRuleForm'].validate() + if (valid) { this.loading = true var visitTaskAnswerList = [] this.globalForm.taskList.forEach((item, index) => { @@ -247,21 +247,21 @@ export default { trialId: this.globalInfo.trialId, visitTaskAnswerList } - batchSubmitGlobalReadingInfo(params).then(res => { + try { + await batchSubmitGlobalReadingInfo(params) this.loading = false if (isPrompt) { this.$message.success(this.$t('common:message:savedSuccessfully')) } this.$emit('getGlInfo') resolve() - }).catch(() => { + } catch (e) { this.loading = false reject() - }) + } } else { reject() } - }) }) } } diff --git a/src/views/trials/trials-panel/reading/global-review/components/RecistBMTable.vue b/src/views/trials/trials-panel/reading/global-review/components/RecistBMTable.vue index ff94183a..ed74baf9 100644 --- a/src/views/trials/trials-panel/reading/global-review/components/RecistBMTable.vue +++ b/src/views/trials/trials-panel/reading/global-review/components/RecistBMTable.vue @@ -369,9 +369,9 @@ export default { return lesion ? lesion.Count : 0 }, handleSave(isPrompt = true) { - return new Promise((resolve, reject) => { - this.$refs['globalRuleForm'].validate(valid => { - if (valid) { + return new Promise(async(resolve, reject) => { + let valid = await this.$refs['globalRuleForm'].validate() + if (valid) { this.loading = true var visitTaskAnswerList = [] this.globalForm.taskList.forEach((item, index) => { @@ -400,7 +400,8 @@ export default { trialId: this.globalInfo.trialId, visitTaskAnswerList } - batchSubmitGlobalReadingInfo(params).then(res => { + try { + await batchSubmitGlobalReadingInfo(params) this.loading = false if (isPrompt) { console.log(isPrompt) @@ -408,14 +409,13 @@ export default { } this.$emit('getGlInfo') resolve() - }).catch(() => { + } catch (e) { this.loading = false reject() - }) + } } else { reject() } - }) }) }, getBeforeAnswer(qsId, row) { diff --git a/src/views/trials/trials-panel/reading/global-review/components/RecistTable.vue b/src/views/trials/trials-panel/reading/global-review/components/RecistTable.vue index d5bf2b1a..3bf48212 100644 --- a/src/views/trials/trials-panel/reading/global-review/components/RecistTable.vue +++ b/src/views/trials/trials-panel/reading/global-review/components/RecistTable.vue @@ -363,9 +363,9 @@ export default { return lesion ? lesion.Count : 0 }, handleSave(isPrompt = true) { - return new Promise((resolve, reject) => { - this.$refs['globalRuleForm'].validate(valid => { - if (valid) { + return new Promise(async (resolve, reject) => { + let valid = await this.$refs['globalRuleForm'].validate() + if (valid) { this.loading = true var visitTaskAnswerList = [] this.globalForm.taskList.forEach((item, index) => { @@ -394,7 +394,8 @@ export default { trialId: this.globalInfo.trialId, visitTaskAnswerList } - batchSubmitGlobalReadingInfo(params).then(res => { + try { + await batchSubmitGlobalReadingInfo(params) this.loading = false if (isPrompt) { console.log(isPrompt) @@ -402,14 +403,14 @@ export default { } this.$emit('getGlInfo') resolve() - }).catch(() => { + } catch (e) { this.loading = false reject() - }) + } } else { reject() } - }) + }) }, getBeforeAnswer(qsId, row) { diff --git a/src/views/trials/trials-panel/reading/global-review/index.vue b/src/views/trials/trials-panel/reading/global-review/index.vue index a6e3b2f1..cbee1109 100644 --- a/src/views/trials/trials-panel/reading/global-review/index.vue +++ b/src/views/trials/trials-panel/reading/global-review/index.vue @@ -256,10 +256,10 @@ export default { } }, methods: { - getGlInfo() { + async getGlInfo() { this.loading = true - getGlobalReadingInfo({ visitTaskId: this.visitTaskId }).then(res => { - console.log('getGlobalReadingInfo') + try { + let res = await getGlobalReadingInfo({ visitTaskId: this.visitTaskId }) var evaluationQsList = [] var adjustedQsList = [] var agreeOrNotList = [] @@ -322,66 +322,20 @@ export default { trialId: this.trialId, subjectId: this.subjectId, subjectCode: this.subjectCode, visitTaskId: res.Result.GlobalTaskId, globalForm, globalUpdateType, evaluationQsList, adjustedQsList, agreeOrNotList, readingTaskState: this.readingTaskState, assessTypeList: res.Result.AssessTypeList } this.loading = false - }).catch(() => { this.loading = false }) + } catch (e) { + this.loading = false + } }, - getHistoryGlobalInfo() { + async getHistoryGlobalInfo() { this.historyLoading = true - getReadingPastResultList({ visitTaskId: this.visitTaskId }).then(res => { + try { + let res = await getReadingPastResultList({ visitTaskId: this.visitTaskId }) this.historyTaskList = res.Result this.historyLoading = false - }).catch(() => { this.historyLoading = false }) - }, - changeAgreeOrNotList(callback, row, visitTaskId) { - var message = '' - if (parseInt(callback) === 1) { - message = '是否确认更改?' - row.Answer = '0' - } else { - message = '是否确认更改?' - row.Answer = '1' + } catch (e) { + this.historyLoading = false } - this.$confirm(message, { - distinguishCancelAndClose: true, - type: 'warning' - }).then(() => { - this.loading = true - var params = { - globalTaskId: this.visitTaskId, - subjectId: this.subjectId, - trialId: this.trialId, - questionList: [ - { - questionId: row.QuestionId ? row.QuestionId : '', - visitTaskId: visitTaskId, - globalAnswerType: row.GlobalAnswerType, - answer: row.Answer === '1' ? '0' : '1' - } - ] - } - saveGlobalReadingInfo(params).then(res => { - this.loading = false - if (res.IsSuccess) { - this.$message.success(this.$t('common:message:savedSuccessfully')) - this.getGlInfo() - } - }).catch(() => { this.loading = false }) - }).catch(() => {}) }, - // handleEdit(row) { - // this.rowData = { ...row } - // if (this.CriterionType === 1) { - // this.rowData.AfterQuestionList.forEach(item => { - // if (item.GlobalAnswerType === 1) { - // // 全局阅片备注 - // item.QuestionName = this.$t('trials:globalReview:table:globalRemark') - // } else if (item.GlobalAnswerType === 3) { - // // 评估更新类型 - // item.QuestionName = this.$t('trials:globalReview:table:updateType') - // } - // }) - // } - // // this.editVisible = true - // }, handleSave() { this.$refs['globalTbl'].handleSave(true) }, @@ -435,53 +389,49 @@ export default { } }, // 签名并确认 - signConfirm(signInfo) { + async signConfirm(signInfo) { this.loading = true - var params = { data: { globalTaskId: this.visitTaskId }, signInfo: signInfo } - submitGlobalReadingInfo(params).then(async res => { + try{ + let res = await submitGlobalReadingInfo(params) if (res.IsSuccess) { this.$message.success(this.$t('common:message:savedSuccessfully')) this.$refs['signForm'].btnLoading = false this.signVisible = false // 设置当前任务阅片状态为已读 this.readingTaskState = 2 - var isAutoTask = await this.getAutoTaskVal() + const res = await getAutoCutNextTask() + var isAutoTask = res.Result.AutoCutNextTask if (isAutoTask) { DicomEvent.$emit('getNextTask') } else { - // 当前阅片任务已完成,是否进入下一个阅片任务 - this.$confirm(this.$t('trials:globalReview:message:msg2'), { - type: 'warning', - distinguishCancelAndClose: true - }) - .then(() => { - store.dispatch('reading/resetVisitTasks') - DicomEvent.$emit('getNextTask') - }) - .catch(action => { - changeURLStatic('visitTaskId', this.visitTaskId) - }) + // 当前阅片任务已完成,是否进入下一个阅片任务 + const confirm = await this.$confirm( + this.$t('trials:globalReview:message:msg2'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm === 'confirm') { + store.dispatch('reading/resetVisitTasks') + DicomEvent.$emit('getNextTask') + } else { + changeURLStatic('visitTaskId', this.visitTaskId) + } } window.opener.postMessage('refreshTaskList', window.location) } this.loading = false - }).catch(_ => { + } catch (e) { this.loading = false this.$refs['signForm'].btnLoading = false - }) - }, - getAutoTaskVal() { - return new Promise((resolve, reject) => { - getAutoCutNextTask().then(res => { - resolve(res.Result.AutoCutNextTask) - }).catch(() => { reject() }) - }) + } }, handleView(row) { if (this.openWindow) { diff --git a/src/views/trials/trials-panel/reading/oncology-review/index.vue b/src/views/trials/trials-panel/reading/oncology-review/index.vue index 954e1f12..940dc5a2 100644 --- a/src/views/trials/trials-panel/reading/oncology-review/index.vue +++ b/src/views/trials/trials-panel/reading/oncology-review/index.vue @@ -262,8 +262,11 @@