From 3e86caab1593d5fc73a3b5ddb6b6916879bb1858 Mon Sep 17 00:00:00 2001 From: Pengxiansen <2422914688@qq.com> Date: Thu, 20 Feb 2025 20:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configGrowth.js | 4 +- src/api/growthpath.js | 6 + .../growthpath/GrowthActiveAttendance.vue | 112 +++++------------- src/views/growthpath/PathManage.vue | 5 +- vue.config.js | 16 +-- 5 files changed, 51 insertions(+), 92 deletions(-) diff --git a/src/api/configGrowth.js b/src/api/configGrowth.js index 2f010b28..ab3fedbe 100644 --- a/src/api/configGrowth.js +++ b/src/api/configGrowth.js @@ -18,8 +18,8 @@ import { boeRequest } from "@/api/request"; // "application/x-www-form-urlencoded"; axios.defaults.withCredentials = true; const http = axios.create({ - baseURL: '/growth', - // baseURL: process.env.VUE_APP_BASE_API_GROWTH, + // baseURL: '/growth', + baseURL: process.env.VUE_APP_BASE_API_GROWTH, timeout: 1000 * 15, // headers: { "Content-Type": "multipart/form-data" }, headers: { "Content-Type": "application/json" }, diff --git a/src/api/growthpath.js b/src/api/growthpath.js index f3bc03eb..40eaecbf 100644 --- a/src/api/growthpath.js +++ b/src/api/growthpath.js @@ -105,3 +105,9 @@ export const markComplete = (obj) => http.get('/professional/allocation/markComp export const attendanceList = (obj) => http.post('/professional/task/attendanceList', obj) + +export const taskSign = (obj) => http.post('/professional/task/taskSign', obj) + +export const taskLeave = (obj) => http.post('/professional/task/taskLeave', obj) + +export const taskBatchSign = (id) => http.get('/professional/task/batchSign/' + id) diff --git a/src/components/growthpath/GrowthActiveAttendance.vue b/src/components/growthpath/GrowthActiveAttendance.vue index 774a9c33..d63ffb96 100644 --- a/src/components/growthpath/GrowthActiveAttendance.vue +++ b/src/components/growthpath/GrowthActiveAttendance.vue @@ -46,7 +46,7 @@ maxlength="20" /> - +
签到状态:
@@ -112,6 +112,7 @@ :columns="tableDataFunc()" :data-source="tableData" :loading="tableDataTotalLoading" + rowKey="username" :scroll="{ x: 1300 }" :pagination="false" :row-selection="{ @@ -289,6 +290,9 @@ import { attendanceList, batchSendMessage, exportStudentTaskPage, + taskSign, + taskLeave, + taskBatchSign, } from "@/api/growthpath"; import { checkPer } from "@/utils/utils"; import dayjs from "dayjs"; @@ -347,7 +351,6 @@ export default { tableDataTotalLoading: true, // 表格loading加载配置 beginTime: null, //签到开始时间 endTime: null, //签到结束时间 - selectedStudents: [], signStatus: undefined, codeType: null, codeIndex: null, @@ -370,11 +373,6 @@ export default { const onSelectChange = (selectedRowKeys, e) => { console.log("selectedRowKeys changed: ", selectedRowKeys); state.selectedRowKeys = selectedRowKeys; - let array = []; - for (let i = 0; i < e.length; i++) { - array.push(e[i].studentId); - } - state.selectedStudents = array; }; // 计算签到时间 @@ -439,18 +437,15 @@ export default { //批量签到 const batchSign = () => { let obj = { - courseId: Number(props.datasource.courseId), - routerId: Number(props.datasource.routerId), - ids: state.selectedStudents, - taskId: Number(props.datasource.id), - taskType: Number(props.datasource.type), - type: 1, + workNoList: state.selectedRowKeys, + taskType: props.datasource.taskType, + growthId: props.datasource.growthId, + courseId: props.datasource.id, }; console.log(obj); state.tableDataTotalLoading = true; - api - .AttendanceSign(obj) + taskLeave(obj) .then((res) => { console.log("签到结果", res, obj); if (res.data.code === 200) { @@ -458,7 +453,6 @@ export default { message.success("批量签到成功"); state.qdModal = false; state.selectedRowKeys = []; - state.selectedStudents = []; getTableData(); } }) @@ -611,11 +605,11 @@ export default { return (
- {text.record.signStatus + {text.record.signStatus == "1" ? "签到" - : text.record.leaveStatus + : text.record.signStatus == "0" ? "请假" - : "-"} + : "未签到"}
); @@ -632,15 +626,10 @@ export default { return (
- {text.record.signStatus == null && - new Date().getTime() > new Date(state.endTime).getTime() - ? "异常" - : text.record.signStatus + {text.record.signStatus === "1" ? "正常" - : text.record.leaveStatus - ? "异常" - : text.record.signStatus == null - ? "-" + : text.record.signStatus === "0" + ? "请假" : "异常"}
@@ -662,40 +651,15 @@ export default { >
{ - { - /* debugger */ - } console.log("点击签到", value); - // 获取当前时间 - { - /* showsingleqdModal(); */ - } - { - /* AttendanceSign */ - } - - let obj1 = { - courseId: Number(props.datasource.courseId), - routerId: Number(props.datasource.projectId), - ids: [value.record.studentId], - taskId: Number(props.datasource.id), - taskType: Number(props.datasource.type), - type: 1, + let params = { + taskType: props.datasource.taskType, + growthId: props.datasource.growthId, + workNoList: [value.record.username], + courseId: props.datasource.id, }; - - let obj2 = { - courseId: Number(props.datasource.courseId), - routerId: Number(props.datasource.routerId), - ids: [value.record.studentId], - taskId: Number(props.datasource.id), - taskType: Number(props.datasource.type), - type: 2, - }; - // 1是项目 2路径图 3开课 - console.log(obj1, obj2); state.tableDataTotalLoading = true; - api - .AttendanceSign(props.types === "1" ? obj1 : obj2) + taskSign(params) .then((res) => { console.log("res----签到是否成功", res); message.destroy(); @@ -709,7 +673,7 @@ export default { }} style="display:flex;justify-content:center;align-items:center;margin-right:12px;cursor:pointer;" > - {value.record.signStatus ? ( + {value.record.signStatus === "1" ? (
@@ -728,28 +692,14 @@ export default { { /* AttendanceLeave */ } - let obj = { - courseId: Number(props.datasource.courseId), - routerId: Number(props.datasource.routerId), - ids: [value.record.studentId], - taskId: - Number(props.datasource.routerTaskId) || - Number(props.datasource.id), - taskType: Number(props.datasource.type), - type: 1, + let params = { + taskType: props.datasource.taskType, + growthId: props.datasource.growthId, + workNoList: [value.record.username], + courseId: props.datasource.id, }; - let obj2 = { - courseId: Number(props.datasource.courseId), - routerId: Number(props.datasource.projectId), - ids: [value.record.studentId], - taskId: Number(props.datasource.projectTaskId), - taskType: Number(props.datasource.type), - type: 2, - }; - console.log(obj, obj2); state.tableDataTotalLoading = true; - api - .AttendanceLeave(props.types == 1 ? obj : obj2) + taskLeave(params) .then((res) => { console.log("res----请假是否成功", res); message.destroy(); @@ -763,7 +713,7 @@ export default { }} style="display:flex;justify-content:center;align-items:center;cursor:pointer;" > - {value.record.leaveStatus ? ( + {value.record.signStatus === "0" ? (
@@ -787,7 +737,7 @@ export default { state.selectedRowKeys = []; }; const showqdModal = () => { - if (state.selectedStudents.length == 0) { + if (state.selectedRowKeys.length == 0) { message.destroy(); message.error("请选择学员"); return; diff --git a/src/views/growthpath/PathManage.vue b/src/views/growthpath/PathManage.vue index 69521aa7..82f7caaa 100644 --- a/src/views/growthpath/PathManage.vue +++ b/src/views/growthpath/PathManage.vue @@ -449,7 +449,10 @@