279 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			279 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div v-loading="loading">
 | 
						|
    <div
 | 
						|
      class="search-form"
 | 
						|
      style="text-align: left;"
 | 
						|
    >
 | 
						|
      <el-button
 | 
						|
        v-if="!isConfirm && hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
        size="mini"
 | 
						|
        type="primary"
 | 
						|
        @click="handleAdd"
 | 
						|
      >
 | 
						|
        新增
 | 
						|
      </el-button>
 | 
						|
      <el-button
 | 
						|
        v-if="isPreview"
 | 
						|
        :disabled="tblList.length===0"
 | 
						|
        size="mini"
 | 
						|
        type="primary"
 | 
						|
        @click="handlePreview"
 | 
						|
      >
 | 
						|
        预览
 | 
						|
      </el-button>
 | 
						|
 | 
						|
    </div>
 | 
						|
 | 
						|
    <el-table
 | 
						|
      :data="tblList"
 | 
						|
      size="small"
 | 
						|
    >
 | 
						|
      <el-table-column
 | 
						|
        prop="ShowOrder"
 | 
						|
        label="序号"
 | 
						|
        min-width="70"
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="GroupName"
 | 
						|
        label="分组名称"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="QuestionName"
 | 
						|
        label="阅片问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="Type"
 | 
						|
        label="类型"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ $fd('Criterion_Question_Type',scope.row.Type) }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="TypeValue"
 | 
						|
        label="选项"
 | 
						|
        show-overflow-tooltip
 | 
						|
        min-width="110"
 | 
						|
      />
 | 
						|
 | 
						|
      <el-table-column
 | 
						|
        prop="IsRequired"
 | 
						|
        label="是否必填"
 | 
						|
        min-width="90"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.IsRequired?'是':'否' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="IsJudgeQuestion"
 | 
						|
        label="是否裁判问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.IsJudgeQuestion?'是':'否' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="ParentQuestionShowOrder"
 | 
						|
        label="显示依赖父问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="ParentTriggerValue"
 | 
						|
        label="显示触发值"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="RelevanceShowOrder"
 | 
						|
        label="必填依赖父问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="RelevanceValue"
 | 
						|
        label="必填触发值"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="ImageCount"
 | 
						|
        label="最大上传个数"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.Type === 'upload'?scope.row.ImageCount:'' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
 | 
						|
      <el-table-column
 | 
						|
        v-if="!isConfirm && hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
        prop=""
 | 
						|
        label="操作"
 | 
						|
        width="180"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          <el-button
 | 
						|
            type="primary"
 | 
						|
            size="mini"
 | 
						|
            @click="handleEdit(scope.row)"
 | 
						|
          >
 | 
						|
            编辑
 | 
						|
          </el-button>
 | 
						|
          <el-button
 | 
						|
            type="danger"
 | 
						|
            size="mini"
 | 
						|
            @click="handleDelete(scope.row)"
 | 
						|
          >
 | 
						|
            删除
 | 
						|
          </el-button>
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
    </el-table>
 | 
						|
 | 
						|
    <el-dialog
 | 
						|
      v-if="addOrEdit.visible"
 | 
						|
      :visible.sync="addOrEdit.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="addOrEdit.title"
 | 
						|
      width="600px"
 | 
						|
      append-to-body
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <QuestionsForm
 | 
						|
        ref="addOrEdit"
 | 
						|
        :data="rowData"
 | 
						|
        @close="addOrEdit.visible = false"
 | 
						|
        @getList="getList"
 | 
						|
        @reloadArbitrationRules="reloadArbitrationRules"
 | 
						|
      />
 | 
						|
    </el-dialog>
 | 
						|
    <el-dialog
 | 
						|
      v-if="preview.visible"
 | 
						|
      :visible.sync="preview.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="preview.title"
 | 
						|
      width="500px"
 | 
						|
      append-to-body
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <div class="base-dialog-body">
 | 
						|
        <QuestionsPreview :criterion-id="trialCriterionId" :form-type="1" />
 | 
						|
      </div>
 | 
						|
    </el-dialog>
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getReadingQuestionTrialList, deleteReadingQuestionTrial } from '@/api/trials'
 | 
						|
import QuestionsForm from './QuestionsForm'
 | 
						|
import QuestionsPreview from './QuestionsPreview'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    QuestionName: ''
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'QcQuestions',
 | 
						|
  components: { QuestionsForm, QuestionsPreview },
 | 
						|
  props: {
 | 
						|
    list: {
 | 
						|
      type: Array,
 | 
						|
      default() { return [] }
 | 
						|
    },
 | 
						|
    trialCriterionId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
    readingCriterionPageId: {
 | 
						|
      type: String,
 | 
						|
      default: ''
 | 
						|
    },
 | 
						|
    isConfirm: {
 | 
						|
      type: Boolean,
 | 
						|
      default: true
 | 
						|
    },
 | 
						|
    isPreview: {
 | 
						|
      type: Boolean,
 | 
						|
      default: true
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      // list: [],
 | 
						|
      tblList: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      rowData: {},
 | 
						|
      addOrEdit: { visible: false, title: '' },
 | 
						|
      preview: { visible: false, title: 'eCRF预览' }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.tblList = this.list
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      this.searchData.ReadingQuestionCriterionTrialId = this.trialCriterionId
 | 
						|
      this.searchData.ReadingCriterionPageId = this.readingCriterionPageId
 | 
						|
      getReadingQuestionTrialList(this.searchData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.tblList = res.Result
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleAdd() {
 | 
						|
      this.rowData = {
 | 
						|
        ReadingQuestionCriterionTrialId: this.trialCriterionId,
 | 
						|
        ReadingCriterionPageId: this.readingCriterionPageId,
 | 
						|
        Id: '' }
 | 
						|
      this.addOrEdit.title = '添加'
 | 
						|
      this.addOrEdit.visible = true
 | 
						|
    },
 | 
						|
    handleEdit(row) {
 | 
						|
      this.rowData = { ...row }
 | 
						|
      this.rowData.ReadingQuestionCriterionTrialId = this.trialCriterionId
 | 
						|
      this.rowData.ReadingCriterionPageId = this.readingCriterionPageId
 | 
						|
      this.addOrEdit.title = '编辑'
 | 
						|
      this.addOrEdit.visible = true
 | 
						|
    },
 | 
						|
    handleDelete(row) {
 | 
						|
      this.$confirm('是否确认删除?', {
 | 
						|
        type: 'warning',
 | 
						|
        distinguishCancelAndClose: true
 | 
						|
      })
 | 
						|
        .then(() => {
 | 
						|
          this.loading = true
 | 
						|
          deleteReadingQuestionTrial(row.Id)
 | 
						|
            .then(res => {
 | 
						|
              this.loading = false
 | 
						|
              if (res.IsSuccess) {
 | 
						|
                this.getList()
 | 
						|
                this.$message.success('删除成功!')
 | 
						|
              }
 | 
						|
            }).catch(() => { this.loading = false })
 | 
						|
        })
 | 
						|
    },
 | 
						|
    handlePreview() {
 | 
						|
      this.preview.visible = true
 | 
						|
    },
 | 
						|
    // 查询
 | 
						|
    handleSearch() {
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    // 重置
 | 
						|
    handleReset() {
 | 
						|
      this.searchData = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    reloadArbitrationRules() {
 | 
						|
      this.$emit('reloadArbitrationRules')
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
 |