保存修改验证调整

This commit is contained in:
wangxuemei
2024-08-27 17:34:20 +08:00
parent 66aac5dc34
commit ed8b4769de
5 changed files with 272 additions and 178 deletions

View File

@@ -70,7 +70,7 @@
<!-- 弹窗组件 -->
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true"
width="60%" :title="teacherdialogtitle">
<a-form :model="formParam" :rules="rules" layout="vertical">
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef">
<!-- 基本信息 -->
<a-row>
<a-col :span="24">
@@ -268,6 +268,7 @@ export default {
UploadOutlined,//图标--导出
},
setup() {
const formRef = ref();
const router = useRouter();
const state = reactive({
currentPage1: 1,
@@ -467,28 +468,32 @@ export default {
}
//保存
const createTeacherDialog = () => {
console.log(state.formParam);
rule()
if( state.log = true){
state.teacherdialog = true;
}
else{
if (state.vf == false) {
formRef.value
.validate()
.then(() => {
if (state.vf == false) {
updateOutTeacher(state.formParam).then(response => {
message.success("修改成功");
state.teacherdialog = false;
cancel()
getTableDate();
});
}
else {
insertTeacherOutSide(state.formParam)
.then((res) => {
message.success("保存成功");
state.teacherdialog = false;
cancel()
getTableDate();
}).catch((err) => {
console.log(err);
});
}
}
state.teacherdialog = false;
getTableDate();
})
.catch(() => {
console.log('error', error);
});
};
//删除弹窗
const deleteModal = (record) => {
@@ -537,6 +542,7 @@ export default {
//取消按钮 清空输入的数据
const cancelTeacherDialog = () => {
if (state.teacherdialog = true) {
formRef.value.resetFields();
state.teacherdialog = false
cancel()
}
@@ -627,6 +633,7 @@ export default {
...toRefs(state),
rules,
rule,
formRef,
sendPhone,
sendEmail,
// managerChange,

View File

@@ -17,7 +17,7 @@
</div>
</a-form-item>
<a-form-item class="select">
<a-input v-model:value="searchParam.name" style="width: 260px; height: 40px; border-radius: 8px"
<a-input v-model:value="searchParam.name" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入课程名称进行搜索" allowClear showSearch>
</a-input>
</a-form-item>
@@ -269,6 +269,7 @@
<script lang="jsx">
import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
import {
RightOutlined,
UpOutlined,
@@ -281,7 +282,7 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
import ProjectManagerOutTeacher from "@/components/project/ProjectManagerOutTeacher";
import dayjs from "dayjs";
import { updateInTeacher, getTeacherExpertise } from "../../api/Lecturer";
import { getOuterTeacherCourseList, getAddress, updateInTeacherCourse, deleteInTeacherCourse, insertInTeacherCourse,getOuterTeacherCourseDetail } from "../../api/Teaching";
import { getTeacherCourseList, getAddress, updateInTeacherCourse, deleteInTeacherCourse, insertInTeacherCourse,getOuterTeacherCourseDetail } from "../../api/Teaching";
// import {getProjSt} from "../../api/indexProjStu";
// import AddTeacher from "../../components/drawers/project/AddTeacher"
export default {
@@ -296,6 +297,7 @@ export default {
ProjectManagerOutTeacher,
},
setup() {
const store = useStore();
const router = useRouter();
const state = reactive({
vf: false,
@@ -472,11 +474,11 @@ export default {
ellipsis: true,
key: "keywords",
align: "center",
customRender: ({ record,text }) =>
`${getSysTypeMap(record.sysType1, record.sysTypeId)?getSysTypeMap(record.sysType1) : ""}
${getSysTypeMap(record.sysType2, record.sysTypeId)?'-'+getSysTypeMap(record.sysType2) : ""}
${getSysTypeMap(record.sysType3, record.sysTypeId)?'-'+getSysTypeMap(record.sysType3) : ""}
`
//customRender: ({ record,text }) =>
//`${getSysTypeMap(record.sysType1, record.sysTypeId)?getSysTypeMap//(record.sysType1) : ""}
//${getSysTypeMap(record.sysType2, record.sysTypeId)?'-'+getSysTypeMap//(record.sysType2) : ""}
//${getSysTypeMap(record.sysType3, record.sysTypeId)?'-'+getSysTypeMap//(record.sysType3) : ""}
// `
},
{
title: '授课时长(H) ',
@@ -545,6 +547,12 @@ export default {
// },
])
const getSysTypeMap = (code) => {
if(code=="")return
// console.log(store.state.sysTypeMap,'map集合');
return store.state.sysTypeMap.get(code)
}
// getSysTypeMap()
// 搜索
const searchSubmit = () => {
getTableDate();
@@ -568,21 +576,21 @@ export default {
};
getTableDate();
};
// List接口数据
const getTableDate = (obj) => {
// List接口数据
const getTableDate = (obj) => {
state.tableLoading = true
let objA = { ...state.searchParam };
objA.startDate = state.searchParam.startDate !== null ? dayjs(new Date(state.searchParam.startDate).getTime()).format("YYYY-MM-DD") : "",
objA.endDate = state.searchParam.endDate !== null ? dayjs(new Date(state.searchParam.endDate).getTime()).format("YYYY-MM-DD") : "",
getOuterTeacherCourseList(objA)
.then((res) => {
tableData.value = res.data.data.records
state.tableDataTotal = Number(res.data.data.total);
state.tableLoading = false
console.log("获取tableData", tableData);
})
getTeacherCourseList(objA)
.then((res) => {
tableData.value = res.data.data.records
state.tableDataTotal = Number(res.data.data.total);
state.tableLoading = false
console.log("获取tableData", tableData);
})
};
getTableDate();
getTableDate()
// // 翻页
const changePagination = (page) => {
state.searchParam.pageNo = page;
@@ -780,6 +788,7 @@ export default {
// getStu
AddressLista,
TeacherSystem,
// getSysTypeMap
}
},
};

View File

@@ -78,7 +78,7 @@
<template #content>
<p>{{ record.organizationName }}</p>
</template>
<span>{{ record.neworganizationName }}</span>
<span>{{ record.neworganizationName }}</span>
</a-popover>
</a-space>
</template>
@@ -102,15 +102,15 @@
<div class="tableBox ">
<div style="float: right;">
<a-pagination v-if="tableDataTotal > 10" :showSizeChanger="true" :showQuickJumper="false " :hideOnSinglePage="true"
:pageSize="searchParam.pageSize" :current="searchParam.pageNo" :total="tableDataTotal" class="pagination"
@change="changePagination" />
<a-pagination v-if="tableDataTotal > 10" :showSizeChanger="true" :showQuickJumper="false"
:hideOnSinglePage="true" :pageSize="searchParam.pageSize" :current="searchParam.pageNo" :total="tableDataTotal"
class="pagination" @change="changePagination" />
</div>
</div>
<!-- 弹窗组件 -->
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true"
width="60%" :title="teacherdialogtitle">
<a-form :model="formParam" :rules="rules" layout="vertical">
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef">
<a-row>
<a-col :span="24">
<span class="line"></span><span>基本信息</span>
@@ -120,18 +120,18 @@
<a-col :span="24">
<div class="item_inp" style="background-color: #fff;">
<a-tooltip>
<template #title>修改头像</template>
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers" :before-upload="beforeUpload" >
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" />
<div class="i_upload" v-else>
<div class="addimg">
<div class="heng"></div>
<div class="shu"></div>
<template #title>修改头像</template>
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers" :before-upload="beforeUpload">
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" />
<div class="i_upload" v-else>
<div class="addimg">
<div class="heng"></div>
<div class="shu"></div>
</div>
</div>
</div>
</a-upload>
</a-tooltip>
</a-upload>
</a-tooltip>
<div class="i_bottom">
<div class="tip" style="margin-bottom: 10px;">
<span style="color: #999999; margin-left: 8px">支持图片格式为jpg/jpeg/png 图片最大为500KB</span>
@@ -143,11 +143,12 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="讲师名称" name="name">
<!-- <ProjectManager v-model:value="formParam.userNo"
<!-- <ProjectManager v-model:value="formParam.userNo"
v-model:name="formParam.name"
placeholder="请输入工号/讲师姓名进行检索"
@onChange="managerChange" mode="multiple"></ProjectManager> -->
<SearchTeacher v-model:value="formParam.name" v-model:lable="formParam.orgName" v-model:newlable="formParam.neworgName"></SearchTeacher>
<SearchTeacher v-model:value="formParam.name" v-model:lable="formParam.orgName"
v-model:newlable="formParam.neworgName"></SearchTeacher>
<!-- <a-tree-select v-model:value="formParam.name"
show-search allow-clear tree-data-simple-mode class="draitem"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData" placeholder="请输入讲师名称" /> -->
@@ -155,10 +156,10 @@
</a-col>
<a-col :span="12">
<a-form-item label="讲师组织" name="orgName">
<a-popover >
<a-popover>
<template #content>
{{ formParam.orgName }}
{{formParam.neworgName }}
{{ formParam.neworgName }}
</template>
<a-input disabled v-model:value="formParam.neworgName" class="draitem"
@@ -177,19 +178,20 @@
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="讲师级别" name="tlevelId" ><div @click="handlesel">
<a-select class="draitem" v-model:value="formParam.tlevelId" placeholder="请选择讲师级别" allowClear
:disabled="getLevelList.length !== 0 ? false : true" :options="getLevelList" >
</a-select>
</div>
<a-form-item label="讲师级别" name="tlevelId">
<div @click="handlesel">
<a-select class="draitem" v-model:value="formParam.tlevelId" placeholder="请选择讲师级别" allowClear
:disabled="getLevelList.length !== 0 ? false : true" :options="getLevelList">
</a-select>
</div>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="初始授课时长" name="defaultteachingTime">
<a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; " @blur="clearNonNumber"
placeholder="0" allowClear showSearch suffix="分钟">
<a-input v-model:value="formParam.defaultteachingTime" style="width:80%; height: 40px; border-radius: 8px; "
@blur="clearNonNumber" placeholder="0" allowClear showSearch suffix="分钟">
</a-input>
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingTime != null">{{
(formParam.defaultteachingTime / 60).toFixed(2) }}小时</span>
@@ -216,7 +218,7 @@
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="讲师介绍">
<Editor v-model:value="formParam.description "/>
<Editor v-model:value="formParam.description" />
</a-form-item>
</a-col>
</a-row>
@@ -230,7 +232,7 @@
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="擅长课程">
<Editor v-model:value="formParam.courses "/>
<Editor v-model:value="formParam.courses" />
</a-form-item>
</a-col>
</a-row>
@@ -467,7 +469,7 @@
<!-- 删除功能弹窗 -->
<div>
<a-modal v-model:visible="deleteInTeacherdialog" :footer="null" :closable="closableQR" centered="true">
<a-modal v-model:visible="deleteInTeacherdialog" :footer="null" :closable="closableQR" centered="true">
<div class="delete">
<div class="del_header"></div>
<div class="del_main">
@@ -493,15 +495,9 @@
</a-modal>
</div>
<!-- 修改状态功能弹窗 -->
<div>
<a-modal
v-model:visible="editTeacher"
:footer="null"
:closable="closableQR"
wrapClassName="DelModal"
style="margin-top: 400px"
:zIndex="9999"
>
<div>
<a-modal v-model:visible="editTeacher" :footer="null" :closable="closableQR" wrapClassName="DelModal"
style="margin-top: 400px" :zIndex="9999">
<div class="delete">
<div class="del_header"></div>
<div class="del_main">
@@ -531,6 +527,7 @@
</template>
<script lang="jsx">
import { reactive, toRefs, ref, watch } from "vue";
import { useStore } from "vuex";
import {
RightOutlined,
UpOutlined,
@@ -561,12 +558,14 @@ export default {
FolderAddOutlined,//图标--新增
},
setup() {
const formRef = ref();
const store = useStore();
const router = useRouter();
const state = reactive({
Addtitle: '选择教师专长',
log:false,
log: false,
showContent: false,
closableQR:false,
closableQR: false,
updialog: false,
moreid: 1,
byPid: null,
@@ -590,15 +589,15 @@ export default {
tableDataTotal: -1,//table列表总条数
vf: false,
formParam: {
teachenType:'0',
teachenType: '0',
name: null,
certStatus: 0,//认证状态
defaultteachingTime: '0',
photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
// photo: 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png'
},
searchParam: {
currentPage: 1,
pageSize1: 10,
currentPage: 1,
pageSize1: 10,
teacherNameOrUserNo: null,
systemId: null,
tlevelId: null,
@@ -638,7 +637,7 @@ export default {
watch(() => state.formParam.courses, (val) => {
console.log(val, 'courses')
})
watch(()=>state.formParam.orgName,(val)=>{
watch(() => state.formParam.orgName, (val) => {
console.log(val, 'orgName')
// if( val !==null ){
// state.formParam.neworgName=val.split('/')
@@ -962,6 +961,7 @@ export default {
])
// 搜索
const searchSubmit = () => {
store.commit("setShouInclude", ['lecturerlist']);
getTableDate();
};
//重置
@@ -981,6 +981,7 @@ export default {
pageNo: 1,
pageSize: 10,
};
store.commit("setShouInclude", []);
getTableDate();
};
// List接口数据
@@ -990,13 +991,14 @@ export default {
getTeacherList(objA)
.then((res) => {
// tableData.value = res.data.data.records
let objA= res.data.data.records
objA.map((item)=>{
if( item.organizationName !==null ){
item.neworganizationName=item.organizationName.split('/')
item.neworganizationName= item.neworganizationName[item.neworganizationName.length-1]}
})
tableData.value = objA
let objA = res.data.data.records
objA.map((item) => {
if (item.organizationName !== null) {
item.neworganizationName = item.organizationName.split('/')
item.neworganizationName = item.neworganizationName[item.neworganizationName.length - 1]
}
})
tableData.value = objA
state.tableDataTotal = Number(res.data.data.total);
state.tableLoading = false
})
@@ -1014,7 +1016,7 @@ export default {
cancel()
state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师'
state.formParam.photo = state.formParam.photo === null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
// state.formParam.photo = state.formParam.photo === null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
state.formParam.status = '1'
state.vf = true
}
@@ -1028,26 +1030,73 @@ export default {
}
//保存
const createTeacherDialog = () => {
rule()
if( state.log = true){
state.teacherdialog = true;
}
else
{ if (state.vf == false) {
updateInTeacher(state.formParam).then(response => {
message.success("修改成功");
formRef.value
.validate()
.then(() => {
if (state.vf == false) {
updateInTeacher(state.formParam).then(response => {
message.success("修改成功");
state.teacherdialog = false;
cancel()
getTableDate();
});
}
else {
insertTeacher(state.formParam)
.then((res) => {
message.success("保存成功");
state.teacherdialog = false;
cancel()
getTableDate();
}).catch((err) => {
console.log(err);
});
}
})
.catch(() => {
console.log('error', error);
});
}
else {
insertTeacher(state.formParam)
.then((res) => {
message.success("保存成功");
}).catch((err) => {
console.log(err);
});
}
state.teacherdialog = false;
getTableDate();}
// rule()
// if (state.log = true) {
// state.teacherdialog = true;
// }
// else {
// // formRef.value.validate(valid => {
// // if (valid) {
// // if (state.vf == false) {
// // updateInTeacher(state.formParam).then(response => {
// // message.success("修改成功");
// // });
// // }
// // else {
// // insertTeacher(state.formParam)
// // .then((res) => {
// // message.success("保存成功");
// // }).catch((err) => {
// // console.log(err);
// // });
// // }
// // state.teacherdialog = false;
// // getTableDate();
// // }
// // }
// // )
// if (state.vf == false) {
// updateInTeacher(state.formParam).then(response => {
// message.success("修改成功");
// });
// }
// else {
// insertTeacher(state.formParam)
// .then((res) => {
// message.success("保存成功");
// }).catch((err) => {
// console.log(err);
// });
// }
// state.teacherdialog = false;
// getTableDate();
// }
};
//删除弹窗
const deleteModal = (record) => {
@@ -1095,6 +1144,7 @@ export default {
//取消按钮 清空输入的数据
const cancelTeacherDialog = () => {
if (state.teacherdialog = true) {
formRef.value.resetFields();
state.teacherdialog = false
cancel()
}
@@ -1106,9 +1156,9 @@ export default {
//清空数据
const cancel = () => {
state.formParam = {
name:null,
status:null,
teacherType:'0',
name: null,
status: null,
teacherType: '0',
photo: null,
teacherNameOrUserNo: null,
newdepartId: null,
@@ -1129,34 +1179,41 @@ export default {
newdepartId: [{ required: true, message: '组织不能为空' }],
tlevelId: [{ required: true, message: '讲师级别不能为空' }],
tsystemId: [{ required: true, message: '讲师体系不能为空' }],
defaultteachingTime: [{ required: true, message: '授课时长不能为空' }],
defaultteachingTime: [{ required: true, message: '' }],
certStatus: [{ required: true, message: '认证状态不能为空' }],
}
const rule =()=>{
if (state.formParam.name==null){
const rule = () => {
if (state.formParam.name == null) {
state.log = true
message.warning( '讲师不能为空')
message.warning('讲师不能为空')
return
600000000000000000000000000000000
}
if (state.formParam.departId==null){
if (state.formParam.departId == null) {
state.log = true
message.warning( '组织不能为空')
message.warning('组织不能为空')
return
}
if (state.formParam.tlevelId==null){
if (state.formParam.tlevelId == null) {
state.log = true
message.warning( '讲师级别不能为空')
message.warning('讲师级别不能为空')
return
}
if (state.formParam.tsystemId==null){
if (state.formParam.tsystemId == null) {
state.log = true
message.warning( '讲师体系不能为空')
message.warning('讲师体系不能为空')
return
}
if (state.formParam.defaultteachingTime==null){
state.log = true
message.warning( '授课时长不能为空')
}
if (state.formParam.certStatus==null){
if (state.formParam.defaultteachingTime == null) {
state.log = true
message.warning( '认证状态不能为空')
message.warning('授课时长不能为空')
return
}
if (state.formParam.certStatus == null) {
state.log = true
message.warning('认证状态不能为空')
return
}
}
// //表格内查看数据操作
@@ -1177,7 +1234,7 @@ export default {
// }
state.formParam = res.data.data[0]
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.workExperience = state.formParam.workExperience === null ? '' : state.formParam.workExperience
state.formParam.workExp0erience = state.formParam.workExperience === null ? '' : state.formParam.workExperience
state.formParam.courses = state.formParam.courses === null ? '' : state.formParam.courses
state.formParam.photo = state.formParam.photo === null ? 'https://p0.itc.cn/q_70/images01/20211013/f45d91616a364d6ea9c42a8db69734aa.png' : state.formParam.photo
}
@@ -1198,15 +1255,15 @@ export default {
// const customPreview =(e)=>{
// e.stopPropagation()
// }
const handlesel=()=>{
console.log( '请下选择讲师体系')
const handlesel = () => {
console.log('请下选择讲师体系')
if (state.formParam.tsystemId == undefimed) {
message.warning( '请下选择讲师体系')
message.warning('请下选择讲师体系')
}
}
//导出功能
const handleExport = () => {
window.open (
window.open(
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${state.searchParam.currentPage
}&pageSize=${state.searchParam.pageSize}
&teacherNameOrUserNo=${state.searchParam.teacherNameOrUserNo ? state.searchParam.teacherNameOrUserNo : ""}
@@ -1224,6 +1281,7 @@ export default {
...toRefs(state),
rules,
rule,
formRef,
handlesel,
// customPreview,
clearNonNumber,
@@ -1272,6 +1330,10 @@ export default {
};
</script>
<style lang="scss" scoped>
::v-deep .ant-upload.ant-upload-select-picture-card {
border-radius: 50% !important;
}
.add_content {
width: 40px;
height: 40px;
@@ -1590,7 +1652,8 @@ export default {
.item_inp .i_upload[data-v-6b882d01] {
border-radius: 50% !important;
}
::v-deep .ant-modal-close{
::v-deep .ant-modal-close {
display: none;
}
</style>

View File

@@ -19,10 +19,24 @@
placeholder="请输入课程名称进行搜索" allowClear showSearch>
</a-input>
</a-form-item>
<a-form-item class="select ">
<!-- <a-form-item class="select ">
<a-range-picker style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate" separator="至"
:placeholder="[' 开始时间', ' 结束时间']" @change="searchTimeChange" />
</a-form-item>
</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: 420px"
@change="searchTimeChange"
format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
separator="至"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
</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);" > -->
@@ -87,16 +101,11 @@
<a-button @click="addTeacher()" type="primary" class="langbtn">
<FolderAddOutlined /> 添加授课记录
</a-button>
<!-- <div style="margin-left: 20px ;">
<a-button @click="addTeacher()" class="langbtn">
<UploadOutlined /> 一键生成讲师费
</a-button>
</div> -->
<a-upload multiple :headers="headers" :show-upload-list="false" :before-upload="beforeUpload2">
<a-button class="resetbtn">
<!-- <a-upload multiple :headers="headers" :show-upload-list="false" :before-upload="beforeUpload2"> -->
<a-button class="resetbtn" @click="handleImport()" >
<DownloadOutlined /> 导入
</a-button>
</a-upload>
<!-- </a-upload> -->
<a-button @click="handleExport()" class="resetbtn">
<UploadOutlined /> 导出
</a-button>
@@ -129,7 +138,7 @@
<!-- 弹窗组件 -->
<a-drawer v-model:visible="teacherdialog" placement="right" @closa="cancelTeacherDialog" :maskClosable="true"
dropdown-style="drawaer" width="60%" :title="teacherdialogtitle">
<a-form :model="formParam" :rules="rules" layout="vertical">
<a-form :model="formParam" :rules="rules" layout="vertical" ref="formRef">
<!-- 讲师姓名 teacher 组织 departId-->
<a-row :gutter="16">
<a-col :span="12">
@@ -380,6 +389,7 @@ export default {
FolderAddOutlined,//图标--新增
},
setup() {
const formRef = ref();
const router = useRouter();
const state = reactive({
moreid: 1,
@@ -641,7 +651,7 @@ export default {
}
},
{
title: '授课/课程日期 ',
title: '授课时间',
dataIndex: 'beginTime',
key: 'beginTime',
elipsis: true, align: "center",
@@ -739,7 +749,7 @@ export default {
state.searchParam.trainorgId = null
state.searchParam.systemId = null
state.searchParam.id = null
state.searchParam.scoreranges = null
state.searchParam.scoreranges = []
state.searchParam.studysranges = []
}
}
@@ -747,17 +757,14 @@ export default {
const searchSubmit = () => {
getTableDate();
};
//修改时间
const searchTimeChange = (e, date) => {
let startDate = date[0] + " 00:00:00";
let endDate = date[1] + " 23:59:59";
state.startDate = new Date(startDate).getTime();
state.endDate = new Date(endDate).getTime();
// state.searchParam.startDate = new Date(startDate).getTime() ;
// state.searchParam.endDate = new Date(endDate).getTime() ;
state.searchParam.startDate = state.startDate ? state.startDate : null,
state.searchParam.endDate = state.endDate ? state.endDate : null
};
//修改时间
function searchTimeChange(time, timeStr) {
state.searchParam.startDate = timeStr[0];
state.searchParam.endDate = timeStr[1];
console.log( state.searchParam.startDate)
console.log(state.searchParam.endDate)
}
const editTimeChange = (e, date) => {
console.log(date);
state.beginTime = date;
@@ -823,28 +830,32 @@ export default {
}
//保存
const createTeacherDialog = () => {
rule()
if (state.log = true) {
state.teacherdialog = true;
formRef.value
.validate()
.then(() => {
if (state.vf == false) {
updateInTeacherCourse(state.formParam).then(response => {
message.success("修改成功");
state.teacherdialog = false;
cancel()
getTableDate();
});
}
else {
if (state.vf == false) {
updateInTeacherCourse(state.formParam).then(response => {
message.success("修改成功");
insertInTeacherCourse(state.formParam)
.then((res) => {
message.success("保存成功");
state.teacherdialog = false;
cancel()
getTableDate();
}).catch((err) => {
console.log(err);
});
}
else {
insertInTeacherCourse(state.formParam)
.then((res) => {
message.success("保存成功");
}).catch((err) => {
console.log(err);
});
cancel()
}
getTableDate();
state.teacherdialog = false
}
})
.catch(() => {
console.log('error', error);
})
}
//删除弹窗
const deleteModal = (record) => {
@@ -872,6 +883,7 @@ export default {
//取消按钮 清空输入的数据
const cancelTeacherDialog = () => {
if (state.teacherdialog = true) {
formRef.value.resetFields();
state.teacherdialog = false
cancel()
}
@@ -1135,6 +1147,7 @@ export default {
beforeUpload2,
rules,
rule,
formRef,
column,
tableDatas,
gettableDatas,
@@ -1192,7 +1205,9 @@ export default {
color: rgba(0, 0, 0, 0.4);
}
}
.addTimeBox .ant-picker{
padding-left: 85px;
}
//导出按钮icon
.daochu {
width: 16px;

View File

@@ -17,9 +17,9 @@
</div>
</a-form-item>
<a-form-item class="select">
<a-select style="width: 276px" v-model:value="searchParam.trainorgId" placeholder="培训发生组织" allowClear
:options="trainOrglist">
</a-select>
<a-input v-model:value="searchParam.trainorgId" style="width: 276px; height: 40px; border-radius: 8px"
placeholder="请输入培训发生组织进行搜索" allowClear showSearch>
</a-input>
</a-form-item>
<a-form-item class="select ">
<a-range-picker style="width: 260px; height: 40px; border-radius: 8px" v-model:value="searchdate" separator="至"