diff --git a/src/views/trials/trials-panel/subject/reading-period/components/ClinicalData.vue b/src/views/trials/trials-panel/subject/reading-period/components/ClinicalData.vue index 690dbbfe..e07c86eb 100644 --- a/src/views/trials/trials-panel/subject/reading-period/components/ClinicalData.vue +++ b/src/views/trials/trials-panel/subject/reading-period/components/ClinicalData.vue @@ -9,14 +9,14 @@

- {{ $t("trials:readingPeriod:cd:title:tips") }} + {{ $t('trials:readingPeriod:cd:title:tips') }}

{{ tips1 }}
- {{ $t("trials:readingPeriod:cd:title:tips2") }} + {{ $t('trials:readingPeriod:cd:title:tips2') }}
@@ -28,7 +28,7 @@ :disabled="list.length === 0" @click="handlePreview()" > - {{ $t("trials:readingPeriod:cd:title:preview") }} + {{ $t('trials:readingPeriod:cd:title:preview') }} - {{ $t("common:button:add") }} + {{ $t('common:button:add') }} + - {{ $t("trials:readingPeriod:cd:title:cdCheck") }} + {{ $t('trials:readingPeriod:cd:title:downLoadTemplate') }} @@ -112,7 +110,7 @@ min-width="100" > @@ -122,7 +120,7 @@ min-width="120" > @@ -133,7 +131,7 @@ > @@ -149,7 +147,7 @@ type="info" >{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}
{{ - $t("common:dialogTitle:sign") + $t('common:dialogTitle:sign') }} {{ - `(${$t("common:label:sign")}${currentUser})` + `(${$t('common:label:sign')}${currentUser})` }}
- {{ $t("trials:readingPeriod:cd:title:preview") }} + {{ $t('trials:readingPeriod:cd:title:preview') }}
- {{ $t("common:button:add") }} + {{ $t('common:button:add') }}
@@ -361,7 +359,7 @@ show-overflow-tooltip > @@ -370,7 +368,7 @@ :label="$t('trials:readingPeriod:cd:table:dataLevel')" > @@ -379,7 +377,7 @@ :label="$t('trials:readingPeriod:cd:table:transferType')" > @@ -389,7 +387,7 @@ > @@ -405,7 +403,7 @@ type="info" >{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}{{ $fd( - "ReadingClinicalDataState", + 'ReadingClinicalDataState', scope.row.ReadingClinicalDataState ) }}
{{ - $t("common:dialogTitle:sign") + $t('common:dialogTitle:sign') }} {{ - `(${$t("common:label:sign")}${currentUser})` + `(${$t('common:label:sign')}${currentUser})` }}
{ - if (res.data.type === "pmConfirmClinical") { - this.getList(); + window.addEventListener('message', (res) => { + if (res.data.type === 'pmConfirmClinical') { + this.getList() } - }); + }) }, methods: { + // 下载模板 + async downLoadTemplate() { + try { + let { files, name } = this.formatDownloadFile() + let res = await downLoadFile(files, name, 'zip') + } catch (err) { + console.log(err) + } + }, + // 格式化下载文件路径 + formatDownloadFile() { + let files = [], + name = `${this.$route.query.trialId}_${ + this.data.CriterionName + }_template_${new Date().getTime()}.zip` + this.clinicalDatas.forEach((item) => { + if (item.Path) { + let obj = { + name: item.FileName, + url: this.OSSclientConfig.basePath + item.Path, + } + files.push(obj) + } + }) + return { files, name } + }, getClinicalDatas() { return new Promise((resolve, reject) => { - let message = ""; + let message = '' let currentData = Object.assign( {}, { @@ -652,113 +678,114 @@ export default { SubjectId: this.data.SubjectId, IsBaseLine: this.data.IsBaseLine, } - ); + ) var param = { trialId: currentData.TrialId, IsVisit: currentData.IsVisit, ReadingId: currentData.ReadingId, SubjectId: currentData.SubjectId, - ReadingClinicalDataId: currentData.Id ? currentData.Id : "", + ReadingClinicalDataId: currentData.Id ? currentData.Id : '', IsBaseLine: currentData.IsBaseLine, TrialReadingCriterionId: this.trialReadingCriterionId, - }; + } getTrialClinicalDataSelect(param) .then((res) => { + this.clinicalDatas = res.Result res.Result.forEach((item, index) => { if (index < 1) { - message += item.ClinicalDataSetName; + message += item.ClinicalDataSetName } else { - message = message + "、" + item.ClinicalDataSetName; + message = message + '、' + item.ClinicalDataSetName } - }); - resolve(message); + }) + resolve(message) }) .catch(() => { - reject(); - }); - }); + reject() + }) + }) }, objectSpanMethod({ row, column, rowIndex, columnIndex }) { if (columnIndex === 6 && row.IsNeedMerge) { - const _row = this.spanArr[rowIndex]; - const _col = _row > 0 ? 1 : 0; + const _row = this.spanArr[rowIndex] + const _col = _row > 0 ? 1 : 0 return { rowspan: _row, colspan: _col, - }; + } } }, getSpanArr(data) { for (var i = 0; i < data.length; i++) { if (i === 0) { - this.spanArr.push(1); - this.pos = 0; + this.spanArr.push(1) + this.pos = 0 } else { // 判断当前元素与上一个元素是否相同 if (data[i].IsNeedMerge === data[i - 1].IsNeedMerge) { - this.spanArr[this.pos] += 1; - this.spanArr.push(0); + this.spanArr[this.pos] += 1 + this.spanArr.push(0) } else { - this.spanArr.push(1); - this.pos = i; + this.spanArr.push(1) + this.pos = i } } } }, getList(is) { - this.loading = true; - if (this.type === "consistencyAnalysis") { + this.loading = true + if (this.type === 'consistencyAnalysis') { let data = { SubjectId: this.data.SubjectId, VisitTaskId: this.data.Id, TrialId: this.$route.query.trialId, - }; + } return getConsistencyAnalysisReadingClinicalDataList(data) .then((res) => { - this.list = res.Result; - this.otherInfo = res.OtherInfo; - this.loading = false; + this.list = res.Result + this.otherInfo = res.OtherInfo + this.loading = false }) .catch(() => { - this.loading = false; - }); + this.loading = false + }) } - this.searchData.ReadingId = this.data.Id; - this.searchData.SubjectId = this.data.SubjectId; - this.searchData.IsVisit = this.data.IsVisit; - this.searchData.TrialId = this.data.TrialId; - this.searchData.IsBaseLine = this.data.IsBaseLine; - this.searchData.TrialReadingCriterionId = this.trialReadingCriterionId; + this.searchData.ReadingId = this.data.Id + this.searchData.SubjectId = this.data.SubjectId + this.searchData.IsVisit = this.data.IsVisit + this.searchData.TrialId = this.data.TrialId + this.searchData.IsBaseLine = this.data.IsBaseLine + this.searchData.TrialReadingCriterionId = this.trialReadingCriterionId if (!is) { - this.searchData.GetClinicalType = this.clinicalType; + this.searchData.GetClinicalType = this.clinicalType } getReadingClinicalDataList(this.searchData) .then(async (res) => { - this.list = res.Result; - let message = ""; + this.list = res.Result + let message = '' this.list.forEach((item, index) => { if (index < 1) { - message += item.ClinicalDataSetName; + message += item.ClinicalDataSetName } else { - message = message + "、" + item.ClinicalDataSetName; + message = message + '、' + item.ClinicalDataSetName } - }); - if (message === "" || !message) { - message = await this.getClinicalDatas(); + }) + if (message === '' || !message) { + message = await this.getClinicalDatas() } - this.tips1 = this.$t("trials:readingPeriod:cd:title:tips1").replace( - "临床数据名称", + this.tips1 = this.$t('trials:readingPeriod:cd:title:tips1').replace( + '临床数据名称', message - ); - this.tips1 = this.tips1.replace("xxx", message); - this.pos = 0; - this.getSpanArr(this.list); - this.otherInfo = res.OtherInfo; - this.loading = false; + ) + this.tips1 = this.tips1.replace('xxx', message) + this.pos = 0 + this.getSpanArr(this.list) + this.otherInfo = res.OtherInfo + this.loading = false }) .catch(() => { - this.loading = false; - }); + this.loading = false + }) }, handleAdd() { this.currentData = Object.assign( @@ -770,136 +797,136 @@ export default { SubjectId: this.data.SubjectId, IsBaseLine: this.data.IsBaseLine, } - ); - this.addOrUpdateCD.title = this.$t("common:button:new"); - this.addOrUpdateCD.visible = true; + ) + this.addOrUpdateCD.title = this.$t('common:button:new') + this.addOrUpdateCD.visible = true }, handleEdit(row) { - this.currentData = { ...row }; - this.currentData.TrialId = this.data.TrialId; - this.currentData.SubjectId = this.data.SubjectId; - if (this.type === "readingPeriod") { - this.currentData.ReadingId = this.data.Id; + this.currentData = { ...row } + this.currentData.TrialId = this.data.TrialId + this.currentData.SubjectId = this.data.SubjectId + if (this.type === 'readingPeriod') { + this.currentData.ReadingId = this.data.Id } - this.currentData.IsVisit = this.data.IsVisit; - this.currentData.IsBaseLine = this.data.IsBaseLine; - this.addOrUpdateCD.title = this.$t("common:button:edit"); + this.currentData.IsVisit = this.data.IsVisit + this.currentData.IsBaseLine = this.data.IsBaseLine + this.addOrUpdateCD.title = this.$t('common:button:edit') this.currentOption = [ { ClinicalDataSetName: - this.$i18n.locale === "zh" + this.$i18n.locale === 'zh' ? row.ClinicalDataSetName : row.ClinicalDataSetEnName, Id: row.ClinicalDataTrialSetId, }, - ]; - this.addOrUpdateCD.visible = true; + ] + this.addOrUpdateCD.visible = true }, handleVerification(row, type) { - if (type === "unconfirm") { - var token = getToken(); + if (type === 'unconfirm') { + var token = getToken() let routeData = this.$router.resolve({ path: `/clinicalData?type=unconfirm&ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&readingId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&readModuleId=${row.ReadModuleId}&getClinicalType=${ this.clinicalType }&isConfirm=1&IsOnlyGetCRCReadModule=1&TokenKey=${token}`, - }); - if (this.type === "consistencyAnalysis") { + }) + if (this.type === 'consistencyAnalysis') { routeData = this.$router.resolve({ path: `/clinicalData?type=unconfirm&ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&visitTaskId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&readModuleId=${row.ReadModuleId}&getClinicalType=${ this.clinicalType }&isConfirm=1&IsOnlyGetCRCReadModule=1&TokenKey=${token}&&isGetAllConsistencyAnalysis=${0}`, - }); + }) } - window.open(routeData.href, "_blank"); - return; + window.open(routeData.href, '_blank') + return } if (row.IsNeedMerge) { - var token = getToken(); + var token = getToken() let routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&readingId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&readModuleId=${row.ReadModuleId}&getClinicalType=${ this.clinicalType }&isConfirm=1&IsOnlyGetCRCReadModule=1&TokenKey=${token}`, - }); - if (this.type === "consistencyAnalysis") { + }) + if (this.type === 'consistencyAnalysis') { routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&visitTaskId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&readModuleId=${row.ReadModuleId}&getClinicalType=${ this.clinicalType }&isConfirm=1&IsOnlyGetCRCReadModule=1&TokenKey=${token}&&isGetAllConsistencyAnalysis=${0}`, - }); + }) } - window.open(routeData.href, "_blank"); + window.open(routeData.href, '_blank') } else { - this.currentData = { ...row }; - this.currentData.TrialId = this.data.TrialId; - this.currentData.SubjectId = this.data.SubjectId; - if (this.type === "readingPeriod") { - this.currentData.ReadingId = this.data.Id; + this.currentData = { ...row } + this.currentData.TrialId = this.data.TrialId + this.currentData.SubjectId = this.data.SubjectId + if (this.type === 'readingPeriod') { + this.currentData.ReadingId = this.data.Id } - this.currentData.IsVisit = this.data.IsVisit; - this.currentData.IsBaseLine = this.data.IsBaseLine; + this.currentData.IsVisit = this.data.IsVisit + this.currentData.IsBaseLine = this.data.IsBaseLine this.verification.title = this.$t( - "trials:readingPeriod:cd:title:cdCheck" - ); // '核查' - this.verification.visible = true; + 'trials:readingPeriod:cd:title:cdCheck' + ) // '核查' + this.verification.visible = true } }, handleDelete(row) { - this.$confirm(this.$t("trials:readingPeriod:cd:message:delete"), { - type: "warning", + this.$confirm(this.$t('trials:readingPeriod:cd:message:delete'), { + type: 'warning', distinguishCancelAndClose: true, }) .then(() => { - this.loading = true; + this.loading = true deleteReadingClinicalData(row.Id) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - this.getList(); + this.getList() this.$message.success( - this.$t("common:message:deletedSuccessfully") - ); + this.$t('common:message:deletedSuccessfully') + ) } }) .catch(() => { - this.loading = false; - }); + this.loading = false + }) }) - .catch(() => {}); + .catch(() => {}) }, handleSign(from) { // this.currentData = { ...row } - this.currentData.IsBlind = from.IsBlind; - this.currentData.IsComplete = from.IsComplete; - const { CDQualityConfirmation } = const_.processSignature; - this.signCode = CDQualityConfirmation; - this.signVisible = true; + this.currentData.IsBlind = from.IsBlind + this.currentData.IsComplete = from.IsComplete + const { CDQualityConfirmation } = const_.processSignature + this.signCode = CDQualityConfirmation + this.signVisible = true }, signConfirm(signInfo) { - this.loading = true; + this.loading = true let params = { data: { readingClinicalDataId: this.currentData.Id, @@ -908,8 +935,8 @@ export default { TrialReadingCriterionId: this.trialReadingCriterionId, }, signInfo: signInfo, - }; - if (this.type === "consistencyAnalysis") { + } + if (this.type === 'consistencyAnalysis') { params = { data: { consistentClinicalDataId: this.currentData.Id, @@ -917,94 +944,90 @@ export default { IsComplete: this.currentData.IsComplete, }, signInfo: signInfo, - }; + } signConsistencyAnalysisReadingClinicalData(params) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - this.$message.success( - this.$t("common:message:savedSuccessfully") - ); - this.$refs["signForm"].btnLoading = false; + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.$refs['signForm'].btnLoading = false - this.signVisible = false; + this.signVisible = false - this.getList(); - this.$emit("getList"); + this.getList() + this.$emit('getList') this.$nextTick(() => { - this.verification.visible = false; - }); + this.verification.visible = false + }) } }) .catch((_) => { - this.loading = false; - this.$refs["signForm"].btnLoading = false; - }); + this.loading = false + this.$refs['signForm'].btnLoading = false + }) } else { ReadClinicalDataSign(params) .then((res) => { - this.loading = false; + this.loading = false if (res.IsSuccess) { - this.$message.success( - this.$t("common:message:savedSuccessfully") - ); - this.$refs["signForm"].btnLoading = false; + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.$refs['signForm'].btnLoading = false - this.signVisible = false; + this.signVisible = false - this.getList(); - this.$emit("getList"); + this.getList() + this.$emit('getList') this.$nextTick(() => { - this.verification.visible = false; - }); + this.verification.visible = false + }) } }) .catch((_) => { - this.loading = false; - this.$refs["signForm"].btnLoading = false; - }); + this.loading = false + this.$refs['signForm'].btnLoading = false + }) } }, // 关闭签名框并设置确认状态 closeSignDialog(isSign, signInfo) { if (isSign) { - this.signConfirm(signInfo); + this.signConfirm(signInfo) } else { - this.signVisible = false; - this.loading = false; + this.signVisible = false + this.loading = false } }, handlePreview(readingClinicalDataId, row) { if (row && row.IsNeedMerge) { - var token = getToken(); + var token = getToken() let routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&readingId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&getClinicalType=${this.clinicalType}&readModuleId=${ row.ReadModuleId }&IsOnlyGetCRCReadModule=1&TokenKey=${token}`, - }); - if (this.type === "consistencyAnalysis") { + }) + if (this.type === 'consistencyAnalysis') { routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&visitTaskId=${this.data.Id}&readingClinicalDataId=${ - row.readingClinicalDataId || "" + row.readingClinicalDataId || '' }&getClinicalType=${this.clinicalType}&readModuleId=${ row.ReadModuleId }&IsOnlyGetCRCReadModule=1&TokenKey=${token}&&isGetAllConsistencyAnalysis=${0}`, - }); + }) } - window.open(routeData.href, "_blank"); + window.open(routeData.href, '_blank') } else { - var token = getToken(); - var routeData; + var token = getToken() + var routeData if (row) { routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ @@ -1012,47 +1035,47 @@ export default { }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&readingId=${this.data.Id}&readingClinicalDataId=${ - readingClinicalDataId || "" + readingClinicalDataId || '' }&getClinicalType=${this.clinicalType}&TokenKey=${token}`, - }); - if (this.type === "consistencyAnalysis") { + }) + if (this.type === 'consistencyAnalysis') { routeData = this.$router.resolve({ path: `/clinicalData?ClinicalDataTrialSetId=${ row.ClinicalDataTrialSetId }&subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&visitTaskId=${this.data.Id}&readingClinicalDataId=${ - readingClinicalDataId || "" + readingClinicalDataId || '' }&getClinicalType=${ this.clinicalType }&TokenKey=${token}&&isGetAllConsistencyAnalysis=${0}`, - }); + }) } } else { routeData = this.$router.resolve({ path: `/clinicalData?subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&readingId=${this.data.Id}&readingClinicalDataId=${ - readingClinicalDataId || "" + readingClinicalDataId || '' }&getClinicalType=${this.clinicalType}&TokenKey=${token}`, - }); - if (this.type === "consistencyAnalysis") { + }) + if (this.type === 'consistencyAnalysis') { routeData = this.$router.resolve({ path: `/clinicalData?subjectId=${this.data.SubjectId}&trialId=${ this.data.TrialId }&visitTaskId=${this.data.Id}&readingClinicalDataId=${ - readingClinicalDataId || "" + readingClinicalDataId || '' }&getClinicalType=${ this.clinicalType }&TokenKey=${token}&&isGetAllConsistencyAnalysis=${0}`, - }); + }) } } - window.open(routeData.href, "_blank"); + window.open(routeData.href, '_blank') } }, }, -}; +}