Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
427 changes: 427 additions & 0 deletions docs/HANDOVER_FEATURE.md

Large diffs are not rendered by default.

254 changes: 254 additions & 0 deletions src/api/modules/handover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
/**
* 交接班相关 API 接口
*/
import request from '../request'

/**
* 获取当前班次信息
*/
export function getCurrentShift() {
return request({
url: '/handover/current-shift',
method: 'GET'
})
}

/**
* 获取上一班留言
*/
export function getPreviousNotes() {
return request({
url: '/handover/previous-notes',
method: 'GET'
})
}

/**
* 获取重点关注老人列表
*/
export function getFocusElders() {
return request({
url: '/handover/focus-elders',
method: 'GET'
})
}

/**
* 获取待完成任务列表
*/
export function getTodoList() {
return request({
url: '/handover/todos',
method: 'GET'
})
}

/**
* 获取本班工作统计
*/
export function getWorkStatistics() {
return request({
url: '/handover/work-statistics',
method: 'GET'
})
}

/**
* 保存工作总结
* @param {Object} data - 工作总结数据
* @param {String} data.workRecord - 工作记录文本
* @param {Array} data.selectedTags - 选中的标签
* @param {Array} data.photos - 照片列表
*/
export function saveWorkSummary(data) {
return request({
url: '/handover/work-summary',
method: 'POST',
data
})
}

/**
* 上传照片
* @param {File} file - 照片文件
*/
export function uploadPhoto(file) {
const formData = new FormData()
formData.append('file', file)

return request({
url: '/handover/upload-photo',
method: 'POST',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
})
}

/**
* 获取接班人信息
*/
export function getSuccessorInfo() {
return request({
url: '/handover/successor',
method: 'GET'
})
}

/**
* 保存下一班注意事项
* @param {Object} data - 注意事项数据
* @param {Array} data.focusElders - 重点关注老人列表
* @param {String} data.supplementNote - 补充说明
* @param {Array} data.attachments - 附件列表
*/
export function saveNextShiftNotes(data) {
return request({
url: '/handover/next-shift-notes',
method: 'POST',
data
})
}

/**
* 提交交接班记录
* @param {Object} data - 交接班完整数据
*/
export function submitHandover(data) {
return request({
url: '/handover/submit',
method: 'POST',
data
})
}

/**
* 检查接班人是否在线
* @param {String} successorId - 接班人ID
*/
export function checkSuccessorOnline(successorId) {
return request({
url: `/handover/check-online/${successorId}`,
method: 'GET'
})
}

/**
* 催促接班人确认
* @param {String} successorId - 接班人ID
* @param {String} method - 催促方式: 'wechat', 'sms', 'phone', 'admin'
*/
export function remindSuccessor(successorId, method) {
return request({
url: '/handover/remind-successor',
method: 'POST',
data: {
successorId,
method
}
})
}

/**
* 获取交接班历史记录
* @param {Object} params - 查询参数
* @param {Number} params.page - 页码
* @param {Number} params.pageSize - 每页数量
* @param {String} params.startDate - 开始日期
* @param {String} params.endDate - 结束日期
*/
export function getHandoverHistory(params) {
return request({
url: '/handover/history',
method: 'GET',
params
})
}

/**
* 获取交接班详情
* @param {String} handoverId - 交接班记录ID
*/
export function getHandoverDetail(handoverId) {
return request({
url: `/handover/detail/${handoverId}`,
method: 'GET'
})
}

/**
* 获取今日工作统计报告
*/
export function getTodayReport() {
return request({
url: '/handover/today-report',
method: 'GET'
})
}

/**
* 获取今日收益预览
*/
export function getTodayEarnings() {
return request({
url: '/handover/today-earnings',
method: 'GET'
})
}

/**
* 确认下班打卡
*/
export function confirmClockOut() {
return request({
url: '/handover/clock-out',
method: 'POST'
})
}

/**
* 获取快捷标签列表
*/
export function getQuickTags() {
return request({
url: '/handover/quick-tags',
method: 'GET'
})
}

/**
* 添加自定义标签
* @param {String} tagName - 标签名称
*/
export function addCustomTag(tagName) {
return request({
url: '/handover/custom-tag',
method: 'POST',
data: {
tagName
}
})
}

export default {
getCurrentShift,
getPreviousNotes,
getFocusElders,
getTodoList,
getWorkStatistics,
saveWorkSummary,
uploadPhoto,
getSuccessorInfo,
saveNextShiftNotes,
submitHandover,
checkSuccessorOnline,
remindSuccessor,
getHandoverHistory,
getHandoverDetail,
getTodayReport,
getTodayEarnings,
confirmClockOut,
getQuickTags,
addCustomTag
}
59 changes: 59 additions & 0 deletions src/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,65 @@
}
}
]
},
{
"root": "pages/handover",
"pages": [
{
"path": "index",
"aliasPath": "/handover",
"name": "handover",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "交接班"
}
},
{
"path": "previous-notes",
"aliasPath": "/handover/previous-notes",
"name": "handover-previous-notes",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "查看上一班留言"
}
},
{
"path": "work-summary",
"aliasPath": "/handover/work-summary",
"name": "handover-work-summary",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "本班工作总结"
}
},
{
"path": "next-shift-notes",
"aliasPath": "/handover/next-shift-notes",
"name": "handover-next-shift-notes",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "下一班注意事项"
}
},
{
"path": "waiting-confirm",
"aliasPath": "/handover/waiting-confirm",
"name": "handover-waiting-confirm",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "等待确认"
}
},
{
"path": "complete",
"aliasPath": "/handover/complete",
"name": "handover-complete",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "交接完成"
}
}
]
}
],
"tabBar": {
Expand Down
Loading