培训发生组织基本联调完毕

This commit is contained in:
zhangsir
2024-10-26 15:34:26 +08:00
parent 7d510a2c25
commit 80342c0862
5 changed files with 398 additions and 70 deletions

View File

@@ -22,11 +22,13 @@
</a-button>
</div>
<a-table style="border: 1px solid #f2f6fe" :columns="columns" :data-source="tableData" :loading="tableLoading"
@expand="expandTable" :pagination="false">
@expand="expandTable" :pagination="false">
<template #bodyCell="{ record, column }">
<template v-if="column.key === 'operation'">
<a-space >
<a-button type="link" @click="() => handleModify(record, String(record.courseform))">查看</a-button>
<lockLecturer :id="record.id" :title="'培训发生组织详情'">
<div style="color: #1890ff;">查看</div>
</lockLecturer>
<a-button type="link" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button>
</a-space>
@@ -86,15 +88,15 @@
</a-row>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="培训发生组织编号:" name="trainOrgId">
<a-input disabled v-model:value="formParam.trainOrgId" class="draitem"
<a-form-item label="培训发生组织编号:" name="affiliationCode">
<a-input disabled v-model:value="formParam.affiliationCode" class="draitem"
placeholder="请输入讲师体系编号" allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="培训发生组织名称:" name="trainOrgName">
<a-input v-model:value="formParam.trainOrgName" class="draitem"
<a-form-item label="培训发生组织名称:" name="affiliationName">
<a-input v-model:value="formParam.affiliationName" class="draitem"
placeholder="请输入讲师体系名称" allowClear showSearch>
</a-input>
</a-form-item>
@@ -126,14 +128,14 @@
<a-form-item label="一级审批人" name="leveOneValue">
<!-- <a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
:options="PlaceOfPayList" allowClear showSearch/> -->
<ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager>
<ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择一级审批人'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="二级审批人">
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
:options="PlaceOfPayList" allowClear showSearch/> -->
<ProjectManager :type="1" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager>
<ProjectManager :type="1" :placeholder="'请选择二级审批人'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager>
</a-form-item>
</a-col>
</a-row>
@@ -142,7 +144,7 @@
<a-form-item label="三级审批人" >
<!-- <a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
:options="PlaceOfPayList" allowClear showSearch/> -->
<ProjectManager :type="1" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager>
<ProjectManager :type="1" :placeholder="'请选择三级审批人'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager>
</a-form-item>
</a-col>
<a-col :span="12">
@@ -194,7 +196,6 @@
</div>
</a-drawer>
<AddOrgContent :Addtitle="'选择组织'" v-model:showContent="showContent" v-model:AddContentList="formParam.affiliationOrgList" />
</div>
</template>
<script lang="jsx">
@@ -208,12 +209,14 @@ import ProjectManager from "@/components/project/ProjectManagerLecturer";
import { queryTrainOrg,deleteTrainOrg,addReviewer,updateTrainOrg} from "../../api/organization";
import AddOrgContent from "../../components/project/AddOrgContent.vue"
import * as lecturer from "../../api/Lecturer.js";
import lockLecturer from "@/components/project/lockLecturer"
export default{
name:"organization",
components: {
ProjectManager,
FolderAddOutlined,//图标--新增
AddOrgContent
AddOrgContent,
lockLecturer
},
setup() {
@@ -232,12 +235,10 @@ export default{
pageSize: "10"
},
formParam:{
trainOrgId:null,
trainOrgName:null,
affiliationCode:null,
affiliationName:null,
isParent: 1,
remark:null,
orgName: null,
orgId: null,
actValue: null,
actArray: [],
leveOneValue: null,
@@ -267,68 +268,82 @@ export default{
const columns = ref([
{
title: '培训发生组织编号 ',
dataIndex: 'trainOrgId',
key: 'trainOrgId',
elipsis: true,
dataIndex: 'affiliationCode',
key: 'affiliationCode',
ellipsis: true,
align: "center",
width: 200,
},
{
title: '培训发生组织名称 ',
dataIndex: 'trainOrgName',
key: 'trainOrgName',
elipsis: true, align: "center",
width: 600,
dataIndex: 'affiliationName',
key: 'affiliationName',
ellipsis: true, align: "center",
width: 200,
},
{
title: '是否为根节点(未命名) ',
dataIndex: 'remark',
key: 'remark',
elipsis: true, align: "center",
width: 800,
dataIndex: 'isParent',
key: 'isParent',
ellipsis: true, align: "center",
width: 200,
customRender: ({text})=>{
return (
text != 1 ? "是" : "否"
)
},
},
{
title: '担当(未命名) ',
dataIndex: 'remark',
key: 'remark',
elipsis: true, align: "center",
width: 800,
dataIndex: 'leaderName',
key: 'leaderName',
ellipsis: true,
align: "center",
width: 200,
},
{
title: '状态(未命名) ',
dataIndex: 'remark',
key: 'remark',
elipsis: true, align: "center",
width: 800,
}, {
title: '备注 ',
dataIndex: 'remark',
key: 'remark',
elipsis: true, align: "center",
width: 800,
dataIndex: 'type',
key: 'type',
ellipsis: true, align: "center",
width: 160,
customRender: ({text})=>{
switch (text) {
case '1':
return <span>待审核</span>;
case '2':
return <span>审核中</span>;
case '3':
return <span>已完成</span>;
case '4':
return <span style={{ color: "red" }}>审核失败</span>;
default:
return <span>-</span>;
}
},
},
{
title: '备注 ',
dataIndex: 'remark',
key: 'remark',
elipsis: true, align: "center",
width: 800,
ellipsis: true, align: "center",
width: 160,
},
{
title: '操作 ',
dataIndex: 'operation',
key: 'operation',
elipsis: true,
width: 400,
align: "right",
width: 200,
align: "center",
fixed: 'right',
scopedSlots: { customRender: "action" },
},
])
const orgColumns = ref([
{
title: '组织名称',
dataIndex: 'name',
key: 'name',
dataIndex: 'orgName',
key: 'orgName',
},
{
title: '是否被培训发生组织选择',
@@ -390,8 +405,19 @@ const getTableDate = (obj) => {
};
//删除弹窗
const deleteModal = (record) => {
state.deleteInTeacherdialog = true
state.delId = record.kid
dialog({
content: '是否确认进行删除 ?',
ok: () => {
lecturer.affiliationDelById(record.id).then(res=>{
console.log(res,'res')
message.success("删除成功")
getTableDate();
}).catch(err=>{
console.log(err,'errr')
message.error(err.msg)
})
}
})
};
//确认删除
const closeDeleteTeacher = () => {
@@ -410,8 +436,8 @@ const getTableDate = (obj) => {
formRef.value.resetFields();
state.teacherdialog = false
cancel()
}
cancel()
state.deleteInTeacherdialog = false
state.editTeacher = false
};
@@ -420,7 +446,7 @@ const getTableDate = (obj) => {
state.teacherdialogtitle="新增归属组织"
state.vf = true
lecturer.getAffiliationCode().then(res=>{
state.formParam.trainOrgId = res.data.data
state.formParam.affiliationCode = res.data.data
}).catch(()=>{
message.error('获取归属组织编号失败')
})
@@ -430,25 +456,60 @@ const getTableDate = (obj) => {
}
//修改信息弹窗
const handleModify = (record) => {
state.teacherdialog = true;
state.teacherdialogtitle = '修改归属组织'
state.formParam.kid= record.kid
state.vf = false
TeacherSystem(record)
lecturer.getAffiliationById(record.id).then(res=>{
console.log(res,'resssss')
state.formParam = res.data.data
const actArray = res.data.data.affiliationUserList.filter(item=>item.type == 0)
const leveOneArray = res.data.data.affiliationUserList.filter(item=>item.type == 1)
const leveTwoArray = res.data.data.affiliationUserList.filter(item=>item.type == 2)
const leveThreeArray = res.data.data.affiliationUserList.filter(item=>item.type == 3)
state.formParam.actArray = actArray.map(item => {
return {
label: item.userName + item.userNo,
value: item.userId,
...item
};
});
state.formParam.actValue = state.formParam.actArray.map(item => item.label).join(',');
state.formParam.leveOneArray = leveOneArray.map(item => {
return {
label: item.userName + item.userNo,
value: item.userId,
...item
};
});
state.formParam.leveOneValue = state.formParam.leveOneArray.map(item => item.label).join(',');
state.formParam.leveTwoArray = leveTwoArray.map(item => {
return {
label: item.userName + item.userNo,
value: item.userId,
...item
};
});
state.formParam.leveThreeArray = leveThreeArray.map(item => {
return {
label: item.userName + item.userNo,
value: item.userId,
...item
};
});
state.teacherdialog = true;
state.teacherdialogtitle = '修改归属组织'
state.vf = false
})
// TeacherSystem(record)
}
const TeacherSystem =(record)=>{
state.formParam.trainOrgId=record.trainOrgId
state.formParam.trainOrgName=record.trainOrgName
state.formParam.affiliationCode=record.affiliationCode
state.formParam.affiliationName=record.affiliationName
state.formParam.remark=record.remark
}
const cancel=()=>{
state.formParam={
trainOrgId:null,
trainOrgName:null,
isParent: 0,
affiliationCode:null,
affiliationName:null,
isParent: 1,
remark:null,
orgName: null,
orgId: null,
actValue: null,
actArray: [],
leveOneValue: null,
@@ -456,7 +517,7 @@ const getTableDate = (obj) => {
leveTwoArray: [],
leveThreeArray: [],
code: null,
affiliationOrgList: []
affiliationOrgList: [],
}
}
async function validateField(name) {
@@ -503,8 +564,8 @@ const getTableDate = (obj) => {
})
};
const rules = {
trainOrgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
trainOrgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
affiliationCode: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
affiliationName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
code: [{ required: true, message: '',log:'根节点不能为空' }],
actValue: [{ required: true, message: '',log:'组织担当不能为空' }],
leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }],