240 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			240 lines
		
	
	
		
			8.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <BaseContainer v-loading="loading" style="height:100%;background-color: #fff;">
 | 
						|
    <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="isReadingTaskViewInOrder && isRender && TrialReadingCriterionId === item.TrialReadingCriterionId">
 | 
						|
          <div slot="search-container">
 | 
						|
            <el-form :inline="true">
 | 
						|
              <!-- 受试者编号 -->
 | 
						|
              <el-form-item label="受试者编号">
 | 
						|
                <el-input
 | 
						|
                  v-model="searchData.SubjectCode"
 | 
						|
                  style="width:130px;"
 | 
						|
                  clearable
 | 
						|
                />
 | 
						|
              </el-form-item>
 | 
						|
 | 
						|
              <el-form-item>
 | 
						|
                <!-- 查询 -->
 | 
						|
                <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-form-item>
 | 
						|
            </el-form>
 | 
						|
          </div>
 | 
						|
          <div slot="main-container">
 | 
						|
                <el-table
 | 
						|
                  v-adaptive="{bottomOffset:75}"
 | 
						|
                  :data="list"
 | 
						|
                  stripe
 | 
						|
                  height="100"
 | 
						|
                >
 | 
						|
                  <el-table-column type="index" width="40" align="left" />
 | 
						|
                  <!-- 受试者编号 -->
 | 
						|
                  <el-table-column
 | 
						|
                    prop="SubjectCode"
 | 
						|
                    min-width="100"
 | 
						|
                    label="受试者编号"
 | 
						|
                    show-overflow-tooltip
 | 
						|
                  />
 | 
						|
                  <!-- 剩余阅片量 -->
 | 
						|
                  <el-table-column
 | 
						|
                    prop="UnReadTaskCount"
 | 
						|
                    min-width="100"
 | 
						|
                    label="剩余阅片量"
 | 
						|
                    show-overflow-tooltip
 | 
						|
                  />
 | 
						|
                  <!-- 建议完成时间 -->
 | 
						|
                  <el-table-column
 | 
						|
                    prop="SuggesteFinishedTime"
 | 
						|
                    min-width="100"
 | 
						|
                    label="建议完成时间"
 | 
						|
                    show-overflow-tooltip
 | 
						|
                  />
 | 
						|
                  <el-table-column
 | 
						|
 | 
						|
                    :label="$t('common:action:action')"
 | 
						|
                    width="250"
 | 
						|
                    fixed="right"
 | 
						|
                  >
 | 
						|
                    <template slot-scope="scope">
 | 
						|
                      <!-- 阅片 -->
 | 
						|
                      <el-button
 | 
						|
                        :disabled="scope.row.ExistReadingApply"
 | 
						|
                        circle
 | 
						|
                        title="阅片"
 | 
						|
                        icon="el-icon-edit-outline"
 | 
						|
                        @click="handleReadImage(scope.row)"
 | 
						|
                      />
 | 
						|
                    </template>
 | 
						|
                  </el-table-column>
 | 
						|
                </el-table>
 | 
						|
                <pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
 | 
						|
          </div>
 | 
						|
        </div>
 | 
						|
        <template v-else-if="!isReadingTaskViewInOrder && isRender">
 | 
						|
          <el-tabs type="border-card" v-model="TrialReadingCriterionId">
 | 
						|
            <el-tab-pane :label="item.TrialReadingCriterionName" :name="item.TrialReadingCriterionId" v-for="item of trialCriterionList">
 | 
						|
              <el-descriptions :column="2" border style="width:800px">
 | 
						|
                <el-descriptions-item label="剩余任务量" :label-style="{'width':'200px'}">
 | 
						|
                  <el-tag size="small" type="danger">{{ randomReadInfo.UnReadTaskCount }}</el-tag>
 | 
						|
                </el-descriptions-item>
 | 
						|
                <el-descriptions-item label="剩余裁判量" :label-style="{'width':'200px'}">
 | 
						|
                  <el-tag size="small" type="danger">{{ randomReadInfo.UnReadJudgeTaskCount }}</el-tag>
 | 
						|
                </el-descriptions-item>
 | 
						|
                <el-descriptions-item label="已完成任务量" :label-style="{'width':'200px'}">
 | 
						|
                  <el-tag size="small">{{ randomReadInfo.FinishTaskCount }}</el-tag>
 | 
						|
                </el-descriptions-item>
 | 
						|
                <el-descriptions-item label="已完成裁判量" :label-style="{'width':'200px'}">
 | 
						|
                  <el-tag size="small">{{ randomReadInfo.FinishJudgeTaskCount }}</el-tag>
 | 
						|
                </el-descriptions-item>
 | 
						|
                <el-descriptions-item>
 | 
						|
                  <el-button
 | 
						|
                    type="primary"
 | 
						|
                    size="small"
 | 
						|
                    :disabled="randomReadInfo.UnReadTaskCount+randomReadInfo.UnReadJudgeTaskCount ===0"
 | 
						|
                    @click="handleOutOfOrderReading"
 | 
						|
                  >
 | 
						|
                    开始随机阅片
 | 
						|
                  </el-button>
 | 
						|
                </el-descriptions-item>
 | 
						|
              </el-descriptions>
 | 
						|
            </el-tab-pane>
 | 
						|
          </el-tabs>
 | 
						|
        </template>
 | 
						|
      </el-tab-pane>
 | 
						|
    </el-tabs>
 | 
						|
  </BaseContainer>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getIRUnReadSubjectTaskList } from '@/api/trials'
 | 
						|
import { getTrialCriterionList } from '@/api/trials/reading'
 | 
						|
import BaseContainer from '@/components/BaseContainer'
 | 
						|
import Pagination from '@/components/Pagination'
 | 
						|
import { getToken } from '@/utils/auth'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    SubjectCode: '',
 | 
						|
    PageIndex: 1,
 | 
						|
    PageSize: 20
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'ReadingTaskList',
 | 
						|
  components: { BaseContainer, Pagination },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      trialId: '',
 | 
						|
      isReadingTaskViewInOrder: null,
 | 
						|
      randomReadInfo: {},
 | 
						|
      isRender: false,
 | 
						|
      trialCriterionList: [],
 | 
						|
      TrialReadingCriterionId: "0",
 | 
						|
      isTableShow: true
 | 
						|
    }
 | 
						|
  },
 | 
						|
  watch: {
 | 
						|
    TrialReadingCriterionId (v) {
 | 
						|
      if (v) {
 | 
						|
        this.isTableShow = false
 | 
						|
        this.$nextTick(() => {
 | 
						|
          this.isTableShow = true
 | 
						|
        })
 | 
						|
        this.getList()
 | 
						|
      }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    window.addEventListener('message', this.receiveMsg)
 | 
						|
    this.trialId = this.$route.query.trialId
 | 
						|
    this.getTrialCriterionList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getTrialCriterionList() {
 | 
						|
      getTrialCriterionList(this.trialId).then(res => {
 | 
						|
        this.trialCriterionList = res.Result
 | 
						|
        this.TrialReadingCriterionId = this.trialCriterionList[0].TrialReadingCriterionId
 | 
						|
      }).catch(() => {})
 | 
						|
    },
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      this.searchData.TrialId = this.trialId
 | 
						|
      this.searchData.TrialReadingCriterionId = this.TrialReadingCriterionId
 | 
						|
      getIRUnReadSubjectTaskList(this.searchData).then(res => {
 | 
						|
        this.isReadingTaskViewInOrder = res.OtherInfo.IsReadingTaskViewInOrder
 | 
						|
        if (res.OtherInfo.IsReadingTaskViewInOrder) {
 | 
						|
          this.list = res.Result.CurrentPageData
 | 
						|
          console.log(this.list)
 | 
						|
          this.total = res.Result.TotalCount
 | 
						|
        } else {
 | 
						|
          this.randomReadInfo = res.OtherInfo.RandomReadInfo
 | 
						|
        }
 | 
						|
        this.isRender = true
 | 
						|
        this.loading = false
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleSearch() {
 | 
						|
      this.searchData.PageIndex = 1
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    handleReset() {
 | 
						|
      this.searchData = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    handleReadImage(row) {
 | 
						|
      var token = getToken()
 | 
						|
      var routeData = ''
 | 
						|
      // if (this.trialId === 'e43e0000-3e2c-0016-a57d-08da87355304') {
 | 
						|
      //   routeData = this.$router.resolve({
 | 
						|
      //     path: `/readingDicoms?subjectCode=${row.SubjectCode}&subjectId=${row.SubjectId}&trialId=${this.trialId}&TokenKey=${token}`
 | 
						|
      //   })
 | 
						|
      // } else {
 | 
						|
      //   routeData = this.$router.resolve({
 | 
						|
      //     path: `/noneDicomReading?subjectCode=${row.SubjectCode}&subjectId=${row.SubjectId}&trialId=${this.trialId}&TokenKey=${token}`
 | 
						|
      //   })
 | 
						|
      // }
 | 
						|
      window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId)
 | 
						|
      routeData = this.$router.resolve({
 | 
						|
        path: `/readingPage?subjectCode=${row.SubjectCode}&subjectId=${row.SubjectId}&trialId=${this.trialId}&TokenKey=${token}`
 | 
						|
      })
 | 
						|
      window.open(routeData.href, '_blank')
 | 
						|
    },
 | 
						|
    handleOutOfOrderReading() {
 | 
						|
      var token = getToken()
 | 
						|
      // const routeData = this.$router.resolve({
 | 
						|
      //   path: `/noneDicomReading?trialId=${this.trialId}&TokenKey=${token}`
 | 
						|
      // })
 | 
						|
      window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId)
 | 
						|
      const routeData = this.$router.resolve({
 | 
						|
        path: `/readingPage?trialId=${this.trialId}&TokenKey=${token}`
 | 
						|
      })
 | 
						|
      window.open(routeData.href, '_blank')
 | 
						|
    },
 | 
						|
    receiveMsg(event) {
 | 
						|
      if (event.data === 'refreshTaskList') {
 | 
						|
        this.getList()
 | 
						|
      }
 | 
						|
    },
 | 
						|
    // 排序
 | 
						|
    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>
 |