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:
@@ -49,3 +49,5 @@ 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=`)
|
||||
//根据userid获取讲师体系信息
|
||||
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="content">
|
||||
<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"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
v-model:checkedKeys="checkedKeys" :fieldNames="{
|
||||
@@ -101,7 +101,7 @@ import { request, useRequest} from "@/api/request";
|
||||
}
|
||||
});
|
||||
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
||||
treeAddData.value = checkedNodes.filter(node => !node.treeChildList || node.treeChildList.length === 0);
|
||||
treeAddData.value = checkedNodes;
|
||||
}
|
||||
const clearTree = () => {
|
||||
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-form-item label="是否为根节点:" name="zzfzr">
|
||||
<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="1">是</a-radio>
|
||||
</a-radio-group>
|
||||
@@ -114,35 +114,39 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="组织担当:" name="zzfzr">
|
||||
<a-select v-model:value="formParam.zzfzr" placeholder="请选择组织负责人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/>
|
||||
<a-form-item label="组织担当:" name="actValue">
|
||||
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择组织负责人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||
<ProjectManager :type="0" v-model:value="formParam.actValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.actArray" ></ProjectManager>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16" v-if="!selectValue">
|
||||
<a-row :gutter="16" v-if="!formParam.status">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="一级审批人" name="yjspr">
|
||||
<a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/>
|
||||
<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>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="二级审批人" name="zzfzr">
|
||||
<a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/>
|
||||
<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>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12" v-if="!selectValue">
|
||||
<a-form-item label="三级审批人" name="sjspr">
|
||||
<a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/>
|
||||
<a-col :span="12" v-if="!formParam.status">
|
||||
<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>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="备注" name="sjspr">
|
||||
<a-form-item label="备注" >
|
||||
<a-input v-model:value="formParam.remark" showCount :maxlength="200"
|
||||
style="width: 100%; height: 40px; border-radius: 8px" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
@@ -165,7 +169,7 @@
|
||||
<a-form-item label="">
|
||||
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
|
||||
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-col>
|
||||
</a-row>
|
||||
@@ -189,7 +193,7 @@
|
||||
</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<AddContent v-model:showContent="showContent" @AddContentList="AddContentList" />
|
||||
<AddOrgContent :Addtitle="'选择组织'" v-model:showContent="showContent" @AddContentList="AddContentList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -199,24 +203,22 @@ import {
|
||||
FolderAddOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { message } from "ant-design-vue";
|
||||
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
import dialog from "@/utils/dialog";
|
||||
import ProjectManager from "@/components/project/ProjectManagerLecturer";
|
||||
import { queryTrainOrg,deleteTrainOrg,addReviewer,updateTrainOrg} from "../../api/organization";
|
||||
import AddContent from "../../components/project/AddContent.vue"
|
||||
import AddOrgContent from "../../components/project/AddOrgContent.vue"
|
||||
export default{
|
||||
name:"organization",
|
||||
components: {
|
||||
ProjectManager,
|
||||
FolderAddOutlined,//图标--新增
|
||||
AddContent
|
||||
AddOrgContent
|
||||
|
||||
},
|
||||
setup() {
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
dataSource: [],
|
||||
selectValue: 0,
|
||||
vf:true,
|
||||
vf:true,
|
||||
showContent: false,
|
||||
tableLoading:false,
|
||||
deleteInTeacherdialog:false,
|
||||
@@ -231,11 +233,29 @@ vf:true,
|
||||
formParam:{
|
||||
trainorgId: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)=>{
|
||||
console.log(val.target.value,'val')
|
||||
if(val.target.value == 1){
|
||||
state.formParam.leveOneArray = []
|
||||
state.formParam.leveTwoArray = []
|
||||
state.formParam.leveThreeArray = []
|
||||
}
|
||||
}
|
||||
const columns = ref([
|
||||
{
|
||||
@@ -399,8 +419,16 @@ const getTableDate = (obj) => {
|
||||
state.formParam={
|
||||
trainorgId:null,
|
||||
trainorgName:null,
|
||||
remark:null ,
|
||||
kid:null
|
||||
status: 0,
|
||||
remark:null,
|
||||
orgName: null,
|
||||
orgId: null,
|
||||
actValue: null,
|
||||
actArray: [],
|
||||
leveOneValue: null,
|
||||
leveOneArray: [],
|
||||
leveTwoArray: [],
|
||||
leveThreeArray: [],
|
||||
}
|
||||
}
|
||||
async function validateField(name) {
|
||||
@@ -416,6 +444,9 @@ const getTableDate = (obj) => {
|
||||
}
|
||||
//保存
|
||||
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);
|
||||
for(let i=0;i<formItemNames.length;i++){
|
||||
const result = await validateField(formItemNames[i]);
|
||||
@@ -423,9 +454,9 @@ const getTableDate = (obj) => {
|
||||
return message.error(rules[formItemNames[i]][0].log)
|
||||
}
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
dialog({
|
||||
content: '是否确认提交,一旦提交将进入(BPM系统)审核流程。',
|
||||
ok: () => {
|
||||
if (state.vf == false) {
|
||||
updateTrainOrg(state.formParam).then(response => {
|
||||
message.success("修改成功");
|
||||
@@ -433,28 +464,24 @@ const getTableDate = (obj) => {
|
||||
cancel()
|
||||
getTableDate();
|
||||
});
|
||||
}
|
||||
else {
|
||||
addReviewer(state.formParam)
|
||||
.then((res) => {
|
||||
}else {
|
||||
addReviewer(state.formParam).then((res) => {
|
||||
message.success("保存成功");
|
||||
state.teacherdialog = false;
|
||||
cancel()
|
||||
getTableDate();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('error', error);
|
||||
});
|
||||
};
|
||||
const rules = {
|
||||
trainorgId: [{ required: true, message: '',log:'归属组织编号不能为空' }],
|
||||
trainorgName: [{ required: true, message: '',log:'归属组织名称不能为空' }],
|
||||
zzfzr: [{ required: true, message: '',log:'组织负责人不能为空' }],
|
||||
yjspr: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
||||
zzfzr: [{ required: true, message: '',log:'二级审批人不能为空' }],
|
||||
sjspr: [{ required: true, message: '',log:'三级审批人不能为空' }],
|
||||
// trainorgId: [{ required: true, message: '',log:'培训发生组织编号不能为空' }],
|
||||
// trainorgName: [{ required: true, message: '',log:'培训发生组织名称不能为空' }],
|
||||
actValue: [{ required: true, message: '',log:'组织担当不能为空' }],
|
||||
leveOneValue: [{ required: true, message: '"',log:'一级审批人不能为空' }],
|
||||
// zzfzr: [{ required: true, message: '',log:'二级审批人不能为空' }],
|
||||
// sjspr: [{ required: true, message: '',log:'三级审批人不能为空' }],
|
||||
|
||||
|
||||
}
|
||||
@@ -468,6 +495,7 @@ const getTableDate = (obj) => {
|
||||
getTableDate,
|
||||
searchSubmit,
|
||||
selectRadio,
|
||||
AddContentList,
|
||||
searchReset,
|
||||
deleteModal,
|
||||
cancelTeacherDialog,
|
||||
|
||||
Reference in New Issue
Block a user