上传临床数据按钮修改
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-14 10:26:12 +08:00
parent 97d786684b
commit 42ed756c4e
2 changed files with 195 additions and 188 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -13,7 +13,7 @@
<!-- 格式化录入 -->
<div v-if="cd.ClinicalUploadType === 0">
<!-- 既往放疗史 -->
<h4>{{ $t("trials:uploadClinicalData:title:pastTreatment") }}</h4>
<h4>{{ $t('trials:uploadClinicalData:title:pastTreatment') }}</h4>
<div v-if="allowAddOrEdit" style="text-align: right">
<!-- 新增 -->
<el-button
@ -24,7 +24,7 @@
addPreviousHistory(cd.ClinicalDataTrialSetId)
"
>
{{ $t("common:button:new") }}
{{ $t('common:button:new') }}
</el-button>
</div>
@ -46,8 +46,8 @@
<template slot-scope="scope">
{{
scope.row.StartTime
? moment(scope.row.StartTime).format("YYYY-MM-DD")
: ""
? moment(scope.row.StartTime).format('YYYY-MM-DD')
: ''
}}
</template>
</el-table-column>
@ -59,8 +59,8 @@
<template slot-scope="scope">
{{
scope.row.EndTime
? moment(scope.row.EndTime).format("YYYY-MM-DD")
: ""
? moment(scope.row.EndTime).format('YYYY-MM-DD')
: ''
}}
</template>
</el-table-column>
@ -70,7 +70,7 @@
:label="$t('trials:uploadClinicalData:table:isPD')"
>
<template slot-scope="scope">
{{ $fd("IsPdEnum", scope.row.IsPD) }}
{{ $fd('IsPdEnum', scope.row.IsPD) }}
</template>
</el-table-column>
<el-table-column
@ -104,7 +104,7 @@
</el-table-column>
</el-table>
<!-- 既往手术史 -->
<h4>{{ $t("trials:uploadClinicalData:title:pastSurgery") }}</h4>
<h4>{{ $t('trials:uploadClinicalData:title:pastSurgery') }}</h4>
<div v-if="allowAddOrEdit" style="text-align: right">
<el-button
type="primary"
@ -112,7 +112,7 @@
size="small"
@click="addPreviousSurgery(cd.ClinicalDataTrialSetId)"
>
{{ $t("common:button:new") }}
{{ $t('common:button:new') }}
</el-button>
</div>
<el-table
@ -133,8 +133,8 @@
<template slot-scope="scope">
{{
scope.row.OperationTime
? moment(scope.row.OperationTime).format("YYYY-MM-DD")
: ""
? moment(scope.row.OperationTime).format('YYYY-MM-DD')
: ''
}}
</template>
</el-table-column>
@ -170,7 +170,7 @@
</el-table-column>
</el-table>
<!-- 既往其他治疗史 -->
<h4>{{ $t("trials:uploadClinicalData:title:others") }}</h4>
<h4>{{ $t('trials:uploadClinicalData:title:others') }}</h4>
<div v-if="allowAddOrEdit" style="text-align: right">
<!-- 新增 -->
<el-button
@ -179,7 +179,7 @@
size="small"
@click="addPreviousOther(cd.ClinicalDataTrialSetId)"
>
{{ $t("common:button:new") }}
{{ $t('common:button:new') }}
</el-button>
</div>
<el-table
@ -200,8 +200,8 @@
<template slot-scope="scope">
{{
scope.row.StartTime
? moment(scope.row.StartTime).format("YYYY-MM-DD")
: ""
? moment(scope.row.StartTime).format('YYYY-MM-DD')
: ''
}}
</template>
</el-table-column>
@ -213,8 +213,8 @@
<template slot-scope="scope">
{{
scope.row.EndTime
? moment(scope.row.EndTime).format("YYYY-MM-DD")
: ""
? moment(scope.row.EndTime).format('YYYY-MM-DD')
: ''
}}
</template>
</el-table-column>
@ -252,7 +252,10 @@
</div>
<!-- PDF录入 -->
<div v-if="cd.ClinicalUploadType === 1">
<div v-if="allowAddOrEdit" style="text-align: right">
<div
v-if="allowAddOrEdit"
style="text-align: right; display: flex; justify-content: flex-end"
>
<!-- 下载模板 -->
<el-button
v-if="cd.Path"
@ -261,8 +264,9 @@
size="small"
:loading="downloadLoading"
@click.native.prevent="handleDownloadTpl(cd)"
style="margin-right: 10px"
>
{{ $t("trials:uploadClinicalData:button:downloadTemplate") }}
{{ $t('trials:uploadClinicalData:button:downloadTemplate') }}
</el-button>
<!-- 新增 -->
<!-- <el-button
@ -274,35 +278,38 @@
{{ $t("common:button:new") }}
</el-button> -->
<!-- 新增 -->
<el-button
icon="el-icon-plus"
type="primary"
size="small"
:disabled="btnLoading"
:loading="btnLoading"
>
{{ $t("common:button:new") }}
</el-button>
<input
type="file"
name="file"
multiple
ref="addFile"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="
($event) =>
beginScanFiles($event, cd.Id, cd.ClinicalDataTrialSetId)
"
/>
<div style="position: relative">
<el-button
icon="el-icon-plus"
type="primary"
size="small"
:disabled="btnLoading"
:loading="btnLoading"
>
{{ $t('common:button:new') }}
</el-button>
<input
type="file"
name="file"
multiple
ref="addFile"
:title="$t('common:button:new')"
style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
"
:accept="faccept.join(',')"
@change="
($event) =>
beginScanFiles($event, cd.Id, cd.ClinicalDataTrialSetId)
"
/>
</div>
</div>
<el-table :data="cd.PDFFileList" style="width: 100%" height="300">
<el-table-column type="index" width="50" />
@ -490,16 +497,16 @@ import {
deletePreviousSurgery,
getCRCClinicalData,
addOrUpdateReadingClinicalData,
} from "@/api/trials";
import PreviousRadiotherapy from "./previousRadiotherapy";
import PreviousSurgery from "./previousSurgery";
import PreviousOther from "./previousOther";
import PreviousFiles from "./previousFiles";
import clinicalDataQuestions from "@/components/clinicalDataQuestions";
import PreviewFile from "@/components/PreviewFile/index";
import moment from "moment";
} from '@/api/trials'
import PreviousRadiotherapy from './previousRadiotherapy'
import PreviousSurgery from './previousSurgery'
import PreviousOther from './previousOther'
import PreviousFiles from './previousFiles'
import clinicalDataQuestions from '@/components/clinicalDataQuestions'
import PreviewFile from '@/components/PreviewFile/index'
import moment from 'moment'
export default {
name: "uploadPetClinicalData",
name: 'uploadPetClinicalData',
components: {
PreviousRadiotherapy,
PreviousSurgery,
@ -512,14 +519,14 @@ export default {
data: {
type: Object,
default() {
return {};
return {}
},
},
studyData: {
required: true,
type: Object,
default() {
return {};
return {}
},
},
subjectVisitId: {
@ -537,9 +544,9 @@ export default {
},
data() {
return {
faccept: [".pdf"],
faccept: ['.pdf'],
isShow: false,
userTypeEnumInt: zzSessionStorage.getItem("userTypeEnumInt") * 1,
userTypeEnumInt: zzSessionStorage.getItem('userTypeEnumInt') * 1,
loading: false,
btnLoading: false,
PreviousHistoryList: [],
@ -556,11 +563,11 @@ export default {
moment,
downloadLoading: false,
clinicalDatas: [],
previewObj: { visible: false, filePath: "", fileType: "" },
};
previewObj: { visible: false, filePath: '', fileType: '' },
}
},
mounted() {
this.getClinicalData();
this.getClinicalData()
},
methods: {
beginScanFiles(e, id, clinicalDataTrialSetId) {
@ -568,59 +575,59 @@ export default {
Id: id,
ClinicalDataTrialSetId: clinicalDataTrialSetId,
SubjectId: this.data.SubjectId,
};
this.currentRow.TrialId = this.$route.query.trialId;
var files = e.target.files;
this.fileList = [];
}
this.currentRow.TrialId = this.$route.query.trialId
var files = e.target.files
this.fileList = []
for (var i = 0; i < files.length; ++i) {
const fileName = files[i].name;
const fileName = files[i].name
var extendName = fileName
.substring(fileName.lastIndexOf("."))
.toLocaleLowerCase();
.substring(fileName.lastIndexOf('.'))
.toLocaleLowerCase()
if (this.faccept.indexOf(extendName) !== -1) {
let obj = {
size: files[i].size,
type: extendName.split(".")[1],
type: extendName.split('.')[1],
file: files[i],
};
this.fileList.push(obj);
}
this.fileList.push(obj)
}
}
this.handleUploadFile();
this.handleUploadFile()
this.$refs.addFile.forEach((item) => {
item.value = null;
});
item.value = null
})
},
async handleUploadFile() {
this.btnLoading = true;
this.loading = true;
this.addFileList = [];
this.btnLoading = true
this.loading = true
this.addFileList = []
try {
for (var i = 0; i < this.fileList.length; ++i) {
const file = await this.fileToBlob(this.fileList[i].file);
var timestamp = Date.now();
const file = await this.fileToBlob(this.fileList[i].file)
var timestamp = Date.now()
const res = await this.OSSclient.put(
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
file
);
)
this.addFileList.push({
fileName: this.fileList[i].file.name,
path: this.$getObjectName(res.url),
url: this.$getObjectName(res.url),
type: this.fileList[i].type,
size: this.fileList[i].size,
});
})
}
this.saveClinicalData();
this.saveClinicalData()
} catch (err) {
console.log(err);
this.btnLoading = false;
this.loading = false;
console.log(err)
this.btnLoading = false
this.loading = false
}
},
saveClinicalData() {
this.btnLoading = true;
this.loading = true;
this.btnLoading = true
this.loading = true
var param = {
id: this.currentRow.Id,
trialId: this.currentRow.TrialId,
@ -630,185 +637,185 @@ export default {
isVisit: true,
deleteFileIds: [],
addFileList: this.addFileList,
};
}
if (this.studyData.StudyId) {
param.StudyId = this.studyData.StudyId;
param.StudyId = this.studyData.StudyId
}
addOrUpdateReadingClinicalData(param)
.then((response) => {
this.btnLoading = false;
this.loading = false;
this.btnLoading = false
this.loading = false
//
this.getClinicalData();
this.getClinicalData()
this.$message.success(
this.$t("trials:uploadClinicalData:message:uploadSuccessfully")
);
this.$emit("getStudyInfo");
this.$t('trials:uploadClinicalData:message:uploadSuccessfully')
)
this.$emit('getStudyInfo')
})
.catch(() => {
this.btnLoading = false;
this.loading = false;
});
this.btnLoading = false
this.loading = false
})
},
getClinicalData() {
this.loading = true;
this.data.TrialId = this.$route.query.trialId;
this.loading = true
this.data.TrialId = this.$route.query.trialId
var param = {
SubjectVisitId: this.studyData.SubjectVisitId,
StudyId: this.studyData.StudyId,
TrialId: this.$route.query.trialId,
SubjectId: this.studyData.SubjectId,
};
}
getCRCClinicalData(param)
.then((res) => {
this.clinicalDatas = res.Result;
this.loading = false;
this.clinicalDatas = res.Result
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
//
editRow(row, type) {
if (type === 1) {
this.prVisible = true;
this.prVisible = true
} else if (type === 2) {
this.psVisible = true;
this.psVisible = true
} else if (type === 3) {
this.poVisible = true;
this.poVisible = true
}
this.currentRow = { ...row };
this.currentRow.TrialId = this.$route.query.trialId;
this.currentRow = { ...row }
this.currentRow.TrialId = this.$route.query.trialId
},
// ID
deletePreviousHistory(row) {
this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: "warning",
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {
this.loading = true;
this.loading = true
deletePreviousHistory(
this.$route.query.trialId,
this.subjectVisitId,
row.Id
)
.then((res) => {
this.loading = false;
this.loading = false
if (res.IsSuccess) {
this.getClinicalData();
this.getClinicalData()
this.$message.success(
this.$t("trials:uploadedDicoms:message:deleteSuccessfully")
);
this.$emit("getStudyInfo");
this.$t('trials:uploadedDicoms:message:deleteSuccessfully')
)
this.$emit('getStudyInfo')
}
})
.catch(() => {
this.loading = false;
});
});
this.loading = false
})
})
},
// ID
deletePreviousSurgery(row) {
console.log(this.$route.query.trialId);
this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: "warning",
console.log(this.$route.query.trialId)
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {
// row.Type = ''
this.loading = true;
this.loading = true
deletePreviousSurgery(
this.$route.query.trialId,
this.subjectVisitId,
row.Id
)
.then((res) => {
this.loading = false;
this.loading = false
if (res.IsSuccess) {
this.getClinicalData();
this.getClinicalData()
this.$message.success(
this.$t("trials:uploadedDicoms:message:deleteSuccessfully")
);
this.$emit("getStudyInfo");
this.$t('trials:uploadedDicoms:message:deleteSuccessfully')
)
this.$emit('getStudyInfo')
}
})
.catch(() => {
this.loading = false;
});
});
this.loading = false
})
})
},
// ID
deletePreviousOther(row) {
this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: "warning",
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {
// row.Type = ''
this.loading = true;
this.loading = true
deletePreviousOther(
this.$route.query.trialId,
this.subjectVisitId,
row.Id
)
.then((res) => {
this.loading = false;
this.loading = false
if (res.IsSuccess) {
this.getClinicalData();
this.getClinicalData()
this.$message.success(
this.$t("trials:uploadedDicoms:message:deleteSuccessfully")
);
this.$emit("getStudyInfo");
this.$t('trials:uploadedDicoms:message:deleteSuccessfully')
)
this.$emit('getStudyInfo')
}
})
.catch(() => {
this.loading = false;
});
});
this.loading = false
})
})
},
//
preview(row) {
if (!row.Path) return;
this.previewObj.fileName = row.FileName;
this.previewObj.filePath = row.Path;
this.previewObj.fileType = "pdf";
this.previewObj.visible = true;
if (!row.Path) return
this.previewObj.fileName = row.FileName
this.previewObj.filePath = row.Path
this.previewObj.fileType = 'pdf'
this.previewObj.visible = true
// window.open(this.OSSclientConfig.basePath + path, '_blank')
},
addPreviousHistory(clinicalDataTrialSetId) {
console.log(clinicalDataTrialSetId);
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId };
this.currentRow.TrialId = this.$route.query.trialId;
this.prVisible = true;
console.log(clinicalDataTrialSetId)
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId }
this.currentRow.TrialId = this.$route.query.trialId
this.prVisible = true
},
addPreviousSurgery(clinicalDataTrialSetId) {
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId };
this.currentRow.TrialId = this.$route.query.trialId;
this.psVisible = true;
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId }
this.currentRow.TrialId = this.$route.query.trialId
this.psVisible = true
},
addPreviousOther(clinicalDataTrialSetId) {
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId };
this.currentRow.TrialId = this.$route.query.trialId;
this.poVisible = true;
this.currentRow = { ClinicalDataTrialSetId: clinicalDataTrialSetId }
this.currentRow.TrialId = this.$route.query.trialId
this.poVisible = true
},
//
closePRDialog() {
this.prVisible = false;
this.currentRow.TrialId = this.$route.query.trialId;
this.prVisible = false
this.currentRow.TrialId = this.$route.query.trialId
},
closePSDialog() {
this.psVisible = false;
this.currentRow.TrialId = this.$route.query.trialId;
this.psVisible = false
this.currentRow.TrialId = this.$route.query.trialId
},
closePODialog() {
this.poVisible = false;
this.currentRow.TrialId = this.$route.query.trialId;
this.poVisible = false
this.currentRow.TrialId = this.$route.query.trialId
},
closeUpDialog() {
this.upVisible = false;
this.currentRow.TrialId = this.$route.query.trialId;
this.upVisible = false
this.currentRow.TrialId = this.$route.query.trialId
},
refresh() {
this.getClinicalData();
this.$emit("getStudyInfo");
this.getClinicalData()
this.$emit('getStudyInfo')
},
//
addFile(id, clinicalDataTrialSetId) {
@ -816,38 +823,38 @@ export default {
Id: id,
ClinicalDataTrialSetId: clinicalDataTrialSetId,
SubjectId: this.data.SubjectId,
};
this.currentRow.TrialId = this.$route.query.trialId;
this.upVisible = true;
}
this.currentRow.TrialId = this.$route.query.trialId
this.upVisible = true
},
//
deleteFile(id) {
this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), {
type: "warning",
this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), {
type: 'warning',
distinguishCancelAndClose: true,
}).then(() => {
this.loading = true;
this.loading = true
deleteReadingClinicalDataPDF(id)
.then((res) => {
this.loading = false;
this.loading = false
if (res.IsSuccess) {
this.getClinicalData();
this.$emit("getStudyInfo");
this.getClinicalData()
this.$emit('getStudyInfo')
this.$message.success(
this.$t("trials:uploadedDicoms:message:deleteSuccessfully")
);
this.$t('trials:uploadedDicoms:message:deleteSuccessfully')
)
}
})
.catch(() => {
this.loading = false;
});
});
this.loading = false
})
})
},
handleDownloadTpl(cd) {
window.open(this.OSSclientConfig.basePath + cd.Path);
window.open(this.OSSclientConfig.basePath + cd.Path)
},
},
};
}
</script>
<style lang="scss">
.clinical-data-wrapper {