239 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			239 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div v-loading="loading">
 | 
						|
    <div
 | 
						|
      class="search-form"
 | 
						|
      style="text-align: right;"
 | 
						|
    >
 | 
						|
      <el-button
 | 
						|
        v-if="!isCompleteConfig"
 | 
						|
        size="mini"
 | 
						|
        type="primary"
 | 
						|
        @click="handleAdd"
 | 
						|
      >
 | 
						|
        新增
 | 
						|
      </el-button>
 | 
						|
 | 
						|
    </div>
 | 
						|
 | 
						|
    <el-table
 | 
						|
      :data="list"
 | 
						|
      size="small"
 | 
						|
      height="500"
 | 
						|
    >
 | 
						|
      <el-table-column
 | 
						|
        prop="ShowOrder"
 | 
						|
        label="序号"
 | 
						|
        min-width="70"
 | 
						|
      />
 | 
						|
      <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="ShowQuestion"
 | 
						|
        label="是否显示"
 | 
						|
        min-width="90"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ $fd('ShowQuestion',scope.row.ShowQuestion) }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="IsRequired"
 | 
						|
        label="是否必填"
 | 
						|
        min-width="90"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ $fd('QuestionRequired',scope.row.IsRequired) }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="IsJudgeQuestion"
 | 
						|
        label="是否裁判问题"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ $fd('YesOrNo',scope.row.IsJudgeQuestion) }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
      <el-table-column
 | 
						|
        prop="ParentQuestionShowOrder"
 | 
						|
        label="显示依赖父问题"
 | 
						|
        min-width="90"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="ParentTriggerValue"
 | 
						|
        label="显示触发值"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="RelevanceShowOrder"
 | 
						|
        label="必填依赖父问题"
 | 
						|
        min-width="90"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="RelevanceValue"
 | 
						|
        label="必填触发值"
 | 
						|
        show-overflow-tooltip
 | 
						|
      />
 | 
						|
      <el-table-column
 | 
						|
        prop="MaxRowCount"
 | 
						|
        label="最大行数"
 | 
						|
        show-overflow-tooltip
 | 
						|
      >
 | 
						|
        <template slot-scope="scope">
 | 
						|
          {{ scope.row.Type === 'upload'?scope.row.ImageCount:'' }}
 | 
						|
        </template>
 | 
						|
      </el-table-column>
 | 
						|
 | 
						|
      <el-table-column
 | 
						|
        v-if="!isCompleteConfig"
 | 
						|
        prop=""
 | 
						|
        label="操作"
 | 
						|
        width="150"
 | 
						|
        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"
 | 
						|
    >
 | 
						|
      <TableQsForm
 | 
						|
        ref="addOrEdit"
 | 
						|
        :data="rowData"
 | 
						|
        :reading-question-id="readingQuestionId"
 | 
						|
        @close="addOrEdit.visible = false"
 | 
						|
        @getList="getList"
 | 
						|
      />
 | 
						|
    </el-dialog>
 | 
						|
 | 
						|
  </div>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getReadingTableQuestionSystemList, deleteReadingTableQuestionSystem } from '@/api/trials'
 | 
						|
import TableQsForm from './TableQsForm'
 | 
						|
const searchDataDefault = () => {
 | 
						|
  return {
 | 
						|
    QuestionName: ''
 | 
						|
  }
 | 
						|
}
 | 
						|
export default {
 | 
						|
  name: 'TableQsList',
 | 
						|
  components: { TableQsForm },
 | 
						|
  props: {
 | 
						|
    readingQuestionId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
 | 
						|
    isCompleteConfig: {
 | 
						|
      type: Boolean,
 | 
						|
      required: true
 | 
						|
    }
 | 
						|
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      searchData: searchDataDefault(),
 | 
						|
      list: [],
 | 
						|
      total: 0,
 | 
						|
      loading: false,
 | 
						|
      rowData: {},
 | 
						|
      addOrEdit: { visible: false, title: '' }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getList() {
 | 
						|
      this.loading = true
 | 
						|
      getReadingTableQuestionSystemList({ readingQuestionId: this.readingQuestionId }).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        this.list = res.Result
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleAdd() {
 | 
						|
      this.rowData = {}
 | 
						|
      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
 | 
						|
          deleteReadingTableQuestionSystem(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()
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
 |