Browse Source

添加签到

master
suyanyan 2 months ago
parent
commit
cdf8f4c01e
2 changed files with 38 additions and 4 deletions
  1. +4
    -0
      SafeCampus.WEB/src/api/modules/attendance/roolcall.ts
  2. +34
    -4
      SafeCampus.WEB/src/views/attendance/roolcall/detail.vue

+ 4
- 0
SafeCampus.WEB/src/api/modules/attendance/roolcall.ts View File

@@ -48,6 +48,10 @@ const attendanceRoolcallApi = {
/** 修改点名任务 */ /** 修改点名任务 */
update(params: any) { update(params: any) {
return http.put("update", params); return http.put("update", params);
},
/** 手动点名 */
manualRoll(params: any) {
return http.post("manualRoll", params);
} }
}; };




+ 34
- 4
SafeCampus.WEB/src/views/attendance/roolcall/detail.vue View File

@@ -20,7 +20,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" <el-col :span="24"
><el-row class="rowbg"> ><el-row class="rowbg">
<el-col :xl="4" :lg="4" :md="6" :sm="8" :xs="12" v-for="(item, index) in listData" :key="index"
<el-col :xl="3" :lg="4" :md="6" :sm="8" :xs="12" v-for="(item, index) in listData" :key="index"
><div class="grid-content"> ><div class="grid-content">
<div class="imgBox" :class="{ active: item.status === 1 ? true : false }"> <div class="imgBox" :class="{ active: item.status === 1 ? true : false }">
<el-image <el-image
@@ -42,6 +42,9 @@
{{ item.personSetName }} {{ item.personSetName }}
</div> </div>
</div> </div>
<div v-if="item.status !== 1" class="btn btns" style="justify-content: center; border-top: none">
<el-button size="small" type="primary" @click="checkOut(item, index)">签到</el-button>
</div>
</div></el-col </div></el-col
> >
</el-row></el-col </el-row></el-col
@@ -151,6 +154,19 @@ const assignFn = (item: any) => {
const checkOut = (item: any, index: number) => { const checkOut = (item: any, index: number) => {
checkIndex.value = index; checkIndex.value = index;
checkData.value = JSON.parse(JSON.stringify(item)); checkData.value = JSON.parse(JSON.stringify(item));

attendanceRoolcallApi.manualRoll([{ personId: item.personId, personSetId: item.personSetId, taskId: route.query.taskId }]).then(() => {
ElMessage({
message: "点名成功",
type: "success"
});
UnrecognizedD.value = UnrecognizedD.value.filter((item1: any) => item1.id !== item.id);
listData.value.map((item2: any) => {
if (item2.personId === item.personId) {
item2.status = 1;
}
});
});
}; };
const submitFn = () => { const submitFn = () => {
if (!checkIndex.value && checkIndex.value !== 0) { if (!checkIndex.value && checkIndex.value !== 0) {
@@ -162,7 +178,7 @@ const submitFn = () => {
} }
visible.value = false; visible.value = false;


attendanceRoolcallApi.update({ id: assignId.value, personId: checkData.value.personId, personSetId: checkData.value.personSetId }).then(() => {
attendanceRoolcallApi.update({ taskId: assignId.value, personId: checkData.value.personId, personSetId: checkData.value.personSetId }).then(() => {
ElMessage({ ElMessage({
message: "指派成功", message: "指派成功",
type: "success" type: "success"
@@ -209,11 +225,26 @@ onMounted(() => {
height: 190px; height: 190px;
margin-bottom: 20px; margin-bottom: 20px;
.grid-content { .grid-content {
position: relative;
box-sizing: border-box; box-sizing: border-box;
height: 100%;

// height: 100%;
padding: 15px; padding: 15px;
margin: 10px; margin: 10px;
background: #ffffff; background: #ffffff;
.btns {
position: absolute;
top: 0;
left: 0;
width: 100%;
background: rgb(0 0 0 / 80%);
opacity: 0;
}
&:hover {
.btns {
opacity: 1;
}
}
.imgBox { .imgBox {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -233,7 +264,6 @@ onMounted(() => {
} }
} }
.info { .info {
height: 80px;
.label { .label {
margin-right: 8px; margin-right: 8px;
font-size: 14px; font-size: 14px;


Loading…
Cancel
Save