Merge remote-tracking branch 'origin/main'
commit
37541eb53b
|
@ -22,7 +22,8 @@ import {invoiceTypeNameMap} from "../../../models/Invoice";
|
||||||
import SingleInvoiceSelector from "./component/SingleInvoiceSelector";
|
import SingleInvoiceSelector from "./component/SingleInvoiceSelector";
|
||||||
import MultiInvoiceSelector from "./component/MultiInvoiceSelector";
|
import MultiInvoiceSelector from "./component/MultiInvoiceSelector";
|
||||||
import {ActionType, StatisticCard} from "@ant-design/pro-components";
|
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;
|
const {Operation} = StatisticCard;
|
||||||
|
|
||||||
|
@ -132,12 +133,24 @@ class ReimbursementCreate extends React.Component<any, any> {
|
||||||
|
|
||||||
submitCheck = () => {
|
submitCheck = () => {
|
||||||
//TODO: check
|
//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 = () => {
|
submit = () => {
|
||||||
let checkResult = this.submitCheck()
|
let checkResult = this.submitCheck()
|
||||||
if (!checkResult.ok) {
|
if (!checkResult.ok) {
|
||||||
openNotification(checkResult.msg)
|
openErrorNotification(checkResult.msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let params = {
|
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