mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
培训发生组织创建抽屉修改
This commit is contained in:
@@ -48,4 +48,6 @@ export const getTeacherByDepartId = (obj) => http.get(`/admin/thirdApi/user/list
|
|||||||
//根据姓名工号查询讲师
|
//根据姓名工号查询讲师
|
||||||
export const getTeacherByNameOrUserNo = (obj) => http.get(`/admin/thirdApi/user/list?keyword=${obj.nameOrUserNo}&pageNo=1&pageSize=50&departId=`)
|
export const getTeacherByNameOrUserNo = (obj) => http.get(`/admin/thirdApi/user/list?keyword=${obj.nameOrUserNo}&pageNo=1&pageSize=50&departId=`)
|
||||||
//根据userid获取讲师体系信息
|
//根据userid获取讲师体系信息
|
||||||
export const getSystemInfoByUserId = (id) => http.get(`/admin/system/getSystemInfoByUserId?id=${id}`)
|
export const getSystemInfoByUserId = (id) => http.get(`/admin/system/getSystemInfoByUserId?id=${id}`)
|
||||||
|
//讲师搜索
|
||||||
|
export const getUserList = (keyword) => http.get(`/admin/thirdApi/user/list?pageNo=${1}&pageSize=${30}&keyword=${keyword}`)
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<a-tree checkable :tree-data="treeData" :loading="orgLoading"
|
<a-tree checkable checkStrictly :tree-data="treeData" :loading="orgLoading"
|
||||||
:load-data="onLoadData" v-model:expandedKeys="expandedKeys"
|
:load-data="onLoadData" v-model:expandedKeys="expandedKeys"
|
||||||
v-model:selectedKeys="selectedKeys"
|
v-model:selectedKeys="selectedKeys"
|
||||||
v-model:checkedKeys="checkedKeys" :fieldNames="{
|
v-model:checkedKeys="checkedKeys" :fieldNames="{
|
||||||
@@ -101,7 +101,7 @@ import { request, useRequest} from "@/api/request";
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
||||||
treeAddData.value = checkedNodes.filter(node => !node.treeChildList || node.treeChildList.length === 0);
|
treeAddData.value = checkedNodes;
|
||||||
}
|
}
|
||||||
const clearTree = () => {
|
const clearTree = () => {
|
||||||
treeAddData.value = [];
|
treeAddData.value = [];
|
||||||
|
|||||||
108
src/components/project/ProjectManagerLecturer.vue
Normal file
108
src/components/project/ProjectManagerLecturer.vue
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<template>
|
||||||
|
<a-select
|
||||||
|
:getPopupContainer="
|
||||||
|
(triggerNode) => {
|
||||||
|
return triggerNode.parentNode || document.body;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
v-model:value="managerArray"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:options="options"
|
||||||
|
allowClear
|
||||||
|
showSearch
|
||||||
|
mode="multiple"
|
||||||
|
:disabled="disabled"
|
||||||
|
@search="searchMember"
|
||||||
|
@change="change"
|
||||||
|
@blur="blur"
|
||||||
|
@focus="focus"
|
||||||
|
:show-arrow="true"
|
||||||
|
style="width: 100%"
|
||||||
|
:maxTagTextLength="3"
|
||||||
|
:maxTagCount="4"
|
||||||
|
>
|
||||||
|
<template v-if="loading" #notFoundContent>
|
||||||
|
<a-spin size="small"/>
|
||||||
|
</template>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {computed, defineEmits, defineProps, onMounted, ref, watch} from "vue";
|
||||||
|
import {throttle} from "@/api/method";
|
||||||
|
import {getUserList} from "@/api/Lecturer.js";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
disabled: Boolean,
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: "请输入搜索关键字",
|
||||||
|
},
|
||||||
|
arrayList:{
|
||||||
|
type: Array,
|
||||||
|
default: ()=>[]
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const emit = defineEmits({})
|
||||||
|
const managerArray = ref([])
|
||||||
|
const loading = ref(false)
|
||||||
|
onMounted(()=>{
|
||||||
|
managerArray.value = props.arrayList
|
||||||
|
options.value = props.arrayList
|
||||||
|
})
|
||||||
|
const options = ref([])
|
||||||
|
const getList = () => {
|
||||||
|
getUserList(keyword.value).then(res=>{
|
||||||
|
loading.value = false
|
||||||
|
if(res.data.code == 200){
|
||||||
|
options.value = res.data.data.list.map(e => ({
|
||||||
|
label: e.realName + e.userNo,
|
||||||
|
value: e.id,
|
||||||
|
userId: e.id,
|
||||||
|
userNo: e.userNo,
|
||||||
|
userName: e.realName,
|
||||||
|
}))
|
||||||
|
console.log(options.value,'xixixixi')
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
loading.value = false
|
||||||
|
options.value =[]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const throttList = throttle(getList, 600);
|
||||||
|
const keyword = ref('')
|
||||||
|
//搜索学员
|
||||||
|
const searchMember = (val) => {
|
||||||
|
options.value = []
|
||||||
|
loading.value = true
|
||||||
|
keyword.value = val
|
||||||
|
throttList()
|
||||||
|
};
|
||||||
|
const focus = () => {
|
||||||
|
options.value =[]
|
||||||
|
loading.value = true
|
||||||
|
keyword.value = ''
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
function blur() {
|
||||||
|
keyword.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
function change(e, l) {
|
||||||
|
console.log(e, l,'xixixixiixix')
|
||||||
|
keyword.value = ''
|
||||||
|
l?.map(item => item.type = props.type)
|
||||||
|
if (Array.isArray(l)) {
|
||||||
|
emit('update:arrayList',l)
|
||||||
|
emit('update:value', l.map(t => t.value).join(','))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="是否为根节点:" name="zzfzr">
|
<a-form-item label="是否为根节点:" name="zzfzr">
|
||||||
<div style="display: flex;align-items: center;">
|
<div style="display: flex;align-items: center;">
|
||||||
<a-radio-group style="min-width:126px;" @change="selectRadio" v-model:value="selectValue" name="radioGroup">
|
<a-radio-group style="min-width:126px;" @change="selectRadio" v-model:value="formParam.status" name="radioGroup">
|
||||||
<a-radio :value="0">否</a-radio>
|
<a-radio :value="0">否</a-radio>
|
||||||
<a-radio :value="1">是</a-radio>
|
<a-radio :value="1">是</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
@@ -114,35 +114,39 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="组织担当:" name="zzfzr">
|
<a-form-item label="组织担当:" name="actValue">
|
||||||
<a-select v-model:value="formParam.zzfzr" placeholder="请选择组织负责人"
|
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择组织负责人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/>
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
|
<ProjectManager :type="0" v-model:value="formParam.actValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.actArray" ></ProjectManager>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16" v-if="!selectValue">
|
<a-row :gutter="16" v-if="!formParam.status">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="一级审批人" name="yjspr">
|
<a-form-item label="一级审批人" name="leveOneValue">
|
||||||
<a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
<!-- <a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/>
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
|
<ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="二级审批人" name="zzfzr">
|
<a-form-item label="二级审批人">
|
||||||
<a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/>
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
|
<ProjectManager :type="1" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="12" v-if="!selectValue">
|
<a-col :span="12" v-if="!formParam.status">
|
||||||
<a-form-item label="三级审批人" name="sjspr">
|
<a-form-item label="三级审批人" >
|
||||||
<a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
<!-- <a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
||||||
:options="PlaceOfPayList" allowClear showSearch/>
|
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||||
|
<ProjectManager :type="1" :placeholder="'请选择担当'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="备注" name="sjspr">
|
<a-form-item label="备注" >
|
||||||
<a-input v-model:value="formParam.remark" showCount :maxlength="200"
|
<a-input v-model:value="formParam.remark" showCount :maxlength="200"
|
||||||
style="width: 100%; height: 40px; border-radius: 8px" placeholder="请输入" />
|
style="width: 100%; height: 40px; border-radius: 8px" placeholder="请输入" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -165,7 +169,7 @@
|
|||||||
<a-form-item label="">
|
<a-form-item label="">
|
||||||
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
|
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
|
||||||
style="width: 100%; height: 100px; border-radius: 8px" placeholder="请输入" /> -->
|
style="width: 100%; height: 100px; border-radius: 8px" placeholder="请输入" /> -->
|
||||||
<a-table :dataSource="dataSource" :columns="orgColumns"/>
|
<a-table :dataSource="orgList" :columns="orgColumns"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -189,7 +193,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
<AddContent v-model:showContent="showContent" @AddContentList="AddContentList" />
|
<AddOrgContent :Addtitle="'选择组织'" v-model:showContent="showContent" @AddContentList="AddContentList" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -199,43 +203,59 @@ import {
|
|||||||
FolderAddOutlined
|
FolderAddOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
|
import dialog from "@/utils/dialog";
|
||||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
import ProjectManager from "@/components/project/ProjectManagerLecturer";
|
||||||
import { queryTrainOrg,deleteTrainOrg,addReviewer,updateTrainOrg} from "../../api/organization";
|
import { queryTrainOrg,deleteTrainOrg,addReviewer,updateTrainOrg} from "../../api/organization";
|
||||||
import AddContent from "../../components/project/AddContent.vue"
|
import AddOrgContent from "../../components/project/AddOrgContent.vue"
|
||||||
export default{
|
export default{
|
||||||
name:"organization",
|
name:"organization",
|
||||||
components: {
|
components: {
|
||||||
ProjectManager,
|
ProjectManager,
|
||||||
FolderAddOutlined,//图标--新增
|
FolderAddOutlined,//图标--新增
|
||||||
AddContent
|
AddOrgContent
|
||||||
|
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
dataSource: [],
|
vf:true,
|
||||||
selectValue: 0,
|
showContent: false,
|
||||||
vf:true,
|
tableLoading:false,
|
||||||
showContent: false,
|
deleteInTeacherdialog:false,
|
||||||
tableLoading:false,
|
teacherdialog:false,
|
||||||
deleteInTeacherdialog:false,
|
teacherdialogtitle:null,
|
||||||
teacherdialog:false,
|
delId:null,
|
||||||
teacherdialogtitle:null,
|
searchParam: {
|
||||||
delId:null,
|
name:null,
|
||||||
searchParam: {
|
pageNo: "1",
|
||||||
name:null,
|
pageSize: "10"
|
||||||
pageNo: "1",
|
|
||||||
pageSize: "10"
|
|
||||||
},
|
},
|
||||||
formParam:{
|
formParam:{
|
||||||
trainorgId:null,
|
trainorgId:null,
|
||||||
trainorgName:null,
|
trainorgName:null,
|
||||||
remark:null
|
status: 0,
|
||||||
}
|
remark:null,
|
||||||
|
orgName: null,
|
||||||
|
orgId: null,
|
||||||
|
actValue: null,
|
||||||
|
actArray: [],
|
||||||
|
leveOneValue: null,
|
||||||
|
leveOneArray: [],
|
||||||
|
leveTwoArray: [],
|
||||||
|
leveThreeArray: [],
|
||||||
|
},
|
||||||
|
orgList: [],
|
||||||
})
|
})
|
||||||
|
const AddContentList = (val) => {
|
||||||
|
console.log(val,'val')
|
||||||
|
state.orgList = val
|
||||||
|
}
|
||||||
const selectRadio = (val)=>{
|
const selectRadio = (val)=>{
|
||||||
console.log(val.target.value,'val')
|
if(val.target.value == 1){
|
||||||
|
state.formParam.leveOneArray = []
|
||||||
|
state.formParam.leveTwoArray = []
|
||||||
|
state.formParam.leveThreeArray = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
@@ -396,11 +416,19 @@ const getTableDate = (obj) => {
|
|||||||
state.formParam.remark=record.remark
|
state.formParam.remark=record.remark
|
||||||
}
|
}
|
||||||
const cancel=()=>{
|
const cancel=()=>{
|
||||||
state.formParam={
|
state.formParam={
|
||||||
trainorgId:null,
|
trainorgId:null,
|
||||||
trainorgName:null,
|
trainorgName:null,
|
||||||
remark:null ,
|
status: 0,
|
||||||
kid:null
|
remark:null,
|
||||||
|
orgName: null,
|
||||||
|
orgId: null,
|
||||||
|
actValue: null,
|
||||||
|
actArray: [],
|
||||||
|
leveOneValue: null,
|
||||||
|
leveOneArray: [],
|
||||||
|
leveTwoArray: [],
|
||||||
|
leveThreeArray: [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function validateField(name) {
|
async function validateField(name) {
|
||||||
@@ -416,6 +444,9 @@ const getTableDate = (obj) => {
|
|||||||
}
|
}
|
||||||
//保存
|
//保存
|
||||||
const createTeacherDialog = async () => {
|
const createTeacherDialog = async () => {
|
||||||
|
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);
|
const formItemNames = Object.keys(rules);
|
||||||
for(let i=0;i<formItemNames.length;i++){
|
for(let i=0;i<formItemNames.length;i++){
|
||||||
const result = await validateField(formItemNames[i]);
|
const result = await validateField(formItemNames[i]);
|
||||||
@@ -423,38 +454,34 @@ const getTableDate = (obj) => {
|
|||||||
return message.error(rules[formItemNames[i]][0].log)
|
return message.error(rules[formItemNames[i]][0].log)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
formRef.value
|
dialog({
|
||||||
.validate()
|
content: '是否确认提交,一旦提交将进入(BPM系统)审核流程。',
|
||||||
.then(() => {
|
ok: () => {
|
||||||
if (state.vf == false) {
|
if (state.vf == false) {
|
||||||
updateTrainOrg(state.formParam).then(response => {
|
updateTrainOrg(state.formParam).then(response => {
|
||||||
message.success("修改成功");
|
message.success("修改成功");
|
||||||
state.teacherdialog = false;
|
state.teacherdialog = false;
|
||||||
cancel()
|
cancel()
|
||||||
getTableDate();
|
getTableDate();
|
||||||
});
|
});
|
||||||
}
|
}else {
|
||||||
else {
|
addReviewer(state.formParam).then((res) => {
|
||||||
addReviewer(state.formParam)
|
|
||||||
.then((res) => {
|
|
||||||
message.success("保存成功");
|
message.success("保存成功");
|
||||||
state.teacherdialog = false;
|
state.teacherdialog = false;
|
||||||
cancel()
|
cancel()
|
||||||
getTableDate();
|
getTableDate();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.catch(() => {
|
})
|
||||||
console.log('error', error);
|
};
|
||||||
});
|
|
||||||
};
|
|
||||||
const rules = {
|
const rules = {
|
||||||
trainorgId: [{ required: true, message: '',log:'归属组织编号不能为空' }],
|
// trainorgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
|
||||||
trainorgName: [{ required: true, message: '',log:'归属组织名称不能为空' }],
|
// trainorgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
|
||||||
zzfzr: [{ required: true, message: '',log:'组织负责人不能为空' }],
|
actValue: [{ required: true, message: '',log:'组织担当不能为空' }],
|
||||||
yjspr: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
||||||
zzfzr: [{ required: true, message: '',log:'二级审批人不能为空' }],
|
// zzfzr: [{ required: true, message: '',log:'二级审批人不能为空' }],
|
||||||
sjspr: [{ required: true, message: '',log:'三级审批人不能为空' }],
|
// sjspr: [{ required: true, message: '',log:'三级审批人不能为空' }],
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -468,6 +495,7 @@ const getTableDate = (obj) => {
|
|||||||
getTableDate,
|
getTableDate,
|
||||||
searchSubmit,
|
searchSubmit,
|
||||||
selectRadio,
|
selectRadio,
|
||||||
|
AddContentList,
|
||||||
searchReset,
|
searchReset,
|
||||||
deleteModal,
|
deleteModal,
|
||||||
cancelTeacherDialog,
|
cancelTeacherDialog,
|
||||||
|
|||||||
Reference in New Issue
Block a user