From 504b4b9be02d1b26fc6a54a9ba855286a16fbbe4 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 16 Jan 2026 08:31:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E5=A1=AB=E6=8A=A5=E8=B7=B3=E8=BD=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 +- src/utils/index.js | 10 +++ src/views/business/form/drug/comp/tbbdList.vue | 36 ++++++----- src/views/business/form/nonTrial/comp/tbbdList.vue | 21 +++--- src/views/business/study/comp/sqbd/Bj.vue | 2 +- src/views/business/study/comp/tbbd/Bj.vue | 74 +++++++++++++--------- src/views/business/study/comp/tbbdList.vue | 21 +++--- src/views/business/study/comp/ytbd/Xq.vue | 15 +++-- 8 files changed, 112 insertions(+), 73 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 6750b2f..f579ae3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -217,7 +217,7 @@ export const dynamicRoutes = [ permissions: ['business:studyFormFill:bj'], children: [ { - path: ':formId(\\d+)/:fromYt/:key/:studyId', + path: ':key', component: () => import('@/views/business/study/comp/tbbd/Bj'), name: 'studyFormFillBj', meta: { title: 'loading', activeMenu: '/trial/list' } @@ -231,7 +231,7 @@ export const dynamicRoutes = [ permissions: ['business:nonTrialFormFill:bj'], children: [ { - path: ':formId(\\d+)/:fromYt/:key/:studyId', + path: ':key', component: () => import('@/views/business/study/comp/tbbd/Bj'), name: 'nonTrialFormFillBj', meta: { title: 'loading', activeMenu: '/form/nonTrial' } @@ -245,7 +245,7 @@ export const dynamicRoutes = [ permissions: ['business:drugFormFill:bj'], children: [ { - path: ':formId(\\d+)/:fromYt/:key/:studyId', + path: ':key', component: () => import('@/views/business/study/comp/tbbd/Bj'), name: 'drugFormFillBj', meta: { title: 'loading', activeMenu: '/form/drug' } diff --git a/src/utils/index.js b/src/utils/index.js index 9375db7..fd3e206 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -388,3 +388,13 @@ export function isNumberStr(str) { return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) } +// 编码 +export function caesarCipher(str) { + return btoa(btoa(str)) +} + +// 解码 +export function caesarDecipher(str) { + return atob(atob(str)); +} + diff --git a/src/views/business/form/drug/comp/tbbdList.vue b/src/views/business/form/drug/comp/tbbdList.vue index 743df74..17990e3 100644 --- a/src/views/business/form/drug/comp/tbbdList.vue +++ b/src/views/business/form/drug/comp/tbbdList.vue @@ -105,7 +105,8 @@ {{ $t('form.detail') }} - {{ $t('form.edit') }} @@ -122,11 +123,12 @@ @click="ghgsr(scope.row)" v-hasPermi="['business:drugFormFill:ghgsr']">{{ $t('page.business.study.studyFormFill.ghgsr') }} - {{ + {{ $t('page.business.study.studyFormFill.sy') }} - {{ $t('page.business.study.studyFormFill.fz') }} @@ -183,6 +185,7 @@ import Ghgsr from "@/views/business/study/comp/tbbd/Ghgsr"; import Gc from "@/views/business/study/comp/tbbd/Gc"; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog'; +import { caesarCipher } from "@/utils/index"; import { mapGetters } from 'vuex' import moment from "moment"; export default { @@ -216,7 +219,7 @@ export default { components: { Ghgsr, Fh, Fz, Bj, Xq, Qrfz, Sy, Jq, Gc, SelectDeptUser, SelectDeptUserDialog }, data() { return { - isQa:false, + isQa: false, leader: null, showFh: false, showAudit: false, @@ -246,13 +249,13 @@ export default { currentRow: null } }, - created() {this.getIsQa() }, + created() { this.getIsQa() }, methods: { checkPermi, checkRole, getIsQa() { studySubject_isQa().then(response => { - this.isQa=response.data + this.isQa = response.data }) }, ghgsr(row) { @@ -313,22 +316,23 @@ export default { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit({ studySn:this.searchForm.studySn, studyMc:this.searchForm.studyMc,studyId: this.searchForm.studyId }) - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params = caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + formId: null })) - this.$tab.openPage("新增表单", '/drug/formFillBj/0/0/' + key + '/' + this.searchForm.studyId) + this.$tab.openPage("新增表单", '/drug/formFillBj/' + params) }, edit(row) { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit(row) - - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params = caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + formId: row.id })) - this.$tab.openPage(row.bdmc, '/drug/formFillBj/' + row.id + "/0/" + key + '/' + searchForm.studyId) + this.$tab.openPage(row.bdmc, '/drug/formFillBj/' + params) }, bjClose() { this.showEdit = false diff --git a/src/views/business/form/nonTrial/comp/tbbdList.vue b/src/views/business/form/nonTrial/comp/tbbdList.vue index fbd3233..bcddce3 100644 --- a/src/views/business/form/nonTrial/comp/tbbdList.vue +++ b/src/views/business/form/nonTrial/comp/tbbdList.vue @@ -94,7 +94,7 @@ @@ -186,6 +186,7 @@ import Ghgsr from "@/views/business/study/comp/tbbd/Ghgsr"; import Gc from "@/views/business/study/comp/tbbd/Gc"; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog'; +import { caesarCipher } from "@/utils/index"; import { mapGetters } from 'vuex' import moment from "moment"; export default { @@ -316,21 +317,23 @@ export default { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit({ studySn:this.searchForm.studySn, studyMc:this.searchForm.studyMc,studyId: this.searchForm.studyId }) - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params = caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + formId: null })) - this.$tab.openPage("新增表单", '/nonTrial/formFillBj/0/0/' + key + '/' + this.searchForm.studyId) + this.$tab.openPage("新增表单", '/nonTrial/formFillBj/' + params) }, edit(row) { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit(row) - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params = caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + formId: row.id })) - this.$tab.openPage(row.bdmc, '/nonTrial/formFillBj/' + row.id + "/0/" + key + '/' + searchForm.studyId) + this.$tab.openPage(row.bdmc, '/nonTrial/formFillBj/' + params) }, bjClose() { this.showEdit = false diff --git a/src/views/business/study/comp/sqbd/Bj.vue b/src/views/business/study/comp/sqbd/Bj.vue index d6d72f9..33fcdc1 100644 --- a/src/views/business/study/comp/sqbd/Bj.vue +++ b/src/views/business/study/comp/sqbd/Bj.vue @@ -132,7 +132,7 @@ import { mapGetters } from 'vuex' import SelectTemplate from "@/views/business/comps/select/SelectTemplate"; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import TemplateTable from '@/views/business/comps/template/TemplateTable'; -import { deepClone } from "@/utils/index"; +import { deepClone,caesarDecipher } from "@/utils/index"; export default { name: "Bj", diff --git a/src/views/business/study/comp/tbbd/Bj.vue b/src/views/business/study/comp/tbbd/Bj.vue index e056e63..5b6aa67 100644 --- a/src/views/business/study/comp/tbbd/Bj.vue +++ b/src/views/business/study/comp/tbbd/Bj.vue @@ -231,7 +231,7 @@ import SelectTemplate from "@/views/business/comps/select/SelectTemplate"; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import TemplateTable from '@/views/business/comps/template/TemplateTable'; import BusinessSelect from '@/views/business/comps/select/BusinessSelect'; -import { deepClone } from "@/utils/index"; +import { deepClone, caesarDecipher } from "@/utils/index"; export default { name: "Bj", @@ -334,32 +334,42 @@ export default { }) }, getInfo() { - let formId = this.$route.params.formId - let studyId = this.$route.params.studyId - let fromYt = this.$route.params.fromYt - this.reset() - if (parseInt(formId) > 0) { - if (fromYt + '' == "10") { - this.showIndex = 1 - this.bdmbTitle = this.$t('page.business.study.studyFormFill.ytbd') + let key = this.$route.params.key + if (key && key != undefined && key != '') { + let params = null + try { + params = JSON.parse(caesarDecipher(this.$route.params.key)) + } catch (e) { + console.log('参数错误') + } + if (params) { + this.reset() + if (params.formId && params.formId != '') { + if (params.fromYt) { + this.showIndex = 1 + this.bdmbTitle = this.$t('page.business.study.studyFormFill.ytbd') + } else { + this.showIndex = 2 + } + this.$modal.loading() + studyFormFill_info({ id: params.formId }).then(response => { + this.form = response.data + this.form.qmyy = this.$t('page.business.study.studyFormFill.zztjyzbd') + this.templateData = deepClone(this.form) + this.$modal.closeLoading() + }) + } else { + this.showIndex = 1 + this.$modal.loading() + study_info({ id: params.studyId }).then(response => { + this.form = _.merge({}, this.form, { stydyId: params.studyId, resourceStudy: response.data.resource, sftb: 1 }) + this.templateData = deepClone(this.form) + this.$modal.closeLoading() + }) + } } else { - this.showIndex = 2 + this.$tab.closeOpenPage('/404') } - this.$modal.loading() - studyFormFill_info({ id: formId }).then(response => { - this.form = response.data - this.form.qmyy = this.$t('page.business.study.studyFormFill.zztjyzbd') - this.templateData = deepClone(this.form) - this.$modal.closeLoading() - }) - } else { - this.showIndex = 1 - this.$modal.loading() - study_info({ id: studyId }).then(response => { - this.form = _.merge({}, this.form, { stydyId: studyId, resourceStudy: response.data.resource, sftb: 1 }) - this.templateData = deepClone(this.form) - this.$modal.closeLoading() - }) } }, getDisabledCz(bh, idx) { @@ -450,11 +460,15 @@ export default { this.form.templateSn = val.sn }, cancel() { - let data = localStorage.getItem(this.$route.params.key) - if (data && data != '') { - let params = JSON.parse(data) - const obj = { path: params.url } - this.$tab.closeOpenPage(obj) + try { + let key = caesarDecipher(this.$route.params.key) + let data = JSON.parse(key) + if (data && data != undefined && data != '') { + const obj = { path: data.url } + this.$tab.closeOpenPage(obj) + } + } catch (e) { + this.$tab.closeOpenPage('/404') } }, reset() { diff --git a/src/views/business/study/comp/tbbdList.vue b/src/views/business/study/comp/tbbdList.vue index 3829af9..a55d84e 100644 --- a/src/views/business/study/comp/tbbdList.vue +++ b/src/views/business/study/comp/tbbdList.vue @@ -184,6 +184,7 @@ import Ghgsr from "./tbbd/Ghgsr"; import Gc from "./tbbd/Gc"; import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog'; +import { caesarCipher } from "@/utils/index"; import { mapGetters } from 'vuex' import moment from "moment"; export default { @@ -322,21 +323,25 @@ export default { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit({ studySn:this.searchForm.studySn, studyMc:this.searchForm.studyMc,studyId: this.searchForm.studyId, studySubjectId: this.searchForm.studySubjectId }) - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + + let params=caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + id:null })) - this.$tab.openPage("新增表单", '/study/formFillBj/0/0/' + key+'/'+this.searchForm.studyId) + this.$tab.openPage("新增表单", '/study/formFillBj/'+params) }, edit(row) { // this.showEdit = true // this.$emit('showDetail', this.showEdit) // this.$refs.Bj.edit(row) - let key = 'formFillReturnUrl' + this.searchForm.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params=caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.searchForm.studyId, + formId:row.id })) - this.$tab.openPage(row.bdmc, '/study/formFillBj/' + row.id + "/0/" + key+'/'+this.searchForm.studyId) + debugger + this.$tab.openPage(row.bdmc, '/study/formFillBj/' +params) }, bjClose() { this.showEdit = false diff --git a/src/views/business/study/comp/ytbd/Xq.vue b/src/views/business/study/comp/ytbd/Xq.vue index 64de0b0..06d84ae 100644 --- a/src/views/business/study/comp/ytbd/Xq.vue +++ b/src/views/business/study/comp/ytbd/Xq.vue @@ -106,6 +106,7 @@ import { studyFormPre_tb, studyFormPre_info, studyFormPre_jcgj, studyFormPre_qmx import { mapGetters } from 'vuex' import JcgjList from "@/views/business/comps/common/JcgjList"; import TemplateTable from '@/views/business/comps/template/TemplateTable'; +import { caesarCipher } from "@/utils/index"; export default { name: "Xq", @@ -229,16 +230,18 @@ export default { if (valid) { this.$modal.loading() studyFormPre_tb(this.formApprove).then(response => { - let key = 'formFillReturnUrl' + response.data.studyId - localStorage.setItem(key, JSON.stringify({ - url: this.$route.fullPath + let params = caesarCipher(JSON.stringify({ + url: this.$route.fullPath, + studyId: this.form.studyId, + formId: response.data.id, + fromYt: true })) if (this.$route.fullPath.indexOf('/study/') > -1) { - this.$tab.openPage(response.data.bdmc, '/study/formFillBj/' + response.data.id + "/10/" + key + '/' + response.data.studyId) + this.$tab.openPage(response.data.bdmc, '/study/formFillBj/' + params) } else if (this.$route.fullPath.indexOf('/nonTrial/') > -1) { - this.$tab.openPage(response.data.bdmc, '/nonTrial/formFillBj/' + response.data.id + "/10/" + key + '/' + response.data.studyId) + this.$tab.openPage(response.data.bdmc, '/nonTrial/formFillBj/' + params) } else { - this.$tab.openPage(response.data.bdmc, '/drug/formFillBj/' + response.data.id + "/10/" + key + '/' + response.data.studyId) + this.$tab.openPage(response.data.bdmc, '/drug/formFillBj/' + params) } this.$emit('close') this.openApprove = false