From ebacc5bb1d612de7756cf548fc42bc7ea0a53e64 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Thu, 25 Apr 2024 11:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=861=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request-download.js | 36 +- src/views/system/notice/components/from.vue | 8 +- src/views/system/notice/index.vue | 14 +- .../trials-panel/reading/read-task/index.vue | 8 + .../reading/reading-tracking/index.vue | 15 +- .../subject/subject-list/index.vue | 11 +- .../trial-summary/audit-record/index.vue | 1949 +++++++++++------ .../trial-summary/trial-information/index.vue | 4 +- 8 files changed, 1362 insertions(+), 683 deletions(-) diff --git a/src/utils/request-download.js b/src/utils/request-download.js index d972d91..8d6b71d 100644 --- a/src/utils/request-download.js +++ b/src/utils/request-download.js @@ -14,8 +14,8 @@ service.interceptors.request.use( config => { config.headers['Content-Type'] = 'application/json;charset=UTF-8' var language = zzSessionStorage.getItem('lang') - config.headers['Accept-Language'] = language === 'en'?'en-US,en;q=0.5':'zh-CN,zh;q=0.9' - console.log(config.headers) + config.headers['Accept-Language'] = language === 'en' ? 'en-US,en;q=0.5' : 'zh-CN,zh;q=0.9' + // console.log(config.headers) if (store.getters.token) { config.headers.Authorization = `Bearer ${store.getters.token}` } @@ -30,14 +30,14 @@ service.interceptors.response.use( response => { const res = response.data let fileReader = new FileReader(); - fileReader.onload = function() { + fileReader.onload = function () { try { let jsonData = JSON.parse(fileReader.result); // 如果是普通对象数据,后台转换失败 if (!jsonData.IsSuccess && jsonData.ErrorMessage) { - MessageBox.confirm(jsonData.ErrorMessage, { + MessageBox.confirm(jsonData.ErrorMessage, { type: 'warning', showCancelButton: false, - callback: action => {} + callback: action => { } }) return Promise.reject(jsonData) } @@ -66,19 +66,19 @@ service.interceptors.response.use( if (error && error.response) { const status = error.response.status switch (status) { - case 400: message = store.state.lang.language === 'en'? 'Request error' : '请求错误'; break - case 401: message = store.state.lang.language === 'en'? 'Not authorized or login timed out. Please log in again.' : '未授权或登陆超时,请重新登录'; break + case 400: message = store.state.lang.language === 'en' ? 'Request error' : '请求错误'; break + case 401: message = store.state.lang.language === 'en' ? 'Not authorized or login timed out. Please log in again.' : '未授权或登陆超时,请重新登录'; break case 403: message = error.response.data.ErrorMessage; break - case 404: message = store.state.lang.language === 'en'? 'Request address error' : `请求地址出错`; break - case 405: message = store.state.lang.language === 'en'? 'Interface parameter error or request method inconsistency' : `接口参数传递错误,或者请求方法不一致`; break - case 408: message = store.state.lang.language === 'en'? 'Request timed out' : '请求超时'; break - case 429: message = store.state.lang.language === 'en'? 'The application service limits the traffic. Your requests are too frequent. Please try again later.' : '应用服务限流,您的请求过于频繁,请稍后再试'; break - case 500: message = store.state.lang.language === 'en'? 'Internal server error, and unable to complete the request. Software release might be in process. Please contact the administrator.' : '服务器内部错误,无法完成请求;可能正在发布中,请联系管理员处理'; break - case 501: message = store.state.lang.language === 'en'? 'Service has not been implemented.' : '服务未实现'; break - case 502: message = store.state.lang.language === 'en'? 'System is being upgraded. Please wait patiently.' : '系统正在升级,请耐心等待。'; break - case 503: message = store.state.lang.language === 'en'? 'Service is not available' : '服务不可用'; break - case 504: message = store.state.lang.language === 'en'? 'Gateway timed out' : '网关超时'; break - case 505: message = store.state.lang.language === 'en'? 'HTTP version is not supported' : 'HTTP版本不受支持'; break + case 404: message = store.state.lang.language === 'en' ? 'Request address error' : `请求地址出错`; break + case 405: message = store.state.lang.language === 'en' ? 'Interface parameter error or request method inconsistency' : `接口参数传递错误,或者请求方法不一致`; break + case 408: message = store.state.lang.language === 'en' ? 'Request timed out' : '请求超时'; break + case 429: message = store.state.lang.language === 'en' ? 'The application service limits the traffic. Your requests are too frequent. Please try again later.' : '应用服务限流,您的请求过于频繁,请稍后再试'; break + case 500: message = store.state.lang.language === 'en' ? 'Internal server error, and unable to complete the request. Software release might be in process. Please contact the administrator.' : '服务器内部错误,无法完成请求;可能正在发布中,请联系管理员处理'; break + case 501: message = store.state.lang.language === 'en' ? 'Service has not been implemented.' : '服务未实现'; break + case 502: message = store.state.lang.language === 'en' ? 'System is being upgraded. Please wait patiently.' : '系统正在升级,请耐心等待。'; break + case 503: message = store.state.lang.language === 'en' ? 'Service is not available' : '服务不可用'; break + case 504: message = store.state.lang.language === 'en' ? 'Gateway timed out' : '网关超时'; break + case 505: message = store.state.lang.language === 'en' ? 'HTTP version is not supported' : 'HTTP版本不受支持'; break default: break } if (error.response.status === 401) { @@ -100,7 +100,7 @@ service.interceptors.response.use( type: 'warning', showCancelButton: false, confirmButtonText: '确定', - callback: action => {} + callback: action => { } }) } } diff --git a/src/views/system/notice/components/from.vue b/src/views/system/notice/components/from.vue index 5d49ac0..0ba0ab6 100644 --- a/src/views/system/notice/components/from.vue +++ b/src/views/system/notice/components/from.vue @@ -62,10 +62,10 @@ size="small" > diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 1f73ba5..ff74a65 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -60,10 +60,10 @@ size="small" > @@ -438,7 +438,11 @@ export default { getUserTypeRoleList() { getUserTypeRoleList({}) .then((res) => { - this.roleList = res.Result; + this.roleList = res.Result.map((item) => { + if ([4, 5, 8, 9, 12, 14].includes(item.UserTypeEnum)) { + return item; + } + }).filter((item) => item); }) .catch(() => {}); }, diff --git a/src/views/trials/trials-panel/reading/read-task/index.vue b/src/views/trials/trials-panel/reading/read-task/index.vue index c2bb017..727e6aa 100644 --- a/src/views/trials/trials-panel/reading/read-task/index.vue +++ b/src/views/trials/trials-panel/reading/read-task/index.vue @@ -150,6 +150,14 @@ sortable="custom" show-overflow-tooltip /> + + - + + + - + @@ -318,6 +318,7 @@ import patientStudyList from "./components/patient-study-list.vue"; // import confirmVisitList from "../../../trials-inspection/components/confirm-visit-list.vue"; const searchDataDefault = () => { return { + PatientIdStr: null, Code: "", Status: "", Sex: "", diff --git a/src/views/trials/trials-panel/trial-summary/audit-record/index.vue b/src/views/trials/trials-panel/trial-summary/audit-record/index.vue index 2d02366..23263d1 100644 --- a/src/views/trials/trials-panel/trial-summary/audit-record/index.vue +++ b/src/views/trials/trials-panel/trial-summary/audit-record/index.vue @@ -3,107 +3,145 @@ @@ -758,22 +1226,28 @@ import { getTrialSiteSelect, getTrialVisitStageSelect, - getTrialCriterionList -} from '@/api/trials' -import { getInspectionList, getInspectionJsonDataList } from '@/api/trials/inspection' -import { getFrontAuditConfigList, getAuditConfigChildList, getModuleTypeDescriptionList, setInspectionEnumValue } from '@/api/dictionary/checkConfig' -import Pagination from '@/components/Pagination' -import BaseContainer from '@/components/BaseContainer' -import BaseModel from '@/components/BaseModel' -import { getToken } from '@/utils/auth' + getTrialCriterionList, +} from "@/api/trials"; +import { + getInspectionList, + getInspectionJsonDataList, +} from "@/api/trials/inspection"; +import { + getAuditConfigChildList, + getModuleTypeDescriptionList, +} from "@/api/dictionary/checkConfig"; +import Pagination from "@/components/Pagination"; +import BaseContainer from "@/components/BaseContainer"; +import BaseModel from "@/components/BaseModel"; +import { getToken } from "@/utils/auth"; export default { components: { BaseContainer, Pagination, BaseModel }, - dicts: ['OptType', 'ModuleType', 'ChildrenType'], + dicts: ["OptType", "ModuleType", "ChildrenType"], data() { const searchDataDefault = () => { return { - SortField: 'CreateTime', + SortField: "TrialReadingCriterionName", Asc: false, PageIndex: 1, PageSize: 20, @@ -795,16 +1269,40 @@ export default { OpByUserName: null, BatchId: null, TrialReadingCriterionId: null, - RoleName:null - } - } + RoleName: null, + }; + }; return { isViewer: true, - otherData:[], - model_cfg: { visible: false, showClose: true, width: '600px', title: '', appendToBody: true }, - model_cfg2: { visible: false, showClose: true, width: '1000px', title: this.$t('trials:auditRecord:title:viewRelationOperations'), appendToBody: true },//'查看关联操作' - model_cfg3: { visible: false, showClose: true, width: '600px', title: '', appendToBody: true }, - model_cfg4: { visible: false, showClose: true, width: '600px', title: this.$t('trials:auditRecord:title:viewImage'), appendToBody: true },//查看图片 + otherData: [], + model_cfg: { + visible: false, + showClose: true, + width: "600px", + title: "", + appendToBody: true, + }, + model_cfg2: { + visible: false, + showClose: true, + width: "1000px", + title: this.$t("trials:auditRecord:title:viewRelationOperations"), + appendToBody: true, + }, //'查看关联操作' + model_cfg3: { + visible: false, + showClose: true, + width: "600px", + title: "", + appendToBody: true, + }, + model_cfg4: { + visible: false, + showClose: true, + width: "600px", + title: this.$t("trials:auditRecord:title:viewImage"), + appendToBody: true, + }, //查看图片 total: 0, loading: false, searchData: searchDataDefault(), @@ -828,418 +1326,579 @@ export default { trialCriterionList: [], openImageUrl: null, $viewer: null, - imagesList: [] - } + imagesList: [], + }; }, mounted() { - this.ResearchProgramNo = this.$route.query.researchProgramNo - this.getSite() - this.getVisitPlanOptions() - this.getTrialCriterionList() - this.getList() + this.ResearchProgramNo = this.$route.query.researchProgramNo; + this.getSite(); + this.getVisitPlanOptions(); + this.getTrialCriterionList(); + this.getList(); }, methods: { openImage(url) { - console.log(url) - - this.$nextTick(()=>{ + console.log(url); + + this.$nextTick(() => { if (url instanceof Array) { - this.imagesList = url.map(v => this.OSSclientConfig.basePath + v) + this.imagesList = url.map((v) => this.OSSclientConfig.basePath + v); } else { - this.imagesList = [this.OSSclientConfig.basePath + url] + this.imagesList = [this.OSSclientConfig.basePath + url]; } - if(this.$refs[url][0]) { - this.$refs[url][0].$viewer.show() + if (this.$refs[url][0]) { + this.$refs[url][0].$viewer.show(); } else { - this.$refs[url].$viewer.show() + this.$refs[url].$viewer.show(); } - }) + }); }, getTrialCriterionList() { - getTrialCriterionList(this.trialId, false).then(res => { - this.trialCriterionList = res.Result - }).catch(() => {}) + getTrialCriterionList(this.trialId, false) + .then((res) => { + this.trialCriterionList = res.Result; + }) + .catch(() => {}); }, handleSortChange(column) { - if (column.order === 'ascending') { - this.searchData.Asc = true + if (column.order === "ascending") { + this.searchData.Asc = true; } else { - this.searchData.Asc = false + this.searchData.Asc = false; } - this.searchData.SortField = column.prop - this.searchData.PageIndex = 1 - this.getList() + this.searchData.SortField = column.prop; + this.searchData.PageIndex = 1; + this.getList(); }, changeTimeList() { if (this.timeList) { - this.searchData.StartTime = this.timeList[0] - this.searchData.EndTime = this.timeList[1] + this.searchData.StartTime = this.timeList[0]; + this.searchData.EndTime = this.timeList[1]; } else { - this.searchData.StartTime = null - this.searchData.EndTime = null + this.searchData.StartTime = null; + this.searchData.EndTime = null; } - }, getModuleTypeDescriptionList(v) { - this.searchData.Description = null - getModuleTypeDescriptionList( v ).then(res => { - this.DescriptionOptions = res.Result - }) + this.searchData.Description = null; + getModuleTypeDescriptionList(v).then((res) => { + this.DescriptionOptions = res.Result; + }); }, // 获取site下拉框数据 getSite() { - getTrialSiteSelect(this.trialId).then(res => { - this.siteOptions = res.Result - }) + getTrialSiteSelect(this.trialId).then((res) => { + this.siteOptions = res.Result; + }); }, // 获取访视下拉框数据 getVisitPlanOptions() { - getTrialVisitStageSelect(this.trialId) - .then((res) => { - this.visitPlanOptions = res.Result - }) + getTrialVisitStageSelect(this.trialId).then((res) => { + this.visitPlanOptions = res.Result; + }); }, toTree(arr, ParentId) { function loop(ParentId) { - const res = [] + const res = []; for (let i = 0; i < arr.length; i++) { - const item = arr[i] - item.hasChildren = false + const item = arr[i]; + item.hasChildren = false; if (item.ParentId !== ParentId) { - continue + continue; } - item.Children = loop(item.Id) - res.push(item) + item.Children = loop(item.Id); + res.push(item); } - return res + return res; } - return loop(ParentId) + return loop(ParentId); }, formatting(config, obj, upObj, parentRow, row, auditData) { - this.tableList = [] - this.tableListData = [] - this[auditData] = [] - config.forEach(v => { - var item - if (!v.IsEnable) return + this.tableList = []; + this.tableListData = []; + this[auditData] = []; + config.forEach((v) => { + var item; + if (!v.IsEnable) return; if (v.IsShowByTrialConfig) { - if (!parentRow[v.TrialConfigRelyFieldName]) return + if (!parentRow[v.TrialConfigRelyFieldName]) return; } if (v.IsTableFiled) { if (obj[v.TableFiledName] && obj[v.TableFiledName].length > 0) { obj[v.TableFiledName].forEach((o, i) => { - let uo = upObj[v.TableFiledName][i] - if (row.OptType === 'Add' || row.OptType === 'Init') { + let uo = upObj[v.TableFiledName][i]; + if (row.OptType === "Add" || row.OptType === "Init") { item = { - newValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : '--') : '--', - oldValue: '' - } - } else if (row.OptType === 'Delete') { + newValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : "--") : "--", + oldValue: "", + }; + } else if (row.OptType === "Delete") { item = { - oldValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : '--') : '--', - newValue: '--' - } + oldValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : "--") : "--", + newValue: "--", + }; } else { item = { - newValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : '--') : '--', - oldValue: uo ? uo[v.Code] : '--' - } + newValue: o[v.Code] ? (o[v.Code] ? o[v.Code] : "--") : "--", + oldValue: uo ? uo[v.Code] : "--", + }; } - item.key = o ? ((o[v.Code] && o[v.Code] !== null && o[v.Code] !== '' || o[v.Code] !== 0) ? o[v.Code] : '--') : '--' - item.Enum = v.ValueCN - item.DataType = v.DataType - item.IsTableFiled = v.IsTableFiled - this[auditData].push(item) - }) + item.key = o + ? (o[v.Code] && o[v.Code] !== null && o[v.Code] !== "") || + o[v.Code] !== 0 + ? o[v.Code] + : "--" + : "--"; + item.Enum = v.ValueCN; + item.DataType = v.DataType; + item.IsTableFiled = v.IsTableFiled; + this[auditData].push(item); + }); } - return + return; } - if (v.DataType === 'ImageList') { + if (v.DataType === "ImageList") { if (obj[v.Code] && obj[v.Code].length > 0) { // obj[v.Code].forEach((o,i) => { // var uo = upObj && upObj.length > 0 ? upObj[v.Code][i] : 0 - if (row.OptType === 'Add' || row.OptType === 'Init') { + if (row.OptType === "Add" || row.OptType === "Init") { item = { key: v.Code, Enum: v.ValueCN, - newValue: obj[v.Code] ? obj[v.Code] : '--', - oldValue: '' - } - } else if (row.OptType === 'Delete') { + newValue: obj[v.Code] ? obj[v.Code] : "--", + oldValue: "", + }; + } else if (row.OptType === "Delete") { item = { key: v.Code, Enum: v.ValueCN, - oldValue: obj[v.Code] ? obj[v.Code] : '--', - newValue: '--' - } + oldValue: obj[v.Code] ? obj[v.Code] : "--", + newValue: "--", + }; } else { item = { key: v.Code, Enum: v.ValueCN, - newValue: obj[v.Code] ? obj[v.Code] : '--', - oldValue: upObj[v.Code] ? upObj[v.Code] : '--' - } + newValue: obj[v.Code] ? obj[v.Code] : "--", + oldValue: upObj[v.Code] ? upObj[v.Code] : "--", + }; } - item.DataType = v.DataType - this[auditData].push(item) - // }) + item.DataType = v.DataType; + this[auditData].push(item); + // }) } - return + return; } - if (v.DataType === 'Array' || v.DataType === 'array') { + if (v.DataType === "Array" || v.DataType === "array") { if (obj[v.Code] && obj[v.Code].length > 0) { obj[v.Code].forEach((o) => { - var uo = upObj ? upObj[v.Code].find(u => u[v.ChildDataLabel] == o[v.ChildDataLabel]) : null - if (row.OptType === 'Add' || row.OptType === 'Init') { + var uo = upObj + ? upObj[v.Code].find( + (u) => u[v.ChildDataLabel] == o[v.ChildDataLabel] + ) + : null; + if (row.OptType === "Add" || row.OptType === "Init") { item = { key: o[v.ChildDataLabel], Enum: o[v.ChildDataLabel], - newValue: o[v.ChildDataValue] ? (o[v.ChildDataValue] ? o[v.ChildDataValue] : '--') : '--', - oldValue: '' - } - } else if (row.OptType === 'Delete') { + newValue: o[v.ChildDataValue] + ? o[v.ChildDataValue] + ? o[v.ChildDataValue] + : "--" + : "--", + oldValue: "", + }; + } else if (row.OptType === "Delete") { item = { key: o[v.ChildDataLabel], Enum: o[v.ChildDataLabel], - oldValue: o[v.ChildDataValue] ? (o[v.ChildDataValue] ? o[v.ChildDataValue] : '--') : '--', - newValue: '--' - } + oldValue: o[v.ChildDataValue] + ? o[v.ChildDataValue] + ? o[v.ChildDataValue] + : "--" + : "--", + newValue: "--", + }; } else { item = { key: o[v.ChildDataLabel], Enum: o[v.ChildDataLabel], - newValue: o[v.ChildDataValue] ? (o[v.ChildDataValue] ? o[v.ChildDataValue] : '--') : '--', - oldValue: uo ? uo[v.ChildDataValue] : '--' - } + newValue: o[v.ChildDataValue] + ? o[v.ChildDataValue] + ? o[v.ChildDataValue] + : "--" + : "--", + oldValue: uo ? uo[v.ChildDataValue] : "--", + }; } - this[auditData].push(item) - }) + this[auditData].push(item); + }); } - return + return; } - if (v.DataType === 'Router') { + if (v.DataType === "Router") { item = { - oldValue: v.UrlConfig.IsHaveParameters ? v.UrlConfig.RoutePath + '?' + - v.UrlConfig.ParameterList.map((v) => { - let a = obj[v.UrlParameterValueName] ? obj[v.UrlParameterValueName] : parentRow[v.UrlParameterValueName] - if (v.UrlParameterValueName === 'token') { - a = getToken() - } - return v.UrlParameterName + '=' + a + '&' - }).toString().replaceAll(',', '') : v.UrlConfig.RoutePath, - newValue: v.UrlConfig.IsHaveParameters ? v.UrlConfig.RoutePath + '?' + - v.UrlConfig.ParameterList.map((v) => { - let a = obj[v.UrlParameterValueName] ? obj[v.UrlParameterValueName] : parentRow[v.UrlParameterValueName] - if (v.UrlParameterValueName === 'token') { - a = getToken() - } - return v.UrlParameterName + '=' + a + '&' - }).toString().replaceAll(',', '') : v.UrlConfig.RoutePath - } - console.log(item) - item.IsTableFiled = v.IsTableFiled - item.DataType = v.DataType - item.key = v.Code - item.Enum = v.ValueCN - this[auditData].push(item) - return + oldValue: v.UrlConfig.IsHaveParameters + ? v.UrlConfig.RoutePath + + "?" + + v.UrlConfig.ParameterList.map((v) => { + let a = obj[v.UrlParameterValueName] + ? obj[v.UrlParameterValueName] + : parentRow[v.UrlParameterValueName]; + if (v.UrlParameterValueName === "token") { + a = getToken(); + } + return v.UrlParameterName + "=" + a + "&"; + }) + .toString() + .replaceAll(",", "") + : v.UrlConfig.RoutePath, + newValue: v.UrlConfig.IsHaveParameters + ? v.UrlConfig.RoutePath + + "?" + + v.UrlConfig.ParameterList.map((v) => { + let a = obj[v.UrlParameterValueName] + ? obj[v.UrlParameterValueName] + : parentRow[v.UrlParameterValueName]; + if (v.UrlParameterValueName === "token") { + a = getToken(); + } + return v.UrlParameterName + "=" + a + "&"; + }) + .toString() + .replaceAll(",", "") + : v.UrlConfig.RoutePath, + }; + console.log(item); + item.IsTableFiled = v.IsTableFiled; + item.DataType = v.DataType; + item.key = v.Code; + item.Enum = v.ValueCN; + this[auditData].push(item); + return; } - if (v.DataType === 'Table') { - var head = [] - var body = [] + if (v.DataType === "Table") { + var head = []; + var body = []; v.TableConfigList.forEach((j, i) => { if (j.IsFixedColumn) { - head.push({IsPicture: j.IsPicture, headName: j.FixedColumnName, IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? j.MergeColumnName : null, ChildrenList: []}) + head.push({ + IsPicture: j.IsPicture, + headName: j.FixedColumnName, + IsMerge: j.IsMerge, + ColumnName: j.ColumnName, + ColumnValue: j.ColumnValue, + ListName: j.ListName, + MergeColumnName: j.IsMerge ? j.MergeColumnName : null, + ChildrenList: [], + }); } else { if (j.ListName) { obj[v.Code][0][j.ListName].forEach((x, o) => { - head.push({IsPicture: j.IsPicture, headName: x[j.ColumnName], IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? j.MergeColumnName : null, ChildrenList: []}) - }) + head.push({ + IsPicture: j.IsPicture, + headName: x[j.ColumnName], + IsMerge: j.IsMerge, + ColumnName: j.ColumnName, + ColumnValue: j.ColumnValue, + ListName: j.ListName, + MergeColumnName: j.IsMerge ? j.MergeColumnName : null, + ChildrenList: [], + }); + }); } else { - head.push({IsPicture: j.IsPicture, headName: j.ColumnName, IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? j.MergeColumnName : null, ChildrenList: []}) + head.push({ + IsPicture: j.IsPicture, + headName: j.ColumnName, + IsMerge: j.IsMerge, + ColumnName: j.ColumnName, + ColumnValue: j.ColumnValue, + ListName: j.ListName, + MergeColumnName: j.IsMerge ? j.MergeColumnName : null, + ChildrenList: [], + }); } } - }) + }); obj[v.Code].forEach((o, i) => { - var b = {} + var b = {}; v.TableConfigList.forEach((j) => { if (j.ListName) { o[j.ListName].forEach((ite, i) => { - b[j.ListName + j.ColumnValue + i] = ite[j.ColumnValue] - }) + b[j.ListName + j.ColumnValue + i] = ite[j.ColumnValue]; + }); } else { - b[j.ColumnValue] = o[j.ColumnValue] + b[j.ColumnValue] = o[j.ColumnValue]; } - }) - body.push(Object.assign({}, b)) - }) - var newHead = [] - var h = JSON.parse(JSON.stringify(head)) - h.forEach(j => { + }); + body.push(Object.assign({}, b)); + }); + var newHead = []; + var h = JSON.parse(JSON.stringify(head)); + h.forEach((j) => { if (j.IsMerge) { - var hasChildren = h.filter(o => { - return o.MergeColumnName === j.MergeColumnName - }) - console.log(hasChildren) + var hasChildren = h.filter((o) => { + return o.MergeColumnName === j.MergeColumnName; + }); + console.log(hasChildren); if (!!hasChildren) { - j.ChildrenList = Object.assign([], hasChildren) - var has = newHead.find(v => { - return v.MergeColumnName === j.MergeColumnName - }) + j.ChildrenList = Object.assign([], hasChildren); + var has = newHead.find((v) => { + return v.MergeColumnName === j.MergeColumnName; + }); if (!has) { - newHead.push(j) + newHead.push(j); } } else { } } else { - newHead.push(j) + newHead.push(j); } - }) - console.log(newHead, body) - this.tableList = newHead - this.tableListData = body - return + }); + console.log(newHead, body); + this.tableList = newHead; + this.tableListData = body; + return; } if (v.IsShowParent === 1) { - if (row.OptType === 'Delete') { + if (row.OptType === "Delete") { item = { // oldValue: parentRow ? (parentRow[v.Code] ? parentRow[v.Code] : '--') : '--', - oldValue: parentRow ? ((parentRow[v.Code] && parentRow[v.Code] !== null && parentRow[v.Code] !== '' || parentRow[v.Code] === 0) ? parentRow[v.Code] : '--') : '--', - newValue: '--' - } - } else if (row.OptType === 'Add' || row.OptType === 'Init') { + oldValue: parentRow + ? (parentRow[v.Code] && + parentRow[v.Code] !== null && + parentRow[v.Code] !== "") || + parentRow[v.Code] === 0 + ? parentRow[v.Code] + : "--" + : "--", + newValue: "--", + }; + } else if (row.OptType === "Add" || row.OptType === "Init") { item = { // newValue: parentRow ? (parentRow[v.Code] ? parentRow[v.Code] : '--') : '--', - newValue: parentRow ? ((parentRow[v.Code] && parentRow[v.Code] !== null && parentRow[v.Code] !== '' || parentRow[v.Code] === 0) ? parentRow[v.Code] : '--') : '--', - oldValue: '--' - } + newValue: parentRow + ? (parentRow[v.Code] && + parentRow[v.Code] !== null && + parentRow[v.Code] !== "") || + parentRow[v.Code] === 0 + ? parentRow[v.Code] + : "--" + : "--", + oldValue: "--", + }; } else { item = { // newValue: parentRow ? (parentRow[v.Code] ? parentRow[v.Code] : '--') : '--', - newValue: parentRow ? ((parentRow[v.Code] && parentRow[v.Code] !== null && parentRow[v.Code] !== '' || parentRow[v.Code] === 0) ? parentRow[v.Code] : '--') : '--', - oldValue: parentRow ? ((parentRow[v.Code] && parentRow[v.Code] !== null && parentRow[v.Code] !== '' || parentRow[v.Code] === 0) ? parentRow[v.Code] : '--') : '--', + newValue: parentRow + ? (parentRow[v.Code] && + parentRow[v.Code] !== null && + parentRow[v.Code] !== "") || + parentRow[v.Code] === 0 + ? parentRow[v.Code] + : "--" + : "--", + oldValue: parentRow + ? (parentRow[v.Code] && + parentRow[v.Code] !== null && + parentRow[v.Code] !== "") || + parentRow[v.Code] === 0 + ? parentRow[v.Code] + : "--" + : "--", // oldValue: parentRow ? (parentRow[v.Code] ? parentRow[v.Code] : '--') : '--' - } + }; } - console.log(item, '1') + console.log(item, "1"); } else if (v.IsShowParent === 0) { - if (row.OptType === 'Delete') { + if (row.OptType === "Delete") { item = { - oldValue: obj ? ((obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== '' || obj[v.Code] === 0) ? obj[v.Code] : '--') : '--', - newValue: '--' - } - } else if (row.OptType === 'Add' || row.OptType === 'Init') { + oldValue: obj + ? (obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== "") || + obj[v.Code] === 0 + ? obj[v.Code] + : "--" + : "--", + newValue: "--", + }; + } else if (row.OptType === "Add" || row.OptType === "Init") { item = { - newValue: obj ? ((obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== '' || obj[v.Code] === 0) ? obj[v.Code] : '--') : '--', - oldValue: '--' - } + newValue: obj + ? (obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== "") || + obj[v.Code] === 0 + ? obj[v.Code] + : "--" + : "--", + oldValue: "--", + }; } else { item = { - newValue: obj ? ((obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== '' || obj[v.Code] === 0) ? obj[v.Code] : '--') : '--', - oldValue: upObj ? ((upObj[v.Code] && upObj[v.Code] !== null && upObj[v.Code] !== '' || upObj[v.Code] === 0) ? upObj[v.Code] : '--') : '--' - } + newValue: obj + ? (obj[v.Code] && obj[v.Code] !== null && obj[v.Code] !== "") || + obj[v.Code] === 0 + ? obj[v.Code] + : "--" + : "--", + oldValue: upObj + ? (upObj[v.Code] && + upObj[v.Code] !== null && + upObj[v.Code] !== "") || + upObj[v.Code] === 0 + ? upObj[v.Code] + : "--" + : "--", + }; } } else { - if (row.OptType === 'Delete') { + if (row.OptType === "Delete") { item = { - oldValue: row ? ((row[v.Code] && row[v.Code] !== null && row[v.Code] !== '' || row[v.Code] === 0) ? row[v.Code] : '--') : '--', - newValue: '--' - } - } else if (row.OptType === 'Add' || row.OptType === 'Init') { + oldValue: row + ? (row[v.Code] && row[v.Code] !== null && row[v.Code] !== "") || + row[v.Code] === 0 + ? row[v.Code] + : "--" + : "--", + newValue: "--", + }; + } else if (row.OptType === "Add" || row.OptType === "Init") { item = { - newValue: row ? ((row[v.Code] && row[v.Code] !== null && row[v.Code] !== '' || row[v.Code] === 0) ? row[v.Code] : '--') : '--', - oldValue: '--' - } + newValue: row + ? (row[v.Code] && row[v.Code] !== null && row[v.Code] !== "") || + row[v.Code] === 0 + ? row[v.Code] + : "--" + : "--", + oldValue: "--", + }; } else { item = { - newValue: row ? ((row[v.Code] && row[v.Code] !== null && row[v.Code] !== '' || row[v.Code] === 0) ? row[v.Code] : '--') : '--', - oldValue: row ? ((row[v.Code] && row[v.Code] !== null && row[v.Code] !== '' || row[v.Code] === 0) ? row[v.Code] : '--') : '--' - } + newValue: row + ? (row[v.Code] && row[v.Code] !== null && row[v.Code] !== "") || + row[v.Code] === 0 + ? row[v.Code] + : "--" + : "--", + oldValue: row + ? (row[v.Code] && row[v.Code] !== null && row[v.Code] !== "") || + row[v.Code] === 0 + ? row[v.Code] + : "--" + : "--", + }; } } - item.DataType = v.DataType - item.key = v.Code - item.Enum = this.$i18n.locale === 'zh' ? v.ValueCN : v.Value - this[auditData].push(item) - }) - console.log(this[auditData],this.tableListData,this.tableList) + item.DataType = v.DataType; + item.key = v.Code; + item.Enum = this.$i18n.locale === "zh" ? v.ValueCN : v.Value; + this[auditData].push(item); + }); + console.log(this[auditData], this.tableListData, this.tableList); }, getJSON(row) { - return new Promise(resolve => { - getInspectionJsonDataList(this.trialId, row.Id).then(res => { - resolve(res.Result) - }) - }) + return new Promise((resolve) => { + getInspectionJsonDataList(this.trialId, row.Id).then((res) => { + resolve(res.Result); + }); + }); }, lookAssociated(n) { - var searchData = Object.assign({}, { - SortField: '', - Asc: true, - PageIndex: 1, - PageSize: 20, - TrialId: this.$route.query.trialId, - BatchId: !n ? this.currentRow.BatchId : null, - ObjectRelationParentId: n ? this.currentRow.ObjectRelationParentId : null, - RelationDeadlineTime: n ? this.currentRow.CreateTime : null, - GeneralId: n ? this.currentRow.GeneralId : null - }) + var searchData = Object.assign( + {}, + { + SortField: "", + Asc: true, + PageIndex: 1, + PageSize: 20, + TrialId: this.$route.query.trialId, + BatchId: !n ? this.currentRow.BatchId : null, + ObjectRelationParentId: n + ? this.currentRow.ObjectRelationParentId + : null, + RelationDeadlineTime: n ? this.currentRow.CreateTime : null, + GeneralId: n ? this.currentRow.GeneralId : null, + } + ); // 查看关联操作 - this.model_cfg2.title = `${this.$t('trials:auditRecord:title:viewRelationOperations')}--${this.$i18n.locale === 'en' ? this.currentRow.Description : this.currentRow.DescriptionCN}` - this.loading = true - getInspectionList(searchData).then((res) => { - this.list2 = res.CurrentPageData - this.model_cfg2.visible = true - this.loading = false - }).catch(() => { - this.loading = false - }) + this.model_cfg2.title = `${this.$t( + "trials:auditRecord:title:viewRelationOperations" + )}--${ + this.$i18n.locale === "en" + ? this.currentRow.Description + : this.currentRow.DescriptionCN + }`; + this.loading = true; + getInspectionList(searchData) + .then((res) => { + this.list2 = res.CurrentPageData; + this.model_cfg2.visible = true; + this.loading = false; + }) + .catch(() => { + this.loading = false; + }); }, async lookDetails2(row) { - var Json = await this.getJSON(row) - var JsonDetail = Json[0] ? JSON.parse(Json[0]) : null - var ParentJson = Json[1] ? JSON.parse(Json[1]) : null - getAuditConfigChildList(row.FrontAuditConfigId).then(res => { - console.log(res) - var configList2 = res.Result - this.formatting(configList2, JsonDetail.Data, ParentJson ? ParentJson.Data : null, JsonDetail.CommonData, row, 'auditData2') - this.otherData2 = [] + var Json = await this.getJSON(row); + var JsonDetail = Json[0] ? JSON.parse(Json[0]) : null; + var ParentJson = Json[1] ? JSON.parse(Json[1]) : null; + getAuditConfigChildList(row.FrontAuditConfigId).then((res) => { + console.log(res); + var configList2 = res.Result; + this.formatting( + configList2, + JsonDetail.Data, + ParentJson ? ParentJson.Data : null, + JsonDetail.CommonData, + row, + "auditData2" + ); + this.otherData2 = []; if (row.IsSign) { // 签名信息 this.otherData2.push({ - Enum: this.$t('trials:auditRecord:title:signInfo2'), - Value: row.SignText - }) + Enum: this.$t("trials:auditRecord:title:signInfo2"), + Value: row.SignText, + }); } - this.model_cfg3.title = this.$i18n.locale === 'en' ? row.Description : row.DescriptionCN - this.model_cfg3.visible = true - }) + this.model_cfg3.title = + this.$i18n.locale === "en" ? row.Description : row.DescriptionCN; + this.model_cfg3.visible = true; + }); }, async lookDetails(row) { - this.currentRow = {...row} - this.OptType = row.OptType - var Json = await this.getJSON(row) - var JsonDetail = Json[0] ? JSON.parse(Json[0]) : null - var ParentJson = Json[1] ? JSON.parse(Json[1]) : null - getAuditConfigChildList(row.FrontAuditConfigId).then(res => { - console.log(res) - var configList = res.Result - this.formatting(configList, JsonDetail.Data, ParentJson ? ParentJson.Data : null, JsonDetail.CommonData, row, 'auditData') - this.otherData = [] + this.currentRow = { ...row }; + this.OptType = row.OptType; + var Json = await this.getJSON(row); + var JsonDetail = Json[0] ? JSON.parse(Json[0]) : null; + var ParentJson = Json[1] ? JSON.parse(Json[1]) : null; + getAuditConfigChildList(row.FrontAuditConfigId).then((res) => { + console.log(res); + var configList = res.Result; + this.formatting( + configList, + JsonDetail.Data, + ParentJson ? ParentJson.Data : null, + JsonDetail.CommonData, + row, + "auditData" + ); + this.otherData = []; if (row.IsSign) { - console.log(row.SignText) + console.log(row.SignText); this.otherData.push({ - Enum: this.$t('trials:auditRecord:title:signInfo2'),//'签名信息' - Value: row.SignText - }) + Enum: this.$t("trials:auditRecord:title:signInfo2"), //'签名信息' + Value: row.SignText, + }); } - this.model_cfg.title = this.$i18n.locale === 'en' ? row.Description : row.DescriptionCN - this.model_cfg.visible = true - }) + this.model_cfg.title = + this.$i18n.locale === "en" ? row.Description : row.DescriptionCN; + this.model_cfg.visible = true; + }); }, handleReset() { this.searchData = Object.assign(this.searchData, { - SortField: '', + SortField: "", Asc: false, PageIndex: 1, PageSize: 20, @@ -1260,32 +1919,34 @@ export default { Description: null, OpByUserName: null, BatchId: null, - RoleName: null - }) - this.timeList = [] - this.getList() + RoleName: null, + }); + this.timeList = []; + this.getList(); }, handleSearch() { - this.searchData.PageIndex = 1 - this.getList() + this.searchData.PageIndex = 1; + this.getList(); }, getList() { - this.loading = true - getInspectionList(this.searchData).then((res) => { - this.list = res.CurrentPageData - // this.list = this.list.map(v => { - // v.OptType = v.OptTypeName - // return v - // }) - this.total = res.TotalCount - this.model_cfg.visible = false - this.loading = false - this.searchData.BatchId = null - }).catch(() => { - this.loading = false - }) - } - } -} + this.loading = true; + getInspectionList(this.searchData) + .then((res) => { + this.list = res.CurrentPageData; + // this.list = this.list.map(v => { + // v.OptType = v.OptTypeName + // return v + // }) + this.total = res.TotalCount; + this.model_cfg.visible = false; + this.loading = false; + this.searchData.BatchId = null; + }) + .catch(() => { + this.loading = false; + }); + }, + }, +}; diff --git a/src/views/trials/trials-panel/trial-summary/trial-information/index.vue b/src/views/trials/trials-panel/trial-summary/trial-information/index.vue index 5d1a3e0..c86f9e7 100644 --- a/src/views/trials/trials-panel/trial-summary/trial-information/index.vue +++ b/src/views/trials/trials-panel/trial-summary/trial-information/index.vue @@ -116,13 +116,13 @@ - {{ trialInfo.AuthorizationDate }} + {{ otherInfo.ActiveTime }} - {{ trialInfo.AuthorizationDate }} + {{ otherInfo.AuthorizationDeadLineDate }}