Filiter.tsx
2.49 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
import React from 'react';
import {Input} from 'antd';
import useInitail from "@/hooks/useInitail";
import {getPartTypeApi} from '@/pages/pms/part/Repertory/api';
import usePagination from '@/hooks/usePagination';
import { getStoragePage } from '@/pages/pms/storage/StorageManage/api';
import { useStore } from '../index';
import PmsSelect from '@/pages/pms/comonents/PmsSelect';
const poolTypes = [
{label: "工单缺件调拨", value: 1},
{label: "装潢缺件调拨", value: 3},
{label: "库销比调拨", value: 4},
{label: "库龄调拨", value: 5},
// {label: "可调出调拨", value: 9},
{label: "调剂调拨", value: 14},
];
export default function Index() {
const { data: partTypeData } = useInitail(getPartTypeApi, [], {});
const { list: storages } = usePagination<PartStorageSpace.PageVO>(getStoragePage, { pageSize: 1000 });
const {setParams, data} = useStore();
return (
<div style={{display: 'flex', flexWrap: 'wrap'}}>
<Input.Search
allowClear
enterButton
placeholder="输入关键词搜索"
onSearch={(value, event) => setParams({keywords: value}, true)}
style={{ width: 200, marginRight: 10, marginBottom: 10 }}
/>
<PmsSelect
style={{width: 200, marginRight: 10}}
placeholder="选择调出库房"
allowClear
onChange={v => setParams({outStorageId: v}, true)}
options={storages.map(it => ({label: it.storageName, value: it.id}))}
/>
<PmsSelect
style={{width: 200, marginRight: 10}}
placeholder="选择调入库房"
allowClear
onChange={v => setParams({inStorageId: v}, true)}
options={storages.map(it => ({label: it.storageName, value: it.id}))}
/>
<PmsSelect
style={{width: 200, marginRight: 10}}
placeholder="选择数据类型"
allowClear
onChange={v => setParams({poolType: v}, true)}
options={poolTypes}
/>
<PmsSelect
style={{width: 200, marginRight: 10}}
placeholder="选择配件类型"
allowClear
onChange={v => setParams({partType: v}, true)}
options={partTypeData.map(item => ({label: item.label, value: item.value}))}
/>
<PmsSelect
allowClear
placeholder="请选择车系"
style={{width: 200, marginRight: 10}}
onChange={v => setParams({seriesId: v}, true)}
options={data.length ? data[0].conditions?.map(item => ({value: item.id, label: item.name})) : []}
/>
</div>
);
}