Merge remote-tracking branch 'origin/main' into main

main
wuyize 2023-01-06 16:07:22 +08:00
commit 6075f39949
3 changed files with 30 additions and 18 deletions

View File

@ -58,7 +58,7 @@ class CityConfig extends React.Component<any, any> {
} }
update = () => { update = () => {
axiosInstance.get("common/place").then((res) => { axiosInstance.get("common/place").then((res) => {
this.setState({tableData: this.convertor(res.data)}) this.setState({tableData: this.convertor(res.data),selectedRowKeys: []})
this.actionRef.current?.reload() this.actionRef.current?.reload()
}) })
} }
@ -96,7 +96,6 @@ class CityConfig extends React.Component<any, any> {
actionRef={this.actionRef} actionRef={this.actionRef}
rowKey="id" rowKey="id"
headerTitle="城市信息配置" headerTitle="城市信息配置"
maxLength={5}
scroll={{ scroll={{
x: 960, x: 960,
}} }}

View File

@ -1,20 +1,28 @@
import React from "react"; import React from "react";
import {Button, Col, Form, InputNumber, Row, Switch, Table} from "antd"; import {Button, Col, Form, InputNumber, Row, Switch, Table} from "antd";
import {ActionType} from "@ant-design/pro-components";
import {FormInstance} from "antd/es/form";
import Column from "antd/es/table/Column";
import RedoOutlined from "@ant-design/icons/lib/icons/RedoOutlined"; import RedoOutlined from "@ant-design/icons/lib/icons/RedoOutlined";
import axiosInstance from "../../../utils/axiosInstance";
class OtherConfig extends React.Component<any, any> { class OtherConfig extends React.Component<any, any> {
refresh = () => { refresh = () => {
//TODO: refresh axiosInstance.get("management/properties").then((res) => {
this.setState({forced: true, limit: 0, activated: true}) console.log(res.data)
this.setState({
forced: res.data.approvalLimit === 0,
limit: res.data.approvalLimit / 100.0,
activated: true
})
})
} }
submit = () => { submit = () => {
//TODO: submit let limit = this.state.limit * 100
if (this.state.forced) {
this.refresh() limit = 0
}
axiosInstance.put("management/properties", {approvalLimit: limit}).then((res) => {
this.refresh()
})
} }
constructor(props: any) { constructor(props: any) {
@ -25,6 +33,7 @@ class OtherConfig extends React.Component<any, any> {
forced: true, forced: true,
refresh: this.refresh refresh: this.refresh
} }
this.refresh()
} }
static getDerivedStateFromProps(props: any, state: any) { static getDerivedStateFromProps(props: any, state: any) {
@ -64,7 +73,7 @@ class OtherConfig extends React.Component<any, any> {
this.refresh() this.refresh()
}}><RedoOutlined/></Button> }}><RedoOutlined/></Button>
<Button style={{marginLeft: 60}} type={"default"} onClick={() => { <Button style={{marginLeft: 60}} type={"default"} onClick={() => {
this.submit()
}}></Button> }}></Button>
</Row> </Row>
</div> </div>

View File

@ -44,7 +44,7 @@ class ReimbursementTab extends React.Component<any, any> {
{ {
title: '申请人', title: '申请人',
width: 60, width: 80,
dataIndex: 'uploaderName', dataIndex: 'uploaderName',
search: false, search: false,
sorter: false, sorter: false,
@ -53,14 +53,14 @@ class ReimbursementTab extends React.Component<any, any> {
}, },
{ {
title: '行程', title: '行程',
width: 60, width: 100,
dataIndex: 'OD', dataIndex: 'OD',
search: false, search: false,
render: (_, row) => <>{row.OD[0] + (row.back ? " ⇌ " : " → ") + row.OD[1]}</>, render: (_, row) => <>{row.OD[0] + (row.back ? " ⇌ " : " → ") + row.OD[1]}</>,
}, },
{ {
title: '出发日期', title: '出发日期',
width: 70, width: 80,
dataIndex: 'beginDate', dataIndex: 'beginDate',
search: false, search: false,
valueType: 'date', valueType: 'date',
@ -69,7 +69,7 @@ class ReimbursementTab extends React.Component<any, any> {
}, },
{ {
title: '总金额', title: '总金额',
width: 60, width: 80,
dataIndex: 'amount', dataIndex: 'amount',
search: false, search: false,
render: (_, item) => render: (_, item) =>
@ -83,7 +83,7 @@ class ReimbursementTab extends React.Component<any, any> {
}, },
{ {
title: '状态', title: '状态',
width: 80, width: 100,
dataIndex: 'status', dataIndex: 'status',
filters: true, filters: true,
onFilter: false, onFilter: false,
@ -103,7 +103,7 @@ class ReimbursementTab extends React.Component<any, any> {
}, },
{ {
title: '申请时间', title: '申请时间',
width: 80, width: 120,
dataIndex: 'submitDateTime', dataIndex: 'submitDateTime',
valueType: 'dateTime', valueType: 'dateTime',
search: false, search: false,
@ -235,7 +235,11 @@ class ReimbursementTab extends React.Component<any, any> {
else if (this.state.mode === 1) else if (this.state.mode === 1)
url = "approval/reimbursement/history" url = "approval/reimbursement/history"
else { else {
if (store.getState().staff.managingDepartment?.departmentId !== 1) { let d1 = store.getState().staff.managingDepartment
let d2 = store.getState().staff.staffDepartments
if ((d1 && d1.departmentId === 1) || (d2 && d2.find((value, index, obj) => value.departmentId === 1))) {
} else {
params['reimbursementSubmitDepartments'] = store.getState().staff.managingDepartment?.departmentId params['reimbursementSubmitDepartments'] = store.getState().staff.managingDepartment?.departmentId
} }
url = "common/reimbursement" url = "common/reimbursement"