Commit bbe48e4d870dadc92a148ae8b80cb4bbe7aa0beb
1 parent
556c9f15
库存池展示加装项
Showing
5 changed files
with
30 additions
and
9 deletions
src/pages/stock/SpecialOfferCar/SubPages/OptionalDetails.tsx renamed to src/pages/stock/Components/OptionalDetails.tsx
... | ... | @@ -16,15 +16,13 @@ export default function DetailModal({ visible, onCancel, listItem = [] }: Props) |
16 | 16 | footer={null} |
17 | 17 | > |
18 | 18 | <List |
19 | - header={<div>Header</div>} | |
20 | - footer={<div>Footer</div>} | |
21 | 19 | bordered |
22 | 20 | dataSource={listItem} |
23 | - renderItem={(item) => ( | |
21 | + renderItem={(item, key) => ( | |
24 | 22 | <List.Item> |
25 | - <Row> | |
26 | - <div>{item.optionalName}</div> | |
27 | - <div>{item.dealerPrice}</div> | |
23 | + <Row style={{ flex: 1 }} justify="space-between"> | |
24 | + <div style={{ flex: 1 }}>{key + 1}.{item.optionalName}</div> | |
25 | + <div style={{ color: "#FF921C" }}>{item.dealerPrice || 0}元</div> | |
28 | 26 | </Row> |
29 | 27 | </List.Item> |
30 | 28 | )} | ... | ... |
src/pages/stock/RepertoryFw/comps/QueryForm.tsx
... | ... | @@ -220,11 +220,14 @@ export default function QueryForm({ onChange, delearData, setSearchParams, inner |
220 | 220 | <Option value="0">否</Option> |
221 | 221 | <Option value="1">是</Option> |
222 | 222 | </Select> |
223 | - <Select placeholder="请选择库存状态" value={innerParams.sold} onChange={(value) => onChange({ sold: value })} style={{ width: 180 }}> | |
223 | + <Select placeholder="加装车" value={innerParams.optionalTag} allowClear onChange={(value) => onChange({ optionalTag: value })} style={{ width: 180 }}> | |
224 | + <Option value="0">否</Option> | |
225 | + <Option value="1"> 是</Option> | |
226 | + </Select> | |
227 | + <Select placeholder="请选择库存状态" value={innerParams.sold} allowClear onChange={(value) => onChange({ sold: value })} style={{ width: 180 }}> | |
224 | 228 | <Option value="0">未售出</Option> |
225 | 229 | <Option value="1"> 已售出</Option> |
226 | 230 | </Select> |
227 | - <div style={{ width: 180 }} /> | |
228 | 231 | <div style={{ width: 180 }}> |
229 | 232 | <Button |
230 | 233 | type="primary" | ... | ... |
src/pages/stock/RepertoryFw/index.tsx
... | ... | @@ -12,6 +12,12 @@ import RecordModal from './comps/RecordModal'; |
12 | 12 | import * as api from './api'; |
13 | 13 | import st from '../style.less'; |
14 | 14 | import moment from 'moment'; |
15 | +import OptionalDetails from '@/pages/stock/Components/OptionalDetails'; | |
16 | + | |
17 | +interface Optionals { | |
18 | + visible: boolean, | |
19 | + listItem?: SpecialOfferCar.OptionalVo[], | |
20 | +} | |
15 | 21 | |
16 | 22 | export default function Repertory() { |
17 | 23 | const { data: delearData, errMsg } = useInitail<CommonApi.OptionVO[], CommonApi.DealerParam>(getDealerApi, [], {}); |
... | ... | @@ -19,6 +25,7 @@ export default function Repertory() { |
19 | 25 | const [showDetailModal, setShowDetailModal] = useState(false); |
20 | 26 | const [listRecord, setListRecord] = useState<Repertory.RepertoryItem>({}); |
21 | 27 | const [recordVisible, setRecordVisible] = useState(false); |
28 | + const [Optionals, setOptionals] = useState<Optionals>({ visible: false }); | |
22 | 29 | |
23 | 30 | const RecordContent = useMemo(() => ( |
24 | 31 | <RecordModal |
... | ... | @@ -110,6 +117,12 @@ export default function Repertory() { |
110 | 117 | <Column title="前装车" dataIndex="decoratedCar" render={(text) => getColumnStyle(text)} width="5%" /> |
111 | 118 | <Column title="加装车" dataIndex="optionalTag" render={(text) => (text ? "是" : "否")} width="5%" /> |
112 | 119 | <Column title="厂家加装金额" dataIndex="optionalPrice" width="5%" /> |
120 | + <Column | |
121 | + title="加装项目" | |
122 | + width="5%" | |
123 | + dataIndex="optionalItemList" | |
124 | + render={(t, record: SpecialOfferCar.Item) => (t && record.optionalTag ? (<Button type="link" onClick={() => setOptionals({ visible: true, listItem: t })}>查看</Button>) : "--")} | |
125 | + /> | |
113 | 126 | <Column title="锁车时长(天)" dataIndex="lockedDuration" render={(text) => text || "--"} sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.lockedDuration || 0) - (b.lockedDuration || 0)} width="6%" /> |
114 | 127 | <Column title="调运次数" dataIndex="transportedNum" sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.transportedNum || 0) - (b.transportedNum || 0)} render={(text) => text || "--"} width="6%" /> |
115 | 128 | <Column title="启票商家" dataIndex="dealerName" width="8%" /> |
... | ... | @@ -143,6 +156,11 @@ export default function Repertory() { |
143 | 156 | }} |
144 | 157 | listItem={listRecord} |
145 | 158 | /> |
159 | + <OptionalDetails | |
160 | + {...Optionals} | |
161 | + onCancel={() => setOptionals({ visible: false, listItem: undefined })} | |
162 | + /> | |
163 | + | |
146 | 164 | {/* <RecordModal |
147 | 165 | visible={recordVisible} |
148 | 166 | onCancel={() => { setRecordVisible(false); }} | ... | ... |
src/pages/stock/RepertoryFw/interface.d.ts
... | ... | @@ -37,6 +37,7 @@ declare namespace Repertory { |
37 | 37 | tempLocked?: number; //临时锁车标识 |
38 | 38 | sold?: number; //库存状态 |
39 | 39 | storageId?: number; //库房取值 |
40 | + optionalTag?: boolean; // 加装车标识 | |
40 | 41 | } |
41 | 42 | |
42 | 43 | /** |
... | ... | @@ -95,6 +96,7 @@ declare namespace Repertory { |
95 | 96 | shippingDay?: number; //发运天数 |
96 | 97 | optionalTag?: boolean; //加装车 |
97 | 98 | optionalPrice?: number; |
99 | + optionalItemList?: any[] //选装项目 | |
98 | 100 | } |
99 | 101 | |
100 | 102 | /**库存列表详情 */ | ... | ... |
src/pages/stock/SpecialOfferCar/index.tsx
... | ... | @@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react'; |
9 | 9 | import st from './style.less'; |
10 | 10 | import moment from 'moment'; |
11 | 11 | import { history } from "umi"; |
12 | -import OptionalDetails from './SubPages/OptionalDetails'; | |
12 | +import OptionalDetails from '@/pages/stock/Components/OptionalDetails'; | |
13 | 13 | |
14 | 14 | interface Optionals { |
15 | 15 | visible: boolean, | ... | ... |