diff --git a/src/pages/configuration/subpage/CityConfig.tsx b/src/pages/configuration/subpage/CityConfig.tsx index 3ea1ecb..0c323d3 100644 --- a/src/pages/configuration/subpage/CityConfig.tsx +++ b/src/pages/configuration/subpage/CityConfig.tsx @@ -58,7 +58,7 @@ class CityConfig extends React.Component { } 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 { actionRef={this.actionRef} rowKey="id" headerTitle="城市信息配置" - maxLength={5} scroll={{ x: 960, }} diff --git a/src/pages/configuration/subpage/OtherConfig.tsx b/src/pages/configuration/subpage/OtherConfig.tsx index 2755fbd..3486219 100644 --- a/src/pages/configuration/subpage/OtherConfig.tsx +++ b/src/pages/configuration/subpage/OtherConfig.tsx @@ -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 { 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 - - this.refresh() + 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 { forced: true, refresh: this.refresh } + this.refresh() } static getDerivedStateFromProps(props: any, state: any) { @@ -64,7 +73,7 @@ class OtherConfig extends React.Component { this.refresh() }}> diff --git a/src/pages/reimbursement/approval/ReimbursementApproval.tsx b/src/pages/reimbursement/approval/ReimbursementApproval.tsx index 8578c2e..a346c71 100644 --- a/src/pages/reimbursement/approval/ReimbursementApproval.tsx +++ b/src/pages/reimbursement/approval/ReimbursementApproval.tsx @@ -44,7 +44,7 @@ class ReimbursementTab extends React.Component { { title: '申请人', - width: 60, + width: 80, dataIndex: 'uploaderName', search: false, sorter: false, @@ -53,14 +53,14 @@ class ReimbursementTab extends React.Component { }, { 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 { }, { title: '总金额', - width: 60, + width: 80, dataIndex: 'amount', search: false, render: (_, item) => @@ -83,7 +83,7 @@ class ReimbursementTab extends React.Component { }, { title: '状态', - width: 80, + width: 100, dataIndex: 'status', filters: true, onFilter: false, @@ -103,7 +103,7 @@ class ReimbursementTab extends React.Component { }, { title: '申请时间', - width: 80, + width: 120, dataIndex: 'submitDateTime', valueType: 'dateTime', search: false, @@ -235,7 +235,11 @@ class ReimbursementTab extends React.Component { 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"