diff --git a/src/pages/reimbursement/mine/ReimbursementCreate.tsx b/src/pages/reimbursement/mine/ReimbursementCreate.tsx index 3596448..b0baadf 100644 --- a/src/pages/reimbursement/mine/ReimbursementCreate.tsx +++ b/src/pages/reimbursement/mine/ReimbursementCreate.tsx @@ -22,7 +22,8 @@ import {invoiceTypeNameMap} from "../../../models/Invoice"; import SingleInvoiceSelector from "./component/SingleInvoiceSelector"; import MultiInvoiceSelector from "./component/MultiInvoiceSelector"; import {ActionType, StatisticCard} from "@ant-design/pro-components"; -import {openNotification} from "./utils"; +import {openNotification, openErrorNotification} from "./utils"; +import {NotificationPlacement} from "antd/es/notification/interface"; const {Operation} = StatisticCard; @@ -132,12 +133,24 @@ class ReimbursementCreate extends React.Component { submitCheck = () => { //TODO: check - return {ok: true, msg: ""} + let msgContent:string = "" + if(this.state.departureName == "" ) { + msgContent = "未填写出发地" + } else if(this.state.destinationName == "") { + msgContent = "未填写目的地" + } else if(this.state.departureInvoice == null) { + msgContent = "未上传出发票据" + } else if(this.state.selectedDepartment == null || this.state.selectedDepartment.isEmpty()) { + msgContent = "未选择报销部门" + } else { + return {ok: true, msg: ""} + } + return {ok: false, msg: msgContent} } submit = () => { let checkResult = this.submitCheck() if (!checkResult.ok) { - openNotification(checkResult.msg) + openErrorNotification(checkResult.msg) return } let params = { diff --git a/src/pages/reimbursement/mine/utils.ts b/src/pages/reimbursement/mine/utils.ts index 1f84ffc..b85f18d 100644 --- a/src/pages/reimbursement/mine/utils.ts +++ b/src/pages/reimbursement/mine/utils.ts @@ -8,4 +8,10 @@ export const openNotification = (hint: string) => { console.log('Notification Clicked!'); }, }); -}; \ No newline at end of file +}; + +export const openErrorNotification = (placement: string) => { + notification.error({ + message: `${placement}` + }); +} \ No newline at end of file