修改522

This commit is contained in:
zhangsir
2024-01-23 17:59:37 +08:00
parent 411f33f831
commit c04c9e91d6
5 changed files with 129 additions and 24 deletions

View File

@@ -133,7 +133,7 @@ export const getStuList = (obj) => http.post('/admin/orgStruct/getStudentRef', o
//获取用户登录 //获取用户登录
export const getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true }) export const getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true })
//公共信息--------------------------------------------------- //公共信息---------------------------------------------------
export const courseData =(obj)=> http.post("/admin/offcourse/allPlanList",obj);
//添加项目学员 //添加项目学员
export const addStudentProject = (obj) => http.post('/admin/project/addStudent', obj) export const addStudentProject = (obj) => http.post('/admin/project/addStudent', obj)
//添加课程学员 //添加课程学员

View File

@@ -125,7 +125,7 @@
<span style="margin-right: 3px">面授时间</span> <span style="margin-right: 3px">面授时间</span>
</div> </div>
<div class="select fitems"> <div class="select fitems">
<a-range-picker <!-- <a-range-picker
style="width: 88%; height: 40px; border-radius: 8px" style="width: 88%; height: 40px; border-radius: 8px"
:show-time="{ format: 'HH:mm' }" :show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
@@ -135,6 +135,28 @@
separator="至" separator="至"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
:disabled="editBeginClass" :disabled="editBeginClass"
/> -->
<a-date-picker
style="width: 41%; height: 40px; border-radius: 8px"
:show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm"
valueFormat="YYYY-MM-DD HH:mm"
v-model:value="dateTime[0]"
@change="timeChange"
:placeholder="' 开始时间'"
:disabled="editBeginClass"
/>
<span style="margin: 0 10px;"></span>
<!-- 第二个日期选择器用于结束时间 -->
<a-date-picker
style="width: 41%; height: 40px; border-radius: 8px"
:show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm"
valueFormat="YYYY-MM-DD HH:mm"
v-model:value="dateTime[1]"
@change="timeChangeEnd"
:placeholder="' 结束时间'"
:disabled="editBeginClass"
/> />
</div> </div>
</div> </div>
@@ -530,12 +552,13 @@ const formDataRule = {
const { validate } = Form.useForm(formData, formDataRule); const { validate } = Form.useForm(formData, formDataRule);
const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间'); const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间');
function timeChange(time, timeStr) { function timeChange(time, timeStr) {
formData.value.beginTime = timeStr[0]; formData.value.beginTime = timeStr;
formData.value.endTime = timeStr[1];
// formData.value.duration = durationText.value // formData.value.duration = durationText.value
// formData.value.duration || (formData.value.duration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute')) // formData.value.duration || (formData.value.duration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute'))
} }
function timeChangeEnd(time,timeStr){
formData.value.endTime = timeStr;
}
function search() { function search() {
tableRef.value.fetch(); tableRef.value.fetch();
} }
@@ -569,6 +592,7 @@ const createNewCourse = () => {
type: props.type, type: props.type,
offcourseId: params.value.offcourseId, offcourseId: params.value.offcourseId,
draftTaskId: params.value.draftTaskId, draftTaskId: params.value.draftTaskId,
name:courseName.value
}); });
dateTime.value = []; dateTime.value = [];
validated.value = 0; validated.value = 0;
@@ -602,6 +626,10 @@ async function coursePlanConfirm() {
message.info('讲师费已进入审批阶段,无法编辑') message.info('讲师费已进入审批阶段,无法编辑')
return return
} }
if(dateTime.value.length<2){
message.info('请选择开始时间和结束时间')
return
}
await validate().catch(({ errorFields }) => { await validate().catch(({ errorFields }) => {
message.warning(errorFields[0].errors.join()); message.warning(errorFields[0].errors.join());
throw Error("数据校验不通过"); throw Error("数据校验不通过");

View File

@@ -86,6 +86,7 @@
class="btn btn1" class="btn btn1"
style="margin-right: 20px" style="margin-right: 20px"
@click="qrcodeVisibleSign()" @click="qrcodeVisibleSign()"
:class="{ 'notClick': courseSelectRows.length > 0 }"
> >
<div class="wz">签到二维码</div> <div class="wz">签到二维码</div>
</div> </div>
@@ -94,6 +95,7 @@
style="margin-right: 20px" style="margin-right: 20px"
v-if="data[coursePlanIndex]?.assessmentId" v-if="data[coursePlanIndex]?.assessmentId"
@click="qrcodeAssement()" @click="qrcodeAssement()"
:class="{ 'notClick': courseSelectRows.length > 0 }"
> >
<div class="wz">评估二维码</div> <div class="wz">评估二维码</div>
</div> </div>
@@ -101,6 +103,7 @@
class="btn btn1" class="btn btn1"
style="margin-right: 20px" style="margin-right: 20px"
@click="qrcodeVisible()" @click="qrcodeVisible()"
:class="{ 'notClick': courseSelectRows.length > 0 }"
> >
<div class="wz">开课二维码</div> <div class="wz">开课二维码</div>
</div> </div>
@@ -112,14 +115,14 @@
:infoType="type" :infoType="type"
@finash="submitCall" @finash="submitCall"
> >
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff"> <a-button :class="{ 'notClick': courseSelectRows.length > 0 }" :disabled="courseSelectRows.length>0" class="cus-btn" style="background: #4ea6ff; color: #fff">
<template #icon><img style="margin-right: 10px" src="../../../assets/images/courseManage/add0.png"/> <template #icon><img style="margin-right: 10px" src="../../../assets/images/courseManage/add0.png"/>
</template> </template>
添加学员 添加学员
</a-button> </a-button>
</CommonStudent> </CommonStudent>
<CommonImport @change="change" title="导入学员" :template-url="stuTemplateUrl" :data="{ targetId: offcoursePlanId, type:3 }" :url="`/admin/student/importStudent`" name="uploadFile"> <CommonImport @change="change" title="导入学员" :template-url="stuTemplateUrl" :data="{ targetId: offcoursePlanId, type:3 }" :url="`/admin/student/importStudent`" name="uploadFile">
<div class="btn btn1" style="margin-right: 20px;margin-left: 20px"> <div class="btn btn1" style="margin-right: 20px;margin-left: 20px" :class="{ 'notClick': courseSelectRows.length > 0 }">
<div class="img1"></div> <div class="img1"></div>
<div class="wz">导入学员</div> <div class="wz">导入学员</div>
</div> </div>
@@ -127,18 +130,18 @@
<div class="btn btn1" @click="batchSign" style="margin-right: 20px"> <div class="btn btn1" @click="batchSign" style="margin-right: 20px">
<div class="wz">批量签到</div> <div class="wz">批量签到</div>
</div> </div>
<div class="btn btn1" @click="exportTaskStu" style="margin-right: 20px"> <div class="btn btn1" @click="exportTaskStu" style="margin-right: 20px" :class="{ 'notClick': courseSelectRows.length > 0 }">
<div class="img2"></div> <div class="img2"></div>
<div class="wz">导出签到数据</div> <div class="wz">导出签到数据</div>
</div> </div>
<div class="btn btn1" @click="exportAssessment" v-if="data[coursePlanIndex]?.assessmentId"> <div class="btn btn1" @click="exportAssessment" v-if="data[coursePlanIndex]?.assessmentId" :class="{ 'notClick': courseSelectRows.length > 0 }">
<div class="img2"></div> <div class="img2"></div>
<div class="wz">导出评估数据</div> <div class="wz">导出评估数据</div>
</div> </div>
</div> </div>
<div class="tableBox" style="margin-top: 30px"> <div class="tableBox" style="margin-top: 30px">
<BaseTable ref="tableRef" :url="STUDENT_LIST" v-model:params="params" :columns="columns" :init="false" <BaseTable ref="tableRef" :url="STUDENT_LIST" v-model:params="params" :columns="columns" :init="false"
v-model:selectedRows="courseSelectRows" v-model:selectedRows="courseSelectRows" :showSizeChanger="true"
type="checkbox"/> type="checkbox"/>
</div> </div>
</div> </div>
@@ -424,18 +427,21 @@ const qrcodeVisible = () => {
const qrcodeVisibleSign = () => { const qrcodeVisibleSign = () => {
qrCode({ qrCode({
title: "【签到】二维码", title: "【签到】二维码",
name: openCourseName.value?openCourseName.value:data.value[0]?.name, name: openCourseName.value?openCourseName.value:data.value[0]?.name + '课程签到',
// url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${props.datasource.id}&taskType=${props.datasource.type}&type=${props.type}`, // url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${props.datasource.id}&taskType=${props.datasource.type}&type=${props.type}`,
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${data.value[coursePlanIndex.value]?.id}&taskType=${2}&type=${3}`, url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${data.value[coursePlanIndex.value]?.id}&taskType=${2}&type=${3}`,
}); });
}; };
const qrcodeAssement = () =>{ const qrcodeAssement = () =>{
console.log(data,'data')
qrCode({ qrCode({
title: "【评估】二维码", title: "【评估】二维码",
name: data.value[coursePlanIndex.value]?.assessmentName, // name: data.value[coursePlanIndex.value]?.assessmentName + '课程评估',
name: openCourseName.value?openCourseName.value:data.value[0]?.name + '课程评估',
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${data.value[coursePlanIndex.value]?.id}&type=3&infoId=${data.value[coursePlanIndex.value]?.id}&courseId=${data.value[coursePlanIndex.value].assessmentId}&chapterOrStageId=0`, url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${data.value[coursePlanIndex.value]?.id}&type=3&infoId=${data.value[coursePlanIndex.value]?.id}&courseId=${data.value[coursePlanIndex.value].assessmentId}&chapterOrStageId=0`,
}); });
const a = {url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${data.value[coursePlanIndex.value]?.id}&type=3&infoId=${data.value[coursePlanIndex.value]?.id}&courseId=${data.value[coursePlanIndex.value].assessmentId}&chapterOrStageId=0`}
console.log(a,'aaaa')
} }
const change = (e) => { const change = (e) => {
@@ -449,6 +455,17 @@ const change = (e) => {
</script> </script>
<style lang="scss"> <style lang="scss">
.notClick{
cursor: pointer;
pointer-events: none;
width: 100px;
height: 40px;
border: 1px solid #3b3c3c !important;
border-radius: 8px;
color: #fff !important;
background-color: #3b3c3c !important;
}
.me { .me {
.ant-modal-body { .ant-modal-body {
padding: 0px; padding: 0px;

View File

@@ -45,9 +45,13 @@ const id = computed(() => {
}); });
const emit = defineEmits({}); const emit = defineEmits({});
const secondItem = store.state.project_level.find((e, index) => index === 1);
const options = computed(() => const options = computed(() =>
store.state.project_level.map((e) => ({ store.state.project_level
.sort((a, b) => parseInt(b.value) - parseInt(a.value))
.filter((e) => e != secondItem)
.concat(secondItem)
.map((e) => ({
value: parseInt(e.value), value: parseInt(e.value),
label: e.name, label: e.name,
})) }))

View File

@@ -641,9 +641,26 @@
class="operation" class="operation"
style="cursor: pointer" style="cursor: pointer"
@click="showCodeModel(item)" @click="showCodeModel(item)"
v-if="item.type !== 2"
> >
二维码 二维码
</div> </div>
<div
class="operation"
style="cursor: pointer"
@click="qrcodeVisible(item)"
v-if="item.type == 2"
>
签到二维码
</div>
<div
class="operation"
style="cursor: pointer"
@click="qrcodeAssement(item)"
v-if="item.type == 2"
>
评估二维码
</div>
<div <div
class="operation" class="operation"
style="cursor: pointer; margin-right: 10px" style="cursor: pointer; margin-right: 10px"
@@ -1653,13 +1670,13 @@
:createId="createId" :createId="createId"
/> />
<!-- 面授学员抽屉 --> <!-- 面授学员抽屉 -->
<RouterFaceStu <RouterFaceStu
:permissions="permissions" :permissions="permissions"
:createId="createId" :createId="createId"
v-model:FSvisible="FSvisible" v-model:FSvisible="FSvisible"
:datasource="facestudent" :datasource="facestudent"
:type="1" :type="1"
/> />
<!-- 活动直播考勤抽屉 --> <!-- 活动直播考勤抽屉 -->
<active-attendance <active-attendance
:permissions="permissions" :permissions="permissions"
@@ -2321,10 +2338,13 @@ import TrainClass from "@/components/project/TrainClass";
import ProjectManager from "@/components/project/ProjectManagerNew"; import ProjectManager from "@/components/project/ProjectManagerNew";
import TableStudent from "@/components/student/TableStudent"; import TableStudent from "@/components/student/TableStudent";
import TableCertificateStudent from "@/components/student/TableCertificateStudent"; import TableCertificateStudent from "@/components/student/TableCertificateStudent";
import { getStuPage } from "@/api/index1"; import { getStuPage,courseData } from "@/api/index1";
import ChangeGroupModal from "@/components/student/ChangeGroupModal.vue"; import ChangeGroupModal from "@/components/student/ChangeGroupModal.vue";
import { checkPer,fixDoublePer } from "@/utils/utils"; import { checkPer,fixDoublePer } from "@/utils/utils";
import ImpoterGroupLeader from "@/components/drawers/project/ImpoterGroupLeader.vue"; import ImpoterGroupLeader from "@/components/drawers/project/ImpoterGroupLeader.vue";
import qrCode from "@/utils/qrCode";
import {COURSE_PLAN_LIST} from "@/api/apis";
import {useRequest} from "@/api/request";
export default { export default {
name: "taskPage", name: "taskPage",
components: { components: {
@@ -2361,6 +2381,38 @@ export default {
ImpoterGroupLeader, ImpoterGroupLeader,
}, },
setup() { setup() {
const qrcodeVisible = async (item)=>{
console.log(item,'item')
const planParams = {
type: 1,
offcourseId: item.courseId,
taskId: item.id
};
courseData(planParams).then((res)=>{
qrCode({
title: "【签到】二维码",
name: res.data.data[0].name + '课程签到',
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${res.data.data[0].id}&taskType=${2}&type=${3}`,
});
})
}
const qrcodeAssement = async (item)=>{
const planParams = {
type: 1,
offcourseId: item.courseId,
taskId: item.id
};
courseData(planParams).then((res)=>{
const assessment = res.data.data[0];
console.log(assessment,'assessment')
qrCode({
title: "【评估】二维码",
name: res.data.data[0].name + '课程评估',
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${res.data.data[0].id}&type=3&infoId=${res.data.data[0].id}&courseId=${res.data.data[0].assessmentId}&chapterOrStageId=0`,
});
})
}
const store = useStore(); const store = useStore();
const route = useRoute(); const route = useRoute();
const headers = { token: getCookieForName("token") }; const headers = { token: getCookieForName("token") };
@@ -5037,7 +5089,11 @@ export default {
studytimeRank, studytimeRank,
xsSelectChange, xsSelectChange,
changePagination, changePagination,
handleChangeGroupLeader handleChangeGroupLeader,
qrcodeVisible,
qrcodeAssement,
}; };
}, },
}; };