165 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			165 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
| /* eslint-disable */
 | |
| <template>
 | |
|   <el-form
 | |
|     ref="taskAllocationRuleDataForm"
 | |
|     v-loading="loading"
 | |
|     :model="form"
 | |
|     size="small"
 | |
|     :rules="rules"
 | |
|     label-width="170px"
 | |
|   >
 | |
|     <div class="base-dialog-body">
 | |
|       <el-form-item label="访视数" prop="PlanVisitCount">
 | |
|         <el-input-number v-model="form.PlanVisitCount" :disabled="isDisable" :min="0" controls-position="right" />
 | |
|       </el-form-item>
 | |
|       <el-form-item label="所选访视是否有阅片期" prop="IsHaveReadingPeriod">
 | |
|         <el-radio-group v-model="form.IsHaveReadingPeriod" :disabled="isDisable" @change="form.IsGenerateGlobalTask = form.IsHaveReadingPeriod">
 | |
|           <el-radio v-for="item of $d.YesOrNo" :key="'form.IsHaveReadingPeriod' + item.value" :label="item.value">{{ item.label }}</el-radio>
 | |
|         </el-radio-group>
 | |
|       </el-form-item>
 | |
|       <el-form-item v-if="isSelfAnalysis" label="间隔周期(周)" prop="IntervalWeeks">
 | |
|         <el-input-number v-model="form.IntervalWeeks" :min="0" :disabled="isDisable" controls-position="right" />
 | |
|       </el-form-item>
 | |
|       <el-form-item label="计划病例数" prop="PlanSubjectCount">
 | |
|         <el-input-number v-model="form.PlanSubjectCount" :min="0" :disabled="isDisable" controls-position="right" />
 | |
|       </el-form-item>
 | |
|       <el-form-item  label="虚拟中心编号" prop="BlindTrialSiteCode">
 | |
|         <el-input v-model="form.BlindTrialSiteCode" style="width: 140px;" :disabled="isDisable" />
 | |
|       </el-form-item>
 | |
|       <el-form-item  label="虚拟受试者位数" prop="BlindSubjectNumberOfPlaces">
 | |
|         <el-input-number v-model="form.BlindSubjectNumberOfPlaces" :min="1" :disabled="isDisable" :max="5" controls-position="right" />
 | |
|       </el-form-item>
 | |
|       <el-form-item label="是否生成全局阅片任务" prop="IsGenerateGlobalTask">
 | |
|         <el-radio-group v-model="form.IsGenerateGlobalTask" disabled>
 | |
|           <el-radio v-for="item of $d.YesOrNo" :key="'form.IsGenerateGlobalTask' + item.value" :label="item.value">{{ item.label }}</el-radio>
 | |
|         </el-radio-group>
 | |
|       </el-form-item>
 | |
|     </div>
 | |
|     <div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
 | |
|       <el-form-item>
 | |
|         <!-- 取消 -->
 | |
|         <el-button
 | |
|           :disabled="btnLoading"
 | |
|           size="small"
 | |
|           type="primary"
 | |
|           @click="close"
 | |
|         >
 | |
|           {{ $t('common:button:cancel') }}
 | |
|         </el-button>
 | |
|         <!-- 保存 -->
 | |
|         <el-button size="small" type="primary" :loading="btnLoading" :disabled="isDisable" @click="save">
 | |
|           {{ $t('common:button:save') }}
 | |
|         </el-button>
 | |
|       </el-form-item>
 | |
|     </div>
 | |
|   </el-form>
 | |
| </template>
 | |
| <script>
 | |
| import { getConsistentRule, addOrUpdateTaskConsistentRule } from '@/api/trials/reading'
 | |
| 
 | |
| export default {
 | |
|   name: 'AddOrUpdateTaskAllocationRuleData',
 | |
|   props: {
 | |
|     TrialReadingCriterionId: {
 | |
|       type: String,
 | |
|       default() {
 | |
|         return ''
 | |
|       }
 | |
|     },
 | |
|     data: {
 | |
|       type: Object,
 | |
|       default() {
 | |
|         return {}
 | |
|       }
 | |
|     },
 | |
|     isDisable: {
 | |
|       type: Boolean,
 | |
|       default() {
 | |
|         return true
 | |
|       }
 | |
|     },
 | |
|     isSelfAnalysis: {
 | |
|       type: Boolean,
 | |
|       default() {
 | |
|         return true
 | |
|       }
 | |
|     },
 | |
|     doctorUserList: {
 | |
|       type: Array,
 | |
|       default() {
 | |
|         return []
 | |
|       }
 | |
|     }
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       form: {
 | |
|         Id: null,
 | |
|         TrialId: this.$route.query.trialId,
 | |
|         PlanSubjectCount: 0,
 | |
|         PlanVisitCount: 0,
 | |
|         IntervalWeeks: 0,
 | |
|         IsHaveReadingPeriod: null,
 | |
|         IsGenerateGlobalTask: null,
 | |
|         BlindTrialSiteCode: '',
 | |
|         BlindSubjectNumberOfPlaces: 0,
 | |
|         IsEnable: true,
 | |
|         Note: ''
 | |
|       },
 | |
|       rules: {
 | |
|         IsHaveReadingPeriod: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }],
 | |
|         IsGenerateGlobalTask: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }],
 | |
|         PlanSubjectCount: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
 | |
|         IntervalWeeks: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
 | |
|         PlanVisitCount: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
 | |
|         BlindTrialSiteCode: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
 | |
|         BlindSubjectNumberOfPlaces: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
 | |
|       },
 | |
|       loading: false,
 | |
|       btnLoading: false
 | |
|     }
 | |
|   },
 | |
|   mounted() {
 | |
|     // this.form.TrialId = this.$route.query.trialId
 | |
|     // if (Object.keys(this.data).length && this.data.Id) {
 | |
|     //   this.form = { ...this.data }
 | |
|     // }
 | |
|     this.getFrom()
 | |
|   },
 | |
|   methods: {
 | |
|     getFrom() {
 | |
|       getConsistentRule({
 | |
|         TrialId: this.$route.query.trialId,
 | |
|         IsSelfAnalysis: this.isSelfAnalysis,
 | |
|         TrialReadingCriterionId: this.TrialReadingCriterionId
 | |
|       }).then(res => {
 | |
|         if (res.Result) {
 | |
|           this.form = res.Result
 | |
|         }
 | |
|       })
 | |
|     },
 | |
|     save() {
 | |
|       this.$refs.taskAllocationRuleDataForm.validate(valid => {
 | |
|         if (!valid) return
 | |
|         this.btnLoading = true
 | |
|         this.loading = true
 | |
|         this.form.IsSelfAnalysis = this.isSelfAnalysis
 | |
|         this.form.TrialReadingCriterionId = this.TrialReadingCriterionId
 | |
|         addOrUpdateTaskConsistentRule(this.form).then(res => {
 | |
|           this.loading = false
 | |
|           this.btnLoading = false
 | |
|           this.$message.success('保存成功')
 | |
|           this.$emit('getList')
 | |
|         }).catch(() => {
 | |
|           this.loading = false
 | |
|           this.btnLoading = false
 | |
|         })
 | |
|       })
 | |
|     },
 | |
|     close() { this.$emit('close') }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| <style lang="scss" scoped>
 | |
| </style>
 |