-
京东方商业模型.xls
+
{{ fileName }}
上传失败
@@ -115,7 +115,7 @@
-
京东方商业模型.xls
+
{{ fileName }}
上传成功
@@ -191,6 +191,7 @@ import { reactive, toRefs } from "vue";
import { message } from "ant-design-vue";
import * as api from "../../api/index1";
import { BATCH_IMPORT_SCORE } from "@/api/config";
+import { useStore } from "vuex";
export default {
name: "EScore",
props: {
@@ -213,6 +214,7 @@ export default {
},
},
setup(props, ctx) {
+ const store = useStore();
const state = reactive({
fileType: ["xls", "xlsx"],
importHomeWork:
@@ -228,6 +230,9 @@ export default {
location.href.indexOf("http://") !== -1
? "http://111.231.196.214:12016/"
: location.href.slice(0, location.href.indexOf("/m")) + "/upload/",
+ userId: store.state.userInfo.id,
+ userName: store.state.userInfo.realName,
+ fileName: "",
});
const closeDrawer = () => {
ctx.emit("update:eScorevisible", false);
@@ -261,6 +266,7 @@ export default {
// console.log(info.file, info.fileList);
}
if (status === "done") {
+ state.fileName = info.file.name;
let i = 0;
let timer = setInterval(() => {
let uid = info.file.response.data;
diff --git a/src/components/drawers/project/ProjectFaceStu.vue b/src/components/drawers/project/ProjectFaceStu.vue
index 6ebb7b2c..266628be 100644
--- a/src/components/drawers/project/ProjectFaceStu.vue
+++ b/src/components/drawers/project/ProjectFaceStu.vue
@@ -30,7 +30,9 @@
: "-"
}}
-
签到时间:14:00
+
+ 签到时间:{{ beginTime }}~{{ endTime }}
+
@@ -234,6 +236,7 @@ import SignQR from "../SignQR.vue";
import * as api from "../../../api/index1";
import TwoDimensionalCode from "../../../components/TwoDimensionalCode";
import { message } from "ant-design-vue";
+import { toDate } from "../../../api/method";
export default {
name: "FaceManage",
components: {
@@ -341,10 +344,13 @@ export default {
codeIndex: null,
codeInfo: null, //二维码内容
// selectOption: [],
+ beginTime: null, //签到开始时间
+ endTime: null, //签到结束时间
});
const afterVisibleChange = (bol) => {
if (bol == true) {
getStudent();
+ isSignClick();
}
};
//考勤
@@ -395,7 +401,8 @@ export default {
// userName: "",
};
api
- .attendanceSign(obj, (res) => {
+ .attendanceSign(obj)
+ .then((res) => {
console.log("签到结果", res, obj);
if (res.data.code === 200) {
message.destroy();
@@ -565,12 +572,19 @@ export default {
},
{
title: "签到时间",
- dataIndex: "cur",
- key: "cur",
+ dataIndex: "signTime",
+ key: "signTime",
width: 110,
align: "center",
ellipsis: true,
className: "h",
+ customRender: (text) => {
+ return (
+
+ {text.record.signTime ? text.record.signTime : "-"}
+
+ );
+ },
},
// {
// title: "签退时间",
@@ -582,21 +596,42 @@ export default {
// },
{
title: "考勤",
- dataIndex: "time",
- key: "time",
+ dataIndex: "signStatus",
+ key: "signStatus",
width: 50,
align: "center",
ellipsis: true,
className: "h",
+ customRender: (text) => {
+ // console.log("text", text);
+ return (
+
+
+ {text.record.signStatus
+ ? "签到"
+ : text.record.leaveStatus
+ ? "请假"
+ : "-"}
+
+
+ );
+ },
},
{
title: "签到状态",
- dataIndex: "state",
- key: "state",
+ dataIndex: "signStatus",
+ key: "signStatus",
width: 50,
align: "center",
ellipsis: true,
className: "h",
+ customRender: (text) => {
+ return (
+
+ {text.record.signStatus ? "正常" : "异常"}
+
+ );
+ },
},
{
title: "考勤情况",
@@ -614,7 +649,7 @@ export default {
{
console.log("点击签到", e);
let obj = {
@@ -629,15 +664,17 @@ export default {
// userName: "",
};
api
- .attendanceSign(obj, (res) => {
+ .attendanceSign(obj)
+ .then((res) => {
console.log("签到结果", res, obj, e);
if (res.data.code === 200) {
- text.record.signIn = true;
+ text.record.signStatus = true;
+ getStudent();
}
})
.catch((err) => {
console.log("签到失败", err, obj);
- text.record.signIn = false;
+ text.record.signStatus = false;
});
}}
>
@@ -645,7 +682,7 @@ export default {
{
console.log("点击请假", e, props.datasource);
let obj = {
@@ -659,15 +696,17 @@ export default {
type: 1,
};
api
- .attendanceLeave(obj, (res) => {
+ .attendanceLeave(obj)
+ .then((res) => {
console.log("请假结果", res, obj, e);
if (res.data.code === 200) {
- text.record.leave = true;
+ text.record.leaveStatus = true;
+ getStudent();
}
})
.catch((err) => {
console.log("请假结果", err, obj);
- text.record.leave = false;
+ text.record.leaveStatus = false;
});
}}
>
@@ -855,7 +894,31 @@ export default {
getStudent();
}
};
+ // 计算签到时间
+ const isSignClick = () => {
+ let beginTime = new Date(props.datasource.startTime).getTime();
+ let endTime = !props.datasource.afterStart
+ ? new Date(props.datasource.endTime).getTime()
+ : new Date(props.datasource.beginTime).getTime();
+ if (props.datasource.beforeStart && props.datasource.afterStart) {
+ //有开始前有开始后
+ beginTime = beginTime - props.datasource.beforeStart * 60 * 1000;
+ endTime = endTime + props.datasource.afterStart * 60 * 1000;
+ console.log("1111");
+ } else if (props.datasource.beforeStart && !props.datasource.afterStart) {
+ //只有开始前无开始后
+ beginTime = beginTime - props.datasource.beforeStart * 60 * 1000;
+ console.log("11112222");
+ } else if (!props.datasource.beforeStart && props.datasource.afterStart) {
+ //无开始前有开始后
+ endTime = endTime + props.datasource.afterStart * 60 * 1000;
+ console.log("1111333");
+ }
+ state.beginTime = toDate(beginTime / 1000, "Y/M/D h:m:s");
+ state.endTime = toDate(endTime / 1000, "Y/M/D h:m:s");
+ console.log("beginTime,endTime", state.beginTime, state.endTime);
+ };
return {
...toRefs(state),
selectProjectName,
diff --git a/src/components/drawers/project/ProjectFaceTaskManage.vue b/src/components/drawers/project/ProjectFaceTaskManage.vue
index 0f0f66c9..6c4b5b02 100644
--- a/src/components/drawers/project/ProjectFaceTaskManage.vue
+++ b/src/components/drawers/project/ProjectFaceTaskManage.vue
@@ -68,7 +68,7 @@