7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
1
|
import React, {useState} from "react";
|
f21c07ed
jiangwei
计划管理筛选
|
2
|
import { Card, ConfigProvider, Select, Table, Button, Divider, Input } from 'antd';
|
12f15fa6
by1642146903
fix
|
3
4
5
6
7
8
9
10
11
|
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import usePagination from "@/hooks/usePagination";
import { getList, ListVO } from './api';
import st from './style.less';
import zhCN from "antd/lib/locale-provider/zh_CN";
import moment from 'moment';
import useInitial from '@/hooks/useInitail';
import * as API from '@/common/api';
import { history } from 'umi';
|
7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
12
|
import DetailModal from "@/pages/pms/partPlan/PlanManage/components/DetailModal";
|
12f15fa6
by1642146903
fix
|
13
14
15
|
// 计划状态 1:待审核2:已通过3待付款4已付款9:已拒绝
const statusName: {[key: number]: string} = {
|
79d4a3b6
jiangwei
计划管理增加草稿和继续编辑功能
|
16
|
0: '草稿',
|
12f15fa6
by1642146903
fix
|
17
18
19
20
21
|
1: '待审核',
2: '已通过',
3: '待付款',
4: '已付款',
9: '已拒绝',
|
ebd701f2
by1642146903
配件计划申请页面联调
|
22
|
};
|
12f15fa6
by1642146903
fix
|
23
24
25
26
|
const { Column } = Table;
export default function Index() {
const { list, paginationConfig, loading, setParams, innerParams } = usePagination<ListVO>(getList, {});
const { data: brands } = useInitial(API.getBrandFilterApi, [], {});
|
7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
27
28
29
|
const [visibleDetail, setVisibleDetail] = useState(false);
const [item, setItem] = useState<ListVO>({});
|
12f15fa6
by1642146903
fix
|
30
31
32
33
34
|
return (
<PageHeaderWrapper title="配件计划管理">
<ConfigProvider locale={zhCN}>
<Card className={st.page}>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginBottom: 20}}>
|
f21c07ed
jiangwei
计划管理筛选
|
35
36
37
|
<div style={{display: 'flex', alignItems: 'center'}}>
<Input.Search
allowClear
|
9ca4d316
jiangwei
搜索优化
|
38
|
enterButton
|
f21c07ed
jiangwei
计划管理筛选
|
39
|
placeholder="输入配件名称/编码搜索"
|
f21c07ed
jiangwei
计划管理筛选
|
40
41
42
43
44
|
onSearch={v => setParams({keywords: v}, true)}
style={{ maxWidth: 240, marginRight: 20 }}
/>
<Input.Search
allowClear
|
9ca4d316
jiangwei
搜索优化
|
45
|
enterButton
|
f21c07ed
jiangwei
计划管理筛选
|
46
|
placeholder="输入计划人员搜索"
|
f21c07ed
jiangwei
计划管理筛选
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
onSearch={v => setParams({userName: v}, true)}
style={{ maxWidth: 200, marginRight: 20 }}
/>
<Select
placeholder="请选择品牌"
showSearch
allowClear
style={{ width: 200, marginRight: 20 }}
value={innerParams.brandId}
onChange={brandId => setParams({ ...innerParams, brandId, current: 1 }, true)}
optionFilterProp="children"
>
{brands.map((item: any) => (
<Select.Option value={item.id} key={item.id}>
{item.name}
</Select.Option>
))}
</Select>
<Select
placeholder="状态筛选"
showSearch
allowClear
style={{ width: 200, marginRight: 20 }}
onChange={v => setParams({status: v }, true)}
optionFilterProp="children"
>
|
79d4a3b6
jiangwei
计划管理增加草稿和继续编辑功能
|
73
|
<Select.Option value={0} key={0}>草稿</Select.Option>
|
f21c07ed
jiangwei
计划管理筛选
|
74
75
76
77
78
|
<Select.Option value={1} key={1}>待审核</Select.Option>
<Select.Option value={2} key={2}>已通过</Select.Option>
<Select.Option value={9} key={9}>已拒绝</Select.Option>
</Select>
</div>
|
12f15fa6
by1642146903
fix
|
79
80
81
82
83
84
85
86
87
88
89
90
|
<Button type="primary" onClick={() => history.push('/pms/partPlan/planManage/apply')}>新增</Button>
</div>
<Table
size="small"
loading={loading}
pagination={paginationConfig}
dataSource={list}
rowKey={(item: ListVO) => `${item.planId}`}
onChange={(_pagination) => setParams({ ..._pagination }, true)}
>
<Column title="计划单号" dataIndex="planNo" />
<Column title="品牌" dataIndex="brandName" />
|
12f15fa6
by1642146903
fix
|
91
92
|
<Column title="计划日期" dataIndex="planDate" render={(t: number) => t && moment(t).format('YYYY-MM-DD HH:mm')} />
<Column title="计划人员" dataIndex="userName" />
|
716ef310
jiangwei
计划管理计划总金额展示
|
93
|
<Column title="计划总金额(元)" dataIndex="totalAmount" />
|
12f15fa6
by1642146903
fix
|
94
95
96
97
98
|
<Column title="状态" dataIndex="status" render={(t: number) => statusName[t]} />
<Column
title="操作"
fixed="right"
render={(text, _item: ListVO) => (
|
7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
99
|
<>
|
79d4a3b6
jiangwei
计划管理增加草稿和继续编辑功能
|
100
101
102
103
104
105
106
107
108
109
|
{[0, 9].includes(_item.status || 0) ? (
<a onClick={() => history.push(`/pms/partPlan/planManage/apply?planId=${_item.planId}`)}>
编辑
</a>
)
: (
<a onClick={() => history.push(`/pms/partPlan/planManage/detail/${_item.planId}`)}>
查看
</a>
)}
|
7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
110
111
112
113
114
115
116
117
118
|
<Divider type="vertical" />
<a onClick={() => {
setItem(_item);
setVisibleDetail(true);
}}
>
进度
</a>
</>
|
12f15fa6
by1642146903
fix
|
119
120
121
|
)}
/>
</Table>
|
7ae589ea
by1642146903
配件计划管理和配件计划进度整合
|
122
123
124
125
126
|
<DetailModal
visible={visibleDetail}
item={item}
onCancel={() => setVisibleDetail(false)}
/>
|
12f15fa6
by1642146903
fix
|
127
128
129
130
131
|
</Card>
</ConfigProvider>
</PageHeaderWrapper>
);
}
|