290 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			290 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
| <template>
 | |
|   <div v-loading="loading">
 | |
|     <div
 | |
|       class="search-form"
 | |
|       style="text-align: right;"
 | |
|     >
 | |
|       <el-button
 | |
|         v-if="!isConfirm && !isFromSystem"
 | |
|         size="mini"
 | |
|         type="primary"
 | |
|         @click="handleAdd"
 | |
|       >
 | |
|         {{$t('common:button:new')}}
 | |
|       </el-button>
 | |
| 
 | |
|     </div>
 | |
| 
 | |
|     <el-table
 | |
|       v-adaptive="{bottomOffset:60}"
 | |
|       :data="list"
 | |
|       size="small"
 | |
|       height="100"
 | |
|     >
 | |
|       <el-table-column
 | |
|         prop="ShowOrder"
 | |
|         :label="$t('trials:qcCfg:table:order')"
 | |
|         min-width="70"
 | |
|       />
 | |
|       <!-- 名称 -->
 | |
|       <el-table-column
 | |
|         prop="QuestionName"
 | |
|         :label="$t('trials:readingUnit:qsList:title:qsName')"
 | |
|         show-overflow-tooltip
 | |
|       />
 | |
|       <!-- 名称(EN) -->
 | |
|       <el-table-column
 | |
|         prop="QuestionEnName"
 | |
|         :label="$t('trials:readingUnit:qsList:title:qsNameEn')"
 | |
|         show-overflow-tooltip
 | |
|       />
 | |
|       <!-- 题型 -->
 | |
|       <el-table-column
 | |
|         prop="Type"
 | |
|         :label="$t('trials:readingUnit:qsList:title:type')"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('Criterion_Question_Type',scope.row.Type) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 是否必填 -->
 | |
|       <el-table-column
 | |
|         prop="IsRequired"
 | |
|         :label="$t('trials:readingUnit:qsList:title:isRequired')"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('QuestionRequired',scope.row.IsRequired) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 是否显示 -->
 | |
|       <el-table-column
 | |
|         prop="ShowQuestion"
 | |
|         :label="$t('trials:readingUnit:qsList:title:isShow')"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('ShowQuestion',scope.row.ShowQuestion) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 是否裁判问题 -->
 | |
|       <el-table-column
 | |
|         prop="IsJudgeQuestion"
 | |
|         :label="$t('trials:readingUnit:qsList:title:isJudgeQuestion')"
 | |
|         width="120"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('YesOrNo', scope.row.IsJudgeQuestion) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 是否在阅片页面显示 -->
 | |
|       <el-table-column
 | |
|         prop="IsShowInDicom"
 | |
|         :label="$t('trials:readingUnit:qsList:title:isShowInDicom')"
 | |
|         width="140"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('YesOrNo', scope.row.IsShowInDicom) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 是否在全局阅片显示 -->
 | |
|       <el-table-column
 | |
|         prop="GlobalReadingShowType"
 | |
|         :label="$t('trials:readingUnit:qsList:title:globalReadingShowType')"
 | |
|         width="160"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('GlobalReadingShowType', scope.row.GlobalReadingShowType) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 限制编辑 -->
 | |
|       <el-table-column
 | |
|         prop="LimitEdit"
 | |
|         :label="$t('trials:readingUnit:qsList:title:limitEdit')"
 | |
|         width="160"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           {{ $fd('LimitEdit', scope.row.LimitEdit) }}
 | |
|         </template>
 | |
|       </el-table-column>
 | |
|       <!-- 注释 -->
 | |
|       <el-table-column
 | |
|         prop="Remark"
 | |
|         :label="$t('trials:readingUnit:qsList:title:Remark')"
 | |
|         width="140"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|       </el-table-column>
 | |
|       <el-table-column
 | |
|         prop=""
 | |
|         :label="$t('common:action:action')"
 | |
|         width="150"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           <el-button
 | |
|             v-if="!isConfirm && !isFromSystem"
 | |
|             type="primary"
 | |
|             size="mini"
 | |
|             @click="handleEdit(scope.row)"
 | |
|           >
 | |
|             {{ $t('common:button:edit') }}
 | |
|           </el-button>
 | |
|           <el-button
 | |
|             v-else
 | |
|             type="primary"
 | |
|             size="mini"
 | |
|             @click="handleLook(scope.row)"
 | |
|           >
 | |
|             {{ $t('trials:readingPeriod:button:view') }}
 | |
|           </el-button>
 | |
|           <el-button
 | |
|             v-if="!isConfirm && !isFromSystem"
 | |
|             type="danger"
 | |
|             size="mini"
 | |
|             @click="handleDelete(scope.row)"
 | |
|           >
 | |
|             {{ $t('common:button:delete') }}
 | |
|           </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"
 | |
|         :list="list"
 | |
|         :type="type"
 | |
|         :is-from-system="isFromSystem"
 | |
|         :digit-places="digitPlaces"
 | |
|         :reading-question-id="readingQuestionId"
 | |
|         :criterion-id="criterionId"
 | |
|         @close="addOrEdit.visible = false"
 | |
|         @getList="getList"
 | |
|       />
 | |
|     </el-dialog>
 | |
| 
 | |
|   </div>
 | |
| </template>
 | |
| <script>
 | |
| import { getReadingTableQuestionTrialList, deleteReadingTableQuestionTrial } from '@/api/trials'
 | |
| import TableQsForm from './TableQsForm'
 | |
| const searchDataDefault = () => {
 | |
|   return {
 | |
|     QuestionName: ''
 | |
|   }
 | |
| }
 | |
| export default {
 | |
|   name: 'TableQsList',
 | |
|   components: { TableQsForm },
 | |
|   props: {
 | |
|     digitPlaces: {
 | |
|       type: Number,
 | |
|       default() { return 0 }
 | |
|     },
 | |
|     readingQuestionId: {
 | |
|       type: String,
 | |
|       required: true
 | |
|     },
 | |
| 
 | |
|     isConfirm: {
 | |
|       type: Boolean,
 | |
|       required: true
 | |
|     },
 | |
|     isFromSystem: {
 | |
|       type: Boolean,
 | |
|       required: true
 | |
|     },
 | |
|     criterionId: {
 | |
|       type: String,
 | |
|       required: true
 | |
|     }
 | |
| 
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       searchData: searchDataDefault(),
 | |
|       list: [],
 | |
|       total: 0,
 | |
|       loading: false,
 | |
|       rowData: {},
 | |
|       addOrEdit: { visible: false, title: '' },
 | |
|       type: null
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     this.getList()
 | |
|     console.log(this.isFromSystem)
 | |
|   },
 | |
|   methods: {
 | |
|     getList() {
 | |
|       this.loading = true
 | |
|       getReadingTableQuestionTrialList({ readingQuestionId: this.readingQuestionId }).then(res => {
 | |
|         this.loading = false
 | |
|         this.list = res.Result
 | |
|       }).catch(() => { this.loading = false })
 | |
|     },
 | |
|     handleAdd() {
 | |
|       this.rowData = {}
 | |
|       this.type = 'add'
 | |
|       this.addOrEdit.title = this.$t('common:button:new')
 | |
|       this.addOrEdit.visible = true
 | |
|     },
 | |
|     handleEdit(row) {
 | |
|       this.rowData = { ...row }
 | |
|       this.type = 'edit'
 | |
|       this.addOrEdit.title = this.$t('common:button:edit')
 | |
|       this.addOrEdit.visible = true
 | |
|     },
 | |
|     handleLook(row) {
 | |
|       this.rowData = { ...row }
 | |
|       this.type = 'look'
 | |
|       this.addOrEdit.title = this.$t('trials:readingPeriod:button:view')
 | |
|       this.addOrEdit.visible = true
 | |
|     },
 | |
|     handleDelete(row) {
 | |
|       this.$confirm(this.$t('trials:staffResearch:message:confirmDel'), {
 | |
|         type: 'warning',
 | |
|         distinguishCancelAndClose: true
 | |
|       })
 | |
|         .then(() => {
 | |
|           this.loading = true
 | |
|           deleteReadingTableQuestionTrial(row.Id)
 | |
|             .then(res => {
 | |
|               this.loading = false
 | |
|               if (res.IsSuccess) {
 | |
|                 this.getList()
 | |
|                 this.$message.success(this.$t('common:message:deletedSuccessfully'))
 | |
|               }
 | |
|             }).catch(() => { this.loading = false })
 | |
|         })
 | |
|     },
 | |
|     // 查询
 | |
|     handleSearch() {
 | |
|       this.getList()
 | |
|     },
 | |
|     // 重置
 | |
|     handleReset() {
 | |
|       this.searchData = searchDataDefault()
 | |
|       this.getList()
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| 
 |