Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
为 GitLab 提交贡献
登录
切换导航
D
dutyManagement
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
刘英杰
dutyManagement
提交
0e65b3d2
提交
0e65b3d2
编写于
11月 22, 2023
作者:
钟一霄
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
签到功能、换班功能、领导值班日志功能 20231121
上级
a55af60a
变更
6
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
413 行增加
和
81 行删除
+413
-81
.gitignore
.gitignore
+1
-0
index.js
src/api/index.js
+25
-0
main.js
src/main.js
+1
-1
index.vue
src/pages/myDuty/index.vue
+101
-5
index.vue
src/pages/signList/index.vue
+283
-75
axios.js
src/util/axios.js
+2
-0
未找到文件。
.gitignore
浏览文件 @
0e65b3d2
...
...
@@ -23,3 +23,4 @@ dist-ssr
*.sln
*.sw?
*.zip
*.rar
src/api/index.js
浏览文件 @
0e65b3d2
...
...
@@ -66,6 +66,11 @@ export function GetWatchInfo(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) {
//填写日志
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
...
...
@@ -94,6 +103,22 @@ export function 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
}
`
)
}
/**
* 微信
...
...
src/main.js
浏览文件 @
0e65b3d2
...
...
@@ -6,7 +6,7 @@ import 'animate.css' //引入
import
VueCookies
from
'
vue-cookies
'
import
VConsole
from
'
vconsole
'
;
const
app
=
createApp
(
App
)
const
vConsole
=
new
VConsole
();
//
const vConsole = new VConsole();
app
.
config
.
globalProperties
.
$cookies
=
VueCookies
app
.
use
(
router
)
app
.
mount
(
'
#app
'
)
src/pages/myDuty/index.vue
浏览文件 @
0e65b3d2
...
...
@@ -75,6 +75,11 @@
</
template
>
</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">-->
<!-- <template #value>-->
<!-- <van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">日志</van-button>-->
...
...
@@ -86,8 +91,24 @@
</van-list>
</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>
<
style
>
<
style
scoped
lang=
"less"
>
.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;
...
...
@@ -98,9 +119,9 @@
background-color: #ffffff;
height: 20%;
.cardContent
{
//
height
:
150px
;
}
//
.cardContent {
//
height: 150px;
//
}
}
.cardContainer:nth-last-child(1) {
...
...
@@ -114,7 +135,9 @@ import _ from 'lodash';
import
*
as
api
from
'
../../api/index.js
'
;
import
{
ref
,
reactive
,
onMounted
,
watch
}
from
'
vue
'
;
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
();
let
myDuty
=
reactive
({
...
...
@@ -136,6 +159,17 @@ const list = ref([]);
const
loading
=
ref
(
false
);
const
finished
=
ref
(
false
);
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
)
=>
{
console
.
log
(
"
🚀🚀🚀,
"
,
newValue
[
0
],
newValue
[
1
])
...
...
@@ -264,7 +298,69 @@ const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute,
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
(()
=>
{
addDutySearchSelectList
()
// 获取当前用户信息
userInfo
.
value
=
JSON
.
parse
(
Cookies
.
get
(
'
userInfo
'
))
})
</
script
>
src/pages/signList/index.vue
浏览文件 @
0e65b3d2
此差异已折叠。
点击以展开。
src/util/axios.js
浏览文件 @
0e65b3d2
...
...
@@ -65,6 +65,8 @@ axiosInstance.interceptors.request.use(
// 在发送请求之前可以进行一些处理,例如添加认证信息、日志等
let
token
=
Cookies
.
get
(
'
admin-token
'
)
config
.
headers
[
'
Authorization
'
]
=
'
Bearer
'
+
token
if
(
config
.
url
.
indexOf
(
'
ImageUpLoad
'
)
!=
-
1
)
config
.
headers
[
'
Content-Type
'
]
=
'
multipart/form-data
'
refreshTokenAction
()
return
config
;
},
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录