This commit is contained in:
Pengxiansen
2025-02-20 20:28:30 +08:00
parent 5dc774f312
commit 3e86caab15
5 changed files with 51 additions and 92 deletions

View File

@@ -18,8 +18,8 @@ import { boeRequest } from "@/api/request";
// "application/x-www-form-urlencoded"; // "application/x-www-form-urlencoded";
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
const http = axios.create({ const http = axios.create({
baseURL: '/growth', // baseURL: '/growth',
// baseURL: process.env.VUE_APP_BASE_API_GROWTH, baseURL: process.env.VUE_APP_BASE_API_GROWTH,
timeout: 1000 * 15, timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" }, // headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },

View File

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

View File

@@ -112,6 +112,7 @@
:columns="tableDataFunc()" :columns="tableDataFunc()"
:data-source="tableData" :data-source="tableData"
:loading="tableDataTotalLoading" :loading="tableDataTotalLoading"
rowKey="username"
:scroll="{ x: 1300 }" :scroll="{ x: 1300 }"
:pagination="false" :pagination="false"
:row-selection="{ :row-selection="{
@@ -289,6 +290,9 @@ import {
attendanceList, attendanceList,
batchSendMessage, batchSendMessage,
exportStudentTaskPage, exportStudentTaskPage,
taskSign,
taskLeave,
taskBatchSign,
} from "@/api/growthpath"; } from "@/api/growthpath";
import { checkPer } from "@/utils/utils"; import { checkPer } from "@/utils/utils";
import dayjs from "dayjs"; import dayjs from "dayjs";
@@ -347,7 +351,6 @@ export default {
tableDataTotalLoading: true, // 表格loading加载配置 tableDataTotalLoading: true, // 表格loading加载配置
beginTime: null, //签到开始时间 beginTime: null, //签到开始时间
endTime: null, //签到结束时间 endTime: null, //签到结束时间
selectedStudents: [],
signStatus: undefined, signStatus: undefined,
codeType: null, codeType: null,
codeIndex: null, codeIndex: null,
@@ -370,11 +373,6 @@ export default {
const onSelectChange = (selectedRowKeys, e) => { const onSelectChange = (selectedRowKeys, e) => {
console.log("selectedRowKeys changed: ", selectedRowKeys); console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = 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 = () => { const batchSign = () => {
let obj = { let obj = {
courseId: Number(props.datasource.courseId), workNoList: state.selectedRowKeys,
routerId: Number(props.datasource.routerId), taskType: props.datasource.taskType,
ids: state.selectedStudents, growthId: props.datasource.growthId,
taskId: Number(props.datasource.id), courseId: props.datasource.id,
taskType: Number(props.datasource.type),
type: 1,
}; };
console.log(obj); console.log(obj);
state.tableDataTotalLoading = true; state.tableDataTotalLoading = true;
api taskLeave(obj)
.AttendanceSign(obj)
.then((res) => { .then((res) => {
console.log("签到结果", res, obj); console.log("签到结果", res, obj);
if (res.data.code === 200) { if (res.data.code === 200) {
@@ -458,7 +453,6 @@ export default {
message.success("批量签到成功"); message.success("批量签到成功");
state.qdModal = false; state.qdModal = false;
state.selectedRowKeys = []; state.selectedRowKeys = [];
state.selectedStudents = [];
getTableData(); getTableData();
} }
}) })
@@ -611,11 +605,11 @@ export default {
return ( return (
<div class="racona"> <div class="racona">
<span> <span>
{text.record.signStatus {text.record.signStatus == "1"
? "签到" ? "签到"
: text.record.leaveStatus : text.record.signStatus == "0"
? "请假" ? "请假"
: "-"} : "未签到"}
</span> </span>
</div> </div>
); );
@@ -632,15 +626,10 @@ export default {
return ( return (
<div class="racona"> <div class="racona">
<span> <span>
{text.record.signStatus == null && {text.record.signStatus === "1"
new Date().getTime() > new Date(state.endTime).getTime()
? "异常"
: text.record.signStatus
? "正常" ? "正常"
: text.record.leaveStatus : text.record.signStatus === "0"
? "异常" ? "请假"
: text.record.signStatus == null
? "-"
: "异常"} : "异常"}
</span> </span>
</div> </div>
@@ -662,40 +651,15 @@ export default {
> >
<div <div
onClick={() => { onClick={() => {
{
/* debugger */
}
console.log("点击签到", value); console.log("点击签到", value);
// 获取当前时间 let params = {
{ taskType: props.datasource.taskType,
/* showsingleqdModal(); */ growthId: props.datasource.growthId,
} workNoList: [value.record.username],
{ courseId: props.datasource.id,
/* 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 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; state.tableDataTotalLoading = true;
api taskSign(params)
.AttendanceSign(props.types === "1" ? obj1 : obj2)
.then((res) => { .then((res) => {
console.log("res----签到是否成功", res); console.log("res----签到是否成功", res);
message.destroy(); message.destroy();
@@ -709,7 +673,7 @@ export default {
}} }}
style="display:flex;justify-content:center;align-items:center;margin-right:12px;cursor:pointer;" style="display:flex;justify-content:center;align-items:center;margin-right:12px;cursor:pointer;"
> >
{value.record.signStatus ? ( {value.record.signStatus === "1" ? (
<div style="width:16px;height:16px;margin-right:6px;border-radius:16px;border:1px solid #ccc;display:flex;justify-content:center;align-items:center;"> <div style="width:16px;height:16px;margin-right:6px;border-radius:16px;border:1px solid #ccc;display:flex;justify-content:center;align-items:center;">
<div style="width:8px;height:8px;border-radius:8px;background:#4ea6ff;"></div> <div style="width:8px;height:8px;border-radius:8px;background:#4ea6ff;"></div>
</div> </div>
@@ -728,28 +692,14 @@ export default {
{ {
/* AttendanceLeave */ /* AttendanceLeave */
} }
let obj = { let params = {
courseId: Number(props.datasource.courseId), taskType: props.datasource.taskType,
routerId: Number(props.datasource.routerId), growthId: props.datasource.growthId,
ids: [value.record.studentId], workNoList: [value.record.username],
taskId: courseId: props.datasource.id,
Number(props.datasource.routerTaskId) ||
Number(props.datasource.id),
taskType: Number(props.datasource.type),
type: 1,
}; };
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; state.tableDataTotalLoading = true;
api taskLeave(params)
.AttendanceLeave(props.types == 1 ? obj : obj2)
.then((res) => { .then((res) => {
console.log("res----请假是否成功", res); console.log("res----请假是否成功", res);
message.destroy(); message.destroy();
@@ -763,7 +713,7 @@ export default {
}} }}
style="display:flex;justify-content:center;align-items:center;cursor:pointer;" style="display:flex;justify-content:center;align-items:center;cursor:pointer;"
> >
{value.record.leaveStatus ? ( {value.record.signStatus === "0" ? (
<div style="width:16px;height:16px;margin-right:6px;border-radius:16px;border:1px solid #ccc;display:flex;justify-content:center;align-items:center;"> <div style="width:16px;height:16px;margin-right:6px;border-radius:16px;border:1px solid #ccc;display:flex;justify-content:center;align-items:center;">
<div style="width:8px;height:8px;border-radius:8px;background:#4ea6ff;"></div> <div style="width:8px;height:8px;border-radius:8px;background:#4ea6ff;"></div>
</div> </div>
@@ -787,7 +737,7 @@ export default {
state.selectedRowKeys = []; state.selectedRowKeys = [];
}; };
const showqdModal = () => { const showqdModal = () => {
if (state.selectedStudents.length == 0) { if (state.selectedRowKeys.length == 0) {
message.destroy(); message.destroy();
message.error("请选择学员"); message.error("请选择学员");
return; return;

View File

@@ -449,7 +449,10 @@
</div> </div>
</template> </template>
<template <template
v-if="element.taskType == 6 || element.taskType == 9" v-if="
(element.taskType == 6 || element.taskType == 9) &&
checkMenu('growthWorkAttendance')
"
> >
<div <div
class="operation" class="operation"

View File

@@ -18,16 +18,16 @@ module.exports = defineConfig({
overlay: false,// 解决代码抛出异常 overlay: false,// 解决代码抛出异常
}, },
proxy: { proxy: {
// "/professional": { "/professional": {
// target: 'http://192.168.68.211:32002', target: 'http://192.168.68.211:32002',
// // target: 'http://192.168.50.195:32002', // target: 'http://192.168.50.195:32002',
// // target: 'http://192.168.86.195:32002', // target: 'http://192.168.86.195:32002',
// changeOrigin: true,
// },
"/growth": {
target: 'https:' + process.env.VUE_APP_BOE_API_URL,
changeOrigin: true, changeOrigin: true,
}, },
// "/growth": {
// target: 'https:' + process.env.VUE_APP_BOE_API_URL,
// changeOrigin: true,
// },
"/manageApi": { "/manageApi": {
target: 'https:' + process.env.VUE_APP_PROXY_URL, target: 'https:' + process.env.VUE_APP_PROXY_URL,
changeOrigin: true, //表示是否改变原域名 changeOrigin: true, //表示是否改变原域名