讲师管理bug

This commit is contained in:
zhangsir
2024-11-15 11:15:41 +08:00
parent 04a39f7f27
commit 2a0b51d6a2
3 changed files with 72 additions and 44 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

@@ -127,12 +127,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">
@@ -449,7 +450,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,
@@ -633,7 +634,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);
@@ -903,7 +904,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
} }
@@ -1195,7 +1196,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

View File

@@ -179,15 +179,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 +243,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 +281,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 +453,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 +467,7 @@
ImportWork, ImportWork,
ConfirmLecturer, ConfirmLecturer,
BatchLecturer, BatchLecturer,
OrgClass,
}, },
setup() { setup() {
const formRef = ref(); const formRef = ref();
@@ -501,6 +511,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 +619,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);
@@ -967,7 +979,6 @@ getAllLevelList().then((res) => {
//保存 //保存
const createTeacherDialog = async () => { const createTeacherDialog = async () => {
console.log(state.formParam,'formParam') console.log(state.formParam,'formParam')
state.formParam.expense = String(state.formParam.expense)
state.formParam.teachingDate=state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD HH:mm").toString() : "" state.formParam.teachingDate=state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD HH:mm").toString() : ""
state.formParam.tsystemName = state.tSystemNames.systemName state.formParam.tsystemName = state.tSystemNames.systemName
state.formParam.tsystemId = state.tSystemNames.systemId state.formParam.tsystemId = state.tSystemNames.systemId
@@ -978,6 +989,7 @@ getAllLevelList().then((res) => {
return message.error(rules[formItemNames[i]][0].log) return message.error(rules[formItemNames[i]][0].log)
} }
} }
state.formParam.expense = String(state.formParam.expense)
state.formParam.orgName = state.formParam.orgNames state.formParam.orgName = state.formParam.orgNames
state.formParam = {...state.formParam,...state.tSystemNames} state.formParam = {...state.formParam,...state.tSystemNames}
state.formParam.name = state.formParam?.name?.split('/')[0] state.formParam.name = state.formParam?.name?.split('/')[0]
@@ -1087,6 +1099,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 +1209,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);
} }
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)
} }
const rules = { const rules = {
name: [{ required: true, message:'',log: '讲师不能为空' }], name: [{ required: true, message:'',log: '讲师不能为空' }],
@@ -1216,12 +1241,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:'计划费用不能为空' }],
} }
@@ -1521,6 +1547,7 @@ const column = ref([
clearstudysNumber, clearstudysNumber,
clearscoreNumber, clearscoreNumber,
clearlevelPayNumber, clearlevelPayNumber,
payExpense,
} }
}, },
}; };