From 996143f721823345c1aeb7af7460a06fa83e9c15 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Sat, 26 Oct 2024 09:49:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lecturer/Organization.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index b9d7ff74..22cd9b91 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -426,7 +426,7 @@ const getTableDate = (obj) => { state.teacherdialogtitle="新增归属组织" state.vf = true lecturer.getAffiliationCode().then(res=>{ - state.formParam.trainOrgId = res.data + state.formParam.trainOrgId = res.data.data }).catch(()=>{ message.error('获取归属组织编号失败') }) From 7d510a2c254477f15e483f93f5fc7b631d8a8c91 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Sat, 26 Oct 2024 11:29:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/project/AddOrgContent.vue | 7 ++- src/views/lecturer/Organization.vue | 55 ++++++++++-------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/components/project/AddOrgContent.vue b/src/components/project/AddOrgContent.vue index e057fc66..993dc3c6 100644 --- a/src/components/project/AddOrgContent.vue +++ b/src/components/project/AddOrgContent.vue @@ -101,10 +101,13 @@ import * as lecturerApi from "@/api/Lecturer.js"; expandedKeys.value = [] selectedKeys.value = [] checkedKeys.value = [] + }else{ + console.log(props.AddContentList,'xixiixix') + treeAddData.value = props?.AddContentList + checkedKeys.value = props?.AddContentList?.map(item=>item.id) } }); const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => { - console.log(checkedKeys.value,'选中的id值') // "965356037047586816" let length = treeAddData.value.length if(checkedNodes.length > length){ @@ -131,7 +134,7 @@ import * as lecturerApi from "@/api/Lecturer.js"; clearTree() }; const queryCreate = () => { - emit("AddContentList", treeAddData.value); + emit("update:AddContentList", treeAddData.value); closeCodeModal() } const expandedKeys = ref([]); diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index 22cd9b91..2db21cf5 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -102,14 +102,14 @@ - +
- - - + + + - +
@@ -121,7 +121,7 @@
- + @@ -169,7 +169,7 @@ - + @@ -193,7 +193,7 @@ - + @@ -234,7 +234,7 @@ export default{ formParam:{ trainOrgId:null, trainOrgName:null, - status: 0, + isParent: 1, remark:null, orgName: null, orgId: null, @@ -244,31 +244,25 @@ export default{ leveOneArray: [], leveTwoArray: [], leveThreeArray: [], - parentId: null, + code: null, affiliationOrgList: [], }, - orgList: [], }) const PlaceOfPayList = ref([ - { value: 1, label: "一级审批人" }, - { value: 2, label: "二级审批人" }, - { value: 3, label: "三级审批人" }, + { value: '1', label: "一级审批人" }, + { value: '2', label: "二级审批人" }, + { value: '3', label: "三级审批人" }, ]) const PlaceOfPayListTwo = ref([ - { value: 1, label: "一级审批人" }, + { value: '1', label: "一级审批人" }, ]) - const AddContentList = (val) => { - console.log(val,'val') - state.orgList = val - state.formParam.affiliationOrgList = val - } const selectRadio = (val)=>{ if(val.target.value == 1){ state.formParam.leveOneArray = [] state.formParam.leveTwoArray = [] state.formParam.leveThreeArray = [] } - state.formParam.parentId = null + state.formParam.code = null } const columns = ref([ { @@ -343,7 +337,7 @@ const orgColumns = ref([ customRender: (text) => { return (
- {isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"} + {text.record.isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"}
) } @@ -451,7 +445,7 @@ const getTableDate = (obj) => { state.formParam={ trainOrgId:null, trainOrgName:null, - status: 0, + isParent: 0, remark:null, orgName: null, orgId: null, @@ -461,7 +455,7 @@ const getTableDate = (obj) => { leveOneArray: [], leveTwoArray: [], leveThreeArray: [], - parentId: null, + code: null, affiliationOrgList: [] } } @@ -478,12 +472,8 @@ const getTableDate = (obj) => { } //保存 const createTeacherDialog = async () => { - if(state.formParam.status){ - state.formParam.status = state.formParam.parentId - } + console.log(state.formParam,'state.formParam') state.formParam.affiliationUserList = [...state.formParam?.actArray,...state.formParam?.leveOneArray,...state.formParam?.leveTwoArray,...state.formParam?.leveThreeArray] - state.formParam.orgId = state.orgList?.map(item=>item.id).join(',') - state.formParam.orgName = state.orgList?.map(item=>item.name).join(',') const formItemNames = Object.keys(rules); for(let i=0;i { const rules = { trainOrgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }], trainOrgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }], - parentId: [{ required: true, message: '',log:'根节点不能为空' }], + code: [{ required: true, message: '',log:'根节点不能为空' }], actValue: [{ required: true, message: '',log:'组织担当不能为空' }], leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }], @@ -531,7 +521,6 @@ const getTableDate = (obj) => { getTableDate, searchSubmit, selectRadio, - AddContentList, PlaceOfPayList, PlaceOfPayListTwo, searchReset, From 80342c08624a0b9343bcd707a673934678ca5dcc Mon Sep 17 00:00:00 2001 From: zhangsir Date: Sat, 26 Oct 2024 15:34:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=9F=BA=E6=9C=AC=E8=81=94=E8=B0=83=E5=AE=8C?= =?UTF-8?q?=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Lecturer.js | 4 + src/components/project/AddOrgContent.vue | 17 +- .../project/ProjectManagerLecturer.vue | 3 + src/components/project/lockLecturer.vue | 251 ++++++++++++++++++ src/views/lecturer/Organization.vue | 193 +++++++++----- 5 files changed, 398 insertions(+), 70 deletions(-) create mode 100644 src/components/project/lockLecturer.vue diff --git a/src/api/Lecturer.js b/src/api/Lecturer.js index f9480722..b9d872d0 100644 --- a/src/api/Lecturer.js +++ b/src/api/Lecturer.js @@ -57,3 +57,7 @@ export const getSelectOrg = (id) => http.get(`/admin/affiliation/getSelectOrg?id export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`) //获取培训发生组织编号 export const getAffiliationCode = () => http.get('/admin/affiliation/getAffiliationCode') +//查看或编辑回显培训发生组织 +export const getAffiliationById = (id) => http.get(`/admin/affiliation/queryById?id=${id}`) +//删除培训发生组织 +export const affiliationDelById = (id)=>http.post(`/admin/affiliation/delById?id=${id}`) \ No newline at end of file diff --git a/src/components/project/AddOrgContent.vue b/src/components/project/AddOrgContent.vue index 993dc3c6..fceb11e5 100644 --- a/src/components/project/AddOrgContent.vue +++ b/src/components/project/AddOrgContent.vue @@ -42,7 +42,7 @@ v-for="(item, index) in treeAddData" :key="index" > -
{{ item?.name }} - (原:{{ item?.orgName || '-' }})
+
{{ item?.orgName }} - (原:{{ item?.updateName || '-' }})
+
@@ -104,7 +104,7 @@ import * as lecturerApi from "@/api/Lecturer.js"; }else{ console.log(props.AddContentList,'xixiixix') treeAddData.value = props?.AddContentList - checkedKeys.value = props?.AddContentList?.map(item=>item.id) + checkedKeys.value = props?.AddContentList?.map(item=>item.orgId) } }); const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => { @@ -119,15 +119,24 @@ import * as lecturerApi from "@/api/Lecturer.js"; } }) } + checkedNodes = checkedNodes.map(item=>{ + return { + orgId: item.id, + orgName: item.name, + affiliationId: item.id, + ...item + } + }) treeAddData.value = checkedNodes; + console.log(treeAddData.value,'checkedNodes') } const clearTree = () => { treeAddData.value = []; checkedKeys.value = []; } const deleteTree = (item) => { - treeAddData.value = treeAddData.value.filter(node => node.id !== item.id); - checkedKeys.value = treeAddData.value.map(item=>item.id) + treeAddData.value = treeAddData.value.filter(node => node.orgId !== item.orgId); + checkedKeys.value = treeAddData.value.map(item=>item.orgId) } const closeCodeModal = () => { emit("update:showContent", false); diff --git a/src/components/project/ProjectManagerLecturer.vue b/src/components/project/ProjectManagerLecturer.vue index 960aca86..eae285a3 100644 --- a/src/components/project/ProjectManagerLecturer.vue +++ b/src/components/project/ProjectManagerLecturer.vue @@ -57,6 +57,9 @@ onMounted(()=>{ managerArray.value = props.arrayList options.value = props.arrayList }) +watch(()=>props.arrayList, ()=>{ + managerArray.value = props.arrayList +}) const options = ref([]) const getList = () => { getUserList(keyword.value).then(res=>{ diff --git a/src/components/project/lockLecturer.vue b/src/components/project/lockLecturer.vue new file mode 100644 index 00000000..5aaf86b7 --- /dev/null +++ b/src/components/project/lockLecturer.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index 2db21cf5..2538a883 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -22,11 +22,13 @@ + @expand="expandTable" :pagination="false">