diff --git a/src/pages/reimbursement/mine/MyReimbursement.tsx b/src/pages/reimbursement/mine/MyReimbursement.tsx index a6231f4..793bc74 100644 --- a/src/pages/reimbursement/mine/MyReimbursement.tsx +++ b/src/pages/reimbursement/mine/MyReimbursement.tsx @@ -339,7 +339,7 @@ class Subpage extends React.Component { <> actionRef={this.tableAction} diff --git a/src/pages/reimbursement/mine/ReimbursementDetail.tsx b/src/pages/reimbursement/mine/ReimbursementDetail.tsx index f3f29af..ad10682 100644 --- a/src/pages/reimbursement/mine/ReimbursementDetail.tsx +++ b/src/pages/reimbursement/mine/ReimbursementDetail.tsx @@ -1,5 +1,5 @@ import React, {ReactNode} from "react"; -import {Button, Col, Descriptions, Modal, Popconfirm, Popover, Row, StepProps, Steps, Tag} from "antd"; +import {Button, Checkbox, Col, Descriptions, Modal, Popconfirm, Popover, Row, StepProps, Steps, Tag} from "antd"; import TextArea from "antd/es/input/TextArea"; import {ApprovalProcess, Invoice, ReimbursementDetailModal} from "../../../models/ReimbursementDetailModal"; import dayjs, {Dayjs} from "dayjs"; @@ -76,7 +76,7 @@ function displayRawInfo(reimbursement: ReimbursementDetailModal | undefined | nu ) } -function displaySteps(reimbursement: ReimbursementDetailModal | undefined | null) { +function displaySteps(reimbursement: ReimbursementDetailModal | undefined | null, onApprove:boolean) { if (reimbursement == undefined) return null; let currentStep = 0; @@ -84,86 +84,90 @@ function displaySteps(reimbursement: ReimbursementDetailModal | undefined | null title: '提交申请', status: 'finish', subTitle: reimbursement.reimbursementSubmitTime.replace("T", " "), - description: reimbursement.reimbursementSubmitStaff.staffName + "提交申请", + description: "【" + reimbursement.reimbursementSubmitStaff.staffName + "】" + "提交申请", }]; let approvalSteps = reimbursement.approvalProcesses; if (approvalSteps == null) approvalSteps = [] for (let i = 0; i < approvalSteps.length; i++) { if (approvalSteps[i].approvalResult === i) { - let description:string|ReactNode = approvalSteps[i].approvalStaff.staffName + "审批通过"; - if (approvalSteps[i].approvalOpinion != null && approvalSteps[i].approvalOpinion !== ""){ - description=(<>{approvalSteps[i].approvalStaff.staffName + "审批通过"}) + let description: string | ReactNode = approvalSteps[i].approvalStaff.staffName + "】" + "审批通过"; + if (approvalSteps[i].approvalOpinion != null && approvalSteps[i].approvalOpinion !== "") { + description = (<>{approvalSteps[i].approvalStaff.staffName + "】" + "审批通过"}) } items.push({ // @ts-ignore title: statusEnum2[i - 1] + "审批", status: 'finish', subTitle: approvalSteps[i].approvalTime.replace("T", " "), - description:description + description: description }) } } if (reimbursement.reimbursementStatus >= 1 && reimbursement.reimbursementStatus <= 4) { items.push({ // @ts-ignore - title: statusEnum[reimbursement.reimbursementStatus].text, + title: statusEnum2[approvalSteps.length] + "审批", status: 'process', - subTitle: "审批中", + subTitle: onApprove?"请您审批":"审批中", description: "", }) - currentStep = items.length - 1; + currentStep = items.length - 2; } else if (reimbursement.reimbursementStatus === 0) { items.push({ title: '通知出纳', status: 'finish', - description: "出纳已收到申请", + description: "报销申请成功", }) currentStep = items.length - 1; } else if (reimbursement.reimbursementStatus === 5) { for (let i = 0; i < approvalSteps.length; i++) { if (approvalSteps[i].approvalResult === 5) { - let description:string|ReactNode = approvalSteps[i].approvalStaff.staffName + "驳回申请"; - if (approvalSteps[i].approvalOpinion != null && approvalSteps[i].approvalOpinion !== ""){ - description=(<>{approvalSteps[i].approvalStaff.staffName + "驳回申请"}) + let description: string | ReactNode = "【" + approvalSteps[i].approvalStaff.staffName + "】" + "驳回申请"; + if (approvalSteps[i].approvalOpinion != null && approvalSteps[i].approvalOpinion !== "") { + description = (<>{"【" + approvalSteps[i].approvalStaff.staffName + "】" + "驳回申请"}) } items.push({ // @ts-ignore title: statusEnum2[i - 1] + "审批", status: 'error', subTitle: approvalSteps[i].approvalTime.replace("T", " "), - description:description + description: description }) } } currentStep = items.length - 1; } else if (reimbursement.reimbursementStatus === 6) { - items.push({ - title: '申请人终止', - status: 'error', - subTitle: reimbursement.reimbursementSubmitStaff.staffName + "终止申请", - }) - currentStep = items.length - 1; - let nextLevel: string = "主管" - if (reimbursement.approvalProcesses !== null && reimbursement.approvalProcesses !== undefined) { - // @ts-ignore - nextLevel = statusEnum2[reimbursement.approvalProcesses.length] + for (let i = 0; i < approvalSteps.length; i++) { + if (approvalSteps[i].approvalResult === 6) { + items.push({ + title: '申请终止', + status: 'error', + subTitle: approvalSteps[i].approvalTime.replace("T", " "), + description: "【" + reimbursement.reimbursementSubmitStaff.staffName + "】" + "终止申请", + }) + currentStep = items.length - 1; + } } items.push({ - title: nextLevel + '审批', + // @ts-ignore + title: statusEnum2[approvalSteps.length - 1] + '审批', status: 'wait', subTitle: "", }) } + console.log(items, currentStep) return ( <> { return <> } } + checkerMenu = () => { + if (this.props.accessLevel === 1) { + return (<> +