145 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			145 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <el-form
 | 
						|
    ref="oncologyForm"
 | 
						|
    v-loading="loading"
 | 
						|
    :model="form"
 | 
						|
    size="small"
 | 
						|
    :rules="rules"
 | 
						|
    label-width="110px"
 | 
						|
  >
 | 
						|
    <el-form-item label="评估结果" prop="OncologyAssessIds">
 | 
						|
<!--      <el-input-->
 | 
						|
<!--        v-model="form.EvaluationResult"-->
 | 
						|
<!--        type="textarea"-->
 | 
						|
<!--        :autosize="{ minRows: 3, maxRows: 4}"-->
 | 
						|
<!--        maxlength="500"-->
 | 
						|
<!--        show-word-limit-->
 | 
						|
<!--        style="width:400px"-->
 | 
						|
<!--        :disabled="isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"-->
 | 
						|
<!--      />-->
 | 
						|
      <el-checkbox-group :disabled="form.IsSystemCriterion" v-model="form.OncologyAssessIds">
 | 
						|
        <el-checkbox v-for="item of $d.OncologyAssessType" :label="item.id">
 | 
						|
          {{item.raw.ValueCN}}
 | 
						|
        </el-checkbox>
 | 
						|
      </el-checkbox-group>
 | 
						|
    </el-form-item>
 | 
						|
    <el-form-item label="评估原因说明" prop="EvaluationReason">
 | 
						|
      <el-input
 | 
						|
        v-model="form.EvaluationReason"
 | 
						|
        type="textarea"
 | 
						|
        :autosize="{ minRows: 3, maxRows: 4}"
 | 
						|
        maxlength="500"
 | 
						|
        show-word-limit
 | 
						|
        style="width:400px"
 | 
						|
        :disabled="isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
      />
 | 
						|
    </el-form-item>
 | 
						|
    <!-- 是否展示详情 -->
 | 
						|
    <el-form-item
 | 
						|
      label="是否查看详情"
 | 
						|
      prop="IsShowDetail"
 | 
						|
    >
 | 
						|
      <el-radio-group
 | 
						|
        v-model="form.IsShowDetail"
 | 
						|
        :disabled="isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
      >
 | 
						|
        <el-radio
 | 
						|
          v-for="item of $d.YesOrNo"
 | 
						|
          :key="`IsShowDetail${item.value}`"
 | 
						|
          :label="item.value"
 | 
						|
        >
 | 
						|
          {{ item.label }}
 | 
						|
        </el-radio>
 | 
						|
      </el-radio-group>
 | 
						|
    </el-form-item>
 | 
						|
    <el-form-item v-if="!isSign && hasPermi(['trials:trials-panel:setting:reading-unit:edit'])">
 | 
						|
      <!-- 保存 -->
 | 
						|
      <el-button
 | 
						|
        size="small"
 | 
						|
        type="primary"
 | 
						|
        @click="handleSave(true)"
 | 
						|
      >
 | 
						|
        {{ $t('common:button:save') }}
 | 
						|
      </el-button>
 | 
						|
    </el-form-item>
 | 
						|
  </el-form>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { getOncologySet, setOncologySet } from '@/api/trials'
 | 
						|
export default {
 | 
						|
  name: 'OncologyForm',
 | 
						|
  props: {
 | 
						|
    TrialReadingCriterionId: {
 | 
						|
      type: String,
 | 
						|
      default() {
 | 
						|
        return ''
 | 
						|
      }
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      form: {
 | 
						|
        TrialId: '',
 | 
						|
        EvaluationResult: '',
 | 
						|
        EvaluationReason: '',
 | 
						|
        IsShowDetail: false,
 | 
						|
        OncologyAssessIds: [],
 | 
						|
        IsSystemCriterion: true
 | 
						|
      },
 | 
						|
      rules: {
 | 
						|
        OncologyAssessIds: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }],
 | 
						|
        EvaluationReason: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }],
 | 
						|
        IsShowDetail: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }]
 | 
						|
      },
 | 
						|
      loading: false,
 | 
						|
      isSign: true
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.initForm()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    initForm() {
 | 
						|
      this.loading = true
 | 
						|
      getOncologySet({ trialId: this.$route.query.trialId, TrialReadingCriterionId: this.TrialReadingCriterionId }).then(res => {
 | 
						|
        if (Object.keys(res.Result).length > 0) {
 | 
						|
          for (const k in res.Result) {
 | 
						|
            if (this.form.hasOwnProperty(k)) {
 | 
						|
              this.form[k] = res.Result[k]
 | 
						|
            }
 | 
						|
          }
 | 
						|
          this.isSign = res.Result.IsSign
 | 
						|
        }
 | 
						|
        this.loading = false
 | 
						|
      }).catch(() => {
 | 
						|
        this.loading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleSave(isPrompt) {
 | 
						|
      return new Promise((resolve, reject) => {
 | 
						|
        this.$refs['oncologyForm'].validate((valid) => {
 | 
						|
          if (!valid) {
 | 
						|
            reject(false)
 | 
						|
          } else {
 | 
						|
            this.loading = true
 | 
						|
            // 保存配置信息
 | 
						|
            this.form.TrialId = this.$route.query.trialId
 | 
						|
            this.form.TrialReadingCriterionId = this.TrialReadingCriterionId
 | 
						|
            setOncologySet(this.form).then(res => {
 | 
						|
              this.loading = false
 | 
						|
              if (res.IsSuccess && isPrompt) {
 | 
						|
                this.$message.success(this.$t('common:message:savedSuccessfully'))
 | 
						|
              }
 | 
						|
              resolve(true)
 | 
						|
            }).catch(_ => {
 | 
						|
              this.loading = false
 | 
						|
              reject(false)
 | 
						|
            })
 | 
						|
          }
 | 
						|
        })
 | 
						|
      })
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 |