183 lines
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			183 lines
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
/* eslint-disable */
 | 
						|
<template>
 | 
						|
  <el-form>
 | 
						|
    <div class="base-dialog-body">
 | 
						|
      <el-table
 | 
						|
        v-loading="loading"
 | 
						|
        :data="list"
 | 
						|
        stripe
 | 
						|
        height="100"
 | 
						|
        style="min-height: 400px;"
 | 
						|
        @selection-change="handleSelectChange"
 | 
						|
      >
 | 
						|
        <el-table-column :selectable="selectable" type="selection" align="left" width="45" />
 | 
						|
        <!-- 中心编号 -->
 | 
						|
        <el-table-column
 | 
						|
          prop="TrialSiteCode"
 | 
						|
          :label="$t('trials:grouptConsistencyAnalysis:table:siteCode')"
 | 
						|
          min-width="100"
 | 
						|
          sortable="custom"
 | 
						|
          show-overflow-tooltip
 | 
						|
        />
 | 
						|
        <!-- 受试者编号 -->
 | 
						|
        <el-table-column
 | 
						|
          prop="SubjectCode"
 | 
						|
          :label="$t('trials:grouptConsistencyAnalysis:table:subjectCode')"
 | 
						|
          min-width="120"
 | 
						|
          sortable="custom"
 | 
						|
          show-overflow-tooltip
 | 
						|
        />
 | 
						|
        <!-- 符合规则访视数 -->
 | 
						|
        <el-table-column
 | 
						|
          prop="ValidVisitCount"
 | 
						|
          :label="$t('trials:grouptConsistencyAnalysis:table:validVisitCount')"
 | 
						|
          min-width="160"
 | 
						|
          sortable="custom"
 | 
						|
          show-overflow-tooltip
 | 
						|
        />
 | 
						|
      </el-table>
 | 
						|
      <!-- 分页组件 -->
 | 
						|
      <div style="text-align: right">
 | 
						|
        <pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
 | 
						|
      </div>
 | 
						|
    </div>
 | 
						|
    <div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
 | 
						|
      <el-form-item>
 | 
						|
        <!-- 取消 -->
 | 
						|
        <el-button
 | 
						|
          :disabled="btnLoading"
 | 
						|
          size="small"
 | 
						|
          type="primary"
 | 
						|
          @click="close"
 | 
						|
        >
 | 
						|
          {{ $t('common:button:cancel') }}
 | 
						|
        </el-button>
 | 
						|
        <!-- 生成 -->
 | 
						|
        <el-button size="small" type="primary" :loading="btnLoading" @click="save">
 | 
						|
          {{$t('trials:grouptConsistencyAnalysis:button:create')}}
 | 
						|
        </el-button>
 | 
						|
      </el-form-item>
 | 
						|
    </div>
 | 
						|
  </el-form>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getGroupConsistentRuleSubjectList, confirmGenerateGroupConsistentTask, getDoctorConsistentRuleSubjectList, confirmGenerateConsistentTask } from '@/api/trials/reading'
 | 
						|
import BaseContainer from '@/components/BaseContainer'
 | 
						|
import Pagination from '@/components/Pagination'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    PageIndex: 1,
 | 
						|
    PageSize: 20,
 | 
						|
    Asc: true,
 | 
						|
    SortField: '',
 | 
						|
    TrialId: null,
 | 
						|
    TaskConsistentRuleId: null
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'TrialsNotice',
 | 
						|
  components: { BaseContainer, Pagination },
 | 
						|
  props: {
 | 
						|
    changeNum: {
 | 
						|
      type: Number,
 | 
						|
      default() {
 | 
						|
        return 0
 | 
						|
      }
 | 
						|
    },
 | 
						|
    IsSelfAnalysis: {
 | 
						|
      type: Boolean,
 | 
						|
      default() {
 | 
						|
        return false
 | 
						|
      }
 | 
						|
    },
 | 
						|
    TrialReadingCriterionId:{
 | 
						|
      type:String,
 | 
						|
      required:true
 | 
						|
    },
 | 
						|
    data: {
 | 
						|
      type: Object,
 | 
						|
      default() {
 | 
						|
        return {}
 | 
						|
      }
 | 
						|
    },
 | 
						|
  },
 | 
						|
  watch: {
 | 
						|
    changeNum(v) {
 | 
						|
      this.getList()
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      trialId: this.$route.query.trialId,
 | 
						|
      SelectList: [],
 | 
						|
      btnLoading: false
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    selectable(row) {
 | 
						|
      if (row.IsHaveGeneratedTask) {
 | 
						|
        return false
 | 
						|
      } else {
 | 
						|
        return true
 | 
						|
      }
 | 
						|
    },
 | 
						|
    handleSelectChange(e) {
 | 
						|
      this.SelectList = e
 | 
						|
    },
 | 
						|
    save () {
 | 
						|
      if (this.SelectList.length === 0) {
 | 
						|
        // '请选择要生成的受试者'
 | 
						|
        this.$alert(this.$t('trials:grouptConsistencyAnalysis:message:msg1'))
 | 
						|
        return
 | 
						|
      }
 | 
						|
      this.btnLoading = true
 | 
						|
      this.loading = true
 | 
						|
      var params = {
 | 
						|
        TrialId: this.$route.query.trialId,
 | 
						|
        SubejctIdList: this.SelectList.map(v => v.SubjectId)
 | 
						|
      }
 | 
						|
      confirmGenerateGroupConsistentTask(params).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.btnLoading = false
 | 
						|
        // '保存成功'
 | 
						|
        this.$message.success(this.$t('common:message:savedSuccessfully'))
 | 
						|
        this.close()
 | 
						|
        this.$emit('getList')
 | 
						|
      }).catch(() => {
 | 
						|
        this.loading = false
 | 
						|
        this.btnLoading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    getList() {
 | 
						|
      this.searchData.TrialId = this.$route.query.trialId
 | 
						|
      this.loading = true
 | 
						|
      this.searchData.TrialReadingCriterionId = this.TrialReadingCriterionId
 | 
						|
      getGroupConsistentRuleSubjectList(this.searchData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.list = res.Result.CurrentPageData
 | 
						|
        this.total = res.Result.TotalCount
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    close() { this.$emit('close') },
 | 
						|
    // 排序
 | 
						|
    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>
 |