feat(hrm): 新增拨款申请功能并修复仓储显示问题

- 添加拨款申请相关组件、API及页面逻辑
- 修复仓储模块列表显示边框和内容插槽问题
- 更新版本记录至5.2.3版本
This commit is contained in:
砂糖
2026-04-14 09:33:58 +08:00
parent f91ab6d45f
commit 05ff3391c7
10 changed files with 481 additions and 26 deletions

59
api/hrm/appropriation.js Normal file
View File

@@ -0,0 +1,59 @@
import request from "@/util/oaRequest"
// 请假单
export function listAppropriationReq (query) {
return request({
url: '/hrm/appropriation/list',
method: 'get',
params: query
})
}
export function getAppropriationReq (bizId) {
return request({
url: `/hrm/appropriation/${bizId}`,
method: 'get'
})
}
export function addAppropriationReq (data) {
return request({
url: '/hrm/appropriation',
method: 'post',
data
})
}
export function editAppropriationReq (data) {
return request({
url: '/hrm/appropriation',
method: 'put',
data
})
}
export function delAppropriationReq (bizIds) {
return request({
url: `/hrm/appropriation/${bizIds}`,
method: 'delete'
})
}
export function allAppropriationReq (query) {
return request({
url: '/hrm/appropriation/all',
method: 'get',
params: query
})
}
/**
* 请假统计信息
*/
export function getAppropriationStats (query) {
return request({
url: '/hrm/appropriation/req/stats',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,381 @@
<template>
<!-- 出差申请详情容器复用统一卡片样式 -->
<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.appropriationType || '无' }}</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.amount || 0 }} </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">
<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.reason || '无' }}</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">
<text class="item-icon icon-date"></text>
<view class="item-label">附件</view>
<view class="item-value">
<oa-file-list :files="detail.accessoryApplyIds"></oa-file-list>
</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>
<script>
import {
getAppropriationReq
} from '@/api/hrm/appropriation.js'
export default {
props: {
bizId: {
type: String,
required: true
}
},
data() {
return {
detail: {}
}
},
watch: {
bizId: {
handler(newVal) {
// 增加空值判断,避免无效请求
if (newVal) {
getAppropriationReq(newVal).then(res => {
this.detail = res.data || {}
console.log(this.detail)
})
}
},
immediate: true
}
},
methods: {
/**
* 时间格式化方法
* 将 "2026-01-08 00:00:00" 格式化为 "2026-01-08"
* @param {String} timeStr - 原始时间字符串
* @returns {String} 格式化后的日期
*/
formatTime(timeStr) {
if (!timeStr) return '';
const [datePart] = timeStr.split(' ');
return datePart;
},
openPopup() {
this.$refs.popup.open()
}
}
}
</script>
<style scoped>
/* 主容器 - 与请假/报销/用印申请完全一致的卡片风格,精致阴影+大圆角+合理内边距 */
.reimburse-detail-container {
background: #ffffff;
border-radius: 18rpx;
margin: 20rpx 16rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
box-sizing: border-box;
}
/* 基础项样式 - 全局统一flex布局、行高、间距分隔线更柔和 */
.detail-item {
display: flex;
align-items: flex-start;
line-height: 48rpx;
padding: 20rpx 0;
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 {
display: inline-block;
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 {
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>

View File

@@ -1,6 +1,6 @@
<template>
<view class="">
<view v-if="files" class="attachment-list">
<view v-if="files && attachmentFiles.length !== 0" class="attachment-list">
<view v-for="(file, index) in attachmentFiles" :key="`${file.ossId}_${index}`" class="attachment-item"
@click="previewFile(file)">
<view class="file-icon">
@@ -15,7 +15,7 @@
</view>
</view>
</view>
<view v-if="files && attachmentFiles.length === 0" class="no-attachment">
<view v-else="files " class="no-attachment">
暂无附件
</view>
</view>

View File

@@ -115,6 +115,10 @@
{
label: '报销',
value: 'reimburse'
},
{
label: '拨款',
value: 'appropriation'
}
],
bizTypeIndex: 0,
@@ -187,6 +191,9 @@
} else if (task.bizType === 'reimburse') {
const amt = biz.totalAmount != null ? biz.totalAmount : 0;
return `${biz.reimburseType || '报销'} · 金额: ${amt}`;
} else if (task.bizType === 'appropriation') {
const amt = biz.amount != null ? biz.amount : 0;
return `${biz.appropriationType || '拨款'} · 金额: ${amt}`;
}
return '-';
},
@@ -200,7 +207,8 @@
leave: '请假',
travel: '出差',
seal: '用印',
reimburse: '报销'
reimburse: '报销',
appropriation: '拨款'
};
return map[type] || type || '-';
},
@@ -210,7 +218,8 @@
leave: 'primary',
travel: 'success',
seal: 'warning',
reimburse: 'danger'
reimburse: 'danger',
appropriation: 'danger'
};
return map[type] || 'info';
},

View File

@@ -114,6 +114,10 @@
{
label: '报销',
value: 'reimburse'
},
{
label: '拨款',
value: 'appropriation'
}
],
bizTypeIndex: 0,
@@ -168,6 +172,9 @@
} else if (task.bizType === 'reimburse') {
const amt = biz.totalAmount != null ? biz.totalAmount : 0;
return `${biz.reimburseType || '报销'} · 金额: ${amt}`;
} else if (task.bizType === 'appropriation') {
const amt = biz.amount != null ? biz.amount : 0;
return `${biz.appropriationType || '拨款'} · 金额: ${amt}`;
}
return '-';
},
@@ -181,7 +188,8 @@
leave: '请假',
travel: '出差',
seal: '用印',
reimburse: '报销'
reimburse: '报销',
appropriation: '拨款'
};
return map[type] || type || '-';
},
@@ -191,7 +199,8 @@
leave: 'primary',
travel: 'success',
seal: 'warning',
reimburse: 'danger'
reimburse: 'danger',
appropriation: 'danger'
};
return map[type] || 'info';
},

View File

@@ -20,6 +20,7 @@
import HRMReimburseDetail from '@/components/hrm/detailPanels/reimburse.vue'
import HRMSealDetail from '@/components/hrm/detailPanels/seal.vue'
import HRMTravelDetail from '@/components/hrm/detailPanels/travel.vue'
import HRMAppropriationDetail from '@/components/hrm/detailPanels/appropriation.vue'
import {
approveFlowTask,
@@ -34,7 +35,8 @@
HRMLeaveDetail,
HRMReimburseDetail,
HRMSealDetail,
HRMTravelDetail
HRMTravelDetail,
HRMAppropriationDetail
},
data() {
return {
@@ -46,7 +48,8 @@
leave: 'HRMLeaveDetail', // 请假
reimburse: 'HRMReimburseDetail', // 报销
seal: 'HRMSealDetail', // 用章
travel: 'HRMTravelDetail' // 差旅
travel: 'HRMTravelDetail' ,// 差旅
appropriation: 'HRMAppropriationDetail'
}
}
},

View File

@@ -96,17 +96,6 @@
height="700rpx"
>
<view class="popup-container">
<!-- 弹窗标题栏 -->
<!-- <view class="popup-header">
<text class="popup-title">入库单明细</text>
<uni-icon
type="close"
size="24"
class="close-icon"
@click="$refs.popup.close()"
></uni-icon>
</view> -->
<view class="detail-scroll">
<view class="detail-document">
<!-- 明细头部 -->
@@ -116,9 +105,9 @@
</view> -->
<!-- 明细列表 -->
<uni-list v-if="warehouseTaskList.length > 0" border="false">
<uni-list v-if="warehouseTaskList.length > 0" :border="false">
<uni-list-item class="detail-item" v-for="(item, index) in warehouseTaskList" :key="index">
<view class="detail-content">
<view class="detail-content" slot="body">
<view class="detail-title">
<text class="item-num">{{ index + 1 }}.</text>
<text class="item-name">{{ item.warehouseName }}</text>
@@ -277,6 +266,7 @@ export default {
showDetail(item) {
this.currentItem = item;
this.$refs.popup.open();
console.log(item.warehouseList)
this.warehouseTaskList = item.warehouseList || [];
},

View File

@@ -116,9 +116,9 @@
</view> -->
<!-- 明细列表 -->
<uni-list v-if="warehouseTaskList.length > 0" border="false">
<uni-list v-if="warehouseTaskList.length > 0" :border="false">
<uni-list-item class="detail-item" v-for="(item, index) in warehouseTaskList" :key="index">
<view class="detail-content">
<view class="detail-content" slot="body">
<view class="detail-title">
<text class="item-num">{{ index + 1 }}.</text>
<text class="item-name">{{ item.warehouseName }}</text>

View File

@@ -82,10 +82,10 @@
<view class="detail-scroll">
<view class="detail-document">
<!-- 明细列表 -->
<uni-list v-if="warehouseTaskList.length > 0" border="false">
<uni-list v-if="warehouseTaskList.length > 0" :border="false">
<checkbox-group @change="checkboxChange">
<uni-list-item class="detail-item" v-for="(item, index) in warehouseTaskList" :key="index">
<view class="detail-content">
<view class="detail-content" slot="body">
<view class="detail-title">
<view class="">
<text class="item-num">{{ index + 1 }}.</text>

View File

@@ -78,3 +78,7 @@
## 5.2.2
+ 为部分页面新增文件预览功能(审批页面和任务页面)
## 5.2.3
+ 办公审批增加拨款申请
+ 修复仓储模块的显示bug