feat:修改签到及下载二维码

This commit is contained in:
lixg
2023-01-11 20:26:24 +08:00
parent b5e5290aa1
commit e6b4f00bd3
4 changed files with 151 additions and 148 deletions

View File

@@ -590,77 +590,76 @@ export default {
// scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => {
// console.log("text.record.signStatus", text.record.signStatus);
return (
<div class="opa">
<a-radio-group name="radioGroup">
<a-radio
value="1"
checked={text.record.signStatus}
onChange={(e) => {
console.log("点击签到", e);
let obj = {
courseId: Number(props.datasource.courseId),
// projectId: 0,
routerId: Number(props.datasource.routerId),
ids: [text.record.studentId],
studentName: text.record.studentName,
taskId: Number(props.datasource.routerTaskId),
taskType: Number(props.datasource.type),
type: 2,
};
api
.attendanceSign(obj)
.then((res) => {
console.log("签到结果", res, obj, e);
if (res.data.code === 200) {
text.record.signStatus = true;
state.tableDataTotal = -1;
getStudent();
}
})
.catch((err) => {
console.log("签到失败", err, obj);
text.record.signStatus = false;
});
}}
>
签到
</a-radio>
<a-radio
value="2"
checked={text.record.leaveStatus}
onChange={(e) => {
console.log("点击请假", e, props.datasource);
let obj = {
courseId: Number(props.datasource.courseId),
// projectId: 0,
routerId: Number(props.datasource.routerId),
ids: [text.record.studentId],
studentName: text.record.studentName,
taskId: Number(props.datasource.routerTaskId),
taskType: Number(props.datasource.type),
type: 2,
// userName: "",
};
api
.attendanceLeave(obj)
.then((res) => {
console.log("请假结果", res, obj, e);
if (res.data.code === 200) {
text.record.leaveStatus = true;
state.tableDataTotal = -1;
getStudent();
}
})
.catch((err) => {
console.log("请假结果", err, obj);
text.record.leaveStatus = false;
});
}}
>
请假
</a-radio>
</a-radio-group>
<a-radio
value="1"
checked={text.record.signStatus}
onChange={(e) => {
console.log("点击签到", e);
let obj = {
courseId: Number(props.datasource.courseId),
// projectId: 0,
routerId: Number(props.datasource.routerId),
ids: [text.record.studentId],
studentName: text.record.studentName,
taskId: Number(props.datasource.routerTaskId),
taskType: Number(props.datasource.type),
type: 2,
};
api
.attendanceSign(obj)
.then((res) => {
console.log("签到结果", res, obj, e);
if (res.data.code === 200) {
text.record.signStatus = true;
state.tableDataTotal = -1;
getStudent();
}
})
.catch((err) => {
console.log("签到失败", err, obj);
text.record.signStatus = false;
});
}}
>
签到
</a-radio>
<a-radio
value="2"
checked={text.record.leaveStatus}
onChange={(e) => {
console.log("点击请假", e, props.datasource);
let obj = {
courseId: Number(props.datasource.courseId),
// projectId: 0,
routerId: Number(props.datasource.routerId),
ids: [text.record.studentId],
studentName: text.record.studentName,
taskId: Number(props.datasource.routerTaskId),
taskType: Number(props.datasource.type),
type: 2,
// userName: "",
};
api
.attendanceLeave(obj)
.then((res) => {
console.log("请假结果", res, obj, e);
if (res.data.code === 200) {
text.record.leaveStatus = true;
state.tableDataTotal = -1;
getStudent();
}
})
.catch((err) => {
console.log("请假结果", err, obj);
text.record.leaveStatus = false;
});
}}
>
请假
</a-radio>
{/**
<a-checkbox
@@ -852,8 +851,8 @@ export default {
}&type=${2}`,
};
console.log("codeInfo", state.codeInfo);
state.codeIndex = 1;
state.codeType = 2;
state.codeIndex = 0;
state.codeType = 1;
};
{