308 lines
		
	
	
		
			8.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			308 lines
		
	
	
		
			8.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
| <template>
 | |
|   <BaseContainer>
 | |
|     <!-- 搜索框 -->
 | |
|     <template slot="search-container">
 | |
|       <!-- <el-form :inline="true">
 | |
|         <el-form-item label="类型">
 | |
|           <el-select v-model="searchData.OrganType" clearable style="width:130px;">
 | |
|             <el-option v-for="item of $d.OrganInfo" :key="item.id" :value="item.value" :label="item.label" />
 | |
|           </el-select>
 | |
|         </el-form-item>
 | |
|         <el-form-item>
 | |
|       <el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">
 | |
|         {{ $t('common:button:search') }}
 | |
|       </el-button>
 | |
|       <el-button type="primary" icon="el-icon-refresh-left" size="small" @click="handleReset">
 | |
|         {{ $t('common:button:reset') }}
 | |
|       </el-button>
 | |
|       </el-form-item>
 | |
|       </el-form> -->
 | |
|       <span style="margin-left:auto;">
 | |
|         <el-button
 | |
|           v-if="!isConfirm && !isFromSystem"
 | |
|           type="primary"
 | |
|           icon="el-icon-plus"
 | |
|           size="small"
 | |
|           @click="handleSet"
 | |
|         >
 | |
|           设置
 | |
|         </el-button>
 | |
|       </span>
 | |
|     </template>
 | |
| 
 | |
|     <template slot="main-container">
 | |
|       <!-- 受试者列表 -->
 | |
|       <el-table
 | |
|         ref="organList"
 | |
|         v-loading="loading"
 | |
|         v-adaptive="{bottomOffset:60}"
 | |
|         :data="list"
 | |
|         stripe
 | |
|         height="100"
 | |
|       >
 | |
|         <el-table-column type="index" width="90" />
 | |
|         <!-- 类型 -->
 | |
|         <el-table-column
 | |
|           prop="OrganType"
 | |
|           label="病灶类型"
 | |
|           show-overflow-tooltip
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             {{ $fd('OrganType',scope.row.OrganType) }}
 | |
|           </template>
 | |
| 
 | |
|         </el-table-column>
 | |
|         <!-- 部位 -->
 | |
|         <el-table-column
 | |
|           prop="Part"
 | |
|           label="部位"
 | |
|           show-overflow-tooltip
 | |
|         />
 | |
|         <el-table-column
 | |
|           prop="TULOC"
 | |
|           label="TULOC"
 | |
|           show-overflow-tooltip
 | |
|         />
 | |
|         <el-table-column
 | |
|           prop="TULAT"
 | |
|           label="TULAT"
 | |
|           show-overflow-tooltip
 | |
|         />
 | |
|         <el-table-column
 | |
|           prop="IsLymphNodes"
 | |
|           label="是否淋巴结"
 | |
|           show-overflow-tooltip
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             <el-tag v-if="scope.row.IsLymphNodes" type="danger">{{ $fd('ReadingYesOrNo', scope.row.IsLymphNodes) }}</el-tag>
 | |
|             <el-tag v-else type="primary">{{ $fd('ReadingYesOrNo', scope.row.IsLymphNodes) }}</el-tag>
 | |
|           </template>
 | |
|         </el-table-column>
 | |
| 
 | |
|         <el-table-column
 | |
|           prop="Remark"
 | |
|           label="备注"
 | |
|           show-overflow-tooltip
 | |
|         />
 | |
|         <el-table-column
 | |
|           prop="IsEnable"
 | |
|           label="是否显示"
 | |
|           show-overflow-tooltip
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             <el-switch
 | |
|               v-if="!isConfirm"
 | |
|               v-model="scope.row.IsEnable"
 | |
|               @change="changeEnableStatus($event, scope.row)"
 | |
|             />
 | |
|             <span v-else>{{ $fd('YesOrNo',scope.row.IsEnable) }}</span>
 | |
|           </template>
 | |
|         </el-table-column>
 | |
|       </el-table>
 | |
|     </template>
 | |
| 
 | |
|     <!-- 选择标准 -->
 | |
|     <el-dialog
 | |
|       v-if="criterion.visible"
 | |
|       :visible.sync="criterion.visible"
 | |
|       :close-on-click-modal="false"
 | |
|       :title="criterion.title"
 | |
|       width="500px"
 | |
|       custom-class="base-dialog-wrapper"
 | |
|       append-to-body
 | |
|     >
 | |
|       <el-form
 | |
|         ref="criterionForm"
 | |
|         v-loading="formLoading"
 | |
|         :model="form"
 | |
|         size="small"
 | |
|       >
 | |
|         <div class="base-dialog-body">
 | |
|           <!-- 类型 -->
 | |
|           <el-form-item
 | |
|             label="标准"
 | |
|             prop="CriterionId"
 | |
|             :rules="[
 | |
|               { required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] },
 | |
|             ]"
 | |
|           >
 | |
|             <el-select
 | |
|               v-model="form.CriterionId"
 | |
|             >
 | |
|               <el-option
 | |
|                 v-for="item of criterions"
 | |
|                 :key="item.CriterionId"
 | |
|                 :label="item.CriterionName"
 | |
|                 :value="item.CriterionId"
 | |
|               />
 | |
|             </el-select>
 | |
|           </el-form-item>
 | |
|         </div>
 | |
|         <div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
 | |
|           <el-form-item style="text-align:right;">
 | |
|             <el-button type="primary" @click="criterion.visible = false"> {{ $t('common:button:cancel') }}</el-button>
 | |
|             <el-button size="small" type="primary" @click="handleSave">
 | |
|               {{ $t('common:button:save') }}
 | |
|             </el-button>
 | |
|           </el-form-item>
 | |
|         </div>
 | |
|       </el-form>
 | |
|     </el-dialog>
 | |
|   </BaseContainer>
 | |
| </template>
 | |
| <script>
 | |
| import { getTrialOrganList, deleteTrialOrganInfo, getSystemCriterionList, synchronizeSystemOrganToTrial, setOrganIsEnable } from '@/api/trials'
 | |
| import BaseContainer from '@/components/BaseContainer'
 | |
| const searchDataDefault = () => {
 | |
|   return {
 | |
|     OrganType: null
 | |
|   }
 | |
| }
 | |
| export default {
 | |
|   name: 'OrgansList',
 | |
|   components: { BaseContainer },
 | |
|   props: {
 | |
|     isFromSystem: {
 | |
|       type: Boolean,
 | |
|       required: true
 | |
|     },
 | |
|     isConfirm: {
 | |
|       type: Boolean,
 | |
|       required: true
 | |
|     }
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       searchData: searchDataDefault(),
 | |
|       loading: false,
 | |
|       list: [],
 | |
|       total: 0,
 | |
|       trialId: '',
 | |
|       criterion: { title: '设置', visible: false },
 | |
|       formLoading: false,
 | |
|       form: { CriterionId: '' },
 | |
|       criterions: []
 | |
|     }
 | |
|   },
 | |
|   watch: {
 | |
|     list() {
 | |
|       this.$nextTick(() => {
 | |
|         this.$refs.organList.doLayout()
 | |
|       })
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     this.getCriterions()
 | |
|     this.getList()
 | |
|   },
 | |
|   methods: {
 | |
|     // 获取受试者列表
 | |
|     getList() {
 | |
|       this.loading = true
 | |
|       this.searchData.TrialId = this.$route.query.trialId
 | |
|       getTrialOrganList(this.searchData).then(res => {
 | |
|         this.loading = false
 | |
|         this.list = res.Result
 | |
|         // this.list = res.Result.CurrentPageData
 | |
|         // this.total = res.Result.TotalCount
 | |
|       }).catch(() => { this.loading = false })
 | |
|     },
 | |
|     // 新增
 | |
|     handleAdd() {
 | |
|       this.addDialog.visible = true
 | |
|     },
 | |
|     changeEnableStatus(callback, row) {
 | |
|       if (callback) {
 | |
|         row.IsEnable = false
 | |
|       } else {
 | |
|         row.IsEnable = true
 | |
|       }
 | |
|       var message = '是否确认更改?'
 | |
|       this.$confirm(message, {
 | |
|         distinguishCancelAndClose: true,
 | |
|         type: 'warning'
 | |
|       }).then(() => {
 | |
|         const state = !row.IsEnable
 | |
|         this.loading = true
 | |
|         var params = {
 | |
|           isEnable: state,
 | |
|           ids: [row.Id]
 | |
|         }
 | |
|         setOrganIsEnable(params).then(res => {
 | |
|           this.loading = false
 | |
|           if (res.IsSuccess) {
 | |
|             this.$message.success(this.$t('common:message:savedSuccessfully'))
 | |
|             this.getList()
 | |
|           }
 | |
|         }).catch(() => { this.loading = false })
 | |
|       }).catch(() => {})
 | |
|     },
 | |
|     // 删除
 | |
|     handleDelete(row) {
 | |
|       this.$confirm('是否确认删除', {
 | |
|         type: 'warning',
 | |
|         distinguishCancelAndClose: true
 | |
|       })
 | |
|         .then(() => {
 | |
|           this.loading = true
 | |
|           deleteTrialOrganInfo(row.Id)
 | |
|             .then(res => {
 | |
|               this.loading = false
 | |
|               if (res.IsSuccess) {
 | |
|                 this.getList()
 | |
|                 this.$message.success('删除成功!')
 | |
|               }
 | |
|             }).catch(() => { this.loading = false })
 | |
|         })
 | |
|     },
 | |
|     // 查询
 | |
|     handleSearch() {
 | |
|       // this.searchData.PageIndex = 1
 | |
|       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()
 | |
|     },
 | |
|     getCriterions() {
 | |
|       getSystemCriterionList().then(res => {
 | |
|         this.criterions = res.Result
 | |
|       })
 | |
|     },
 | |
|     handleSet() {
 | |
|       this.criterion.visible = true
 | |
|       this.form.CriterionId = ''
 | |
|     },
 | |
|     handleSave() {
 | |
|       this.$refs['criterionForm'].validate((valid) => {
 | |
|         if (!valid) return
 | |
|         this.formLoading = true
 | |
|         var param = {
 | |
|           trialId: this.$route.query.trialId,
 | |
|           systemCriterionId: this.form.CriterionId
 | |
|         }
 | |
|         synchronizeSystemOrganToTrial(param).then(res => {
 | |
|           this.getList()
 | |
|           this.criterion.visible = false
 | |
|           this.formLoading = false
 | |
|         }).catch(() => {
 | |
|           this.formLoading = false
 | |
|         })
 | |
|       })
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 |