diff --git a/ruoyi-ui/src/views/loanPricing/workflow/detail.vue b/ruoyi-ui/src/views/loanPricing/workflow/detail.vue
index 5d7bf02..40e2479 100644
--- a/ruoyi-ui/src/views/loanPricing/workflow/detail.vue
+++ b/ruoyi-ui/src/views/loanPricing/workflow/detail.vue
@@ -3,25 +3,39 @@
-
-
+
@@ -72,6 +86,37 @@ export default {
/** 返回上一页 */
goBack() {
this.$router.go(-1)
+ },
+ /** 打印流程详情 */
+ handlePrint() {
+ this.$nextTick(() => {
+ const originalTitle = document.title
+ document.title = this.buildPrintFileName()
+ window.print()
+ document.title = originalTitle
+ })
+ },
+ /** 生成打印文件名 */
+ buildPrintFileName() {
+ const custName = this.sanitizePrintFileName(this.workflowDetail?.custName || '流程详情')
+ return `${custName}_${this.formatPrintTimestamp(new Date())}`
+ },
+ /** 格式化打印时间戳 */
+ formatPrintTimestamp(date) {
+ const pad = value => String(value).padStart(2, '0')
+ return [
+ date.getFullYear(),
+ pad(date.getMonth() + 1),
+ pad(date.getDate())
+ ].join('') + [
+ pad(date.getHours()),
+ pad(date.getMinutes()),
+ pad(date.getSeconds())
+ ].join('')
+ },
+ /** 清理文件名中的非法字符 */
+ sanitizePrintFileName(value) {
+ return String(value).replace(/[\\/:*?"<>|]/g, '').trim() || '流程详情'
}
}
}
@@ -92,6 +137,96 @@ export default {
font-weight: 500;
color: #303133;
}
+
+ .page-actions {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+ }
+}
+
+
+