index.tsx
2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
73
74
75
76
77
78
79
80
81
82
83
84
import React, {useState} from 'react';
import { PlusOutlined, DownloadOutlined, UploadOutlined } from '@ant-design/icons';
import { Card, Button } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import Filter from './components/Filter';
import List from './components/List';
import store from './store';
import { createStore } from '@/hooks/moz';
import ImportModal from './components/UploadExcel';
import UploadMoreModal from './components/UploadMoreModal';
export const { Provider, useStore } = createStore(store);
function PartShop() {
const { setImportVisible, fw, setVisible, setIsadd } = useStore();
const [more, setMore] = useState(false);
const [stock, setStock] = useState(false);
const [islock, setIslock] = useState(false);
return (
<PageHeaderWrapper title={`服务站配件${fw ? '(霏微)': ''}`}>
<Card>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: 20 }}>
<Filter />
<div style={{ display: 'flex', alignItems: 'center'}}>
<Button
type="primary"
icon={<PlusOutlined />}
onClick={() => { setVisible(true); setIsadd(true); }}
>
新增
</Button>
{fw && (
<Button
icon={<UploadOutlined />}
type="primary"
onClick={() => setImportVisible(true)}
style={{ marginLeft: 10 }}
>
导入
</Button>
)}
{fw && (
<Button
icon={<UploadOutlined />}
type="primary"
onClick={() => { setImportVisible(true); setStock(true); }}
style={{marginLeft: 10}}
>
调运库存导入
</Button>
)}
<Button
type="primary"
icon={<DownloadOutlined />}
onClick={() => { setMore(true); setIslock(true); }}
style={{marginLeft: 10}}
>
锁件批量导出
</Button>
<Button
type="primary"
icon={<DownloadOutlined />}
onClick={() => setMore(true)}
style={{marginLeft: 10}}
>
库存批量导出
</Button>
</div>
</div>
<List />
<ImportModal stock={stock} setStock={setStock} />
<UploadMoreModal
visible={more}
onCancel={() => setMore(false)}
islock={islock}
setIslock={setIslock}
/>
</Card>
</PageHeaderWrapper>
);
}
export default () => <Provider><PartShop /></Provider>;