讲师管理修改

This commit is contained in:
zhangsir
2024-10-30 14:37:02 +08:00
parent 1efd0901da
commit cbc1b28809
8 changed files with 173 additions and 92 deletions

View File

@@ -16,7 +16,7 @@
</div>
<div class="content">
<div class="box">
<div style="margin-bottom: 20px;font-size: 18px;font-weight: 700;">选择讲师费汇总:<span style="color:red;margin-left:20px;">256</span></div>
<div style="margin-bottom: 20px;font-size: 18px;font-weight: 700;">选择讲师费汇总:<span style="color:red;margin-left:20px;">{{levelPay||0}}</span></div>
<div class="table">
<a-table
:columns="columns"
@@ -81,6 +81,16 @@ const addList = (item) => {
selectedRowKeys.value.push(item.id)
selectsData.value.push(item)
}
const levelPay = ref(0)
watch(()=>selectsData.value.length,(val)=>{
if(val){
levelPay.value = selectsData.value.reduce((a,b)=>{
return a + b.levelPay
},0)
}else{
levelPay.value = 0
}
})
const removeList = (item) => {
selectedRowKeys.value = selectedRowKeys.value.filter(t=> t != item.id)
selectsData.value = selectsData.value.filter(t=>t.id != item.id)

View File

@@ -16,40 +16,40 @@
</div>
<div class="content">
<div class="head">
<div class="list" :class="item.id==indexList?'active':''" @click="clickItem(item,index)" v-for="(item,index) in forData">
<div class="list" :class="index==indexList?'active':''" @click="clickItem(item,index)" v-for="(item,index) in forData">
<div class="left">
<div>培训发生组织</div>
<div class="text">汇总金额</div>
</div>
<div class="right">
<div>{{item.name}}</div>
<div class="text">{{item.name}}</div>
<div>{{item?.trainOrgName}}</div>
<div class="text">{{item?.summaryTotal}}</div>
</div>
</div>
</div>
<div class="box">
<div class="top">
<div class="item">
<a-input style="border-radius: 8px;width:240px;height: 40px;" v-model:value="search" placeholder="请输入工号/讲师名称进行搜索" allowClear />
<a-input style="border-radius: 8px;width:240px;height: 40px;" v-model:value="nameUserNo" placeholder="请输入工号/讲师名称进行搜索" allowClear />
</div>
<div class="item">
<a-range-picker style="border-radius: 8px;width:360px;height: 40px;" v-model:value="value1" />
<a-range-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="border-radius: 8px;width:360px;height: 40px;" v-model:value="dateValue" />
</div>
<div class="item">
<a-button type="primary" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
<a-button type="primary" @click="searchData(true)" style="margin-right:20px;border-radius:8px;width: 100px;height: 40px;">搜索</a-button>
<a-button type="primary" @click="resetData()" style="border-radius:8px;width: 100px;height: 40px;">重置</a-button>
</div>
</div>
<div class="table">
<a-table
:columns="columns"
:data-source="tableData"
:data-source="searchTrue?searchList:expenseList"
:pagination="false"
:scroll="{ x: 'max-content' }"
>
<template #action="{ text, record }">
<template #action="{ record,index }">
<div class="action">
<div class="btn">移除</div>
<div @click="removeId(record,index)" class="btn" style="color: #40a9ff;cursor: pointer;">移除</div>
</div>
</template>
</a-table>
@@ -134,19 +134,25 @@ const handleConfirm = () => {
}
numTime.value+=1
localStorage.setItem('numTime',numTime.value)
close()
const obj = {
id: '1',
status: 1
}
api.isConfirm(obj).then(res=>{
console.log(res,'resssss')
message.success('提交成功')
close()
closeDrawer()
})
}
const forData = ref([
{name:'a',id:1},
{name:'b',id:2},
{name:'c',id:3},
{name:'c',id:3},
{name:'c',id:3},
{name:'c',id:3},
])
const indexList = ref(1)
const forData = ref()
const indexList = ref(0)
const expenseList = ref([])
const searchList = ref([])
const clickItem = (item,i) => {
indexList.value = i+1
expenseList.value = item.expenseList
indexList.value = i
resetData()
}
watch(()=>props.visible,(val)=>{
if(val){
@@ -159,10 +165,49 @@ watch(()=>props.visible,(val)=>{
endTime: '',
}
).then(res=>{
console.log(res,'resss')
if(res.data.code === 200){
forData.value = res.data.data
expenseList.value = res.data.data[indexList.value]?.expenseList
}
})
}else{
nameUserNo.value = null
dateValue.value = null
}
})
const removeId = (e,i) =>{
if(searchTrue.value){
searchList.value = searchList.value.filter(item=>item.id !== e.id)
expenseList.value = expenseList.value.filter(item=>item.id !== e.id)
}else{
expenseList.value = expenseList.value.filter(item=>item.id !== e.id)
}
}
const nameUserNo = ref(null)
const dateValue = ref(null)
const searchTrue = ref(false)
const searchData = (val) => {
searchTrue.value = val
if(!nameUserNo.value&&!dateValue.value){
searchList.value = expenseList.value;
return
}
//搜索 数组expenseList.value 参数名字或者工号nameUserNo.value 日期dateValue.value
const filteredList = expenseList.value.filter(item => {
const isNameMatch = (item.name + item.userNo).includes(nameUserNo.value);
const teachingDateTimestamp = new Date(item.teachingDate).getTime();
const startDateTimestamp = new Date(dateValue.value[0]).getTime();
const endDateTimestamp = new Date(dateValue.value[1]).getTime();
const isDateInRange = teachingDateTimestamp >= startDateTimestamp && teachingDateTimestamp <= endDateTimestamp;
return isNameMatch || isDateInRange;
});
searchList.value = filteredList;
}
const resetData = () => {
nameUserNo.value = null
dateValue.value = null
searchData(false)
}
const emit = defineEmits({})
const columns = [
{
@@ -173,8 +218,8 @@ const columns = [
},
{
title: '讲师工号',
dataIndex: 'name',
key: 'name',
dataIndex: 'userNo',
key: 'userNo',
align: 'center',
},
{
@@ -192,76 +237,92 @@ const columns = [
},
{
title: '讲师等级',
dataIndex: 'name',
key: 'name',
dataIndex: 'tlevelName',
key: 'tlevelName',
align: 'center',
},
{
title: '发薪地',
dataIndex: 'name',
key: 'name',
dataIndex: 'payrollPlace',
key: 'payrollPlace',
align: 'center',
},
{
title: '课程类型',
dataIndex: 'name',
key: 'name',
dataIndex: 'courseType',
key: 'courseType',
align: 'center',
customRender: ({ text,record })=>{
switch (text) {
case 0:
return "在线"
case 1:
return "面授"
case 2:
return "授课"
case 3:
return "课程开发"
case 4:
return "作业员如模培训"
default:
return "-"
}
}
},
{
title: '课程名称',
dataIndex: 'name',
key: 'name',
dataIndex: 'courseName',
key: 'courseName',
align: 'center',
},
{
title: '授课/开发课程日期',
dataIndex: 'name',
key: 'name',
dataIndex: 'teachingDate',
key: 'teachingDate',
align: 'center',
},
{
title: '授课/开发课程时长',
dataIndex: 'name',
key: 'name',
dataIndex: 'teachingTime',
key: 'teachingTime',
align: 'center',
},
{
title: '参训人数',
dataIndex: 'name',
key: 'name',
dataIndex: 'studys',
key: 'studys',
align: 'center',
},
{
title: '评分',
dataIndex: 'name',
key: 'name',
dataIndex: 'score',
key: 'score',
align: 'center',
},
{
title: '课酬基准',
dataIndex: 'name',
key: 'name',
dataIndex: 'levelPay',
key: 'levelPay',
align: 'center',
},
{
title: '计划费用',
dataIndex: 'name',
key: 'name',
dataIndex: 'expense',
key: 'expense',
align: 'center',
},
{
title: '应发费用',
dataIndex: 'name',
key: 'name',
dataIndex: 'payableExpense',
key: 'payableExpense',
align: 'center',
},
{
title: '操作',
align: 'center',
fixed: 'right',
scopedSlots: { customRender: "action" },
slots: { customRender: "action" },
},
]
const closeDrawer = () => emit("update:visible", false);
@@ -269,7 +330,12 @@ const qureyDrawer = () => {
dialog({
content: '是否确认讲师费信息无误?提交后按“培训发生组织”汇总至审批中心,等待验证后“提交”进入审批流程。',
ok: () => {
closeDrawer()
const ids = expenseList.value.map(item=>item.id)
api.teacherExpenseConfirm(ids).then(res=>{
console.log(res,'resssss')
message.success('提交成功')
closeDrawer()
})
}
})
}
@@ -460,6 +526,7 @@ const config = () => {
}
}
.box{
padding-bottom: 80px;
.top{
display: flex;
align-items: center;
@@ -483,7 +550,7 @@ const config = () => {
justify-content: end;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
background-color: #fff;
z-index: 9;
.btn2 {
width: 100px;
height: 40px;

View File

@@ -169,7 +169,7 @@ const searchMember = (keyword) => {
level: item.realName+'('+item.userNo+')'+item.sLevelName,
key: item.id,
orgName: item.orgName,
orgId: item.kid,
orgId: item.departId,
tSystemName:item.tSystemName,
sLevelName:item.sLevelName
}
@@ -237,7 +237,7 @@ function stuStuOrgSelect(e, {selected: bool, selectedNodes, node, event}) {
if(selectedNodes[0].isLeaf){
teacherName.value = selectedNodes[0].name
orgName.value = selectedNodes[0].orgName
orgId.value = selectedNodes[0].kid
orgId.value = selectedNodes[0].departId
// systemName.value = selectedNodes[0].systemName
levelName.value = selectedNodes[0].levelName
teacherId.value = selectedNodes[0].id