diff --git a/src/api/global.js b/src/api/global.js index 6d0a4b58..a568bea3 100644 --- a/src/api/global.js +++ b/src/api/global.js @@ -14,17 +14,19 @@ export function getHospitalList() { }) } -export function getAllSponsorList() { +export function getAllSponsorList(params) { return request({ url: '/sponsor/getAllSponsorList', - method: 'get' + method: 'get', + params }) } -export function getAllCROList() { +export function getAllCROList(params) { return request({ url: '/cro/getAllCROList', - method: 'get' + method: 'get', + params }) } export function getAllSiteList() { diff --git a/src/main.js b/src/main.js index 6bab2a98..b2eae15e 100644 --- a/src/main.js +++ b/src/main.js @@ -24,7 +24,6 @@ Vue.use(VueClipboard) // import htmlToPdf from './utils/htmlToPdf' // Vue.use(htmlToPdf) import permission from './utils/permission' -import { OSSclient } from './utils/oss' Vue.use(permission) import Viewer from 'v-viewer' @@ -80,6 +79,7 @@ import DictTag from '@/components/DictTag' import DictData from '@/components/DictData' import { getBasicDataSelect } from '@/api/dictionary/dictionary' import { checkConfig } from '@/const/check/index' +import { getTrialBodyPartList } from "@/api/trials/setting"; // 全局方法挂载 var $q = params Vue.prototype.checkConfig = checkConfig @@ -181,6 +181,24 @@ async function VueInit() { zhMessages[v.Code] = v.ValueCN enMessages[v.Code] = v.Value }) + // 获取检查部位 + Vue.prototype.$getBodyPart = (id) => { + return new Promise(async (resolve, reject) => { + try { + let params = { + TrialId: id + } + let BodyPart = await getTrialBodyPartList(params) + if (BodyPart.IsSuccess) { + resolve(BodyPart.Result); + } else { + reject(BodyPart); + } + } catch (err) { + reject(err) + } + }) + } i18n.mergeLocaleMessage('zh', zhMessages) i18n.mergeLocaleMessage('en', enMessages) Vue.use(ElementUI, { @@ -210,15 +228,17 @@ async function VueInit() { return dictInfo }() Vue.prototype.$d = d - Vue.prototype.$fd = function (code, v, type) { + Vue.prototype.$fd = function (code, v, type, arr, key = 'label') { try { + let data = arr || d; + type = type || 'value'; + console.log(data,type,key,code) // code === 'YesOrNo' ? console.log(d) : '' - type = type || 'value' - return d[code].find(i => { + return data[code].find(i => { return i[type] === v - }) ? d[code].find(i => { + }) ? data[code].find(i => { return i[type] === v - }).label : '' + })[key] : '' } catch (e) { } } diff --git a/src/views/none-dicom-show/index.vue b/src/views/none-dicom-show/index.vue index 50502285..baab5ae2 100644 --- a/src/views/none-dicom-show/index.vue +++ b/src/views/none-dicom-show/index.vue @@ -96,7 +96,7 @@ export default { // 默认选择第一个文件 }, methods: { - getBodyPart(bodyPart) { + async getBodyPart(bodyPart) { if (!bodyPart) return '' var separator = ',' if (bodyPart.indexOf('|') > -1) { @@ -107,8 +107,9 @@ export default { separator = ',' } var arr = bodyPart.split(separator) + let bp = await this.$getBodyPart(this.$route.query.trialId) var newArr = arr.map(i => { - return this.$fd('Bodypart', i.trim()) + return this.$fd('Bodypart', i.trim(),'Code',{Bodypart:bp},'Name') }) return newArr.join(' | ') }, diff --git a/src/views/trials/trials-list/components/TrialForm.vue b/src/views/trials/trials-list/components/TrialForm.vue index 77ed1ba3..0727b0e8 100644 --- a/src/views/trials/trials-list/components/TrialForm.vue +++ b/src/views/trials/trials-list/components/TrialForm.vue @@ -17,7 +17,10 @@ :label="$t('trials:trials-list:form:trialId')" prop="TrialCode" > - +