265 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			265 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
| <template>
 | |
|   <div class="clinical-data_content">
 | |
|     <div class="top">
 | |
|       <!-- 添加 -->
 | |
|       <el-button v-if="data.OnlyExistsMedicalHistory === false" type="primary" icon="el-icon-plus" size="small" @click="handleAdd">
 | |
|         {{ $t('common:button:add') }}
 | |
|       </el-button>
 | |
|     </div>
 | |
|     <div class="main">
 | |
|       <el-table
 | |
|         v-loading="loading"
 | |
|         :data="list"
 | |
|         stripe
 | |
|         style="width: 100%"
 | |
|         height="500"
 | |
|       >
 | |
|         <el-table-column type="index" width="40" />
 | |
|         <!-- 临床数据名称 -->
 | |
|         <el-table-column
 | |
|           prop="ClinicalDataSetName"
 | |
|           :label="$t('trials:readingPeriod:cd:table:clinicalDataName')"
 | |
|         />
 | |
|         <!-- 数据级别 -->
 | |
|         <el-table-column
 | |
|           prop="ClinicalDataLevel"
 | |
|           :label="$t('trials:readingPeriod:cd:table:dataLevel')"
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             {{ $fd('ClinicalLevel',scope.row.ClinicalDataLevel) }}
 | |
|           </template>
 | |
|         </el-table-column>
 | |
|         <!-- 传输方式 -->
 | |
|         <el-table-column
 | |
|           prop="ClinicalUploadType"
 | |
|           :label="$t('trials:readingPeriod:cd:table:transferType')"
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             {{ $fd('ClinicalUploadType',scope.row.ClinicalUploadType) }}
 | |
|           </template>
 | |
|         </el-table-column>
 | |
|         <!-- 文件数量 -->
 | |
|         <el-table-column
 | |
|           prop="FileCount"
 | |
|           :label="$t('trials:readingPeriod:cd:table:fileCount')"
 | |
|         />
 | |
|         <el-table-column
 | |
|           :label="$t('common:action:action')"
 | |
|           width="210"
 | |
|         >
 | |
|           <template slot-scope="scope">
 | |
|             <!-- 查看 -->
 | |
|             <el-button
 | |
|               circle
 | |
|               :title="$t('trials:readingPeriod:cd:action:view')"
 | |
|               icon="el-icon-view"
 | |
|               @click="handlePreview(scope.row)"
 | |
|             />
 | |
|             <!-- 签名 -->
 | |
|             <el-button
 | |
|               circle
 | |
|               :title="$t('trials:readingPeriod:cd:action:sign')"
 | |
|               icon="el-icon-edit"
 | |
|               :disabled="scope.row.IsCRCUpload || scope.row.IsSign"
 | |
|               @click="handleSign(scope.row)"
 | |
|             />
 | |
|             <!-- 编辑 -->
 | |
|             <el-button
 | |
|               circle
 | |
|               :title="$t('trials:readingPeriod:cd:action:edit')"
 | |
|               icon="el-icon-edit-outline"
 | |
|               :disabled="scope.row.IsCRCUpload || scope.row.IsSign"
 | |
|               @click="handleEdit(scope.row)"
 | |
|             />
 | |
|             <!-- 删除 -->
 | |
|             <el-button
 | |
|               circle
 | |
|               :title="$t('trials:readingPeriod:cd:action:delete')"
 | |
|               icon="el-icon-delete"
 | |
|               :disabled="scope.row.IsCRCUpload || scope.row.IsSign"
 | |
|               @click="handleDelete(scope.row)"
 | |
|             />
 | |
|           </template>
 | |
|         </el-table-column>
 | |
|       </el-table>
 | |
|       <!-- 分页组件 -->
 | |
|       <div style="text-align:right;">
 | |
|         <pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" />
 | |
|       </div>
 | |
| 
 | |
|       <!-- 添加或编辑 -->
 | |
|       <el-dialog
 | |
|         v-if="addOrUpdateCD.visible"
 | |
|         :visible.sync="addOrUpdateCD.visible"
 | |
|         :close-on-click-modal="false"
 | |
|         :title="addOrUpdateCD.title"
 | |
|         width="500px"
 | |
|         append-to-body
 | |
|         custom-class="base-dialog-wrapper"
 | |
|       >
 | |
|         <AddOrEditCD :data="currentData" @close="addOrUpdateCD.visible = false" @getList="getList" />
 | |
|       </el-dialog>
 | |
| 
 | |
|       <!-- 预览 -->
 | |
|       <el-dialog
 | |
|         v-if="preview.visible"
 | |
|         :visible.sync="preview.visible"
 | |
|         :close-on-click-modal="false"
 | |
|         :title="preview.title"
 | |
|         width="500px"
 | |
|         append-to-body
 | |
|         custom-class="base-dialog-wrapper"
 | |
|       >
 | |
|         <PreviewCD :data="currentData" @close="preview.visible = false" @getList="getList" />
 | |
|       </el-dialog>
 | |
| 
 | |
|       <!-- 签名 -->
 | |
|       <el-dialog
 | |
|         v-if="signVisible"
 | |
|         :visible.sync="signVisible"
 | |
|         :close-on-click-modal="false"
 | |
|         width="600px"
 | |
|         custom-class="base-dialog-wrapper"
 | |
|         append-to-body
 | |
|       >
 | |
|         <div slot="title">
 | |
|           <span style="font-size:18px;">{{ $t('common:dialogTitle:sign') }}</span>
 | |
|           <span style="font-size:12px;margin-left:5px">{{ `(${$t('common:label:sign')}${ currentUser })` }}</span>
 | |
|         </div>
 | |
|         <SignForm ref="signForm" :sign-code-enum="signCode" @closeDialog="closeSignDialog" />
 | |
|       </el-dialog>
 | |
|     </div>
 | |
|   </div>
 | |
| </template>
 | |
| <script>
 | |
| import { getReadingClinicalDataList, deleteReadingClinicalData, ReadClinicalDataSign } from '@/api/trials'
 | |
| import Pagination from '@/components/Pagination'
 | |
| import AddOrEditCD from './AddOrEditCD'
 | |
| import PreviewCD from './PreviewCD'
 | |
| import SignForm from '@/views/trials/components/newSignForm'
 | |
| import const_ from '@/const/sign-code'
 | |
| const searchDataDefault = () => {
 | |
|   return {
 | |
|     PageIndex: 1,
 | |
|     PageSize: 20
 | |
|   }
 | |
| }
 | |
| export default {
 | |
|   name: 'ClinicalData',
 | |
|   components: { Pagination, AddOrEditCD, PreviewCD, SignForm },
 | |
|   props: {
 | |
|     data: {
 | |
|       type: Object,
 | |
|       default() { return {} }
 | |
|     }
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       loading: false,
 | |
|       searchData: searchDataDefault(),
 | |
|       list: [],
 | |
|       total: 0,
 | |
|       dialogVisible: false,
 | |
|       addOrUpdateCD: { title: '', visible: false },
 | |
|       preview: { title: this.$t('trials:readingPeriod:cd:action:view'), visible: false },
 | |
|       currentData: {},
 | |
|       signCode: '',
 | |
|       currentUser: zzSessionStorage.getItem('userName'),
 | |
|       signVisible: false
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     this.getList()
 | |
|   },
 | |
|   methods: {
 | |
|     getList() {
 | |
|       this.searchData.ReadingId = this.data.Id
 | |
|       this.searchData.SubjectId = this.data.SubjectId
 | |
|       this.loading = true
 | |
|       getReadingClinicalDataList(this.searchData).then(res => {
 | |
|         this.list = res.Result.CurrentPageData
 | |
|         this.total = res.Result.TotalCount
 | |
|         this.loading = false
 | |
|       }).catch(() => { this.loading = false })
 | |
|     },
 | |
|     handleAdd() {
 | |
|       this.currentData = Object.assign({}, { TrialId: this.data.TrialId, ReadingId: this.data.Id, IsVisit: this.data.IsVisit, SubjectId: this.data.SubjectId })
 | |
|       this.addOrUpdateCD.title = this.$t('common:button:new')
 | |
|       this.addOrUpdateCD.visible = true
 | |
|     },
 | |
|     handlePreview(row) {
 | |
|       this.currentData = { ...row }
 | |
|       this.preview.visible = true
 | |
|     },
 | |
|     handleEdit(row) {
 | |
|       this.currentData = { ...row }
 | |
|       this.currentData.TrialId = this.data.TrialId
 | |
|       this.currentData.SubjectId = this.data.SubjectId
 | |
|       this.currentData.ReadingId = this.data.Id
 | |
|       this.currentData.IsVisit = this.data.IsVisit
 | |
|       this.addOrUpdateCD.title = this.$t('common:button:edit')
 | |
|       this.addOrUpdateCD.visible = true
 | |
|     },
 | |
|     handleDelete(row) {
 | |
|       this.$confirm(this.$t('trials:readingPeriod:cd:message:delete'), {
 | |
|         type: 'warning',
 | |
|         distinguishCancelAndClose: true
 | |
|       })
 | |
|         .then(() => {
 | |
|           this.loading = true
 | |
|           deleteReadingClinicalData(row.Id)
 | |
|             .then(res => {
 | |
|               this.loading = false
 | |
|               if (res.IsSuccess) {
 | |
|                 this.getList()
 | |
|                 this.$message.success(this.$t('common:message:deletedSuccessfully'))
 | |
|               }
 | |
|             }).catch(() => { this.loading = false })
 | |
|         }).catch(() => {})
 | |
|     },
 | |
|     handleSign(row) {
 | |
|       this.currentData = { ...row }
 | |
|       const { CDQualityConfirmation } = const_.processSignature
 | |
|       this.signCode = CDQualityConfirmation
 | |
|       this.signVisible = true
 | |
|     },
 | |
|     signConfirm(signInfo) {
 | |
|       this.loading = true
 | |
|       const params = {
 | |
|         data: {
 | |
|           readingClinicalDataId: this.currentData.Id
 | |
|         },
 | |
|         signInfo: signInfo
 | |
|       }
 | |
|       ReadClinicalDataSign(params).then(res => {
 | |
|         this.loading = false
 | |
|         if (res.IsSuccess) {
 | |
|           this.$message.success(this.$t('common:message:savedSuccessfully'))
 | |
|           this.$refs['signForm'].btnLoading = false
 | |
|           this.signVisible = false
 | |
|           this.getList()
 | |
|         }
 | |
|       }).catch(_ => {
 | |
|         this.loading = false
 | |
|         this.$refs['signForm'].btnLoading = false
 | |
|       })
 | |
|     },
 | |
|     // 关闭签名框并设置确认状态
 | |
|     closeSignDialog(isSign, signInfo) {
 | |
|       if (isSign) {
 | |
|         this.signConfirm(signInfo)
 | |
|       } else {
 | |
|         this.signVisible = false
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| <style lang="scss" scoped>
 | |
| .clinical-data_content{
 | |
|   .top{
 | |
|     text-align: right;
 | |
|   }
 | |
| }
 | |
| </style>
 |