diff --git a/src/api/Lecturer.js b/src/api/Lecturer.js index 02a82d54..f9480722 100644 --- a/src/api/Lecturer.js +++ b/src/api/Lecturer.js @@ -54,4 +54,6 @@ export const getUserList = (keyword) => http.get(`/admin/thirdApi/user/list?page //查询弹框选择的组织信息 export const getSelectOrg = (id) => http.get(`/admin/affiliation/getSelectOrg?id=${id}`) //查询弹框不可选择组织(审核中的组织) -export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`) \ No newline at end of file +export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`) +//获取培训发生组织编号 +export const getAffiliationCode = () => http.get('/admin/affiliation/getAffiliationCode') diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index 15a108b4..eb3c0955 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -86,15 +86,15 @@ - - + - - + @@ -102,14 +102,14 @@ - +
- +
@@ -206,7 +206,8 @@ import { message } from "ant-design-vue"; import dialog from "@/utils/dialog"; import ProjectManager from "@/components/project/ProjectManagerLecturer"; import { queryTrainOrg,deleteTrainOrg,addReviewer,updateTrainOrg} from "../../api/organization"; -import AddOrgContent from "../../components/project/AddOrgContent.vue" +import AddOrgContent from "../../components/project/AddOrgContent.vue" +import lecturer from "../../api/Lecturer"; export default{ name:"organization", components: { @@ -231,8 +232,8 @@ export default{ pageSize: "10" }, formParam:{ - trainorgId:null, - trainorgName:null, + trainOrgId:null, + trainOrgName:null, status: 0, remark:null, orgName: null, @@ -243,12 +244,23 @@ export default{ leveOneArray: [], leveTwoArray: [], leveThreeArray: [], + parentId: null, + affiliationOrgList: [], }, orgList: [], }) + const PlaceOfPayList = ref([ + { value: 1, label: "一级审批人" }, + { value: 2, label: "二级审批人" }, + { value: 3, label: "三级审批人" }, + ]) + const PlaceOfPayListTwo = ref([ + { 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){ @@ -256,20 +268,21 @@ export default{ state.formParam.leveTwoArray = [] state.formParam.leveThreeArray = [] } + state.formParam.parentId = null } const columns = ref([ { title: '培训发生组织编号 ', - dataIndex: 'trainorgId', - key: 'trainorgId', + dataIndex: 'trainOrgId', + key: 'trainOrgId', elipsis: true, align: "center", width: 200, }, { title: '培训发生组织名称 ', - dataIndex: 'trainorgName', - key: 'trainorgName', + dataIndex: 'trainOrgName', + key: 'trainOrgName', elipsis: true, align: "center", width: 600, }, @@ -325,13 +338,27 @@ const orgColumns = ref([ }, { title: '是否被培训发生组织选择', - dataIndex: 'name', - key: 'name', + dataIndex: 'isSelect', + key: 'isSelect', + customRender: (text) => { + return ( +
+ {isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"} +
+ ) + } }, { title: '担当', - dataIndex: 'name', - key: 'name', + dataIndex: 'leaders', + key: 'leaders', + customRender: (text) => { + return ( +
+ {text.record.leaders || '-'} +
+ ) + } }, ]) //列表数据 @@ -398,6 +425,11 @@ const getTableDate = (obj) => { state.teacherdialog=true , state.teacherdialogtitle="新增归属组织" state.vf = true + lecturer.getAffiliationCode().then(res=>{ + state.formParam.trainOrgId = res.data + }).catch(()=>{ + message.error('获取归属组织编号失败') + }) } const addContentData = () => { state.showContent = true @@ -411,14 +443,14 @@ const getTableDate = (obj) => { TeacherSystem(record) } const TeacherSystem =(record)=>{ - state.formParam.trainorgId=record.trainorgId - state.formParam.trainorgName=record.trainorgName + state.formParam.trainOrgId=record.trainOrgId + state.formParam.trainOrgName=record.trainOrgName state.formParam.remark=record.remark } const cancel=()=>{ state.formParam={ - trainorgId:null, - trainorgName:null, + trainOrgId:null, + trainOrgName:null, status: 0, remark:null, orgName: null, @@ -429,6 +461,8 @@ const getTableDate = (obj) => { leveOneArray: [], leveTwoArray: [], leveThreeArray: [], + parentId: null, + affiliationOrgList: [] } } async function validateField(name) { @@ -444,6 +478,9 @@ const getTableDate = (obj) => { } //保存 const createTeacherDialog = async () => { + if(state.formParam.status){ + state.formParam.status = state.formParam.parentId + } 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(',') @@ -476,12 +513,11 @@ const getTableDate = (obj) => { }) }; const rules = { - // trainorgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }], - // trainorgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }], + trainOrgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }], + trainOrgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }], + parentId: [{ required: true, message: '',log:'根节点不能为空' }], actValue: [{ required: true, message: '',log:'组织担当不能为空' }], leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }], - // zzfzr: [{ required: true, message: '',log:'二级审批人不能为空' }], - // sjspr: [{ required: true, message: '',log:'三级审批人不能为空' }], } @@ -496,6 +532,8 @@ const getTableDate = (obj) => { searchSubmit, selectRadio, AddContentList, + PlaceOfPayList, + PlaceOfPayListTwo, searchReset, deleteModal, cancelTeacherDialog,