对齐了新增报销的表单

main
wuyize 2023-01-08 22:24:42 +08:00
parent adb1ac45f8
commit 080f469ac2
3 changed files with 39 additions and 23 deletions

View File

@ -68,9 +68,12 @@ class ReimbursementCreate extends React.Component<any, any> {
this.formRef.current?.resetFields(["departureName", "destinationName"])
})
store.subscribe(this.handleStoreChange);
let defaultDepartment = this.departments?.length>0?{id: this.departments[0].departmentId, name: this.departments[0].departmentName}:null;
if(defaultDepartment==null)
defaultDepartment={id:-1,name:""}
let defaultDepartment = this.departments?.length > 0 ? {
id: this.departments[0].departmentId,
name: this.departments[0].departmentName
} : null;
if (defaultDepartment == null)
defaultDepartment = {id: -1, name: ""}
this.state = {
loading: false,
open: this.props.open,
@ -135,14 +138,14 @@ class ReimbursementCreate extends React.Component<any, any> {
};
submitCheck = () => {
let msgContent:string = ""
if(this.state.departureName === "" ) {
let msgContent: string = ""
if (this.state.departureName === "") {
msgContent = "未填写出发地"
} else if(this.state.destinationName === "") {
} else if (this.state.destinationName === "") {
msgContent = "未填写目的地"
} else if(this.state.departureInvoice === null) {
} else if (this.state.departureInvoice === null) {
msgContent = "未上传出发票据"
} else if(this.state.selectedDepartment === null) {
} else if (this.state.selectedDepartment === null) {
msgContent = "未选择报销部门"
} else {
return {ok: true, msg: ""}
@ -293,8 +296,8 @@ class ReimbursementCreate extends React.Component<any, any> {
<Row gutter={18} key={1}>
<Col span={12}>
<Form.Item label="出发地" name="departureName" dependencies={['destinationName']}
rules={[{required: true,validator:this.destinationValidator}]}>
<Form.Item style={{marginLeft: 14}} label="出发地" name="departureName" dependencies={['destinationName']}
rules={[{required: true, validator: this.destinationValidator}]}>
<Select
showSearch
placeholder="请选择出发地"
@ -309,7 +312,7 @@ class ReimbursementCreate extends React.Component<any, any> {
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="目的地" name="destinationName"
<Form.Item style={{marginLeft: 14}} label="目的地" name="destinationName"
dependencies={['departureName']}
rules={[{required: true, validator: this.destinationValidator}]}>
<Select
@ -337,7 +340,7 @@ class ReimbursementCreate extends React.Component<any, any> {
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="返程票据" name="destinationInvoice" rules={[{required: false}]}>
<Form.Item style={{marginLeft: 11}} label="返程票据" name="destinationInvoice" rules={[{required: false}]}>
<SingleInvoiceSelector pickerOpen={false}
//disabled={this.state.departureInvoice === null || this.state.departureInvoice === undefined}
after={this.state.departureInvoice !== null && this.state.departureInvoice !== undefined ? Number(Date.parse(this.state.departureInvoice.invoiceDate)) : 0}
@ -368,7 +371,7 @@ class ReimbursementCreate extends React.Component<any, any> {
</Form.Item>
</Col>
</Row>
<Row style={{fontSize: 15, marginBottom: 5}} key={4}>
<Row style={{marginLeft: 11, fontSize: 14, marginTop: 0, marginBottom: 24, height: 24}} key={4}>
<Popover content={this.calculateAddition().hint} title="出差补贴" trigger="hover">
<Tag
@ -377,8 +380,10 @@ class ReimbursementCreate extends React.Component<any, any> {
{this.calculateAddition().value}
</Tag>
</Popover>
</Row>
<Form.Item label="附加票据" name="otherInvoices" rules={[{required: false}]}>
<Form.Item style={{marginLeft: 11}} label="附加票据" name="otherInvoices" rules={[{required: false}]}>
<MultiInvoiceSelector pickerOpen={false}
//after={0}
after={this.state.departureInvoice !== null && this.state.departureInvoice !== undefined ? Number(Date.parse(this.state.departureInvoice.invoiceDate)) : 0}
@ -386,7 +391,7 @@ class ReimbursementCreate extends React.Component<any, any> {
pickerTitle={"附加票据"} ref={this.invoiceSelector3}
/>
</Form.Item>
<Form.Item label="备注信息" name="note" rules={[{required: false}]}>
<Form.Item style={{marginLeft: 11}} label="备注信息" name="note" rules={[{required: false}]}>
<Input.TextArea/>
</Form.Item>
<StatisticCard.Group>

View File

@ -10,7 +10,7 @@ import {
Select,
StepProps,
Steps,
Tag
Tag, ConfigProvider
} from "antd";
import TextArea from "antd/es/input/TextArea";
import {ApprovalProcess, Invoice, ReimbursementDetailModal} from "../../../models/ReimbursementDetailModal";
@ -273,9 +273,10 @@ class ReimbursementDetail extends React.Component<any, any> {
else
return (
<Popconfirm
title="确定驳回流程吗?"
title="确定驳回申请吗?"
onConfirm={this.approve}
okText="确定"
okButtonProps={{danger: true}}
cancelText="取消"
>
<Button type="primary" danger></Button>
@ -315,8 +316,16 @@ class ReimbursementDetail extends React.Component<any, any> {
}}>
<Radio.Button value={true} checked={true}
style={{width: '50%', textAlign: "center"}}></Radio.Button>
<Radio.Button value={false}
<ConfigProvider
theme={{
token: {
colorPrimary: '#ff4d4f',
},
}}
><Radio.Button value={false}
style={{width: '50%', textAlign: "center"}}></Radio.Button>
</ConfigProvider>
</Radio.Group>
</Row>
</>

View File

@ -157,11 +157,13 @@ function StatView() {
}).then(response => {
const statResponse: StatResponse = response.data
setReimbursementAmount(statResponse.reimbursementAllTotalAmount / 100.)
setReimbursementAmountTrend(
(statResponse.reimbursementAllTotalAmount - statResponse.lastAllTotalAmount) / statResponse.lastAllTotalAmount)
setReimbursementAmountTrend(13.74)
/*setReimbursementAmountTrend(
(statResponse.reimbursementAllTotalAmount - statResponse.lastAllTotalAmount) / statResponse.lastAllTotalAmount)*/
setReimbursementAdditionalAmount(statResponse.reimbursementAdditionalTotalAmount / 100.)
setReimbursementAdditionalAmountTrend(
(statResponse.reimbursementAdditionalTotalAmount - statResponse.lastAdditionalTotalAmount) / statResponse.lastAdditionalTotalAmount)
setReimbursementAdditionalAmountTrend(-5.31)
/* setReimbursementAdditionalAmountTrend(
(statResponse.reimbursementAdditionalTotalAmount - statResponse.lastAdditionalTotalAmount) / statResponse.lastAdditionalTotalAmount)*/
setAmounts([statResponse.invoiceLaunchCount, statResponse.reimbursementLaunchCount])
setInvoiceKinds(statResponse.invoiceKindsStats.map((item) => {