@@ -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 @@