228 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			228 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <el-form
 | 
						|
    ref="oncologyForm"
 | 
						|
    v-loading="loading"
 | 
						|
    :model="form"
 | 
						|
    size="small"
 | 
						|
    :rules="rules"
 | 
						|
    label-width="110px"
 | 
						|
  >
 | 
						|
    <el-form-item label="评估结果" prop="OncologyAssessIdsStr">
 | 
						|
      <el-input
 | 
						|
        v-model="form.OncologyAssessIdsStr"
 | 
						|
        type="textarea"
 | 
						|
        :autosize="{ minRows: 1, maxRows: 4}"
 | 
						|
        show-word-limit
 | 
						|
        style="width:400px"
 | 
						|
        :disabled="form.IsSystemCriterion || isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
      />
 | 
						|
      <el-button
 | 
						|
        :disabled="form.IsSystemCriterion || isSign || !hasPermi(['trials:trials-panel:setting:reading-unit:edit'])"
 | 
						|
        icon="el-icon-plus"
 | 
						|
        circle
 | 
						|
        @click="handleSetCriterion"
 | 
						|
      />
 | 
						|
<!--      <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-dialog
 | 
						|
      v-if="config.visible"
 | 
						|
      :visible.sync="config.visible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      :title="config.title"
 | 
						|
      width="90%"
 | 
						|
      append-to-body
 | 
						|
    >
 | 
						|
      <div style="text-align: right">
 | 
						|
        <el-button
 | 
						|
          size="mini"
 | 
						|
          type="primary"
 | 
						|
          @click="handleTypeSave"
 | 
						|
          v-loading="loading"
 | 
						|
        >
 | 
						|
          保存
 | 
						|
        </el-button>
 | 
						|
      </div>
 | 
						|
      <el-table
 | 
						|
        v-loading="loading"
 | 
						|
        v-adaptive="{bottomOffset:80}"
 | 
						|
        height="100"
 | 
						|
        ref="multipleTable"
 | 
						|
        :data="$d.OncologyAssessType"
 | 
						|
        stripe
 | 
						|
        @selection-change="handleSelectionChange"
 | 
						|
      >
 | 
						|
        <el-table-column
 | 
						|
          type="selection"
 | 
						|
          width="55">
 | 
						|
        </el-table-column>
 | 
						|
        <el-table-column
 | 
						|
          prop="raw.ValueCN"
 | 
						|
          label="中文值"
 | 
						|
          show-overflow-tooltip
 | 
						|
        >
 | 
						|
        </el-table-column>
 | 
						|
        <el-table-column
 | 
						|
          prop="raw.Value"
 | 
						|
          label="英文值"
 | 
						|
          show-overflow-tooltip
 | 
						|
        >
 | 
						|
        </el-table-column>
 | 
						|
      </el-table>
 | 
						|
    </el-dialog>
 | 
						|
  </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,
 | 
						|
        OncologyAssessIdsStr: null
 | 
						|
      },
 | 
						|
      rules: {
 | 
						|
        OncologyAssessIdsStr: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur'] }],
 | 
						|
        EvaluationReason: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }],
 | 
						|
        IsShowDetail: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }]
 | 
						|
      },
 | 
						|
      config: { visible: false, title: '全局阅片' },
 | 
						|
      loading: false,
 | 
						|
      isSign: true,
 | 
						|
      selectedList: []
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.initForm()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    handleSelectionChange(val) {
 | 
						|
      this.selectedList = val
 | 
						|
    },
 | 
						|
    toggleSelection(rows) {
 | 
						|
      console.log(this.$refs.multipleTable)
 | 
						|
      if (rows) {
 | 
						|
        rows.forEach(row => {
 | 
						|
          this.$refs.multipleTable.toggleRowSelection(row);
 | 
						|
        });
 | 
						|
      } else {
 | 
						|
        this.$refs.multipleTable.clearSelection();
 | 
						|
      }
 | 
						|
    },
 | 
						|
    handleSetCriterion() {
 | 
						|
      this.config.visible = true
 | 
						|
      this.$nextTick(() => {
 | 
						|
        var a = this.$d.OncologyAssessType.filter(v => {
 | 
						|
          return !!this.form.OncologyAssessIds.find(v1 => {
 | 
						|
            return v1 === v.id
 | 
						|
          })
 | 
						|
        })
 | 
						|
        this.toggleSelection(a)
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleTypeSave() {
 | 
						|
      this.form.OncologyAssessIds = this.selectedList.map(v => v.id)
 | 
						|
      this.form.OncologyAssessIdsStr = this.form.OncologyAssessIds.map(v => this.$fd('OncologyAssessType', v, 'id')).toString()
 | 
						|
      this.config.visible = false
 | 
						|
    },
 | 
						|
    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.form.OncologyAssessIdsStr = this.form.OncologyAssessIds.map(v => this.$fd('OncologyAssessType', v, 'id')).toString()
 | 
						|
        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>
 |