irc_web/.svn/pristine/e1/e128df6037e35c84e07fd37f699...

622 lines
19 KiB
Plaintext

<template>
<div class="wrapper">
<el-row>
<el-col :span="8">
<h3>{{ $t('trials:crcUpload:label:clinicalData') }}</h3>
</el-col>
<el-col :span="16" style="text-align:right;">
<h3>
<Pagination class="page" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" layout="total, sizes, prev, pager, next" :background="false" style="display: inline-block;" @pagination="getList" />
<!-- 重置 -->
<el-button icon="el-icon-refresh-left" size="small" circle :title="$t('common:button:reset')" @click="handleReset" />
</h3>
</el-col>
</el-row>
<el-table
ref="needSignDocList"
v-loading="listLoading"
:data="list"
:show-header="true"
height="calc(100% - 100px)"
@sort-change="handleSortByColumn"
>
<el-table-column type="index" width="40" />
<!-- 项目编号 -->
<el-table-column
:label="$t('trials:workbench:table:trialId')"
prop="TrialCode"
show-overflow-tooltip
sortable="custom"
/>
<!-- 试验名称 -->
<el-table-column
:label="$t('trials:workbench:table:experimentName')"
prop="ExperimentName"
show-overflow-tooltip
sortable="custom"
/>
<!-- 研究方案号 -->
<el-table-column
:label="$t('trials:workbench:table:researchNo')"
prop="ResearchProgramNo"
show-overflow-tooltip
sortable="custom"
/>
<!-- 加急量 -->
<el-table-column
:label="'加急量'"
prop="UrgentCount"
show-overflow-tooltip
sortable="custom"
width="190"
/>
<!-- 待核查量 -->
<el-table-column
:label="'待录入量'"
prop="ToBeDealedCount"
show-overflow-tooltip
sortable="custom"
width="190"
/>
<el-table-column
:label="$t('common:action:action')"
width="100"
>
<template slot-scope="scope">
<el-button
icon="el-icon-edit-outline"
circle
:title="$t('trials:workbench:action:sign')"
@click="handleUpload(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<el-dialog
v-if="configVisible"
:visible.sync="configVisible"
:close-on-click-modal="false"
width="800px"
:title="$t('trials:trialCfg:dialogTitle:cfgConfirm')"
custom-class="base-dialog-wrapper"
>
<div class="base-dialog-body">
<el-tabs type="border-card" :before-leave="() => {handleUpload(subjectRowData)}">
<el-tab-pane label="上传临床数据">
<el-table
:data="clinicalData"
border
v-loading="listLoading"
style="width: 100%"
size="small"
:span-method="objectSpanMethod"
>
<!-- 受试者 -->
<el-table-column
prop="SubjectCode"
label="受试者"
show-overflow-tooltip
width="120"
/>
<!-- 临床数据类型 -->
<el-table-column
prop="ClinicalDataSetName"
label="临床数据类型"
show-overflow-tooltip
/>
<!-- 配置值 -->
<el-table-column
prop="ClinicalCount"
label="记录数"
show-overflow-tooltip
/>
<el-table-column
:label="$t('common:action:action')"
width="150"
>
<template slot-scope="scope">
<el-button
icon="el-icon-plus"
circle
title="添加"
@click="handleAdd(scope.row)"
/>
<el-button
icon="el-icon-view"
circle
title="查看"
@click="handleView(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<div class="pagination" style="text-align: right;margin-top: 5px;">
<pagination :total="clinicalPageTotal" :page.sync="clinicalPage.PageIndex" :limit.sync="clinicalPage.PageSize" @pagination="getList" />
</div>
</el-tab-pane>
<el-tab-pane label="临床数据确认">
<el-tabs v-model="TrialReadingCriterionId" type="border-card">
<el-tab-pane v-for="item of trialCriterionList" :key="item.TrialReadingCriterionId" :label="item.TrialReadingCriterionName" :name="item.TrialReadingCriterionId">
<el-table
:data="confirmData"
v-loading="listLoading"
border
style="width: 100%"
size="small"
>
<el-table-column
prop="SubjectCode"
label="受试者"
show-overflow-tooltip
width="120"
/>
<el-table-column
prop="SubjectCode"
label="截止日期"
show-overflow-tooltip
width="120"
>
<template slot-scope="scope">
{{scope.row.LatestScanDate.split(' ')[0]}}
</template>
</el-table-column>
<el-table-column
prop="FormCount"
label="记录数"
show-overflow-tooltip
width="120"
/>
<el-table-column
prop=""
label="是否确认"
show-overflow-tooltip
width="120"
>
<template slot-scope="scope">
{{$fd('YesOrNo', scope.row.IsCRCConfirm)}}
</template>
</el-table-column>
<el-table-column
:label="$t('common:action:action')"
fixed="right"
>
<template slot-scope="scope">
<el-button
icon="el-icon-view"
circle
size="mini"
title="查看"
@click="getCRCBeConfirmList(scope.row, 'look')"
/>
<el-button
icon="el-icon-check"
:disabled="scope.row.IsCRCConfirm"
circle
size="mini"
title="确认"
@click="getCRCBeConfirmList(scope.row, 'confirm')"
/>
<el-button
icon="el-icon-back"
:disabled="!scope.row.IsCRCConfirm"
circle
size="mini"
title="取消确认"
@click="handleUnConfirm(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<div class="pagination" style="text-align: right;margin-top: 5px;">
<pagination :total="confirmPageTotal" :page.sync="confirmPage.PageIndex" :limit.sync="confirmPage.PageSize" @pagination="getList" />
</div>
</el-tab-pane>
</el-tabs>
</el-tab-pane>
</el-tabs>
</div>
</el-dialog>
<el-dialog
v-if="confirmVisible"
:visible.sync="confirmVisible"
:close-on-click-modal="false"
width="500px"
:title="confirmType === 'look' ? '查看临床数据' : '确认临床数据'"
custom-class="base-dialog-wrapper"
>
<div class="base-dialog-body">
<el-table
v-loading="listLoading"
:data="beConfirmList"
:show-header="true"
@sort-change="handleSortByColumn"
>
<el-table-column
prop="ClinicalDataSetName"
label="临床数据类型"
/>
<el-table-column
label="采集日期"
width="120"
>
<template slot-scope="scope">
{{scope.row.CheckDate.split(' ')[0]}}
</template>
</el-table-column>
<el-table-column
:label="$t('common:action:action')"
width="50"
fixed="right"
>
<template slot-scope="scope">
<el-button
icon="el-icon-view"
circle
size="mini"
title="查看"
@click="handleView2(scope.row)"
/>
</template>
</el-table-column>
</el-table>
</div>
<div class="base-dialog-footer" v-if="confirmType !== 'look'" style="text-align:right;margin-top:10px;">
<!-- 取消 -->
<el-button
size="small"
type="primary"
@click="confirmVisible = false"
>
{{ $t('common:button:cancel') }}
</el-button>
<!-- 保存 -->
<el-button size="small" type="primary" @click="confirmClinicalData">
{{ $t('common:button:confirm') }}
</el-button>
</div>
</el-dialog>
<el-dialog
v-if="preview.visible"
:visible.sync="preview.visible"
:close-on-click-modal="false"
:title="preview.title"
:fullscreen="true"
>
<clinicalDataQuestions
:data="rowData"
:trial-clinical-id="rowData.ClinicalDataTrialSetId"
:is-viewer="false"
:visit-id="rowData.VisitId"
:subject-id="rowData.SubjectId"
:trial-id="rowData.TrialId"
:reading-id="rowData.ReadingId"
:clinical-form-id="rowData.ClinicalFormId"
:open-type="openType"
@close="preview.visible = false;handleUpload(rowData)"
/>
</el-dialog>
<el-dialog
v-if="preview2.visible"
:visible.sync="preview2.visible"
:close-on-click-modal="false"
:title="preview2.title"
width="1200px"
>
<el-table
v-loading="listLoading"
:data="AnswerList"
:show-header="true"
@sort-change="handleSortByColumn"
>
<el-table-column
v-for="item of QuestionList"
:prop="item.Id"
:label="item.QuestionName"
show-overflow-tooltip
width="120"
/>
<el-table-column
:label="$t('common:action:action')"
width="150"
fixed="right"
>
<template slot-scope="scope">
<el-button
icon="el-icon-view"
circle
size="mini"
title="查看"
@click="handleView2(scope.row)"
/>
<el-button
icon="el-icon-edit-outline"
circle
size="mini"
title="编辑"
@click="handleEdit2(scope.row)"
/>
<el-button
icon="el-icon-delete"
circle
size="mini"
title="删除"
@click="handleDelete2(scope.row)"
/>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<script>
import { getImageClinicalDataToBeDoneList, getTrialCriterionList, getCRCSubjectClinicalList, deleteClinicalForm, getCRCConfirmList, getCRCBeConfirmList, cRCConfirmClinical, cRCCancelConfirmClinical } from '@/api/trials'
import { getClinicalQuestionFormList } from '@/api/dictionary'
import Pagination from '@/components/Pagination'
import clinicalDataQuestions from '@/components/clinicalDataQuestions'
const searchDataDefault = () => {
return {
pageIndex: 1,
pageSize: 20,
asc: true,
sortField: ''
}
}
export default {
name: 'NeedSignDoc',
components: { Pagination, clinicalDataQuestions },
data() {
return {
listLoading: false,
configVisible: false,
list: [],
listQuery: searchDataDefault(),
total: 0,
clinicalData: [],
rowData: {},
rowData2: {},
spanArr: [],
QuestionList: [],
AnswerList: [],
pos: 0,
pos2: 0,
spanArr2: 0,
confirmData: [],
preview: { visible: false, title: '临床数据自定义问题' },
preview2: { visible: false, title: '已上传临床数据列表' },
openType: 'look',
formListData: {},
confirmVisible: false,
subjectRowData: {},
beConfirmList: [],
trialCriterionList: [],
TrialReadingCriterionId: null,
confirmType: 'look',
confirmPageTotal: 0,
clinicalPageTotal: 0,
clinicalPage: {
PageIndex: 1,
PageSize: 20
},
confirmPage: {
PageIndex: 1,
PageSize: 20
},
}
},
watch: {
TrialReadingCriterionId(v) {
console.log(v)
this.handleUpload2(this.subjectRowData)
}
},
mounted() {
this.getList()
},
methods: {
getTrialCriterionList(row) {
getTrialCriterionList(row.TrialId, false).then(async res => {
this.trialCriterionList = res.Result
this.TrialReadingCriterionId = this.trialCriterionList[0].TrialReadingCriterionId
this.handleUpload2(this.subjectRowData)
this.isShow = true
}).catch(() => {
})
},
confirmClinicalData() {
cRCConfirmClinical({
TrialId: this.subjectRowData.TrialId,
SubjectId: this.rowData.SubjectId,
ReadModuleId: this.rowData.ReadModuleId,
}).then(res => {
this.$message.success('确认成功')
this.handleUpload2(this.subjectRowData)
this.getCRCBeConfirmList(this.rowData, 'confirm')
this.confirmVisible = false
})
},
handleUnConfirm(row) {
this.rowData = {...row}
this.$confirm('确定撤销确认吗?').then(res => {
cRCCancelConfirmClinical({
TrialId: this.subjectRowData.TrialId,
ReadModuleId: row.ReadModuleId,
}).then(res => {
this.$message.success('撤销成功')
this.handleUpload2(this.subjectRowData)
})
})
},
getCRCBeConfirmList(row, type) {
this.rowData = {...row}
this.confirmVisible = true
this.confirmType = type
getCRCBeConfirmList({
TrialId: this.subjectRowData.TrialId,
ReadModuleId: row.ReadModuleId
}).then(res => {
console.log(res.Result)
this.beConfirmList = res.Result
})
},
handleView2(row) {
console.log(row)
this.rowData = {...row}
this.openType = 'look'
this.preview.visible = true
},
handleEdit2(row) {
this.rowData = {...row}
this.openType = 'edit'
this.preview.visible = true
},
handleDelete2(row) {
this.$confirm('确定删除该条临床数据记录吗?').then(() => {
this.listLoading = true
deleteClinicalForm({
ClinicalFormId: row.ClinicalFormId
}).then(res => {
this.$message.success('删除成功')
this.listLoading = false
this.handleView(row)
})
})
},
handleAdd(row) {
this.rowData = {...row}
this.preview.visible = true
this.openType = 'add'
},
handleView(row) {
this.rowData = {...row}
this.listLoading = true
getClinicalQuestionFormList({
TrialId: row.TrialId,
SubjectId: row.SubjectId,
ClinicalDataTrialSetId: row.ClinicalDataTrialSetId
}).then(res => {
this.preview2.visible = true
this.listLoading = false
this.QuestionList = res.Result.QuestionList
this.AnswerList = res.Result.AnswerList
})
},
getSpanArr(data) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
this.spanArr.push(1)
this.pos = 0
} else {
// 判断当前元素与上一个元素是否相同
if (data[i].SubjectId === data[i - 1].SubjectId) {
this.spanArr[this.pos] += 1
this.spanArr.push(0)
} else {
this.spanArr.push(1)
this.pos = i
}
}
}
},
getSpanArr2(data) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
this.spanArr2.push(1)
this.pos2 = 0
} else {
// 判断当前元素与上一个元素是否相同
if (data[i].SubjectId === data[i - 1].SubjectId) {
this.spanArr2[this.pos2] += 1
this.spanArr2.push(0)
} else {
this.spanArr2.push(1)
this.pos2 = i
}
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
const _row = this.spanArr[rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col
}
}
},
getList() {
this.listLoading = true
getImageClinicalDataToBeDoneList(this.listQuery).then(res => {
this.listLoading = false
this.total = res.Result.TotalCount
this.list = res.Result.CurrentPageData
}).catch(() => { this.listLoading = false })
},
handleUpload2(row) {
this.listLoading = true
this.rowData = {...row}
getCRCConfirmList({
TrialId: row.TrialId,
TrialReadingCriterionId: this.TrialReadingCriterionId,
SubjectId: this.subjectRowData.SubjectId,
PageIndex: this.confirmPage.PageIndex,
PageSize: this.confirmPage.PageSize
}).then(res => {
this.spanArr2 = []
this.pos2 = 0
this.configVisible = true
this.confirmData = res.Result.CurrentPageData
this.confirmPageTotal = res.Result.TotalCount
this.getSpanArr2(this.confirmData)
this.listLoading = false
})
},
handleUpload(row) {
this.listLoading = true
this.rowData = {...row}
this.subjectRowData = {...row}
getCRCSubjectClinicalList({
TrialId: row.TrialId,
PageIndex: this.clinicalPage.PageIndex,
PageSize: this.clinicalPage.PageSize
}).then(res => {
this.spanArr = []
this.pos = 0
this.configVisible = true
this.clinicalData = res.Result.CurrentPageData
this.clinicalPageTotal = res.Result.TotalCount
this.getSpanArr(this.clinicalData)
this.listLoading = false
})
this.getTrialCriterionList(row)
},
handleReset() {
this.listQuery = searchDataDefault()
this.getList()
this.$nextTick(() => {
this.$refs.needSignDocList.clearSort()
})
},
// 排序
handleSortByColumn(column) {
if (column.order === 'ascending') {
this.listQuery.asc = true
} else {
this.listQuery.asc = false
}
this.listQuery.sortField = column.prop
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.wrapper{
height: 100%;
}
>>>.el-table__fixed-right{
height: 100%!important;
}
</style>