216 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			216 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
| <template>
 | |
|   <div v-loading="loading" class="page-break-list-wrapper">
 | |
|     <div
 | |
|       v-if="!isConfirm"
 | |
|       style="text-align:left"
 | |
|     >
 | |
|       <el-button
 | |
|         size="mini"
 | |
|         type="primary"
 | |
|         @click="handleAdd"
 | |
|       >
 | |
|         新增
 | |
|       </el-button>
 | |
|     </div>
 | |
| 
 | |
|     <!-- 分页列表 -->
 | |
|     <el-table
 | |
|       :data="list"
 | |
|       style="width: 100%"
 | |
|       size="small"
 | |
|       height="300"
 | |
|     >
 | |
|       <!-- <el-table-column type="index" width="40" /> -->
 | |
|       <el-table-column
 | |
|         prop="ShowOrder"
 | |
|         label="序号"
 | |
|         width="70"
 | |
|       />
 | |
|       <el-table-column
 | |
|         prop="PageName"
 | |
|         label="分页名称"
 | |
|         show-overflow-tooltip
 | |
|         width="180"
 | |
|       />
 | |
|       <el-table-column
 | |
|         prop="IsPublicPage"
 | |
|         label="是否公共分页"
 | |
|         show-overflow-tooltip
 | |
|         width="180"
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           <el-tag v-if="scope.row.IsPublicPage" type="danger">{{ $fd('YesOrNo', scope.row.IsPublicPage) }}</el-tag>
 | |
|           <el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsPublicPage) }}</el-tag>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
| 
 | |
|       <el-table-column
 | |
|         prop="IsEnable"
 | |
|         show-overflow-tooltip
 | |
|         width="180"
 | |
|         label="是否启用"
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           <el-tag v-if="scope.row.IsEnable" type="danger">{{ $fd('YesOrNo', scope.row.IsEnable) }}</el-tag>
 | |
|           <el-tag v-else type="primary">{{ $fd('YesOrNo', scope.row.IsEnable) }}</el-tag>
 | |
|         </template>
 | |
|       </el-table-column>
 | |
| 
 | |
|       <el-table-column
 | |
|         prop="CreateTime"
 | |
|         show-overflow-tooltip
 | |
|         label="创建时间"
 | |
|         width="200"
 | |
|       />
 | |
|       <el-table-column
 | |
|         prop=""
 | |
|         label="操作"
 | |
|         show-overflow-tooltip
 | |
|       >
 | |
|         <template slot-scope="scope">
 | |
|           <el-button
 | |
|             type="primary"
 | |
|             size="mini"
 | |
|             @click="handleCfgQuestions(scope.row)"
 | |
|           >
 | |
|             问题表单
 | |
|           </el-button>
 | |
|           <el-button
 | |
|             v-if="!isConfirm"
 | |
|             type="primary"
 | |
|             size="mini"
 | |
|             @click="handleEdit(scope.row)"
 | |
|           >
 | |
|             编辑
 | |
|           </el-button>
 | |
|           <el-button
 | |
|             v-if="!isConfirm"
 | |
|             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="500px"
 | |
|       custom-class="base-dialog-wrapper"
 | |
|     >
 | |
|       <PageBreakForm
 | |
|         :data="rowData"
 | |
|         @close="addOrEdit.visible = false"
 | |
|         @getList="getList"
 | |
|       />
 | |
|     </el-dialog>
 | |
| 
 | |
|     <el-dialog
 | |
|       v-if="questions.visible"
 | |
|       :visible.sync="questions.visible"
 | |
|       :close-on-click-modal="false"
 | |
|       :title="questions.title"
 | |
|       width="1200px"
 | |
|       custom-class="base-dialog-wrapper"
 | |
|     >
 | |
|       <QuestionsList
 | |
|         ref="questions"
 | |
|         :trial-criterion-id="trialCriterionId"
 | |
|         :reading-criterion-page-id="rowData.Id"
 | |
|         :is-confirm="isConfirm"
 | |
|         @reloadArbitrationRules="reloadArbitrationRules"
 | |
|       />
 | |
|     </el-dialog>
 | |
|   </div>
 | |
| </template>
 | |
| <script>
 | |
| import { getReadingCriterionPageList, deleteReadingCriterionPage } from '@/api/trials'
 | |
| import PageBreakForm from './PageBreakForm'
 | |
| import QuestionsList from './QuestionsList'
 | |
| export default {
 | |
|   name: 'PageBreakList',
 | |
|   components: { PageBreakForm, QuestionsList },
 | |
|   props: {
 | |
|     list: {
 | |
|       type: Array,
 | |
|       default() {
 | |
|         return []
 | |
|       }
 | |
|     },
 | |
|     trialCriterionId: {
 | |
|       type: String,
 | |
|       required: true
 | |
|     },
 | |
|     isConfirm: {
 | |
|       type: Boolean,
 | |
|       default: true
 | |
|     }
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       loading: false,
 | |
|       addOrEdit: { visible: false, title: '' },
 | |
|       questions: { visible: false, title: '阅片问题' },
 | |
|       rowData: {}
 | |
|     }
 | |
|   },
 | |
|   methods: {
 | |
|     getList() {
 | |
|       this.loading = true
 | |
|       const trialId = this.$route.query.trialId
 | |
|       getReadingCriterionPageList({ trialId }).then(res => {
 | |
|         this.loading = false
 | |
|         this.list = res.Result
 | |
|       }).catch(() => { this.loading = false })
 | |
|     },
 | |
|     handleAdd() {
 | |
|       this.rowData = {
 | |
|         ReadingQuestionCriterionTrialId: this.trialCriterionId
 | |
|       }
 | |
|       this.addOrEdit.title = '添加'
 | |
|       this.addOrEdit.visible = true
 | |
|     },
 | |
|     handleEdit(row) {
 | |
|       this.rowData = { ...row }
 | |
|       this.rowData.ReadingQuestionCriterionTrialId = this.trialCriterionId
 | |
|       this.addOrEdit.title = '编辑'
 | |
|       this.addOrEdit.visible = true
 | |
|     },
 | |
|     handleCfgQuestions(row) {
 | |
|       this.rowData = { ...row }
 | |
|       this.questions.visible = true
 | |
|       this.$nextTick(() => {
 | |
|         this.$refs['questions'].getList()
 | |
|       })
 | |
|     },
 | |
|     handleDelete(row) {
 | |
|       this.$confirm('是否确认删除?', {
 | |
|         type: 'warning',
 | |
|         distinguishCancelAndClose: true
 | |
|       })
 | |
|         .then(() => {
 | |
|           this.loading = true
 | |
|           deleteReadingCriterionPage(row.Id)
 | |
|             .then(res => {
 | |
|               this.loading = false
 | |
|               if (res.IsSuccess) {
 | |
|                 this.getList()
 | |
|                 this.$message.success('删除成功!')
 | |
|               }
 | |
|             }).catch(() => { this.loading = false })
 | |
|         })
 | |
|     },
 | |
|     reloadArbitrationRules() {
 | |
|       this.$emit('reloadArbitrationRules')
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| <style lang="scss" scoped>
 | |
| </style>
 |