938 lines
		
	
	
		
			38 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			938 lines
		
	
	
		
			38 KiB
		
	
	
	
		
			Plaintext
		
	
	
| /* eslint-disable */
 | |
| <template>
 | |
|   <BaseContainer>
 | |
|     <el-tabs type="border-card" v-model="TrialReadingCriterionId">
 | |
|       <el-tab-pane :label="item.TrialReadingCriterionName" :name="item.TrialReadingCriterionId" v-for="item of trialCriterionList">
 | |
|         <div v-if="TrialReadingCriterionId === item.TrialReadingCriterionId">
 | |
|           <div 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="'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="searchData.SubjectCode" style="width:100px;" />
 | |
|               </el-form-item>
 | |
|               <el-form-item :label="$t('trials:trials-panel:readTaskAllocation:search:ReadPeople')">
 | |
|                 <el-select v-model="searchData.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>
 | |
|                 <el-button type="primary" icon="el-icon-search" @click="getList">
 | |
|                   {{ $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" v-hasPermi="['trials:trials-panel:reading:readTaskAllocation:edit']" @click="openAllocationConfigVisible">
 | |
|                   {{ $t('trials:trials-panel:readTaskAllocation:button:AllocationRule') }}
 | |
|                 </el-button>
 | |
|                 <el-button type="primary" :loading="btnLoading" v-hasPermi="['trials:trials-panel:reading:readTaskAllocation:edit']" @click="manualAllocation()">
 | |
|                   {{ $t('trials:trials-panel:readTaskAllocation:button:ManualDistribution') }}
 | |
|                 </el-button>
 | |
|                 <el-button type="primary" :loading="btnLoading" @click="openAllocation('task')">
 | |
|                   {{ $t('trials:trials-panel:readTaskAllocation:button:vgoTask') }}
 | |
|                 </el-button>
 | |
|                 <el-button type="primary" :loading="btnLoading" @click="openAllocation('referee')">
 | |
|                   {{$t('trials:trials-panel:readTaskAllocation:button:adTask')}}
 | |
|                 </el-button>
 | |
|               </el-form-item>
 | |
|             </el-form>
 | |
|           </div>
 | |
|           <div slot="main-container">
 | |
|             <el-table
 | |
|               v-loading="loading"
 | |
|               v-adaptive="{bottomOffset:85}"
 | |
|               border
 | |
|               :data="list"
 | |
|               stripe
 | |
|               height="100"
 | |
|               @selection-change="handleSubjectAssignListSelectChange"
 | |
|             >
 | |
|               <el-table-column type="selection" align="left" width="45" />
 | |
|               <el-table-column
 | |
|                 prop="TrialSiteCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:TrialSiteCode')"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|               />
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:SubjectCode')"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|               />
 | |
|               <el-table-column
 | |
|                 prop="VisitTaskTypeCount"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:VisitTaskTypeCount')"
 | |
|                 label="访视"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <span @click="openAllocation('task', 1, scope.row.SubjectCode)" style="color:#00D1B2;cursor: pointer">{{scope.row.VisitTaskTypeCount}}</span>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="GlobalTaskTypeCount"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:GlobalTaskTypeCount')"
 | |
|                 label="全局"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="OtherInfo && OtherInfo.IsGlobalReading"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <span @click="openAllocation('task', 2, scope.row.SubjectCode)" style="color:#00D1B2;cursor: pointer">{{scope.row.GlobalTaskTypeCount}}</span>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="JudgeTaskTypeCount"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:JudgeTaskTypeCount')"
 | |
|                 label="裁判"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="OtherInfo && OtherInfo.IsArbitrationReading && ReadingType === 2"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <span @click="openAllocation('referee', 4, scope.row.SubjectCode)" style="color:#00D1B2;cursor: pointer">{{scope.row.JudgeTaskTypeCount}}</span>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="OncologyTaskTypeCount"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:OncologyTaskTypeCount')"
 | |
|                 width="140"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="OtherInfo && OtherInfo.IsOncologyReading"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <span @click="openAllocation('task', 5, scope.row.SubjectCode)" style="color:#00D1B2;cursor: pointer">{{scope.row.OncologyTaskTypeCount}}</span>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:R1')"
 | |
|                 min-width="100"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="ReadingType === 1"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <div v-if="scope.row.NowDoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
 | |
|                     <el-tag v-if="findDoctorUser(scope.row.NowDoctorUserList, 0).DoctorUser">
 | |
|                       {{ `${findDoctorUser(scope.row.NowDoctorUserList, 0).DoctorUser.UserName}(${findDoctorUser(scope.row.NowDoctorUserList, 1).DoctorUser.FullName})` }}
 | |
|                     </el-tag>
 | |
|                   </div>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:R1')"
 | |
|                 min-width="100"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="ReadingType === 2"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <div v-if="scope.row.NowDoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
 | |
|                     <el-tag v-if="findDoctorUser(scope.row.NowDoctorUserList, 1).DoctorUser">
 | |
|                       {{ `${findDoctorUser(scope.row.NowDoctorUserList, 1).DoctorUser.UserName}(${findDoctorUser(scope.row.NowDoctorUserList, 1).DoctorUser.FullName})` }}
 | |
|                     </el-tag>
 | |
|                   </div>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:R2')"
 | |
|                 min-width="100"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="ReadingType === 2"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <div v-if="scope.row.NowDoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
 | |
|                     <el-tag v-if="findDoctorUser(scope.row.NowDoctorUserList, 2).DoctorUser">
 | |
|                       {{ `${findDoctorUser(scope.row.NowDoctorUserList, 2).DoctorUser.UserName}(${findDoctorUser(scope.row.NowDoctorUserList, 2).DoctorUser.FullName})` }}
 | |
|                     </el-tag>
 | |
|                   </div>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:AD')"
 | |
|                 min-width="100"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="OtherInfo && OtherInfo.IsArbitrationReading && ReadingType === 2"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <div v-if="scope.row.NowDoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
 | |
|                     <el-tag v-if="findDoctorUser(scope.row.NowDoctorUserList, 3).DoctorUser">
 | |
|                       {{ `${findDoctorUser(scope.row.NowDoctorUserList, 3).DoctorUser.UserName}(${findDoctorUser(scope.row.NowDoctorUserList, 3).DoctorUser.FullName})` }}
 | |
|                     </el-tag>
 | |
|                   </div>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop="SubjectCode"
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:O1')"
 | |
|                 min-width="100"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="OtherInfo && OtherInfo.IsOncologyReading"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <div v-if="scope.row.NowDoctorUserList.length" style="display: flex;justify-content: left;align-items: center">
 | |
|                     <el-tag v-if="findDoctorUser(scope.row.NowDoctorUserList, 4).DoctorUser">
 | |
|                       {{ `${findDoctorUser(scope.row.NowDoctorUserList, 4).DoctorUser.UserName}(${findDoctorUser(scope.row.NowDoctorUserList, 4).DoctorUser.FullName})` }}
 | |
|                     </el-tag>
 | |
|                   </div>
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|               <el-table-column
 | |
|                 prop=""
 | |
|                 :label="$t('trials:trials-panel:readTaskAllocation:table:operation')"
 | |
|                 width="180"
 | |
|                 show-overflow-tooltip
 | |
|                 v-if="hasPermi(['trials:trials-panel:reading:readTaskAllocation:edit'])"
 | |
|               >
 | |
|                 <template slot-scope="scope">
 | |
|                   <el-button
 | |
|                     circle
 | |
|                     :disabled="scope.row.NowDoctorUserList.length === 4"
 | |
|                     icon="el-icon-thumb"
 | |
|                     :title="$t('trials:trials-panel:readTaskAllocation:table:ManualDistribution')"
 | |
|                     @click="manualAllocation(scope.row)"
 | |
|                   />
 | |
|                   <el-button
 | |
|                     circle
 | |
|                     :disabled="scope.row.NowDoctorUserList.length === 0"
 | |
|                     icon="el-icon-close"
 | |
|                     :title="$t('trials:trials-panel:readTaskAllocation:table:clearReview')"
 | |
|                     @click="openClearAudience(scope.row)"
 | |
|                   />
 | |
|                   <el-button
 | |
|                     circle
 | |
|                     icon="el-icon-document-copy"
 | |
|                     :title="$t('trials:trials-panel:readTaskAllocation:table:lookCancelHistory')"
 | |
|                     @click="openSubjectCancelDoctorHistoryList(scope.row)"
 | |
|                   />
 | |
|                 </template>
 | |
|               </el-table-column>
 | |
|             </el-table>
 | |
|             <pagination style="text-align: right;margin-top: 10px;" 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" style="margin-bottom: 40px;">阅片人列表</el-divider>
 | |
|                 <el-form
 | |
|                   style="margin-top: 40px"
 | |
|                   ref="signForm"
 | |
|                   size="small"
 | |
|                   label-width="0px"
 | |
|                 >
 | |
|                   <el-form-item>
 | |
|                     <el-table
 | |
|                       v-loading="loading"
 | |
|                       border
 | |
|                       :data="TaskAllocationRuleList"
 | |
|                       stripe
 | |
|                     >
 | |
|                       <el-table-column
 | |
|                         prop="DoctorUser.UserName"
 | |
|                         label="阅片人"
 | |
|                         min-width="180"
 | |
|                         show-overflow-tooltip
 | |
|                       >
 | |
|                         <template slot-scope="scope">
 | |
|                           {{ `${scope.row.DoctorUser.UserName}(${scope.row.DoctorUser.FullName})` }}
 | |
|                         </template>
 | |
|                       </el-table-column>
 | |
|                       <el-table-column
 | |
|                         prop="PlanSubjectCount"
 | |
|                         label="计划受试者数量"
 | |
|                         min-width="130"
 | |
|                         show-overflow-tooltip
 | |
|                       />
 | |
|                       <el-table-column
 | |
|                         prop="ReadingCategorys"
 | |
|                         :label="$t('trials:enrolledReviews:table:readingType')"
 | |
|                         :width="360 * TrialReadingCriterionList.length"
 | |
|                         show-overflow-tooltip
 | |
|                       >
 | |
|                         <el-table-column
 | |
|                           v-for="ite of TrialReadingCriterionList"
 | |
|                           :label="ite.TrialReadingCriterionName"
 | |
|                           width="360"
 | |
|                           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>
 | |
|                           </template>
 | |
|                         </el-table-column>
 | |
|                       </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)"
 | |
|                           />
 | |
|                         </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="TrialTaskInfo.IsFollowVisitAutoAssign" disabled>同一病例随访阅片任务自动分配(在拟分配的阅片人未标记为退出项目状态时)默认状态 {{$fd('AutoAssignDefaultState', TrialTaskInfo.FollowVisitAutoAssignDefaultState)}} </el-checkbox>
 | |
|                       </template>
 | |
|                       <div style="margin-left: 10px;">
 | |
|                       </div>
 | |
|                     </el-descriptions-item>
 | |
|                     <el-descriptions-item label="同一病例随访阅片任务自动分配(在拟分配的阅片人未标记为退出项目状态时)">
 | |
|                       <template slot="label">
 | |
|                         <el-checkbox v-model="TrialTaskInfo.IsFollowGlobalVisitAutoAssign" disabled>同一病例全局任务自动分配(在拟分配的阅片人未标记为退出项目状态时 默认状态 {{$fd('AutoAssignDefaultState', TrialTaskInfo.FollowGlobalVisitAutoAssignDefaultState)}} </el-checkbox>
 | |
|                       </template>
 | |
|                       <div style="margin-left: 10px;">
 | |
| 
 | |
|                       </div>
 | |
|                     </el-descriptions-item>
 | |
|                     <el-descriptions-item>
 | |
|                       <template slot="label">
 | |
|                         <el-checkbox v-model="TrialTaskInfo.IsFollowJudgeTaskAutoAssign" disabled>同一病例第二次裁判任务自动分配(在拟分配的阅片人未标记为退出项目状态时)默认状态 {{$fd('AutoAssignDefaultState', TrialTaskInfo.FollowJudgeTaskAutoAssignDefaultState)}} </el-checkbox>
 | |
|                       </template>
 | |
|                       <div style="margin-left: 10px;" />
 | |
|                     </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" :TaskAllocationRuleList="TaskAllocationRuleList" :doctor-user-list="DoctorUserList" @close="() => {taskAllocationRuleVisible = false}" @getList="openAllocationConfigVisible" />
 | |
|             </el-dialog>
 | |
|             <el-dialog
 | |
|               v-if="manualAllocationVisible"
 | |
|               title="分配阅片人"
 | |
|               :visible.sync="manualAllocationVisible"
 | |
|               width="1610px"
 | |
|               :close-on-click-modal="false"
 | |
|             >
 | |
|               <ManualAllocationTable :TrialReadingCriterionId="TrialReadingCriterionId" :data="rowData" :reading-type="ReadingType" :SubjectAssignSelectList="SubjectAssignSelectList" @close="() => {manualAllocationVisible = false}" @getList="getList"></ManualAllocationTable>
 | |
|             </el-dialog>
 | |
|             <el-dialog
 | |
|               v-if="ClearAudienceVisible"
 | |
|               title="清除阅片人"
 | |
|               :visible.sync="ClearAudienceVisible"
 | |
|               width="500px"
 | |
|               :close-on-click-modal="false"
 | |
|             >
 | |
|               <ClearAudienceList :TrialReadingCriterionId="TrialReadingCriterionId" :data="rowData"  @close="() => {ClearAudienceVisible = false}" @getList="getList"></ClearAudienceList>
 | |
|             </el-dialog>
 | |
|             <el-dialog
 | |
|               v-if="AllocationVisible"
 | |
|               :title="AllocationType === 'task' ? ' 访视/全局/肿瘤学阅片任务' : ' 裁判阅片任务'"
 | |
|               :visible.sync="AllocationVisible"
 | |
|               :fullscreen="true"
 | |
|               :close-on-click-modal="false"
 | |
|             >
 | |
|               <taskAllacation :AllocationReadingCategory="AllocationReadingCategory" :AllocationSubjectCode="AllocationSubjectCode" v-if="AllocationType === 'task'"></taskAllacation>
 | |
|               <refereeAllacation :AllocationReadingCategory="AllocationReadingCategory" :AllocationSubjectCode="AllocationSubjectCode" v-else></refereeAllacation>
 | |
|             </el-dialog>
 | |
|             <el-dialog
 | |
|               v-if="SubjectCancelDoctorHistoryVisible"
 | |
|               title="取消历史"
 | |
|               :visible.sync="SubjectCancelDoctorHistoryVisible"
 | |
|               width="800px"
 | |
|               :close-on-click-modal="false"
 | |
|             >
 | |
|               <el-table
 | |
|                 border
 | |
|                 :data="SubjectCancelDoctorHistoryList"
 | |
|                 stripe
 | |
|               >
 | |
|                 <el-table-column
 | |
|                   prop="CreateTime"
 | |
|                   label="取消时间"
 | |
|                   width="180"
 | |
|                   show-overflow-tooltip
 | |
|                 />
 | |
|                 <el-table-column
 | |
|                   prop="Note"
 | |
|                   label="原因"
 | |
|                   show-overflow-tooltip
 | |
|                 />
 | |
|               </el-table>
 | |
|             </el-dialog>
 | |
|           </div>
 | |
|         </div>
 | |
|       </el-tab-pane>
 | |
|     </el-tabs>
 | |
|   </BaseContainer>
 | |
| </template>
 | |
| <script>
 | |
| import { getTrialSiteSelect } from '@/api/trials'
 | |
| import { getTrialCriterionList, getSubjectCancelDoctorHistoryList, getSubjectAssignAndTaskStatList, getDoctorPlanAllocationRuleList, getSubjectApplyDoctorTaskStatList, assignSubjectTaskToDoctor, manualAssignDoctorApplyTask, autoSubjectAssignDoctor, getTaskAllocationRuleList, getSubjectAssignList, assignSubjectDoctor, cancelSubjectAssignDoctor, deleteTaskAllocationRule, configTrialTaskInfo, getDoctorUserSelectList } from '@/api/trials/reading'
 | |
| import AddOrEditTaskAllocationRule from './components/AddOrEditTaskAllocationRule'
 | |
| import ManualAllocationTable from './components/ManualAllocationTable'
 | |
| import ClearAudienceList from './components/ClearAudienceList'
 | |
| import BaseContainer from '@/components/BaseContainer'
 | |
| import Pagination from '@/components/Pagination'
 | |
| import taskAllacation from '../task-allocation/index'
 | |
| import refereeAllacation from '../referee-allocation/index'
 | |
| const searchDataDefault = () => {
 | |
|   return {
 | |
|     PageIndex: 1,
 | |
|     PageSize: 20,
 | |
|     Asc: true,
 | |
|     SortField: '',
 | |
|     TrialId: null,
 | |
|     SiteId: null,
 | |
|     SubjectId: null,
 | |
|     SubjectCode: null,
 | |
|     DoctorUserId: null,
 | |
|     IsHaveAssigned: null,
 | |
|     IsAssignConfirmed: null,
 | |
|     TrialReadingCriterionId: null
 | |
|   }
 | |
| }
 | |
| const taskSearchDataDefault = () => {
 | |
|   return {
 | |
|     PageIndex: 1,
 | |
|     PageSize: 20,
 | |
|     Asc: true,
 | |
|     SortField: '',
 | |
|     TrialId: null,
 | |
|     SiteId: null,
 | |
|     SubjectId: null,
 | |
|     SubjectCode: null,
 | |
|     IsUrgent: null,
 | |
|     TaskName: null,
 | |
|     TaskState: null,
 | |
|     DoctorUserId: null,
 | |
|     ReadingCategory: null,
 | |
|     TaskAllocationState: null,
 | |
|     BeginAllocateDate: null,
 | |
|     EndAllocateDate: null
 | |
|   }
 | |
| }
 | |
| export default {
 | |
|   name: 'TrialsNotice',
 | |
|   components: { BaseContainer, Pagination, AddOrEditTaskAllocationRule, ManualAllocationTable, ClearAudienceList, taskAllacation, refereeAllacation },
 | |
|   data() {
 | |
|     return {
 | |
|       TrialReadingCriterionId: '0',
 | |
|       searchData: searchDataDefault(),
 | |
|       taskSearchData: taskSearchDataDefault(),
 | |
|       maxLength: 0,
 | |
|       list: [],
 | |
|       siteOptions: [],
 | |
|       total: 0,
 | |
|       SubjectAssignListTotal: 0,
 | |
|       loading: false,
 | |
|       AllocationVisible: false,
 | |
|       AllocationConfigVisible: false,
 | |
|       taskAllocationRuleVisible: false,
 | |
|       AutoAlloctionVisible: false,
 | |
|       ClearAudienceVisible: false,
 | |
|       WaitApplyVisible: false,
 | |
|       applyVisible: false,
 | |
|       manualAllocationVisible: false,
 | |
|       SubjectCancelDoctorHistoryVisible: false,
 | |
|       trialId: this.$route.query.trialId,
 | |
|       AllocationType: null,
 | |
|       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
 | |
|       },
 | |
|       ReadingType: null,
 | |
|       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,
 | |
|       SubjectCancelDoctorHistoryList: [],
 | |
|       trialCriterionList: [],
 | |
|       TrialReadingCriterionList: [],
 | |
|       AllocationReadingCategory: null,
 | |
|       AllocationSubjectCode: null
 | |
|     }
 | |
|   },
 | |
|   watch: {
 | |
|     TrialReadingCriterionId (v) {
 | |
|       if (v) {
 | |
|         this.getList()
 | |
|       }
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     this.getDoctorUserSelectList()
 | |
|     this.getSite()
 | |
|     this.getTrialCriterionList()
 | |
|   },
 | |
|   methods: {
 | |
|     getTrialCriterionList() {
 | |
|       getTrialCriterionList(this.trialId).then(res => {
 | |
|         this.trialCriterionList = res.Result
 | |
|         this.TrialReadingCriterionId = this.trialCriterionList[0].TrialReadingCriterionId
 | |
|       }).catch(() => {})
 | |
|     },
 | |
|     openSubjectCancelDoctorHistoryList(row) {
 | |
|       getSubjectCancelDoctorHistoryList(row.SubjectId).then((res) => {
 | |
|         this.SubjectCancelDoctorHistoryVisible = true
 | |
|         this.SubjectCancelDoctorHistoryList = res.Result
 | |
|       })
 | |
|     },
 | |
|     openAllocation(AllocationType, ReadingCategory, SubjectCode) {
 | |
|       this.AllocationVisible = true
 | |
|       this.AllocationType = AllocationType
 | |
|       this.AllocationReadingCategory = ReadingCategory
 | |
|       this.AllocationSubjectCode = SubjectCode
 | |
|     },
 | |
|     openClearAudience(row) {
 | |
|       this.rowData = {...row}
 | |
|       this.ClearAudienceVisible = true
 | |
|     },
 | |
|     findDoctorUser(list, type) {
 | |
|       var a
 | |
|       if (list.length > 0) {
 | |
|         a = list.find(v => {
 | |
|           return v.ArmEnum === type
 | |
|         }) ? list.find(v => {
 | |
|           return v.ArmEnum === type
 | |
|         }) : {
 | |
|           DoctorUser: null
 | |
|         }
 | |
|       }
 | |
|       return a
 | |
|     },
 | |
|     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
 | |
|         ]
 | |
|       }
 | |
|       this.loading = true
 | |
|       this.btnLoading = true
 | |
|       getSubjectApplyDoctorTaskStatList(params).then(res => {
 | |
|         if (res.Result.length === 0) {
 | |
|           this.$message.error('该项目没有有效阅片人')
 | |
|           return
 | |
|         }
 | |
|         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
 | |
|       }
 | |
|     },
 | |
|     manualAllocation(row) {
 | |
|       this.rowData = {}
 | |
|       if (row) {
 | |
|         this.rowData = { ...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
 | |
|       params.TrialReadingCriterionId = this.TrialReadingCriterionId
 | |
|       configTrialTaskInfo(params).then(res => {
 | |
|         this.btnLoading = false
 | |
|         this.loading = false
 | |
|         this.getList()
 | |
|         this.AllocationConfigVisible = false
 | |
|         this.$message.success('保存成功')
 | |
|       }).catch(() => {
 | |
|         this.btnLoading = false
 | |
|         this.loading = false
 | |
|       })
 | |
|     },
 | |
|     handleDelete(row) {
 | |
|       this.$confirm(`确定要删除${row.DoctorUser.UserName}(${row.DoctorUser.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
 | |
|       getDoctorPlanAllocationRuleList({
 | |
|         TrialId: this.$route.query.trialId
 | |
|       }).then(res => {
 | |
|         this.loading = false
 | |
|         this.TaskAllocationRuleList = res.Result
 | |
|         if (this.list.length > 0) {
 | |
|           this.TrialReadingCriterionList = this.TaskAllocationRuleList[0].TrialReadingCriterionList
 | |
|         }
 | |
|         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
 | |
|       })
 | |
|     },
 | |
|     getList() {
 | |
|       this.searchData.TrialId = this.$route.query.trialId
 | |
|       this.loading = true
 | |
|       this.searchData.TrialReadingCriterionId = this.TrialReadingCriterionId
 | |
|       getSubjectAssignAndTaskStatList(this.searchData).then(res => {
 | |
|         this.loading = false
 | |
|         this.OtherInfo = res.OtherInfo
 | |
|         this.ReadingType = this.OtherInfo.ReadingType
 | |
|         this.list = res.Result.CurrentPageData
 | |
|         this.total = res.Result.TotalCount
 | |
|         this.ClearAudienceVisible = false
 | |
|         this.SubjectAssignSelectList = []
 | |
|       }).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;
 | |
|   }
 | |
|   >>>.base-dialog-wrapper .base-dialog-body{
 | |
|     max-height: 1000px;
 | |
|   }
 | |
| </style>
 |