代表移除标题
This commit is contained in:
1 parent
c425411694
commit
335eb0d77a
1 file changed
+102
-139
+102
-139
@@ -1,11 +1,5 @@
|
||||
<template>
|
||||
<view class="todo-page">
|
||||
<view class="todo-header">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<text class="iconfont icon-fanhui"></text>
|
||||
</view>
|
||||
<view class="todo-title">我的待办</view>
|
||||
</view>
|
||||
<view class="todo-tabs">
|
||||
<view :class="['tab-item', activeTab === 0 ? 'active' : '']" @click="switchTab(0)">我的待办</view>
|
||||
<view :class="['tab-item', activeTab === 1 ? 'active' : '']" @click="switchTab(1)">我的已办</view>
|
||||
@@ -51,13 +45,13 @@
|
||||
<text class="modal-title">提交审核</text>
|
||||
<text class="modal-close" @tap="hideCommentModal">×</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-body">
|
||||
<view class="comment-section">
|
||||
<text class="comment-label">审核意见</text>
|
||||
<textarea
|
||||
v-model="approvalComment"
|
||||
class="comment-textarea"
|
||||
<textarea
|
||||
v-model="approvalComment"
|
||||
class="comment-textarea"
|
||||
placeholder="请输入审核意见..."
|
||||
maxlength="100"
|
||||
></textarea>
|
||||
@@ -79,13 +73,13 @@
|
||||
<text class="modal-title">选择转办人员</text>
|
||||
<text class="modal-close" @tap="hideDelegateModal">×</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-body">
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-section">
|
||||
<input
|
||||
v-model="searchKeyword"
|
||||
class="search-input"
|
||||
<input
|
||||
v-model="searchKeyword"
|
||||
class="search-input"
|
||||
placeholder="搜索"
|
||||
@input="filterUsers"
|
||||
/>
|
||||
@@ -94,8 +88,8 @@
|
||||
<!-- 面包屑导航 -->
|
||||
<view v-if="breadcrumbPath.length > 1" class="breadcrumb-section">
|
||||
<view class="breadcrumb">
|
||||
<view
|
||||
v-for="(item, index) in breadcrumbPath"
|
||||
<view
|
||||
v-for="(item, index) in breadcrumbPath"
|
||||
:key="item.id"
|
||||
class="breadcrumb-item"
|
||||
@tap="navigateToBreadcrumb(index)"
|
||||
@@ -154,7 +148,7 @@
|
||||
<text class="modal-title">转办确认</text>
|
||||
<text class="modal-close" @tap="hideDelegateConfirmModal">×</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-body">
|
||||
<view class="delegate-info">
|
||||
<view class="info-item">
|
||||
@@ -162,12 +156,12 @@
|
||||
<text class="info-value">{{ selectedUser?.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="comment-section">
|
||||
<text class="comment-label">审核意见 *</text>
|
||||
<textarea
|
||||
v-model="delegateComment"
|
||||
class="comment-textarea"
|
||||
<textarea
|
||||
v-model="delegateComment"
|
||||
class="comment-textarea"
|
||||
placeholder="请输入审核意见 (2-100字)"
|
||||
maxlength="100"
|
||||
></textarea>
|
||||
@@ -189,7 +183,7 @@
|
||||
<text class="modal-title">审批处理</text>
|
||||
<text class="modal-close" @tap="hideApprovalModal">×</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-body">
|
||||
<!-- 动态字段渲染 - 根据 formItems 渲染 -->
|
||||
<view v-if="currentTask.formItems && currentTask.formItems.length > 0">
|
||||
@@ -204,7 +198,7 @@
|
||||
<view v-else class="form-input">{{ field.props?.value || '未知' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 如果没有动态字段,显示默认字段 -->
|
||||
<view v-else>
|
||||
<!-- 流水号 -->
|
||||
@@ -231,7 +225,7 @@
|
||||
<view class="form-input">{{ currentTask.meetingTime || '未知时间' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- 动态审批流程 - 根据 approvalFlow 渲染 -->
|
||||
<view class="approval-flow">
|
||||
@@ -259,7 +253,7 @@
|
||||
<view v-if="index < currentTask.approvalFlow.length - 1" class="flow-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 如果没有动态审批流程,显示默认流程 -->
|
||||
<view v-else>
|
||||
<view class="flow-item">
|
||||
@@ -293,7 +287,7 @@
|
||||
<text class="btn-icon">×</text>
|
||||
<text class="btn-text">关闭</text>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 审批模式下显示操作按钮 -->
|
||||
<template v-else>
|
||||
<view class="modal-btn reject-btn" @tap="handleReject">
|
||||
@@ -322,7 +316,7 @@
|
||||
<text class="iconfont icon-guanbi"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="delegate-form">
|
||||
<!-- 选择转办人员 -->
|
||||
<view class="form-section">
|
||||
@@ -341,7 +335,7 @@
|
||||
</view>
|
||||
<view v-if="userSelectError" class="error-message">{{ userSelectError }}</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 审核意见 -->
|
||||
<view class="form-section">
|
||||
<view class="section-title">
|
||||
@@ -349,7 +343,7 @@
|
||||
<text class="required">*</text>
|
||||
</view>
|
||||
<view class="comment-input-wrapper">
|
||||
<textarea
|
||||
<textarea
|
||||
v-model="delegateFormComment"
|
||||
class="comment-textarea"
|
||||
placeholder="请输入审核意见 (2-100字)"
|
||||
@@ -361,7 +355,7 @@
|
||||
<view v-if="commentError" class="error-message">{{ commentError }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="modal-footer">
|
||||
<view class="modal-btn cancel-btn" @tap="hideDelegateFormModal">
|
||||
<text class="btn-text">取消</text>
|
||||
@@ -453,9 +447,6 @@ function switchTab(tabIdx: number) {
|
||||
fetchTodoList(true)
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchTodoList(true)
|
||||
@@ -476,14 +467,14 @@ onReachBottom(() => {
|
||||
// 查看已办任务
|
||||
async function viewProcess(item: any) {
|
||||
if (isProcessing.value) return
|
||||
|
||||
|
||||
isProcessing.value = true
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
|
||||
|
||||
try {
|
||||
// 调用第一个接口:查询任务详情 (view=true)
|
||||
const taskRes = await taskApi.queryTask(item.taskId, true)
|
||||
|
||||
|
||||
// 调用第二个接口:格式化开始节点显示
|
||||
const formatData = {
|
||||
flowId: item.flowId,
|
||||
@@ -496,27 +487,27 @@ async function viewProcess(item: any) {
|
||||
},
|
||||
taskId: item.taskId
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const formatRes = await taskApi.formatStartNodeShow(formatData)
|
||||
|
||||
|
||||
// 从接口返回的数据中提取动态字段和审批流程
|
||||
const taskData = taskRes as any
|
||||
const formatData_result = formatRes as any
|
||||
|
||||
|
||||
let formItems = []
|
||||
let approvalFlow = []
|
||||
|
||||
|
||||
if (taskData.code === 0 && taskData.data) {
|
||||
// 从 queryTask 接口获取表单字段
|
||||
formItems = taskData.data.formItems || []
|
||||
}
|
||||
|
||||
|
||||
if (formatData_result.code === 0 && formatData_result.data) {
|
||||
// 从 formatStartNodeShow 接口获取审批流程
|
||||
approvalFlow = formatData_result.data || []
|
||||
}
|
||||
|
||||
|
||||
// 设置当前任务数据 - 使用实际的任务数据和接口返回的动态数据
|
||||
currentTask.value = {
|
||||
...item,
|
||||
@@ -533,11 +524,11 @@ async function viewProcess(item: any) {
|
||||
// 标记为查看模式
|
||||
isViewMode: true
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 显示审批弹窗
|
||||
showApprovalModal.value = true
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载查看信息失败:', error)
|
||||
uni.showToast({
|
||||
@@ -553,14 +544,14 @@ async function viewProcess(item: any) {
|
||||
// 开始处理审批
|
||||
async function startProcess(item: any) {
|
||||
if (isProcessing.value) return
|
||||
|
||||
|
||||
isProcessing.value = true
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
|
||||
|
||||
try {
|
||||
// 调用第一个接口:查询任务详情
|
||||
const taskRes = await taskApi.queryTask(item.taskId, false)
|
||||
|
||||
|
||||
// 调用第二个接口:格式化开始节点显示
|
||||
const formatData = {
|
||||
flowId: item.flowId,
|
||||
@@ -573,27 +564,27 @@ async function startProcess(item: any) {
|
||||
},
|
||||
taskId: item.taskId
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const formatRes = await taskApi.formatStartNodeShow(formatData)
|
||||
|
||||
|
||||
// 从接口返回的数据中提取动态字段和审批流程
|
||||
const taskData = taskRes as any
|
||||
const formatData_result = formatRes as any
|
||||
|
||||
|
||||
let formItems = []
|
||||
let approvalFlow = []
|
||||
|
||||
|
||||
if (taskData.code === 0 && taskData.data) {
|
||||
// 从 queryTask 接口获取表单字段
|
||||
formItems = taskData.data.formItems || []
|
||||
}
|
||||
|
||||
|
||||
if (formatData_result.code === 0 && formatData_result.data) {
|
||||
// 从 formatStartNodeShow 接口获取审批流程
|
||||
approvalFlow = formatData_result.data || []
|
||||
}
|
||||
|
||||
|
||||
// 设置当前任务数据 - 使用实际的任务数据和接口返回的动态数据
|
||||
currentTask.value = {
|
||||
...item,
|
||||
@@ -608,11 +599,11 @@ async function startProcess(item: any) {
|
||||
formItems: formItems,
|
||||
approvalFlow: approvalFlow
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 显示审批弹窗
|
||||
showApprovalModal.value = true
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载审批信息失败:', error)
|
||||
uni.showToast({
|
||||
@@ -655,22 +646,22 @@ async function handleTransfer() {
|
||||
|
||||
// 提交审批结果
|
||||
async function submitApproval(approved: boolean) {
|
||||
|
||||
|
||||
if (isProcessing.value) return
|
||||
|
||||
|
||||
isProcessing.value = true
|
||||
uni.showLoading({
|
||||
title: approved ? '提交中...' : '拒绝中...',
|
||||
mask: true
|
||||
uni.showLoading({
|
||||
title: approved ? '提交中...' : '拒绝中...',
|
||||
mask: true
|
||||
})
|
||||
|
||||
|
||||
try {
|
||||
// 检查任务数据
|
||||
|
||||
|
||||
if (!currentTask.value.taskId) {
|
||||
throw new Error('任务ID不存在')
|
||||
}
|
||||
|
||||
|
||||
// 构建审批参数
|
||||
const paramMap = {
|
||||
mcmxfktv1b0zg: null,
|
||||
@@ -679,33 +670,33 @@ async function submitApproval(approved: boolean) {
|
||||
meetingTime: currentTask.value.meetingTime,
|
||||
mcmxoxqvzau0u_approve_condition: approved
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const taskLocalParamMap = {
|
||||
approveDesc: approvalComment.value || (approved ? '同意申请' : '拒绝申请')
|
||||
}
|
||||
|
||||
|
||||
const requestData = {
|
||||
taskId: currentTask.value.taskId,
|
||||
paramMap: paramMap,
|
||||
taskLocalParamMap: taskLocalParamMap
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const res = await taskApi.completeTask(requestData)
|
||||
|
||||
|
||||
|
||||
|
||||
uni.showToast({
|
||||
title: approved ? '提交成功' : '拒绝成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
|
||||
// 关闭弹窗并刷新列表
|
||||
hideApprovalModal()
|
||||
setTimeout(() => {
|
||||
fetchTodoList(true)
|
||||
}, 1000)
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('审批失败:', error)
|
||||
uni.showToast({
|
||||
@@ -733,11 +724,11 @@ function confirmApproval() {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 先保存 pendingApproval 的值,因为 hideCommentModal 会重置它
|
||||
const approvalValue = pendingApproval.value
|
||||
|
||||
|
||||
hideCommentModal()
|
||||
submitApproval(approvalValue!)
|
||||
}
|
||||
@@ -753,7 +744,7 @@ async function showUserSelection() {
|
||||
try {
|
||||
// 获取用户选择列表 - 使用抽取的API
|
||||
const res = await taskApi.getDeptOrgUsers(0)
|
||||
|
||||
|
||||
const responseData = res as any
|
||||
if (responseData.code === 0 && responseData.data) {
|
||||
// 处理接口返回的数据结构
|
||||
@@ -789,19 +780,19 @@ function removeSelectedUser() {
|
||||
}
|
||||
|
||||
function confirmDelegateForm() {
|
||||
|
||||
|
||||
// 清除之前的错误提示
|
||||
userSelectError.value = ''
|
||||
commentError.value = ''
|
||||
|
||||
|
||||
let hasError = false
|
||||
|
||||
|
||||
// 验证表单
|
||||
if (!selectedUser.value) {
|
||||
userSelectError.value = '请选择转办人员'
|
||||
hasError = true
|
||||
}
|
||||
|
||||
|
||||
if (!delegateFormComment.value || delegateFormComment.value.length < 2) {
|
||||
commentError.value = '请输入审核意见(至少2字)'
|
||||
hasError = true
|
||||
@@ -809,11 +800,11 @@ function confirmDelegateForm() {
|
||||
commentError.value = '审核意见不能超过100字'
|
||||
hasError = true
|
||||
}
|
||||
|
||||
|
||||
if (hasError) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// 设置转办数据并提交
|
||||
delegateComment.value = delegateFormComment.value
|
||||
// 先提交转办,再关闭弹窗
|
||||
@@ -837,13 +828,13 @@ async function selectUser(user: any) {
|
||||
if (user.type === 'dept') {
|
||||
try {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
|
||||
|
||||
const res = await taskApi.getDeptOrgUsers(user.id)
|
||||
|
||||
|
||||
const responseData = res as any
|
||||
if (responseData.code === 0 && responseData.data) {
|
||||
const apiData = responseData.data
|
||||
|
||||
|
||||
// 更新数据,显示下级部门和员工
|
||||
userSelectionData.value = {
|
||||
titleDepartments: [...(userSelectionData.value.titleDepartments || []), user],
|
||||
@@ -853,7 +844,7 @@ async function selectUser(user: any) {
|
||||
filteredDepartments.value = apiData.childDepartments || []
|
||||
filteredEmployees.value = apiData.employees || []
|
||||
searchKeyword.value = ''
|
||||
|
||||
|
||||
// 更新面包屑导航
|
||||
breadcrumbPath.value.push(user)
|
||||
} else {
|
||||
@@ -888,7 +879,7 @@ function confirmDelegateUser() {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
hideDelegateModal()
|
||||
// 返回到转办表单弹窗
|
||||
showDelegateFormModal.value = true
|
||||
@@ -900,21 +891,21 @@ async function navigateToBreadcrumb(index: number) {
|
||||
// 点击当前层级,不执行任何操作
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
|
||||
|
||||
// 截取面包屑路径到指定层级
|
||||
breadcrumbPath.value = breadcrumbPath.value.slice(0, index + 1)
|
||||
|
||||
|
||||
// 获取目标层级的数据
|
||||
const targetItem = breadcrumbPath.value[index]
|
||||
const res = await taskApi.getDeptOrgUsers(targetItem.id)
|
||||
|
||||
|
||||
const responseData = res as any
|
||||
if (responseData.code === 0 && responseData.data) {
|
||||
const apiData = responseData.data
|
||||
|
||||
|
||||
// 更新数据
|
||||
filteredDepartments.value = apiData.childDepartments || []
|
||||
filteredEmployees.value = apiData.employees || []
|
||||
@@ -944,7 +935,7 @@ function confirmDelegate() {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (delegateComment.value.length < 2) {
|
||||
uni.showToast({
|
||||
title: '审核意见至少2个字符',
|
||||
@@ -952,19 +943,19 @@ function confirmDelegate() {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
submitDelegate()
|
||||
}
|
||||
|
||||
async function submitDelegate() {
|
||||
|
||||
|
||||
if (isProcessing.value) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
isProcessing.value = true
|
||||
uni.showLoading({ title: '转办中...', mask: true })
|
||||
|
||||
|
||||
try {
|
||||
// 使用抽取的转办接口
|
||||
const res = await taskApi.setAssignee({
|
||||
@@ -981,15 +972,15 @@ async function submitDelegate() {
|
||||
approveDesc: delegateComment.value
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
const responseData = res as any
|
||||
if (responseData.code === 0) {
|
||||
uni.showToast({
|
||||
title: '转办成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
|
||||
// 关闭弹窗并刷新列表
|
||||
hideDelegateFormModal()
|
||||
hideApprovalModal()
|
||||
@@ -1002,7 +993,7 @@ async function submitDelegate() {
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('转办失败:', error)
|
||||
uni.showToast({
|
||||
@@ -1018,18 +1009,18 @@ async function submitDelegate() {
|
||||
// 搜索过滤
|
||||
function filterUsers() {
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
|
||||
|
||||
if (!keyword) {
|
||||
filteredDepartments.value = userSelectionData.value.childDepartments || []
|
||||
filteredEmployees.value = userSelectionData.value.employees || []
|
||||
return
|
||||
}
|
||||
|
||||
filteredDepartments.value = (userSelectionData.value.childDepartments || []).filter((dept: any) =>
|
||||
|
||||
filteredDepartments.value = (userSelectionData.value.childDepartments || []).filter((dept: any) =>
|
||||
dept.name.toLowerCase().includes(keyword)
|
||||
)
|
||||
|
||||
filteredEmployees.value = (userSelectionData.value.employees || []).filter((emp: any) =>
|
||||
|
||||
filteredEmployees.value = (userSelectionData.value.employees || []).filter((emp: any) =>
|
||||
emp.name.toLowerCase().includes(keyword)
|
||||
)
|
||||
}
|
||||
@@ -1040,34 +1031,6 @@ function filterUsers() {
|
||||
background: linear-gradient(180deg, #f5f7fa 60%, #e3eafc 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
.todo-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 96rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
|
||||
border-radius: 0 0 24rpx 24rpx;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
.back-btn {
|
||||
width: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
color: #1976d2;
|
||||
cursor: pointer;
|
||||
}
|
||||
.todo-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #222;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
.todo-tabs {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -1077,7 +1040,7 @@ function filterUsers() {
|
||||
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
|
||||
margin-bottom: 12rpx;
|
||||
position: sticky;
|
||||
top: 96rpx;
|
||||
top: 0;
|
||||
z-index: 9;
|
||||
}
|
||||
.tab-item {
|
||||
|
||||
Reference in new issue
Block a user