Commit afb73ee3 by 李伟康

feat(template-import): 更新模板导入的审批链为两级审批

修改提交确认卡片中的审批链标签与描述
更新审批链预览组件:新增二级审批节点,移除未使用的 chainType 参数,更新组件注释与默认节点逻辑
1 parent 788f01c2
...@@ -97,7 +97,6 @@ function NodeLine({ status }: { status: ChainNodeStatus }) { ...@@ -97,7 +97,6 @@ function NodeLine({ status }: { status: ChainNodeStatus }) {
export interface ApprovalChainPreviewProps { export interface ApprovalChainPreviewProps {
nodes?: ChainNode[]; nodes?: ChainNode[];
chainType?: string;
/** (可选)覆盖默认的提交人名称。不传则取当前登录用户名 */ /** (可选)覆盖默认的提交人名称。不传则取当前登录用户名 */
submitterName?: string; submitterName?: string;
/** (可选)覆盖默认的提交时间,格式 YYYY-MM-DD HH:mm */ /** (可选)覆盖默认的提交时间,格式 YYYY-MM-DD HH:mm */
...@@ -105,10 +104,11 @@ export interface ApprovalChainPreviewProps { ...@@ -105,10 +104,11 @@ export interface ApprovalChainPreviewProps {
} }
/** /**
* 生成默认 3 节点审批链: * 生成默认 4 节点审批链:
* - 第 1 个节点「提交」:副标题 = 当前登录用户名(外部 prop 覆盖优先);时间 = submitTime 或 DEFAULT_SUBMIT_TIME * - 第 1 个节点「提交」:副标题 = 当前登录用户名(外部 prop 覆盖优先);时间 = submitTime 或 DEFAULT_SUBMIT_TIME
* - 第 2 个节点「优加财务经理」:唯一审批节点 * - 第 2 个节点「优加商务经理」:当前审批节点(active)
* - 第 3 个节点「生效」:写入门店列表 * - 第 3 个节点「优加财务经理」:下一审批节点(pending)
* - 第 4 个节点「生效」:写入门店列表
*/ */
function buildDefaultNodes(submitter: string, time: string): ChainNode[] { function buildDefaultNodes(submitter: string, time: string): ChainNode[] {
return [ return [
...@@ -120,8 +120,13 @@ function buildDefaultNodes(submitter: string, time: string): ChainNode[] { ...@@ -120,8 +120,13 @@ function buildDefaultNodes(submitter: string, time: string): ChainNode[] {
}, },
{ {
status: 'active', status: 'active',
title: '优加商务经理',
subtitle: '当前审批节点',
},
{
status: 'pending',
title: '优加财务经理', title: '优加财务经理',
subtitle: '唯一审批节点', subtitle: '下一审批节点',
}, },
{ {
status: 'pending', status: 'pending',
...@@ -133,7 +138,6 @@ function buildDefaultNodes(submitter: string, time: string): ChainNode[] { ...@@ -133,7 +138,6 @@ function buildDefaultNodes(submitter: string, time: string): ChainNode[] {
export function ApprovalChainPreview({ export function ApprovalChainPreview({
nodes, nodes,
chainType = '单级审批',
submitterName, submitterName,
submitTime, submitTime,
}: ApprovalChainPreviewProps) { }: ApprovalChainPreviewProps) {
...@@ -153,11 +157,6 @@ export function ApprovalChainPreview({ ...@@ -153,11 +157,6 @@ export function ApprovalChainPreview({
<span style={{ fontSize: 15, fontWeight: 600 }}>审批链预览</span> <span style={{ fontSize: 15, fontWeight: 600 }}>审批链预览</span>
</div> </div>
} }
extra={
<UTag color="default" bordered style={{ fontSize: 12 }}>
{chainType}
</UTag>
}
> >
<div style={{ display: 'flex', padding: '20px 8px 8px' }}> <div style={{ display: 'flex', padding: '20px 8px 8px' }}>
{finalNodes.map((n, i) => ( {finalNodes.map((n, i) => (
......
...@@ -44,19 +44,18 @@ function buildInfoFromCheckResult(vo: StoreImportCheckVO): SubmitConfirmInfo { ...@@ -44,19 +44,18 @@ function buildInfoFromCheckResult(vo: StoreImportCheckVO): SubmitConfirmInfo {
const monthly = Math.round(first?.costMonthly ?? 0); const monthly = Math.round(first?.costMonthly ?? 0);
const labor = Math.round(first?.costLabor ?? 0); const labor = Math.round(first?.costLabor ?? 0);
const total = deco + monthly + labor; const total = deco + monthly + labor;
const approvalRole = vo.nextRoleName ?? '优加财务经理'; const approvalRole = vo.nextRoleName ?? '-';
return { return {
storeName: vo.storeName ?? '巴州强冠东风汽车销售服务有限公司', storeName: vo.storeName ?? '-',
storeMerchantNo: vo.merchantNo ?? 'SQ20240115', storeMerchantNo: vo.merchantNo ?? '-',
categoryCount: vo.distinctProductCategoryCount ?? 6, categoryCount: vo.distinctProductCategoryCount ?? 6,
sceneCount: vo.distinctBusinessSceneCount ?? 2, sceneCount: vo.distinctBusinessSceneCount ?? 2,
totalRows: vo.productCategoryRowCount ?? vo.totalRows ?? 12, totalRows: vo.productCategoryRowCount ?? vo.totalRows ?? 12,
operatingCost: total > 0 ? `¥ ${total.toLocaleString('en-US')}` : '¥ 1,500.00', operatingCost: total > 0 ? `¥ ${total.toLocaleString('en-US')}` : '-',
operatingCostDetail: `门店维度字段(装修设备 ${deco} + 当月产生 ${monthly} + 人工成本 ${labor})`, operatingCostDetail: `门店维度字段(装修设备 ${deco} + 当月产生 ${monthly} + 人工成本 ${labor})`,
approvalChain: approvalRole, approvalChain: approvalRole,
approvalChainTag: '单级审批', approvalChainTag: '两级审批',
approvalChainDesc: '提交后直接进入单级审批,无中间节点', approvalChainDesc: '提交后直接进入两级审批,无中间节点',
// 预计审批人 = 当前提交人(登录用户名) + (审批角色)
expectedApprover: `${approvalRole}`, expectedApprover: `${approvalRole}`,
}; };
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!