From 7c6b010fe15d8cc3ea4f439e45d4137370a3621e Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Thu, 21 Nov 2024 09:59:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trial-summary/audit-record/index.vue | 2148 ++++++----------- 1 file changed, 743 insertions(+), 1405 deletions(-) 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 7a5a34c..baaaae8 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,142 +3,125 @@ - - + + - - - - - - - - - - + + + + + + + + + + @@ -1232,86 +811,55 @@ import { getTrialSiteSelect, getTrialVisitStageSelect, - 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"; -import { getUserTypeListByUserType } from "@/api/admin"; + 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' +const searchDataDefault = () => { + return { + SortField: 'CreateTime', + Asc: false, + PageIndex: 1, + PageSize: 20, + ModuleType: null, + BlindName: null, + TrialId: '', + TrialSiteId: null, + SubjectId: null, + SubjectInfo: null, + SubjectVisitId: null, + VisitPlanInfo: null, + OptType: null, + ChildrenType: null, + Reason: null, + IsSign: null, + StartTime: null, + EndTime: null, + Description: null, + OpByUserName: null, + BatchId: null, + TrialReadingCriterionId: null, + RoleName:null, + TaskName: '', + CreateUserRealName: '' + } +} export default { components: { BaseContainer, Pagination, BaseModel }, - dicts: ["OptType", "ModuleType", "ChildrenType"], + dicts: ['OptType', 'ModuleType', 'ChildrenType'], data() { - const searchDataDefault = () => { - return { - SortField: "CreateTime", - Asc: false, - PageIndex: 1, - PageSize: 20, - ModuleType: null, - BlindName: null, - TrialId: this.$route.query.trialId, - SiteId: null, - SubjectId: null, - SubjectInfo: null, - SubjectVisitId: null, - VisitPlanInfo: null, - OptType: null, - ChildrenType: null, - Reason: null, - IsSign: null, - StartTime: null, - EndTime: null, - Description: null, - OpByUserName: null, - BatchId: null, - TrialReadingCriterionId: null, - UserTypeId: null, - VisitName: null, - SubjectCode: null, - }; - }; + return { - userTypeOptions: [], 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(), @@ -1336,658 +884,448 @@ export default { trialCriterionList: [], openImageUrl: null, $viewer: null, - imagesList: [], - }; - }, - watch: { - "model_cfg.visible": { - handler() { - console.log(this.model_cfg.visible); - if (!this.model_cfg.visible) this.$setOpenWindow(); - }, - }, + imagesList: [] + } }, mounted() { - this.ResearchProgramNo = this.$route.query.researchProgramNo; - this.getTrialCriterionList(); - this.getList(); - this.getUserType(); + this.ResearchProgramNo = this.$route.query.researchProgramNo + this.getSite() + this.getVisitPlanOptions() + this.getTrialCriterionList() + this.getList() }, methods: { - // 获取用户类型下拉数据 - getUserType() { - getUserTypeListByUserType(0).then((res) => { - let arr = []; - if (this.hasPermi(["role:admin"])) { - arr = [1]; - } - if (this.hasPermi(["role:oa"])) { - arr = [1, 2]; - } - if (this.hasPermi(["role:pm"])) { - arr = [1, 2, 14]; - } - this.userTypeOptions = res.Result.map((item) => { - if (!arr.includes(item.UserTypeEnum)) { - return item; - } - }).filter((item) => item); - }); - }, - openImage(url) { - console.log(url); - - this.$nextTick(() => { + openImage(url, type) { + 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) + let refName = type ? `${url[0]}_${type}` : url[0] + this.$refs[refName].$viewer.show() } else { - this.imagesList = [this.OSSclientConfig.basePath + url]; + this.imagesList = [this.OSSclientConfig.basePath + url] + let refName = type ? `${url}_${type}` : url + if(this.$refs[refName] instanceof Array){ + this.$refs[refName][0].$viewer.show() + }else{ + this.$refs[refName].$viewer.show() + } } - if (this.$refs[url][0]) { - this.$refs[url][0].$viewer.show(); - } else { - 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 => { + v.Code = this.$i18n.locale === 'zh' ? v.Code : v.CodeEn ? v.CodeEn : v.Code + + 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] : '--', + 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] : '--', + 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] : '--', + oldValue: uo ? uo[v.Code] ? 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 = this.$i18n.locale === 'zh' ? v.ValueCN : v.Value + 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") { + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + 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: "--", - }; + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + 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] : "--", - }; + Enum: this.$i18n.locale === 'zh' ? v.ValueCN : v.Value, + newValue: obj[v.Code] ? obj[v.Code] : '--', + oldValue: upObj[v.Code].length > 0 ? 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] ? 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") { + Enum: this.$i18n.locale === 'zh' ? o[v.ChildDataLabel] : o[v.ChildDataEnLabel] ? o[v.ChildDataEnLabel] : o[v.ChildDataLabel], + newValue: 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: "--", - }; + Enum: this.$i18n.locale === 'zh' ? o[v.ChildDataLabel] : o[v.ChildDataEnLabel] ? o[v.ChildDataEnLabel] : o[v.ChildDataLabel], + oldValue: 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] : "--", - }; + Enum: this.$i18n.locale === 'zh' ? o[v.ChildDataLabel] : o[v.ChildDataEnLabel] ? o[v.ChildDataEnLabel] : o[v.ChildDataLabel], + newValue: o[v.ChildDataValue] ? o[v.ChildDataValue] : '--', + oldValue: uo ? uo[v.ChildDataValue] ? 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(',', '') + 'zh='+this.$i18n.locale : 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(',', '') + 'zh='+this.$i18n.locale : v.UrlConfig.RoutePath + } + console.log(item) + item.IsTableFiled = v.IsTableFiled + item.DataType = v.DataType + item.key = v.Code + item.Enum = this.$i18n.locale === 'zh' ? v.ValueCN : v.Value + 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: this.$i18n.locale === 'zh' ? j.FixedColumnName : j.FixedColumnEnName, IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? this.$i18n.locale === 'zh' ? j.MergeColumnName : j.MergeColumnEnName : 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[this.$i18n.locale === 'zh' ? j.ColumnName : j.ColumnEnName ? j.ColumnEnName : j.ColumnName], IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? this.$i18n.locale === 'zh' ? j.MergeColumnName : j.MergeColumnEnName : 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: this.$i18n.locale === 'zh' ? j.ColumnName : j.ColumnEnName ? j.ColumnEnName : j.ColumnName, IsMerge: j.IsMerge, ColumnName: j.ColumnName, ColumnValue: j.ColumnValue, ListName: j.ListName, MergeColumnName: j.IsMerge ? this.$i18n.locale === 'zh' ? j.MergeColumnName : j.MergeColumnEnName : 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) { - this.OptType2 = 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 configList2 = res.Result; - this.formatting( - configList2, - JsonDetail.Data, - ParentJson ? ParentJson.Data : null, - JsonDetail.CommonData, - row, - "auditData2" - ); - this.otherData2 = []; + this.OptType2 = 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 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: "", - Asc: false, - PageIndex: 1, - PageSize: 20, - ModuleType: null, - BlindName: null, - TrialId: this.$route.query.trialId, - SiteId: null, - SubjectId: null, - SubjectInfo: null, - SubjectVisitId: null, - VisitPlanInfo: null, - OptType: null, - ChildrenType: null, - Reason: null, - IsSign: null, - StartTime: null, - EndTime: null, - Description: null, - OpByUserName: null, - BatchId: null, - UserTypeId: null, - TrialReadingCriterionId: null, - VisitName: null, - SubjectCode: null, - }); - this.timeList = []; - this.getList(); + this.searchData = searchDataDefault() + 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 + this.searchData.TrialId = this.$route.query.trialId + 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 + }) + } + } +}