From 0c7b4fbfdd790c077d990f18e1059085494b5a08 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Tue, 11 Mar 2025 16:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=B1=E5=83=8F=E9=87=8D=E4=BC=A0=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=AE=8C=E6=88=90=E6=97=B6=EF=BC=8C=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E4=B8=ADXXX=E6=9C=AA=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crc-upload/components/historyChat.vue | 419 +++++++++++------- 1 file changed, 262 insertions(+), 157 deletions(-) diff --git a/src/views/trials/trials-panel/visit/crc-upload/components/historyChat.vue b/src/views/trials/trials-panel/visit/crc-upload/components/historyChat.vue index 75c89553..207bd513 100644 --- a/src/views/trials/trials-panel/visit/crc-upload/components/historyChat.vue +++ b/src/views/trials/trials-panel/visit/crc-upload/components/historyChat.vue @@ -1,23 +1,45 @@ @@ -172,20 +266,21 @@ import { verifyReuploadIsCanJump, addQCChallengeReply, cRCRequestReUpload, -} from "@/api/trials"; -import { setReuploadFinished } from "@/api/trials/visit"; -import adminAvatar from "@/assets/Admin.png"; -import pmAvatar from "@/assets/PM.png"; -import crcAvatar from "@/assets/CRC.png"; -import qcAvatar from "@/assets/QC.png"; -import UploadDicomFiles from "./uploadDicomFiles2"; -import UploadNonDicomFiles from "./uploadNonDicomFiles"; -import UploadClinicalData from "./uploadClinicalData"; -import SignForm from "@/views/trials/components/newSignForm"; -import dicomStore from "@/utils/dicom-store"; -import const_ from "@/const/sign-code"; + getVisitClinicalDataName +} from '@/api/trials' +import { setReuploadFinished } from '@/api/trials/visit' +import adminAvatar from '@/assets/Admin.png' +import pmAvatar from '@/assets/PM.png' +import crcAvatar from '@/assets/CRC.png' +import qcAvatar from '@/assets/QC.png' +import UploadDicomFiles from './uploadDicomFiles2' +import UploadNonDicomFiles from './uploadNonDicomFiles' +import UploadClinicalData from './uploadClinicalData' +import SignForm from '@/views/trials/components/newSignForm' +import dicomStore from '@/utils/dicom-store' +import const_ from '@/const/sign-code' export default { - name: "HistoryChat", + name: 'HistoryChat', components: { UploadDicomFiles, UploadNonDicomFiles, @@ -196,22 +291,22 @@ export default { data: { type: Object, default() { - return {}; + return {} }, }, otherInfo: { type: Object, default() { - return {}; + return {} }, }, bodyParts: { type: String, - default: "", + default: '', }, modalities: { type: String, - default: "", + default: '', }, clinicalEnum: { type: Number, @@ -223,66 +318,67 @@ export default { list: [], loading: false, btnLoading: false, - newMessage: "", - userId: zzSessionStorage.getItem("userId"), + newMessage: '', + userId: zzSessionStorage.getItem('userId'), trialCode: this.$route.query.trialCode, adminAvatar, pmAvatar, crcAvatar, qcAvatar, uploadVisible: false, - activeName: "dicom", + activeName: 'dicom', currentChallengeIndex: null, signVisible: false, - signCode: "", - currentUser: zzSessionStorage.getItem("userName"), + signCode: '', + currentUser: zzSessionStorage.getItem('userName'), trialId: this.$route.query.trialId, uploadBtnLoading: false, applyBtnLoading: false, reuploadedFinishbtnLoading: false, - }; + signReplaceText: null, + } }, mounted() { - this.initChat(); + this.initChat() }, methods: { clickTab(tab) { - this.setScrollHeight(tab.index * 1); + this.setScrollHeight(tab.index * 1) }, // 初始化聊天记录 initChat(index) { - var list = []; - this.loading = true; + var list = [] + this.loading = true getCRCVisitChallengeAndDialog(this.data.Id, this.data.QCProcessEnum) .then((res) => { res.Result.forEach((item) => { - var contents = []; - if (item.Content && item.Content.indexOf("|") !== -1) { - contents = item.Content.split("|"); - } else if (item.Content && item.Content !== "") { - contents.push(item.Content); + var contents = [] + if (item.Content && item.Content.indexOf('|') !== -1) { + contents = item.Content.split('|') + } else if (item.Content && item.Content !== '') { + contents.push(item.Content) } var li = contents.map((content) => { - return `
  • ${content}
  • `; - }); + return `
  • ${content}
  • ` + }) const content = ` -
    ${this.$t("trials:qcQuality:dialog:qcContent")} +
    ${this.$t('trials:qcQuality:dialog:qcContent')}
      - ${li.join("")} + ${li.join('')}

    - ${this.$t("trials:qcQuality:dialogTips:tip")} + ${this.$t('trials:qcQuality:dialogTips:tip')}

    ${this.$t( - "trials:qcQuality:dialog:deadline" + 'trials:qcQuality:dialog:deadline' )}: ${ item.DeadlineTime ? item.DeadlineTime - : this.$t("trials:qcQuality:dialog:none") - }

    `; - const userId = zzSessionStorage.getItem("userId"); - var recordContent = []; + : this.$t('trials:qcQuality:dialog:none') + }

    ` + const userId = zzSessionStorage.getItem('userId') + var recordContent = [] recordContent.push({ IsCurrentUser: item.CreateUserId === userId, TalkContent: content, @@ -291,8 +387,8 @@ export default { CreateUserFullName: item.CreateUserFullName, CreateUserId: item.CreateUserId, UserTypeEnum: item.UserTypeEnum, - }); - recordContent.push(...item.DialogList); + }) + recordContent.push(...item.DialogList) list.push({ Id: item.Id, ChallengeCode: item.ChallengeCode, @@ -302,98 +398,107 @@ export default { Content: item.Content, DeadlineTime: item.DeadlineTime, IsOverTime: item.IsOverTime, - }); - this.list = Object.assign({}, list); - this.loading = false; - this.setScrollHeight(index || 0); - }); + }) + this.list = Object.assign({}, list) + this.loading = false + this.setScrollHeight(index || 0) + }) }) .catch(() => { - this.loading = false; - }); + this.loading = false + }) }, setScrollHeight(index) { setTimeout(() => { - var container = document.querySelectorAll(".chat-content")[index]; - container.scrollTop = container.scrollHeight; - }, 100); + var container = document.querySelectorAll('.chat-content')[index] + container.scrollTop = container.scrollHeight + }, 100) }, // 回复质疑 handleReply(qcChallengeId, index) { - if (!this.newMessage) return; - this.btnLoading = true; + if (!this.newMessage) return + this.btnLoading = true var params = { talkContent: this.newMessage, qcChallengeId: qcChallengeId, subjectVisitId: this.data.Id, - }; + } addQCChallengeReply(this.data.TrialId, params) .then((res) => { if (res.IsSuccess) { // this.list[index].DialogList.push({ IsCurrentUser: true, TalkContent: this.newMessage, CreateTime: res.Result.CreateTime, CreateUserName: res.Result.CreateUserName, CreateUserId: res.Result.CreateUserId, UserTypeEnum: res.Result.UserTypeEnum }) - this.initChat(index); - this.newMessage = ""; + this.initChat(index) + this.newMessage = '' } - this.btnLoading = false; + this.btnLoading = false }) .catch(() => { - this.btnLoading = false; - }); + this.btnLoading = false + }) }, // 打开上传弹窗 openUploadDialog(index) { - const qcChallengeId = this.list[index].Id; - if (!qcChallengeId) return; - this.uploadBtnLoading = true; + const qcChallengeId = this.list[index].Id + if (!qcChallengeId) return + this.uploadBtnLoading = true verifyReuploadIsCanJump(this.trialId, qcChallengeId) .then((res) => { - this.uploadBtnLoading = false; + this.uploadBtnLoading = false if (res.IsSuccess) { - dicomStore.studyList = []; - if ([0, 1].includes(this.$store.state.trials.config.CollectImagesEnum)) { + dicomStore.studyList = [] + if ( + [0, 1].includes(this.$store.state.trials.config.CollectImagesEnum) + ) { this.activeName = 'dicom' } else { this.activeName = 'non-dicom' } - this.uploadVisible = true; + this.uploadVisible = true } }) .catch(() => { - this.initChat(index); - this.$emit("getList"); - this.uploadBtnLoading = false; - }); + this.initChat(index) + this.$emit('getList') + this.uploadBtnLoading = false + }) }, // 关闭重传弹框 closeUpload() { - this.uploadVisible = false; + this.uploadVisible = false }, // 刷新父组件列表 reFreshList() { - this.$emit("getList"); + this.$emit('getList') }, // 设置重传完成 handleSetUploadFinished(index) { if (this.clinicalEnum > 0 && this.data.IsBaseLine) { - this.currentChallengeIndex = index; - const { ClinicalDataConfirmation } = const_.processSignature; - this.signCode = ClinicalDataConfirmation; - this.signVisible = true; + getVisitClinicalDataName({ id: this.data.Id }) + .then((res) => { + this.signReplaceText = res.Result.ClinicalDataName + this.currentChallengeIndex = index + const { ClinicalDataConfirmation } = const_.processSignature + this.signCode = ClinicalDataConfirmation + this.signVisible = true + }) + .catch((err) => { + console.log(err) + }) } else { - this.$confirm(this.$t("trials:crcQuestion:message:reuploadConfirm"), { - type: "warning", + this.$confirm(this.$t('trials:crcQuestion:message:reuploadConfirm'), { + type: 'warning', distinguishCancelAndClose: true, }) .then(() => { - this.currentChallengeIndex = index; - this.setReuploadFinished(); + this.currentChallengeIndex = index + this.setReuploadFinished() }) - .catch(() => {}); + .catch(() => {}) } }, setReuploadFinished(signInfo) { - this.loading = true; - var item = Object.assign({}, this.list[this.currentChallengeIndex]); + this.loading = true + var item = Object.assign({}, this.list[this.currentChallengeIndex]) var params = { data: { QcChallengeId: item.Id, @@ -401,65 +506,65 @@ export default { SetOrCancel: true, }, signInfo: signInfo, - }; - this.loading = true; - this.reuploadedFinishbtnLoading = true; + } + this.loading = true + this.reuploadedFinishbtnLoading = true setReuploadFinished(params) .then((res) => { - this.loading = false; - this.reuploadedFinishbtnLoading = false; + this.loading = false + this.reuploadedFinishbtnLoading = false if (res.IsSuccess) { if (signInfo) { - this.$refs["signForm"].btnLoading = false; - this.signVisible = false; + this.$refs['signForm'].btnLoading = false + this.signVisible = false } - this.list[this.currentChallengeIndex].ReuploadEnum = 3; - this.initChat(); + this.list[this.currentChallengeIndex].ReuploadEnum = 3 + this.initChat() // this.$message.success(this.$t('common:message:savedSuccessfully')) - this.reFreshList(); + this.reFreshList() } }) .catch(() => { - this.loading = false; - this.reuploadedFinishbtnLoading = false; - this.$refs["signForm"].btnLoading = false; - }); + this.loading = false + this.reuploadedFinishbtnLoading = false + this.$refs['signForm'].btnLoading = false + }) }, // 关闭临床数据签名弹窗 closeClinicalDataSignDialog(isSign, signInfo) { if (isSign) { - this.setReuploadFinished(signInfo); + this.setReuploadFinished(signInfo) } else { - this.signVisible = false; + this.signVisible = false } }, // crc申请重传 handleCRCApplyReupload(item) { - this.$confirm(this.$t("trials:crcQuestion:message:applyReupload"), { - type: "warning", + this.$confirm(this.$t('trials:crcQuestion:message:applyReupload'), { + type: 'warning', distinguishCancelAndClose: true, }) .then(() => { - this.applyBtnLoading = true; + this.applyBtnLoading = true cRCRequestReUpload(this.trialId, this.data.Id, item.Id) .then((res) => { - this.applyBtnLoading = false; + this.applyBtnLoading = false if (res.IsSuccess) { - item.ReuploadEnum = 1; - this.initChat(); + item.ReuploadEnum = 1 + this.initChat() // this.$message.success(this.$t('common:message:savedSuccessfully')) - this.$forceUpdate(); - this.reFreshList(); + this.$forceUpdate() + this.reFreshList() } }) .catch(() => { - this.applyBtnLoading = false; - }); + this.applyBtnLoading = false + }) }) - .catch(() => {}); + .catch(() => {}) }, }, -}; +}