/* eslint-disable */
<template>
  <BaseContainer class="consistency-analysis-wrapper">
    <template slot="search-container">
      <el-form :inline="true">
        <!-- 是否加急 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:isUrgent')"
        >
          <el-select
            v-model="searchData.IsUrgent"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.YesOrNo"
              :key="'IsUrgent' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('trials:consistencyCheck:table:siteId')">
          <!-- 中心编号 -->
          <el-select
            v-model="searchData.TrialSiteCode"
            clearable
            filterable
            style="width: 120px"
          >
            <el-option
              v-for="(item, index) of siteOptions"
              :key="index"
              :label="item"
              :value="item"
            />
          </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="$t('trials:consistencyAnalysis:table:taskName')"
        >
          <el-input
            v-model="searchData.TaskName"
            style="width: 100px"
            clearable
          />
        </el-form-item>
        <!-- 任务类型 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:taskType')"
        >
          <el-select
            v-model="searchData.ReadingCategory"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.ReadingCategory"
              :key="'ReadingCategory' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>
        <!-- 阅片人 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:reader')"
        >
          <el-select
            v-model="searchData.DoctorUserId"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of DoctorUserList"
              :key="'DoctorUserId' + item.DoctorUserId"
              :value="item.DoctorUserId"
              :label="`${item.UserName}(${item.FullName})`"
            />
          </el-select>
        </el-form-item>
        <!-- 角色 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:role')"
        >
          <el-select
            v-model="searchData.ArmEnum"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.ArmEnum"
              :key="'ArmEnum' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>

        <!-- 阅片标准 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:criterionName')"
        >
          <el-select
            v-model="searchData.TrialReadingCriterionId"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of trialCriterionList"
              :key="'TrialReadingCriterionId' + item.TrialReadingCriterionId"
              :value="item.TrialReadingCriterionId"
              :label="item.TrialReadingCriterionName"
            />
          </el-select>
        </el-form-item>
        <!-- 一致性分析类别 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:category')"
        >
          <el-select
            v-model="searchData.IsSelfAnalysis"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.IsSelfAnalysis"
              :key="'IsSelfAnalysis' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>
        <!-- 阅片状态 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:reviewStatus')"
        >
          <el-select
            v-model="searchData.ReadingTaskState"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.ReadingTaskState"
              :key="'ReadingTaskState' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>
        <!-- 任务状态 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:taskStatus')"
        >
          <el-select
            v-model="searchData.TaskState"
            clearable
            style="width: 120px"
          >
            <el-option
              v-for="item of $d.TaskState"
              :key="'TaskState' + item.label"
              :value="item.value"
              :label="item.label"
            />
          </el-select>
        </el-form-item>

        <!-- 分配状态 -->
        <!-- <el-form-item style="margin-bottom:10px" label="分配状态">
          <el-select v-model="searchData.TaskAllocationState" clearable style="width:120px;">
            <el-option v-for="item of $d.TaskAllocationState" :key="'TaskAllocationState' + item.label" :value="item.value" :label="item.label" />
          </el-select>
        </el-form-item> -->
        <!-- 分配时间 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:auditTime')"
        >
          <el-date-picker
            v-model="timeList"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetimerange"
            :default-time="['00:00:00', '23:59:59']"
            @change="changeTimeList"
          />
        </el-form-item>
        <!-- 完成时间 -->
        <el-form-item
          style="margin-bottom: 10px"
          :label="$t('trials:consistencyAnalysis:table:signTime')"
        >
          <el-date-picker
            v-model="timeList2"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetimerange"
            :default-time="['00:00:00', '23:59:59']"
            @change="changeTimeList2"
          />
        </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-download" @click="handleExport(1)">
            {{$t('trials:consistencyAnalysis:button:exportSelf')}}
          </el-button>
          <el-button type="primary" icon="el-icon-download" @click="handleExport(2)">
            {{$t('trials:consistencyAnalysis:button:exportGroup')}}
          </el-button> -->
          <!-- 自身一致性分析 -->
          <el-button
            type="primary"
            v-if="
              hasPermi([
                'trials:trials-panel:reading:consistency-analysis:edit',
              ])
            "
            @click="openTaskConsistentRule(true)"
          >
            {{ $t('trials:consistencyAnalysis:button:self') }}
          </el-button>
          <!-- 组间一致性分析 -->
          <el-button
            :disabled="!OtherInfo.IsHaveDoubleReadCriterion"
            type="primary"
            v-if="
              hasPermi([
                'trials:trials-panel:reading:consistency-analysis:edit',
              ])
            "
            @click="openTaskConsistentRule(false)"
          >
            {{ $t('trials:consistencyAnalysis:button:group') }}
          </el-button>
          <!-- 虚拟中心编号 -->
          <el-button
            type="primary"
            v-if="
              hasPermi([
                'trials:trials-panel:reading:consistency-analysis:edit',
              ])
            "
            @click="openSite()"
          >
            {{ $t('trials:consistencyAnalysis:button:site') }}
          </el-button>
          <!--导出-->
          <el-button
            type="primary"
            icon="el-icon-download"
            @click="openExport()"
          >
            {{ $t('common:button:export') }}
          </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:consistencyAnalysis:table:isUrgent')"
          show-overflow-tooltip
          min-width="120"
          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="TrialSiteCode"
          :label="$t('trials:consistencyAnalysis:table:siteCode')"
          min-width="100"
          sortable="custom"
          show-overflow-tooltip
        />
        <!-- 受试者编号 -->
        <el-table-column
          prop="SubjectCode"
          :label="$t('trials:consistencyAnalysis:table:subjectCode')"
          min-width="120"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span
              v-if="
                scope.row.BlindSubjectCode &&
                scope.row.BlindSubjectCode !== scope.row.SubjectCode
              "
            >
              {{ `${scope.row.SubjectCode}/${scope.row.BlindSubjectCode}` }}
            </span>
            <span v-else>{{ scope.row.SubjectCode }}</span>
            <span
              v-if="scope.row.IsReReadingOrBackInfluenceAnalysis"
              class="status-primary-circle"
            >
              <!-- 影 -->
              {{ $t('trials:consistencyAnalysis:table:impact') }}
            </span>
          </template>
        </el-table-column>
        <!-- 任务编号 -->
        <!-- <el-table-column
          prop="TaskCode"
          :label="$t('trials:consistencyAnalysis:table:taskCode')"
          width="120"
          sortable="custom"
          show-overflow-tooltip
        /> -->
        <!-- 任务名称 -->
        <el-table-column
          prop="VisitTaskNum"
          :label="$t('trials:consistencyAnalysis:table:taskName')"
          min-width="140"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span
              v-if="
                scope.row.TaskBlindName &&
                scope.row.TaskName !== scope.row.TaskBlindName
              "
            >
              {{ `${scope.row.TaskName}/${scope.row.TaskBlindName}` }}
            </span>
            <span v-else>{{ scope.row.TaskName }}</span>
          </template>
        </el-table-column>
        <!-- 盲态任务标识 -->
        <!-- <el-table-column
          prop="TaskBlindName"
          :label="$t('trials:consistencyAnalysis:table:taskBlindName')"
          width="160"
          sortable="custom"
          show-overflow-tooltip
        /> -->
        <!-- 任务类型 -->
        <el-table-column
          prop="ReadingCategory"
          :label="$t('trials:consistencyAnalysis:table:taskType')"
          min-width="140"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.ReadingCategory === 1" type="primary">{{
              $fd('ReadingCategory', scope.row.ReadingCategory)
            }}</el-tag>
            <el-tag v-if="scope.row.ReadingCategory === 2" type="info">{{
              $fd('ReadingCategory', scope.row.ReadingCategory)
            }}</el-tag>
            <el-tag v-if="scope.row.ReadingCategory === 4" type="danger">{{
              $fd('ReadingCategory', scope.row.ReadingCategory)
            }}</el-tag>
            <el-tag v-if="scope.row.ReadingCategory === 5" type="warning">{{
              $fd('ReadingCategory', scope.row.ReadingCategory)
            }}</el-tag>
          </template>
        </el-table-column>
        <!-- 阅片人 -->
        <el-table-column
          prop="UserName"
          :label="$t('trials:consistencyAnalysis:table:reader')"
          min-width="120"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            {{ scope.row.UserName }}({{ scope.row.FullName }})
          </template>
        </el-table-column>
        <!-- 角色 -->
        <el-table-column
          prop="ArmEnum"
          :label="$t('trials:consistencyAnalysis:table:role')"
          min-width="100"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.ArmEnum === 1" type="primary">{{
              $fd('ArmEnum', scope.row.ArmEnum)
            }}</el-tag>
            <el-tag v-if="scope.row.ArmEnum === 2" type="success">{{
              $fd('ArmEnum', scope.row.ArmEnum)
            }}</el-tag>
            <el-tag v-if="scope.row.ArmEnum === 3" type="info">{{
              $fd('ArmEnum', scope.row.ArmEnum)
            }}</el-tag>
            <el-tag v-if="scope.row.ArmEnum === 4" type="danger">{{
              $fd('ArmEnum', scope.row.ArmEnum)
            }}</el-tag>
            <el-tag v-if="scope.row.ArmEnum === 5" type="warning">{{
              $fd('ArmEnum', scope.row.ArmEnum)
            }}</el-tag>
            <el-tag
              v-if="scope.row.ArmEnum === 8"
              style="border-color: #4c2791; color: #4c2791"
              >{{ $fd('ArmEnum', scope.row.ArmEnum) }}</el-tag
            >
          </template>
        </el-table-column>
        <!-- 阅片标准 -->
        <el-table-column
          prop="TrialReadingCriterionName"
          :label="$t('trials:consistencyAnalysis:table:criterionName')"
          min-width="180"
          sortable="custom"
          show-overflow-tooltip
        />
        <!-- 一致性分析类别 -->
        <el-table-column
          prop="IsSelfAnalysis"
          :label="$t('trials:consistencyAnalysis:table:category')"
          min-width="170"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.IsSelfAnalysis" type="primary">{{
              $fd('IsSelfAnalysis', scope.row.IsSelfAnalysis)
            }}</el-tag>
            <el-tag v-else type="warning">{{
              $fd('IsSelfAnalysis', scope.row.IsSelfAnalysis)
            }}</el-tag>
          </template>
        </el-table-column>
        <!-- 阅片状态 -->
        <el-table-column
          prop="ReadingTaskState"
          :label="$t('trials:consistencyAnalysis:table:reviewStatus')"
          min-width="140"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.ReadingTaskState === 2" type="primary">{{
              $fd('ReadingTaskState', scope.row.ReadingTaskState)
            }}</el-tag>
            <el-tag v-else type="danger">{{
              $fd('ReadingTaskState', scope.row.ReadingTaskState)
            }}</el-tag>
          </template>
        </el-table-column>

        <!-- 分配时间 -->
        <el-table-column
          prop="AllocateTime"
          :label="$t('trials:consistencyAnalysis:table:auditTime')"
          min-width="160"
          sortable="custom"
          show-overflow-tooltip
        >
        </el-table-column>
        <!-- 建议完成时间 -->
        <!-- <el-table-column
          prop="SuggesteFinishedTime"
          :label="$t('trials:consistencyAnalysis:table:suggesteFinishedTime')"
          width="140"
          sortable="custom"
          show-overflow-tooltip
        />
         -->
        <!-- 阅片完成时间 -->
        <el-table-column
          prop="SignTime"
          :label="$t('trials:consistencyAnalysis:table:signTime')"
          min-width="160"
          sortable="custom"
          show-overflow-tooltip
        />
        <!-- 任务状态 -->
        <el-table-column
          prop="TaskState"
          :label="$t('trials:consistencyAnalysis:table:taskStatus')"
          min-width="120"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.TaskState === 0" type="primary">{{
              $fd('TaskState', scope.row.TaskState)
            }}</el-tag>
            <el-tag v-if="scope.row.TaskState === 1" type="info">{{
              $fd('TaskState', scope.row.TaskState)
            }}</el-tag>
            <el-tag v-if="scope.row.TaskState === 3" type="danger">{{
              $fd('TaskState', scope.row.TaskState)
            }}</el-tag>
            <el-tag v-if="scope.row.TaskState === 4" type="warning">{{
              $fd('TaskState', scope.row.TaskState)
            }}</el-tag>
            <el-tag v-if="scope.row.TaskState === 5" type="danger">{{
              $fd('TaskState', scope.row.TaskState)
            }}</el-tag>
          </template>
        </el-table-column>
        <!-- 申请状态 -->
        <!-- <el-table-column
          prop="ReReadingApplyState"
          :label="$t('trials:consistencyAnalysis:table:applyStatus')"
          width="180"
          sortable="custom"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.ReReadingApplyState === 4 || scope.row.ReReadingApplyState === 5" type="danger">{{ $fd('ReReadingApplyState', scope.row.ReReadingApplyState) }}</el-tag>
            <el-tag v-if="scope.row.ReReadingApplyState === 2" type="primary">{{ $fd('ReReadingApplyState', scope.row.ReReadingApplyState) }}</el-tag>
            <el-tag v-if="scope.row.ReReadingApplyState === 3" type="warning">{{ $fd('ReReadingApplyState', scope.row.ReReadingApplyState) }}</el-tag>
          </template>
        </el-table-column> -->
        <!-- 是否受到退回影响 -->
        <!-- <el-table-column
          prop="IsReReadingOrBackInfluenceAnalysis"
          :label="$t('trials:consistencyAnalysis:table:impactInfluence')"
          width="160"
          sortable="custom"
          show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="!scope.row.IsReReadingOrBackInfluenceAnalysis" type="danger">{{ $fd('YesOrNo', scope.row.IsReReadingOrBackInfluenceAnalysis) }}</el-tag>
            <el-tag v-if="scope.row.IsReReadingOrBackInfluenceAnalysis" type="primary">{{ $fd('YesOrNo', scope.row.IsReReadingOrBackInfluenceAnalysis) }}</el-tag>
          </template>
        </el-table-column> -->
        <el-table-column
          fixed="right"
          :label="$t('common:action:action')"
          width="200"
        >
          <template slot-scope="scope">
            <!-- 查看阅片结果-->
            <el-button
              icon="el-icon-view"
              :disabled="scope.row.ReadingTaskState !== 2"
              circle
              :title="$t('trials:consistencyAnalysis:action:view')"
              @click="lookReadingResults(scope.row)"
            />
            <!-- 设置为失效-->
            <el-button
              :disabled="
                !scope.row.IsReReadingOrBackInfluenceAnalysis ||
                scope.row.TaskState === 1
              "
              v-if="
                hasPermi([
                  'trials:trials-panel:reading:consistency-analysis:edit',
                ])
              "
              icon="el-icon-close"
              circle
              :title="$t('trials:consistencyAnalysis:action:setInvalid')"
              @click="setAnalysisTaskInvalid(scope.row)"
            />
            <el-button
              :disabled="
                scope.row.TaskState !== 1 ||
                scope.row.ConsistentClinicalDataCount <= 0
              "
              v-if="
                hasPermi([
                  'trials:trials-panel:reading:consistency-analysis:edit',
                ])
              "
              icon="el-icon-document"
              circle
              :title="$t('trials:consistencyAnalysis:action:getClinicalData')"
              @click="handleView(scope.row)"
            />
            <el-button
              :disabled="scope.row.TaskState !== 1"
              v-if="
                hasPermi([
                  'trials:trials-panel:reading:consistency-analysis:edit',
                ])
              "
              icon="el-icon-setting"
              circle
              :title="$t('trials:consistencyAnalysis:action:setState')"
              @click="handleSetState(scope.row)"
            />

            <!--            <el-button-->
            <!--              :disabled="scope.row.TaskState !== 0 || scope.row.ReadingTaskState !== 2 || scope.row.ReReadingApplyState === 2 || scope.row.ReReadingApplyState === 1"-->
            <!--              icon="el-icon-collection"-->
            <!--              circle-->
            <!--              title="申请重阅"-->
            <!--              @click="openApplyReReading(scope.row)"-->
            <!--            />-->
            <!--            <el-button-->
            <!--              :disabled="!scope.row.ReReadingApplyState"-->
            <!--              icon="el-icon-toilet-paper"-->
            <!--              circle-->
            <!--              title="退回重阅历史"-->
            <!--              @click="reReadingHistory(scope.row, 1)"-->
            <!--            />-->
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页组件 -->
      <pagination
        class="page"
        :total="total"
        :page.sync="searchData.PageIndex"
        :limit.sync="searchData.PageSize"
        @pagination="getList"
      />
      <div class="remark">
        <!-- √：已设置访视基准日期；末：末次访视；失：失访；PD：PD进展；入：入组确认 -->
        <span class="status-primary-circle">
          <!-- 影 -->
          {{ $t('trials:consistencyAnalysis:table:impact') }}
        </span>
        <!-- 受到退回影响 -->
        <span
          >: {{ $t('trials:consistencyAnalysis:title:impactInfluence') }}</span
        >
      </div>
      <!-- 自身一致性分析 -->
      <el-dialog
        v-if="ReaderRulesVisible"
        :title="$t('trials:consistencyAnalysis:button:self')"
        :visible.sync="ReaderRulesVisible"
        width="1200px"
        append-to-body
        :close-on-click-modal="false"
        custom-class="base-dialog-wrapper"
      >
        <el-tabs
          type="border-card"
          v-model="TrialReadingCriterionId"
          @tab-click="clickTab"
        >
          <el-tab-pane
            :label="item.TrialReadingCriterionName"
            :name="item.TrialReadingCriterionId"
            v-for="item of trialCriterionList"
            :key="item.TrialReadingCriterionId"
          >
            <!-- 配置自身一致性分析规则 -->
            <el-button
              size="small"
              type="primary"
              style="position: absolute; right: 20px; top: 10px; z-index: 100"
              :loading="btnLoading"
              @click="addReaderRulesForm()"
            >
              {{ $t('trials:selftConsistencyAnalysis:button:config') }}
            </el-button>
            <div
              class="base-dialog-body"
              v-if="IsSelfAnalysis"
              style="margin-top: 32px"
            >
              <el-table
                v-loading="loading"
                :data="TaskConsistentRuleList"
                stripe
              >
                <!-- 阅片人 -->
                <el-table-column
                  prop="TaskCode"
                  :label="$t('trials:selftConsistencyAnalysis:table:reader')"
                  width="140"
                  show-overflow-tooltip
                >
                  <template
                    slot-scope="scope"
                    v-if="scope.row.AnalysisDoctorUser"
                  >
                    {{ scope.row.AnalysisDoctorUser.UserName }}({{
                      scope.row.AnalysisDoctorUser.FullName
                    }})
                  </template>
                </el-table-column>
                <!-- 访视数 -->
                <el-table-column
                  prop="PlanVisitCount"
                  :label="$t('trials:selftConsistencyAnalysis:table:visitNum')"
                  width="90"
                  show-overflow-tooltip
                >
                </el-table-column>
                <!-- 间隔周期 -->
                <el-table-column
                  prop="IntervalWeeks"
                  :label="
                    $t('trials:selftConsistencyAnalysis:table:intervalPeriod')
                  "
                  width="100"
                  show-overflow-tooltip
                  v-if="IsSelfAnalysis"
                >
                </el-table-column>
                <!-- 所选访视是否有阅片期 -->
                <el-table-column
                  prop="IsHaveReadingPeriod"
                  :label="
                    $t('trials:selftConsistencyAnalysis:table:isReadingPeriod')
                  "
                  width="120"
                  show-overflow-tooltip
                >
                  <template slot-scope="scope">
                    <el-tag
                      v-if="scope.row.IsHaveReadingPeriod"
                      size="success"
                      >{{
                        $fd('YesOrNo', scope.row.IsHaveReadingPeriod)
                      }}</el-tag
                    >
                    <el-tag v-else size="danger">{{
                      $fd('YesOrNo', scope.row.IsHaveReadingPeriod)
                    }}</el-tag>
                  </template>
                </el-table-column>
                <!-- 是否生成全局阅片任务 -->
                <el-table-column
                  prop="IsGenerateGlobalTask"
                  :label="
                    $t(
                      'trials:selftConsistencyAnalysis:table:isGenerateGlobalTask'
                    )
                  "
                  width="120"
                  show-overflow-tooltip
                >
                  <template slot-scope="scope">
                    <el-tag
                      v-if="scope.row.IsGenerateGlobalTask"
                      size="success"
                      >{{
                        $fd('YesOrNo', scope.row.IsGenerateGlobalTask)
                      }}</el-tag
                    >
                    <el-tag v-else size="danger">{{
                      $fd('YesOrNo', scope.row.IsGenerateGlobalTask)
                    }}</el-tag>
                  </template>
                </el-table-column>
                <!-- 计划受试者数 -->
                <el-table-column
                  prop="PlanSubjectCount"
                  :label="
                    $t(
                      'trials:selftConsistencyAnalysis:table:plannedSubjectNum'
                    )
                  "
                  width="120"
                  show-overflow-tooltip
                >
                </el-table-column>
                <!-- 可分配样本量 -->
                <el-table-column
                  prop="CanGeneratedSubejctCount"
                  :label="
                    $t(
                      'trials:selftConsistencyAnalysis:table:CanGeneratedSubejctCount'
                    )
                  "
                  width="120"
                  show-overflow-tooltip
                >
                </el-table-column>
                <!-- 已生成受试者数 -->
                <el-table-column
                  prop="GeneratedSubjectCount"
                  :label="
                    $t(
                      'trials:selftConsistencyAnalysis:table:createdSubjectNum'
                    )
                  "
                  width="130"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  fixed="right"
                  :label="$t('common:action:action')"
                  width="110"
                >
                  <template slot-scope="scope">
                    <!-- 选择 -->
                    <el-button
                      circle
                      icon="el-icon-s-check"
                      :disabled="scope.row.CanGeneratedSubejctCount === 0"
                      :title="
                        $t('trials:selftConsistencyAnalysis:button:select')
                      "
                      @click="
                        openDoctorConsistentRuleSubjectTable(scope.row, false)
                      "
                    />
                    <!-- 选择 -->
                    <el-button
                      circle
                      icon="el-icon-connection"
                      :disabled="
                        scope.row.GeneratedSubjectCount > 0 ||
                        scope.row.CanGeneratedSubejctCount === 0 ||
                        Number(scope.row.PlanSubjectCount) * 2 >=
                          scope.row.CanGeneratedSubejctCount
                      "
                      :title="
                        $t(
                          'trials:grouptConsistencyAnalysis:button:RandomCreate'
                        )
                      "
                      @click="
                        openDoctorConsistentRuleSubjectTable(scope.row, true)
                      "
                    />
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-tab-pane>
        </el-tabs>
        <div slot="footer" class="dialog-footer">
          <!-- 取消 -->
          <el-button
            :disabled="btnLoading"
            size="small"
            type="primary"
            @click="ReaderRulesVisible = false"
          >
            {{ $t('common:button:cancel') }}
          </el-button>
          <!-- 保存 -->
        </div>
      </el-dialog>
      <!-- 组间一致性分析 -->
      <el-dialog
        v-if="ReaderRulesVisible2"
        :title="$t('trials:consistencyAnalysis:button:group')"
        :visible.sync="ReaderRulesVisible2"
        width="1200px"
        append-to-body
        :close-on-click-modal="false"
        custom-class="base-dialog-wrapper"
      >
        <el-tabs type="border-card" v-model="TrialReadingCriterionId">
          <el-tab-pane
            :label="item.TrialReadingCriterionName"
            :name="item.TrialReadingCriterionId"
            v-for="item of trialCriterionList"
            :key="item.TrialReadingCriterionId"
          >
            <el-button
              size="small"
              type="primary"
              style="position: absolute; right: 20px; top: 10px; z-index: 100"
              :loading="btnLoading"
              @click="addReaderRulesForm('g')"
            >
              <!-- 配置组间一致性分析规则 -->
              {{ $t('trials:grouptConsistencyAnalysis:button:config') }}
            </el-button>
            <GroupConsistentRuleSubjectTable
              @setReaderRulesFormVisible="
                (v) => {
                  ReaderRulesFormVisible = v
                  isDisable = false
                }
              "
              v-if="TrialReadingCriterionId === item.TrialReadingCriterionId"
              :TrialReadingCriterionId="item.TrialReadingCriterionId"
              :ref="`GroupConsistentRuleSubjectTable${item.TrialReadingCriterionId}`"
              style="margin-top: 40px"
              :IsSelfAnalysis="IsSelfAnalysis"
              :changeNum="changeNum"
              :other-info="RuleOtherInfo"
              @close="
                () => {
                  ReaderRulesVisible2 = false
                  rowData = {}
                }
              "
              @getList="getList()"
            />
          </el-tab-pane>
        </el-tabs>
      </el-dialog>
      <el-dialog
        v-if="ReaderRulesFormVisible"
        :title="`${title}`"
        :visible.sync="ReaderRulesFormVisible"
        width="480px"
        :close-on-click-modal="false"
        append-to-body
      >
        <ReaderRulesForm
          :other-info="OtherInfo"
          :isDisable="isDisable"
          :trial-criterion-list="trialCriterionList"
          :TrialReadingCriterionId="TrialReadingCriterionId"
          :data="rowData"
          :select-list="SelectList"
          :doctor-user-list="DoctorUserList"
          :is-self-analysis="IsSelfAnalysis"
          @close="
            () => {
              ReaderRulesFormVisible = false
              rowData = {}
            }
          "
          @getList="openTaskConsistentRule(IsSelfAnalysis)"
        />
      </el-dialog>
      <!-- 选择受试者 -->
      <el-dialog
        v-if="DoctorConsistentRuleSubjectTableVisible"
        :title="
          rowData.IsAutoAllocateGenerateTask
            ? $t('trials:consistencyAnalysis:dialog:selectSubjectRandom')
            : $t('trials:consistencyAnalysis:dialog:selectSubject')
        "
        :visible.sync="DoctorConsistentRuleSubjectTableVisible"
        :width="rowData.IsAutoAllocateGenerateTask ? '400px' : '1000px'"
        :close-on-click-modal="false"
      >
        <DoctorConsistentRuleSubjectTable
          :data="rowData"
          :other-info="RuleOtherInfo"
          @close="
            () => {
              DoctorConsistentRuleSubjectTableVisible = false
              rowData = {}
            }
          "
          @getList="openTaskConsistentRule(IsSelfAnalysis)"
        />
      </el-dialog>
      <!-- 申请重阅 -->

      <el-dialog
        v-if="isOpenSite"
        :title="$t('trials:consistencyAnalysis:dialog:isOpenSite')"
        :visible.sync="isOpenSite"
        width="600px"
        append-to-body
        :close-on-click-modal="false"
        custom-class="base-dialog-wrapper"
      >
        <VirtualCenter
          :other-info="OtherInfo"
          @getList="getList"
          @close="isOpenSite = false"
        ></VirtualCenter>
      </el-dialog>
      <el-dialog
        v-if="ApplyforReasonVisible"
        :title="$t('trials:consistencyAnalysis:dialog:applyReread')"
        :visible.sync="ApplyforReasonVisible"
        width="600px"
        append-to-body
        :close-on-click-modal="false"
        custom-class="base-dialog-wrapper"
      >
        <div
          style="
            padding: 10px;
            border: 1px solid #e0e0e0;
            max-height: 650px;
            overflow-y: auto;
          "
        >
          <el-form
            ref="reasonForm"
            :rules="rules"
            :model="ApplyforReasonForm"
            class="demo-ruleForm"
            size="small"
            label-width="120px"
          >
            <!-- 申请原因 -->
            <el-form-item
              :label="$t('trials:consistencyAnalysis:applyReread:reason')"
              prop="Type"
              :rules="[
                { required: true, message: $t('common:ruleMessage:select') },
              ]"
            >
              <el-radio-group v-model="ApplyforReasonForm.Type">
                <!-- 图像重传 -->
                <el-radio :label="1">{{
                  $t('trials:consistencyAnalysis:applyReread:imageReload')
                }}</el-radio>
                <!-- 其他 -->
                <el-radio :label="2">{{
                  $t('trials:consistencyAnalysis:applyReread:other')
                }}</el-radio>
              </el-radio-group>
            </el-form-item>
            <!-- 备注 -->
            <el-form-item
              v-if="ApplyforReasonForm.Type === 2"
              :label="$t('trials:consistencyAnalysis:applyReread:remark')"
              prop="RequestReReadingReason"
            >
              <el-input
                v-model="ApplyforReasonForm.RequestReReadingReason"
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4 }"
                :placeholder="$t('common:ruleMessage:specify')"
                maxlength="500"
                show-word-limit
              />
            </el-form-item>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer">
          <!-- 取消 -->
          <el-button
            :disabled="btnLoading"
            size="small"
            type="primary"
            @click="
              ApplyforReasonVisible = false
              ApplyforReasonForm = { Type: null, RequestReReadingReason: null }
            "
          >
            {{ $t('common:button:cancel') }}
          </el-button>
          <!-- 保存 -->
          <el-button
            :loading="btnLoading"
            size="small"
            type="primary"
            @click="applyReReading"
          >
            {{ $t('common:button:save') }}
          </el-button>
        </div>
      </el-dialog>
      <el-dialog
        v-if="exportVisible"
        :title="$t('trials:reviewTrack:button:export')"
        :visible.sync="exportVisible"
        :close-on-click-modal="false"
        width="35%"
        append-to-body
      >
        <exportList
          :trial-reading-criterion-id="TrialReadingCriterionId"
          @handleExport="handleExport"
        />
      </el-dialog>
      <!-- 临床资料 -->
      <el-dialog
        v-if="clinicalDataVisible"
        :title="`${$t('trials:readingPeriod:dialogTitle:clinicalData')}（${
          currentData.SubjectCode
        }|${currentData.TaskName}|${currentData.TrialReadingCriterionName}）`"
        :visible.sync="clinicalDataVisible"
        :close-on-click-modal="false"
        append-to-body
      >
        <ClinicalData
          :trial-reading-criterion-id="TrialReadingCriterionId"
          :trial-id="trialId"
          type="consistencyAnalysis"
          :data="currentData"
          @getList="getList"
        />
      </el-dialog>
    </template>
  </BaseContainer>
</template>
<script>
import {
  getTrialCriterionList,
  getSelfConsistentDoctorStatList,
  setAnalysisTaskInvalid,
  getTrialSiteCodeSelect,
  getDoctorUserSelectList,
  getAnalysisTaskList,
  applyReReading,
} from '@/api/trials/reading'
import { setTaskValid } from '@/api/trials'
import ClinicalData from '@/views/trials/trials-panel/subject/reading-period/components/ClinicalData'
import {
  getSelfAnalysisTaskList_Export,
  getGroupAnalysisTaskList_Export,
  GetAnalysisTaskList_Export,
} from '@/api/export'
import ReaderRulesForm from './components/ReaderRulesForm'
import DoctorConsistentRuleSubjectTable from './components/DoctorConsistentRuleSubjectTable'
import GroupConsistentRuleSubjectTable from './components/GroupConsistentRuleSubjectTable'
import VirtualCenter from './components/VirtualCenter'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
import { getToken } from '@/utils/auth'
import exportList from './components/exportList.vue'
const searchDataDefault = () => {
  return {
    PageIndex: 1,
    PageSize: 20,
    Asc: true,
    SortField: '',
    TrialId: null,
    TrialSiteId: null,
    SubjectId: null,
    SubjectCode: null,
    TrialSiteCode: null,
    IsUrgent: null,
    TaskName: null,
    TaskState: null,
    DoctorUserId: null,
    ReadingCategory: null,
    TaskAllocationState: null,
    BeginAllocateDate: null,
    EndAllocateDate: null,
    TrialReadingCriterionId: null,
    BeginSignTime: null,
    EndSignTime: null,
  }
}
export default {
  name: 'TrialsNotice',
  components: {
    exportList,
    BaseContainer,
    Pagination,
    ReaderRulesForm,
    DoctorConsistentRuleSubjectTable,
    GroupConsistentRuleSubjectTable,
    VirtualCenter,
    ClinicalData,
  },
  data() {
    return {
      TrialReadingCriterionId: null,
      trialCriterionList: [],
      searchData: searchDataDefault(),
      maxLength: 0,
      list: [],
      siteOptions: [],
      total: 0,
      loading: false,
      ReaderRulesVisible: false,
      DoctorConsistentRuleSubjectTableVisible: false,
      trialId: this.$route.query.trialId,
      ReaderRulesVisible2: false,
      currentData: {},
      param: {},
      DoctorUserList: [],
      btnLoading: false,
      rowData: {},
      OtherInfo: {},
      RuleOtherInfo: {},
      title: null,
      SelectList: [],
      TaskConsistentRuleList: [],
      isDisable: false,
      ReaderRulesFormVisible: false,
      IsSelfAnalysis: true,
      timeList: [],
      timeList2: [],
      ApplyforReasonVisible: false,
      ApplyforReasonForm: {
        Type: null,
        RequestReReadingReason: null,
      },
      rules: {
        Type: [
          {
            required: true,
            message: this.$t('common:ruleMessage:specify'),
            trigger: 'blur',
          },
        ],
        RequestReReadingReason: [
          {
            required: true,
            message: this.$t('common:ruleMessage:specify'),
            trigger: 'blur',
          },
        ],
      },
      changeNum: 0,
      openWindow: null,
      isOpenSite: false,

      exportVisible: false,

      clinicalDataVisible: false,
    }
  },
  mounted() {
    this.getList()
    this.getSite()
    this.getDoctorUserSelectList()
    this.getTrialCriterionList()
  },
  beforeDestroy() {
    if (this.openWindow) {
      this.openWindow.close()
    }
  },
  methods: {
    // 修改状态
    async handleSetState(row) {
      try {
        let confirm = await this.$confirm(
          this.$t('trials:reading:consistencyAnalysis:message:setState'),
          {
            type: 'warning',
            distinguishCancelAndClose: true,
          }
        )
        if (!confirm) return
        let data = {
          visitTaskId: row.Id,
        }
        let res = await setTaskValid(data)
        if (res.IsSuccess) {
          this.$message.success(
            this.$t('trials:reading:consistencyAnalysis:setStateSuccess')
          )
          this.getList()
        }
      } catch (err) {
        console.log(err)
      }
    },
    // 临床数据相关
    handleView(row) {
      this.currentData = row
      this.currentData.TrialId = this.$route.query.trialId
      this.clinicalDataVisible = true
    },
    openSite() {
      this.isOpenSite = true
    },
    handleExport(type, TrialReadingCriterionId) {
      // if (!this.searchData.TrialReadingCriterionId) {
      //   this.$alert(this.$t('trials:consistencyAnalysis:message:selectCriterion'))//'请先选择阅片标准'
      //   return
      // }
      if (!TrialReadingCriterionId) {
        this.$alert(
          this.$t('trials:consistencyAnalysis:message:selectCriterion')
        ) //'请先选择阅片标准'
        return
      }
      let obj = JSON.parse(JSON.stringify(this.searchData))
      obj.TrialReadingCriterionId = TrialReadingCriterionId
      obj.ReadingExportType =  type
      return GetAnalysisTaskList_Export(obj)
      if (type === 1) {
        getSelfAnalysisTaskList_Export(obj)
          .then((res) => {})
          .catch(() => {
            this.loading = false
          })
      } else {
        getGroupAnalysisTaskList_Export(obj)
          .then((res) => {})
          .catch(() => {
            this.loading = false
          })
      }
    },
    getTrialCriterionList() {
      this.loading = true
      getTrialCriterionList(this.trialId)
        .then((res) => {
          this.trialCriterionList = res.Result
          this.TrialReadingCriterionId =
            this.trialCriterionList[0].TrialReadingCriterionId
          this.loading = false
        })
        .catch(() => {
          this.loading = false
        })
    },
    setAnalysisTaskInvalid(row) {
      // '确定要将该一致性任务设置成失效吗？'
      this.$confirm(
        this.$t('trials:consistencyAnalysis:applyReread:msg1')
      ).then(() => {
        this.loading = true
        setAnalysisTaskInvalid([row.Id])
          .then((res) => {
            // 设置成功
            this.$message.success(
              this.$t('trials:consistencyAnalysis:applyReread:msg2')
            )
            this.getList()
            this.loading = false
          })
          .catch(() => {
            this.loading = false
          })
      })
    },
    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
      }
    },
    changeTimeList2() {
      if (this.timeList2) {
        this.searchData.BeginSignTime = this.timeList2[0]
        this.searchData.EndSignTime = this.timeList2[1]
      } else {
        this.searchData.BeginSignTime = null
        this.searchData.EndSignTime = null
      }
    },
    // 重阅历史
    reReadingHistory(row) {
      this.$router.push({
        path: `/trials/trials-panel/reading/reReadingTracking?trialId=${this.$route.query.trialId}&trialCode=${this.$route.query.trialCode}&researchProgramNo=${this.$route.query.researchProgramNo}&TrialSiteId=${row.TrialSiteId}&SubjectCode=${row.SubjectCode}&TaskName=${row.TaskName}&DoctorUserId=${row.DoctorUserId}`,
      })
    },
    // 申请重阅
    applyReReading() {
      this.$refs.reasonForm.validate((valid) => {
        if (!valid) return
        this.loading = true
        this.btnLoading = true
        var params = {
          TaskIdList: [this.rowData.Id],
          TrialId: this.$route.query.trialId,
          RequestReReadingType: 2,
          RequestReReadingReason:
            this.ApplyforReasonForm.Type === 2
              ? this.ApplyforReasonForm.RequestReReadingReason
              : this.$t('trials:consistencyAnalysis:applyReread:imageReload'), //'图像重传'
        }
        applyReReading(params)
          .then((res) => {
            this.loading = false
            this.btnLoading = false
            // 申请重阅成功
            this.$message.success(
              this.$t('trials:consistencyAnalysis:applyReread:msg3')
            )
            this.getList()
            this.ApplyforReasonVisible = false
          })
          .catch(() => {
            this.loading = false
            this.btnLoading = false
          })
      })
    },
    lookReadingResults(row) {
      if (this.openWindow) {
        this.openWindow.close()
      }
      // var token = getToken()
      // const routeData = this.$router.resolve({
      //   path: `/readingPage?TrialReadingCriterionId=${row.TrialReadingCriterionId}&subjectId=${row.SubjectId}&trialId=${row.TrialId}&visitTaskId=${row.Id}&TokenKey=${token}`
      // })
      // window.open(routeData.href, '_blank')
      window.localStorage.setItem(
        'TrialReadingCriterionId',
        this.TrialReadingCriterionId
      )
      var token = getToken()
      var path = ''
      if (row.ReadingTool === 0) {
        path = `/readingDicoms?TrialReadingCriterionId=${row.TrialReadingCriterionId}&trialId=${row.TrialId}&subjectCode=${row.SubjectCode}&subjectId=${row.SubjectId}&visitTaskId=${row.Id}&isReadingTaskViewInOrder=${row.IsReadingTaskViewInOrder}&criterionType=${row.CriterionType}&readingTool=${row.ReadingTool}&TokenKey=${token}`
      } else {
        path = `/noneDicomReading?TrialReadingCriterionId=${row.TrialReadingCriterionId}&trialId=${row.TrialId}&subjectCode=${row.SubjectCode}&subjectId=${row.SubjectId}&visitTaskId=${row.Id}&isReadingTaskViewInOrder=${row.IsReadingTaskViewInOrder}&criterionType=${row.CriterionType}&readingTool=${row.ReadingTool}&TokenKey=${token}`
      }
      var routeData = this.$router.resolve({ path })
      this.openWindow = window.open(routeData.href, '_blank')
    },
    openApplyReReading(row) {
      this.rowData = { ...row }
      this.ApplyforReasonVisible = true
      this.ApplyforReasonForm = {
        Type: null,
        Remake: null,
      }
    },
    editReaderRulesForm(row) {
      this.rowData = { ...row }
      this.ReaderRulesFormVisible = true
    },
    openDoctorConsistentRuleSubjectTable(row, IsAutoAllocateGenerateTask) {
      this.rowData = { ...row }
      this.DoctorConsistentRuleSubjectTableVisible = true
      this.rowData.IsAutoAllocateGenerateTask = IsAutoAllocateGenerateTask
    },
    addReaderRulesForm(isg) {
      this.isDisable = false
      if (isg) {
        if (
          this.$refs[
            `GroupConsistentRuleSubjectTable${this.TrialReadingCriterionId}`
          ][0].list
        ) {
          this.$refs[
            `GroupConsistentRuleSubjectTable${this.TrialReadingCriterionId}`
          ][0].list.forEach((v) => {
            if (v.IsHaveGeneratedTask) {
              this.isDisable = true
            }
          })
        }
      } else {
        if (this.TaskConsistentRuleList.length > 0) {
          this.rowData = { ...this.TaskConsistentRuleList[0] }
          this.TaskConsistentRuleList.forEach((v) => {
            if (v.GeneratedSubjectCount) {
              this.isDisable = true
            }
          })
        } else {
          this.rowData = {}
        }
      }
      this.ReaderRulesFormVisible = true
    },
    clickTab(tab, event) {
      this.loading = true
      this.title = `${this.$t(
        'trials:selftConsistencyAnalysis:button:config'
      )}(${
        this.trialCriterionList.find(
          (v) => v.TrialReadingCriterionId === this.TrialReadingCriterionId
        ).TrialReadingCriterionName
      })`
      getSelfConsistentDoctorStatList({
        TrialId: this.trialId,
        TrialReadingCriterionId: tab.name,
      })
        .then((res) => {
          if (res.OtherInfo) {
            this.ReaderRulesFormVisible = false
            this.RuleOtherInfo = res.OtherInfo
          } else {
            this.ReaderRulesFormVisible = true
          }
          // this.ReaderRulesFormVisible = false
          // this.DoctorConsistentRuleSubjectTableVisible = false
          this.TaskConsistentRuleList = res.Result
          // this.IsSelfAnalysis = true
          // this.ReaderRulesVisible = true
          // this.getList()
          this.loading = false
        })
        .catch(() => {
          this.loading = false
        })
    },
    openExport() {
      if (this.trialCriterionList.length === 0) {
        this.$alert(
          this.$t(
            'trials:trials-panel:consistency-analysis:trialCriterionListLength'
          )
        )
        return
      }
      this.exportVisible = true
    },
    openTaskConsistentRule(IsSelfAnalysis) {
      if (this.trialCriterionList.length === 0) {
        this.$alert(
          this.$t(
            'trials:trials-panel:consistency-analysis:trialCriterionListLength'
          )
        )
        return
      }
      this.loading = true
      if (IsSelfAnalysis) {
        // '配置自身一致性分析规则'
        this.title = `${this.$t(
          'trials:selftConsistencyAnalysis:button:config'
        )}(${
          this.trialCriterionList.find(
            (v) => v.TrialReadingCriterionId === this.TrialReadingCriterionId
          ).TrialReadingCriterionName
        })`
        getSelfConsistentDoctorStatList({
          TrialId: this.trialId,
          TrialReadingCriterionId: this.TrialReadingCriterionId,
        })
          .then((res) => {
            if (res.OtherInfo) {
              this.ReaderRulesFormVisible = false
              this.RuleOtherInfo = res.OtherInfo
            } else {
              this.ReaderRulesFormVisible = true
            }
            this.DoctorConsistentRuleSubjectTableVisible = false
            this.TaskConsistentRuleList = res.Result
            this.IsSelfAnalysis = IsSelfAnalysis
            this.ReaderRulesVisible = true
            this.getList()
            this.loading = false
          })
          .catch(() => {
            this.loading = false
          })
      } else {
        this.changeNum++
        this.ReaderRulesFormVisible = false
        // '配置组间一致性分析规则'
        this.title = this.$t('trials:grouptConsistencyAnalysis:button:config')
        this.IsSelfAnalysis = IsSelfAnalysis
        this.ReaderRulesVisible2 = true
        this.loading = false
      }
      // getTaskConsistentRuleList({
      //   IsSelfAnalysis: IsSelfAnalysis,
      //   TrialId: this.trialId
      // }).then(res => {
      //   this.ReaderRulesFormVisible = false
      //   this.DoctorConsistentRuleSubjectTableVisible = false
      //   this.TaskConsistentRuleList = res.Result
      //   this.IsSelfAnalysis = IsSelfAnalysis
      //   this.ReaderRulesVisible = true
      // })
    },
    getDoctorUserSelectList() {
      getDoctorUserSelectList(this.$route.query.trialId).then((res) => {
        this.DoctorUserList = res.Result
        if (this.DoctorUserList.length > 0) {
          this.ReadingType = this.DoctorUserList[0].ReadingType
        } else {
        }
      })
    },
    getList() {
      this.searchData.TrialId = this.$route.query.trialId
      this.loading = true
      getAnalysisTaskList(this.searchData)
        .then((res) => {
          this.loading = false
          this.OtherInfo = res.OtherInfo
          this.list = res.Result.CurrentPageData
          this.total = res.Result.TotalCount
          this.ReaderRulesVisible2 = false
          this.AssignMedicalReviewTaskVisible = false
        })
        .catch(() => {
          this.loading = false
        })
    },
    handleSearch() {
      this.searchData.PageIndex = 1
      this.getList()
    },
    handleReset() {
      this.timeList = null
      this.timeList2 = null
      this.searchData = searchDataDefault()
      this.getList()
    },
    getSite() {
      getTrialSiteCodeSelect(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>
.consistency-analysis-wrapper {
  height: 100%;
  position: relative;
  .remark {
    position: absolute;
    left: 5px;
    bottom: 7px;
    font-size: 12px;
  }
}

.status-primary-circle {
  display: inline-block;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 18px;
  border-radius: 50%;
  // background: #f56c6c;
  border: 1px solid #f56c6c;
  color: #f56c6c;
  font-size: 10px;
}
/deep/ .hidden-row {
  display: none;
}
/deep/ .el-dialog__body {
  padding: 15px 20px;
}

/deep/ .el-tag--danger.el-tag--dark {
  // background-color: #f56c6c!important;
  border-color: none !important;
  // color: #fff!important;
}
/deep/ #TaskAllocationRuleList thead .el-checkbox__inner {
  display: none;
}
/deep/ .el-descriptions-item__label.has-colon:after {
  display: none;
}
</style>
