|
@@ -12,11 +12,13 @@ import {
|
|
|
Row,
|
|
|
Col,
|
|
|
Select,
|
|
|
+ Divider,
|
|
|
} from 'antd';
|
|
|
+import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
|
import { PageContainer } from '@ant-design/pro-components';
|
|
|
const { RangePicker } = DatePicker;
|
|
|
import { useRequest, useModel } from '@umijs/max';
|
|
|
-import { queryProfileList, queryApplyList } from '@/services/boom';
|
|
|
+import { queryProfileList, queryApplyList, applyRepeal } from '@/services/boom';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { queryContractCheck, queryGetContractList } from '@/services/contract';
|
|
|
import ContractModal, {
|
|
@@ -39,6 +41,7 @@ function Apply(props) {
|
|
|
const approveFormRef = useRef();
|
|
|
const [applyFormRef] = Form.useForm();
|
|
|
let navigate = useNavigate();
|
|
|
+
|
|
|
const contractResult = (res) => {
|
|
|
let data = res.data?.list?.map((item) => {
|
|
|
return {
|
|
@@ -60,6 +63,7 @@ function Apply(props) {
|
|
|
});
|
|
|
return { data, pagination: res.data?.pagination };
|
|
|
};
|
|
|
+
|
|
|
//OA我的申请列表
|
|
|
const {
|
|
|
data: OAApplyData,
|
|
@@ -81,6 +85,7 @@ function Apply(props) {
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
//合同管理相关数据
|
|
|
//请求我的申请列表
|
|
|
const {
|
|
@@ -96,12 +101,25 @@ function Apply(props) {
|
|
|
formatResult: contractResult,
|
|
|
},
|
|
|
);
|
|
|
+
|
|
|
+ //撤回申请
|
|
|
+ const { run: runRepeal, loading: repealLoading } = useRequest(
|
|
|
+ (id) => applyRepeal({ id: id }),
|
|
|
+ {
|
|
|
+ manual: true,
|
|
|
+ onSuccess: () => {
|
|
|
+ OAApplyRun();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
const applyData = useMemo(() => {
|
|
|
let result = [];
|
|
|
if (OAApplyData?.data && OAApplyData?.data.length > 0)
|
|
|
result = [...OAApplyData?.data];
|
|
|
return result;
|
|
|
}, [OAApplyData]);
|
|
|
+
|
|
|
const onTabChange = (activeKey) => {
|
|
|
if (activeKey == '1') {
|
|
|
OAApplyRun();
|
|
@@ -110,10 +128,25 @@ function Apply(props) {
|
|
|
}
|
|
|
setTabActive(activeKey);
|
|
|
};
|
|
|
+
|
|
|
+ const onRepeal = (record) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '撤回',
|
|
|
+ icon: <ExclamationCircleOutlined />,
|
|
|
+ content: `确定撤回申请`,
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: () => {
|
|
|
+ runRepeal(record.id);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
const handleApplySubmit = (values) => {
|
|
|
console.log(values);
|
|
|
OAApplyRun(values);
|
|
|
};
|
|
|
+
|
|
|
const handleApplyPaginationChange = (pagination) => {
|
|
|
applyFormRef.validateFields().then((values) => {
|
|
|
OAApplyRun({
|
|
@@ -123,11 +156,13 @@ function Apply(props) {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
const handleProfilePaginationChange = (pagination) => {
|
|
|
conApplyRun({
|
|
|
current: pagination.current,
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '标题',
|
|
@@ -163,6 +198,7 @@ function Apply(props) {
|
|
|
title: '流程状态',
|
|
|
// dataIndex: 'status',
|
|
|
render: (record) => {
|
|
|
+ if (record.is_repeal) return '已撤回';
|
|
|
switch (record.audit_status) {
|
|
|
case 0:
|
|
|
return '审核中';
|
|
@@ -178,20 +214,35 @@ function Apply(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
- render: (text, record) => (
|
|
|
- <Fragment>
|
|
|
- <>
|
|
|
- <a
|
|
|
- style={{ color: '#4096ff' }}
|
|
|
- onClick={() => {
|
|
|
- navigate(`/profile/${record.id}`);
|
|
|
- }}
|
|
|
- >
|
|
|
- 详情
|
|
|
- </a>
|
|
|
- </>
|
|
|
- </Fragment>
|
|
|
- ),
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ !record.is_repeal && (
|
|
|
+ <Fragment>
|
|
|
+ <>
|
|
|
+ <a
|
|
|
+ style={{ color: '#4096ff' }}
|
|
|
+ onClick={() => {
|
|
|
+ navigate(`/profile/${record.id}`);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </a>
|
|
|
+ {tabActive == '1' && record?.audit_status == 0 && (
|
|
|
+ <>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <a
|
|
|
+ style={{ color: '#4096ff' }}
|
|
|
+ onClick={() => onRepeal(record)}
|
|
|
+ >
|
|
|
+ 撤回
|
|
|
+ </a>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ </Fragment>
|
|
|
+ )
|
|
|
+ );
|
|
|
+ },
|
|
|
width: '10%',
|
|
|
},
|
|
|
];
|
|
@@ -250,7 +301,7 @@ function Apply(props) {
|
|
|
navigate(`/profile/${record.id}`);
|
|
|
}}
|
|
|
>
|
|
|
- 申请
|
|
|
+ 详情
|
|
|
</a>
|
|
|
</>
|
|
|
</Fragment>
|