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

This commit is contained in:
2026-04-22 13:10:58 +08:00
parent 3db80e5ff7
commit 244dc8a056
6 changed files with 287 additions and 43 deletions

View File

@@ -51,9 +51,32 @@
:is="currentDetailComponent"
:bizId="bizId"
v-if="bizId && bizType"
@early-end="handleTravelEarlyEnd"
></component>
<view class="approval-btn-bar" v-if="canApprove">
<view class="detail-action-bar" v-if="canTravelEarlyEnd">
<button class="btn early-end-btn" @click="handleTravelEarlyEnd">提前结束</button>
</view>
<view class="seal-inline-card" v-if="canSealApprove">
<view class="seal-inline-head">
<text class="seal-inline-title">用印签章审批</text>
<text class="seal-inline-subtitle">当前申请已绑定印章{{ sealTypeLabel }}</text>
</view>
<view class="seal-form-row">
<text class="seal-form-label">签章页码</text>
<input class="seal-form-input" type="number" v-model="sealStampForm.pageNo" :placeholder="sealPageHint" />
</view>
<view class="seal-form-row seal-form-row--info">
<text class="seal-form-label">PDF页数</text>
<text class="seal-form-value">{{ sealPageTotal || '-' }}</text>
</view>
<view class="seal-form-actions">
<button class="btn approve-btn" @click="submitSealStamp">签章通过</button>
</view>
</view>
<view class="approval-btn-bar" v-if="canApprove && bizType !== 'seal'">
<button class="btn reject-btn" @click="handleReject">驳回</button>
<button class="btn approve-btn" @click="handleApprove">通过</button>
</view>
@@ -71,6 +94,8 @@
rejectFlowTask,
getFlowTaskDetailByBiz,
} from '@/api/hrm/flow';
import { earlyEndTravelReq } from '@/api/hrm/travel';
import { stampSealJava, getSealPdfPages } from '@/api/hrm/seal';
export default {
components: {
@@ -91,7 +116,17 @@
seal: 'HRMSealDetail',
travel: 'HRMTravelDetail',
appropriation: 'HRMAppropriationDetail'
}
},
sealStampPresets: [
{ key: 'left-bottom', label: '山东福安德信息科技有限公司采购部专用章FAD201400201.png', preview: 'http://49.232.154.205:10900/fad-oa/files%2Fstamp%2F山东福安德信息科技有限公司采购部专用章FAD201400201.png' },
{ key: 'center-bottom', label: '山东福安德信息科技有限公司采购部专用章FAD201400202.png', preview: 'http://49.232.154.205:10900/fad-oa/files%2Fstamp%2F山东福安德信息科技有限公司采购部专用章FAD201400202.png' },
{ key: 'right-bottom', label: '山东福安德信息科技有限公司采购部专用章FAD201400401.png', preview: 'http://49.232.154.205:10900/fad-oa/files%2Fstamp%2F山东福安德信息科技有限公司采购部专用章FAD201400401.png' }
],
sealStampForm: {
position: 'right-bottom',
pageNo: 1
},
sealPageTotal: 0
}
},
computed: {
@@ -106,6 +141,18 @@
(this.currentTask?.assigneeUserName === this.$store.getters.storeOaName
|| this.currentTask?.assigneeUserId === this.$store.getters.storeOaId)
},
canSealApprove() {
return this.bizType === 'seal' && this.canApprove;
},
sealPageHint() {
return this.sealPageTotal > 0 ? `1-${this.sealPageTotal}` : '1-1';
},
sealTypeLabel() {
return this.detailData?.sealType || '-';
},
canTravelEarlyEnd() {
return this.bizType === 'travel' && this.detailData?.actualEndTime == null;
},
assigneeText() {
return this.currentTask?.assigneeNickName || this.currentTask?.assigneeUserName || this.currentTask?.assigneeUserId || '-';
}
@@ -134,7 +181,8 @@
rejected: '已驳回',
reject: '已驳回',
withdraw: '已撤回',
withdrawn: '已撤回'
withdrawn: '已撤回',
finished: '已结束'
};
return map[status] || status || '-';
},
@@ -191,6 +239,56 @@
}
}
});
},
async fetchSealPageTotal() {
try {
const res = await getSealPdfPages(this.bizId);
this.sealPageTotal = Number(res?.data || 0);
} catch (e) {
this.sealPageTotal = 0;
}
},
submitSealStamp() {
const pageNo = Number(this.sealStampForm.pageNo) || 1;
const payload = {
pageNo,
xPx: 120,
yPx: 120,
viewportWidth: 750,
viewportHeight: 1334
};
stampSealJava(this.bizId, payload)
.then(() => {
uni.showToast({ title: '签章成功', icon: 'none' });
setTimeout(() => uni.navigateBack(), 1000);
})
.catch(err => {
console.error('签章失败:', err);
uni.showToast({ title: '签章失败', icon: 'none' });
});
},
handleTravelEarlyEnd() {
if (!this.canTravelEarlyEnd) {
uni.showToast({ title: '当前出差已结束', icon: 'none' });
return;
}
const bizId = this.bizId;
uni.showModal({
title: '提前结束出差',
content: '确认提前结束该出差吗?',
success: (res) => {
if (!res.confirm) return;
earlyEndTravelReq(bizId)
.then(() => {
uni.showToast({ title: '提前结束成功', icon: 'none' });
setTimeout(() => uni.navigateBack(), 1200);
})
.catch(err => {
console.error('提前结束失败:', err);
uni.showToast({ title: '提前结束失败', icon: 'none' });
});
}
});
}
},
onLoad(options) {
@@ -199,6 +297,9 @@
if (!this.bizId || !this.bizType) {
uni.showToast({ title: '参数缺失,无法加载详情', icon: 'none' });
}
if (this.bizType === 'seal') {
this.fetchSealPageTotal();
}
}
}
</script>
@@ -256,8 +357,10 @@
.timeline-header, .timeline-meta { display:flex; justify-content:space-between; gap: 16rpx; font-size:24rpx; color:#6b7280; }
.timeline-name { color:#111827; font-weight:600; }
.timeline-remark { margin-top: 8rpx; color:#374151; font-size:26rpx; }
.detail-action-bar { display: flex; justify-content: center; margin: 24rpx 0; }
.approval-btn-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; padding: 20rpx; background-color: #fff; border-top: 1px solid #eee; z-index: 99; }
.btn { flex: 1; height: 88rpx; line-height: 88rpx; border-radius: 44rpx; font-size: 32rpx; border: none; margin: 0 10rpx; }
.early-end-btn { flex: none; min-width: 260rpx; background-color: #007aff; color: #fff; }
.reject-btn { background-color: #fff; color: #ff4757; border: 1px solid #ff4757; }
.approve-btn { background-color: #007aff; color: #fff; }
</style>

View File

@@ -21,7 +21,11 @@ export default {
initialForm: { sealType: '', applyFileIds: '', reason: '', remark: '' },
sections: [
{ key: 'basic', title: '基础信息', fields: [
{ key: 'sealType', label: '用印类型', type: 'select', required: true, placeholder: '请选择用印类型', options: ['合同用印', '公章', '财务章', '法人章', '其他'] },
{ key: 'sealType', label: '用印类型', type: 'select', required: true, placeholder: '请选择用印类型', options: [
'山东福安德信息科技有限公司采购部专用章FAD201400201.png',
'山东福安德信息科技有限公司采购部专用章FAD201400202.png',
'山东福安德信息科技有限公司采购部专用章FAD201400401.png'
] },
{ key: 'applyFileIds', label: '附件', type: 'file', required: true, placeholder: '上传盖章文件', accept: '.pdf' }
]},
{ key: 'desc', title: '说明', fields: [