Files
fe-manage/src/views/lecturer/LecturerFee.vue
2025-05-09 11:08:00 +08:00

2423 lines
79 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 讲师费管理页面 -->
<template>
<div>
<!-- 搜索框及按钮 -->
<div class="filter">
<a-form layout="inline" style="min-width: 1056px;">
<a-form-item class="select">
<!-- v-model:value="searchParam.name" -->
<!-- <a-input v-model:value="searchParam.name" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入工号/讲师姓名进行检索" allowClear showSearch>
</a-input>
-->
<div style="width: 235px; height: 40px; border-radius: 8px">
<a-input v-model:value="searchParam.name" style="width: 235px; height: 40px; border-radius: 8px"
placeholder="请输入工号/讲师姓名进行检索" allowClear showSearch v-on:keydown.enter="enterPressHadlerSearch">
</a-input>
</div>
</a-form-item>
<a-form-item class="select">
<a-input v-model:value="searchParam.courseName" style="width: 230px; height: 40px; border-radius: 8px"
placeholder="请输入课程名称进行检索" allowClear showSearch v-on:keydown.enter="enterPressHadlerSearch">
</a-input>
</a-form-item>
<a-form-item class="select">
<!-- TODO4 -->
<a-select
v-model:value="searchParam.trainOrgId"
style="width: 200px"
allowClear
showSearch
:filter-option="false"
@change="handleOrgChange"
@search="handleOrgSearch"
placeholder="请选择培训发生组织"
>
<a-select-option v-for="item in filterOrgListSearch" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
<!-- <a-select style="width: 235px ;margin-bottom:20px" v-model:value="searchParam.trainOrgId"
placeholder="请选择培训发生组织" allowClear :options="orgListSearch" showSearch
v-on:keydown.enter="enterPressHadlerSearch">
</a-select> -->
</a-form-item>
<a-form-item class="select ">
<!-- <div class="select addTimeBox">
<div class="addTime" >授课日期</div> -->
<a-range-picker v-model:value="searchdate" style="width: 340px !important;" format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD" separator="至" :placeholder="['授课日期开始时间', '授课日期结束时间']"
v-on:keydown.enter="enterPressHadlerSearch" />
<!-- </div> -->
</a-form-item>
<a-form-item class="select">
<a-select style="width: 200px ;margin-bottom:20px" v-model:value="searchParam.type" placeholder="请选择课程类型"
allowClear :options="OnTheJobStatusList" v-on:keydown.enter="enterPressHadlerSearch">
</a-select>
</a-form-item>
<a-form-item class="select" v-if="moreid == 2">
<a-select style="width: 200px ;margin-bottom:20px" v-model:value="searchParam.status" placeholder="请选择状态"
allowClear :options="AuthenticationStatusList" v-on:keydown.enter="enterPressHadlerSearch">
</a-select>
</a-form-item>
<a-form-item class="select" v-if="moreid == 2">
<a-select style="width: 235px ;margin-bottom:20px" placeholder="请选择讲师体系" v-model:value="searchParam.tSystemId"
allowClear :options="lecturerSystemList" v-on:keydown.enter="enterPressHadlerSearch" @change="changetlevel">
</a-select>
</a-form-item>
<a-form-item class="select" v-if="moreid == 2">
<a-select style="width: 235px ;margin-bottom:20px" v-model:value="searchParam.tLevelName"
placeholder="请选择讲师级别" allowClear :options="getLevelList" v-on:keydown.enter="enterPressHadlerSearch">
</a-select>
</a-form-item>
<div style="display: flex; margin-bottom: 20px">
<a-button @click="searchSubmit()" type="primary" class="resetbtn">查询 </a-button>
<!-- <div class="btn btn1" @click="searchReset" style="background:rgba(64, 158, 255, 0);" > -->
<!-- <div class="search"></div> -->
<a-button class="resetbtn " @click="searchReset">重置</a-button>
<!-- 更多筛选-->
<div v-if="moreid == 1">
<a-button @click="handlemoreid()" class="moreidbtn" type="text"> 展开
<DownOutlined />
</a-button>
</div>
<div v-if="moreid == 2">
<a-button @click="handlemoreid()" class="moreidbtn"> 收起
<UpOutlined />
</a-button>
</div>
</div>
<div style="width:100%"></div>
<!-- <a-form-item class="select" v-if="moreid == 2">
<a-select style="width: 230px ;margin-bottom:20px" v-model:value="searchParam.courseType" placeholder="请选择费用类型" allowClear
:options="courseTypeList">
</a-select>
</a-form-item> -->
</a-form>
<div style="width: 100%;"></div>
<div style="display: flex; margin-bottom: 20px">
<a-button v-if="checkMenu('lecturerExpenseAdd')" @click="addTeacher()" type="primary" class="langbtn">
<div class="search"></div> 添加费用
</a-button>
<!-- <div style="margin-left: 20px ;">
<a-button @click="addTeacher()" class="langbtn">
<UploadOutlined /> 一键生成讲师费
</a-button>
</div> -->
<a-button v-if="checkMenu('lecturerExpenseImport')" class="resetbtn" @click="handleImport()">
<DownloadOutlined /> 导入
</a-button>
<a-button v-if="checkMenu('lecturerExpenseExport')" @click="handleExport()" class="resetbtn">
<UploadOutlined /> 导出
</a-button>
<a-button v-if="orgList.length" @click="handleTeacher()" type="primary" class="langbtn">
一键确认讲师费
</a-button>
<a-button v-if="orgList.length" @click="allFee()" type="primary" class="langbtn">
批量确认讲师费
</a-button>
<!-- <div style="line-height: 40px;" >当前页面汇总金额<span style="line-height: 40px; font-size: 24px; color: rgb(207, 34, 34) ;font-weight: 600;">1,230,490</span> 当前总汇总金额<span style="line-height: 40px; font-size: 24px; color: rgb(207, 34, 34) ;font-weight: 600;">9,230,490</span></div> -->
</div>
<!-- 表格 -->
<div>
<a-table :header-cell-style="{ 'text-align': 'center' }" style="border: 1px solid #f2f6fe" :columns="columns"
:data-source="tableData" :scroll="{ x: 1500 }" :loading="tableLoading" @expand="expandTable"
:pagination="false">
<template #bodyCell="{ record, column }">
<template v-if="column.key === 'operation'">
<a-space>
<a-button type="link" v-if="(record.status == 0 || record.status == 5) && checkMenu('lecturerExpenseStop')"
@click="updateModal(record, record.status)">{{ record.status == 0 ? '停用' : '启用' }}</a-button>
<a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button>
<!-- :disabled="record.createFrom==1 ?false :true" -->
<a-button type="link" v-if="(record.status == 0 || record.status == 4) && checkMenu('lecturerExpenseEdit')"
@click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<!-- <a-button :disabled="record.status==='A20' || record.status==='A30'||record.status==='S20' ?true :false" type="link" @click="() => handleOperate(record, String(record.courseform))">提交</a-button> -->
<!-- <a-button type="link" @click="handleOperate(record)">撤回</a-button> -->
<a-button type="link"
v-if="(record.status == 0 || record.status == 4 || record.status == 5) && checkMenu('lecturerExpenseDel')"
@click="deleteModal(record)">删除</a-button>
</a-space>
</template>
</template>
<template #trainOrg="{ record }">
<a-space style="display:flex ;justify-content: space-around;">
<div style="max-width: 180px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
>{{ record.orgName }}</div>
</a-space>
</template>
</a-table>
</div>
</div>
<div class="tableBox ">
<div style="float: right;">
<a-pagination v-if="tableDataTotal > 10" :showSizeChanger="true" :showQuickJumper="false"
:hideOnSinglePage="false" :pageSize="searchParam.pageSize" :current="searchParam.pageNo"
:total="tableDataTotal" class="pagination" @change="changePagination" />
</div>
</div>
<!-- 弹窗组件 -->
<a-drawer class="largeDrawerInside" v-model:visible="teacherdialog" placement="right" :closable="false"
:maskClosable="false" dropdown-style="drawaer" width="60%" :title="false">
<div style="padding:24px;">
<div class="headers" style="margin-top:-24px;">
<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" layout="vertical" ref="formRef">
<!-- 讲师姓名 name 讲师工号 userNo-->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="name">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师名称
</template>
<SearchTeacher :disabled="!!id" @byUserIdData="byUserIdData" @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:payrollPlaceName="formParam.payrollPlace">
</SearchTeacher>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="userNo">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师工号
</template>
<a-input class="draitem" v-model:value="formParam.userNo" disabled placeholder="请输入讲师工号" allowClear
showSearch>
</a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 讲师组织 departId 讲师体系 systemId -->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="orgName">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师组织
</template>
<!-- <a-popover>
<template #content>
{{ formParam.orgNames }}
</template> -->
<a-input :title="formParam.orgNames" disabled v-model:value="formParam.orgName" class="draitem"
placeholder="自动带出讲师的组织,展示主要部分,鼠标浮上去展示所有" allowClear showSearch>
</a-input>
<!-- </a-popover> -->
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="tsystemName">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师体系
</template>
<!-- <a-select class="draitem" v-model:value="formParam.tsystemName" placeholder="请选择讲师体系" allowClear
@change="changetlevel" .:options="LecturerSystemList">
</a-select> -->
<a-input disabled v-model:value="tSystemNames.systemName" class="draitem" placeholder="自动带出讲师的体系"
allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 讲师级别 levelId 讲师发薪地 payrollPlaceName-->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="tlevelName">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师级别
</template>
<a-input disabled v-model:value="formParam.tlevelName" class="draitem" placeholder="自动带出讲师级别" allowClear
showSearch>
</a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="payrollPlace">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
讲师发薪地
</template>
<a-input disabled v-model:value="formParam.payrollPlace" class="draitem" placeholder="自动带出讲师发薪地"
allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 费用类型 课程名称 courseName-->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="courseType">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
费用类型
</template>
<a-select :disabled="formParam.createFrom == 0" class="draitem" v-model:value="formParam.courseType"
placeholder="请选择费用类型" :options="courseTypeList">
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="courseName">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
课程名称
</template>
<!-- <a-radio-group v-model:value="formParam.courseName">
<a-radio :value="0">面授课</a-radio>
<a-radio :value="1">在线课</a-radio>
</a-radio-group> -->
<!-- <a-select class="draitem" v-model:value="formParam.courseName" placeholder="请选择输入或选择面授课" style="width:63%" allowClear
:options="getLevelList">
</a-select> -->
<a-input :disabled="formParam.createFrom == 0" :maxlength="20" show-count
v-model:value="formParam.courseName" placeholder="请输入面授课名称" class="draitem">
</a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 授课日期 teachingDate 授课时长 teachingTime -->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="trainOrgId">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
培训发生组织
</template>
<!-- <OrgClass
v-model:value="formParam.sourceBelongId"
v-model:name="formParam.sourceBelongFullName"
></OrgClass> -->
<!-- TODO GX02 -->
<a-select
:disabled="formParam.createFrom == 0"
v-model:value="formParam.trainOrgId"
placeholder="请选择培训发生组织"
allowClear
showSearch
:options="filterOrgListSearch"
@search="handleOrgSearch"
@change="changeOrg">
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="teachingDate">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
{{ formParam.courseType == 2 ? '课程' : '授课' }}日期 :
</template>
<a-date-picker :disabled="formParam.createFrom == 0" :locale="locale" class="draitem"
v-model:value="teachingDate" style="width:100%" :show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm" valueFormat="YYYY-MM-DD HH:mm" placeholder="请选择课程日期"
@select="handleSelect" />
</a-form-item>
</a-col>
</a-row>
<!-- 参训人数 studys 评分 score -->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="teachingTime">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
{{ formParam.courseType == 2 ? '课程时长' : '授课时长' }}
</template>
<a-input v-model:value="formParam.teachingTime" style="width:100%; height: 40px; border-radius: 8px; "
@change="clearNonNumber" placeholder="请输入授课分钟数" allowClear showSearch suffix="分钟">
</a-input>
<!-- <span style="margin-left: 5px ;" v-if="formParam.teachingTime != null">{{
(formParam.teachingTime / 60).toFixed(2) }}小时</span>
<span style="margin-left: 5px ;" v-if="formParam.teachingTime == null">0.00小时</span> -->
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="studys">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
参训人数
</template>
<a-input :disabled="formParam.createFrom == 0" v-model:value="formParam.studys" class="draitem"
@change="clearstudysNumber" placeholder="请输入参训人数" allowClear showSearch>
</a-input>
</a-form-item>
</a-col>
</a-row>
<!-- 课酬基准 计划费用 expense-->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="score">
<template v-slot:label>
<!-- <img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" /> -->
评分
</template>
<a-input-number :disabled="formParam.createFrom == 0" class="draitem" v-model:value="formParam.score"
:defaultValue="null" :max="100" :controls="false" :min="1" :precision="2" placeholder="请输入评分"
allowClear @change="scoreNumber">
</a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item name="levelPay">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
课酬基准
</template>
<a-input-number v-model:value="formParam.levelPay" placeholder="自动键入系统基准(可手动更改)" :max="99999999"
:controls="false" :min="0" :precision="2" @change="clearlevelPayNumber" allowClear showSearch
class="draitem">
</a-input-number>
</a-form-item>
</a-col>
</a-row>
<!-- 应发费用 -->
<a-row :gutter="16">
<a-col :span="12">
<a-form-item name="expense">
<template v-slot:label>
<img style="margin-right:4px;width: 7px;height: 7px"
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
计划费用
</template>
<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-input-number :max="99999999" :controls="false" :min="0" :precision="2" v-model:value="formParam.payableExpense" class="draitem"
placeholder="请输入应发费用" @change="clearPayableExpense" allowClear>
</a-input-number>
</a-form-item>
</a-col> -->
</a-row>
<!-- 备注 remark -->
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="备注">
<a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
style="width: 100%; height: 100px; border-radius: 8px ;margin-bottom:50px" placeholder="请输入" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<div :style="{
position: 'absolute',
right: 0,
bottom: 0,
width: '100%',
borderTop: '1px solid #e9e9e9',
padding: '10px 16px',
background: '#fff',
textAlign: 'right',
zIndex: 1,
}">
<a-button class="drabtn" @click="cancelTeacherDialog">取消</a-button>
<a-button class="drabtn" type="primary" @click="createTeacherDialog" :loading="buttonLoading">保存
</a-button>
</div>
</div>
</a-drawer>
<!-- 修改状态功能弹窗 -->
<div>
<a-modal v-model:visible="editTeacher" :footer="null" :closable="close" wrapClassName="canclestu1"
centered="true">
<div class="delete">
<div class="del_header"></div>
<div class="del_main">
<div class="header">
<div class="icon1"></div>
<span>提示</span>
</div>
<div class="body">
<span v-if="handleOperate1 == 'A10' || handleOperate1 == 'E10'">您确定要提交此信息吗</span>
<span v-if="handleOperate1 == 'A20'">您确定要撤回此信息吗</span>
</div>
<div class="del_btnbox">
<div class="del_btn btn2" @click="canceleditTeacherDialog" style="margin-right: 32px">
<div class="btnText">取消</div>
</div>
<div class="del_btn btn2" @click="closehandleOperate">
<div class="btnText">确定</div>
</div>
</div>
</div>
</div>
</a-modal>
</div>
<!-- <div> <Upload/> </div> -->
<a-drawer class="largeDrawerInside" v-model:visible="teachingdialog" placement="right" :closable="false" width="60%"
:title="false">
<div style="padding:24px;">
<div class="headers" style="margin-top:-24px;">
<div class="headerTitle">查看讲师费用</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
@click="cancelTeachingDialog(false)" />
</div>
<span class="line"></span>
<span style="font-weight: 600;">讲师费用详情</span>
<a-descriptions style="padding-bottom: 35px;margin-top:20px;" bordered :column="2"
:contentStyle="{ width: '300px', }" :labelStyle="{ width: '166px' }">
<a-descriptions-item label="讲师姓名">
<div style="user-select: text">{{ formParam.name }}</div>
</a-descriptions-item>
<!-- <a-descriptions-item label="讲师工号">{{formParam.userNo}}</a-descriptions-item> -->
<a-descriptions-item label="讲师组织">{{ formParam.orgNames }}</a-descriptions-item>
<a-descriptions-item label="讲师体系">{{ formParam.tsystemName }}</a-descriptions-item>
<a-descriptions-item label="讲师级别">{{ formParam.tlevelName }}</a-descriptions-item>
<a-descriptions-item label="讲师发薪地">{{ formParam?.payrollPlace || '-' }}</a-descriptions-item>
<a-descriptions-item label="课程名称">
<div style="user-select: text">{{ formParam.courseName || '-' }}</div>
</a-descriptions-item>
<a-descriptions-item
label="费用类型">{{ { 0: '在线', 1: '面授', 2: '课程开发', 3: '作业员入模培训', 4: '其他' }[formParam?.courseType] }}</a-descriptions-item>
<!-- <a-descriptions-item label="课程类型">{{formParam.courseType==1?'项目开课' :formParam.courseType==2 ?'路径开课':formParam.courseType==3 ?'面授开课':'-'}}</a-descriptions-item> -->
<a-descriptions-item label="培训发生组织">
<div style="user-select: text">{{ formParam.trainOrgName || '-' }}</div>
</a-descriptions-item>
<a-descriptions-item label="授课/课程开发日期 ">{{ (formParam.teachingDate) || '-' }}</a-descriptions-item>
<a-descriptions-item label="授课/课程开发时长 ">{{ formParam.teachingTime || '-' }} <span
v-if="formParam.teachingTime">({{ (formParam.teachingTime / 60).toFixed(2) }}小时)</span></a-descriptions-item>
<a-descriptions-item label="参训人数 ">{{ formParam.studys ? formParam.studys + '人' : '-' }}</a-descriptions-item>
<!-- <a-descriptions-item
label="评分 ">{{ formParam.score ? Number(formParam.score).toFixed(0) == 0 ? '-' : Number(formParam.score).toFixed(2) + '分' : '-'
}}</a-descriptions-item>-->
<a-descriptions-item label="评分 ">{{formParam.score }}</a-descriptions-item>
<a-descriptions-item label="基准课酬 ">{{ formParam.levelPay || formParam.levelPay == 0 ? formParam.levelPay + '元' :
'-'}}</a-descriptions-item>
<a-descriptions-item label="计划费用 ">{{ formParam.expense ? formParam.expense + '元' : '-' }}</a-descriptions-item>
<!-- <a-descriptions-item label="应发费用 ">{{formParam.payableExpense || '-'}}</a-descriptions-item> -->
<!-- <a-descriptions-item label="费用发放时间">{{formParam.payableExpenseTime || '-'}}</a-descriptions-item> -->
<a-descriptions-item label="状态">{{ {
0: '待确认', 1: '待提交', 2: '审核中', 3: '审核通过',
4: '审核拒绝', 5: '停用'
}[formParam?.status]}}</a-descriptions-item>
<!-- <a-descriptions-item label="课程类型">{{{"0": "在线课","1": "面授课","2": "课程开发","3": "作业员入模培训","4": "其他",}[formParam.courseType + ""]}}</a-descriptions-item> -->
<a-descriptions-item label="备注 ">{{ formParam.remark || '-' }}</a-descriptions-item>
</a-descriptions>
<div style="margin-bottom: 20px;" v-if="false">
<span class="line"></span>
<span style="font-weight: 600;">讲师费审批</span>
</div>
<div style="margin-bottom:32px;" v-if="false">
<a-table :columns="columnSee" :loading="SeeLoading" :data-source="tableDataSee" :pagination="false" />
</div>
<!-- <span class="line"></span> -->
<!-- <div :style="{
position: 'absolute',
right: 0,
bottom: 0,
width: '100%',
borderTop: '1px solid #e9e9e9',
padding: '10px 16px',
background: '#fff',
textAlign: 'right',
zIndex: 1,
}">
<a-button class="drabtn" type="primary" @click="cancelTeachingDialog(false)">确定</a-button>
<a-button class="drabtn" @click="cancelTeachingDialog(false)" :loading="buttonLoading">取消
</a-button>
</div> -->
</div>
</a-drawer>
<!-- TODO dr01 -->
<ImportWork v-model:showWork="showWork" :template="'/admin/export/exportExpenseTemplate'"
:url="'/admin/export/importTeacherExpense'" :fileName="uploadFile" :title="title"></ImportWork>
</div>
<div class="example" v-if="example">
<a-spin />
</div>
<!-- 一键确认讲师费 -->
<ConfirmLecturer @example="getexample" @visibleFalse="visibleAll" :ids="selectsIds" v-model:visible="visibleConfirm"
:name="'确认讲师费'" />
<!-- 批量确认讲师费 -->
<BatchLecturer @selectedRowKeys="selectedRowKey" v-model:visible="allFeedialog" :name="'批量审批'" />
</template>
<script lang="jsx">
import { reactive, toRefs, ref, watch, onMounted , computed ,defineProps} from "vue";
import { message } from "ant-design-vue";
import dayjs from "dayjs";
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
import 'dayjs/locale/zh-cn';
import {
DownOutlined,
UpOutlined,
UploadOutlined,
FolderAddOutlined,
DownloadOutlined
} from '@ant-design/icons-vue';
import ImportWork from "../../components/lecturer/ImportWork.vue";
import SearchTeacher from "@/components/project/SearchTeacher";
import { getTeacherFeeList, getTeacherFeeDetail, getListByTeacherExpenseId, addTeacherFee, getListByIds, updateTeacherFee, updateStatusSubmit, approveTeacherFee, getTeacherLevel, deleteInTeacher, confirm } from "../../api/lecturerFeeManagement";
import {
getTeacherSystemList,
getAllLevelList,
getPayRollPlace,
fileUp,
submitApproval,
deleteLecturerFee,
updateLecturerFee,
getLevel
} from "../../api/Lecturer";
// lecturerFeeManagement
// import {getProjSt} from "../../api/indexProjStu";
// import AddTeacher from "../../components/drawers/project/AddTeacher"
import ConfirmLecturer from "@/components/project/ConfirmLecturer"
import BatchLecturer from "@/components/project/BatchLecturer"
import { queryTrainOrgPor, } from "../../api/organization";
import dialog from '@/utils/dialog';
import OrgClass from "@/components/project/OrgClass";
import { checkMenu } from '@/utils/utils'
export default {
name: "LecturerFee",
props: {
activeKeyFn: Function
},
components: {
DownOutlined, //图标--展开
UpOutlined,//图标--收起
UploadOutlined,//图标--导出
DownloadOutlined,//图标-导入
FolderAddOutlined,//图标--新增
SearchTeacher,
ImportWork,
ConfirmLecturer,
BatchLecturer,
OrgClass,
},
setup(props) {
const formRef = ref();
const state = reactive({
example: false,
tableDataSee: [],
SeeLoading: false,
orgList: [],
filterOrgListSearch: [],
orgListSearch: [],
selectsIds: '',
visibleConfirm: false,
title: '导入讲师费记录',
allFeedialog: false,
tableLoadings: false,
teachingdialog: false,
showWork: false,
vf: true,
moreid: 1,
byPid: null,
currentPage1: 1,
pageSize1: 10,
promotionrecordsLoading: false, //晋级记录遮罩层
teacherrecordsLoading: false,// 授课记录遮罩层
tableLoading: false,
tagsshow: "1",
delTeacherId: null, //删除id确认
newStatus: null, //修改状态码确认
id: null, //内部讲师工号确认
lookTeacherId: null, //内部讲师详情id确认
// deleteInTeacherdialog: false, //删除弹窗
editTeacher: false, //修改状态弹窗
handleOperate1: null, //修改状态弹窗内容
teacherdialog1: null,
teacherdialog: false, //控制讲师弹窗
teacherdialogtitle: '',//讲师弹框title内容
pageSizeOptions: ['10', '20', '30', '50'], //下拉选择每页显示多少条
pageSize: 10,
tableDataTotal: -1,//table列表总条数
teachingDate: null,
formParam: {
teachingDate: null,
teachingTime: null,
name: null,
userNo: null,
payrollPlace: null,
payrollPlaceId: null,
trainOrgId: null,
trainOrgName: null,
},
searchdate: null, //选择时间
allsearchdate: null, //选择时间
searchParam: {
userNo: null,
name: null,
trainOrgId: null,
tSystemId: null,
courseName: null,
tLevelName: null,
courseType: null,
certStatus: null,
salaryName: null,
payrollPlaceName: null,
status: null,
pageNo: "1",
pageSize: "10",
beginTime: null,
endTime: null,
},
//一键确认
searchall: {
name: null,
beginTime: null,
endTime: null,
pageNo: "1",
pageSize: "10",
},
tSystemNames: {
systemName: null,
systemId: null,
levelVoList: []
},
})
onMounted(() => {
orgLists()
})
const orgLists = () => {
const obj = {
pageNo: 1,
pageSize: 50
}
queryTrainOrgPor(obj).then((res) => {
state.orgList = res.data.data?.map(item => {
return {
label: item.affiliationName,
value: item.id
}
})
state.orgListSearch = res.data.data?.map(item => {
state.orgInput = item.affiliationName;
return {
label: item.affiliationName,
value: item.id
}
})
state.orgListSearch.unshift({
label: '全部', value: ''
})
state.filterOrgListSearch = state.orgListSearch
})
}
//费用类型
const courseTypeList = ref([
// { value: '0', label: "在线" },
// { value: '1', label: "面授 " },
// { value: '2', label: "授课 " },
{ value: '2', label: "课程开发" },
{ value: '3', label: "作业员入模培训" },
// { value: '4', label: "其他" },
])
//课程类型
const OnTheJobStatusList = ref([
{ value: '', label: "全部" },
{ value: '1', label: "面授课" },
{ value: '0', label: "在线课" },
{ value: '2', label: "课程开发" },
{ value: '3', label: "作业员入模培训" },
// { value: '4', label: "其他" },
])
//认证状态
const AuthenticationStatusList = ref([
{ value: '', label: "全部" },
{ value: '0', label: "待确认" },
{ value: '1', label: "待提交" },
{ value: '2', label: "审核中" },
{ value: '4', label: "审核拒绝" },
{ value: '3', label: "审核通过" },
{ value: '5', label: "已停用" },
])
const lecturerSystemList = ref([
]);
///获取讲师体系列表
const LecturerSystemLista = () => {
let obj = {
pageNo: 1,
pageSize: 1000,
isView: 1,
isEnable: 1
}
getTeacherSystemList(obj).then((res) => {
if (res.data.code === 200) {
let arr = res.data.data.records;
let array = [];
arr.map((value) => {
let obj = {
value: value.id,
label: value.systemName,
};
array.push(obj);
});
lecturerSystemList.value = array;
lecturerSystemList.value.unshift({
value: '',
label: '全部'
})
}
})
}
const getLevelList = ref([
// { value: 0, label: "未定级" },
])
const changetlevel = (id) => {
console.log("==============changetlevelId", id);
if(id){
// 清空讲师级别
state.searchParam.tLevelName = null;
let obj = {
id: id
}
getLevel(obj).then((res) => {
if (res.data.code === 200) {
let arr = res.data.data;
let array = [];
arr.map((value) => {
let obj = {
value: value.levelName,
label: value.levelName,
};
array.push(obj);
});
getLevelList.value = array;
getLevelList.value.unshift({
value: "",
label: "全部"
})
}
})
return;
}
getAllLevelList().then((res) => {
if (res.data.code === 200) {
let arr = res.data.data;
let array = [];
arr.map((value) => {
let obj = {
value: value.levelName,
label: value.levelName,
};
array.push(obj);
});
getLevelList.value = array;
getLevelList.value.unshift({
value: "",
label: "全部"
})
}
})
}
changetlevel()
LecturerSystemLista()
// //获取讲师发薪地列表
// const PlaceOfPayList = ref([
// // { value: 0, label: "发薪地B1" },
// ])
// const PlaceOfPayLista =() => {
// getPayRollPlace().then((res)=>{
// if (res.data.code === 200) {
// let arr = res.data.data;
// let array = [];
// arr.map((value) => {
// let obj = {
// value: value.id,
// label: value.name,
// };
// array.push(obj);
// });
// PlaceOfPayList.value = array;
// }
// console.log("获取发薪地", PlaceOfPayList);
// })
// }
// PlaceOfPayLista()
//状态
const AccountStatusList = ref([
{ value: "0", label: "待确认", },
{ value: "1", label: "待提交", },
{ value: "2", label: "审核中", },
{ value: "3", label: "审核通过", },
{ value: "4", label: "审核拒绝", },
{ value: "5", label: "待提交", },
])
watch(() => state.formParam.name, (val) => {
state.formParam.userNo = val?.split('/')[1]
}
)
//切换筛选
const handlemoreid = () => {
if (state.moreid == 1) {
state.moreid = 2
}
else if (state.moreid == 2) {
state.moreid = 1
// state.searchParam.certStatus=null
// state.searchParam.salaryName=null
state.searchParam.status = null
state.searchParam.tSystemId = null
state.searchParam.tLevelName = null
}
}
const columnSee = ref([
{
title: '审批层级',
dataIndex: 'levelName',
key: 'levelName',
ellipsis: true,
align: "center",
},
{
title: '审批人 ',
dataIndex: 'employeeNames',
key: 'employeeNames',
ellipsis: true,
align: "center",
},
{
title: '审批状态 ',
dataIndex: 'approvalStatus',
key: 'approvalStatus',
ellipsis: true,
align: "center",
customRender: ({ text }) => {
switch (text) {
case 0:
return <span>待提交</span>;
case 1:
return <span>待审核</span>;
case 2:
return <span>审核中</span>;
case 3:
return <span>审核通过</span>;
case 4:
return <span>拒绝</span>;
case 5:
return <span>撤销中</span>;
case 6:
return <span>已撤销</span>;
default:
return <span>-</span>;
}
}
},
{
title: '审批时间 ',
dataIndex: 'approvalTime',
key: 'approvalTime',
ellipsis: true,
align: "center",
},
{
title: '备注 ',
dataIndex: 'approvalMsg',
key: 'approvalMsg',
ellipsis: true,
align: "center",
customRender: ({ text }) => {
return text || '-'
}
},
])
const columns = ref([
{
title: '讲师姓名 ',
dataIndex: 'name',
key: 'name',
ellipsis: true, align: "center",
width: 180,
customRender: (value, index) => {
return (
<div style="user-select: text;">
{ value.record?.name } / { value.record?.userNo }
</div>
);
},
},
// {
// title: '讲师工号 ',
// dataIndex: 'userNo',
// key: 'userNo',
// ellipsis: true, align: "center",
// width: 120,
// },
{
title: '课程名称 ',
dataIndex: 'courseName',
key: 'courseName',
ellipsis: true,
align: "left",
width: 200,
customCell: () => { return { style: { userSelect: 'text' } } }
},
{
title: '培训发生组织',
dataIndex: 'trainOrgName',
key: 'trainOrgName',
ellipsis: true, align: "left",
width: 200,
customCell: () => { return { style: { userSelect: 'text' } } }
},
{
title: '课程类型 ',
dataIndex: ' courseType',
key: ' courseType',
ellipsis: true,
align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ String(value.record.courseType)
? {
"0": "在线课",
"1": "面授课",
"2": "课程开发",
"3": "作业员入模培训",
"4": "其他",
}[value.record.courseType + ""]
: "-" }
</div>
)
}
},
{
title: '授课/课程开发日期',
dataIndex: 'teachingDate',
key: 'teachingDate',
ellipsis: true, align: "center",
width: 160,
},
{
title: '授课/课程开发时长 ',
dataIndex: 'teachingTime',
key: 'teachingTime',
ellipsis: true, align: "center",
width: 160,
customRender: (value) => {
return (
<div>
{ (value.record?.teachingTime / 60).toFixed(2) }小时
</div>
)
}
},
{
title: '基准课酬 ',
dataIndex: 'levelPay',
key: 'levelPay',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || text == 0 ? text + '元' : '-'
}
},
{
title: '计划费用 ',
dataIndex: 'expense',
key: 'expense',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text ? text + '元' : '-'
}
},
{
title: '参训人数',
dataIndex: 'studys',
key: 'studys',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text ? text + '人' : '0人'
}
},
{
title: '评分 ',
dataIndex: 'score',
key: 'score',
ellipsis: true, align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ value.record.score ? Number(value.record.score).toFixed(0) == 0 ? '-' : Number(value.record.score).toFixed(2) + '分' : '-' }
</div>
)
}
},
{
title: '状态 ',
dataIndex: 'status',
key: 'status',
ellipsis: true,
align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ String(value.record.status)
? {
"0": "待确认",
"1": "待提交",
"2": "审核中",
"3": "审核通过",
'4': '审核拒绝',
'5': '停用',
}[value.record.status + ""] || ""
: "-" }
</div>
)
}
},
{
title: '发薪地 ',
dataIndex: 'payrollPlace',
key: 'payrollPlace',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || '-'
}
},
{
title: '讲师体系',
dataIndex: 'tsystemName',
key: 'tsystemName',
ellipsis: true, align: "left",
width: 200,
customRender: ({ text }) => {
return text || '-'
}
},
{
title: '讲师级别 ',
dataIndex: 'tlevelName',
key: 'tlevelName',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || '-'
}
},
{
title: '讲师组织',
dataIndex: 'orgName',
key: 'orgName',
ellipsis: true, align: "center",
width: 200,
slots: { customRender: "trainOrg" },
},
{
title: '操作 ',
dataIndex: 'operation',
key: 'operation',
ellipsis: true, align: "center",
fixed: "right",
width: 180,
scopedSlots: { customRender: "action" },
},
])
//列表数据
const tableData = ref([
])
// 搜索
const searchSubmit = () => {
state.searchParam.pageNo = 1
getTableDate();
};
//重置
const searchReset = () => {
state.searchdate = null,
state.searchParam = {
endTime: null,
beginTime: null,
userNo: null,
tSystemId: null,
courseName: null,
tLevelName: null,
courseType: null,
certStatus: null,
salaryName: null,
status: null,
pageNo: 1,
pageSize: 10,
};
getTableDate();
};
// //修改时间
// function searchTimeChange(time, timeStr) {
// let startTime = timeStr[0]
// let beginTime = timeStr[1] ;
// state.startTime = new Date(startTime).getTime();
// state.beginTime = new Date(beginTime).getTime();
// // state.searchParam.beginTime = new Date(beginTime).getTime() ;
// // state.searchParam.endTime = new Date(endTime).getTime() ;
// state.searchParam.beginTime = state.startTime ? state.startTime : null,
// state.searchParam.endTime = state.beginTime ? state.beginTime : null
// }
// List接口数据
const getTableDate = (obj) => {
state.tableLoading = true
let objA = { ...state.searchParam };
objA.beginTime = state.searchdate ? dayjs(state.searchdate[0]).format("YYYY-MM-DD") : "",
objA.endTime = state.searchdate ? dayjs(state.searchdate[1]).format("YYYY-MM-DD") : "",
getTeacherFeeList(objA)
.then((res) => {
tableData.value = res.data.data.records
state.tableDataTotal = Number(res.data.data.total);
state.tableLoading = false
}).catch(err => {
console.log("getTeacherFeeList catch err.data.msg",err.data.msg)
state.tableLoading = false
message.destroy()
message.error(err.data.msg)
})
};
getTableDate()
// // 翻页
const changePagination = (page, pageSize) => {
state.searchParam.pageNo = page;
// state.pageNo = page;
state.searchParam.pageSize = pageSize;
getTableDate();
};
// 添加讲师费
const addTeacher = () => {
cancel()
state.teacherdialog = true;
state.vf = true
state.teacherdialogtitle = '添加讲师费'
}
//修改讲师费信息弹窗
const handleModify = (record) => {
state.teacherdialog = true;
state.teacherdialogtitle = '编辑讲师费'
state.id = record.id
state.vf = false
TeacherSystem()
}
//一键确认讲师费
const handleTeacher = () => {
state.visibleConfirm = true
}
async function validateField(name) {
return new Promise((resolve) => {
formRef.value.validateFields([name])
.then(() => {
resolve(false);
})
.catch(() => {
resolve(true);
});
});
}
watch(() => state.formParam.orgNames, (val) => {
if (val) {
const parts = val.split('/');
const reversedParts = parts.reverse();
state.formParam.orgName = reversedParts.join('/');
}
})
const changeOrg = (e, l) => {
console.log("changeOrg e",e);
console.log("changeOrg l",l);
if(l == undefined || l == null){
state.filterOrgListSearch = state.orgListSearch;
}
state.formParam.trainOrgName = l?.label
}
//保存
const createTeacherDialog = async () => {
state.formParam.expense = String(state.formParam.expense)
state.formParam.teachingDate = state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD HH:mm").toString() : ""
state.formParam.tsystemName = state.tSystemNames.systemName
state.formParam.tsystemId = state.tSystemNames.systemId
state.formParam.courseName = state.formParam.courseName?.trim()
if (state.formParam.studys == 0) {
state.formParam.studys = null
}
if (state.formParam.score) {
state.formParam.score = String(state.formParam.score)
} else {
state.formParam.score = null
}
console.log("state.formParam.levelPay",state.formParam.levelPay)
if (state.formParam.levelPay || state.formParam.levelPay == 0) {
state.formParam.levelPay = String(state.formParam.levelPay)
}
if (state.formParam.payableExpense) {
state.formParam.payableExpense = String(state.formParam.payableExpense)
}
const formItemNames = Object.keys(rules);
for (let i = 0; i < formItemNames.length; i++) {
// const result = await validateField(formItemNames[i]);
const result = state.formParam[formItemNames[i]]
if (!result) {
return message.error(rules[formItemNames[i]][0].log)
}
}
state.formParam.orgName = state.formParam.orgNames
state.formParam = { ...state.formParam, ...state.tSystemNames }
state.formParam.name = state.formParam?.name?.split('/')[0]
if (state.vf == false) {
updateTeacherFee(state.formParam).then(response => {
message.success("编辑成功");
state.teacherdialog = false;
cancel()
getTableDate();
}).catch(err => {
console.log("updateTeacherFee catch err",err.data.msg)
message.destroy()
state.teacherdialog = false;
message.error(err.data.msg)
})
}
else {
addTeacherFee(state.formParam)
.then((res) => {
message.success("新增成功");
state.teacherdialog = false;
cancel()
getTableDate();
}).catch(err => {
message.destroy()
state.teacherdialog = false;
message.error(err.data.msg)
})
}
};
//删除弹窗
const deleteModal = (record) => {
dialog({
content: '是否确认进行删除?',
ok: () => {
deleteLecturerFee({ id: record.id }).then(res => {
if (typeof (res.data.data) != 'object') {
message.error(res.data.data)
return
}
message.success("删除成功");
searchSubmit()
}).catch(err => {
message.destroy()
message.error(err.data.msg)
})
}
})
};
const updateModal = (record) => {
dialog({
content: `是否确认${record.status == 5 ? '启用' : '停用'}?`,
ok: () => {
const status = record.status == 0 ? 5 : 0
updateLecturerFee({ id: record.id, status }).then(res => {
if (typeof (res.data.data) != 'object') {
message.error(res.data.data)
return
}
message.success(`${status == 0 ? '启用' : '停用'}成功`);
searchSubmit()
}).catch(err => {
message.destroy()
message.error(err.data.msg)
})
}
})
}
//修改状态窗口
const handleOperate = (record) => {
dialog({
content: "等待接口中...",
ok: () => {
}
})
};
// //确认删除
const closeDeleteTeacher = () => {
//调用删除接口
deleteInTeacher(state.delTeacherId).then((res) => {
if (res.data.code == 200) {
// message.success("删除成功");
state.deleteInTeacherdialog = false
getTableDate();
}
})
}
//提交撤回状态
const closehandleOperate = () => {
//调用接口
let ids = {
id: state.id
}
if (state.handleOperate1 === 'A10') {
updateStatusSubmit(ids).then((res) => {
message.success("提交成功");
getTableDate();
})
}
else {
approveTeacherFee(ids).then((res) => {
message.success("撤回成功");
getTableDate();
})
}
// else if(state.handleOperate1 === 'A20'){
// approveTeacherFee(ids).then((res) => {
// message.success("撤回成功");
// getTableDate();
// })
// }
state.editTeacher = false
}
//取消按钮 清空输入的数据
const cancelTeacherDialog = () => {
formRef.value.resetFields();
state.teacherdialog = false
cancel()
};
const canceleditTeacherDialog = () => {
state.editTeacher = false
}
//清空数据
const cancel = () => {
state.formParam = {
name: null,
userNo: null,
orgNames: null,
orgName: null,
tsystemName: null,
tlevelId: null,
payrollPlace: null,
courseType: null,
courseName: null,
teachingDate: null,
teachingTime: null,
courseType: null,
studys: null,
teacherlevelPay: null,
score: null,
levelPay: null,
payableExpense: null,
expense: null,
remark: null,
trainOrgId: null,
trainOrgName: null,
}
state.id = null
state.teachingDate = null
state.tSystemNames = {
systemName: null,
levelVoList: []
}
}
const orgSplit = (val) => {
if (val) {
const org = val.split('/')
return org[org.length - 1]
}
}
//表格内查看数据操作
const handleLook = (record) => {
state.teachingdialog = true;
state.teacherdialogtitle = '查看详情'
state.id = record.id
// alert(record.grade)
TeacherSystem()
// getListData()
// getteacherrecordstableData ()
}
const getListData = () => {
state.SeeLoading = true
getListByTeacherExpenseId(state.id).then(res => {
if (res.data.code == 200) {
state.tableDataSee = res.data.data
}
state.SeeLoading = false
}).catch(err => {
message.destroy()
message.error(err.data.msg)
state.SeeLoading = false
})
}
//详情
const TeacherSystem = () => {
getTeacherFeeDetail({ id: state.id }).then((res) => {
// state.formParam=Object.assign({} ,res.data.data)
state.formParam = res.data.data
// tableDataFeeDetail.value = res.data.data.records
state.formParam.courseType = String(res.data.data.courseType)
state.formParam.levelPay = String(res.data.data.levelPay)
state.tSystemNames.systemName = res.data.data.tsystemName
state.tSystemNames.systemId = res.data.data.tsystemId
state.tSystemNames.systemCode = res.data.data.systemCode
state.tSystemNames.levelVoList = res.data.data.levelVoList
state.formParam.tlevelName = res.data.data.tlevelName
state.formParam.tlevelId = res.data.data.tlevelId
state.formParam.name = res.data.data.name + '/' + res.data.data.userNo
state.teachingDate = dayjs(res.data.data.teachingDate)
state.formParam.payrollPlaceId = res.data.data.payrollPlaceId
state.formParam.orgNames = state.formParam.orgName
state.formParam.teachingDate = dayjs(state.formParam.teachingDate).format("YYYY-MM-DD HH:mm")
})
.catch((err) => {
message.destroy()
message.error(err.data.msg)
});
}
//二级页面
const columnsFeeDetail = ref([
{
title: '时间',
dataIndex: 'updatedAt',
key: 'updatedAt',
ellipsis: true, align: "center",
width: 150,
},
{
title: '操作人 ',
dataIndex: 'updatedBy',
key: 'updatedBy9',
ellipsis: true, align: "center",
width: 150,
},
{
title: '操作 ',
dataIndex: 'status',
key: 'status',
ellipsis: true, align: "center",
width: 150,
customRender: (value) => {
return (
<div>
{ value.record.status == "A10" || value.record.status == "A20"
? {
"A10": "已提交",
"A20": "待审核",
}[value.record.status + ""] || ""
: "-" }
</div>
)
}
},
{
title: '备注 ',
dataIndex: 'remark',
key: 'remark',
ellipsis: true, align: "center",
width: 150,
},
])
//取消按钮 清空输入的数据
const cancelTeachingDialog = (val) => {
if (val) {
dialog({
content: '是否确认讲师费信息无误?提交后按“培训发生组织”汇总至审批中心,等待验证后“提交”进入审批流程。',
ok: () => {
submitApproval({ ids: state.formParam.id }).then(res => {
if (res.data.code == 200) {
message.success('提交成功')
state.teachingdialog = false
searchSubmit()
}
}).catch(err => {
message.destroy()
message.error(err.data.msg)
state.teachingdialog = false
})
}
})
} else {
state.teachingdialog = false
}
};
const clearNonNumber = () => {
state.formParam.teachingTime = state.formParam.teachingTime?.replace(/\D/g, '');
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));
state.formParam.teachingTime && state.formParam.levelPay && (state.formParam.payableExpense = (state.formParam.levelPay * (state.formParam.teachingTime / 60)).toFixed(2));
}
const clearstudysNumber = () => {
state.formParam.studys = state.formParam.studys.replace(/\D/g, '');
state.formParam.studys = state.formParam.studys?.slice(0, 8)
}
const clearscoreNumber = () => {
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 scoreNumber = () => {
state.formParam.score && (state.formParam.score = String(state.formParam.score))
}
const clearlevelPayNumber = () => {
// state.formParam.levelPay = state.formParam.levelPay?.replace(/\D/g, '');
// state.formParam.levelPay = state.formParam.levelPay?.slice(0,8);
// state.formParam.levelPay == 0;
state.formParam.levelPay && state.formParam.teachingTime && (state.formParam.expense = (state.formParam.levelPay * (state.formParam.teachingTime / 60)).toFixed(2))
state.formParam.levelPay && state.formParam.teachingTime && (state.formParam.payableExpense = (state.formParam.levelPay * (state.formParam.teachingTime / 60)).toFixed(2))
state.formParam.levelPay && (state.formParam.levelPay = String(state.formParam.levelPay))
}
const clearPayableExpense = () => {
state.formParam.payableExpense == 0 && (state.formParam.payableExpense = null);
state.formParam.payableExpense && (state.formParam.payableExpense = String(state.formParam.payableExpense))
}
watch(() => state.formParam.levelPay, (val) => {
state.formParam.levelPay && state.formParam.teachingTime && (state.formParam.expense = (state.formParam.levelPay * (state.formParam.teachingTime / 60)).toFixed(2))
state.formParam.levelPay && state.formParam.teachingTime && (state.formParam.payableExpense = (state.formParam.levelPay * (state.formParam.teachingTime / 60)).toFixed(2))
})
const rules = {
name: [{ required: true, message: '', log: '讲师不能为空' }],
userNo: [{ required: true, message: '', log: '讲师工号不能为空' }],
orgName: [{ required: true, message: '', log: '讲师组织不能为空' }],
tsystemName: [{ required: true, message: '', log: '讲师体系不能为空' }],
tlevelName: [{ required: true, message: '', log: ' 讲师级别不能为空' }],
payrollPlace: [{ required: true, message: '', log: '讲师发薪地不能为空' }],
courseType: [{ required: true, message: '', log: '费用类型不能为空' }],
courseName: [{ required: true, message: '', log: '课程名称不能为空' }],
trainOrgId: [{ required: true, message: '', log: '培训发生组织不能为空' }],
teachingDate: [{ required: true, message: '', log: '授课日期不能为空' }],
teachingTime: [{ required: true, message: '', log: ' 授课时长不能为空' }],
studys: [{ required: true, message: '', log: ' 参训人数不能为空' }],
// score: [{ required: true, message: '', log: ' 评分不能为空' }],
levelPay: [{ required: true, message: '', log: '课酬基准不能为空' }],
expense: [{ required: true, message: '', log: '计划费用不能为空' }],
// payableExpense: [{ required: true, message: '',log:'应发费用不能为空' }],
}
//TODO4 筛查
const handleOrgSearch = (value) => {
console.log("handleOrgSearch value ",value)
//克隆数据
let temp = JSON.parse(JSON.stringify(state.orgListSearch));
//选择数据
state.filterOrgListSearch = temp.filter(item => item.label.includes(value))
}
const handleOrgChange = (value) => {
if(value == undefined || value == null){
state.filterOrgListSearch = state.orgListSearch;
}
}
const handleImport = () => {
state.showWork = true
}
const allFee = () => {
state.allFeedialog = true
}
const visibleAll = (val) => {
state.allFeedialog = val
searchSubmit()
}
const getexample = (val) => {
state.example = val
props.activeKeyFn();
}
const selectedRowKey = (val) => {
state.selectsIds = val?.join(',');
state.visibleConfirm = true;
}
watch(() => state.visibleConfirm, (val) => {
if (!val) {
state.selectsIds = '';
}
})
const tableDatas = ref([])
const column = ref([
{
title: '讲师姓名 ',
dataIndex: 'name',
key: 'name',
ellipsis: true, align: "center",
width: 180,
customRender: (value, index) => {
return (
<div>
{ value.record?.name } / { value.record?.userNo }
</div>
);
},
},
// {
// title: '讲师工号 ',
// dataIndex: 'userNo',
// key: 'userNo',
// ellipsis: true, align: "center",
// width: 120,
// },
{
title: '课程名称 ',
dataIndex: 'courseName',
key: 'courseName',
ellipsis: true, align: "center",
width: 120,
},
{
title: '培训发生组织',
dataIndex: 'trainOrg',
key: 'trainOrg',
ellipsis: true, align: "center",
width: 120,
},
{
title: '授课时长 ',
dataIndex: 'teachingTime',
key: 'teachingTime',
ellipsis: true, align: "center",
width: 120,
},
{
title: '授课时间 ',
dataIndex: 'teachingTime',
key: 'teachingTime',
ellipsis: true, align: "center",
width: 120,
},
{
title: '讲师体系',
dataIndex: 'systemName',
key: 'systemName',
ellipsis: true, align: "center",
width: 120,
},
{
title: '讲师级别 ',
dataIndex: 'levelName',
key: 'levelName',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || '-'
}
// customRender: (value, record) => {
// return (
// <div>
// {value.record.grade == 0 || value.record.grade == 1 || value.record.grade == 2 || value.record.grade == 3
// ? {
// 0: "未定级",
// 1: "1级",
// 2: "2级",
// 3: "3级",
// }[value.record.grade + ""] || ""
// : "-"}
// </div>
// )
// }
},
{
title: '发薪地 ',
dataIndex: 'teacherpayrollPlace',
key: 'teacherpayrollPlace',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || '-'
}
},
{
title: '基准课酬 ',
dataIndex: 'teacherlevelPay',
key: 'teacherlevelPay',
ellipsis: true, align: "center",
width: 120,
},
{
title: '计划费用 ',
dataIndex: 'expense',
key: 'expense',
ellipsis: true, align: "center",
width: 120,
},
{
title: '参训人数 ',
dataIndex: 'studentNum',
key: 'studentNum',
ellipsis: true, align: "center",
width: 120,
customRender: ({ text }) => {
return text || '-'
}
},
{
title: '评分 ',
dataIndex: 'courseAssess',
key: 'courseAssess',
ellipsis: true, align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ value.record.score ? Number(value.record.score).toFixed(0) == 0 ? '-' : Number(value.record.score).toFixed(0) : '-' }
</div>
)
}
},
{
title: '课程类型 ',
dataIndex: ' courseType',
key: ' courseType',
ellipsis: true, align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ String(value.record.courseType)
? {
"0": "在线课",
"1": "面授课",
"2": "课程开发",
"3": "作业员入模培训",
"4": "其他",
}[value.record.courseType + ""]
: "-" }
</div>
)
}
},
{
title: '状态 ',
dataIndex: 'status',
key: 'status',
ellipsis: true, align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{ value.record.status == "0" || value.record.status == "1" || value.record.status == "2" || value.record.status == "3"
? {
"0": "待确认",
"1": "待提交",
"2": "审核中",
"3": "审核通过",
'4': '审核拒绝',
'5': '停用',
}[value.record.status + ""] || ""
: "-" }
</div>
)
}
},
{
title: '讲师组织',
dataIndex: 'trainOrg',
key: 'trainOrg',
ellipsis: true, align: "center",
width: 200,
scopedSlots: { customRender: "trainOrg" },
},
{
title: '操作 ',
dataIndex: 'operation',
key: 'operation',
ellipsis: true, align: "right",
fixed: "right",
width: 100,
scopedSlots: { customRender: "action" },
},
])
const tlevelChange = (e) => {
state.formParam.tlevelName = e?.tlevelName
state.formParam.tlevelId = e?.tlevelId
// state.formParam.payrollPlace = e?.salaryName
// state.formParam.payrollPlaceId = e?.salaryId
// state.formParam.levelPay = e?.levelPay
}
const byUserIdData = (e) => {
// e?.levelVoList.some(item=>{
// if(item.id == e?.levelId){
// state.formParam.levelPay = item.levelPay
// return true
// }
// })
state.formParam.levelPay = e
}
//导出功能
const handleExport = () => {
window.open(
`${process.env.VUE_APP_BASE_API}/admin/export/exportTeacherExpense?name=${state.searchParam.name || ""
}&status=${state.searchParam.status || ""}&trainOrgId=${state.searchParam.trainOrgId || ""}&type=${state.searchParam.type || ""}&courseName=${state.searchParam.courseName || ""}&tSystemId=${state.searchParam.tSystemId || ""}&tLevelName=${state.searchParam.tLevelName || ""}&beginTime=${state.searchParam.beginTime || ""}&endTime=${state.searchParam.endTime || ""}`
);
// this.download('lesson_records/export', {
// ...state.searchParam
// }, `project_${new Date().getTime()}.xlsx` )
}
const beforeUpload2 = (file) => {
const fileType = [
"xls",
"xlsx",
"zip",
];
if (!fileType.includes(file.name.split(".")[1])) {
message.error(
"仅支持.xls,.xlsx,.zip格式!"
);
return false;
}
const formData = new FormData();
formData.append("file", file);
fileUp(formData).then((res) => {
if (res.data.code === 200) {
state.imgList.push({
img: res.data.data,
name: file.name,
size: file.size,
});
// state.hasImgName = res.data.data;
}
});
return false;
};
//回车
const enterPressHadlerSearch = e => {
if (e.keyCode === 13) {
searchSubmit()
}
};
return {
...toRefs(state),
handleTeacher,
enterPressHadlerSearch,
rules,
formRef,
clearNonNumber,
handleImport,
beforeUpload2,
closeDeleteTeacher,
cancelTeachingDialog,
courseTypeList,
orgLists,
// searchTimeChange,
handlemoreid,
handleExport,
lecturerSystemList,
getLevelList,
OnTheJobStatusList,
// PlaceOfPayLista,
AuthenticationStatusList,
// PlaceOfPayList,
AccountStatusList,
searchSubmit,
searchReset,
columns,
columnSee,
columnsFeeDetail,
tableData,
changePagination,
addTeacher,
cancelTeacherDialog,
handleLook,
orgSplit,
cancel,
deleteModal,
updateModal,
handleModify,
// closeDeleteTeacher,
createTeacherDialog,
changeOrg,
handleOperate,
closehandleOperate,
getTableDate, //list接口数据调用
// getStu
LecturerSystemLista,
TeacherSystem,
getListData,
changetlevel,
handleOrgSearch,
handleOrgChange,
canceleditTeacherDialog,
allFee,
selectedRowKey,
visibleAll,
getexample,
column,
tableDatas,
tlevelChange,
byUserIdData,
validateField,
clearstudysNumber,
clearscoreNumber,
clearlevelPayNumber,
scoreNumber,
clearPayableExpense,
payExpense,
locale,
checkMenu
}
},
};
</script>
<style lang="scss" scoped>
.select .ant-picker {
width: 410px !important;
}
.example {
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.45);
position: fixed;
top: 0;
left: 0;
z-index: 999999;
display: flex;
justify-content: center;
align-items: center;
}
.headers {
height: 57px;
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;
}
}
.addTimeBox {
position: relative;
display: flex;
align-items: center;
.addTime {
position: absolute;
z-index: 1;
margin-left: 10px;
color: rgba(0, 0, 0, 0.4);
}
.ant-picker {
padding-left: 85px;
}
::v-deep .ant-picker-range .ant-picker-active-bar {
margin-left: 85px !important;
}
}
.addTimeBox .ant-picker {
padding-left: 85px;
}
//导出按钮icon
.daochu {
width: 16px;
height: 18px;
background-image: url("../../assets/images/coursewareManage/export1.png");
}
//弹窗内详情样式
.display1 {
display: inline-block;
width: 200px;
}
// .display0{
// display:inline-block ;
// width:200px ;
// text-align:center }
//弹窗内确认取消按钮布局
.del_btnbox {
display: flex;
margin: 30px auto;
justify-content: center;
.del_btn {
width: 100px;
height: 40px;
background: rgba(64, 158, 255, 0);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
cursor: pointer;
.btnText {
font-size: 14px;
font-weight: 400;
line-height: 40px;
}
}
.btn1 {
border: 1px solid rgba(64, 158, 255, 1);
color: #4ea6ff;
margin-right: 14px;
}
.btn2 {
background-color: #4ea6ff;
color: #ffffff;
}
}
.ant-table-cell-fix-right {
width: 300px !important;
}
.ant-table-tbody>tr>td {
text-align: center;
}
.InsideTeaching {
width: 100%;
height: 100%;
.filter {
margin-left: 38px;
margin-right: 38px;
margin-top: 30px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.select {
margin-right: 20px;
margin-bottom: 10px;
}
}
}
.delete {
z-index: 9999;
width: 424px;
background: #ffffff;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
border-radius: 4px;
position: absolute;
left: 30%;
top: 10%;
// transform: translate(-50%, -50%);
.del_header {
position: absolute;
width: calc(100%);
height: 40px;
background: linear-gradient(rgba(78, 166, 255, 0.2) 0%,
rgba(78, 166, 255, 0) 100%);
}
.del_main {
width: 100%;
position: relative;
.header {
display: flex;
align-items: center;
padding-top: 20px;
padding-left: 26px;
font-size: 16px;
.del-icon {
width: 16px;
height: 16px;
margin-right: 10px;
background-image: url(@/assets/images/coursewareManage/notice.png);
background-size: 100% 100%;
}
.icon {
width: 16px;
height: 16px;
margin-right: 10px;
background-image: url(@/assets/images/coursewareManage/QR.png);
background-size: 100% 100%;
}
.close_exit {
position: absolute;
right: 42px;
cursor: pointer;
width: 20px;
height: 20px;
background-image: url(@/assets/images/coursewareManage/close.png);
background-size: 100% 100%;
}
}
.body {
width: 100%;
margin: 34px auto 56px auto;
display: flex;
justify-content: center;
align-items: center;
}
.del_btnbox {
display: flex;
margin: 30px auto;
justify-content: center;
.del_btn {
width: 100px;
height: 40px;
background: rgba(64, 158, 255, 0);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
flex-shrink: 0;
cursor: pointer;
.btnText {
font-size: 14px;
font-weight: 400;
line-height: 40px;
}
}
.btn1 {
border: 1px solid rgba(64, 158, 255, 1);
color: #4ea6ff;
}
.btn2 {
background-color: #4ea6ff;
color: #ffffff;
}
}
}
}
.CreatePath {
.out {
z-index: 9999;
display: block;
position: absolute;
top: 90px;
width: 1080px !important;
height: 650px;
overflow: auto;
background-color: #fff;
box-shadow: 0 0 10px rgba(118, 136, 166, 0.21);
left: 50%;
top: 300px;
transform: translate(-50%, -50%);
.top {
width: 100%;
height: 68px;
background: linear-gradient(rgba(78, 166, 255, 0.2) 0%,
rgba(78, 166, 255, 0) 100%);
display: flex;
align-items: center;
.topimg {
width: 18px;
height: 18px;
margin-left: 27px;
margin-top: -2px;
}
.topc {
color: #000000;
font-size: 16px;
margin-left: 8px;
}
}
.mid {
width: 100%;
height: 100%;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
.d {
// margin-top: 8px;
// color: #ff4e4e;
margin-left: -5px;
}
}
}
}
//添加样式
.langbtn {
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
flex-shrink: 0;
cursor: pointer;
.search {
width: 15px;
height: 16px;
margin-right: 5px;
background: url("../../assets/images/courseManage/add0.png") no-repeat;
background-size: 100% 100%;
}
}
// 重置样式
.resetbtn {
width: 100px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
flex-shrink: 0;
cursor: pointer;
}
//展开收起样式
.moreidbtn {
border: none;
color: #4ea6ff;
// width: 80px;
line-height: 40px;
padding: 0;
}
//小竖线
.line {
float: left;
width: 3px;
height: 17px;
background: #4ea6ff;
border-radius: 30%;
margin-right: 5px;
margin-top: 3px;
}
//抽屉功能
.drawaer // /* 改变所有 a-tree-select 输入框的高度 */
// ::v-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{
// height: 40px;
// line-height: 40px;
// border-radius: 8px
// /* 确保文字垂直居中 */
// }
::v-deep .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
height: 40px !important;
line-height: 40px;
border-radius: 8px
}
// 抽屉内样式
.draitem {
width: 100%;
height: 40px !important;
border-radius: 8px;
line-height: 40px;
}
.drabtn {
height: 40px;
width: 80px;
border-radius: 8px;
margin-right: 20px
}
::v-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector {
border-radius: 8px;
height: 40px;
}
.ant-col-12 {
height: 90px;
}
::v-deep .ant-select-selection-overflow-item {
margin-top: -2px;
}
::v-deep .ant-select-multiple .ant-select-selection-item {
height: 34px
}
.tableBox {
padding-bottom: 20px;
margin: 20px 38px 30px;
::v-deep .ant-select-dropdown {
display: inline-block;
}
::v-deep .ant-select-selection-item {
margin-left: 3px;
}
::v-deep .ant-pagination-options-size-changer.ant-select {
width: 84px;
}
.pa {
width: 100%;
display: flex;
justify-content: right;
}
}
</style>