feat(审批): 新增审批中心页面及功能优化
- 新增审批中心页面,包含待审批任务列表展示和筛选功能 - 优化各审批类型详情页,增加项目信息展示和弹窗查看功能 - 在报销、用印、请假、出差详情页添加项目信息展示区域和详情弹窗 - 调整消息中心CC列表,增加未读状态红点标识 - 更新tabbar配置,新增审批入口图标和路由 - 优化部分页面交互细节和样式调整
This commit is contained in:
@@ -40,6 +40,59 @@
|
|||||||
<view class="item-label">申请时间:</view>
|
<view class="item-label">申请时间:</view>
|
||||||
<view class="item-value">{{ formatTime(detail.createTime) || '无' }}</view>
|
<view class="item-value">{{ formatTime(detail.createTime) || '无' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目名称</view>
|
||||||
|
<view class="item-value">{{ detail.projectName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目编号</view>
|
||||||
|
<view class="item-value">{{ detail.projectNum || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目代号</view>
|
||||||
|
<view class="item-value">{{ detail.projectCode || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="popup" type="center">
|
||||||
|
<view class="detail-content" v-if="detail.projectId">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目名称:</text>
|
||||||
|
<text class="info-value">{{ detail.projectName || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目编号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectNum || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目代号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectCode || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目类型:</text>
|
||||||
|
<oa-dict-tag dict-type="sys_project_type" :value="detail.projectType" placeholder="-" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目地址:</text>
|
||||||
|
<text class="info-value">{{ detail.address || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目总金额:</text>
|
||||||
|
<text class="info-value">{{ detail.funds || '-' }}元</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">负责人:</text>
|
||||||
|
<text class="info-value">{{ detail.functionary || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">备注:</text>
|
||||||
|
<text class="info-value">{{ detail.remark || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -84,7 +137,10 @@
|
|||||||
if (!timeStr) return '';
|
if (!timeStr) return '';
|
||||||
const [datePart] = timeStr.split(' ');
|
const [datePart] = timeStr.split(' ');
|
||||||
return datePart;
|
return datePart;
|
||||||
}
|
},
|
||||||
|
openPopup() {
|
||||||
|
this.$refs.popup.open()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -162,6 +218,12 @@
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
/* 总金额突出 - 字体加粗+主题色,视觉重点 */
|
||||||
|
.amount-item .item-value {
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
/* 请假原因 - 适配多行文,增加行高 */
|
/* 请假原因 - 适配多行文,增加行高 */
|
||||||
.reason-item .item-value {
|
.reason-item .item-value {
|
||||||
line-height: 52rpx;
|
line-height: 52rpx;
|
||||||
@@ -183,4 +245,26 @@
|
|||||||
margin: 8rpx 16rpx 0;
|
margin: 8rpx 16rpx 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
border: 1px solid #ccc; /* 边框 */
|
||||||
|
border-radius: 10px; /* 圆角 */
|
||||||
|
padding: 15px; /* 内边距 */
|
||||||
|
background-color: #f9f9f9; /* 背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex; /* 使用 Flexbox 布局 */
|
||||||
|
justify-content: space-between; /* 在一行内均匀分布 */
|
||||||
|
margin-top: 10px; /* 上边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: #333; /* 标签颜色 */
|
||||||
|
font-weight: bold; /* 标签加粗 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #666; /* 值的颜色 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -42,6 +42,59 @@
|
|||||||
<view class="item-label">更新人:</view>
|
<view class="item-label">更新人:</view>
|
||||||
<view class="item-value">{{ detail.updateBy || '无' }}</view>
|
<view class="item-value">{{ detail.updateBy || '无' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目名称</view>
|
||||||
|
<view class="item-value">{{ detail.projectName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目编号</view>
|
||||||
|
<view class="item-value">{{ detail.projectNum || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目代号</view>
|
||||||
|
<view class="item-value">{{ detail.projectCode || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="popup" type="center">
|
||||||
|
<view class="detail-content" v-if="detail.projectId">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目名称:</text>
|
||||||
|
<text class="info-value">{{ detail.projectName || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目编号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectNum || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目代号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectCode || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目类型:</text>
|
||||||
|
<oa-dict-tag dict-type="sys_project_type" :value="detail.projectType" placeholder="-" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目地址:</text>
|
||||||
|
<text class="info-value">{{ detail.address || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目总金额:</text>
|
||||||
|
<text class="info-value">{{ detail.funds || '-' }}元</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">负责人:</text>
|
||||||
|
<text class="info-value">{{ detail.functionary || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">备注:</text>
|
||||||
|
<text class="info-value">{{ detail.remark || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -99,6 +152,9 @@
|
|||||||
const [datePart] = timeStr.split(' ');
|
const [datePart] = timeStr.split(' ');
|
||||||
return datePart;
|
return datePart;
|
||||||
},
|
},
|
||||||
|
openPopup() {
|
||||||
|
this.$refs.popup.open()
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 状态文本转换
|
* 状态文本转换
|
||||||
* 将接口返回的英文状态转为中文展示
|
* 将接口返回的英文状态转为中文展示
|
||||||
@@ -219,4 +275,26 @@
|
|||||||
margin: 8rpx 16rpx 0;
|
margin: 8rpx 16rpx 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
border: 1px solid #ccc; /* 边框 */
|
||||||
|
border-radius: 10px; /* 圆角 */
|
||||||
|
padding: 15px; /* 内边距 */
|
||||||
|
background-color: #f9f9f9; /* 背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex; /* 使用 Flexbox 布局 */
|
||||||
|
justify-content: space-between; /* 在一行内均匀分布 */
|
||||||
|
margin-top: 10px; /* 上边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: #333; /* 标签颜色 */
|
||||||
|
font-weight: bold; /* 标签加粗 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #666; /* 值的颜色 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -36,6 +36,59 @@
|
|||||||
<view class="item-label">更新人</view>
|
<view class="item-label">更新人</view>
|
||||||
<view class="item-value">{{ detail.updateBy || '无' }}</view>
|
<view class="item-value">{{ detail.updateBy || '无' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目名称</view>
|
||||||
|
<view class="item-value">{{ detail.projectName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目编号</view>
|
||||||
|
<view class="item-value">{{ detail.projectNum || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目代号</view>
|
||||||
|
<view class="item-value">{{ detail.projectCode || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="popup" type="center">
|
||||||
|
<view class="detail-content" v-if="detail.projectId">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目名称:</text>
|
||||||
|
<text class="info-value">{{ detail.projectName || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目编号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectNum || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目代号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectCode || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目类型:</text>
|
||||||
|
<oa-dict-tag dict-type="sys_project_type" :value="detail.projectType" placeholder="-" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目地址:</text>
|
||||||
|
<text class="info-value">{{ detail.address || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目总金额:</text>
|
||||||
|
<text class="info-value">{{ detail.funds || '-' }}元</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">负责人:</text>
|
||||||
|
<text class="info-value">{{ detail.functionary || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">备注:</text>
|
||||||
|
<text class="info-value">{{ detail.remark || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -65,6 +118,11 @@
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
openPopup() {
|
||||||
|
this.$refs.popup.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -143,6 +201,12 @@
|
|||||||
word-break: break-all; /* 适配超长文本,防止溢出 */
|
word-break: break-all; /* 适配超长文本,防止溢出 */
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
}
|
}
|
||||||
|
/* 总金额突出 - 字体加粗+主题色,视觉重点 */
|
||||||
|
.amount-item .item-value {
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
/* 多行文适配 - 用印原因/备注,加大行高提升阅读体验,与其他组件一致 */
|
/* 多行文适配 - 用印原因/备注,加大行高提升阅读体验,与其他组件一致 */
|
||||||
.multi-line .item-value {
|
.multi-line .item-value {
|
||||||
line-height: 52rpx;
|
line-height: 52rpx;
|
||||||
@@ -164,4 +228,26 @@
|
|||||||
margin: 8rpx 16rpx 0;
|
margin: 8rpx 16rpx 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
border: 1px solid #ccc; /* 边框 */
|
||||||
|
border-radius: 10px; /* 圆角 */
|
||||||
|
padding: 15px; /* 内边距 */
|
||||||
|
background-color: #f9f9f9; /* 背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex; /* 使用 Flexbox 布局 */
|
||||||
|
justify-content: space-between; /* 在一行内均匀分布 */
|
||||||
|
margin-top: 10px; /* 上边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: #333; /* 标签颜色 */
|
||||||
|
font-weight: bold; /* 标签加粗 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #666; /* 值的颜色 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,75 +1,130 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 出差申请详情容器,复用统一卡片样式 -->
|
<!-- 出差申请详情容器,复用统一卡片样式 -->
|
||||||
<view class="reimburse-detail-container">
|
<view class="reimburse-detail-container">
|
||||||
<!-- 出差类型 - 带分类图标 -->
|
<!-- 出差类型 - 带分类图标 -->
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-travel-type"></text>
|
|
||||||
<view class="item-label">出差类型</view>
|
|
||||||
<view class="item-value">{{ detail.travelType || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="detail-item single-item">
|
<view class="detail-item single-item">
|
||||||
<text class="item-icon icon-travel-type"></text>
|
<text class="item-icon icon-travel-type"></text>
|
||||||
<view class="item-label">出差时间</view>
|
<view class="item-label">出差类型</view>
|
||||||
<view class="item-value">{{ formatTime(detail.startTime) || '无' }} - {{ formatTime(detail.endTime) || '无' }}</view>
|
<view class="item-value">{{ detail.travelType || '无' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 出差目的地 - 带定位专属图标(贴合出差场景) -->
|
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-address"></text>
|
|
||||||
<view class="item-label">出差目的地</view>
|
|
||||||
<view class="item-value">{{ detail.destination || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 出差原因 - 带原因图标,多行文适配 -->
|
|
||||||
<view class="detail-item single-item multi-line">
|
|
||||||
<text class="item-icon icon-reason"></text>
|
|
||||||
<view class="item-label">出差原因</view>
|
|
||||||
<view class="item-value">{{ detail.reason || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 收款人姓名 - 带用户图标 -->
|
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-user"></text>
|
|
||||||
<view class="item-label">收款人姓名</view>
|
|
||||||
<view class="item-value">{{ detail.payeeName || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 预估费用 - 突出显示,带金额图标+主题色+加粗(财务核心字段) -->
|
|
||||||
<view class="detail-item single-item amount-item">
|
|
||||||
<text class="item-icon icon-amount"></text>
|
|
||||||
<view class="item-label">预估费用</view>
|
|
||||||
<view class="item-value">{{ detail.estimatedCost || 0 }} 元</view>
|
|
||||||
</view>
|
|
||||||
<!-- 开户银行 - 带银行专属图标(贴合财务场景) -->
|
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-bank"></text>
|
|
||||||
<view class="item-label">开户银行</view>
|
|
||||||
<view class="item-value">{{ detail.bankName || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 银行账号 - 带卡号专属图标 -->
|
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-card"></text>
|
|
||||||
<view class="item-label">银行账号</view>
|
|
||||||
<view class="item-value">{{ detail.bankAccount || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 备注 - 带笔记图标,多行文适配 -->
|
|
||||||
<view class="detail-item single-item multi-line">
|
|
||||||
<text class="item-icon icon-remark"></text>
|
|
||||||
<view class="item-label">备注</view>
|
|
||||||
<view class="item-value">{{ detail.remark || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<!-- 创建人 - 带创建用户图标 -->
|
|
||||||
<view class="detail-item single-item">
|
|
||||||
<text class="item-icon icon-creator"></text>
|
|
||||||
<view class="item-label">申请人</view>
|
|
||||||
<view class="item-value">{{ detail.createBy || '无' }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="detail-item single-item">
|
<view class="detail-item single-item">
|
||||||
<text class="item-icon icon-creator"></text>
|
<text class="item-icon icon-travel-type"></text>
|
||||||
<view class="item-label">申请时间</view>
|
<view class="item-label">出差时间</view>
|
||||||
<view class="item-value">{{ detail.createTime || '无' }}</view>
|
<view class="item-value">{{ formatTime(detail.startTime) || '无' }} - {{ formatTime(detail.endTime) || '无' }}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<!-- 出差目的地 - 带定位专属图标(贴合出差场景) -->
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-address"></text>
|
||||||
|
<view class="item-label">出差目的地</view>
|
||||||
|
<view class="item-value">{{ detail.destination || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 出差原因 - 带原因图标,多行文适配 -->
|
||||||
|
<view class="detail-item single-item multi-line">
|
||||||
|
<text class="item-icon icon-reason"></text>
|
||||||
|
<view class="item-label">出差原因</view>
|
||||||
|
<view class="item-value">{{ detail.reason || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 收款人姓名 - 带用户图标 -->
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-user"></text>
|
||||||
|
<view class="item-label">收款人姓名</view>
|
||||||
|
<view class="item-value">{{ detail.payeeName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 预估费用 - 突出显示,带金额图标+主题色+加粗(财务核心字段) -->
|
||||||
|
<view class="detail-item single-item amount-item">
|
||||||
|
<text class="item-icon icon-amount"></text>
|
||||||
|
<view class="item-label">预估费用</view>
|
||||||
|
<view class="item-value">{{ detail.estimatedCost || 0 }} 元</view>
|
||||||
|
</view>
|
||||||
|
<!-- 开户银行 - 带银行专属图标(贴合财务场景) -->
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-bank"></text>
|
||||||
|
<view class="item-label">开户银行</view>
|
||||||
|
<view class="item-value">{{ detail.bankName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 银行账号 - 带卡号专属图标 -->
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-card"></text>
|
||||||
|
<view class="item-label">银行账号</view>
|
||||||
|
<view class="item-value">{{ detail.bankAccount || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 备注 - 带笔记图标,多行文适配 -->
|
||||||
|
<view class="detail-item single-item multi-line">
|
||||||
|
<text class="item-icon icon-remark"></text>
|
||||||
|
<view class="item-label">备注</view>
|
||||||
|
<view class="item-value">{{ detail.remark || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<!-- 创建人 - 带创建用户图标 -->
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">申请人</view>
|
||||||
|
<view class="item-value">{{ detail.createBy || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">申请时间</view>
|
||||||
|
<view class="item-value">{{ detail.createTime || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目名称</view>
|
||||||
|
<view class="item-value">{{ detail.projectName || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目编号</view>
|
||||||
|
<view class="item-value">{{ detail.projectNum || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail-item single-item amount-item" @click="openPopup" v-if="detail.projectId">
|
||||||
|
<text class="item-icon icon-creator"></text>
|
||||||
|
<view class="item-label">项目代号</view>
|
||||||
|
<view class="item-value">{{ detail.projectCode || '无' }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<uni-popup ref="popup" type="center">
|
||||||
|
<view class="detail-content" v-if="detail.projectId">
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目名称:</text>
|
||||||
|
<text class="info-value">{{ detail.projectName || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目编号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectNum || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目代号:</text>
|
||||||
|
<text class="info-value">{{ detail.projectCode || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目类型:</text>
|
||||||
|
<oa-dict-tag dict-type="sys_project_type" :value="detail.projectType" placeholder="-" />
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目地址:</text>
|
||||||
|
<text class="info-value">{{ detail.address || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">项目总金额:</text>
|
||||||
|
<text class="info-value">{{ detail.funds || '-' }}元</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">负责人:</text>
|
||||||
|
<text class="info-value">{{ detail.functionary || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-item">
|
||||||
|
<text class="info-label">备注:</text>
|
||||||
|
<text class="info-value">{{ detail.remark || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTravelReq } from '@/api/hrm/travel.js'
|
import {
|
||||||
|
getTravelReq
|
||||||
|
} from '@/api/hrm/travel.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -109,116 +164,221 @@
|
|||||||
const [datePart] = timeStr.split(' ');
|
const [datePart] = timeStr.split(' ');
|
||||||
return datePart;
|
return datePart;
|
||||||
},
|
},
|
||||||
|
openPopup() {
|
||||||
|
this.$refs.popup.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 主容器 - 与请假/报销/用印申请完全一致的卡片风格,精致阴影+大圆角+合理内边距 */
|
/* 主容器 - 与请假/报销/用印申请完全一致的卡片风格,精致阴影+大圆角+合理内边距 */
|
||||||
.reimburse-detail-container {
|
.reimburse-detail-container {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
margin: 20rpx 16rpx;
|
margin: 20rpx 16rpx;
|
||||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 基础项样式 - 全局统一flex布局、行高、间距,分隔线更柔和 */
|
/* 基础项样式 - 全局统一flex布局、行高、间距,分隔线更柔和 */
|
||||||
.detail-item {
|
.detail-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
border-bottom: 1px solid #f9f9f9;
|
border-bottom: 1px solid #f9f9f9;
|
||||||
}
|
}
|
||||||
/* 最后一项移除下边框,原生样式逻辑完整保留 */
|
|
||||||
.detail-item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
/* 单独行项 - 基础适配,复用统一布局逻辑 */
|
|
||||||
.single-item {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
/* 同行双项 - 核心布局(时间字段),与其他组件完全一致 */
|
|
||||||
.double-item {
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 图标样式 - 项目统一规范,Unicode图标无需额外引入,贴合出差/财务场景 */
|
/* 最后一项移除下边框,原生样式逻辑完整保留 */
|
||||||
.item-icon {
|
.detail-item:last-child {
|
||||||
display: inline-block;
|
border-bottom: none;
|
||||||
width: 32rpx;
|
}
|
||||||
height: 32rpx;
|
|
||||||
margin-right: 12rpx;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
flex-shrink: 0; /* 固定尺寸,防止被长文本挤压 */
|
|
||||||
color: #409eff; /* 项目统一主题色,一键全局替换 */
|
|
||||||
font-family: "iconfont";
|
|
||||||
}
|
|
||||||
/* 各字段专属语义化图标(贴合出差/财务场景,Unicode格式直接使用) */
|
|
||||||
.icon-start-time { content: "\e629"; } /* 开始时间图标 */
|
|
||||||
.icon-end-time { content: "\e62a"; } /* 结束时间图标 */
|
|
||||||
.icon-travel-type { content: "\e645"; }/* 分类图标,适配出差类型 */
|
|
||||||
.icon-address { content: "\e609"; } /* 定位图标,贴合目的地场景 */
|
|
||||||
.icon-reason { content: "\e614"; } /* 原因图标,项目统一 */
|
|
||||||
.icon-user { content: "\e6b8"; } /* 用户图标,适配收款人 */
|
|
||||||
.icon-amount { content: "\e62e"; } /* 金额图标,适配预估费用 */
|
|
||||||
.icon-bank { content: "\e673"; } /* 银行图标,贴合财务场景 */
|
|
||||||
.icon-card { content: "\e682"; } /* 卡号图标,适配银行账号 */
|
|
||||||
.icon-remark { content: "\e634"; } /* 笔记图标,适配备注 */
|
|
||||||
.icon-creator { content: "\e600"; } /* 创建用户图标 */
|
|
||||||
.icon-create-time { content: "\e629"; }/* 创建时间图标,项目统一 */
|
|
||||||
.icon-update-time { content: "\e684"; }/* 更新时间图标,项目统一 */
|
|
||||||
.icon-update-user { content: "\e64c"; }/* 编辑用户图标,适配更新人 */
|
|
||||||
|
|
||||||
/* 标签样式 - 统一视觉规范,同行时间项标签窄化适配,保留原无冒号逻辑 */
|
/* 单独行项 - 基础适配,复用统一布局逻辑 */
|
||||||
.item-label {
|
.single-item {
|
||||||
width: 160rpx;
|
flex-direction: row;
|
||||||
font-size: 30rpx;
|
}
|
||||||
color: #909399; /* 统一次要文字色,提升视觉层次 */
|
|
||||||
font-weight: 500;
|
|
||||||
flex-shrink: 0; /* 固定宽度,防止挤压 */
|
|
||||||
padding-top: 2rpx; /* 微调对齐,适配多行文本 */
|
|
||||||
}
|
|
||||||
/* 同行时间项标签 - 窄化宽度,适配双项同行紧凑布局 */
|
|
||||||
.time-item .item-label {
|
|
||||||
width: 100rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 内容值样式 - 统一规范,弹性占比,适配所有文本场景 */
|
/* 同行双项 - 核心布局(时间字段),与其他组件完全一致 */
|
||||||
.item-value {
|
.double-item {
|
||||||
flex: 1;
|
flex-direction: row;
|
||||||
font-size: 30rpx;
|
justify-content: space-between;
|
||||||
color: #333333; /* 统一主要文字色,保证可读性 */
|
}
|
||||||
word-break: break-all; /* 适配超长文本(如银行账号),防止溢出 */
|
|
||||||
line-height: 48rpx;
|
|
||||||
}
|
|
||||||
/* 多行文适配 - 出差原因/备注,加大行高提升阅读体验,项目统一规范 */
|
|
||||||
.multi-line .item-value {
|
|
||||||
line-height: 52rpx;
|
|
||||||
padding-top: 4rpx;
|
|
||||||
}
|
|
||||||
/* 预估费用突出 - 字体加粗+主题色+稍大字号,财务核心字段视觉聚焦 */
|
|
||||||
.amount-item .item-value {
|
|
||||||
color: #409eff;
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 同行时间项 - 各占48%宽度,防止互相挤压,布局稳定不凌乱 */
|
/* 图标样式 - 项目统一规范,Unicode图标无需额外引入,贴合出差/财务场景 */
|
||||||
.time-item {
|
.item-icon {
|
||||||
display: flex;
|
display: inline-block;
|
||||||
align-items: flex-start;
|
width: 32rpx;
|
||||||
width: 48%;
|
height: 32rpx;
|
||||||
}
|
margin-right: 12rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
/* 固定尺寸,防止被长文本挤压 */
|
||||||
|
color: #409eff;
|
||||||
|
/* 项目统一主题色,一键全局替换 */
|
||||||
|
font-family: "iconfont";
|
||||||
|
}
|
||||||
|
|
||||||
/* 竖线分隔 - 项目统一样式,视觉边界清晰,不混淆同行字段 */
|
/* 各字段专属语义化图标(贴合出差/财务场景,Unicode格式直接使用) */
|
||||||
.split-line {
|
.icon-start-time {
|
||||||
width: 1px;
|
content: "\e629";
|
||||||
height: 60rpx;
|
}
|
||||||
background-color: #f9f9f9;
|
|
||||||
margin: 8rpx 16rpx 0;
|
/* 开始时间图标 */
|
||||||
flex-shrink: 0;
|
.icon-end-time {
|
||||||
}
|
content: "\e62a";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 结束时间图标 */
|
||||||
|
.icon-travel-type {
|
||||||
|
content: "\e645";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 分类图标,适配出差类型 */
|
||||||
|
.icon-address {
|
||||||
|
content: "\e609";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 定位图标,贴合目的地场景 */
|
||||||
|
.icon-reason {
|
||||||
|
content: "\e614";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 原因图标,项目统一 */
|
||||||
|
.icon-user {
|
||||||
|
content: "\e6b8";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 用户图标,适配收款人 */
|
||||||
|
.icon-amount {
|
||||||
|
content: "\e62e";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 金额图标,适配预估费用 */
|
||||||
|
.icon-bank {
|
||||||
|
content: "\e673";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 银行图标,贴合财务场景 */
|
||||||
|
.icon-card {
|
||||||
|
content: "\e682";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡号图标,适配银行账号 */
|
||||||
|
.icon-remark {
|
||||||
|
content: "\e634";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 笔记图标,适配备注 */
|
||||||
|
.icon-creator {
|
||||||
|
content: "\e600";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 创建用户图标 */
|
||||||
|
.icon-create-time {
|
||||||
|
content: "\e629";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 创建时间图标,项目统一 */
|
||||||
|
.icon-update-time {
|
||||||
|
content: "\e684";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 更新时间图标,项目统一 */
|
||||||
|
.icon-update-user {
|
||||||
|
content: "\e64c";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 编辑用户图标,适配更新人 */
|
||||||
|
|
||||||
|
/* 标签样式 - 统一视觉规范,同行时间项标签窄化适配,保留原无冒号逻辑 */
|
||||||
|
.item-label {
|
||||||
|
width: 160rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #909399;
|
||||||
|
/* 统一次要文字色,提升视觉层次 */
|
||||||
|
font-weight: 500;
|
||||||
|
flex-shrink: 0;
|
||||||
|
/* 固定宽度,防止挤压 */
|
||||||
|
padding-top: 2rpx;
|
||||||
|
/* 微调对齐,适配多行文本 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 同行时间项标签 - 窄化宽度,适配双项同行紧凑布局 */
|
||||||
|
.time-item .item-label {
|
||||||
|
width: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容值样式 - 统一规范,弹性占比,适配所有文本场景 */
|
||||||
|
.item-value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #333333;
|
||||||
|
/* 统一主要文字色,保证可读性 */
|
||||||
|
word-break: break-all;
|
||||||
|
/* 适配超长文本(如银行账号),防止溢出 */
|
||||||
|
line-height: 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 多行文适配 - 出差原因/备注,加大行高提升阅读体验,项目统一规范 */
|
||||||
|
.multi-line .item-value {
|
||||||
|
line-height: 52rpx;
|
||||||
|
padding-top: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 预估费用突出 - 字体加粗+主题色+稍大字号,财务核心字段视觉聚焦 */
|
||||||
|
.amount-item .item-value {
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 同行时间项 - 各占48%宽度,防止互相挤压,布局稳定不凌乱 */
|
||||||
|
.time-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 48%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 竖线分隔 - 项目统一样式,视觉边界清晰,不混淆同行字段 */
|
||||||
|
.split-line {
|
||||||
|
width: 1px;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
margin: 8rpx 16rpx 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
/* 边框 */
|
||||||
|
border-radius: 10px;
|
||||||
|
/* 圆角 */
|
||||||
|
padding: 15px;
|
||||||
|
/* 内边距 */
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
/* 背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: flex;
|
||||||
|
/* 使用 Flexbox 布局 */
|
||||||
|
justify-content: space-between;
|
||||||
|
/* 在一行内均匀分布 */
|
||||||
|
margin-top: 10px;
|
||||||
|
/* 上边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: #333;
|
||||||
|
/* 标签颜色 */
|
||||||
|
font-weight: bold;
|
||||||
|
/* 标签加粗 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #666;
|
||||||
|
/* 值的颜色 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
13
pages.json
13
pages.json
@@ -585,6 +585,13 @@
|
|||||||
"navigationBarTitleText": "我的申请",
|
"navigationBarTitleText": "我的申请",
|
||||||
"navigationStyle": "default"
|
"navigationStyle": "default"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/hrm/approve/approve",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "办公审批",
|
||||||
|
"navigationStyle": "default"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
@@ -600,6 +607,12 @@
|
|||||||
"selectedIconPath": "static/images/tabbar_conversation_active.png",
|
"selectedIconPath": "static/images/tabbar_conversation_active.png",
|
||||||
"text": "消息"
|
"text": "消息"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/hrm/approve/approve",
|
||||||
|
"iconPath": "/static/images/tabbar_shenpi.png",
|
||||||
|
"selectedIconPath": "/static/images/tabbar_shenpi_active.png",
|
||||||
|
"text": "审批"
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// "pagePath": "pages/contact/index/index",
|
// "pagePath": "pages/contact/index/index",
|
||||||
// "iconPath": "./static/images/tabbar_contacts.png",
|
// "iconPath": "./static/images/tabbar_contacts.png",
|
||||||
|
|||||||
626
pages/hrm/approve/approve.vue
Normal file
626
pages/hrm/approve/approve.vue
Normal file
@@ -0,0 +1,626 @@
|
|||||||
|
<template>
|
||||||
|
<view class="hrm-page">
|
||||||
|
<!-- 顶部统计栏 -->
|
||||||
|
<view class="summary-bar">
|
||||||
|
<view class="summary-left">
|
||||||
|
<view class="page-title">审批中心</view>
|
||||||
|
<view class="page-desc">集中查看与处理待办审批</view>
|
||||||
|
</view>
|
||||||
|
<view class="summary-right">
|
||||||
|
<view class="metric">
|
||||||
|
<view class="metric-value">{{ todoCount }}</view>
|
||||||
|
<view class="metric-label">待审批</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 筛选栏 -->
|
||||||
|
<view class="filter-bar">
|
||||||
|
<view style="display: flex; align-items: center; gap: 16rpx; flex: 1">
|
||||||
|
<span class="filter-label">申请类型:</span>
|
||||||
|
<picker @change="handleBizTypeChange" :value="bizTypeIndex" :range="bizTypeList" range-key="label">
|
||||||
|
<view class="picker-text">{{ bizTypeList[bizTypeIndex].label }}</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button class="refresh-btn" size="mini" @click="loadTodoList">
|
||||||
|
刷新
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 待审批列表 -->
|
||||||
|
<scroll-view class="approval-list" scroll-y>
|
||||||
|
<!-- 加载中 -->
|
||||||
|
<view v-if="loading" class="loading-container">
|
||||||
|
<uni-load-more type="loading" color="#409EFF"></uni-load-more>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 空数据 -->
|
||||||
|
<view v-else-if="todoList.length === 0" class="empty-container">
|
||||||
|
<uni-icons type="empty" size="60" color="#909399"></uni-icons>
|
||||||
|
<view class="empty-text">暂无待审批任务</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 列表项 -->
|
||||||
|
<view v-else class="list-item" v-for="(item, index) in todoList" :key="index" @click="goDetail(item)"
|
||||||
|
@longpress="showActionMenu(item)">
|
||||||
|
<!-- 申请类型标签 -->
|
||||||
|
<view class="item-tag" :class="getBizTypeTagType(item.bizType)">
|
||||||
|
{{ getBizTypeText(item.bizType) }}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 核心信息 -->
|
||||||
|
<view class="item-main">
|
||||||
|
<view class="applicant">
|
||||||
|
<uni-icons type="user" size="14" color="#8a8f99"></uni-icons>
|
||||||
|
{{ formatApplicant(item) }}
|
||||||
|
</view>
|
||||||
|
<view class="request-info">{{ formatRequestInfo(item) }}</view>
|
||||||
|
<!-- <view class="node-info">当前节点:{{ formatNodeName(item) }}</view> -->
|
||||||
|
<view class="time-info">{{ formatDate(item.createTime) }}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 状态标签 -->
|
||||||
|
<view class="status-tag" :class="statusType(item.status)">
|
||||||
|
{{ statusText(item.status) }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listEmployee
|
||||||
|
} from '@/api/hrm';
|
||||||
|
import { getUserProfile } from '@/api/oa/user.js';
|
||||||
|
import {
|
||||||
|
approveFlowTask,
|
||||||
|
listTodoFlowTask,
|
||||||
|
rejectFlowTask
|
||||||
|
} from '@/api/hrm/flow';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'HrmApproval',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 员工列表
|
||||||
|
employees: [],
|
||||||
|
// 待审批列表
|
||||||
|
todoList: [],
|
||||||
|
loading: false,
|
||||||
|
todoCount: 0,
|
||||||
|
todayCount: 0,
|
||||||
|
// 筛选条件
|
||||||
|
query: {
|
||||||
|
bizType: ''
|
||||||
|
},
|
||||||
|
// 申请类型筛选器配置
|
||||||
|
bizTypeList: [{
|
||||||
|
label: '全部',
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '请假',
|
||||||
|
value: 'leave'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '出差',
|
||||||
|
value: 'travel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '用印',
|
||||||
|
value: 'seal'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '报销',
|
||||||
|
value: 'reimburse'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
bizTypeIndex: 0,
|
||||||
|
// 审批操作弹窗
|
||||||
|
actionDialog: {
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
type: '', // approve/reject
|
||||||
|
task: null
|
||||||
|
},
|
||||||
|
actionForm: {
|
||||||
|
remark: ''
|
||||||
|
},
|
||||||
|
actionSubmitting: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.loadTodoList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 格式化员工信息展示
|
||||||
|
formatEmpLabel(emp) {
|
||||||
|
if (!emp) return '';
|
||||||
|
const name = emp.empName || emp.nickName || emp.userName || '';
|
||||||
|
const no = emp.empNo ? ` · ${emp.empNo}` : '';
|
||||||
|
const dept = emp.deptName ? ` · ${emp.deptName}` : '';
|
||||||
|
return `${name || '员工'}${no}${dept}`.trim();
|
||||||
|
},
|
||||||
|
async fetchUserProfile() {
|
||||||
|
console.log('fetchUserProfile方法开始执行');
|
||||||
|
try {
|
||||||
|
// this.loading = true;
|
||||||
|
uni.showLoading()
|
||||||
|
console.log('开始调用getUserProfile API');
|
||||||
|
const response = await getUserProfile();
|
||||||
|
//
|
||||||
|
console.log('用户个人信息:', response);
|
||||||
|
// 从接口返回数据中提取用户权限(roleKey)
|
||||||
|
const roles = response.data.user?.roles?.map(item => item.roleKey) || [];
|
||||||
|
this.$store.commit('oa/SET_STATE', response.data.user)
|
||||||
|
console.log('用户权限字段', roles);
|
||||||
|
this.roleGroup = roles;
|
||||||
|
uni.hideLoading()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取用户个人信息失败:', error);
|
||||||
|
// 错误处理:可以设置默认权限或提示用户
|
||||||
|
this.roleGroup = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 格式化申请人信息
|
||||||
|
formatApplicant(task) {
|
||||||
|
if (!task.bizData) return '加载中...';
|
||||||
|
const empId = task.bizData.empId;
|
||||||
|
const emp = this.employees.find(e => String(e.empId) === String(empId));
|
||||||
|
if (emp) {
|
||||||
|
return this.formatEmpLabel(emp);
|
||||||
|
}
|
||||||
|
return empId ? `员工ID:${empId}` : '未指定';
|
||||||
|
},
|
||||||
|
// 格式化申请信息
|
||||||
|
formatRequestInfo(task) {
|
||||||
|
if (!task.bizData) return '加载中...';
|
||||||
|
const biz = task.bizData;
|
||||||
|
if (task.bizType === 'leave') {
|
||||||
|
return `${biz.leaveType || '请假'} · ${this.formatDuration(biz)}`;
|
||||||
|
} else if (task.bizType === 'travel') {
|
||||||
|
return `${biz.travelType || '出差'} · ${biz.destination || ''}`;
|
||||||
|
} else if (task.bizType === 'seal') {
|
||||||
|
return `${biz.sealType || '用印'} · ${biz.applyFileIds ? '已上传文件' : '未上传'}`;
|
||||||
|
} else if (task.bizType === 'reimburse') {
|
||||||
|
const amt = biz.totalAmount != null ? biz.totalAmount : 0;
|
||||||
|
return `${biz.reimburseType || '报销'} · 金额: ${amt}元`;
|
||||||
|
}
|
||||||
|
return '-';
|
||||||
|
},
|
||||||
|
// 格式化节点名称
|
||||||
|
formatNodeName(task) {
|
||||||
|
return `节点 #${task.nodeId}`;
|
||||||
|
},
|
||||||
|
// 获取申请类型文本
|
||||||
|
getBizTypeText(type) {
|
||||||
|
const map = {
|
||||||
|
leave: '请假',
|
||||||
|
travel: '出差',
|
||||||
|
seal: '用印',
|
||||||
|
reimburse: '报销'
|
||||||
|
};
|
||||||
|
return map[type] || type || '-';
|
||||||
|
},
|
||||||
|
// 获取申请类型标签样式
|
||||||
|
getBizTypeTagType(type) {
|
||||||
|
const map = {
|
||||||
|
leave: 'primary',
|
||||||
|
travel: 'success',
|
||||||
|
seal: 'warning',
|
||||||
|
reimburse: 'danger'
|
||||||
|
};
|
||||||
|
return map[type] || 'info';
|
||||||
|
},
|
||||||
|
// 获取状态文本
|
||||||
|
statusText(status) {
|
||||||
|
const map = {
|
||||||
|
pending: '待审批',
|
||||||
|
draft: '草稿',
|
||||||
|
approved: '已通过',
|
||||||
|
rejected: '已驳回'
|
||||||
|
};
|
||||||
|
return map[status] || status || '-';
|
||||||
|
},
|
||||||
|
// 获取状态标签样式
|
||||||
|
statusType(status) {
|
||||||
|
if (!status) return 'info';
|
||||||
|
const map = {
|
||||||
|
pending: 'warning',
|
||||||
|
draft: 'info',
|
||||||
|
approved: 'success',
|
||||||
|
rejected: 'danger'
|
||||||
|
};
|
||||||
|
return map[status] || 'info';
|
||||||
|
},
|
||||||
|
// 格式化日期
|
||||||
|
formatDate(val) {
|
||||||
|
if (!val) return '';
|
||||||
|
const d = new Date(val);
|
||||||
|
const p = n => (n < 10 ? `0${n}` : n);
|
||||||
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
|
||||||
|
},
|
||||||
|
// 格式化时长
|
||||||
|
formatDuration(biz) {
|
||||||
|
if (biz.hours) return `${biz.hours}h`;
|
||||||
|
if (biz.startTime && biz.endTime) {
|
||||||
|
const ms = new Date(biz.endTime).getTime() - new Date(biz.startTime).getTime();
|
||||||
|
if (ms > 0) return `${(ms / 3600000).toFixed(1)}h`;
|
||||||
|
}
|
||||||
|
return '-';
|
||||||
|
},
|
||||||
|
// 加载员工列表
|
||||||
|
loadEmployees() {
|
||||||
|
listEmployee({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
}).then(res => {
|
||||||
|
this.employees = res.rows || res.data || [];
|
||||||
|
}).catch(() => {
|
||||||
|
this.employees = [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 加载待办列表
|
||||||
|
async loadTodoList() {
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
await this.fetchUserProfile()
|
||||||
|
const userId = this.$store?.getters.storeOaId;
|
||||||
|
console.log(this.$store?.getters.storeOaId)
|
||||||
|
if (!userId) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '无法获取当前用户信息,请重新登录',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await listTodoFlowTask(userId);
|
||||||
|
let list = res.data || [];
|
||||||
|
// 前端过滤 bizType
|
||||||
|
if (this.query.bizType) {
|
||||||
|
list = list.filter(item => item.bizType === this.query.bizType);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.todoList = list;
|
||||||
|
this.todoCount = list.length;
|
||||||
|
this.todayCount = 0; // 可根据实际需求实现今日处理数量统计
|
||||||
|
} catch (err) {
|
||||||
|
// console.error('加载待办任务失败:', err);
|
||||||
|
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '加载待办任务失败',
|
||||||
|
// icon: 'error'
|
||||||
|
// });
|
||||||
|
this.loadTodoList();
|
||||||
|
this.todoList = [];
|
||||||
|
this.todoCount = 0;
|
||||||
|
} finally {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 跳转详情页
|
||||||
|
goDetail(task) {
|
||||||
|
if (!task || !task.bizId) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '缺少bizId,无法打开详情',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!task || !task.bizType) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未知的申请类型',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/workbench/hrm/detail/detail?bizId=${task.bizId}&bizType=${task.bizType}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 申请类型筛选变更
|
||||||
|
handleBizTypeChange(e) {
|
||||||
|
this.bizTypeIndex = e.detail.value;
|
||||||
|
this.query.bizType = this.bizTypeList[this.bizTypeIndex].value;
|
||||||
|
this.loadTodoList();
|
||||||
|
},
|
||||||
|
// 长按弹出操作菜单
|
||||||
|
showActionMenu(task) {
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['查看详情', '审批通过', '审批驳回'],
|
||||||
|
success: (res) => {
|
||||||
|
switch (res.tapIndex) {
|
||||||
|
case 0: // 查看详情
|
||||||
|
this.goDetail(task);
|
||||||
|
break;
|
||||||
|
case 1: // 审批通过
|
||||||
|
approveFlowTask(task.taskId).then(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已通过审批',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.loadTodoList()
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 2: // 审批驳回
|
||||||
|
rejectFlowTask(task.taskId).then(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '已驳回',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.loadTodoList()
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
console.log('取消操作:', res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 提交审批操作
|
||||||
|
submitAction() {
|
||||||
|
if (!this.actionDialog.task) return;
|
||||||
|
this.actionSubmitting = true;
|
||||||
|
const {
|
||||||
|
task,
|
||||||
|
type
|
||||||
|
} = this.actionDialog;
|
||||||
|
const action = type === 'approve' ? approveFlowTask : rejectFlowTask;
|
||||||
|
|
||||||
|
action(task.taskId, {
|
||||||
|
remark: this.actionForm.remark
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: type === 'approve' ? '审批通过' : '已驳回',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
this.actionDialog.visible = false;
|
||||||
|
this.loadTodoList();
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('审批操作失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '操作失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.actionSubmitting = false;
|
||||||
|
this.actionForm.remark = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.hrm-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
background-color: #f8f9fb;
|
||||||
|
padding: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 顶部统计栏
|
||||||
|
.summary-bar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
border: 1px solid #e6e8ed;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
|
||||||
|
.summary-left {
|
||||||
|
.page-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #2b2f36;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-desc {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #8a8f99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-right {
|
||||||
|
display: flex;
|
||||||
|
gap: 16rpx;
|
||||||
|
|
||||||
|
.metric {
|
||||||
|
min-width: 100rpx;
|
||||||
|
padding: 12rpx 16rpx;
|
||||||
|
border: 1px solid #e6e8ed;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background: #fcfdff;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.metric-value {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #2b2f36;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-label {
|
||||||
|
margin-top: 4rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #8a8f99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选栏
|
||||||
|
.filter-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 16rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.filter-label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-text {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
border: 1px solid #e6e8ed;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refresh-btn {
|
||||||
|
background-color: #409eff;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 8rpx 16rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审批列表
|
||||||
|
.approval-list {
|
||||||
|
height: calc(100vh - 280rpx);
|
||||||
|
|
||||||
|
.loading-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 100rpx 0;
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
|
.item-tag {
|
||||||
|
padding: 6rpx 12rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
background-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.success {
|
||||||
|
background-color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
background-color: #e6a23c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
background-color: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.info {
|
||||||
|
background-color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-main {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8rpx;
|
||||||
|
|
||||||
|
.applicant {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.request-info {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.node-info {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-info {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag {
|
||||||
|
padding: 6rpx 12rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&.warning {
|
||||||
|
background-color: #e6a23c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.info {
|
||||||
|
background-color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.success {
|
||||||
|
background-color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
background-color: #f56c6c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审批意见输入框
|
||||||
|
.remark-textarea {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 120rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
border: 1px solid #e6e8ed;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="refresh-btn" size="mini" @click="loadTodoList">
|
<button class="refresh-btn" size="mini" @click="loadHistory">
|
||||||
刷新
|
刷新
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 状态标签 -->
|
<!-- 状态标签 -->
|
||||||
<!-- <view class="status-tag" :class="statusType(item.status)">
|
<view v-if="!item.readFlag" class="status-tag" style="border-radius: 50%; background-color: red; width: 20rpx; height: 20rpx; padding: 0;">
|
||||||
{{ statusText(item.status) }}
|
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
@@ -278,6 +278,7 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
readCc(task.ccId)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/workbench/hrm/detail/detail?bizId=${task.bizId}&bizType=${task.bizType}`
|
url: `/pages/workbench/hrm/detail/detail?bizId=${task.bizId}&bizType=${task.bizType}`
|
||||||
});
|
});
|
||||||
|
|||||||
BIN
static/images/tabbar_shenpi.png
Normal file
BIN
static/images/tabbar_shenpi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
static/images/tabbar_shenpi_active.png
Normal file
BIN
static/images/tabbar_shenpi_active.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Reference in New Issue
Block a user