增强办公,新增审批,缺少电子签章功能

This commit is contained in:
2026-04-20 15:56:29 +08:00
parent a026ef7a54
commit cd71a3a457
18 changed files with 1791 additions and 537 deletions

View File

@@ -1,81 +1,84 @@
<template>
<!-- 出差申请详情容器复用统一卡片样式 -->
<view class="reimburse-detail-container">
<!-- 出差类型 - 带分类图标 -->
<view class="leave-detail-container">
<view class="detail-item single-item">
<text class="item-icon icon-travel-type"></text>
<view class="item-label">拨款类型</view>
<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-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-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-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-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-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-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-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>
<text class="item-icon icon-date"></text>
<view class="item-label">申请时间</view>
<view class="item-value">{{ formatTime(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">
<text class="item-icon icon-date"></text>
<view class="item-label">附件</view>
<view class="item-value">
<view v-if="uploading" class="upload-loading">
<text class="loading-dot"></text>
<text class="loading-text">附件正在上传中...</text>
</view>
<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">
<view class="detail-item single-item amount-item" v-if="detail.projectId" @click="openPopup">
<text class="item-icon icon-creator"></text>
<view class="item-label">项目名称</view>
<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">
<view class="detail-item single-item amount-item" v-if="detail.projectId" @click="openPopup">
<text class="item-icon icon-creator"></text>
<view class="item-label">项目编号</view>
<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">
<view class="detail-item single-item amount-item" v-if="detail.projectId" @click="openPopup">
<text class="item-icon icon-creator"></text>
<view class="item-label">项目代号</view>
<view class="item-label">项目代号</view>
<view class="item-value">{{ detail.projectCode || '无' }}</view>
</view>
@@ -119,55 +122,113 @@
</template>
<script>
import {
getAppropriationReq
} from '@/api/hrm/appropriation.js'
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;
export default {
props: {
bizId: {
type: String,
required: true
}
},
data() {
return {
detail: {}
}
},
watch: {
bizId: {
handler(newVal) {
if (!newVal) return
getAppropriationReq(newVal)
.then(res => {
this.detail = res.data || {}
})
.catch(err => {
console.error('获取拨款详情失败:', err)
uni.showToast({ title: '获取详情失败', icon: 'none', duration: 2000 })
})
},
openPopup() {
this.$refs.popup.open()
}
immediate: true
}
},
methods: {
formatTime(timeStr) {
if (!timeStr) return ''
const [datePart] = timeStr.split(' ')
return datePart
},
openPopup() {
this.$refs.popup.open()
}
}
}
</script>
<style scoped>
.leave-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;
}
.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; }
.item-icon {
display: inline-block;
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
margin-top: 8rpx;
flex-shrink: 0;
color: #409eff;
font-family: "iconfont";
}
.icon-travel-type { content: "\e645"; }
.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-date { content: "\e637"; }
.item-label {
width: 160rpx;
font-size: 30rpx;
color: #909399;
font-weight: 500;
flex-shrink: 0;
padding-top: 2rpx;
}
.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; }
.detail-content {
border: 1px solid #ccc;
border-radius: 10px;
padding: 15px;
background-color: #f9f9f9;
}
.info-item { display: flex; justify-content: space-between; margin-top: 10px; }
.info-label { color: #333; font-weight: bold; }
.info-value { color: #666; }
</style>
<style scoped>
/* 主容器 - 与请假/报销/用印申请完全一致的卡片风格,精致阴影+大圆角+合理内边距 */
.reimburse-detail-container {

View File

@@ -134,10 +134,26 @@
},
methods: {
formatTime(timeStr) {
if (!timeStr) return '';
const [datePart] = timeStr.split(' ');
return datePart;
if (!timeStr) return ''
var str = String(timeStr).trim()
// 兼容后端常见时间格式:"2026-01-08 00:00:00" / "2026-01-08T00:00:00" / 时间戳
if (/^\d+$/.test(str)) {
var ts = Number(str)
if (!Number.isNaN(ts)) {
var d = new Date(ts)
if (!Number.isNaN(d.getTime())) {
return this.pad(d.getFullYear(), 4) + '-' + this.pad(d.getMonth() + 1) + '-' + this.pad(d.getDate())
}
}
}
str = str.replace('T', ' ')
var parts = str.split(' ')
return parts[0] || str
},
pad(n, len = 2) {
return String(n).padStart(len, '0')
},
openPopup() {
this.$refs.popup.open()
},

View File

@@ -43,9 +43,13 @@
<view class="item-value">{{ detail.updateBy || '无' }}</view>
</view>
<view class="detail-item single-item">
<text class="item-icon icon-date"></text>
<view class="item-label">附件</view>
<view class="item-value">
<text class="item-icon icon-date"></text>
<view class="item-label">附件</view>
<view class="item-value">
<view v-if="uploading" class="upload-loading">
<text class="loading-dot"></text>
<text class="loading-text">附件正在上传中...</text>
</view>
<oa-file-list :files="detail.accessoryApplyIds"></oa-file-list>
</view>
</view>