266 lines
		
	
	
		
			9.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			266 lines
		
	
	
		
			9.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div v-loading="loading" class="reading-unit-wrapper">
 | 
						|
    <div class="content" v-if="isShow">
 | 
						|
      <el-tabs type="border-card" v-model="TrialReadingCriterionId">
 | 
						|
        <el-tab-pane v-if="isPaneShow" :label="item.TrialReadingCriterionName" :name="item.TrialReadingCriterionId" v-for="item of trialCriterionList">
 | 
						|
          <el-collapse v-model="activeCollapse" class="setting-config">
 | 
						|
            <!-- 阅片规则 -->
 | 
						|
            <el-collapse-item title="阅片规则" name="1">
 | 
						|
              <ReadingRules
 | 
						|
                :ref="`readingRules${item.TrialReadingCriterionId}`"
 | 
						|
                :TrialReadingCriterionId="TrialReadingCriterionId"
 | 
						|
                @setConfirm="setConfirm"
 | 
						|
                @setArbitrationReading="setArbitrationReading"
 | 
						|
                @setIsClinicalReading="setIsClinicalReading"
 | 
						|
                @setGlobalReading="setGlobalReading"
 | 
						|
                @setOncologyReading="setOncologyReading"
 | 
						|
              />
 | 
						|
            </el-collapse-item>
 | 
						|
            <!-- 阅片标准 -->
 | 
						|
            <el-collapse-item title="阅片标准" name="2">
 | 
						|
              <ReadingCriterions
 | 
						|
                :TrialReadingCriterionId="TrialReadingCriterionId"
 | 
						|
                :ref="`readingCriterions${item.TrialReadingCriterionId}`"
 | 
						|
                @reloadArbitrationRules="reloadArbitrationRules"
 | 
						|
              />
 | 
						|
            </el-collapse-item>
 | 
						|
            <!-- 仲裁规则 -->
 | 
						|
            <el-collapse-item v-if="setGlobalReading" title="全局阅片" name="5">
 | 
						|
              <GlobalReading :TrialReadingCriterionId="TrialReadingCriterionId" :ref="`globalReading${item.TrialReadingCriterionId}`" />
 | 
						|
            </el-collapse-item>
 | 
						|
            <!-- 仲裁规则 -->
 | 
						|
            <el-collapse-item v-if="isArbitrationReading" title="仲裁规则" name="3">
 | 
						|
              <ArbitrationRules :TrialReadingCriterionId="TrialReadingCriterionId" :ref="`arbitrationRules${item.TrialReadingCriterionId}`" />
 | 
						|
            </el-collapse-item>
 | 
						|
            <!-- 肿瘤学阅片配置 -->
 | 
						|
            <!-- v-if="isClinicalReading" -->
 | 
						|
            <el-collapse-item v-if="isOncologyReading" title="肿瘤学阅片配置" name="4">
 | 
						|
              <OncologyForm :TrialReadingCriterionId="TrialReadingCriterionId" :ref="`oncologyForm${item.TrialReadingCriterionId}`" />
 | 
						|
            </el-collapse-item>
 | 
						|
          </el-collapse>
 | 
						|
        </el-tab-pane>
 | 
						|
      </el-tabs>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div v-if="!isConfirm && hasPermi(['trials:trials-panel:setting:reading-unit:edit'])" class="bottom">
 | 
						|
      <el-button
 | 
						|
        type="danger"
 | 
						|
        @click="handleConfirm"
 | 
						|
      >
 | 
						|
        确认
 | 
						|
      </el-button>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <!--签名框 -->
 | 
						|
    <el-dialog
 | 
						|
      v-if="signVisible"
 | 
						|
      :visible.sync="signVisible"
 | 
						|
      :close-on-click-modal="false"
 | 
						|
      width="600px"
 | 
						|
      custom-class="base-dialog-wrapper"
 | 
						|
    >
 | 
						|
      <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>
 | 
						|
</template>
 | 
						|
<script>
 | 
						|
import { asyncTrialCriterionDictionary, getTrialCriterionList, trialReadingInfoSign, trialReadingInfoSignVerify, verifyeCriterionNeedSynchronize, synchronizeCriterion } from '@/api/trials'
 | 
						|
import ReadingRules from './components/ReadingRules'
 | 
						|
import ReadingCriterions from './components/ReadingCriterions'
 | 
						|
import ArbitrationRules from './components/ArbitrationRules'
 | 
						|
import GlobalReading from './components/GlobalReading'
 | 
						|
import OncologyForm from './components/OncologyForm'
 | 
						|
import SignForm from '@/views/trials/components/newSignForm'
 | 
						|
import const_ from '@/const/sign-code'
 | 
						|
 | 
						|
export default {
 | 
						|
  name: 'ReadingUnit',
 | 
						|
  components: { GlobalReading, ReadingRules, ReadingCriterions, ArbitrationRules, OncologyForm, SignForm },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      activeCollapse: ['1', '2', '3', '4', '5'],
 | 
						|
      signCode: null,
 | 
						|
      signVisible: false,
 | 
						|
      currentUser: zzSessionStorage.getItem('userName'),
 | 
						|
      isConfirm: true,
 | 
						|
      loading: false,
 | 
						|
      isArbitrationReading: false,
 | 
						|
      isClinicalReading: false,
 | 
						|
      trialCriterionList: [],
 | 
						|
      TrialReadingCriterionId: '0',
 | 
						|
      trialId: this.$route.query.trialId,
 | 
						|
      isPaneShow: true,
 | 
						|
      isShow: false,
 | 
						|
      isOncologyReading: false
 | 
						|
    }
 | 
						|
  },
 | 
						|
  watch: {
 | 
						|
    TrialReadingCriterionId() {
 | 
						|
      this.isPaneShow = false
 | 
						|
      this.$nextTick(() => {
 | 
						|
        this.isPaneShow = true
 | 
						|
      })
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getTrialCriterionList()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    asyncTrialCriterionDictionary(TrialReadingCriterionId) {
 | 
						|
      return new Promise(resolve => {
 | 
						|
        asyncTrialCriterionDictionary({TrialReadingCriterionId: TrialReadingCriterionId}).then(res => {
 | 
						|
          resolve()
 | 
						|
        })
 | 
						|
      })
 | 
						|
 | 
						|
    },
 | 
						|
    getTrialCriterionList() {
 | 
						|
      getTrialCriterionList(this.trialId).then(async res => {
 | 
						|
        this.trialCriterionList = res.Result
 | 
						|
        await this.asyncTrialCriterionDictionary(this.trialCriterionList[0].TrialReadingCriterionId)
 | 
						|
        this.TrialReadingCriterionId = this.trialCriterionList[0].TrialReadingCriterionId
 | 
						|
        this.isShow = true
 | 
						|
      }).catch(() => {
 | 
						|
      })
 | 
						|
    },
 | 
						|
    setConfirm(isConfirm) {
 | 
						|
      this.isConfirm = isConfirm
 | 
						|
    },
 | 
						|
    setIsClinicalReading(isClinicalReading) {
 | 
						|
      this.isClinicalReading = isClinicalReading
 | 
						|
    },
 | 
						|
    setArbitrationReading(isArbitrationReading) {
 | 
						|
      this.isArbitrationReading = isArbitrationReading
 | 
						|
    },
 | 
						|
    setGlobalReading(isGlobalReading) {
 | 
						|
      this.isGlobalReading = isGlobalReading
 | 
						|
    },
 | 
						|
    setOncologyReading(isOncologyReading) {
 | 
						|
      this.isOncologyReading = isOncologyReading
 | 
						|
    },
 | 
						|
    updateCriterions() {
 | 
						|
      this.loading = true
 | 
						|
      synchronizeCriterion({ trialId: this.$route.query.trialId, TrialReadingCriterionId: this.TrialReadingCriterionId }).then(res => {
 | 
						|
        this.$router.push({ path: `/trials/trials-panel/setting/reading-unit?trialId=${this.$route.query.trialId}&trialCode=${this.$route.query.trialCode}&researchProgramNo=${this.$route.query.researchProgramNo}&t=${new Date().getTime()}` })
 | 
						|
        this.loading = false
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleConfirm() {
 | 
						|
      this.loading = true
 | 
						|
      var _this = this
 | 
						|
      verifyeCriterionNeedSynchronize({ trialId: this.$route.query.trialId, TrialReadingCriterionId: this.TrialReadingCriterionId }).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        if (res.Result !== 1) {
 | 
						|
          this.$confirm('系统检测当前阅片标准配置发生更新,是否确认获取最新配置信息?', {
 | 
						|
            type: 'warning'
 | 
						|
          })
 | 
						|
            .then(() => {
 | 
						|
              this.updateCriterions()
 | 
						|
            })
 | 
						|
            .catch(action => {
 | 
						|
            })
 | 
						|
        } else {
 | 
						|
          console.log(this.$refs['readingRules' + this.TrialReadingCriterionId])
 | 
						|
          console.log(this.$refs['readingCriterions' + this.TrialReadingCriterionId])
 | 
						|
          console.log(this.$refs['globalReading' + this.TrialReadingCriterionId])
 | 
						|
          console.log(this.$refs['oncologyForm' + this.TrialReadingCriterionId])
 | 
						|
          Promise.all(
 | 
						|
            [
 | 
						|
              this.$refs['readingRules' + this.TrialReadingCriterionId][0].handleSave(false),
 | 
						|
              this.$refs['readingCriterions' + this.TrialReadingCriterionId][0].handleSave(false),
 | 
						|
              this.$refs['globalReading' + this.TrialReadingCriterionId][0].handleSave(false),
 | 
						|
              this.$refs['oncologyForm' + this.TrialReadingCriterionId][0].handleSave(false)
 | 
						|
            ])
 | 
						|
            .then(async(res) => {
 | 
						|
              console.log(res)
 | 
						|
              await this.$refs['arbitrationRules' + this.TrialReadingCriterionId][0].saveAllSync()
 | 
						|
              trialReadingInfoSignVerify({ trialId: this.$route.query.trialId, TrialReadingCriterionId: this.TrialReadingCriterionId }).then(res => {
 | 
						|
                if (res.IsSuccess) {
 | 
						|
                  const { ReadingUnitConfirmation } = const_.processSignature
 | 
						|
                  this.signCode = ReadingUnitConfirmation
 | 
						|
                  this.signVisible = true
 | 
						|
                }
 | 
						|
              })
 | 
						|
            }).catch((res) => {
 | 
						|
            console.log(333)
 | 
						|
          })
 | 
						|
        }
 | 
						|
      }).catch(() => {
 | 
						|
        console.log(222)
 | 
						|
        this.loading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    // 关闭签名框并设置确认状态
 | 
						|
    closeSignDialog(isSign, signInfo) {
 | 
						|
      if (isSign) {
 | 
						|
        this.signConfirm(signInfo)
 | 
						|
      } else {
 | 
						|
        this.signVisible = false
 | 
						|
      }
 | 
						|
    },
 | 
						|
    // 签名确认
 | 
						|
    signConfirm(signInfo) {
 | 
						|
      this.loading = true
 | 
						|
      const params = {
 | 
						|
        data: {
 | 
						|
          trialId: this.$route.query.trialId,
 | 
						|
          TrialReadingCriterionId: this.TrialReadingCriterionId
 | 
						|
        },
 | 
						|
        signInfo: signInfo
 | 
						|
      }
 | 
						|
      trialReadingInfoSign(params).then(res => {
 | 
						|
        if (res.IsSuccess) {
 | 
						|
          this.$message.success(this.$t('common:message:savedSuccessfully'))
 | 
						|
          this.$refs['signForm'].btnLoading = false
 | 
						|
          this.signVisible = false
 | 
						|
          this.isConfirm = true
 | 
						|
          this.$refs['readingRules' + this.TrialReadingCriterionId][0].initPage()
 | 
						|
          this.$refs['readingCriterions' + this.TrialReadingCriterionId][0].initPage()
 | 
						|
          this.$refs['arbitrationRules' + this.TrialReadingCriterionId][0].getList()
 | 
						|
          this.$refs['oncologyForm' + this.TrialReadingCriterionId][0].initForm()
 | 
						|
        }
 | 
						|
        this.loading = false
 | 
						|
      }).catch(_ => {
 | 
						|
        this.loading = false
 | 
						|
        this.$refs['signForm'].btnLoading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    reloadArbitrationRules() {
 | 
						|
      this.$refs['arbitrationRules'].getList()
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
<style lang="scss" scoped>
 | 
						|
.reading-unit-wrapper{
 | 
						|
  height: 100%;
 | 
						|
  background-color: #fff;
 | 
						|
  display: flex;
 | 
						|
  flex-direction: column;
 | 
						|
  .content{
 | 
						|
    flex: 1;
 | 
						|
    overflow-y: auto;
 | 
						|
  }
 | 
						|
  >>>.el-collapse-item__header{
 | 
						|
    background:#e5ecef;
 | 
						|
    padding-left:10px;
 | 
						|
  }
 | 
						|
  >>>.el-collapse-item__content{
 | 
						|
    padding: 10px;
 | 
						|
  }
 | 
						|
  .bottom{
 | 
						|
    height: 50px;
 | 
						|
    display:flex;
 | 
						|
    align-items:center;
 | 
						|
    justify-content:center;
 | 
						|
    text-align: center;
 | 
						|
    border-top: 1px solid #e1e1e1;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
</style>
 |