添加了报销单提交的check内容
parent
eb0d64b251
commit
7cad47c256
|
@ -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<any, any> {
|
|||
|
||||
submitCheck = () => {
|
||||
//TODO: check
|
||||
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 = {
|
||||
|
|
|
@ -9,3 +9,9 @@ export const openNotification = (hint: string) => {
|
|||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const openErrorNotification = (placement: string) => {
|
||||
notification.error({
|
||||
message: `${placement}`
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue