268 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			268 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div class="criterion-config">
 | 
						|
    <div class="search-form" style="display:flex;justify-content: space-between;">
 | 
						|
      <el-form :inline="true" size="mini" class="base-search-form">
 | 
						|
        <el-form-item label="阅片问题">
 | 
						|
          <el-input v-model="searchData.QuestionName" clearable style="width:120px;" />
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item>
 | 
						|
          <el-button type="primary" @click="handleReset">重置</el-button>
 | 
						|
          <el-button type="primary" @click="handleSearch">查询</el-button>
 | 
						|
 | 
						|
        </el-form-item>
 | 
						|
      </el-form>
 | 
						|
      <div>
 | 
						|
        <el-button
 | 
						|
          :disabled="list.length === 0"
 | 
						|
          size="mini"
 | 
						|
          type="primary"
 | 
						|
          @click="preview.visible = true"
 | 
						|
        >
 | 
						|
          预览
 | 
						|
        </el-button>
 | 
						|
        <el-button
 | 
						|
          v-if="Object.keys(data).length > 0 && !(data.IsCompleteConfig || data.IsBeUsed)"
 | 
						|
          size="mini"
 | 
						|
          type="primary"
 | 
						|
          @click="handleAdd"
 | 
						|
        >
 | 
						|
          添加
 | 
						|
        </el-button>
 | 
						|
      </div>
 | 
						|
 | 
						|
    </div>
 | 
						|
 | 
						|
    <el-table
 | 
						|
      v-loading="loading"
 | 
						|
      v-adaptive="{bottomOffset:100}"
 | 
						|
      :data="list"
 | 
						|
      stripe
 | 
						|
      @sort-change="handleSortByColumn"
 | 
						|
    >
 | 
						|
      <el-table-column
 | 
						|
        prop="ShowOrder"
 | 
						|
        label=""
 | 
						|
        width="50"
 | 
						|
      />
 | 
						|
      <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
 | 
						|
      />
 | 
						|
 | 
						|
      <el-table-column
 | 
						|
        prop="IsRequired"
 | 
						|
        label="是否必填"
 | 
						|
        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="ParentQuestionName"
 | 
						|
        label="父问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="ParentTriggerValue"
 | 
						|
        label="父问题触发值"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        v-if="Object.keys(data).length > 0 && !(data.IsCompleteConfig || data.IsBeUsed)"
 | 
						|
        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"
 | 
						|
            :disabled="scope.row.IsEnable"
 | 
						|
            @click="handleDelete(scope.row)"
 | 
						|
          >
 | 
						|
            删除
 | 
						|
          </el-button>
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
    </el-table>
 | 
						|
    <pagination style="text-align: right;margin-top: 10px;" class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
 | 
						|
 | 
						|
    <el-dialog
 | 
						|
      v-if="addOrEdit.visible"
 | 
						|
      :visible.sync="addOrEdit.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="addOrEdit.title"
 | 
						|
      width="500px"
 | 
						|
      append-to-body
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <CriterionQuestionForm
 | 
						|
        ref="addOrEdit"
 | 
						|
        :data="rowData"
 | 
						|
        @close="addOrEdit.visible = false"
 | 
						|
        @getList="getList"
 | 
						|
      />
 | 
						|
    </el-dialog>
 | 
						|
 | 
						|
    <!-- 预览 -->
 | 
						|
    <el-dialog
 | 
						|
      v-if="preview.visible"
 | 
						|
      v-dialogDrag
 | 
						|
      :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">
 | 
						|
        <ECRF
 | 
						|
          :criterion-id="criterionId"
 | 
						|
        />
 | 
						|
      </div>
 | 
						|
    </el-dialog>
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getReadingQuestionSystemList, deleteReadingQuestionSystem } from '@/api/dictionary'
 | 
						|
import Pagination from '@/components/Pagination'
 | 
						|
import CriterionQuestionForm from './CriterionQuestionForm'
 | 
						|
import ECRF from './ECRF'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    QuestionName: '',
 | 
						|
    PageIndex: 1,
 | 
						|
    PageSize: 20
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'QcQuestions',
 | 
						|
  components: { Pagination, CriterionQuestionForm, ECRF },
 | 
						|
  props: {
 | 
						|
    criterionId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
    data: {
 | 
						|
      type: Object,
 | 
						|
      default() {
 | 
						|
        return {}
 | 
						|
      }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      rowData: {},
 | 
						|
      addOrEdit: { visible: false, title: '' },
 | 
						|
      preview: { visible: false, title: 'eCRF预览' }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      this.searchData.ReadingQuestionCriterionSystemId = this.criterionId
 | 
						|
      getReadingQuestionSystemList(this.searchData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.list = res.Result.CurrentPageData
 | 
						|
        this.total = res.Result.TotalCount
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleAdd() {
 | 
						|
      this.rowData = { ReadingQuestionCriterionSystemId: this.criterionId, Id: '' }
 | 
						|
      this.addOrEdit.title = '添加'
 | 
						|
      this.addOrEdit.visible = true
 | 
						|
    },
 | 
						|
    handleEdit(row) {
 | 
						|
      this.rowData = { ...row }
 | 
						|
      this.addOrEdit.title = '编辑'
 | 
						|
      this.addOrEdit.visible = true
 | 
						|
    },
 | 
						|
    handleDelete(row) {
 | 
						|
      this.$confirm('是否确认删除?', {
 | 
						|
        type: 'warning',
 | 
						|
        distinguishCancelAndClose: true
 | 
						|
      })
 | 
						|
        .then(() => {
 | 
						|
          this.loading = true
 | 
						|
          deleteReadingQuestionSystem(row.Id)
 | 
						|
            .then(res => {
 | 
						|
              this.loading = false
 | 
						|
              if (res.IsSuccess) {
 | 
						|
                this.getList()
 | 
						|
                this.$message.success('删除成功!')
 | 
						|
              }
 | 
						|
            }).catch(() => { this.loading = false })
 | 
						|
        })
 | 
						|
    },
 | 
						|
    // 查询
 | 
						|
    handleSearch() {
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    // 重置
 | 
						|
    handleReset() {
 | 
						|
      this.searchData = searchDataDefault()
 | 
						|
      this.getList()
 | 
						|
    },
 | 
						|
    // 排序
 | 
						|
    handleSortByColumn(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>
 | 
						|
 |