对齐了新增报销的表单

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

View File

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

View File

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