Merge branch 'zcwy-teacher-manage' of https://codeup.aliyun.com/648097ddb583fece2f059e59/vue/fe-manage into zcwy-teacher-manage

This commit is contained in:
wangxuemei
2024-11-15 14:50:27 +08:00
4 changed files with 121 additions and 51 deletions

View File

@@ -82,4 +82,4 @@ export const isConfirm = (obj) => http.post('/admin/expenseBill/isConfirm',obj)
//培训发生组织根节点列表 //培训发生组织根节点列表
export const parentList = () => http.get('/admin/affiliation/parentList') export const parentList = () => http.get('/admin/affiliation/parentList')
//讲师级别获取 //讲师级别获取
export const getAllLevelList = () => http.get(' /admin/system/getAllLevelList') export const getAllLevelList = () => http.get('/admin/system/getAllLevelList')

View File

@@ -228,7 +228,7 @@ const searchMember = (keyword) => {
level: item.name+'('+item.userNo+')'+item.sLevelName, level: item.name+'('+item.userNo+')'+item.sLevelName,
key: item.id, key: item.id,
orgName: item.orgName, orgName: item.orgName,
orgId: item.departId, orgId: item.orgId,
tSystemName:item.tsystemName, tSystemName:item.tsystemName,
sLevelName:item.sLevelName, sLevelName:item.sLevelName,
payrollPlaceCode: item.salaryId, payrollPlaceCode: item.salaryId,

View File

@@ -112,8 +112,16 @@
</div> </div>
</div> </div>
<!-- 弹窗组件 --> <!-- 弹窗组件 -->
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true" <a-drawer v-model:visible="teacherdialog" placement="right" :closable="false" :maskClosable="false"
width="40%" :title="teacherdialogtitle"> width="40%" :title="false">
<div class="headers">
<div class="headerTitle">{{ teacherdialogtitle }}</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="@/assets/images/basicinfo/close.png"
@click="cancelTeacherDialog"
/>
</div>
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef"> <a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
@@ -127,12 +135,13 @@
<a-upload :disabled="!formParam.name" name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false" <a-upload :disabled="!formParam.name" name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers" :before-upload="beforeUpload"> :headers="headers" :before-upload="beforeUpload">
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" /> <img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" />
<div class="i_upload" v-else> <img class="i_upload_img" v-else src="../../assets/avatar.png" alt="avatar" title="更换头像" />
<!-- <div class="i_upload" v-else>
<div class="addimg"> <div class="addimg">
<div class="heng"></div> <div class="heng"></div>
<div class="shu"></div> <div class="shu"></div>
</div> </div>
</div> </div> -->
</a-upload> </a-upload>
</div> </div>
<div class="i_bottom"> <div class="i_bottom">
@@ -450,7 +459,7 @@ export default {
certStatus: 0,//认证状态 certStatus: 0,//认证状态
defaultTeachingTime: null, defaultTeachingTime: null,
teacherType:1, teacherType:1,
photo: avatar, photo: null,
orgLists: [], orgLists: [],
certification: null, certification: null,
certificationName: null, certificationName: null,
@@ -634,7 +643,7 @@ export default {
let array = []; let array = [];
arr.map((value) => { arr.map((value) => {
let obj = { let obj = {
value: value.levelCode, value: value.levelName,
label: value.levelName, label: value.levelName,
}; };
array.push(obj); array.push(obj);
@@ -904,7 +913,7 @@ export default {
cancel() cancel()
state.teacherdialog = true; state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师' state.teacherdialogtitle = '新增讲师'
state.formParam.photo = avatar state.formParam.photo = null
state.formParam.status = '1' state.formParam.status = '1'
state.vf = true state.vf = true
} }
@@ -1196,7 +1205,7 @@ export default {
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.workExp0erience = state.formParam.workExperience === null ? '' : state.formParam.workExperience state.formParam.workExp0erience = state.formParam.workExperience === null ? '' : state.formParam.workExperience
state.formParam.courses = state.formParam.courses === null ? '' : state.formParam.courses state.formParam.courses = state.formParam.courses === null ? '' : state.formParam.courses
state.formParam.photo = state.formParam.photo === null ? avatar : state.formParam.photo // state.formParam.photo = state.formParam.photo === null ? avatar : state.formParam.photo
state.tSystemNames.systemName = res.data.data.tsystemName state.tSystemNames.systemName = res.data.data.tsystemName
state.tSystemNames.systemId = res.data.data.tsystemId state.tSystemNames.systemId = res.data.data.tsystemId
state.tSystemNames.systemCode = res.data.data.systemCode state.tSystemNames.systemCode = res.data.data.systemCode
@@ -1328,6 +1337,24 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.headers {
height: 73px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
margin-bottom: 20px;
flex-shrink: 0;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
// margin-left: 24px;
}
}
.selectonlineface{ .selectonlineface{
z-index: 999; z-index: 999;
width: 679px; width: 679px;

View File

@@ -155,8 +155,16 @@
</div> </div>
</div> </div>
<!-- 弹窗组件 --> <!-- 弹窗组件 -->
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true" dropdown-style="drawaer" <a-drawer v-model:visible="teacherdialog" placement="right" :closable="false" :maskClosable="false" dropdown-style="drawaer"
width="60%" :title="teacherdialogtitle"> width="60%" :title="false">
<div class="headers">
<div class="headerTitle">{{ teacherdialogtitle }}</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="@/assets/images/basicinfo/close.png"
@click="cancelTeacherDialog"
/>
</div>
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef" > <a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef" >
<!-- 讲师姓名 name 讲师工号 userNo--> <!-- 讲师姓名 name 讲师工号 userNo-->
<a-row :gutter="16"> <a-row :gutter="16">
@@ -164,7 +172,7 @@
<a-form-item label="讲师名称" name="name"> <a-form-item label="讲师名称" name="name">
<SearchTeacher :disabled="!!id" @tlevel="tlevelChange" v-model:id="formParam.teacherId" v-model:value="formParam.name" v-model:orgId="formParam.orgId" v-model:lable="formParam.orgNames" v-model:user="formParam.userNo" <SearchTeacher :disabled="!!id" @tlevel="tlevelChange" v-model:id="formParam.teacherId" v-model:value="formParam.name" v-model:orgId="formParam.orgId" v-model:lable="formParam.orgNames" v-model:user="formParam.userNo"
v-model:system="tSystemNames" v-model:payrollPlaceCode="formParam.payrollPlaceId" v-model:system="tSystemNames" v-model:payrollPlaceCode="formParam.payrollPlaceId"
v-model:payrollPlaceName="formParam.payrollPlace" v-model:level="formParam.tlevelId" ></SearchTeacher> v-model:payrollPlaceName="formParam.payrollPlace" ></SearchTeacher>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@@ -179,15 +187,15 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="讲师组织" name="orgName"> <a-form-item label="讲师组织" name="orgName">
<a-popover> <!-- <a-popover>
<template #content> <template #content>
{{ formParam.orgNames }} {{ formParam.orgNames }}
</template> </template> -->
<a-input disabled v-model:value="formParam.orgName" class="draitem" <a-input :title="formParam.orgNames" disabled v-model:value="formParam.orgName" class="draitem"
placeholder="自动带出讲师的组织,展示主要部分,鼠标浮上去展示所有" allowClear showSearch> placeholder="自动带出讲师的组织,展示主要部分,鼠标浮上去展示所有" allowClear showSearch>
</a-input> </a-input>
</a-popover> <!-- </a-popover> -->
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@@ -243,37 +251,37 @@
</a-row> </a-row>
<!-- 授课日期 teachingDate 授课时长 teachingTime --> <!-- 授课日期 teachingDate 授课时长 teachingTime -->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12">
<a-form-item label="课程归属组织" name="sourceBelongId">
<OrgClass
v-model:value="formParam.sourceBelongId"
v-model:name="formParam.sourceBelongFullName"
></OrgClass>
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="授课/课程日期 :" name="teachingDate"> <a-form-item label="授课/课程日期 :" name="teachingDate">
<a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD HH:mm" <a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD HH:mm"
placeholder="请选择课程日期" /> placeholder="请选择课程日期" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<!-- 参训人数 studys 评分 score -->
<a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="授课时长" name="teachingTime"> <a-form-item label="授课时长" name="teachingTime">
<a-input v-model:value="formParam.teachingTime" style="width:80%; height: 40px; border-radius: 8px; " <a-input v-model:value="formParam.teachingTime" style="width:80%; height: 40px; border-radius: 8px; "
@blur="clearNonNumber" placeholder="0" allowClear showSearch suffix="分钟"> @blur="clearNonNumber" placeholder="请输入授课分钟数" allowClear showSearch suffix="分钟">
</a-input> </a-input>
<span style="margin-left: 5px ;" v-if="formParam.teachingTime != null">{{ <span style="margin-left: 5px ;" v-if="formParam.teachingTime != null">{{
(formParam.teachingTime / 60).toFixed(2) }}小时</span> (formParam.teachingTime / 60).toFixed(2) }}小时</span>
<span style="margin-left: 5px ;" v-if="formParam.teachingTime == null">0.00小时</span> <span style="margin-left: 5px ;" v-if="formParam.teachingTime == null">0.00小时</span>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<!-- 参训人数 studys 评分 score -->
<a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="参训人数" name="studys"> <a-form-item label="参训人数" name="studys">
<a-input v-model:value="formParam.studys" class="draitem" @blur="clearstudysNumber" <a-input v-model:value="formParam.studys" class="draitem" @blur="clearstudysNumber"
placeholder="0 " allowClear showSearch > placeholder="请输入参训人数" allowClear showSearch >
</a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="评分" name="score">
<a-input class="draitem" v-model:value="formParam.score" placeholder="0"
@blur="clearscoreNumber" allowClear
showSearch >
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -281,27 +289,35 @@
<!-- 课酬基准 计划费用 expense--> <!-- 课酬基准 计划费用 expense-->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="课酬基准" name="levelPay"> <a-form-item label="评分" name="score">
<a-input v-model:value="formParam.levelPay" placeholder="自动键入" <a-input class="draitem" v-model:value="formParam.score" placeholder="请输入评分"
@blur="clearlevelPayNumber" @blur="clearscoreNumber" allowClear
allowClear showSearch class="draitem"> showSearch >
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="计划费用" name="expense"> <a-form-item label="课酬基准" name="levelPay">
<a-input class="draitem" v-model:value="formParam.expense" placeholder="" allowClear disabled <a-input v-model:value="formParam.levelPay" placeholder="自动键入系统基准(可手动更改)"
showSearch> @blur="clearlevelPayNumber"
allowClear showSearch class="draitem">
</a-input> </a-input>
</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="24"> <a-col :span="12">
<a-form-item label="计划费用" name="expense">
<a-input class="draitem" v-model:value="formParam.expense" placeholder="自动计算( 授课时长(或课程时长)*课酬基准 " allowClear disabled
showSearch>
</a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="应发费用" name="payableExpense"> <a-form-item label="应发费用" name="payableExpense">
<a-input v-model:value="formParam.payableExpense" class="draitem" <a-input @blur="payExpense" v-model:value="formParam.payableExpense" class="draitem"
placeholder="0 " allowClear showSearch> placeholder="请输入应发费用" allowClear showSearch>
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -445,7 +461,8 @@
import ConfirmLecturer from "@/components/project/ConfirmLecturer" import ConfirmLecturer from "@/components/project/ConfirmLecturer"
import BatchLecturer from "@/components/project/BatchLecturer" import BatchLecturer from "@/components/project/BatchLecturer"
import { queryTrainOrg,} from "../../api/organization"; import { queryTrainOrg,} from "../../api/organization";
import dialog from '@/utils/dialog' import dialog from '@/utils/dialog';
import OrgClass from "@/components/project/OrgClass";
export default { export default {
name: "LecturerFee", name: "LecturerFee",
components: { components: {
@@ -458,6 +475,7 @@
ImportWork, ImportWork,
ConfirmLecturer, ConfirmLecturer,
BatchLecturer, BatchLecturer,
OrgClass,
}, },
setup() { setup() {
const formRef = ref(); const formRef = ref();
@@ -501,6 +519,8 @@
userNo: null, userNo: null,
payrollPlace: null, payrollPlace: null,
payrollPlaceId: null, payrollPlaceId: null,
sourceBelongId: null,
sourceBelongFullName: null,
}, },
searchdate: null, //选择时间 searchdate: null, //选择时间
allsearchdate: null, //选择时间 allsearchdate: null, //选择时间
@@ -607,7 +627,7 @@ getAllLevelList().then((res) => {
let array = []; let array = [];
arr.map((value) => { arr.map((value) => {
let obj = { let obj = {
value: value.levelCode, value: value.levelName,
label: value.levelName, label: value.levelName,
}; };
array.push(obj); array.push(obj);
@@ -872,6 +892,7 @@ getAllLevelList().then((res) => {
]) ])
// 搜索 // 搜索
const searchSubmit = () => { const searchSubmit = () => {
state.searchParam.pageNo = 1
getTableDate(); getTableDate();
}; };
//重置 //重置
@@ -915,7 +936,11 @@ getAllLevelList().then((res) => {
state.tableDataTotal = Number(res.data.data.total); state.tableDataTotal = Number(res.data.data.total);
state.tableLoading=false state.tableLoading=false
console.log("获取讲师tableData", tableData); console.log("获取讲师tableData", tableData);
}) }).catch(err=>{
state.tableLoading=false
message.destroy()
message.error(err.data.msg)
})
}; };
getTableDate() getTableDate()
// // 翻页 // // 翻页
@@ -989,6 +1014,7 @@ getAllLevelList().then((res) => {
getTableDate(); getTableDate();
}).catch(err=>{ }).catch(err=>{
message.destroy() message.destroy()
state.teacherdialog = false;
message.error(err.data.msg) message.error(err.data.msg)
}) })
} }
@@ -998,9 +1024,10 @@ getAllLevelList().then((res) => {
message.success("保存成功"); message.success("保存成功");
state.teacherdialog = false; state.teacherdialog = false;
cancel() cancel()
getTableDate(); getTableDate();
}).catch(err=>{ }).catch(err=>{
message.destroy() message.destroy()
state.teacherdialog = false;
message.error(err.data.msg) message.error(err.data.msg)
}) })
} }
@@ -1087,6 +1114,8 @@ getAllLevelList().then((res) => {
payableExpense:null, payableExpense:null,
expense:null, expense:null,
remark:null, remark:null,
sourceBelongId: null,
sourceBelongFullName: null,
} }
state.id = null state.id = null
state.teachingDate=null state.teachingDate=null
@@ -1195,18 +1224,29 @@ getAllLevelList().then((res) => {
} }
}; };
const clearNonNumber = () => { const clearNonNumber = () => {
state.formParam.teachingTime = state.formParam.teachingTime.replace(/\D/g, ''); state.formParam.teachingTime = state.formParam.teachingTime?.replace(/\D/g, '');
state.formParam.expense = state.formParam.levelPay*state.formParam.teachingTime state.formParam.teachingTime = state.formParam.teachingTime?.slice(0,8);
state.formParam.teachingTime == 0 && (state.formParam.teachingTime = null);
state.formParam.teachingTime && state.formParam.levelPay && (state.formParam.expense = state.formParam.levelPay*(state.formParam.teachingTime/60).toFixed(2));
} }
const clearstudysNumber = () => { const clearstudysNumber = () => {
state.formParam.studys = state.formParam.studys.replace(/\D/g, ''); state.formParam.studys = state.formParam.studys.replace(/\D/g, '');
} }
const clearscoreNumber= () => { const clearscoreNumber= () => {
state.formParam.score = state.formParam.score.replace(/\D/g, ''); state.formParam.score = state.formParam.score?.replace(/\D/g, '');
state.formParam.score == 0 && (state.formParam.score = null);
state.formParam.score > 10 && (state.formParam.score = '10');
}
const payExpense = () => {
state.formParam.payableExpense = state.formParam.payableExpense?.replace(/\D/g, '');
state.formParam.payableExpense = state.formParam.payableExpense?.slice(0,8);
state.formParam.payableExpense == 0 && (state.formParam.payableExpense = null);
} }
const clearlevelPayNumber = () => { const clearlevelPayNumber = () => {
state.formParam.levelPay = state.formParam.levelPay.replace(/\D/g, ''); state.formParam.levelPay = state.formParam.levelPay?.replace(/\D/g, '');
state.formParam.expense = state.formParam.levelPay*state.formParam.teachingTime state.formParam.levelPay = state.formParam.levelPay?.slice(0,8);
state.formParam.levelPay == 0 && (state.formParam.levelPay = null);
state.formParam.levelPay&&state.formParam.teachingTime && (state.formParam.expense = state.formParam.levelPay*(state.formParam.teachingTime/60).toFixed(2))
} }
const rules = { const rules = {
name: [{ required: true, message:'',log: '讲师不能为空' }], name: [{ required: true, message:'',log: '讲师不能为空' }],
@@ -1216,12 +1256,13 @@ getAllLevelList().then((res) => {
tlevelName: [{ required: true, message:'',log: ' 讲师级别不能为空' }], tlevelName: [{ required: true, message:'',log: ' 讲师级别不能为空' }],
payrollPlace: [{ required: true, message:'',log: '讲师发薪地不能为空' }], payrollPlace: [{ required: true, message:'',log: '讲师发薪地不能为空' }],
courseType: [{ required: true, message: '',log:'费用类型不能为空' }], courseType: [{ required: true, message: '',log:'费用类型不能为空' }],
courseName: [{ required: true, message:'',log: '课程名称不能为空' }], courseName: [{ required: true, message:'',log: '课程归属组织不能为空' }],
sourceBelongId: [{ required: true, message: '',log:'费用来源不能为空' }],
teachingDate: [{ required: true, message:'',log: '授课日期不能为空' }], teachingDate: [{ required: true, message:'',log: '授课日期不能为空' }],
teachingTime: [{ required: true, message:'',log: ' 授课时长不能为空' }], teachingTime: [{ required: true, message:'',log: ' 授课时长不能为空' }],
studys: [{ required: true, message: '',log:' 参训人数不能为空' }], studys: [{ required: true, message: '',log:' 参训人数不能为空' }],
score: [{ required: true, message:'',log: ' 评分不能为空' }], score: [{ required: true, message:'',log: ' 评分不能为空' }],
levelPay: [{ required: true, message:'',log: '课酬基准 不能为空' }], levelPay: [{ required: true, message:'',log: '课酬基准不能为空' }],
expense: [{ required: true, message: '',log:'计划费用不能为空' }], expense: [{ required: true, message: '',log:'计划费用不能为空' }],
} }
@@ -1412,6 +1453,7 @@ const column = ref([
]) ])
const tlevelChange = (e) => { const tlevelChange = (e) => {
console.log(e,'eeeee')
state.formParam.tlevelName = e?.tlevelName state.formParam.tlevelName = e?.tlevelName
state.formParam.tlevelId = e?.tlevelId state.formParam.tlevelId = e?.tlevelId
// state.formParam.payrollPlace = e?.salaryName // state.formParam.payrollPlace = e?.salaryName
@@ -1521,6 +1563,7 @@ const column = ref([
clearstudysNumber, clearstudysNumber,
clearscoreNumber, clearscoreNumber,
clearlevelPayNumber, clearlevelPayNumber,
payExpense,
} }
}, },
}; };