159 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			159 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div v-loading="loading" class="reading-unit-wrapper">
 | 
						|
    <div class="content">
 | 
						|
 | 
						|
      <el-collapse v-model="activeCollapse" class="setting-config">
 | 
						|
        <!-- 阅片规则 -->
 | 
						|
        <el-collapse-item title="阅片规则" name="1">
 | 
						|
          <ReadingRules
 | 
						|
            ref="readingRules"
 | 
						|
            @setConfirm="setConfirm"
 | 
						|
            @setArbitrationReading="setArbitrationReading"
 | 
						|
          />
 | 
						|
        </el-collapse-item>
 | 
						|
        <!-- 阅片标准 -->
 | 
						|
        <el-collapse-item title="阅片标准" name="2">
 | 
						|
          <ReadingCriterions
 | 
						|
            ref="readingCriterions"
 | 
						|
            @reloadArbitrationRules="reloadArbitrationRules"
 | 
						|
          />
 | 
						|
        </el-collapse-item>
 | 
						|
        <!-- 仲裁规则 -->
 | 
						|
        <el-collapse-item v-if="isArbitrationReading" title="仲裁规则" name="3">
 | 
						|
          <ArbitrationRules ref="arbitrationRules" />
 | 
						|
        </el-collapse-item>
 | 
						|
      </el-collapse>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div v-if="!isConfirm" 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 { trialReadingInfoSign } from '@/api/trials'
 | 
						|
import ReadingRules from './components/ReadingRules'
 | 
						|
import ReadingCriterions from './components/ReadingCriterions'
 | 
						|
import ArbitrationRules from './components/ArbitrationRules'
 | 
						|
import SignForm from '@/views/trials/components/newSignForm'
 | 
						|
import const_ from '@/const/sign-code'
 | 
						|
 | 
						|
export default {
 | 
						|
  name: 'ReadingUnit',
 | 
						|
  components: { ReadingRules, ReadingCriterions, ArbitrationRules, SignForm },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      activeCollapse: ['1', '2', '3'],
 | 
						|
      signCode: null,
 | 
						|
      signVisible: false,
 | 
						|
      currentUser: zzSessionStorage.getItem('userName'),
 | 
						|
      isConfirm: true,
 | 
						|
      loading: false,
 | 
						|
      isArbitrationReading: false
 | 
						|
    }
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    setConfirm(isConfirm) {
 | 
						|
      this.isConfirm = isConfirm
 | 
						|
    },
 | 
						|
    setArbitrationReading(isArbitrationReading) {
 | 
						|
      this.isArbitrationReading = isArbitrationReading
 | 
						|
    },
 | 
						|
 | 
						|
    handleConfirm() {
 | 
						|
      Promise.all([this.$refs['readingRules'].handleSave(false), this.$refs['readingCriterions'].handleSave(false)])
 | 
						|
        .then(() => {
 | 
						|
          const { ReadingUnitConfirmation } = const_.processSignature
 | 
						|
          this.signCode = ReadingUnitConfirmation
 | 
						|
          this.signVisible = true
 | 
						|
        }).catch(() => {
 | 
						|
        })
 | 
						|
    },
 | 
						|
    // 关闭签名框并设置确认状态
 | 
						|
    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
 | 
						|
        },
 | 
						|
        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'].initPage()
 | 
						|
          this.$refs['readingCriterions'].initPage()
 | 
						|
          this.$refs['arbitrationRules'].getList()
 | 
						|
        }
 | 
						|
        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>
 |