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 = () => {
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()
})
}
@ -96,7 +96,6 @@ class CityConfig extends React.Component<any, any> {
actionRef={this.actionRef}
rowKey="id"
headerTitle="城市信息配置"
maxLength={5}
scroll={{
x: 960,
}}

View File

@ -1,20 +1,28 @@
import React from "react";
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 axiosInstance from "../../../utils/axiosInstance";
class OtherConfig extends React.Component<any, any> {
refresh = () => {
//TODO: refresh
this.setState({forced: true, limit: 0, activated: true})
axiosInstance.get("management/properties").then((res) => {
console.log(res.data)
this.setState({
forced: res.data.approvalLimit === 0,
limit: res.data.approvalLimit / 100.0,
activated: true
})
})
}
submit = () => {
//TODO: submit
let limit = this.state.limit * 100
if (this.state.forced) {
limit = 0
}
axiosInstance.put("management/properties", {approvalLimit: limit}).then((res) => {
this.refresh()
})
}
constructor(props: any) {
@ -25,6 +33,7 @@ class OtherConfig extends React.Component<any, any> {
forced: true,
refresh: this.refresh
}
this.refresh()
}
static getDerivedStateFromProps(props: any, state: any) {
@ -64,7 +73,7 @@ class OtherConfig extends React.Component<any, any> {
this.refresh()
}}><RedoOutlined/></Button>
<Button style={{marginLeft: 60}} type={"default"} onClick={() => {
this.submit()
}}></Button>
</Row>
</div>

View File

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