1440 lines
52 KiB
Plaintext
1440 lines
52 KiB
Plaintext
<template>
|
||
<BaseContainer>
|
||
<template slot="search-container">
|
||
<el-form :inline="true">
|
||
<el-form-item :label="$t('trials:consistencyCheck:table:siteId')">
|
||
<el-select v-model="searchData.SiteId" clearable filterable style="width:120px;">
|
||
<el-option
|
||
v-for="(item,index) of siteOptions"
|
||
:key="index"
|
||
:label="item.TrialSiteCode"
|
||
:value="item.SiteId"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<!-- 受试者编号 -->
|
||
<el-form-item :label="$t('trials:consistencyCheck:table:subjectId')">
|
||
<el-input v-model="searchData.SubjectCode" style="width:100px;" />
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="任务名称">
|
||
<el-input
|
||
v-model="searchData.TaskName"
|
||
style="width:100px;"
|
||
clearable
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="阅片人">
|
||
<el-select v-model="searchData.DoctorUserId" clearable style="width:120px;">
|
||
<el-option v-for="item of DoctorUserList" :key="'阅片人' + item.DoctorUserId" :value="item.DoctorUserId" :label="`${item.UserName}(${item.FullName})`" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="是否加急">
|
||
<el-select v-model="searchData.IsUrgent" clearable style="width:120px;">
|
||
<el-option v-for="item of $d.YesOrNo" :key="'是否加急' + item.value" :value="item.value" :label="item.label" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="任务类型">
|
||
<el-select v-model="searchData.ReadingCategory" clearable style="width:120px;">
|
||
<el-option v-for="item of $d.ReadingCategory" :key="'任务类型' + item.value" :value="item.value" :label="item.label" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="分配状态">
|
||
<el-select v-model="searchData.TaskState" clearable style="width:120px;">
|
||
<el-option v-for="item of $d.TaskState" :key="'分配状态' + item.value" :value="item.value" :label="item.label" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px" label="分配时间">
|
||
<el-date-picker
|
||
v-model="timeList"
|
||
value-format="yyyy-MM-dd HH:mm:ss"
|
||
type="datetimerange"
|
||
range-separator="至"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期"
|
||
@change="changeTimeList"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item style="margin-bottom:10px">
|
||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
||
{{ $t('common:button:search') }}
|
||
</el-button>
|
||
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
|
||
{{ $t('common:button:reset') }}
|
||
</el-button>
|
||
<el-button type="primary" icon="el-icon-edit-outline" @click="openAllocationConfigVisible">
|
||
分配规则
|
||
</el-button>
|
||
<el-button type="primary" icon="el-icon-edit-outline" @click="openAutoAlloction">
|
||
分配阅片人
|
||
</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</template>
|
||
<template slot="main-container">
|
||
<el-table
|
||
v-adaptive="{bottomOffset:60}"
|
||
v-loading="loading"
|
||
:data="list"
|
||
stripe
|
||
height="100"
|
||
@sort-change="handleSortChange"
|
||
>
|
||
<el-table-column
|
||
prop="IsUrgent"
|
||
:label="$t('trials:consistencyCheck:table:isUrgent')"
|
||
show-overflow-tooltip
|
||
min-width="100"
|
||
sortable="custom"
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="scope.row.IsUrgent" type="danger">{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag>
|
||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="TaskCode"
|
||
label="任务编号"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="TrialSiteCode"
|
||
label="中心编号"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="SubjectCode"
|
||
label="受试者编号"
|
||
min-width="120"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="TaskName"
|
||
label="访视/阅片期名称"
|
||
min-width="160"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="TaskBlindName"
|
||
label="访视盲态名称"
|
||
min-width="140"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="CreateTime"
|
||
label="任务创建时间"
|
||
min-width="140"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="ReadingCategory"
|
||
label="阅片类别"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag type="primary">{{ $fd('ReadingCategory', scope.row.ReadingCategory) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="TaskState"
|
||
label="任务状态"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="!scope.row.TaskState" type="danger">{{ $fd('TaskState', scope.row.TaskState) }}</el-tag>
|
||
<el-tag v-else type="primary">{{ $fd('TaskState', scope.row.TaskState) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="ArmEnum"
|
||
label="任务组"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag type="primary">{{ $fd('ArmEnum', scope.row.ArmEnum) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="阅片人"
|
||
min-width="180"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{`${scope.row.UserName}(${scope.row.FullName})`}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="AllocateTime"
|
||
label="分配时间"
|
||
min-width="100"
|
||
sortable="custom"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
fixed="right"
|
||
label="操作"
|
||
width="300"
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
:disabled="scope.row.TaskState === 2 || scope.row.UserName"
|
||
icon="el-icon-thumb"
|
||
circle
|
||
title="分配"
|
||
@click="assignSubjectTaskToDoctor(scope.row, 1)"
|
||
/>
|
||
<el-button
|
||
:disabled="scope.row.TaskState === 2 || !scope.row.UserName"
|
||
icon="el-icon-check"
|
||
circle
|
||
title="确认"
|
||
@click="assignSubjectTaskToDoctor(scope.row,3)"
|
||
/>
|
||
<el-button
|
||
:disabled="scope.row.TaskState === 0"
|
||
icon="el-icon-close"
|
||
circle
|
||
title="取消分配"
|
||
@click="assignSubjectTaskToDoctor(scope.row,4)"
|
||
/>
|
||
<el-button
|
||
:disabled="!scope.row.UserName"
|
||
icon="el-icon-refresh-left"
|
||
circle
|
||
title="重新分配"
|
||
@click="assignSubjectTaskToDoctor(scope.row,2)"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<!-- 分页组件 -->
|
||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
|
||
<!-- 详情 -->
|
||
<el-dialog
|
||
title="分配规则"
|
||
:visible.sync="AllocationConfigVisible"
|
||
width="1200px"
|
||
:close-on-click-modal="false"
|
||
custom-class="base-dialog-wrapper"
|
||
>
|
||
<div class="base-dialog-body" style="position: relative">
|
||
<el-divider content-position="left">首次分配规则</el-divider>
|
||
<el-button size="small" type="primary" style="position: absolute;right: 10px;top: 60px;z-index: 100;" :loading="btnLoading" @click="addOrEdit()">
|
||
添加阅片人
|
||
</el-button>
|
||
<el-form
|
||
ref="signForm"
|
||
size="small"
|
||
label-width="100px"
|
||
>
|
||
<el-form-item label="分配对象">
|
||
<el-radio-group v-model="TrialTaskInfo.TaskAllocateObjEnum">
|
||
<el-radio v-for="item of $d.TaskAllocateObj" :key="'TaskAllocateObjEnum' + item.value" :label="item.value" :disabled="item.value === 1">{{ item.label }}</el-radio>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
<el-form-item label="阅片人列表">
|
||
<el-table
|
||
v-loading="loading"
|
||
border
|
||
:data="TaskAllocationRuleList"
|
||
stripe
|
||
>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="阅片人"
|
||
min-width="180"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{`${scope.row.UserName}(${scope.row.FullName})`}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="PlanReadingRatio"
|
||
label="计划受试者比例"
|
||
min-width="130"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.PlanReadingRatio ? scope.row.PlanReadingRatio + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="当前受试者比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalSubjectCount > 0 ? (scope.row.SelfApplyedSubjectCount * 100 / scope.row.ApplyedTotalSubjectCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配任务比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalTaskCount > 0 ? (scope.row.SelfApplyedTaskCount * 100 / scope.row.ApplyedTotalTaskCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配总任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfApplyedTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="待处理任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfUndoTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="IsEnable"
|
||
label="状态"
|
||
min-width="80"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="!scope.row.IsEnable" type="danger">{{ $fd('IsEnable', scope.row.IsEnable) }}</el-tag>
|
||
<el-tag v-else>{{ $fd('IsEnable', scope.row.IsEnable) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="Note"
|
||
label="备注"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
fixed="right"
|
||
label="操作"
|
||
width="180"
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
circle
|
||
icon="el-icon-edit-outline"
|
||
title="编辑"
|
||
@click="addOrEdit(scope.row)"
|
||
/>
|
||
<el-button
|
||
circle
|
||
icon="el-icon-delete"
|
||
title="删除"
|
||
@click="handleDelete(scope.row)"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
</el-form-item>
|
||
<el-divider content-position="left">后续分配规则</el-divider>
|
||
<el-descriptions class="margin-top" :column="1">
|
||
<el-descriptions-item>
|
||
<template slot="label">
|
||
<el-checkbox v-model="value1" disabled>同一病例随访阅片任务自动分配(在拟分配的阅片人未标记为退出项目状态时) </el-checkbox>
|
||
</template>
|
||
<div style="margin-left: 10px;">
|
||
默认状态
|
||
</div>
|
||
<el-radio-group v-model="TrialTaskInfo.FollowVisitAutoAssignDefaultState">
|
||
<el-radio style="margin-left: 10px;" :label="1">已分配</el-radio>
|
||
<el-radio :label="0">预分配</el-radio>
|
||
</el-radio-group>
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="同一病例随访阅片任务自动分配(在拟分配的阅片人未标记为退出项目状态时)">
|
||
<template slot="label">
|
||
<el-checkbox v-model="value1" disabled>同一病例全局任务自动分配(在拟分配的阅片人未标记为退出项目状态时 </el-checkbox>
|
||
</template>
|
||
<div style="margin-left: 10px;">
|
||
默认状态
|
||
</div>
|
||
<el-radio-group v-model="TrialTaskInfo.FollowGlobalVisitAutoAssignDefaultState">
|
||
<el-radio style="margin-left: 10px;" :label="1">已分配</el-radio>
|
||
<el-radio :label="0">预分配</el-radio>
|
||
</el-radio-group>
|
||
</el-descriptions-item>
|
||
</el-descriptions>
|
||
</el-form>
|
||
</div>
|
||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||
<!-- 取消 -->
|
||
<el-button
|
||
:disabled="btnLoading"
|
||
size="small"
|
||
type="primary"
|
||
@click="handleCancel"
|
||
>
|
||
{{ $t('common:button:cancel') }}
|
||
</el-button>
|
||
<!-- 保存 -->
|
||
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">
|
||
{{ $t('common:button:save') }}
|
||
</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog
|
||
v-if="taskAllocationRuleVisible"
|
||
:title="title"
|
||
:visible.sync="taskAllocationRuleVisible"
|
||
width="600px"
|
||
:close-on-click-modal="false"
|
||
>
|
||
<AddOrEditTaskAllocationRule :data="rowData" :doctor-user-list="DoctorUserList" @close="() => {taskAllocationRuleVisible = false}" @getList="openAllocationConfigVisible" />
|
||
</el-dialog>
|
||
|
||
<!-- 临床资料 -->
|
||
<el-dialog
|
||
v-if="AutoAlloctionVisible"
|
||
title="分配阅片人"
|
||
:visible.sync="AutoAlloctionVisible"
|
||
:close-on-click-modal="false"
|
||
:fullscreen="true"
|
||
append-to-body
|
||
custom-class="base-dialog-wrapper"
|
||
>
|
||
<el-divider content-position="left">分配规则</el-divider>
|
||
<el-descriptions class="margin-top" :column="3" border>
|
||
<el-descriptions-item>
|
||
<template slot="label">
|
||
分配对象
|
||
</template>
|
||
{{ $fd('TaskAllocateObj', TrialTaskInfo.TaskAllocateObjEnum) }}
|
||
</el-descriptions-item>
|
||
<el-descriptions-item>
|
||
<template slot="label">
|
||
备选医生
|
||
</template>
|
||
<el-tag>{{ TaskAllocationRuleList.length ? TaskAllocationRuleList.map(v => `${v.UserName}(${v.FullName})`).toString().replaceAll(',', '/') : '无' }}</el-tag>
|
||
</el-descriptions-item>
|
||
</el-descriptions>
|
||
<el-divider content-position="left">受试者阅片人最新关系表</el-divider>
|
||
<el-form :inline="true">
|
||
<el-form-item :label="$t('trials:consistencyCheck:table:siteId')">
|
||
<el-select v-model="taskSearchData.SiteId" clearable filterable style="width:120px;">
|
||
<el-option
|
||
v-for="(item,index) of siteOptions"
|
||
:key="'taskSearchData' + index"
|
||
:label="item.TrialSiteCode"
|
||
:value="item.SiteId"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<!-- 受试者编号 -->
|
||
<el-form-item :label="$t('trials:consistencyCheck:table:subjectId')">
|
||
<el-input v-model="taskSearchData.SubjectCode" style="width:100px;" />
|
||
</el-form-item>
|
||
<el-form-item label="阅片人">
|
||
<el-select v-model="taskSearchData.DoctorUserId" clearable style="width:120px;">
|
||
<el-option v-for="item of DoctorUserList" :key="'taskSearchData' + item.DoctorUserId" :value="item.DoctorUserId" :label="`${item.UserName}(${item.FullName})`" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="是否已分配阅片人">
|
||
<el-select v-model="taskSearchData.IsHaveAssigned" clearable style="width:120px;">
|
||
<el-option v-for="item of $d.YesOrNo" :key="'taskSearchData.IsHaveAssigned' + item.value" :value="item.value" :label="item.label" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="是否生效">
|
||
<el-select v-model="taskSearchData.IsHaveApplyedTask" clearable style="width:120px;">
|
||
<el-option v-for="item of $d.YesOrNo" :key="'taskSearchData.IsHaveAssigned' + item.value" :value="item.value" :label="item.label" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item>
|
||
<el-button type="primary" icon="el-icon-search" @click="openAutoAlloction">
|
||
{{ $t('common:button:search') }}
|
||
</el-button>
|
||
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset2">
|
||
{{ $t('common:button:reset') }}
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading" @click="autoSubjectAssignDoctor">
|
||
自动分配阅片人
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading" @click="manualAllocation()">
|
||
手动分配阅片人
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading" @click="cancelSubjectAssignDoctor()">
|
||
清空阅片人
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading" @click="manualAssignDoctorApplyTask(null)">
|
||
生效
|
||
</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
<el-table
|
||
v-loading="loading"
|
||
v-adaptive="{bottomOffset:100}"
|
||
border
|
||
:data="SubjectAssignList"
|
||
stripe
|
||
@selection-change="handleSubjectAssignListSelectChange"
|
||
>
|
||
<el-table-column type="selection" align="left" width="45" />
|
||
<el-table-column
|
||
prop="TrialSiteCode"
|
||
label="中心编号"
|
||
width="140"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
prop="SubjectCode"
|
||
label="受试者编号"
|
||
width="140"
|
||
show-overflow-tooltip
|
||
/>
|
||
<el-table-column
|
||
v-if="ReadingType === 1"
|
||
prop="SubjectCode"
|
||
label="阅片人"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.DoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
|
||
<div v-for="item of scope.row.DoctorUserList" :key="'SubjectCode' + item.UserName" style="display: flex;justify-content: center;align-items: center;margin-right: 5px;">
|
||
<el-tag>
|
||
{{ `${item.UserName}(${item.FullName})` }}
|
||
</el-tag>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
v-if="ReadingType === 2"
|
||
prop="SubjectCode"
|
||
label="阅片人(组001)"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.DoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
|
||
<el-tag>
|
||
{{ `${scope.row.DoctorUserList[0].UserName}(${scope.row.DoctorUserList[0].FullName})` }}
|
||
</el-tag>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
v-if="ReadingType === 2"
|
||
prop="SubjectCode"
|
||
label="阅片人(组002)"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.DoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
|
||
<el-tag>
|
||
{{ `${scope.row.DoctorUserList[1].UserName}(${scope.row.DoctorUserList[1].FullName})` }}
|
||
</el-tag>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="SubjectCode"
|
||
label="是否分配阅片人"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="!scope.row.IsAssignedDoctorUser" type="danger">{{ $fd('YesOrNo', scope.row.IsAssignedDoctorUser) }}</el-tag>
|
||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsAssignedDoctorUser) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="SubjectCode"
|
||
label="是否生效"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="!scope.row.IsAssignDoctorApplyedTask" type="danger">{{ $fd('YesOrNo', scope.row.IsAssignDoctorApplyedTask) }}</el-tag>
|
||
<el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsAssignDoctorApplyedTask) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column
|
||
prop="SubjectCode"
|
||
label="绑定时间"
|
||
width="240"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.DoctorUserList.length ? scope.row.DoctorUserList[0].AssignTime : '' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop=""
|
||
label="操作"
|
||
width="180"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
circle
|
||
icon="el-icon-connection"
|
||
title="应用"
|
||
@click="manualAssignDoctorApplyTask(scope.row)"
|
||
/>
|
||
<el-button
|
||
circle
|
||
icon="el-icon-close"
|
||
title="清空阅片人"
|
||
@click="cancelSubjectAssignDoctor(scope.row)"
|
||
/>
|
||
<el-button
|
||
circle
|
||
icon="el-icon-refresh-right"
|
||
title="手动分配"
|
||
@click="manualAllocation(scope.row)"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<pagination style="text-align: right;margin-top: 10px;" class="page" :total="SubjectAssignListTotal" :page.sync="taskSearchData.PageIndex" :limit.sync="taskSearchData.PageSize" @pagination="openAutoAlloction" />
|
||
</el-dialog>
|
||
<el-dialog
|
||
v-if="manualAllocationVisible"
|
||
id="TaskAllocationRuleList"
|
||
title="选择阅片人"
|
||
:visible.sync="manualAllocationVisible"
|
||
width="1000px"
|
||
:close-on-click-modal="false"
|
||
>
|
||
<div>
|
||
<div style="line-height: 32px">
|
||
当前项目阅片模式为:{{ $fd('ReadingMethod', ReadingType) }}
|
||
</div>
|
||
<div v-if="ReadingType === 2" style="line-height: 32px;margin-bottom: 10px;">
|
||
当前选择阅片人为:<el-tag v-if="TaskAllocationRuleSelectList.length">组001:{{ `${TaskAllocationRuleSelectList[0].UserName.toString()}(${TaskAllocationRuleSelectList[0].FullName})` }}</el-tag>
|
||
<el-tag v-if="TaskAllocationRuleSelectList.length > 1">组002:{{ `${TaskAllocationRuleSelectList[1].UserName.toString()}(${TaskAllocationRuleSelectList[1].FullName})` }}</el-tag>
|
||
</div>
|
||
<div style="font-size: 12px;color:#f00;margin-bottom: 20px;">
|
||
双重阅片模式下,阅片人根据勾选顺序进行分组
|
||
</div>
|
||
<div v-if="ReadingType === 1" style="line-height: 32px;margin-bottom: 10px;">
|
||
当前选择阅片人为:<el-tag v-if="TaskAllocationRuleSelectList.length">{{ TaskAllocationRuleSelectList.map(v => `${v.UserName}(${v.FullName})`).toString() }}</el-tag>
|
||
</div>
|
||
</div>
|
||
<el-table
|
||
v-loading="loading"
|
||
border
|
||
:data="TaskAllocationRuleList"
|
||
stripe
|
||
@selection-change="handleTaskAllocationRuleListSelectChange"
|
||
>
|
||
<el-table-column :selectable="selectable" type="selection" align="left" width="45" />
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="阅片人"
|
||
min-width="180"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{`${scope.row.UserName}(${scope.row.FullName})`}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="PlanReadingRatio"
|
||
label="计划受试者比例"
|
||
min-width="130"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.PlanReadingRatio ? scope.row.PlanReadingRatio + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="当前受试者比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalSubjectCount > 0 ? (scope.row.SelfApplyedSubjectCount * 100 / scope.row.ApplyedTotalSubjectCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配任务比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalTaskCount > 0 ? (scope.row.SelfApplyedTaskCount * 100 / scope.row.ApplyedTotalTaskCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配总任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfApplyedTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="待处理任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfUndoTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="IsEnable"
|
||
label="状态"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<el-tag v-if="!scope.row.IsEnable" type="danger">{{ $fd('IsEnable', scope.row.IsEnable) }}</el-tag>
|
||
<el-tag v-else>{{ $fd('IsEnable', scope.row.IsEnable) }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="Note"
|
||
label="备注"
|
||
min-width="100"
|
||
show-overflow-tooltip
|
||
/>
|
||
</el-table>
|
||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||
<!-- 取消 -->
|
||
<el-button
|
||
:disabled="btnLoading"
|
||
size="small"
|
||
type="primary"
|
||
@click="manualAllocationVisible = false;TaskAllocationRuleSelectList=[]"
|
||
>
|
||
{{ $t('common:button:cancel') }}
|
||
</el-button>
|
||
<!-- 保存 -->
|
||
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSaveTaskAllocationRuleSelectList">
|
||
分配
|
||
</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog
|
||
v-if="readVisible"
|
||
title="分配"
|
||
:visible.sync="readVisible"
|
||
width="360px"
|
||
:close-on-click-modal="false"
|
||
>
|
||
<el-form
|
||
ref="readDataForm"
|
||
v-loading="loading"
|
||
:model="rowData"
|
||
size="small"
|
||
:rules="rules"
|
||
label-width="90px"
|
||
>
|
||
<div class="base-dialog-body">
|
||
<el-form-item label="阅片人" prop="DoctorUserId">
|
||
<el-select v-model="rowData.DoctorUserId" clearable>
|
||
<el-option v-for="item of DoctorUserList" :key="item.DoctorUserId" :label="`${item.UserName}(${item.FullName})`" :value="item.DoctorUserId" />
|
||
</el-select>
|
||
</el-form-item>
|
||
</div>
|
||
</el-form>
|
||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||
<!-- 取消 -->
|
||
<el-button
|
||
:disabled="btnLoading"
|
||
size="small"
|
||
type="primary"
|
||
@click="readVisible = false"
|
||
>
|
||
{{ $t('common:button:cancel') }}
|
||
</el-button>
|
||
<!-- 保存 -->
|
||
<el-button size="small" type="primary" :loading="btnLoading" @click="assignSubjectTaskToDoctorSave">
|
||
保存
|
||
</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog
|
||
v-if="applyVisible"
|
||
title="分配"
|
||
:visible.sync="applyVisible"
|
||
width="360px"
|
||
:close-on-click-modal="false"
|
||
>
|
||
<el-form
|
||
ref="readDataForm"
|
||
v-loading="loading"
|
||
:model="rowData"
|
||
size="small"
|
||
:rules="rules"
|
||
label-width="90px"
|
||
>
|
||
<div class="base-dialog-body">
|
||
<el-form-item label="阅片人" prop="DoctorUserId">
|
||
<el-select v-model="rowData.DoctorUserId" clearable>
|
||
<el-option v-for="item of DoctorUserList" :key="item.DoctorUserId" :label="`${item.UserName}(${item.FullName})`" :value="item.DoctorUserId" />
|
||
</el-select>
|
||
</el-form-item>
|
||
</div>
|
||
</el-form>
|
||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||
<!-- 取消 -->
|
||
<el-button
|
||
:disabled="btnLoading"
|
||
size="small"
|
||
type="primary"
|
||
@click="readVisible = false"
|
||
>
|
||
{{ $t('common:button:cancel') }}
|
||
</el-button>
|
||
<!-- 保存 -->
|
||
<el-button size="small" type="primary" :loading="btnLoading" @click="assignSubjectTaskToDoctorSave">
|
||
保存
|
||
</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog
|
||
v-if="WaitApplyVisible"
|
||
title="确定生效吗?"
|
||
:visible.sync="WaitApplyVisible"
|
||
width="1400px"
|
||
:close-on-click-modal="false"
|
||
>
|
||
<el-table
|
||
v-loading="loading"
|
||
border
|
||
:data="WaitApplyList"
|
||
stripe
|
||
>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="阅片人"
|
||
min-width="180"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{`${scope.row.UserName}(${scope.row.FullName})`}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="PlanReadingRatio"
|
||
label="计划受试者比例"
|
||
min-width="130"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.PlanReadingRatio ? scope.row.PlanReadingRatio + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="当前受试者比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalSubjectCount > 0 ? (scope.row.SelfApplyedSubjectCount * 100 / scope.row.ApplyedTotalSubjectCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="生效后受试者比例"
|
||
min-width="140"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<span style="color:#f66;">
|
||
{{ scope.row.ApplyedTotalSubjectCount + scope.row.WaitApplyTotalSubjectCount > 0 ? ((scope.row.SelfApplyedSubjectCount + scope.row.WaitApplySelfSubjectCount) * 100 / (scope.row.ApplyedTotalSubjectCount + scope.row.WaitApplyTotalSubjectCount)).toFixed(2) + '%' : '0%' }}
|
||
</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配任务比例"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.ApplyedTotalTaskCount > 0 ? (scope.row.SelfApplyedTaskCount * 100 / scope.row.ApplyedTotalTaskCount).toFixed(2) + '%' : '0%' }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="生效后任务比例"
|
||
min-width="140"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<span style="color:#f66;">
|
||
{{ scope.row.ApplyedTotalTaskCount + scope.row.WaitApplyTotalTaskCount > 0 ? ((scope.row.SelfApplyedTaskCount + scope.row.WaitApplySelfTaskCount) * 100 / (scope.row.ApplyedTotalTaskCount + scope.row.WaitApplyTotalTaskCount)).toFixed(2) + '%' : '0%' }}
|
||
</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="已分配总任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfApplyedTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="生效后总任务量"
|
||
min-width="140"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<span style="color:#f66;">{{ scope.row.SelfApplyedTaskCount + scope.row.WaitApplySelfTaskCount }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="待处理任务量"
|
||
min-width="120"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
{{ scope.row.SelfUndoTaskCount }}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column
|
||
prop="UserName"
|
||
label="生效后待处理任务量"
|
||
min-width="150"
|
||
show-overflow-tooltip
|
||
>
|
||
<template slot-scope="scope">
|
||
<span style="color:#f66;"> {{ scope.row.SelfUndoTaskCount + scope.row.WaitApplySelfTaskCount }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||
<!-- 取消 -->
|
||
<el-button
|
||
:disabled="btnLoading"
|
||
size="small"
|
||
type="primary"
|
||
@click="WaitApplyVisible = false"
|
||
>
|
||
{{ $t('common:button:cancel') }}
|
||
</el-button>
|
||
<!-- 保存 -->
|
||
<el-button size="small" type="primary" :loading="btnLoading" @click="manualAssignDoctorApplyTaskSave">
|
||
确定
|
||
</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
</template>
|
||
</BaseContainer>
|
||
</template>
|
||
<script>
|
||
import { getTrialSiteSelect, getVisitTaskList } from '@/api/trials'
|
||
import { getSubjectApplyDoctorTaskStatList, assignSubjectTaskToDoctor, manualAssignDoctorApplyTask, autoSubjectAssignDoctor, getTaskAllocationRuleList, getSubjectAssignList, assignSubjectDoctor, cancelSubjectAssignDoctor, deleteTaskAllocationRule, configTrialTaskInfo, getDoctorUserSelectList } from '@/api/trials/reading'
|
||
import AddOrEditTaskAllocationRule from './components/AddOrEditTaskAllocationRule'
|
||
import BaseContainer from '@/components/BaseContainer'
|
||
import Pagination from '@/components/Pagination'
|
||
const searchDataDefault = () => {
|
||
return {
|
||
PageIndex: 1,
|
||
PageSize: 20,
|
||
Asc: true,
|
||
SortField: '',
|
||
TrialId: null,
|
||
SiteId: null,
|
||
SubjectId: null,
|
||
SubjectCode: null,
|
||
IsUrgent: null,
|
||
TaskName: null,
|
||
DoctorUserId: null,
|
||
ReadingCategory: null,
|
||
TaskState: null,
|
||
BeginAllocateDate: null,
|
||
EndAllocateDate: null
|
||
}
|
||
}
|
||
const taskSearchDataDefault = () => {
|
||
return {
|
||
PageIndex: 1,
|
||
PageSize: 20,
|
||
Asc: true,
|
||
SortField: '',
|
||
TrialId: null,
|
||
SiteId: null,
|
||
SubjectId: null,
|
||
SubjectCode: null,
|
||
DoctorUserId: null,
|
||
IsHaveAssigned: null,
|
||
IsHaveApplyedTask: null
|
||
}
|
||
}
|
||
export default {
|
||
name: 'TrialsNotice',
|
||
components: { BaseContainer, Pagination, AddOrEditTaskAllocationRule },
|
||
data() {
|
||
return {
|
||
searchData: searchDataDefault(),
|
||
taskSearchData: taskSearchDataDefault(),
|
||
maxLength: 0,
|
||
list: [],
|
||
siteOptions: [],
|
||
total: 0,
|
||
SubjectAssignListTotal: 0,
|
||
loading: false,
|
||
AllocationConfigVisible: false,
|
||
taskAllocationRuleVisible: false,
|
||
AutoAlloctionVisible: false,
|
||
WaitApplyVisible: false,
|
||
applyVisible: false,
|
||
manualAllocationVisible: false,
|
||
trialId: this.$route.query.trialId,
|
||
currentData: {},
|
||
param: {},
|
||
DoctorUserList: [],
|
||
TaskAllocationRuleList: [],
|
||
btnLoading: false,
|
||
value: true,
|
||
value1: true,
|
||
TrialTaskInfo: {
|
||
TrialId: null,
|
||
TaskAllocateObjEnum: 0,
|
||
FollowVisitAutoAssignDefaultState: 0,
|
||
FollowGlobalVisitAutoAssignDefaultState: 0,
|
||
TaskAllocateDefaultState: 1,
|
||
IsFollowVisitAutoAssign: true,
|
||
IsFollowGlobalVisitAutoAssign: true
|
||
},
|
||
rules: {
|
||
DoctorUserId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }]
|
||
},
|
||
title: '',
|
||
rowData: {},
|
||
ApplyTaskInfo: {},
|
||
timeList: [],
|
||
WaitApplyList: [],
|
||
SubjectAssignList: [],
|
||
SubjectAssignSelectList: [],
|
||
TaskAllocationRuleSelectList: [],
|
||
readVisible: false,
|
||
TaskOptType: null,
|
||
OtherInfo: null
|
||
}
|
||
},
|
||
mounted() {
|
||
this.getList()
|
||
this.getSite()
|
||
this.getDoctorUserSelectList()
|
||
},
|
||
methods: {
|
||
assignSubjectTaskToDoctor(row, type) {
|
||
this.rowData = { ...row }
|
||
this.rowData.TaskOptType = type
|
||
if (type === 1 || type === 2) {
|
||
this.readVisible = true
|
||
} else if (type === 3) {
|
||
this.$confirm('是否确定分配').then(() => {
|
||
this.btnLoading = true
|
||
this.loading = true
|
||
var params = Object.assign({}, this.rowData)
|
||
assignSubjectTaskToDoctor(params).then(res => {
|
||
this.$message.success('保存成功')
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
this.readVisible = false
|
||
this.getList()
|
||
}).catch(() => {
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
})
|
||
})
|
||
} else if (type === 4) {
|
||
this.$confirm('是否确定取消分配').then(() => {
|
||
this.btnLoading = true
|
||
this.loading = true
|
||
var params = Object.assign({}, this.rowData)
|
||
assignSubjectTaskToDoctor(params).then(res => {
|
||
this.$message.success('保存成功')
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
this.readVisible = false
|
||
this.getList()
|
||
}).catch(() => {
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
})
|
||
})
|
||
}
|
||
},
|
||
assignSubjectTaskToDoctorSave() {
|
||
this.$refs.readDataForm.validate(valid => {
|
||
if (!valid) return
|
||
this.btnLoading = true
|
||
this.loading = true
|
||
var params = Object.assign({}, this.rowData)
|
||
assignSubjectTaskToDoctor(params).then(res => {
|
||
this.$message.success('保存成功')
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
this.readVisible = false
|
||
this.getList()
|
||
}).catch(() => {
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
})
|
||
})
|
||
},
|
||
manualAssignDoctorApplyTaskSave() {
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
manualAssignDoctorApplyTask(this.ApplyTaskInfo).then(res => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
this.$message.success('生效成功')
|
||
this.WaitApplyVisible = false
|
||
this.getList()
|
||
this.openAutoAlloction()
|
||
}).catch(() => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
},
|
||
manualAssignDoctorApplyTask(row) {
|
||
var params = {
|
||
TrialId: this.trialId,
|
||
SubjectIdList: Object.assign([], this.SubjectAssignSelectList.map(v => v.SubjectId))
|
||
}
|
||
this.ApplyTaskInfo = {
|
||
TrialId: this.trialId,
|
||
SubjectDoctorUserList: Object.assign([], this.SubjectAssignSelectList.map(v => {
|
||
v.DoctorUserIdArmList = v.DoctorUserList
|
||
return v
|
||
}))
|
||
}
|
||
if (row) {
|
||
params.SubjectIdList = [row.SubjectId]
|
||
var param = Object.assign({}, row)
|
||
param.DoctorUserIdArmList = param.DoctorUserList
|
||
this.ApplyTaskInfo = Object.assign({}, row)
|
||
delete this.ApplyTaskInfo.DoctorUserList
|
||
delete this.ApplyTaskInfo.DoctorUserIdList
|
||
this.ApplyTaskInfo.SubjectDoctorUserList = [
|
||
param
|
||
]
|
||
}
|
||
console.log(this.ApplyTaskInfo)
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
getSubjectApplyDoctorTaskStatList(params).then(res => {
|
||
this.WaitApplyList = res.Result
|
||
this.WaitApplyVisible = true
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
}).catch(() => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
},
|
||
autoSubjectAssignDoctor() {
|
||
this.$confirm('确定执行自动分配?').then(() => {
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
autoSubjectAssignDoctor({ TrialId: this.trialId }).then(res => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
this.$message.success('自动分配成功')
|
||
this.getList()
|
||
this.openAutoAlloction()
|
||
}).catch(() => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
})
|
||
},
|
||
handleSaveTaskAllocationRuleSelectList() {
|
||
if (this.TaskAllocationRuleSelectList.length === 0) {
|
||
this.$message.error('请选择阅片人')
|
||
return
|
||
}
|
||
var num
|
||
if (this.ReadingType === 2) {
|
||
num = 2
|
||
} else {
|
||
num = 1
|
||
}
|
||
if (this.TaskAllocationRuleSelectList.length !== num) {
|
||
this.$message.error(`当前阅片模式为${this.$fd('ReadingMethod', this.ReadingType)},请选择正确阅片人数量`)
|
||
return
|
||
}
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
var params = {
|
||
DoctorUserIdArmList: this.TaskAllocationRuleSelectList.map((v, i) => { return { DoctorUserId: v.DoctorUserId, ArmEnum: this.ReadingType === 1 ? 1 : i + 1 } }),
|
||
SubjectIdList: this.SubjectAssignSelectList.map(v => v.SubjectId),
|
||
TrialId: this.trialId,
|
||
IsReAssign: true
|
||
}
|
||
assignSubjectDoctor(params).then(v => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
this.openAutoAlloction()
|
||
this.TaskAllocationRuleSelectList = []
|
||
this.SubjectAssignSelectList = []
|
||
this.getDoctorUserSelectList()
|
||
this.$message.success('分配成功')
|
||
this.manualAllocationVisible = false
|
||
}).catch(() => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
},
|
||
selectable(row) {
|
||
var num
|
||
if (this.ReadingType === 2) {
|
||
num = 2
|
||
} else {
|
||
num = 1
|
||
}
|
||
if (this.TaskAllocationRuleSelectList.length === num && !this.TaskAllocationRuleSelectList.find(v => { return v.UserName === row.UserName })) {
|
||
return false
|
||
} else {
|
||
return true
|
||
}
|
||
},
|
||
cancelSubjectAssignDoctor(row) {
|
||
if (row) {
|
||
this.$confirm('确定要清空该受试者的阅片人吗?').then(() => {
|
||
var params = {
|
||
SubjectIdList: [row.SubjectId],
|
||
TrialId: this.trialId
|
||
}
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
cancelSubjectAssignDoctor(params).then(v => {
|
||
this.$message.success('清空成功')
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
this.openAutoAlloction()
|
||
}).catch(v => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
})
|
||
return
|
||
}
|
||
if (this.SubjectAssignSelectList.length === 0) {
|
||
this.$message.error('请勾选要清空阅片人的受试者')
|
||
return
|
||
}
|
||
this.$confirm('确定要清空该受试者的阅片人吗?').then(() => {
|
||
var params = {
|
||
SubjectIdList: this.SubjectAssignSelectList.map(v => v.SubjectId),
|
||
TrialId: this.trialId
|
||
}
|
||
this.loading = true
|
||
this.btnLoading = true
|
||
cancelSubjectAssignDoctor(params).then(v => {
|
||
this.$message.success('清空成功')
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
this.openAutoAlloction()
|
||
}).catch(v => {
|
||
this.loading = false
|
||
this.btnLoading = false
|
||
})
|
||
})
|
||
},
|
||
manualAllocation(row) {
|
||
if (row) {
|
||
this.SubjectAssignSelectList = [row]
|
||
}
|
||
if (this.SubjectAssignSelectList.length === 0) {
|
||
this.$message.error('请勾选要分配的受试者')
|
||
return
|
||
}
|
||
this.manualAllocationVisible = true
|
||
},
|
||
handleTaskAllocationRuleListSelectChange(e) {
|
||
this.TaskAllocationRuleSelectList = e
|
||
},
|
||
handleSubjectAssignListSelectChange(e) {
|
||
this.SubjectAssignSelectList = e
|
||
},
|
||
changeTimeList() {
|
||
if (this.timeList) {
|
||
this.searchData.BeginAllocateDate = this.timeList[0]
|
||
this.searchData.EndAllocateDate = this.timeList[1]
|
||
} else {
|
||
this.searchData.BeginAllocateDate = null
|
||
this.searchData.EndAllocateDate = null
|
||
}
|
||
},
|
||
handleCancel() {
|
||
this.AllocationConfigVisible = false
|
||
},
|
||
handleSave() {
|
||
this.btnLoading = true
|
||
this.loading = true
|
||
var params = Object.assign({}, this.TrialTaskInfo)
|
||
params.TrialId = this.$route.query.trialId
|
||
configTrialTaskInfo(params).then(res => {
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
this.AllocationConfigVisible = false
|
||
this.getList()
|
||
this.$message.success('保存成功')
|
||
}).catch(() => {
|
||
this.btnLoading = false
|
||
this.loading = false
|
||
})
|
||
},
|
||
handleDelete(row) {
|
||
this.$confirm(`确定要删除${row.UserName}(${row.FullName})的任务分配规则?`, {
|
||
type: 'warning',
|
||
distinguishCancelAndClose: true
|
||
}).then(() => {
|
||
this.loading = true
|
||
deleteTaskAllocationRule(row.Id, false).then(res => {
|
||
this.loading = false
|
||
this.$message.success('删除成功')
|
||
this.openAllocationConfigVisible()
|
||
}).catch(() => { this.loading = false })
|
||
})
|
||
},
|
||
addOrEdit(row) {
|
||
if (row) {
|
||
this.rowData = { ...row }
|
||
this.title = '编辑'
|
||
} else {
|
||
this.rowData = {}
|
||
this.title = '新增'
|
||
}
|
||
this.taskAllocationRuleVisible = true
|
||
},
|
||
openAllocationConfigVisible() {
|
||
this.loading = true
|
||
getTaskAllocationRuleList({
|
||
TrialId: this.$route.query.trialId
|
||
}).then(res => {
|
||
this.loading = false
|
||
this.TaskAllocationRuleList = res.Result
|
||
this.TrialTaskInfo = Object.assign({}, res.OtherInfo)
|
||
this.AllocationConfigVisible = true
|
||
this.taskAllocationRuleVisible = false
|
||
}).catch(() => { this.loading = false })
|
||
},
|
||
openAutoAlloction() {
|
||
this.loading = true
|
||
getTaskAllocationRuleList({
|
||
TrialId: this.$route.query.trialId
|
||
}).then(async(res) => {
|
||
this.taskSearchData.TrialId = this.$route.query.trialId
|
||
var params = Object.assign({}, this.taskSearchData)
|
||
var SubjectAssignListRes = await getSubjectAssignList(params)
|
||
this.SubjectAssignList = SubjectAssignListRes.Result.CurrentPageData
|
||
this.SubjectAssignListTotal = SubjectAssignListRes.Result.TotalCount
|
||
this.loading = false
|
||
this.TaskAllocationRuleList = res.Result
|
||
this.TrialTaskInfo = Object.assign({}, res.OtherInfo)
|
||
this.AutoAlloctionVisible = true
|
||
}).catch(() => { this.loading = false })
|
||
},
|
||
getDoctorUserSelectList() {
|
||
getDoctorUserSelectList(this.$route.query.trialId).then(res => {
|
||
this.DoctorUserList = res.Result
|
||
if (this.DoctorUserList.length > 0) {
|
||
this.ReadingType = this.DoctorUserList[0].ReadingType
|
||
} else {
|
||
this.$alert('请先去选择项目阅片人')
|
||
}
|
||
})
|
||
},
|
||
getList() {
|
||
this.searchData.TrialId = this.$route.query.trialId
|
||
this.loading = true
|
||
getVisitTaskList(this.searchData).then(res => {
|
||
this.loading = false
|
||
this.OtherInfo = res.OtherInfo
|
||
this.list = res.Result.CurrentPageData
|
||
this.total = res.Result.TotalCount
|
||
}).catch(() => { this.loading = false })
|
||
},
|
||
handleSearch() {
|
||
this.searchData.PageIndex = 1
|
||
this.getList()
|
||
},
|
||
handleReset() {
|
||
this.searchData = searchDataDefault()
|
||
this.getList()
|
||
},
|
||
handleReset2() {
|
||
this.taskSearchData = taskSearchDataDefault()
|
||
this.openAutoAlloction()
|
||
},
|
||
getSite() {
|
||
getTrialSiteSelect(this.trialId).then(res => {
|
||
this.siteOptions = res.Result
|
||
})
|
||
},
|
||
// 排序
|
||
handleSortChange(column) {
|
||
if (column.order === 'ascending') {
|
||
this.searchData.Asc = true
|
||
} else {
|
||
this.searchData.Asc = false
|
||
}
|
||
this.searchData.SortField = column.prop
|
||
this.searchData.PageIndex = 1
|
||
this.getList()
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style lang="scss" scoped>
|
||
>>>.hidden-row{
|
||
display: none;
|
||
}
|
||
>>>.el-dialog__body {
|
||
padding: 15px 20px;
|
||
}
|
||
|
||
>>>.el-tag--danger.el-tag--dark {
|
||
// background-color: #f56c6c!important;
|
||
border-color: none!important;
|
||
// color: #fff!important;
|
||
}
|
||
>>>#TaskAllocationRuleList thead .el-checkbox__inner{
|
||
display: none;
|
||
}
|
||
>>>.el-descriptions-item__label.has-colon:after{
|
||
display: none;
|
||
}
|
||
</style>
|