383 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			383 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
<template>
 | 
						|
  <div class="adReview_wrapper">
 | 
						|
    <el-card :body-style="{ padding: '10px' }">
 | 
						|
      <div slot="header" class="clearfix">
 | 
						|
        <span style="font-weight: bold;">评估结果</span>
 | 
						|
      </div>
 | 
						|
      <el-table
 | 
						|
        :data="adInfo.VisitTaskInfoList"
 | 
						|
        style="width: 100%"
 | 
						|
      >
 | 
						|
        <el-table-column
 | 
						|
          prop="ArmEnum"
 | 
						|
          label="角色"
 | 
						|
          show-overflow-tooltip
 | 
						|
          width="150"
 | 
						|
        >
 | 
						|
          <template slot-scope="scope">
 | 
						|
            {{ $fd('ArmEnum', scope.row.ArmEnum) }}
 | 
						|
          </template>
 | 
						|
        </el-table-column>
 | 
						|
 | 
						|
        <el-table-column
 | 
						|
          v-for="(qs,index) in judgeQuestion"
 | 
						|
          :key="qs"
 | 
						|
          prop=""
 | 
						|
          :label="qs"
 | 
						|
          show-overflow-tooltip
 | 
						|
          width="150"
 | 
						|
        >
 | 
						|
          <template slot-scope="scope">
 | 
						|
            {{ scope.row.JudgeQuestionAnswerInfoList[index].Answer }}
 | 
						|
          </template>
 | 
						|
        </el-table-column>
 | 
						|
 | 
						|
        <el-table-column
 | 
						|
          :label="$t('common:action:action')"
 | 
						|
          width="200"
 | 
						|
        >
 | 
						|
          <template slot-scope="scope">
 | 
						|
            <el-button
 | 
						|
              circle
 | 
						|
              title="查看详情"
 | 
						|
              icon="el-icon-view"
 | 
						|
              @click="handleView(scope.row,1)"
 | 
						|
            />
 | 
						|
          </template>
 | 
						|
        </el-table-column>
 | 
						|
      </el-table>
 | 
						|
    </el-card>
 | 
						|
    <el-card :body-style="{ padding: '10px' }" class="box-mr">
 | 
						|
      <div slot="header" class="clearfix">
 | 
						|
        <span style="font-weight: bold;">裁判结果</span>
 | 
						|
      </div>
 | 
						|
      <el-form
 | 
						|
        ref="adForm"
 | 
						|
        v-loading="loading"
 | 
						|
        :model="adForm"
 | 
						|
        style="width:600px"
 | 
						|
        label-width="100px"
 | 
						|
      >
 | 
						|
        <el-form-item
 | 
						|
          label=""
 | 
						|
          prop="judgeResultTaskId"
 | 
						|
          :rules="[
 | 
						|
            { required: true, message: '请选择'},
 | 
						|
          ]"
 | 
						|
        >
 | 
						|
          <el-radio-group
 | 
						|
            v-model="adForm.judgeResultTaskId"
 | 
						|
            :disabled="adInfo.ReadingTaskState >= 2"
 | 
						|
          >
 | 
						|
            <el-radio
 | 
						|
              v-for="t in adInfo.VisitTaskInfoList"
 | 
						|
              :key="t.VisitTaskId"
 | 
						|
              :label="t.VisitTaskId"
 | 
						|
            >
 | 
						|
              {{ $fd('ArmEnum', t.ArmEnum) }}
 | 
						|
            </el-radio>
 | 
						|
          </el-radio-group>
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item
 | 
						|
          label="备注"
 | 
						|
          prop="judgeResultRemark"
 | 
						|
          :rules="[
 | 
						|
            { required: true, message: '请注明'},
 | 
						|
          ]"
 | 
						|
        >
 | 
						|
          <el-input
 | 
						|
            v-model="adForm.judgeResultRemark"
 | 
						|
            type="textarea"
 | 
						|
            :autosize="{ minRows: 2, maxRows: 4}"
 | 
						|
            :disabled="adInfo.ReadingTaskState >= 2"
 | 
						|
          />
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item
 | 
						|
          label="截图说明"
 | 
						|
        >
 | 
						|
          <el-upload
 | 
						|
            :action="accept"
 | 
						|
            :limit="1"
 | 
						|
            :on-preview="handlePictureCardPreview"
 | 
						|
            :before-upload="handleBeforeUpload"
 | 
						|
            :http-request="uploadScreenshot"
 | 
						|
            list-type="picture-card"
 | 
						|
            :on-remove="handleRemove"
 | 
						|
            :file-list="fileList"
 | 
						|
            :class="{disabled:uploadDisabled}"
 | 
						|
            :disabled="adInfo.ReadingTaskState >= 2"
 | 
						|
          >
 | 
						|
            <i slot="default" class="el-icon-plus" />
 | 
						|
            <div slot="file" slot-scope="{file}">
 | 
						|
              <img
 | 
						|
                class="el-upload-list__item-thumbnail"
 | 
						|
                :src="file.url"
 | 
						|
                alt=""
 | 
						|
              >
 | 
						|
              <span class="el-upload-list__item-actions">
 | 
						|
                <span
 | 
						|
                  class="el-upload-list__item-preview"
 | 
						|
                  @click="handlePictureCardPreview(file)"
 | 
						|
                >
 | 
						|
                  <i class="el-icon-zoom-in" />
 | 
						|
                </span>
 | 
						|
 | 
						|
                <span
 | 
						|
                  v-if="adInfo.ReadingTaskState < 2"
 | 
						|
                  class="el-upload-list__item-delete"
 | 
						|
                  @click="handleRemove(file)"
 | 
						|
                >
 | 
						|
                  <i class="el-icon-delete" />
 | 
						|
                </span>
 | 
						|
              </span>
 | 
						|
            </div>
 | 
						|
          </el-upload>
 | 
						|
          <el-dialog
 | 
						|
            append-to-body
 | 
						|
            :visible.sync="imgVisible"
 | 
						|
            width="600px"
 | 
						|
          >
 | 
						|
            <!-- <img width="100%" :src="imageUrl" alt="图片未找到"> -->
 | 
						|
            <el-image :src="imageUrl" width="100%">
 | 
						|
              <div slot="placeholder" class="image-slot">
 | 
						|
                加载中<span class="dot">...</span>
 | 
						|
              </div>
 | 
						|
            </el-image>
 | 
						|
          </el-dialog>
 | 
						|
        </el-form-item>
 | 
						|
        <el-form-item v-if="adInfo.ReadingTaskState < 2">
 | 
						|
          <div style="text-align:center;">
 | 
						|
            <el-button type="primary" @click="handleSave">保存</el-button>
 | 
						|
            <el-button type="primary" @click="handleSubmit">提交</el-button>
 | 
						|
          </div>
 | 
						|
 | 
						|
        </el-form-item>
 | 
						|
      </el-form>
 | 
						|
    </el-card>
 | 
						|
    <!-- 签名框 -->
 | 
						|
    <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 { getJudgeReadingInfo, uploadJudgeTaskImage, saveJudgeVisitTaskResult, submitJudgeVisitTaskResult } from '@/api/trials'
 | 
						|
import const_ from '@/const/sign-code'
 | 
						|
import { getToken } from '@/utils/auth'
 | 
						|
import SignForm from '@/views/trials/components/newSignForm'
 | 
						|
export default {
 | 
						|
  name: 'AdReview',
 | 
						|
  components: { SignForm },
 | 
						|
  props: {
 | 
						|
    trialId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
    subjectId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
    visitTaskId: {
 | 
						|
      type: String,
 | 
						|
      required: true
 | 
						|
    },
 | 
						|
    readingCategory: {
 | 
						|
      type: Number,
 | 
						|
      required: true
 | 
						|
    }
 | 
						|
  },
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
      adInfo: {},
 | 
						|
      judgeQuestion: [],
 | 
						|
      adForm: {
 | 
						|
        visitTaskId: '',
 | 
						|
        judgeResultTaskId: '',
 | 
						|
        judgeResultRemark: '',
 | 
						|
        JudgeResultImagePath: ''
 | 
						|
      },
 | 
						|
      currentUser: zzSessionStorage.getItem('userName'),
 | 
						|
      signVisible: false,
 | 
						|
      signCode: null,
 | 
						|
      accept: '.png,.jpg,.jpeg',
 | 
						|
      imgVisible: false,
 | 
						|
      imageUrl: '',
 | 
						|
      uploadDisabled: false,
 | 
						|
      fileList: [],
 | 
						|
      loading: false
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.getAdInfo()
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    getAdInfo() {
 | 
						|
      this.loading = true
 | 
						|
      getJudgeReadingInfo({ visitTaskId: this.visitTaskId }).then(res => {
 | 
						|
        var judgeQS = []
 | 
						|
        if (res.Result.VisitTaskInfoList.length > 0) {
 | 
						|
          res.Result.VisitTaskInfoList[0].JudgeQuestionAnswerInfoList.map(v => {
 | 
						|
            judgeQS.push(v.QuestionName)
 | 
						|
          })
 | 
						|
        }
 | 
						|
        this.judgeQuestion = judgeQS
 | 
						|
        this.adInfo = res.Result
 | 
						|
        this.adForm.judgeResultTaskId = res.Result.JudgeResultTaskId
 | 
						|
        this.adForm.judgeResultRemark = res.Result.JudgeResultRemark
 | 
						|
        if (res.Result.JudgeResultImagePath) {
 | 
						|
          this.fileList = [{ name: '', url: `/api/${res.Result.JudgeResultImagePath}` }]
 | 
						|
          this.imageUrl = `/api/${res.Result.JudgeResultImagePath}`
 | 
						|
          this.uploadDisabled = true
 | 
						|
        }
 | 
						|
        this.loading = false
 | 
						|
      }).catch(() => { this.loading = false })
 | 
						|
    },
 | 
						|
    handleSave() {
 | 
						|
      this.$refs['adForm'].validate((valid) => {
 | 
						|
        if (!valid) return
 | 
						|
        this.loading = true
 | 
						|
 | 
						|
        this.adForm.visitTaskId = this.visitTaskId
 | 
						|
        saveJudgeVisitTaskResult(this.adForm).then(res => {
 | 
						|
          this.$message.success(this.$t('common:message:savedSuccessfully'))
 | 
						|
          this.loading = false
 | 
						|
        }).catch(() => {
 | 
						|
          this.loading = false
 | 
						|
        })
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleSubmit() {
 | 
						|
      this.$refs['adForm'].validate((valid) => {
 | 
						|
        if (!valid) return
 | 
						|
        const { ImageAssessmentReportConfirmation } = const_.processSignature
 | 
						|
        this.signCode = ImageAssessmentReportConfirmation
 | 
						|
        this.signVisible = true
 | 
						|
      })
 | 
						|
    },
 | 
						|
    // 关闭签名框
 | 
						|
    closeSignDialog(isSign, signInfo) {
 | 
						|
      if (isSign) {
 | 
						|
        this.signConfirm(signInfo)
 | 
						|
      } else {
 | 
						|
        this.signVisible = false
 | 
						|
      }
 | 
						|
    },
 | 
						|
    // 签名并确认
 | 
						|
    signConfirm(signInfo) {
 | 
						|
      this.loading = true
 | 
						|
      var params = {
 | 
						|
        data: {
 | 
						|
          visitTaskId: this.visitTaskId,
 | 
						|
          judgeResultTaskId: this.adForm.judgeResultTaskId,
 | 
						|
          judgeResultRemark: this.adForm.judgeResultRemark
 | 
						|
        },
 | 
						|
        signInfo: signInfo
 | 
						|
      }
 | 
						|
      submitJudgeVisitTaskResult(params).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        if (res.IsSuccess) {
 | 
						|
          this.$message.success(this.$t('common:message:savedSuccessfully'))
 | 
						|
          this.isEdit = false
 | 
						|
          this.$refs['signForm'].btnLoading = false
 | 
						|
          this.signVisible = false
 | 
						|
          window.location.reload()
 | 
						|
          window.opener.postMessage('noneDicoms', window.location)
 | 
						|
        }
 | 
						|
      }).catch(_ => {
 | 
						|
        this.loading = false
 | 
						|
        this.$refs['signForm'].btnLoading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleView(row) {
 | 
						|
      var token = getToken()
 | 
						|
      var visitTaskId = row.VisitTaskId
 | 
						|
      const routeData = this.$router.resolve({
 | 
						|
        path: `/noneDicomReading?subjectId=${this.subjectId}&trialId=${this.trialId}&visitTaskId=${visitTaskId}&TokenKey=${token}&isReadingShowPreviousResults=false`
 | 
						|
      })
 | 
						|
      window.open(routeData.href, '_blank')
 | 
						|
    },
 | 
						|
    uploadScreenshot(param) {
 | 
						|
      this.loading = true
 | 
						|
      this.uploadDisabled = false
 | 
						|
      const formData = new FormData()
 | 
						|
      formData.append('file', param.file)
 | 
						|
      uploadJudgeTaskImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => {
 | 
						|
        this.loading = false
 | 
						|
        if (res.IsSuccess) {
 | 
						|
          this.fileList.push({ name: res.Result.FileName, url: `/api/${res.Result.Path}` })
 | 
						|
          this.imageUrl = `/api/${res.Result.Path}`
 | 
						|
          this.adForm.JudgeResultImagePath = res.Result.Path
 | 
						|
        }
 | 
						|
        this.uploadDisabled = true
 | 
						|
      }).catch(() => {
 | 
						|
        this.loading = false
 | 
						|
      })
 | 
						|
    },
 | 
						|
    handleBeforeUpload(file) {
 | 
						|
      // 检测文件类型是否符合要求
 | 
						|
      if (this.checkFileSuffix(file.name)) {
 | 
						|
        this.fileList = []
 | 
						|
        return true
 | 
						|
      } else {
 | 
						|
        this.$message.error(`必须是 ${this.accept} 格式`)
 | 
						|
        return false
 | 
						|
      }
 | 
						|
    },
 | 
						|
    checkFileSuffix(fileName) {
 | 
						|
      var index = fileName.lastIndexOf('.')
 | 
						|
      var suffix = fileName.substring(index + 1, fileName.length)
 | 
						|
      if (this.accept.toLocaleLowerCase().search(suffix.toLocaleLowerCase()) === -1) {
 | 
						|
        return false
 | 
						|
      } else {
 | 
						|
        return true
 | 
						|
      }
 | 
						|
    },
 | 
						|
    // 图片清空
 | 
						|
    removeImage() {
 | 
						|
      this.imageUrl = ''
 | 
						|
      this.fileList = []
 | 
						|
      this.adForm.JudgeResultImagePath = ''
 | 
						|
    },
 | 
						|
    // 预览图片
 | 
						|
    handlePictureCardPreview() {
 | 
						|
      this.imgVisible = true
 | 
						|
      this.uploadDisabled = true
 | 
						|
    },
 | 
						|
    // 删除图片
 | 
						|
    handleRemove(file, fileList) {
 | 
						|
      this.uploadDisabled = false
 | 
						|
      this.imageUrl = ''
 | 
						|
      this.fileList = []
 | 
						|
      this.adForm.JudgeResultImagePath = ''
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</script>
 | 
						|
<style lang="scss" scoped>
 | 
						|
.adReview_wrapper{
 | 
						|
  flex: 1;
 | 
						|
  padding: 10px;
 | 
						|
  width: 100%;
 | 
						|
  height: 100%;
 | 
						|
  overflow-y: auto;
 | 
						|
  .box-mr{
 | 
						|
    margin:10px 0;
 | 
						|
  }
 | 
						|
  .disabled{
 | 
						|
  >>>.el-upload--picture-card {
 | 
						|
    display: none;
 | 
						|
  }
 | 
						|
}
 | 
						|
}
 | 
						|
</style>
 |