irc_web/.svn/pristine/c9/c98bf28cc02d3d3eea98be1f007...

751 lines
26 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<BaseContainer>
<!-- <template slot="search-container">
<el-button
v-hasPermi="['trials:trials-panel:enrolled-reviewers:list:enroll']"
icon="el-icon-plus"
type="primary"
style="margin-left: auto"
@click="handleEnroll"
>Enroll</el-button>
</template> -->
<template slot="main-container">
<!-- 入组医生列表 -->
<el-table
v-loading="listLoading"
v-adaptive="{bottomOffset:55}"
ref="myTable"
:data="list"
stripe
height="100"
@sort-change="handleSortByColumn"
>
<el-table-column type="index" width="40" />
<!-- Name -->
<el-table-column
:label="$t('trials:enrolledReviews:table:name')"
show-overflow-tooltip
min-width="150"
prop="FirstName"
sortable="custom"
>
<template slot-scope="scope">
<router-link
style="color: #00d1b2;"
tag="a"
:to="{
path: `/trialsResume?doctorId=${scope.row.DoctorId}&token=${token}`,
}"
target="_blank"
>{{ scope.row.LastName }} / {{ scope.row.FirstName }}</router-link>
</template>
</el-table-column>
<!-- Name CN -->
<el-table-column
prop="ChineseName"
sortable="custom"
:label="$t('trials:enrolledReviews:table:nameCN')"
min-width="110"
show-overflow-tooltip
/>
<!-- ID -->
<el-table-column
prop="UserName"
label="用户名"
min-width="80"
sortable="custom"
show-overflow-tooltip
/>
<!-- Status -->
<el-table-column
prop="EnrollTimeStr"
label="入组时间"
width="200"
sortable="custom"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.EnrollTime">
{{ `${scope.row.EnrollTime}` }}
</span>
</template>
</el-table-column>
<el-table-column
prop="EnrollTimeStr"
:label="$t('trials:enrolledReviews:table:status')"
width="100"
sortable="custom"
>
<template slot-scope="scope">
<div>
<el-switch
v-model="scope.row.IsEnable"
@change="(v) => {return isEnableChange(scope.row, v)}"
:active-value="true"
:inactive-value="false">
</el-switch>
<span>{{scope.row.IsEnable ? '启用' : '停用'}}</span>
</div>
</template>
</el-table-column>
<el-table-column
v-for="ite of TrialReadingCriterionList"
:label="ite.TrialReadingCriterionName"
width="360"
header-align="center"
show-overflow-tooltip
>
<el-table-column
:label="$t('trials:enrolledReviews:table:readingType')"
width="300"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-for="item of scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}) ? scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).ReadingCategorys : []">
<el-tag v-if="item === 1" type="primary">{{ $fd('ReadingCategory', item) + '&' + $fd('ReadingCategory', 2) }}</el-tag>
<!-- <el-tag v-if="item === 2" type="info">{{ $fd('ReadingCategory', item) }}</el-tag>-->
<el-tag v-if="item === 4" type="danger">{{ $fd('ReadingCategory', item) }}</el-tag>
<el-tag v-if="item === 5" type="warning">{{ $fd('ReadingCategory', item) }}</el-tag>
</span>
<el-button
v-hasPermi="['trials:trials-panel:enrolled-reviewers:list:edit']"
type="text"
@click="openSetEnrollReadingCategory(scope.row, ite.TrialReadingCriterionId)"
>
{{ $t('trials:enrolledReviews:button:config') }}
</el-button>
</template>
</el-table-column>
<el-table-column
:label="$t('trials:enrolledReviews:button:sow')"
width="160"
show-overflow-tooltip
>
<template slot-scope="scope">
<div v-if="scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).StatementCriterionFileList.length > 0">
<el-button type="text" @click="windowOpen(scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).StatementCriterionFileList[0].FilePath)">View</el-button>
</div>
<div v-else>
未上传
</div>
</template>
</el-table-column>
<el-table-column
:label="$t('trials:enrolledReviews:button:asow')"
width="160"
show-overflow-tooltip
>
<template slot-scope="scope">
<div v-if="scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).AcknowledgementCriterionFileList.length > 0">
<el-button type="text" @click="windowOpen(scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).AcknowledgementCriterionFileList[0].FilePath)">View</el-button>
</div>
<div v-else>
未上传
</div>
</template>
</el-table-column>
<el-table-column
:label="$t('trials:enrolledReviews:button:tackNum')"
width="200"
show-overflow-tooltip
>
<template slot-scope="scope">
<div>
{{scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).PendingCount}}
/
{{scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).ComplectedCount}}
/
{{scope.row.CriterionCategoryList.find(v => {return v.TrialReadingCriterionId === ite.TrialReadingCriterionId}).TotalCount}}
</div>
</template>
</el-table-column>
</el-table-column>
<!-- <el-table-column-->
<!-- :label="$t('trials:enrolledReviews:table:ackOfSow')"-->
<!-- width="200"-->
<!-- show-overflow-tooltip-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div-->
<!-- v-if="-->
<!-- scope.row.AgreementId != '00000000-0000-0000-0000-000000000000'-->
<!-- "-->
<!-- >-->
<!-- &lt;!&ndash; 查看 &ndash;&gt;-->
<!-- <el-button-->
<!-- type="text"-->
<!-- style="margin-right: 10px"-->
<!-- @click="handleViewAckSow(scope.row)"-->
<!-- >-->
<!-- {{ $t('trials:enrolledReviews:button:view') }}-->
<!-- </el-button>-->
<!-- &lt;!&ndash; 删除 &ndash;&gt;-->
<!-- <el-button-->
<!-- v-hasPermi="['trials:trials-panel:enrolled-reviewers:list:edit']"-->
<!-- type="text"-->
<!-- @click="handleDeleteAckSOW(scope.row)"-->
<!-- >-->
<!-- {{ $t('trials:enrolledReviews:button:delete') }}-->
<!-- </el-button>-->
<!-- </div>-->
<!-- <div v-else>-->
<!-- &lt;!&ndash; Not uploaded &ndash;&gt;-->
<!-- <span>{{ $t('trials:enrolledReviews:label:notUpload') }}</span>-->
<!-- &lt;!&ndash; 上传 &ndash;&gt;-->
<!-- <el-button-->
<!-- v-hasPermi="['trials:trials-panel:enrolled-reviewers:list:edit']"-->
<!-- type="text"-->
<!-- style="margin-left: 10px"-->
<!-- @click="handleUploadAckSow(scope.row)"-->
<!-- >-->
<!-- {{ $t('trials:enrolledReviews:button:upload') }}-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- v-if="hasPermi(['trials:trials-panel:enrolled-reviewers:list:stats']) && TrialReadingCriterionList.length"-->
<!-- fixed="right"-->
<!-- :label="$t('common:action:action')"-->
<!-- width="100"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- &lt;!&ndash; stats &ndash;&gt;-->
<!-- <el-button-->
<!-- v-hasPermi="['trials:trials-panel:enrolled-reviewers:list:stats']"-->
<!-- icon="el-icon-edit"-->
<!-- circle-->
<!-- :title="$t('trials:enrolledReviews:action:stats')"-->
<!-- @click="handleStats(scope.row)"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</template>
<!-- 上传SOW -->
<base-model :config="sow_model">
<template slot="dialog-body">
<upload-acksow
ref="uploadAckSow"
:trial-id="listQuery.TrialId"
:doctor-id="doctorId"
@getFileList="getFileList"
/>
</template>
</base-model>
<!-- 修改 Reading Type -->
<base-model :config="readingType_model">
<template slot="dialog-body">
<!-- Reading Type -->
<label>{{ $t('trials:enrolledReviews:table:readingType') }}: </label>
<el-select
v-model="readingType"
filterable
allow-create
default-first-option
style="width: 70%"
>
<el-option :value="0" label="TP&GL&AD" />
<el-option :value="1" label="TP&GL" />
<el-option :value="2" label="AD" />
</el-select>
</template>
<template slot="dialog-footer">
<el-button
:disabled="readingType_model.btnLoading"
type="primary"
@click="readingType_model.visible = false"
>
{{ $t('common:button:cancel') }}
</el-button>
<el-button
type="primary"
:loading="readingType_model.btnLoading"
@click="handleUpdateReadingType"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</base-model>
<!-- 修改 readingCategory -->
<base-model :config="readingCategory_model">
<template slot="dialog-body">
<!-- Reading Type -->
<label>{{ $t('trials:enrolledReviews:table:readingType') }}: </label>
<el-select
v-model="ReadingCategorys"
filterable
allow-create
multiple
default-first-option
style="width: 70%"
>
<el-option v-for="item of $d.ReadingCategory" :key="item.id" v-if="item.value === 1" :value="1" :label="$fd('ReadingCategory', 1) + '&' + $fd('ReadingCategory', 2)" />
<el-option v-for="item of $d.ReadingCategory" :key="item.id" v-if="item.value === 4 && IsArbitrationReading" :value="item.value" :label="$fd('ReadingCategory', 4)" />
<el-option v-for="item of $d.ReadingCategory" :key="item.id" v-if="item.value === 5 && IsOncologyReading" :value="item.value" :label="$fd('ReadingCategory', 5)" />
</el-select>
</template>
<template slot="dialog-footer">
<el-button
:disabled="readingCategory_model.btnLoading"
type="primary"
@click="readingCategory_model.visible = false"
>
{{ $t('common:button:cancel') }}
</el-button>
<el-button
type="primary"
:loading="readingCategory_model.btnLoading"
@click="handleUpdateReadingCategory"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</base-model>
<!-- 修改医生状态 -->
<base-model :config="reviewerStatus_model">
<template slot="dialog-body">
<el-form
ref="updateStatusForm"
:model="updateStatusForm"
:rules="updateStatusFormrules"
>
<el-form-item :label="$t('trials:enrolledReviews:label:enrollmentStatus')" prop="Status">
<el-select
v-model="updateStatusForm.Status"
style="width:60%;"
>
<!-- 0回退1出组 -->
<el-option v-for="item of $d.OutOrInEnrollment" :value="item.value" :label="item.label" :disabled="item.value === 0 && currentWorkload>0" />
</el-select>
</el-form-item>
<el-form-item
v-if="updateStatusForm.Status== 1"
:label="$t('trials:enrolledReviews:label:outOfEnrollmentTime')"
prop="OutEnrollmentTime"
>
<el-date-picker
v-model="updateStatusForm.OutEnrollmentTime"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
/>
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer">
<el-button
:disabled="reviewerStatus_model.btnLoading"
type="primary"
@click="reviewerStatus_model.visible = false"
>
{{ $t('common:button:cancel') }}
</el-button>
<el-button
type="primary"
:loading="reviewerStatus_model.btnLoading"
@click="handleUpdateReviewerStatus"
>
{{ $t('common:button:save') }}
</el-button>
</template>
</base-model>
</BaseContainer>
</template>
<script>
import {
getTrialEnrollmentWorkloadStats,
deleteReviewerAckSOW,
updateReviewerReadingType,
enrollBackOrOut,
setEnrollReadingCategory
} from '@/api/trials'
import { updateTrialReviewerState } from '@/api/trials/reading'
import UploadAcksow from './components/UploadAcksow'
import store from '@/store'
import BaseContainer from '@/components/BaseContainer'
import BaseModel from '@/components/BaseModel'
export default {
components: { UploadAcksow, BaseContainer, BaseModel },
data() {
return {
list: [],
TrialReadingCriterionId: null,
listQuery: {
TrialId: '',
PageIndex: 1,
PageSize: 100,
Asc: false,
SortField: ''
},
doctorId: '',
currentRow: {},
listLoading: false,
total: 0,
trialId: '',
currentClickRowData: '',
readingType: '',
sow_model: {
visible: false,
title: this.$t('trials:enrolledReviews:dialogTitle:signedAckOfSow'),
showClose: true,
width: '500px'
},
readingType_model: {
visible: false,
title: this.$t('trials:enrolledReviews:dialogTitle:changeReadingType'),
showClose: true,
width: '500px',
btnLoading: false
},
readingCategory_model: {
visible: false,
title: this.$t('trials:enrolledReviews:dialogTitle:changeReadingType'),
showClose: true,
width: '500px',
btnLoading: false
},
reviewerStatus_model: {
visible: false,
title: this.$t('trials:enrolledReviews:dialogTitle:changeStatus'),
showClose: true,
width: '500px',
btnLoading: false
},
updateStatusForm: {
Status: '',
OutEnrollmentTime: ''
},
updateStatusFormrules: {
Status: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
OutEnrollmentTime: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }]
},
token: store.getters.token,
ReadingCategorys: [],
apiReadingCategorys: [],
TrialReadingCriterionList: [],
IsArbitrationReading: true,
IsOncologyReading: true
}
},
computed: {
currentWorkload() {
if (Object.keys(this.currentRow).length === 0) return 0
var total = this.currentRow.Adjudication + this.currentRow.AdjudicationIn24H + this.currentRow.AdjudicationIn48H + this.currentRow.Timepoint + this.currentRow.TimepointIn24H + this.currentRow.TimepointIn48H + this.currentRow.TrainingTimes + this.currentRow.RefresherTraining + this.currentRow.Global + this.currentRow.Downtime
return total
}
},
mounted() {
this.trialId = this.$route.query.trialCode
this.listQuery.TrialId = this.$route.query.trialId
this.initPage()
},
methods: {
windowOpen(url) {
console.log(url)
window.open(url)
},
isEnableChange(row, v) {
console.log(row)
this.listLoading = true
updateTrialReviewerState({
TrialId: this.listQuery.TrialId,
IsEnable: v,
EnrollId: row.EnrollId
}).then(res => {
this.$message.success('保存成功')
this.listLoading = false
}).catch(() => {
this.listLoading = false
})
},
handleUpdateReadingCategory() {
this.readingCategory_model.btnLoading = true
this.readingCategory_model.showClose = false
var params = {
TrialId: this.$route.query.trialId,
EnrollId: this.currentRow.EnrollId,
ReadingCategorys: Object.assign([], this.ReadingCategorys),
TrialReadingCriterionId: this.TrialReadingCriterionId
}
if (~this.ReadingCategorys.indexOf(1)) {
params.ReadingCategorys.push(2)
}
setEnrollReadingCategory(params)
.then(res => {
this.readingCategory_model.visible = false
this.readingCategory_model.btnLoading = false
this.readingCategory_model.showClose = true
this.initPage()
this.$message.success(this.$t('common:message:savedSuccessfully'))
}).catch(_ => {
this.readingCategory_model.btnLoading = false
this.readingCategory_model.showClose = true
})
},
openSetEnrollReadingCategory(row, TrialReadingCriterionId) {
// this.ReadingCategorys = []
console.log(row)
this.currentRow = row
this.TrialReadingCriterionId = TrialReadingCriterionId
this.readingCategory_model.visible = true
var o = row.CriterionCategoryList.find(v => {
return v.TrialReadingCriterionId === TrialReadingCriterionId
}) ? row.CriterionCategoryList.find(v => {
return v.TrialReadingCriterionId === TrialReadingCriterionId
}) : null
var i = row.TrialReadingCriterionList.find(v => {
return v.TrialReadingCriterionId === TrialReadingCriterionId
}) ? row.TrialReadingCriterionList.find(v => {
return v.TrialReadingCriterionId === TrialReadingCriterionId
}) : null
if (i) {
this.IsArbitrationReading = i.IsArbitrationReading
this.IsOncologyReading = i.IsOncologyReading
}
// index不能等于-1(删最后一个元素)和空(删第一个元素)
this.ReadingCategorys = Object.assign([], o.ReadingCategorys)
this.currentRow.TrialReadingCriterionId = TrialReadingCriterionId
var index = o ? o.ReadingCategorys.indexOf(2) : -1
if (index >= 0){
this.ReadingCategorys.splice(index,1);
}
},
// 获取入组医生列表数据
initPage() {
this.listLoading = true
getTrialEnrollmentWorkloadStats(this.listQuery).then((res) => {
this.listLoading = false
this.list = res.Result.CurrentPageData
if (this.list.length > 0) {
this.TrialReadingCriterionList = this.list[0].TrialReadingCriterionList
}
this.total = res.Result.TotalCount
this.$nextTick(() => {
// myTable是表格的ref属性值
if (this.$refs.myTable && this.$refs.myTable.doLayout) {
this.$refs.myTable.doLayout();
}
})
}).catch(() => {
this.listLoading = false
})
},
// Enroll按钮回调
handleEnroll() {
this.$router.push({
path: `/trials/trials-panel/enrolled-reviewers/enroll?trialId=${this.listQuery.TrialId}&trialCode=${this.trialId}`
})
},
// 打开修改状态模态框
changeStatus(row) {
this.reviewerStatus_model.visible = true
this.currentRow = row
},
// 更新医生状态信息
handleUpdateReviewerStatus() {
this.$refs.updateStatusForm.validate(valid => {
if (!valid) return
this.reviewerStatus_model.btnLoading = true
this.reviewerStatus_model.showClose = false
enrollBackOrOut(this.listQuery.TrialId, this.currentRow.DoctorId, this.updateStatusForm.Status)
.then(res => {
this.$nextTick(() => {
this.$refs['updateStatusForm'].resetFields()
})
this.reviewerStatus_model.btnLoading = false
this.reviewerStatus_model.visible = false
this.reviewerStatus_model.showClose = true
this.initPage()
this.$message.success(this.$t('common:message:savedSuccessfully'))
})
.catch(() => {
this.reviewerStatus_model.btnLoading = false
this.reviewerStatus_model.showClose = true
})
})
},
// 打开修改reading type模态框
handleConfigReadingType(row) {
this.readingType_model.visible = true
const { ReviewerReadingType } = row
this.readingType = ReviewerReadingType
this.currentRow = row
},
// 更新 reading type
handleUpdateReadingType() {
this.readingType_model.btnLoading = true
this.readingType_model.showClose = false
updateReviewerReadingType(this.listQuery.TrialId, this.currentRow.DoctorId, this.readingType)
.then(res => {
this.readingType_model.visible = false
this.readingType_model.btnLoading = false
this.readingType_model.showClose = true
this.initPage()
this.$message.success(this.$t('common:message:savedSuccessfully'))
}).catch(_ => {
this.readingType_model.btnLoading = false
this.readingType_model.showClose = true
})
},
// 排序
handleSortByColumn(column) {
if (column.order === 'ascending') {
this.listQuery.Asc = true
} else {
this.listQuery.Asc = false
}
column.prop === 'EnrollTimeStr'
? (this.listQuery.SortField = 'EnrollTime')
: (this.listQuery.SortField = column.prop)
this.listQuery.PageIndex = 1
this.initPage()
},
// 医生详情页跳转
handleReviewerDetail(row) {
const { href } = this.$router.resolve({ path: `/trials/trials-panel/enrolled-reviewers/resume?doctorId=${row.DoctorId}` })
window.open(href, '_blank')
},
// 上传SOW
handleUploadAckSow(row) {
this.doctorId = row.DoctorId
this.currentRow = row
this.sow_model.visible = true
let fileList = []
if (row.AgreementId !== '00000000-0000-0000-0000-000000000000') {
fileList = [
{
DoctorId: row.DoctorId,
name: row.AgreementFileName,
FileName: row.AgreementFileName,
Path: row.AgreementPath,
FullPath: row.AgreementFullPath,
Type: 'ACK of SOW'
}
]
}
this.$nextTick(function() {
this.$refs.uploadAckSow.initFileList(fileList)
})
},
// 获取上传控件种SOW文件列表
getFileList(fileList) {
this.currentRow.AgreementId =
fileList.length > 0
? fileList[0].Id
: '00000000-0000-0000-0000-000000000000'
this.currentRow.AgreementFileName =
fileList.length > 0 ? fileList[0].FileName : ''
this.currentRow.AgreementFullPath =
fileList.length > 0 ? fileList[0].FullPath : ''
this.currentRow.AgreementPath =
fileList.length > 0 ? fileList[0].Path : ''
},
// 预览SOW
handleViewAckSow(row) {
row.AgreementFullPath ? window.open(row.AgreementFullPath, '_blank') : ''
},
// 删除SOW文件
handleDeleteAckSOW(row) {
this.$confirm(this.$t('trials:enrolledReviews:message:deleteSOWWarning'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
deleteReviewerAckSOW(
this.listQuery.TrialId,
row.DoctorId,
row.AgreementId
).then((res) => {
row.AgreementId = '00000000-0000-0000-0000-000000000000'
row.AgreementFileName = ''
row.AgreementFullPath = ''
row.AgreementPath = ''
this.$message.success(this.$t('common:message:savedSuccessfully'))
})
})
.catch((action) => {})
},
// 跳转工作量统计页
handleStats(row) {
this.currentClickRowData = row
if (row.AgreementId === '00000000-0000-0000-0000-000000000000') {
// 'Ack-Sow is not uploaded, continue'
this.$confirm(this.$t('trials:enrolledReviews:message:statsWarning'), {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.handleTipCloseOK()
})
.catch(_ => {})
} else {
this.handleTipCloseOK()
}
},
handleTipCloseOK() {
zzSessionStorage.setItem(
'ReviewerName',
this.currentClickRowData.FirstName +
' ' +
this.currentClickRowData.LastName
)
this.$router.push({
path: `/trials/trials-panel/enrolled-reviewers/stats?doctorId=${this.currentClickRowData.DoctorId}&trialId=${this.listQuery.TrialId}&trialCode=${this.trialId}&doctorName=${this.currentClickRowData.LastName}/${this.currentClickRowData.FirstName}`
})
},
// 合计行
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = 'Total (Current Page)'
return
}
const values = data.map((item) => Number(item[column.property]))
if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
}
})
return sums
}
}
}
</script>
<style lang="scss">
.enroll-list {
height: 100%;
.filter-box {
display: flex;
align-items: center;
padding: 5px 0px;
}
}
</style>