feat: 电子签署集成到合同管理和离职流程

- 合同管理:选择电子签署时保存后自动创建ESignRecord并关联合同ID
- 离职管理:工作交接清单「离职文件签署」步骤增加「发起电子签署」按钮
- 电子签署页面:列表增加来源标识(劳动合同/离职协议)
- 合同卡片:电子签署合同显示提示而非手动填写编号/链接
This commit is contained in:
freedakgmail
2026-08-05 07:34:01 +08:00
parent cce0c936bd
commit b9240ffe9b
3 changed files with 64 additions and 21 deletions
+23 -2
View File
@@ -2,12 +2,12 @@ import { useState, useMemo, useEffect } from 'react'
import { usePageSize } from '../hooks/usePageSize'
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { AlertTriangle, Check, ChevronRight, ChevronLeft, Shield, Info, Calculator, FileText, Printer, Trash2, List, Download, Plus, Edit, Send, CheckCircle, XCircle, Play, Ban, CheckCheck } from 'lucide-react'
import { AlertTriangle, Check, ChevronRight, ChevronLeft, Shield, Info, Calculator, FileText, Printer, Trash2, List, Download, Plus, Edit, Send, CheckCircle, XCircle, Play, Ban, CheckCheck, PenTool } from 'lucide-react'
import { Stepper } from '../components/ui/Stepper'
import { InlineAlert } from '../components/ui/InlineAlert'
import PageGuide from '../components/ui/PageGuide'
import jsPDF from 'jspdf'
import { rosterApi, terminationApi } from '../lib/api-services'
import { rosterApi, terminationApi, esignApi } from '../lib/api-services'
import { useAuthStore } from '../store/authStore'
import Card from '../components/ui/Card'
import Button from '../components/ui/Button'
@@ -1549,6 +1549,27 @@ export default function Termination() {
placeholder="备注说明(选填)"
className="text-xs"
/>
{item.key === 'docs_signed' && employeeId && (
<Button
size="sm"
variant="secondary"
onClick={async () => {
try {
await esignApi.create({
employeeId,
documentTitle: '离职协议',
remark: '离职流程中发起',
})
queryClient.invalidateQueries({ queryKey: ['esign-records'] })
toast.success('离职协议电子签署已发起')
} catch {
toast.error('发起签署失败')
}
}}
>
<PenTool className="w-3.5 h-3.5 mr-1" />
</Button>
)}
</div>
))}
<div className="flex items-center gap-2 text-xs text-gray-500">