diff --git a/src/api/Teaching.js b/src/api/Teaching.js index cd56100e..c44fbe60 100644 --- a/src/api/Teaching.js +++ b/src/api/Teaching.js @@ -12,7 +12,8 @@ export const updateInTeacherCourse = (obj) => http.post('/admin/teacherRecord/ed export const getTeacherCourseList = (obj) => http.get('/admin/teacherRecord/queryById', {params: obj}) //获取培训组织 export const getOrganization = (obj) => http.get ('/admin/affiliation/list', {params: obj}) - +//供应商数据 +export const selectSupplier = (obj) => http.get('/admin/teacher/selectSupplier', {params: obj}) //授课记录导出 export const getexport = (obj) => http.post('/lesson_records/export', obj) diff --git a/src/components/project/AddOrgContent.vue b/src/components/project/AddOrgContent.vue index 911ca8e7..7ec7505d 100644 --- a/src/components/project/AddOrgContent.vue +++ b/src/components/project/AddOrgContent.vue @@ -141,7 +141,7 @@ import * as lecturerApi from "@/api/Lecturer.js"; }) } const orgLists = ref([]) - const onCheck = async (checkedKeys, {checked: bool, checkedNodes, node, event}) => { + const onCheck = async (checkedKey, {checked: bool, checkedNodes, node, event}) => { // "965356037047586816" let length = treeAddData.value.length if(checkedNodes.length > length){ @@ -154,7 +154,7 @@ import * as lecturerApi from "@/api/Lecturer.js"; message.error('获取被占用组织失败,请重新尝试') }) } - treeAddData.value = checkedNodes.map(item => { + const checkLists = checkedNodes.map(item => { if (!item || !item.id) { return item; } @@ -176,6 +176,14 @@ import * as lecturerApi from "@/api/Lecturer.js"; return item; } }); + const endLists = [...checkLists,...orgLists.value] + const seen = new Set(); + const uniqueEndLists = endLists.filter(item => { + const isDuplicate = seen.has(item.orgId); + seen.add(item.orgId); + return !isDuplicate; + }); + treeAddData.value = uniqueEndLists?.filter(item => checkedKeys.value?.checked?.includes(item.orgId)); // treeAddData.value = checkedNodes; console.log(treeAddData.value,'checkedNodes',orgLists.value) } @@ -193,6 +201,13 @@ import * as lecturerApi from "@/api/Lecturer.js"; clearTree() }; const queryCreate = () => { + treeAddData.value?.map(item=>{ + props?.AddContentList?.map(i=>{ + if(item.orgId === i.orgId){ + item.affiliationOrgId = i.affiliationOrgId + } + }) + }) emit("update:AddContentList", treeAddData.value); closeCodeModal() } diff --git a/src/components/project/LookExternalLecturer.vue b/src/components/project/LookExternalLecturer.vue index 44c2b246..76e8e085 100644 --- a/src/components/project/LookExternalLecturer.vue +++ b/src/components/project/LookExternalLecturer.vue @@ -19,7 +19,7 @@
@@ -139,18 +139,18 @@