diff --git a/pages/apply/subPages/SE/1trainNotifyEdit.vue b/pages/apply/subPages/SE/1trainNotifyEdit.vue index 3532b83..713ead6 100644 --- a/pages/apply/subPages/SE/1trainNotifyEdit.vue +++ b/pages/apply/subPages/SE/1trainNotifyEdit.vue @@ -3,57 +3,90 @@ - + - + - - + + - - + + - - + + - - + - - + - + - + - - + + - - + + - - + + - + - + + + + + + + + + + @@ -62,37 +95,56 @@ - - + + - + - - + + 附件 - + - + + - + - - + + - - - + + + 提交 @@ -130,8 +182,8 @@ NEED_EVALUATION_SHOW: "", NEED_EVALUATION: "", CREATE_NOTIFY_RECORD: true, - IN_OUT_SHOW:'', - IN_OUT:'', + IN_OUT_SHOW: '', + IN_OUT: '', }, options: [{ text: '删除', @@ -222,6 +274,7 @@ qsCom: { show: false, lists: [], + defaultChecked: [], formIndex: undefined, isMultiple: false, }, @@ -247,7 +300,7 @@ this.TaskID = option.taskID ? option.taskID : ''; this.model.ID = option.ID ? option.ID : ''; this.tableKey = option.tableKey ? option.tableKey : '0'; - this.fetchEnums(['TrainType', 'PlanCheckType', 'FMDepartmentType','TrainInOut','SETrainNeedSuvey']); + this.fetchEnums(['TrainType', 'PlanCheckType', 'FMDepartmentType', 'TrainInOut', 'SETrainNeedSuvey']); this.isAdd = option.isAdd }, @@ -343,6 +396,12 @@ this.model.TRAIN_END_TIME = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM') } + + //如果开始结束时间都有 默认处理 培训学时 + if (this.model.TRAIN_START_TIME && this.model.TRAIN_END_TIME) { + this.model.HOURS = ((new Date(this.model.TRAIN_END_TIME).getTime() - new Date(this.model + .TRAIN_START_TIME).getTime()) / 1000 / 60 / 45.0).toFixed(1) + } this.dateTimePickerInfo.showCheckDate = false }, //时间end @@ -379,7 +438,7 @@ } }) }) - } else if (this.currSearchType == "Nav_RecordUser"||this.currSearchType == "Nav_UserTeacher") { + } else if (this.currSearchType == "Nav_RecordUser" || this.currSearchType == "Nav_UserTeacher") { getRequest(json, "/FM/FMUser/OrderPagedUseful").then(res => { this.Lists = res.map(i => { return { @@ -415,13 +474,26 @@ //多选start async handleQuerySelect(opt) { let column = await this.handleGet(opt, 'init') + var defaultChecked = [] + if (opt.formIndex == 'Nav_TrainContentList') { + if (this.model.Nav_TrainContentList != null && this.model.Nav_TrainContentList.length > 0) + this.model.Nav_TrainContentList.forEach(e => { + defaultChecked.push(e.Nav_Point) + }) + } else if (opt.formIndex == 'Nav_ListCour') { + if (this.model.Nav_ListCour != null && this.model.Nav_ListCour.length > 0) + this.model.Nav_ListCour.forEach(e => { + defaultChecked.push(e.Nav_Cour) + }) + } if (column && column.length) { this.qsCom = { show: true, name: opt.NAME, formIndex: opt.formIndex, isMultiple: opt.isMultiple, - lists: column + lists: column, + defaultChecked: defaultChecked } } }, @@ -437,6 +509,8 @@ }) }, async handleGet(opt, value, pageIndex) { + var api = (opt.formIndex == 'Nav_TrainContentList') ? '/SE/TestEnumPoint/OrderPaged' : + '/SE/Coursewearlibrary/OrderPaged' const json = initFilter(this.ORG_ID, '', "", 0, pageIndex || 1) if (value !== 'init') { const tempGroup = initFilterGroup(false); @@ -448,7 +522,7 @@ json.Start = (pageIndex - 1) * 20; } let result = [] - const raw = await getRequest(json, "/SE/TestEnumPoint/OrderPaged").then(res => { + const raw = await getRequest(json, api).then(res => { this.curTotal = res.TotalCount return res }) @@ -465,20 +539,40 @@ const { formIndex, } = this.qsCom - this.model.Nav_TrainContentList = []; - val.forEach(item => { - let obj = { - POINT_ID: item.ID, - Nav_Point: { - NAME: item.NAME - }, - ID: guid(), - NOTIFY_ID: this.model.ID, - ORG_ID: this.ORG_ID, - } - this.model.Nav_TrainContentList.push(obj); - }) + //formIndex Nav_ListCour Nav_TrainContentList + if (formIndex == 'Nav_TrainContentList') { + this.model.Nav_TrainContentList = []; + val.forEach(item => { + let obj = { + POINT_ID: item.ID, + Nav_Point: { + ID: item.ID, + NAME: item.NAME + }, + ID: guid(), + NOTIFY_ID: this.model.ID, + ORG_ID: this.ORG_ID, + } + this.model.Nav_TrainContentList.push(obj); + }) + } else if (formIndex == 'Nav_ListCour') { + this.model.Nav_ListCour = []; + val.forEach(item => { + let obj = { + COURSEWEARLIBRARY_ID: item.ID, + Nav_Cour: { + ID: item.ID, + NAME: item.NAME + }, + ID: guid(), + NOTIFY_ID: this.model.ID, + ORG_ID: this.ORG_ID, + } + this.model.Nav_ListCour.push(obj); + }) + } this.qsCom.show = false + this.qsCom.defaultChecked = [] }, onCloseQS() { this.qsCom = { @@ -539,11 +633,16 @@ extendRule(json, 'ID', 1, this.model.ID) getRequest(json, "/SE/TrainNotify/Get").then(res => { this.model = res - this.model.LEVEL_SHOW = res.LEVEL !== undefined ? this.enumsData['FMDepartmentType'].find(item => item.code === res.LEVEL)?.name : ''; - this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.TRAINTYPE)?.name : ''; - this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.CHECKTYPE)?.name : ''; - this.model.IN_OUT_SHOW = res.IN_OUT !== undefined ? this.enumsData['TrainInOut'].find(item => item.code === res.IN_OUT)?.name : ''; - this.model.NEED_EVALUATION_SHOW = res.NEED_EVALUATION !== undefined ? this.enumsData['SETrainNeedSuvey'].find(item => item.code === res.NEED_EVALUATION)?.name : ''; + this.model.LEVEL_SHOW = res.LEVEL !== undefined ? this.enumsData['FMDepartmentType'].find( + item => item.code === res.LEVEL)?.name : ''; + this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find( + item => item.code === res.TRAINTYPE)?.name : ''; + this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find( + item => item.code === res.CHECKTYPE)?.name : ''; + this.model.IN_OUT_SHOW = res.IN_OUT !== undefined ? this.enumsData['TrainInOut'].find(item => + item.code === res.IN_OUT)?.name : ''; + this.model.NEED_EVALUATION_SHOW = res.NEED_EVALUATION !== undefined ? this.enumsData[ + 'SETrainNeedSuvey'].find(item => item.code === res.NEED_EVALUATION)?.name : ''; }) }, closePicker() { @@ -586,13 +685,13 @@ } else if (name == 'FMDepartmentType') { this.model.LEVEL_SHOW = e.value[0].name this.model.LEVEL = this.enumsData['FMDepartmentType'][e.indexs[0]].code - } else if (name == 'SETrainNeedSuvey') { + } else if (name == 'SETrainNeedSuvey') { this.model.NEED_EVALUATION_SHOW = e.value[0].name this.model.NEED_EVALUATION = this.enumsData['SETrainNeedSuvey'][e.indexs[0]].code } else if (name == 'TrainInOut') { this.model.IN_OUT_SHOW = e.value[0].name this.model.IN_OUT = this.enumsData['TrainInOut'][e.indexs[0]].code - } + } @@ -615,9 +714,7 @@ submit() { const ele = this.$refs ele['wForm'].validate().then(res => { - this.modelEdit = JSON.parse(JSON.stringify(this.model)) - this.modelEdit.PUBLISH = "SaveAndNotify"; if (this.TaskID != "") { this.modelEdit.TaskID = this.TaskID; @@ -632,7 +729,7 @@ 'yyyy-mm-dd hh:MM:ss'); this.modelEdit.TRAIN_END_TIME = uni.$u.timeFormat(this.modelEdit.TRAIN_END_TIME, 'yyyy-mm-dd hh:MM:ss'); - this.modelEdit.Nav_UserTeacher = null; + this.modelEdit.Nav_UserTeacher = null; this.modelEdit.Nav_TrainType = null; this.modelEdit.Nav_TrainCheckType = null; this.modelEdit.Nav_RecordUser = null; diff --git a/pages/apply/subPages/SE/1trainNotifyShow.vue b/pages/apply/subPages/SE/1trainNotifyShow.vue index f477698..8c84fd0 100644 --- a/pages/apply/subPages/SE/1trainNotifyShow.vue +++ b/pages/apply/subPages/SE/1trainNotifyShow.vue @@ -3,46 +3,64 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + @@ -53,7 +71,8 @@ 附件 - + @@ -64,8 +83,10 @@ - - + + @@ -78,7 +99,8 @@ import { initFilter, extendRule, - extendInclude + extendInclude, + getArryPropShow } from '../../../../utils/common' import { getRequest, @@ -110,7 +132,7 @@ this.model.ID = option.ID; this.TaskID = option.taskID; this.tableKey = option.tableKey ? option.tableKey : '0' - this.fetchEnums(['TrainType', 'PlanCheckType','FMDepartmentType', 'TrainInOut','SETrainNeedSuvey']); + this.fetchEnums(['TrainType', 'PlanCheckType', 'FMDepartmentType', 'TrainInOut', 'SETrainNeedSuvey']); }, methods: { async fetchEnums(enumNames) { @@ -167,6 +189,7 @@ extendInclude(json, 'Nav_TrainUserList.Nav_User'); extendInclude(json, 'Nav_Files.Nav_ImgFile'); extendInclude(json, "Nav_UserTeacher") + extendInclude(json, "Nav_ListCour.Nav_Cour") getRequest(json, "/SE/TrainNotify/Get").then(res => { this.model = res let trainContent = ''; @@ -197,11 +220,17 @@ // this.model.LEVEL = this.transLevel(this.model.LEVEL); this.model.TRAINCONTENT = trainContent; this.model.users = users; - this.model.LEVEL_SHOW = res.LEVEL !== undefined ? this.enumsData['FMDepartmentType'].find(item => item.code === res.LEVEL)?.name : ''; - this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.TRAINTYPE)?.name : ''; - this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.CHECKTYPE)?.name : ''; - this.model.IN_OUT_SHOW = res.IN_OUT !== undefined ? this.enumsData['TrainInOut'].find(item => item.code === res.IN_OUT)?.name : ''; - this.model.NEED_EVALUATION_SHOW = res.NEED_EVALUATION !== undefined ? this.enumsData['SETrainNeedSuvey'].find(item => item.code === res.NEED_EVALUATION)?.name : ''; + this.model.LEVEL_SHOW = res.LEVEL !== undefined ? this.enumsData['FMDepartmentType'].find( + item => item.code === res.LEVEL)?.name : ''; + this.model.TRAINTYPE_SHOW = res.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find( + item => item.code === res.TRAINTYPE)?.name : ''; + this.model.CHECKTYPE_SHOW = res.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find( + item => item.code === res.CHECKTYPE)?.name : ''; + this.model.IN_OUT_SHOW = res.IN_OUT !== undefined ? this.enumsData['TrainInOut'].find(item => + item.code === res.IN_OUT)?.name : ''; + this.model.NEED_EVALUATION_SHOW = res.NEED_EVALUATION !== undefined ? this.enumsData[ + 'SETrainNeedSuvey'].find(item => item.code === res.NEED_EVALUATION)?.name : ''; + this.model.Nav_ListCour_Show = getArryPropShow(this.model.Nav_ListCour, 'Nav_Cour.NAME') this.isLoadOK = true; }) }, diff --git a/pages/apply/subPages/SE/2trainRecordEdit.vue b/pages/apply/subPages/SE/2trainRecordEdit.vue index 147082a..bbdd65e 100644 --- a/pages/apply/subPages/SE/2trainRecordEdit.vue +++ b/pages/apply/subPages/SE/2trainRecordEdit.vue @@ -3,72 +3,145 @@ - + - + - + - + - + - - + + - - + + - + - + - + - + - + + + + 附件: - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + 附件: + + + - + + + + + + + - - - + + + + + + + + 提交 @@ -84,13 +157,15 @@ extendRule, guid, initFilter, - initFilterGroup + initFilterGroup, + getArryPropShow } from '../../../../utils/common' import { getRequest, } from '../../../../services/apply/FOServices/FOServices'; import { - getEnum + getEnum, + GetEnumAnyOrder } from '../../../../services/common'; export default { data() { @@ -98,6 +173,8 @@ Lists: [], listPropUpload: ['RECORD_ID'], listPropValUpload: [], + listSubPropUpload: ['RECORD_USER_ID'], + listSubPropValUpload: [], model: { Nav_Users: [], ORG_ID: "", @@ -126,6 +203,7 @@ }, list: ['参与', '请假', '缺席'], showPopup: false, + title: '', tableKey: '0', TaskID: '', isLoadOK: false, @@ -141,47 +219,78 @@ formatter: null, enumsData: {}, // 存储所有枚举数据(键:枚举名称,值:处理后的枚举列表) enumsText: {}, // 存储枚举文本列表(用于下拉选择等场景) + selectorInfo: { + isSubShow: false, + isMultiple: false, + showPopup: false, + totalCount: 0, + title: '检查人员', + itemData: {}, + index: 0, + dataLists: [], + defaultText: '', + defaultValue: '', + name: '', + defaultChecked: [] + }, } }, onLoad(option) { this.TaskID = option.taskID ? option.taskID : ''; this.model.ID = option.ID ? option.ID : ''; this.tableKey = option.tableKey ? option.tableKey : '0'; - this.fetchEnums(['TrainType', 'PlanCheckType','FMDepartmentType']); + this.fetchEnums(['TrainType', 'PlanCheckType', 'FMDepartmentType', 'SETrainRecordUserStatusEnum', + 'SEExaminationResultsEnum' + ]); }, methods: { async fetchEnums(enumNames) { try { - // 存储所有枚举请求的Promise - const enumPromises = enumNames.map(name => { - return getEnum({ - name - }).then(res => { - // 统一处理枚举格式:添加name/code字段,便于后续映射 - return { - enumName: name, - data: res.map(item => ({ - ...item, - name: item.NAME, // 统一显示名称字段 - code: item.ID // 统一值字段 - })) - }; - }); - }); + // // 存储所有枚举请求的Promise + // const enumPromises = enumNames.map(name => { + // return getEnum({ + // name + // }).then(res => { + // // 统一处理枚举格式:添加name/code字段,便于后续映射 + // return { + // enumName: name, + // data: res.map(item => ({ + // ...item, + // name: item.NAME, // 统一显示名称字段 + // code: item.ID // 统一值字段 + // })) + // }; + // }); + // }); + // // 等待所有枚举请求完成 + // const results = await Promise.all(enumPromises); + // // 存储枚举结果到data中(键为枚举名称,值为处理后的数据) + // results.forEach(({ + // enumName, + // data + // }) => { + // this.enumsData[enumName] = data; + // // 生成文本列表(如需要) + // this.enumsText[enumName] = data.map(item => item.name); + // }); + // // 所有枚举获取完成后,执行loadData + // this.loadData(); - // 等待所有枚举请求完成 - const results = await Promise.all(enumPromises); - // 存储枚举结果到data中(键为枚举名称,值为处理后的数据) - results.forEach(({ - enumName, - data - }) => { - this.enumsData[enumName] = data; - // 生成文本列表(如需要) - this.enumsText[enumName] = data.map(item => item.name); - }); - // 所有枚举获取完成后,执行loadData - this.loadData(); + GetEnumAnyOrder({ + name: 'TrainType|PlanCheckType|FMDepartmentType|SETrainRecordUserStatusEnum|SEExaminationResultsEnum' + }).then(res => { + res.forEach((e, index) => { + var dataTemp = e.map(sube => ({ + ...sube, + name: sube.NAME, // 统一显示名称字段 + code: sube.ID // 统一值字段 + })); + + this.enumsData[enumNames[index]] = dataTemp + this.enumsText[enumNames[index]] = dataTemp.map(item => item.name); + }) + this.loadData(); + }) } catch (error) { console.error('枚举请求失败:', error); uni.showToast({ @@ -249,8 +358,28 @@ extendInclude(json, 'Nav_Users.Nav_User'); extendInclude(json, 'Nav_Files.Nav_ImgFile'); extendInclude(json, 'Nav_Users'); + extendInclude(json, "Nav_Notify.Nav_ListCour.Nav_Cour") extendRule(json, 'ID', 1, this.model.ID) getRequest(json, "/SE/TrainRecord/Get").then(res => { + var SETrainRecordUserStatusEnum = this.enumsData["SETrainRecordUserStatusEnum"] + var SEExaminationResultsEnum = this.enumsData["SEExaminationResultsEnum"] + res.Nav_Users.forEach(e => { + try { + if (e.STATUS == undefined || e.STATUS == null) { + e.STATUS = 0 + } + if (e.EXAMINATION_RESULTS == undefined || e.EXAMINATION_RESULTS == null) { + e.EXAMINATION_RESULTS = 1 + } + e.STATUS_SHOW = SETrainRecordUserStatusEnum.filter(es => es.ID == e.STATUS)[0] + .NAME + e.EXAMINATION_RESULTS_SHOW = SEExaminationResultsEnum.filter(es => es.ID == e + .EXAMINATION_RESULTS)[0].NAME + } catch (e) {} + e.listSubPropValUpload = [] + e.listSubPropValUpload.push(e.ID) + }) + this.model = res // if (this.model.Nav_Notify.LEVEL == 0) { // this.model.Nav_Notify.LEVEL_SHOW = "部门"; @@ -261,24 +390,29 @@ // } else if (this.model.Nav_Notify.LEVEL == 3) { // this.model.Nav_Notify.LEVEL_SHOW = "公司"; // } - this.model.Nav_Notify.LEVEL_SHOW= res.Nav_Notify.LEVEL !== undefined ? this.enumsData['FMDepartmentType'].find(item => item.code === res.Nav_Notify.LEVEL)?.name : ''; - this.model.Nav_Notify.TRAINTYPE_SHOW = res.Nav_Notify.TRAINTYPE !== undefined ? this.enumsData['TrainType'].find(item => item.code === res.Nav_Notify.TRAINTYPE)?.name : ''; - this.model.Nav_Notify.CHECKTYPE_SHOW = res.Nav_Notify.CHECKTYPE !== undefined ? this.enumsData['PlanCheckType'].find(item => item.code === res.Nav_Notify.CHECKTYPE)?.name : ''; - this.model.Nav_Notify.TRAIN_MODEL_SHOW = ""; - if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(1) > 0) { - this.model.Nav_Notify.TRAIN_MODEL_SHOW += "讲授法 "; - } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(2) > 0) { - this.model.Nav_Notify.TRAIN_MODEL_SHOW += "视听法 "; - } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(3) > 0) { - this.model.Nav_Notify.TRAIN_MODEL_SHOW += "研讨法 "; - } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(4) > 0) { - this.model.Nav_Notify.TRAIN_MODEL_SHOW += "演示法 "; - } + this.model.Nav_Notify.LEVEL_SHOW = res.Nav_Notify.LEVEL !== undefined ? this.enumsData[ + 'FMDepartmentType'].find(item => item.code === res.Nav_Notify.LEVEL)?.name : ''; + this.model.Nav_Notify.TRAINTYPE_SHOW = res.Nav_Notify.TRAINTYPE !== undefined ? this.enumsData[ + 'TrainType'].find(item => item.code === res.Nav_Notify.TRAINTYPE)?.name : ''; + this.model.Nav_Notify.CHECKTYPE_SHOW = res.Nav_Notify.CHECKTYPE !== undefined ? this.enumsData[ + 'PlanCheckType'].find(item => item.code === res.Nav_Notify.CHECKTYPE)?.name : ''; + // this.model.Nav_Notify.TRAIN_MODEL_SHOW = ""; + // if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(1) > 0) { + // this.model.Nav_Notify.TRAIN_MODEL_SHOW += "讲授法 "; + // } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(2) > 0) { + // this.model.Nav_Notify.TRAIN_MODEL_SHOW += "视听法 "; + // } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(3) > 0) { + // this.model.Nav_Notify.TRAIN_MODEL_SHOW += "研讨法 "; + // } else if (this.model.Nav_Notify.TRAIN_MODEL.indexOf(4) > 0) { + // this.model.Nav_Notify.TRAIN_MODEL_SHOW += "演示法 "; + // } this.model.Nav_TrainContentList_SHOW = ""; for (let i = 0; i < this.model.Nav_Notify.Nav_TrainContentList.length; i++) { this.model.Nav_TrainContentList_SHOW += (i + 1) + "." + this.model.Nav_Notify .Nav_TrainContentList[i].Nav_Point.NAME + "
"; } + this.model.Nav_ListCour_Show = getArryPropShow(this.model.Nav_Notify.Nav_ListCour, + 'Nav_Cour.NAME', '
') this.model.Nav_Users_SHOW = ""; for (let i = 0; i < this.model.Nav_Users.length; i++) { this.model.Nav_Users_SHOW += (i + 1) + "." + this.model.Nav_Users[i].Nav_User.NAME + @@ -321,6 +455,76 @@ }) }, + //数据加载 + handleSearch(val, pageIndex) { + var p = { + name: this.selectorInfo.name, + title: this.selectorInfo.title, + val: val, + pageIndex: pageIndex + } + this.handleShowSheet(p) + }, + + //下拉数据加载 + async handleShowSheet(p) { + // const orgId = uni.getStorageSync('orgId') + // const json = initFilter(orgId, "", "", 0, p.pageIndex ?? 1) + let dataSelect = [] + var defaultChecked = [] + if (p.name == 'STATUS') { + dataSelect = this.enumsData['SETrainRecordUserStatusEnum'] + } else if (p.name == 'EXAMINATION_RESULTS') { + dataSelect = this.enumsData['SEExaminationResultsEnum'] + } + if (defaultChecked == null) + defaultChecked = [] + if (dataSelect.length) { + this.selectorInfo = { + itemData: p.itemData != undefined ? p.itemData : this.selectorInfo.itemData, + totalCount: this.selectorInfo.totalCount, + showPopup: true, + title: p.title, + name: p.name, + dataLists: [dataSelect], + defaultChecked: defaultChecked + } + } else { + // 暂无数据 + debugger + } + }, + handleSelected(e) { + this.selectorInfo.showPopup = false + if (this.selectorInfo.name == "STATUS") { + this.selectorInfo.itemData.STATUS = e.ID + this.selectorInfo.itemData.STATUS_SHOW = e.NAME + } else if (this.selectorInfo.name == 'EXAMINATION_RESULTS') { + this.selectorInfo.itemData.EXAMINATION_RESULTS = e.ID + this.selectorInfo.itemData.EXAMINATION_RESULTS_SHOW = e.NAME + } + }, + onConfirmPicker(e) { + this.selectorInfo.showPopup = false + if (this.selectorInfo.name == "STATUS") { + this.selectorInfo.itemData.STATUS = e.value[0].ID + this.selectorInfo.itemData.STATUS_SHOW = e.value[0].NAME + } else if (this.selectorInfo.name == 'EXAMINATION_RESULTS') { + this.selectorInfo.itemData.EXAMINATION_RESULTS = e.value[0].ID + this.selectorInfo.itemData.EXAMINATION_RESULTS_SHOW = e.value[0].NAME + } + }, + + closePicker() { + this.selectorInfo = { + showPopup: false, + dataLists: [], + title: '', + name: '', + dataIndex: undefined, + formIndex: undefined + } + }, } } diff --git a/utils/common.js b/utils/common.js index 8e08e70..59e75dd 100644 --- a/utils/common.js +++ b/utils/common.js @@ -465,10 +465,10 @@ export function initQueryFilter(OrgId, PageIndex, Limit, Sort, Order) { } export function extendSelectField(obj, clude) { - if (!obj.SelectField) { - obj.SelectField = []; - } - obj.SelectField.push(clude); + if (!obj.SelectField) { + obj.SelectField = []; + } + obj.SelectField.push(clude); } export function initFilter(OrgId, Keyword = "", Sort, Order, PageIndex = 1, Parameter1, Parameter2, Parameter3, @@ -2069,4 +2069,23 @@ export function SourceFormcode(json) { break; } return linkToUrl +} + + +export function getArryPropShow(arry, propPath, htmlPerAdd) { + var arryShow = '' + const [prop1, prop2] = propPath.split('.'); + if (arry && arry.length > 0 && propPath) { + arry.map(function(item, index) { + var itemProp = item[prop1]?.[prop2] + if (itemProp && itemProp.length > 0) { + if (htmlPerAdd != null && htmlPerAdd != undefined) { + arryShow += itemProp + ((htmlPerAdd != null && htmlPerAdd != undefined) ? htmlPerAdd : ''); + } else { + arryShow += (index > 0 ? ',' : '') + itemProp + } + } + }); + } + return arryShow; } \ No newline at end of file