irc_web/.svn/pristine/fb/fb6c5da31cffba859f8e8897de1...

293 lines
8.2 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">
<el-tab-pane label="上传临床数据">
<el-table
:data="clinicalData"
border
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>
</el-tab-pane>
<el-tab-pane label="临床数据确认">
<el-table
:data="confirmData"
border
style="width: 100%"
size="small"
>
<!-- 配置项 -->
<el-table-column
prop="Name"
:label="$t('trials:trialCfg:table:cfgItem')"
show-overflow-tooltip
/>
<!-- 配置值 -->
<el-table-column
prop="NewVal"
:label="$t('trials:trialCfg:table:cfgVal')"
show-overflow-tooltip
/>
</el-table>
</el-tab-pane>
</el-tabs>
</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"
@close="preview.visible = false;handleUpload(rowData)"
/>
</el-dialog>
</div>
</template>
<script>
import { getImageClinicalDataToBeDoneList, getCRCSubjectClinicalList } from '@/api/trials'
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: {},
spanArr: [],
pos: 0,
confirmData: [],
preview: { visible: false, title: '临床数据自定义问题' },
}
},
mounted() {
this.getList()
},
methods: {
handleAdd(row) {
this.rowData = {...row}
this.preview.visible = true
},
handleView() {
},
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
}
}
}
},
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 })
},
handleUpload(row) {
this.listLoading = true
this.rowData = {...row}
getCRCSubjectClinicalList({
TrialId: row.TrialId
}).then(res => {
this.spanArr = []
this.pos = 0
this.configVisible = true
this.clinicalData = res.Result
this.getSpanArr(this.clinicalData)
this.listLoading = false
})
},
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%;
}
</style>