463 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			463 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div class="wrapper">
 | 
						|
    <el-row>
 | 
						|
      <el-col :span="8">
 | 
						|
        <h3>{{ $t('trials:crcUpload:label:clinicalData') }}</h3>
 | 
						|
      </el-col>
 | 
						|
      <el-col :span="16" style="text-align:right;">
 | 
						|
        <h3>
 | 
						|
          <Pagination class="page" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" layout="total, sizes, prev, pager, next" :background="false" style="display: inline-block;" @pagination="getList" />
 | 
						|
          <!-- 重置 -->
 | 
						|
          <el-button icon="el-icon-refresh-left" size="small" circle :title="$t('common:button:reset')" @click="handleReset" />
 | 
						|
        </h3>
 | 
						|
      </el-col>
 | 
						|
    </el-row>
 | 
						|
    <el-table
 | 
						|
      ref="needSignDocList"
 | 
						|
      v-loading="listLoading"
 | 
						|
      :data="list"
 | 
						|
      :show-header="true"
 | 
						|
      height="calc(100% - 100px)"
 | 
						|
      @sort-change="handleSortByColumn"
 | 
						|
    >
 | 
						|
      <el-table-column type="index" width="40" />
 | 
						|
      <!-- 项目编号 -->
 | 
						|
      <el-table-column
 | 
						|
        :label="$t('trials:workbench:table:trialId')"
 | 
						|
        prop="TrialCode"
 | 
						|
        show-overflow-tooltip
 | 
						|
        sortable="custom"
 | 
						|
      />
 | 
						|
      <!-- 试验名称 -->
 | 
						|
      <el-table-column
 | 
						|
        :label="$t('trials:workbench:table:experimentName')"
 | 
						|
        prop="ExperimentName"
 | 
						|
        show-overflow-tooltip
 | 
						|
        sortable="custom"
 | 
						|
      />
 | 
						|
      <!-- 研究方案号 -->
 | 
						|
      <el-table-column
 | 
						|
        :label="$t('trials:workbench:table:researchNo')"
 | 
						|
        prop="ResearchProgramNo"
 | 
						|
        show-overflow-tooltip
 | 
						|
        sortable="custom"
 | 
						|
      />
 | 
						|
      <!-- 加急量 -->
 | 
						|
      <el-table-column
 | 
						|
        :label="'加急量'"
 | 
						|
        prop="UrgentCount"
 | 
						|
        show-overflow-tooltip
 | 
						|
        sortable="custom"
 | 
						|
        width="190"
 | 
						|
      />
 | 
						|
      <!-- 待核查量 -->
 | 
						|
      <el-table-column
 | 
						|
        :label="'待录入量'"
 | 
						|
        prop="ToBeDealedCount"
 | 
						|
        show-overflow-tooltip
 | 
						|
        sortable="custom"
 | 
						|
        width="190"
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        :label="$t('common:action:action')"
 | 
						|
        width="100"
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          <el-button
 | 
						|
            icon="el-icon-edit-outline"
 | 
						|
            circle
 | 
						|
            :title="$t('trials:workbench:action:sign')"
 | 
						|
            @click="handleUpload(scope.row)"
 | 
						|
          />
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
    </el-table>
 | 
						|
    <el-dialog
 | 
						|
      v-if="configVisible"
 | 
						|
      :visible.sync="configVisible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      width="800px"
 | 
						|
      :title="$t('trials:trialCfg:dialogTitle:cfgConfirm')"
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <div class="base-dialog-body">
 | 
						|
        <el-tabs type="border-card">
 | 
						|
          <el-tab-pane label="上传临床数据">
 | 
						|
            <el-table
 | 
						|
              :data="clinicalData"
 | 
						|
              border
 | 
						|
              style="width: 100%"
 | 
						|
              size="small"
 | 
						|
              :span-method="objectSpanMethod"
 | 
						|
            >
 | 
						|
              <!-- 受试者 -->
 | 
						|
              <el-table-column
 | 
						|
                prop="SubjectCode"
 | 
						|
                label="受试者"
 | 
						|
                show-overflow-tooltip
 | 
						|
                width="120"
 | 
						|
              />
 | 
						|
              <!-- 临床数据类型 -->
 | 
						|
              <el-table-column
 | 
						|
                prop="ClinicalDataSetName"
 | 
						|
                label="临床数据类型"
 | 
						|
                show-overflow-tooltip
 | 
						|
              />
 | 
						|
              <!-- 配置值 -->
 | 
						|
              <el-table-column
 | 
						|
                prop="ClinicalCount"
 | 
						|
                label="记录数"
 | 
						|
                show-overflow-tooltip
 | 
						|
              />
 | 
						|
              <el-table-column
 | 
						|
                :label="$t('common:action:action')"
 | 
						|
                width="150"
 | 
						|
              >
 | 
						|
                <template slot-scope="scope">
 | 
						|
                  <el-button
 | 
						|
                    icon="el-icon-plus"
 | 
						|
                    circle
 | 
						|
                    title="添加"
 | 
						|
                    @click="handleAdd(scope.row)"
 | 
						|
                  />
 | 
						|
                  <el-button
 | 
						|
                    icon="el-icon-view"
 | 
						|
                    circle
 | 
						|
                    title="查看"
 | 
						|
                    @click="handleView(scope.row)"
 | 
						|
                  />
 | 
						|
                </template>
 | 
						|
              </el-table-column>
 | 
						|
            </el-table>
 | 
						|
          </el-tab-pane>
 | 
						|
          <el-tab-pane label="临床数据确认">
 | 
						|
            <el-table
 | 
						|
              :data="confirmData"
 | 
						|
              border
 | 
						|
              style="width: 100%"
 | 
						|
              size="small"
 | 
						|
            >
 | 
						|
              <el-table-column
 | 
						|
                prop="SubjectCode"
 | 
						|
                label="受试者"
 | 
						|
                show-overflow-tooltip
 | 
						|
                width="120"
 | 
						|
              />
 | 
						|
              <el-table-column
 | 
						|
                prop="SubjectCode"
 | 
						|
                label="截止日期"
 | 
						|
                show-overflow-tooltip
 | 
						|
                width="120"
 | 
						|
              />
 | 
						|
              <el-table-column
 | 
						|
                prop="SubjectCode"
 | 
						|
                label="记录数"
 | 
						|
                show-overflow-tooltip
 | 
						|
                width="120"
 | 
						|
              />
 | 
						|
              <el-table-column
 | 
						|
                prop="是否确认"
 | 
						|
                label="记录数"
 | 
						|
                show-overflow-tooltip
 | 
						|
                width="120"
 | 
						|
              />
 | 
						|
              <el-table-column
 | 
						|
                :label="$t('common:action:action')"
 | 
						|
                width="150"
 | 
						|
                fixed="right"
 | 
						|
              >
 | 
						|
                <template slot-scope="scope">
 | 
						|
                  <el-button
 | 
						|
                    icon="el-icon-view"
 | 
						|
                    circle
 | 
						|
                    size="mini"
 | 
						|
                    title="查看"
 | 
						|
                    @click="handleView3(scope.row)"
 | 
						|
                  />
 | 
						|
                  <el-button
 | 
						|
                    icon="el-icon-check"
 | 
						|
                    circle
 | 
						|
                    size="mini"
 | 
						|
                    title="确认"
 | 
						|
                    @click="handleEdit2(scope.row)"
 | 
						|
                  />
 | 
						|
                  <el-button
 | 
						|
                    icon="icon-back"
 | 
						|
                    circle
 | 
						|
                    size="mini"
 | 
						|
                    title="删除"
 | 
						|
                    @click="handleDelete2(scope.row)"
 | 
						|
                  />
 | 
						|
                </template>
 | 
						|
              </el-table-column>
 | 
						|
            </el-table>
 | 
						|
          </el-tab-pane>
 | 
						|
        </el-tabs>
 | 
						|
      </div>
 | 
						|
    </el-dialog>
 | 
						|
    <el-dialog
 | 
						|
      v-if="preview.visible"
 | 
						|
      :visible.sync="preview.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="preview.title"
 | 
						|
      :fullscreen="true"
 | 
						|
    >
 | 
						|
      <clinicalDataQuestions
 | 
						|
        :data="rowData"
 | 
						|
        :trial-clinical-id="rowData.ClinicalDataTrialSetId"
 | 
						|
        :is-viewer="false"
 | 
						|
        :visit-id="rowData.VisitId"
 | 
						|
        :subject-id="rowData.SubjectId"
 | 
						|
        :trial-id="rowData.TrialId"
 | 
						|
        :reading-id="rowData.ReadingId"
 | 
						|
        :clinical-form-id="rowData.ClinicalFormId"
 | 
						|
        :open-type="openType"
 | 
						|
        @close="preview.visible = false;handleUpload(rowData)"
 | 
						|
      />
 | 
						|
    </el-dialog>
 | 
						|
    <el-dialog
 | 
						|
      v-if="preview2.visible"
 | 
						|
      :visible.sync="preview2.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="preview2.title"
 | 
						|
      width="1200px"
 | 
						|
    >
 | 
						|
      <el-table
 | 
						|
        v-loading="listLoading"
 | 
						|
        :data="AnswerList"
 | 
						|
        :show-header="true"
 | 
						|
        @sort-change="handleSortByColumn"
 | 
						|
      >
 | 
						|
        <el-table-column
 | 
						|
          v-for="item of QuestionList"
 | 
						|
          :prop="item.Id"
 | 
						|
          :label="item.QuestionName"
 | 
						|
          show-overflow-tooltip
 | 
						|
          width="120"
 | 
						|
        />
 | 
						|
        <el-table-column
 | 
						|
          :label="$t('common:action:action')"
 | 
						|
          width="150"
 | 
						|
          fixed="right"
 | 
						|
        >
 | 
						|
          <template slot-scope="scope">
 | 
						|
            <el-button
 | 
						|
              icon="el-icon-view"
 | 
						|
              circle
 | 
						|
              size="mini"
 | 
						|
              title="查看"
 | 
						|
              @click="handleView2(scope.row)"
 | 
						|
            />
 | 
						|
            <el-button
 | 
						|
              icon="el-icon-edit-outline"
 | 
						|
              circle
 | 
						|
              size="mini"
 | 
						|
              title="编辑"
 | 
						|
              @click="handleEdit2(scope.row)"
 | 
						|
            />
 | 
						|
            <el-button
 | 
						|
              icon="el-icon-delete"
 | 
						|
              circle
 | 
						|
              size="mini"
 | 
						|
              title="删除"
 | 
						|
              @click="handleDelete2(scope.row)"
 | 
						|
            />
 | 
						|
          </template>
 | 
						|
        </el-table-column>
 | 
						|
      </el-table>
 | 
						|
    </el-dialog>
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getImageClinicalDataToBeDoneList, getCRCSubjectClinicalList, deleteClinicalForm, getCRCConfirmList } from '@/api/trials'
 | 
						|
import { getClinicalQuestionFormList } from '@/api/dictionary'
 | 
						|
import Pagination from '@/components/Pagination'
 | 
						|
import clinicalDataQuestions from '@/components/clinicalDataQuestions'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    pageIndex: 1,
 | 
						|
    pageSize: 20,
 | 
						|
    asc: true,
 | 
						|
    sortField: ''
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'NeedSignDoc',
 | 
						|
  components: { Pagination, clinicalDataQuestions },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      listLoading: false,
 | 
						|
      configVisible: false,
 | 
						|
      list: [],
 | 
						|
      listQuery: searchDataDefault(),
 | 
						|
      total: 0,
 | 
						|
      clinicalData: [],
 | 
						|
      rowData: {},
 | 
						|
      rowData2: {},
 | 
						|
      spanArr: [],
 | 
						|
      QuestionList: [],
 | 
						|
      AnswerList: [],
 | 
						|
      pos: 0,
 | 
						|
      pos2: 0,
 | 
						|
      spanArr2: 0,
 | 
						|
      confirmData: [],
 | 
						|
      preview: { visible: false, title: '临床数据自定义问题' },
 | 
						|
      preview2: { visible: false, title: '已上传临床数据列表' },
 | 
						|
      openType: 'look',
 | 
						|
      formListData: {}
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    handleView2(row) {
 | 
						|
      console.log(row)
 | 
						|
      this.rowData = {...row}
 | 
						|
      this.openType = 'look'
 | 
						|
      this.preview.visible = true
 | 
						|
    },
 | 
						|
    handleEdit2(row) {
 | 
						|
      this.rowData = {...row}
 | 
						|
      this.openType = 'edit'
 | 
						|
      this.preview.visible = true
 | 
						|
    },
 | 
						|
    handleDelete2(row) {
 | 
						|
      this.$confirm('确定删除该条临床数据记录吗?').then(() => {
 | 
						|
        this.listLoading = true
 | 
						|
        deleteClinicalForm({
 | 
						|
          ClinicalFormId: row.ClinicalFormId
 | 
						|
        }).then(res => {
 | 
						|
          this.$message.success('删除成功')
 | 
						|
          this.listLoading = false
 | 
						|
          this.handleView(row)
 | 
						|
        })
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleAdd(row) {
 | 
						|
      this.rowData = {...row}
 | 
						|
      this.preview.visible = true
 | 
						|
      this.openType = 'add'
 | 
						|
    },
 | 
						|
    handleView(row) {
 | 
						|
      this.rowData = {...row}
 | 
						|
      this.listLoading = true
 | 
						|
      getClinicalQuestionFormList({
 | 
						|
        TrialId: row.TrialId,
 | 
						|
        SubjectId: row.SubjectId,
 | 
						|
        ClinicalDataTrialSetId: row.ClinicalDataTrialSetId
 | 
						|
      }).then(res => {
 | 
						|
        this.preview2.visible = true
 | 
						|
        this.listLoading = false
 | 
						|
        this.QuestionList = res.Result.QuestionList
 | 
						|
        this.AnswerList = res.Result.AnswerList
 | 
						|
      })
 | 
						|
    },
 | 
						|
    getSpanArr(data) {
 | 
						|
      for (var i = 0; i < data.length; i++) {
 | 
						|
        if (i === 0) {
 | 
						|
          this.spanArr.push(1)
 | 
						|
          this.pos = 0
 | 
						|
        } else {
 | 
						|
          // 判断当前元素与上一个元素是否相同
 | 
						|
          if (data[i].SubjectId === data[i - 1].SubjectId) {
 | 
						|
            this.spanArr[this.pos] += 1
 | 
						|
            this.spanArr.push(0)
 | 
						|
          } else {
 | 
						|
            this.spanArr.push(1)
 | 
						|
            this.pos = i
 | 
						|
          }
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    getSpanArr2(data) {
 | 
						|
      for (var i = 0; i < data.length; i++) {
 | 
						|
        if (i === 0) {
 | 
						|
          this.spanArr2.push(1)
 | 
						|
          this.pos2 = 0
 | 
						|
        } else {
 | 
						|
          // 判断当前元素与上一个元素是否相同
 | 
						|
          if (data[i].SubjectId === data[i - 1].SubjectId) {
 | 
						|
            this.spanArr2[this.pos2] += 1
 | 
						|
            this.spanArr2.push(0)
 | 
						|
          } else {
 | 
						|
            this.spanArr2.push(1)
 | 
						|
            this.pos2 = i
 | 
						|
          }
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
						|
      if (columnIndex === 0) {
 | 
						|
        const _row = this.spanArr[rowIndex]
 | 
						|
        const _col = _row > 0 ? 1 : 0
 | 
						|
        return {
 | 
						|
          rowspan: _row,
 | 
						|
          colspan: _col
 | 
						|
        }
 | 
						|
      }
 | 
						|
    },
 | 
						|
    getList() {
 | 
						|
      this.listLoading = true
 | 
						|
      getImageClinicalDataToBeDoneList(this.listQuery).then(res => {
 | 
						|
        this.listLoading = false
 | 
						|
        this.total = res.Result.TotalCount
 | 
						|
        this.list = res.Result.CurrentPageData
 | 
						|
      }).catch(() => { this.listLoading = false })
 | 
						|
    },
 | 
						|
    handleUpload2(row) {
 | 
						|
      this.listLoading = true
 | 
						|
      this.rowData = {...row}
 | 
						|
      getCRCConfirmList({
 | 
						|
        TrialId: row.TrialId
 | 
						|
      }).then(res => {
 | 
						|
        this.spanArr2 = []
 | 
						|
        this.pos2 = 0
 | 
						|
        this.configVisible = true
 | 
						|
        this.confirmData = res.Result
 | 
						|
        this.getSpanArr2(this.confirmData)
 | 
						|
        this.listLoading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleUpload(row) {
 | 
						|
      this.listLoading = true
 | 
						|
      this.rowData = {...row}
 | 
						|
      getCRCSubjectClinicalList({
 | 
						|
        TrialId: row.TrialId
 | 
						|
      }).then(res => {
 | 
						|
        this.spanArr = []
 | 
						|
        this.pos = 0
 | 
						|
        this.configVisible = true
 | 
						|
        this.clinicalData = res.Result
 | 
						|
        this.getSpanArr(this.clinicalData)
 | 
						|
        this.listLoading = false
 | 
						|
      })
 | 
						|
      this.handleUpload2(row)
 | 
						|
    },
 | 
						|
    handleReset() {
 | 
						|
      this.listQuery = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
      this.$nextTick(() => {
 | 
						|
        this.$refs.needSignDocList.clearSort()
 | 
						|
      })
 | 
						|
    },
 | 
						|
    // 排序
 | 
						|
    handleSortByColumn(column) {
 | 
						|
      if (column.order === 'ascending') {
 | 
						|
        this.listQuery.asc = true
 | 
						|
      } else {
 | 
						|
        this.listQuery.asc = false
 | 
						|
      }
 | 
						|
      this.listQuery.sortField = column.prop
 | 
						|
      this.getList()
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
 | 
						|
<style lang="scss" scoped>
 | 
						|
.wrapper{
 | 
						|
  height: 100%;
 | 
						|
}
 | 
						|
</style>
 |