讲师管理bug

This commit is contained in:
zhangsir
2024-11-19 15:55:19 +08:00
parent 3d293af18e
commit e722a29759
4 changed files with 78 additions and 32 deletions

View File

@@ -203,6 +203,7 @@ const searchMember = (keyword) => {
payrollPlaceCode: item.payrollPlaceCode, payrollPlaceCode: item.payrollPlaceCode,
payrollPlaceName:item.payrollPlaceName, payrollPlaceName:item.payrollPlaceName,
avatar: item.avatar, avatar: item.avatar,
gender: item.gender
} }
}) })
}else{ }else{

View File

@@ -378,27 +378,34 @@ export default {
ellipsis: true, align: "center", ellipsis: true, align: "center",
width: 200, width: 200,
}, },
{
title: '供应商',
dataIndex: 'supplier',
key: 'supplier',
ellipsis: true, align: "center",
width: 200,
},
{ {
title: '手机号码', title: '手机号码',
dataIndex: 'mobile', dataIndex: 'mobile',
key: 'mobile', key: 'mobile',
ellipsis: true, align: "center", ellipsis: true, align: "center",
width: 200, width: 200,
// customRender: (value, record) => { customRender: (value, record) => {
// return ( return (
// <div> <div>
// {value.record.orgName} {value.record.mobile||'-'}
// </div> </div>
// ) )
// } }
},
{
title: '讲师邮箱 ',
dataIndex: 'email',
key: 'email',
ellipsis: true, align: "center",
width: 200,
}, },
// {
// title: '讲师邮箱 ',
// dataIndex: 'email',
// key: 'email',
// ellipsis: true, align: "center",
// width: 200,
// },
{ {
title: '授课时长 ', title: '授课时长 ',
dataIndex: 'teaching', dataIndex: 'teaching',
@@ -520,6 +527,7 @@ export default {
} }
//保存 //保存
const createTeacherDialog = async () => { const createTeacherDialog = async () => {
state.formParam.supplier = state.formParam?.supplier?.trim()
const formItemNames = Object.keys(rules); const formItemNames = Object.keys(rules);
for(let i=0;i<formItemNames.length;i++){ for(let i=0;i<formItemNames.length;i++){
const result = await validateField(formItemNames[i]); const result = await validateField(formItemNames[i]);
@@ -535,7 +543,11 @@ export default {
state.teacherdialog = false; state.teacherdialog = false;
cancel() cancel()
getTableDate(); getTableDate();
}); }).catch(err=>{
state.teacherdialog = false;
message.destroy()
message.error(err.data.msg)
})
} }
else { else {
insertTeacher(state.formParam) insertTeacher(state.formParam)
@@ -544,9 +556,11 @@ export default {
state.teacherdialog = false; state.teacherdialog = false;
cancel() cancel()
getTableDate(); getTableDate();
}).catch((err) => { }).catch(err=>{
console.log(err); state.teacherdialog = false;
}); message.destroy()
message.error(err.data.msg)
})
} }
}; };
//删除弹窗 //删除弹窗
@@ -683,6 +697,8 @@ export default {
// state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo // state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo
}) })
.catch((err) => { .catch((err) => {
message.destroy()
message.error(err.data.msg)
console.log("外部讲师详情", err); console.log("外部讲师详情", err);
}); });
} }
@@ -693,7 +709,7 @@ export default {
// state.formParam.mobile='2' // state.formParam.mobile='2'
// // state.formParam.mobile = state.formParam.mobile.replace(/\D/g, ''); // // state.formParam.mobile = state.formParam.mobile.replace(/\D/g, '');
// } // }
state.formParam.name = state.formParam.name.replace(/\s/g, ''); state.formParam.name = state.formParam?.name?.replace(/\s/g, '');
} }
const sendPhone=()=>{ const sendPhone=()=>{
console.log(state.formParam.mobile) console.log(state.formParam.mobile)

View File

@@ -135,6 +135,8 @@
<a-upload :disabled="!formParam.name" name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false" <a-upload :disabled="!formParam.name" name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers" :before-upload="beforeUpload"> :headers="headers" :before-upload="beforeUpload">
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" /> <img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" />
<img class="i_upload_img" v-else-if="formParam.gender==1" src="../../assets/Avatarman.png" alt="avatar" title="更换头像" />
<img class="i_upload_img" v-else-if="formParam.gender==2" src="../../assets/Avatarwoman.png" alt="avatar" title="更换头像" />
<img class="i_upload_img" v-else src="../../assets/avatar.png" alt="avatar" title="更换头像" /> <img class="i_upload_img" v-else src="../../assets/avatar.png" alt="avatar" title="更换头像" />
<!-- <div class="i_upload" v-else> <!-- <div class="i_upload" v-else>
<div class="addimg"> <div class="addimg">
@@ -460,6 +462,7 @@ export default {
defaultTeachingTime: null, defaultTeachingTime: null,
teacherType:1, teacherType:1,
photo: null, photo: null,
gender: 0,
orgLists: [], orgLists: [],
certification: null, certification: null,
certificationName: null, certificationName: null,
@@ -643,7 +646,7 @@ export default {
let array = []; let array = [];
arr.map((value) => { arr.map((value) => {
let obj = { let obj = {
value: value.levelName, value: value.id,
label: value.levelName, label: value.levelName,
}; };
array.push(obj); array.push(obj);
@@ -753,7 +756,7 @@ export default {
}, },
{ {
title: '授课时长 ', title: '授课时长(分钟)',
dataIndex: 'teaching', dataIndex: 'teaching',
key: 'teaching', key: 'teaching',
ellipsis: true, align: "center", ellipsis: true, align: "center",
@@ -938,9 +941,11 @@ export default {
}); });
} }
const teacherTlevel = (val) => { const teacherTlevel = (val) => {
console.log(val,'vallll')
if(val?.avatar){ if(val?.avatar){
state.formParam.photo = val.avatar state.formParam.photo = val.avatar
} }
state.formParam.gender = val?.gender
} }
const repl = (val) => { const repl = (val) => {
if(val){ if(val){
@@ -1120,6 +1125,7 @@ export default {
status: null, status: null,
teacherType: 1, teacherType: 1,
photo: null, photo: null,
gender: 0,
name: null, name: null,
newdepartId: null, newdepartId: null,
tlevelId: null, tlevelId: null,

View File

@@ -23,10 +23,11 @@ ExternalLecturer
:width="55" style="border-radius: 50%;" :width="55" style="border-radius: 50%;"
:src=formParam.photo :src=formParam.photo
/></a-descriptions-item> /></a-descriptions-item>
<a-descriptions-item label="讲师姓名">{{formParam.name}}</a-descriptions-item> <a-descriptions-item label="讲师姓名">{{formParam.name||'-'}}</a-descriptions-item>
<a-descriptions-item label="手机号码">{{formParam.mobile}}</a-descriptions-item> <a-descriptions-item label="手机号码">{{formParam.mobile||'-'}}</a-descriptions-item>
<a-descriptions-item label="讲师邮箱">{{formParam.email}}</a-descriptions-item> <a-descriptions-item label="供应商">{{formParam.supplier||'-'}}</a-descriptions-item>
<a-descriptions-item label="授课时长" :span="2">{{formParam.teaching}} <a-descriptions-item label="讲师邮箱">{{formParam.email||'-'}}</a-descriptions-item>
<a-descriptions-item label="授课时长" :span="2">{{formParam.teaching||'-'}}
<span style="margin-left: 5px;" v-if="formParam.teaching != null">分钟</span> <span style="margin-left: 5px;" v-if="formParam.teaching != null">分钟</span>
<span style="margin-left: 10px ; padding: 2px;" v-if="formParam.teaching != null">({{ <span style="margin-left: 10px ; padding: 2px;" v-if="formParam.teaching != null">({{
(formParam.teaching / 60).toFixed(2) }}小时)</span> (formParam.teaching / 60).toFixed(2) }}小时)</span>
@@ -57,23 +58,23 @@ ExternalLecturer
<a-tab-pane key="1" tab="授课记录"> <a-tab-pane key="1" tab="授课记录">
<a-table :header-cell-style="{ 'text-align': 'center' }" style="border: 1px solid #f2f6fe" :columns="teacherrecordsColumns" <a-table :header-cell-style="{ 'text-align': 'center' }" style="border: 1px solid #f2f6fe" :columns="teacherrecordsColumns"
:data-source="teacherrecordstableData" :loading="teacherrecordsLoading" @expand="expandTable" :pagination="false"> :data-source="teacherrecordstableData" :loading="teacherrecordsLoading" @expand="expandTable" :pagination="pagination">
</a-table> </a-table>
<div style="float: right;"> <!-- <div style="float: right;">
<a-pagination <a-pagination
v-if="tableDataTotal > 10" v-if="tableDataTotal > 10"
:showSizeChanger="true" :showSizeChanger="true"
:showQuickJumper="false" :showQuickJumper="false"
:hideOnSinglePage="true" :hideOnSinglePage="false"
:pageSize="searchParam.pageSize" :pageSize="searchParam.pageSize"
:current="searchParam.pageNo" :current="searchParam.pageNo"
:total="tableDataTotal" :total="tableDataTotal"
class="pagination" class="pagination"
@change="changePagination" @change="changePagination"
/> />
</div> </div> -->
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@@ -83,11 +84,12 @@ ExternalLecturer
</template> </template>
<script lang ="jsx"> <script lang ="jsx">
import { useRouter,useRoute } from "vue-router"; import { useRouter,useRoute } from "vue-router";
import { reactive, toRefs, ref } from "vue" import { reactive, toRefs, ref,computed } from "vue"
import {getTeacherById} from "../../api/Lecturer"; import {getTeacherById} from "../../api/Lecturer";
import { getNewInTeacherCourseList } from "../../api/Teaching"; import { getNewInTeacherCourseList } from "../../api/Teaching";
// import boe from '@/assets/boe.jpg' // import boe from '@/assets/boe.jpg'
import avatar from '@/assets/avatar.png' import avatar from '@/assets/avatar.png'
import dayjs from "dayjs";
export default{ export default{
name :"LookExternalLecturer", name :"LookExternalLecturer",
components:{ components:{
@@ -103,7 +105,7 @@ export default{
}, },
promotionrecordsLoading: false, //晋级记录遮罩层 promotionrecordsLoading: false, //晋级记录遮罩层
teacherrecordsLoading: false,// 授课记录遮罩层 teacherrecordsLoading: false,// 授课记录遮罩层
teacherrecordstableDataTotal: -1,//授课记录列表总条数 teacherrecordstableDataTotal: 0,//授课记录列表总条数
teacherrepromotableDataTotal: -1,//晋级记录总条数 teacherrepromotableDataTotal: -1,//晋级记录总条数
teacherrecords: { teacherrecords: {
recordType:2, recordType:2,
@@ -167,6 +169,13 @@ export default{
key: 'teachingDate', key: 'teachingDate',
ellipsis: true, align: "center", ellipsis: true, align: "center",
width: 120, width: 120,
customRender: (value) => {
return (
<div>
{dayjs(value.record?.teachingDate).format("YYYY-MM-DD HH:mm")}
</div>
);
},
}, },
{ {
title: '内容分类', title: '内容分类',
@@ -264,7 +273,19 @@ export default{
state.teacherrecordsLoading = false state.teacherrecordsLoading = false
}) })
}; };
// getteacherrecordstableData() const pagination = computed(() => ({
total: state.teacherrecordstableDataTotal,
showSizeChanger: true,
showQuickJumper:true,
current: state.teacherrecords.pageNo,
pageSize: state.teacherrecords.pageSize,
onChange: paginationChange,
}));
const paginationChange = (e,pageSize) => {
state.teacherrecords.pageNo = e;
state.teacherrecords.pageSize = pageSize
getteacherrecordstableData();
};
//授课翻页 //授课翻页
const teacherchangePagination = (page) => { const teacherchangePagination = (page) => {
state.searchParam.pageNo = page; state.searchParam.pageNo = page;
@@ -294,6 +315,8 @@ export default{
teacherrecordsColumns, teacherrecordsColumns,
getteacherrecordstableData, getteacherrecordstableData,
teacherchangePagination, teacherchangePagination,
pagination,
paginationChange,
} }
} }
} }