mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-25 02:32:54 +08:00
1167 lines
36 KiB
Vue
1167 lines
36 KiB
Vue
<template>
|
||
<a-drawer :visible="visible" placement="right" :closable="false" :maskClosable="false"
|
||
width="60%" :title="false">
|
||
<div class="appedit">
|
||
<div class="header" style="margin-top: -24px;">
|
||
<div class="headerTitle">编辑讲师费审批</div>
|
||
<img
|
||
style="width: 29px; height: 29px; cursor: pointer"
|
||
src="../../assets/images/basicinfo/close.png"
|
||
@click="closeDrawer"
|
||
/>
|
||
</div>
|
||
<div class="content">
|
||
<div class="title">
|
||
<div class="line"></div>
|
||
<div class="text">基本信息</div>
|
||
</div>
|
||
<div class="desc">
|
||
<a-descriptions :column="2" bordered>
|
||
<a-descriptions-item label="审批编号">{{formData?.approvalNumber||'-'}}</a-descriptions-item>
|
||
<a-descriptions-item label="培训发生组名称">{{formData?.trainOrgName||'-'}}</a-descriptions-item>
|
||
<a-descriptions-item label="提交时间">{{formData?.approvalSubmitTime||'-'}}</a-descriptions-item>
|
||
<a-descriptions-item label="汇总金额">{{formData?.summaryTotal||'-'}}</a-descriptions-item>
|
||
<a-descriptions-item label="状态">
|
||
{{{0:'待确认' ,1:'待提交' ,2:'审核中', 3:'已完成', 4:'审核拒绝',5:'待提交'}[formData?.status]}}
|
||
</a-descriptions-item>
|
||
</a-descriptions>
|
||
</div>
|
||
<div class="title">
|
||
<div class="line"></div>
|
||
<div class="text">基本信息</div>
|
||
</div>
|
||
<div class="desc">
|
||
<div class="input_box">
|
||
<div class="input">
|
||
<a-input @pressEnter="search" style="height:40px;border-radius:8px;" v-model:value="params.userNoName" placeholder="请输入工号/讲师名称进行搜索" allowClear />
|
||
</div>
|
||
<div class="input">
|
||
<a-range-picker style="height:40px;border-radius:8px;" @change="dateChange" valueFormat="YYYY-MM-DD" format="YYYY-MM-DD" v-model:value="dateValue" />
|
||
</div>
|
||
<div class="input">
|
||
<a-button style="margin-right: 15px;height:40px;border-radius:8px;" type="primary" @click="search">搜索</a-button>
|
||
<a-button style="height:40px;border-radius:8px;" type="primary" @click="reset">重置</a-button>
|
||
</div>
|
||
</div>
|
||
<div style="margin-bottom: 20px;">
|
||
<a-button @click="searchResetPrevious()" type="primary" class="langbtn" style="width: 150px; height: 40px; border-radius: 8px" >
|
||
重新汇总讲师费
|
||
</a-button>
|
||
</div>
|
||
<div class="table">
|
||
<a-table
|
||
:columns="columns"
|
||
:dataSource="dataList"
|
||
:loading="loading"
|
||
:scroll="{ x: 'max-content' }"
|
||
:pagination="pagination"
|
||
>
|
||
<template #orgName="{record}">
|
||
<div :title="record?.orgName" style="maxWidth:200px;overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;">{{flipData(record.orgName)||'-'}}</div>
|
||
</template>
|
||
<template #appEdit="{ record }">
|
||
<a-button type="link" :disabled="record.createFrom==1 ?false :true" @click="edit(record)">编辑</a-button>
|
||
<a-button type="link" @click="recome(record)">移除</a-button>
|
||
</template>
|
||
</a-table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="btnn">
|
||
<button class="btn2" @click="closeDrawer">取消</button>
|
||
<button class="btn2" @click="paramsDrawer">提交</button>
|
||
</div>
|
||
</div>
|
||
<a-drawer v-model:visible="teacherdialog" placement="right" :closable="false" :maskClosable="false" dropdown-style="drawaer"
|
||
width="60%" :title="false">
|
||
<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="cancelTeacherDialog"
|
||
/>
|
||
</div>
|
||
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef" >
|
||
<!-- 讲师姓名 name 讲师工号 userNo-->
|
||
<a-row :gutter="16">
|
||
<a-col :span="12">
|
||
<a-form-item label="讲师名称" name="name">
|
||
<SearchTeacher :disabled="true" @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 label="讲师工号" name="userNo">
|
||
<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 label="讲师组织" name="orgName">
|
||
<!-- <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 label="讲师体系" name="tsystemName">
|
||
<!-- <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 label="讲师级别" name="tlevelName">
|
||
<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 label="讲师发薪地" name="payrollPlace">
|
||
<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 label="费用类型" name="courseType">
|
||
<a-select class="draitem" v-model:value="formParam.courseType" placeholder="请选择费用类型"
|
||
:options="courseTypeList">
|
||
</a-select>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12">
|
||
<a-form-item label="课程名称" name="courseName">
|
||
<!-- <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 :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 label="培训发生组织" name="trainOrgId">
|
||
<!-- <OrgClass
|
||
v-model:value="formParam.sourceBelongId"
|
||
v-model:name="formParam.sourceBelongFullName"
|
||
></OrgClass> -->
|
||
<a-select v-model:value="formParam.trainOrgId" placeholder="请选择培训发生组织" allowClear
|
||
:options="orgList" @change="changeOrg">
|
||
</a-select>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12">
|
||
<a-form-item label="授课/课程日期 :" name="teachingDate">
|
||
<a-date-picker 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="请选择课程日期" />
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
<!-- 参训人数 studys 评分 score -->
|
||
<a-row :gutter="16">
|
||
<a-col :span="12">
|
||
<a-form-item label="授课时长" name="teachingTime">
|
||
<a-input v-model:value="formParam.teachingTime" style="width:80%; 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 label="参训人数" name="studys">
|
||
<a-input 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 label="评分" name="score">
|
||
<a-input-number class="draitem" v-model:value="formParam.score" :defaultValue="null" :max="10" :controls="false" :min="0" :precision="2" placeholder="请输入评分"
|
||
allowClear >
|
||
</a-input-number>
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12">
|
||
<a-form-item label="课酬基准" name="levelPay">
|
||
<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 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-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>
|
||
</a-drawer>
|
||
<a-modal
|
||
:visible="modalVisible"
|
||
:footer="null"
|
||
:title="null"
|
||
:centere="true"
|
||
:closable="false"
|
||
style="margin-top: 400px"
|
||
:zIndex="9"
|
||
@cancel="close"
|
||
>
|
||
<div class="delete">
|
||
<div class="del_header"></div>
|
||
<div class="del_main">
|
||
<div class="header">
|
||
<div class="del-icons">
|
||
<img src="@/assets/images/coursewareManage/QR.png" alt=""/>
|
||
</div>
|
||
<span>提示</span>
|
||
<div class="close_exit" @click="close"></div>
|
||
</div>
|
||
<div class="body">
|
||
<div style="margin-top: 30px;">
|
||
<span>自动添加的讲师费不可直接编辑,需在数据源头进行修改</span>
|
||
</div>
|
||
</div>
|
||
<div class="del_btnbox">
|
||
<div class="del_btn btn2" @click="close">
|
||
<div class="btnText">取消</div>
|
||
</div>
|
||
<div class="del_btn btn2" @click="handleConfirm">
|
||
<div class="btnText">复制课程名称</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</a-modal>
|
||
</a-drawer>
|
||
</template>
|
||
|
||
<script lang="jsx">
|
||
import { ref, reactive,toRefs,watch,onMounted,computed } from 'vue'
|
||
import { isConfirm,updateTeacherFee,getTeacherFeeDetail,withdrawRecord,queryById,queryExpnseByBillId,CreateSummaryAgain, } from "../../api/lecturerFeeManagement";
|
||
import SearchTeacher from "@/components/project/SearchTeacher";
|
||
import { useRouter,useRoute } from 'vue-router'
|
||
import dialog from '@/utils/dialog'
|
||
import dayjs from "dayjs";
|
||
import { message } from 'ant-design-vue';
|
||
import { queryTrainOrgPor,} from "../../api/organization";
|
||
export default {
|
||
components: {
|
||
SearchTeacher,
|
||
},
|
||
props: {
|
||
visible: {
|
||
type: Boolean,
|
||
default: false,
|
||
},
|
||
id: {
|
||
type: String,
|
||
default: "",
|
||
},
|
||
},
|
||
setup (props,emits) {
|
||
const router = useRouter()
|
||
const route = useRoute()
|
||
const state = reactive({
|
||
orgList: [],
|
||
params: {
|
||
pageNo: 1,
|
||
pageSize: 10,
|
||
total: 100,
|
||
userNoName: null,
|
||
startTime: null,
|
||
endTime: null,
|
||
},
|
||
paramsId: props.id,
|
||
copyName: null,
|
||
modalVisible: false,
|
||
tSystemNames:{
|
||
systemName:null,
|
||
systemId: null,
|
||
levelVoList: []
|
||
},
|
||
teachingDate:null,
|
||
formData: {
|
||
|
||
},
|
||
formParam: {
|
||
teachingDate:null ,
|
||
teachingTime:null,
|
||
name: null,
|
||
userNo: null,
|
||
payrollPlace: null,
|
||
payrollPlaceId: null,
|
||
orgName:null,
|
||
tsystemName:null,
|
||
tlevelId:null,
|
||
courseType: null,
|
||
courseName:null,
|
||
studys:null,
|
||
teacherlevelPay:null,
|
||
score:null,
|
||
levelPay:null,
|
||
payableExpense:null,
|
||
expense:null,
|
||
remark:null,
|
||
},
|
||
teacherdialog: false,
|
||
dateValue: [],
|
||
dataList: [],
|
||
loading: false,
|
||
})
|
||
watch(()=>props.visible, (val) => {
|
||
if(val){
|
||
queryById({id: state.paramsId}).then(res=>{
|
||
state.formData = res.data.data
|
||
})
|
||
getTableList()
|
||
orgLists()
|
||
}
|
||
})
|
||
onMounted(()=>{
|
||
|
||
})
|
||
const getTableList = () => {
|
||
state.loading = true
|
||
queryExpnseByBillId({
|
||
billId: state.paramsId,
|
||
pageNo: state.params.pageNo,
|
||
pageSize: state.params.pageSize,
|
||
name: state.params.userNoName,
|
||
startTime: state.params.startTime,
|
||
endTime: state.params.endTime
|
||
}).then(res => {
|
||
state.dataList = res.data.data.records
|
||
state.params.total = Number(res.data.data.total);
|
||
state.loading = false
|
||
})
|
||
}
|
||
const dateChange = (e) => {
|
||
if(e){
|
||
state.params.startTime = e[0];
|
||
state.params.endTime = e[1];
|
||
}else{
|
||
state.params.startTime = null;
|
||
state.params.endTime = null;
|
||
}
|
||
}
|
||
const pagination = computed(() => ({
|
||
total: state.params.total,
|
||
showSizeChanger: true,
|
||
showQuickJumper:true,
|
||
current: state.params.pageNo,
|
||
pageSize: state.params.pageSize,
|
||
onChange: paginationChange,
|
||
}));
|
||
const paginationChange = (e,pageSize) => {
|
||
state.params.pageNo = e;
|
||
state.params.pageSize = pageSize
|
||
getTableList();
|
||
};
|
||
const close = () => {
|
||
state.modalVisible = false;
|
||
state.copyName = null;
|
||
}
|
||
const search = () => {
|
||
state.params.pageNo = 1
|
||
getTableList()
|
||
}
|
||
const reset = () => {
|
||
state.params.userNoName = null
|
||
state.params.startTime = null
|
||
state.params.endTime = null
|
||
state.dateValue = []
|
||
search()
|
||
}
|
||
const searchResetPrevious = () => {
|
||
dialog({
|
||
content: '确定要重新汇总数据吗?',
|
||
ok: () => {
|
||
CreateSummaryAgain(props.id).then(res=>{
|
||
queryById({id: state.paramsId}).then(res=>{
|
||
state.formData = res.data.data
|
||
})
|
||
search();
|
||
}).catch(err=>{
|
||
message.destroy()
|
||
message.error(err.data.msg)
|
||
})
|
||
}
|
||
})
|
||
}
|
||
const handleConfirm = () => {
|
||
navigator.clipboard.writeText(state.copyName).then(() => {
|
||
message.success('复制成功')
|
||
close()
|
||
}).catch(() => {
|
||
message.error('复制失败,请重新尝试')
|
||
});
|
||
}
|
||
const clearPayableExpense = () => {
|
||
state.formParam.payableExpense == 0 && (state.formParam.payableExpense = null);
|
||
state.formParam.payableExpense && (state.formParam.payableExpense = String(state.formParam.payableExpense))
|
||
}
|
||
const clearlevelPayNumber = () => {
|
||
// state.formParam.levelPay = state.formParam?.levelPay.replace(/\D/g, '');
|
||
// state.formParam.expense = state.formParam?.levelPay*state.formParam?.teachingTime
|
||
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))
|
||
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 clearscoreNumber= () => {
|
||
state.formParam.score = state.formParam?.score?.replace(/\D/g, '');
|
||
}
|
||
const clearstudysNumber = () => {
|
||
state.formParam.studys = state.formParam?.studys?.replace(/\D/g, '');
|
||
state.formParam.studys = state.formParam.studys?.slice(0,8)
|
||
}
|
||
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 courseTypeList = ref([
|
||
{ value: '0', label: "在线" },
|
||
{ value: '1', label: "面授 " },
|
||
{ value: '2', label: "授课 " },
|
||
{ value: '3', label: "课程开发" },
|
||
{ value: '4', label: "作业员如模培训" },
|
||
])
|
||
const formRef = ref();
|
||
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
|
||
}
|
||
watch(()=>state.formParam.name,(val)=>{
|
||
state.formParam.userNo = val?.split('/')[1]
|
||
})
|
||
async function validateField(name) {
|
||
return new Promise((resolve) => {
|
||
formRef.value.validateFields([name])
|
||
.then(() => {
|
||
resolve(false);
|
||
})
|
||
.catch(() => {
|
||
resolve(true);
|
||
});
|
||
});
|
||
}
|
||
const orgLists = () => {
|
||
const obj = {
|
||
pageNo:1,
|
||
pageSize:50
|
||
}
|
||
queryTrainOrgPor(obj).then((res) => {
|
||
console.log(res,'rssssss')
|
||
state.orgList = res.data.data?.map(item=>{
|
||
return{
|
||
label: item.affiliationName,
|
||
value: item.id
|
||
}
|
||
})
|
||
})
|
||
}
|
||
const changeOrg = (e,l) => {
|
||
console.log(e,'eeeee',l)
|
||
state.formParam.trainOrgName = l?.label
|
||
}
|
||
const createTeacherDialog = async () => {
|
||
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.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
|
||
}
|
||
if(state.formParam.levelPay){
|
||
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]);
|
||
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]
|
||
updateTeacherFee(state.formParam).then(response => {
|
||
message.success("编辑成功");
|
||
state.teacherdialog = false;
|
||
cancel()
|
||
search();
|
||
}).catch(err=>{
|
||
message.destroy()
|
||
state.teacherdialog = false;
|
||
message.error(err.data.msg)
|
||
})
|
||
};
|
||
const cancelTeacherDialog = () => {
|
||
formRef.value.resetFields();
|
||
state.teacherdialog = false
|
||
cancel()
|
||
};
|
||
const cancel = () => {
|
||
state.formParam ={
|
||
name:null,
|
||
userNo:null,
|
||
orgName:null,
|
||
tsystemName:null,
|
||
tlevelId:null,
|
||
payrollPlace:null,
|
||
courseType: null,
|
||
courseName:null,
|
||
teachingDate:null,
|
||
teachingTime:null,
|
||
studys:null,
|
||
teacherlevelPay:null,
|
||
score:null,
|
||
levelPay:null,
|
||
payableExpense:null,
|
||
expense:null,
|
||
remark:null,
|
||
}
|
||
state.teachingDate=null
|
||
state.tSystemNames = {
|
||
systemName:null,
|
||
systemId: null,
|
||
levelVoList: []
|
||
}
|
||
}
|
||
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: '课程名称不能为空' }],
|
||
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:'应发费用不能为空' }],
|
||
}
|
||
const closeDrawer = () => {
|
||
state.params.userNoName = null
|
||
state.params.startTime = null
|
||
state.params.endTime = null
|
||
state.dateValue = []
|
||
emits.emit('update:visible',false)
|
||
// router.push({
|
||
// path: '/lecturerfeemanagement',
|
||
// query:{activeKey:true}
|
||
// })
|
||
}
|
||
const paramsDrawer = () => {
|
||
dialog({
|
||
content: '请仔细核对讲师费信息,确认无误后,将自动进入(BPM系统)审批流程',
|
||
ok: ()=>{
|
||
isConfirm({
|
||
id: props.id,
|
||
status: 2
|
||
}).then(res=>{
|
||
if(res.data.code == 200){
|
||
message.success('提交成功')
|
||
closeDrawer();
|
||
}
|
||
}).catch(err=>{
|
||
message.destroy()
|
||
message.error(err.data.msg)
|
||
})
|
||
}
|
||
})
|
||
}
|
||
const flipData = (val) => {
|
||
if(val){
|
||
const parts = val.split('/');
|
||
const reversedParts = parts.reverse();
|
||
return reversedParts.join('/');
|
||
}
|
||
}
|
||
watch(() => state.formParam.orgNames, (val) => {
|
||
if(val){
|
||
const parts = val.split('/');
|
||
const reversedParts = parts.reverse();
|
||
state.formParam.orgName = reversedParts.join('/');
|
||
}
|
||
})
|
||
const edit = (record) => {
|
||
console.log(record,'record')
|
||
if(record.id == 2){
|
||
state.modalVisible = true;
|
||
state.copyName = record.name
|
||
return
|
||
}
|
||
state.teacherdialog = true
|
||
getTeacherFeeDetail({id : record.id}).then((res) => {
|
||
state.formParam=res.data.data
|
||
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) => {
|
||
console.log("详情", err);
|
||
});
|
||
}
|
||
const recome = (record) => {
|
||
console.log(record,'record')
|
||
dialog({
|
||
content: '确定要移除此条数据吗?',
|
||
ok: () => {
|
||
withdrawRecord({
|
||
billId: props.id,
|
||
ids: [record.id]
|
||
}).then(res=>{
|
||
message.success('移除成功')
|
||
search()
|
||
}).catch(err=>{
|
||
message.error(err.msg)
|
||
})
|
||
}
|
||
})
|
||
}
|
||
const columns = ref([
|
||
{
|
||
title: '讲师姓名 ',
|
||
dataIndex: 'name',
|
||
key: 'name',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '讲师工号',
|
||
dataIndex: 'userNo',
|
||
key: 'userNo',
|
||
align: "center",
|
||
ellipsis: true,
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '所属组织 ',
|
||
dataIndex: 'orgName',
|
||
key: 'orgName',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 200,
|
||
slots: { customRender: "orgName" },
|
||
},
|
||
{
|
||
title: '讲师体系',
|
||
dataIndex: 'tsystemName',
|
||
key: 'tsystemName',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '讲师级别',
|
||
dataIndex: 'tlevelName',
|
||
key: 'tlevelName',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '发薪地',
|
||
dataIndex: 'payrollPlace',
|
||
key: 'payrollPlace',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '课程类型',
|
||
dataIndex: 'courseType',
|
||
key: 'courseType',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
customRender: (value) => {
|
||
return (
|
||
<div>
|
||
{String(value.record.courseType)
|
||
? {
|
||
"0": "在线课",
|
||
"1": "面授课",
|
||
"2": "课程开发",
|
||
"3": "作业员入模培训",
|
||
"4": "其他",
|
||
}[value.record.courseType + ""]
|
||
: "-"}
|
||
</div>
|
||
)
|
||
}
|
||
},
|
||
{
|
||
title: '课程名称',
|
||
dataIndex: 'courseName',
|
||
key: 'courseName',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 200,
|
||
},
|
||
{
|
||
title: '授课/开发课程日期',
|
||
dataIndex: 'teachingDate',
|
||
key: 'teachingDate',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 200,
|
||
},
|
||
{
|
||
title: '授课/开发课程时长 ',
|
||
dataIndex: 'teachingTime',
|
||
key: 'teachingTime',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
customRender:(value)=>{
|
||
return (
|
||
<div>
|
||
{(value.record?.teachingTime/60).toFixed(2)}小时
|
||
</div>
|
||
)
|
||
}
|
||
},
|
||
{
|
||
title: '参训人数 ',
|
||
dataIndex: 'studys',
|
||
key: 'studys',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '评分 ',
|
||
dataIndex: 'score',
|
||
key: 'score',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '课程基准 ',
|
||
dataIndex: 'levelPay',
|
||
key: 'levelPay',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '计划费用 ',
|
||
dataIndex: 'expense',
|
||
key: 'expense',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '应发费用 ',
|
||
dataIndex: 'payableExpense',
|
||
key: 'payableExpense',
|
||
ellipsis: true,
|
||
align: "center",
|
||
width: 160,
|
||
},
|
||
{
|
||
title: '操作 ',
|
||
dataIndex: 'operation',
|
||
key: 'operation',
|
||
ellipsis: true,
|
||
align: "center",
|
||
fixed: "right",
|
||
width: 160,
|
||
slots: { customRender: "appEdit" },
|
||
},
|
||
])
|
||
|
||
return {
|
||
...toRefs(state),
|
||
columns,
|
||
closeDrawer,
|
||
paramsDrawer,
|
||
edit,
|
||
flipData,
|
||
rules,
|
||
recome,
|
||
validateField,
|
||
tlevelChange,
|
||
createTeacherDialog,
|
||
changeOrg,
|
||
orgLists,
|
||
cancelTeacherDialog,
|
||
formRef,
|
||
courseTypeList,
|
||
clearlevelPayNumber,
|
||
clearPayableExpense,
|
||
clearscoreNumber,
|
||
clearstudysNumber,
|
||
clearNonNumber,
|
||
close,
|
||
handleConfirm,
|
||
search,
|
||
dateChange,
|
||
getTableList,
|
||
reset,
|
||
searchResetPrevious,
|
||
pagination,
|
||
paginationChange,
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
::v-deep .ant-select-single:not(.ant-select-customize-input) .ant-select-selector{
|
||
height: 40px !important;
|
||
line-height: 40px;
|
||
border-radius: 8px
|
||
}
|
||
::v-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{
|
||
border-radius:8px;
|
||
height:40px;
|
||
}
|
||
::v-deep .ant-descriptions-bordered .ant-descriptions-item-label{
|
||
width: 200px;
|
||
}
|
||
.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;
|
||
}
|
||
}
|
||
.delete {
|
||
min-width: 424px;
|
||
background: #ffffff;
|
||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
|
||
border-radius: 4px;
|
||
position: absolute;
|
||
left: 50%;
|
||
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-icons {
|
||
width: 16px;
|
||
height: 16px;
|
||
position: relative;
|
||
margin-right: 10px;
|
||
|
||
img {
|
||
width: 100%;
|
||
height: 100%;
|
||
position: absolute;
|
||
top: 0px;
|
||
left: 0px;
|
||
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%;
|
||
}
|
||
|
||
}
|
||
.title{
|
||
padding: 0 30px;
|
||
margin-top: 34px;
|
||
}
|
||
|
||
.body {
|
||
width: 100%;
|
||
padding: 0 30px;
|
||
margin: 34px auto 56px auto;
|
||
margin-top: 10px;
|
||
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;
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
.draitem{
|
||
width: 100%;
|
||
height: 40px !important;
|
||
border-radius: 8px;
|
||
line-height: 40px;
|
||
}
|
||
.drabtn{
|
||
height:40px;
|
||
width:80px;
|
||
border-radius:8px;
|
||
margin-right:20px
|
||
}
|
||
.appedit {
|
||
width: 100%;
|
||
// margin: 0px 32px 0px 32px;
|
||
overflow-x: auto;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.header {
|
||
padding: 0px 15px;
|
||
height: 68px;
|
||
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;
|
||
}
|
||
}
|
||
.content{
|
||
margin: 0px 32px;
|
||
padding-right: 20px;
|
||
.title{
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 20px;
|
||
.line{
|
||
width: 5px;
|
||
height: 15px;
|
||
background: #4ea6ff;
|
||
margin-right: 10px;
|
||
}
|
||
.text{
|
||
|
||
}
|
||
}
|
||
.desc{
|
||
margin-bottom: 30px;
|
||
.input_box{
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
.input{
|
||
margin-right: 20px;
|
||
}
|
||
}
|
||
.table{
|
||
padding-bottom: 70px;
|
||
}
|
||
}
|
||
}
|
||
|
||
.btnn {
|
||
position: absolute;
|
||
bottom: 0;
|
||
width: 100%;
|
||
left: -6px;
|
||
z-index: 9;
|
||
background: #fff;
|
||
padding: 0px 32px;
|
||
min-height: 70px;
|
||
border-top: 1px solid #e6e6e6;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: end;
|
||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||
|
||
.btn1 {
|
||
width: 100px;
|
||
height: 40px;
|
||
border: 1px solid #4ea6ff;
|
||
border-radius: 8px;
|
||
color: #4ea6ff;
|
||
background-color: #fff;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.btn2 {
|
||
cursor: pointer;
|
||
width: 100px;
|
||
height: 40px;
|
||
background: #4ea6ff;
|
||
border-radius: 8px;
|
||
border: 0;
|
||
margin-left: 15px;
|
||
color: #fff;
|
||
}
|
||
}
|
||
}
|
||
</style> |