Commit 7a03dbfae16911b6334496e96256da751dc5002c

Authored by zhaofeng
1 parent 27123514

厂家票据启票账户样式调整

src/pages/finance/SpecialAccount/FactoryBill/components/Filter.tsx
1 1 import React, { useCallback } from "react";
2   -import { Button, Col, Row, Select } from "antd";
  2 +import { Button, Row, Select } from "antd";
3 3 import { useStore } from "../index";
4 4  
5 5 const { Option } = Select;
... ... @@ -10,61 +10,47 @@ export default function Filter() {
10 10 const searchDealer = useCallback((dealerId) => {
11 11 setDealerId(dealerId);
12 12 }, []);
13   -
  13 +
14 14 const searchBrand = useCallback((brandId) => {
15 15 setBrandId(brandId);
16 16 }, []);
17 17  
18 18 return (
19   - <div
20   - style={{
21   - display: "flex",
22   - flexDirection: "row",
23   - justifyContent: "space-between",
24   - alignItems: "center",
25   - marginBottom: 20,
26   - }}
27   - >
28   - <Row style={{ display: "flex", flex: 1, alignItems: "center" }}>
29   - <div>商家:</div>
30   - <Col span={6}>
31   - <Select
32   - placeholder="请选择商家"
33   - showSearch
34   - optionFilterProp="children"
35   - onChange={searchDealer}
36   - // value={dealerId && dealerId > 0 ? dealerId : undefined}
37   - style={{ width: 300 }}
38   - >
39   - {dealerList.map((dealer) => (
40   - <Option value={dealer.id} key={dealer.id}>
41   - {dealer.name}
42   - </Option>
43   - ))}
44   - </Select>
45   - </Col>
46   - <div style={{ marginLeft: 20 }}>品牌:</div>
47   - <Col span={6}>
48   - <Select
49   - placeholder="请选择品牌"
50   - loading={brandLoading}
51   - allowClear
52   - optionFilterProp="children"
53   - onChange={searchBrand}
54   - value={brandId && brandId > 0 ? brandId : undefined}
55   - style={{ width: 160 }}
56   - >
57   - {brandList.map((brand) => (
58   - <Option value={brand.id} key={brand.id}>
59   - {brand.name}
60   - </Option>
61   - ))}
62   - </Select>
63   - </Col>
  19 + <Row justify="space-between" style={{ marginBottom: 10 }}>
  20 + <Row justify="start">
  21 + <Select
  22 + placeholder="请选择商家"
  23 + showSearch
  24 + optionFilterProp="children"
  25 + onChange={searchDealer}
  26 + style={{ width: 200 }}
  27 + >
  28 + {dealerList.map((dealer) => (
  29 + <Option value={dealer.id} key={dealer.id}>
  30 + {dealer.name}
  31 + </Option>
  32 + ))}
  33 + </Select>
  34 + <Select
  35 + placeholder="请选择品牌"
  36 + loading={brandLoading}
  37 + allowClear
  38 + optionFilterProp="children"
  39 + onChange={searchBrand}
  40 + value={brandId && brandId > 0 ? brandId : undefined}
  41 + style={{ width: 200,marginLeft:100 }}
  42 + >
  43 + {brandList.map((brand) => (
  44 + <Option value={brand.id} key={brand.id}>
  45 + {brand.name}
  46 + </Option>
  47 + ))}
  48 + </Select>
64 49 </Row>
  50 +
65 51 <Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}>
66 52 新增
67 53 </Button>
68   - </div>
  54 + </Row>
69 55 );
70 56 }
... ...