提交 0e65b3d2 编写于 作者: 钟一霄's avatar 钟一霄

签到功能、换班功能、领导值班日志功能 20231121

上级 a55af60a
...@@ -23,3 +23,4 @@ dist-ssr ...@@ -23,3 +23,4 @@ dist-ssr
*.sln *.sln
*.sw? *.sw?
*.zip *.zip
*.rar
...@@ -66,6 +66,11 @@ export function GetWatchInfo(data) { ...@@ -66,6 +66,11 @@ export function GetWatchInfo(data) {
return requestGet(`/api/Watch/api/Watch/GetWatchInfo?id=${data.id}`, data) return requestGet(`/api/Watch/api/Watch/GetWatchInfo?id=${data.id}`, data)
} }
export function WatchInfoSaveOneSelf(id, card_name) {
//给自己换班
return requestGet(`/api/Watch/api/Watch/WatchInfoSaveOneSelf?id=${id}&card_name=${card_name}`)
}
/*** /***
* *
* 签到列表 * 签到列表
...@@ -86,6 +91,10 @@ export function SignLogSave(data) { ...@@ -86,6 +91,10 @@ export function SignLogSave(data) {
//填写日志 //填写日志
return requestGet(`/api/SignRecord/api/SignRecord/SignLogSave?signId=${data.signId}&content=${data.content}`, data) return requestGet(`/api/SignRecord/api/SignRecord/SignLogSave?signId=${data.signId}&content=${data.content}`, data)
} }
export function LeadLogInit(signid) {
//领导日志初始化
return requestGet(`/api/SignRecord/api/SignRecord/LeadLogInit?signid=${signid}`)
}
/** /**
* Attendance * Attendance
...@@ -94,6 +103,22 @@ export function GetAttendanceList() { ...@@ -94,6 +103,22 @@ export function GetAttendanceList() {
//获取考勤列表 //获取考勤列表
return requestGet(`/api/Attendance/GetAttendanceList`) return requestGet(`/api/Attendance/GetAttendanceList`)
} }
export function ImageUpLoad(data) {
//照片上传
return requestPost(`/api/Attendance/ImageUpLoad`, data)
}
export function AttendanceSubmit(data) {
//考勤打卡
return requestPost(`/api/Attendance/AttendanceSubmit`, data)
}
/**
* UserInfo
*/
export function GetUserSelect(condition) {
//获取用户信息(选项框)
return requestGet(`/api/UserInfo/api/UserInfo/GetUserSelect?condition=${condition}`)
}
/** /**
* 微信 * 微信
......
...@@ -6,7 +6,7 @@ import 'animate.css' //引入 ...@@ -6,7 +6,7 @@ import 'animate.css' //引入
import VueCookies from 'vue-cookies' import VueCookies from 'vue-cookies'
import VConsole from 'vconsole'; import VConsole from 'vconsole';
const app = createApp(App) const app = createApp(App)
const vConsole = new VConsole(); // const vConsole = new VConsole();
app.config.globalProperties.$cookies = VueCookies app.config.globalProperties.$cookies = VueCookies
app.use(router) app.use(router)
app.mount('#app') app.mount('#app')
...@@ -75,6 +75,11 @@ ...@@ -75,6 +75,11 @@
</template> </template>
</van-cell> </van-cell>
<van-cell v-if="item.card_name == userInfo.card_number" class="" title="换班">
<template #value>
<van-button plain type="warning" size="small" @click="pickerChgSftOpen(item)">换班</van-button>
</template>
</van-cell>
<!-- <van-cell class="cardContent">--> <!-- <van-cell class="cardContent">-->
<!-- <template #value>--> <!-- <template #value>-->
<!-- <van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">日志</van-button>--> <!-- <van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">日志</van-button>-->
...@@ -86,8 +91,24 @@ ...@@ -86,8 +91,24 @@
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
<!-- 换班人员选择器 -->
<van-popup v-model:show="changeShiftsPickerShow" round position="bottom">
<!-- 搜索框 -->
<van-search
v-model="changeSftInput"
placeholder="请输入姓名或工号"
@update:model-value="searchChange"/>
<!-- 选择器 -->
<van-picker
:columns="userList"
:loading="pickerLoading"
@cancel="pickerCancel"
@confirm="pickerConfirm"
/>
</van-popup>
</template> </template>
<style> <style scoped lang="less">
.container { .container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start; //box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
...@@ -98,9 +119,9 @@ ...@@ -98,9 +119,9 @@
background-color: #ffffff; background-color: #ffffff;
height: 20%; height: 20%;
.cardContent { // .cardContent {
//height: 150px; // height: 150px;
} // }
} }
.cardContainer:nth-last-child(1) { .cardContainer:nth-last-child(1) {
...@@ -114,7 +135,9 @@ import _ from 'lodash'; ...@@ -114,7 +135,9 @@ import _ from 'lodash';
import * as api from '../../api/index.js'; import * as api from '../../api/index.js';
import {ref, reactive, onMounted, watch} from 'vue'; import {ref, reactive, onMounted, watch} from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import {showToast} from "vant"; import 'vant/es/dialog/style'
import {showToast, showSuccessToast, showFailToast, showConfirmDialog} from "vant";
import Cookies from 'js-cookie'
const onClickLeft = () => history.back(); const onClickLeft = () => history.back();
let myDuty = reactive({ let myDuty = reactive({
...@@ -136,6 +159,17 @@ const list = ref([]); ...@@ -136,6 +159,17 @@ const list = ref([]);
const loading = ref(false); const loading = ref(false);
const finished = ref(false); const finished = ref(false);
let searchValue = ref('') let searchValue = ref('')
const userInfo = ref({})
// 选中值班obj
const attendanceObj = ref({})
// 换班选择器显示
const changeShiftsPickerShow = ref(false)
// 搜索条件
const changeSftInput = ref('')
// 换班选择器列表
const userList = ref([])
const pickerLoading = ref(false)
watch([searchValue, () => myDuty.watchtypeid, () => myDuty.watch_hour_id, () => myDuty.campusid, () => myDuty.dept_id], (newValue, oldValue) => { watch([searchValue, () => myDuty.watchtypeid, () => myDuty.watch_hour_id, () => myDuty.campusid, () => myDuty.dept_id], (newValue, oldValue) => {
console.log("🚀🚀🚀,", newValue[0], newValue[1]) console.log("🚀🚀🚀,", newValue[0], newValue[1])
...@@ -264,7 +298,69 @@ const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute, ...@@ -264,7 +298,69 @@ const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute,
resolve(array) resolve(array)
}) })
} }
// 打开换班选择器
function pickerChgSftOpen(obj) {
changeShiftsPickerShow.value = true
attendanceObj.value = obj
}
// 搜索值改变
function searchChange(val) {
pickerLoading.value = true
api.GetUserSelect(val).then(res => {
// console.log('搜索换班人员', res)
if (res.code == 1) {
userList.value = res.response.map(a => {
return {
...a,
text: a.name,
value: a.id,
}
})
} else {
showFailToast(res.msg_detail)
}
}).finally(() => {
pickerLoading.value = false
})
}
// 换班选择器确认
function pickerConfirm(val) {
// console.log('选择器确认', val)
if (val.selectedOptions[0] == undefined) {
// 未选择人员
showToast('请选择换班人员')
return
}
showConfirmDialog({
title: '提示',
message: '是否确认换班?',
}).then(() => {
let id = attendanceObj.value.watchid
let card_name = val.selectedOptions[0].id
api.WatchInfoSaveOneSelf(id, card_name).then(res => {
// console.log('换班请求', res)
if (res.code == 1) {
showSuccessToast(res.response)
changeShiftsPickerShow.value = false
onLoad()
} else {
showFailToast(res.msg_detail)
}
})
}).catch(() => {
})
}
// 换班选择器取消
function pickerCancel() {
changeShiftsPickerShow.value = false
}
onMounted(() => { onMounted(() => {
addDutySearchSelectList() addDutySearchSelectList()
// 获取当前用户信息
userInfo.value = JSON.parse(Cookies.get('userInfo'))
}) })
</script> </script>
此差异已折叠。
...@@ -65,6 +65,8 @@ axiosInstance.interceptors.request.use( ...@@ -65,6 +65,8 @@ axiosInstance.interceptors.request.use(
// 在发送请求之前可以进行一些处理,例如添加认证信息、日志等 // 在发送请求之前可以进行一些处理,例如添加认证信息、日志等
let token = Cookies.get('admin-token') let token = Cookies.get('admin-token')
config.headers['Authorization'] = 'Bearer ' + token config.headers['Authorization'] = 'Bearer ' + token
if (config.url.indexOf('ImageUpLoad') != -1)
config.headers['Content-Type'] = 'multipart/form-data'
refreshTokenAction() refreshTokenAction()
return config; return config;
}, },
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或