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,15 +16,13 @@ export default function DetailModal({ visible, onCancel, listItem = [] }: Props) | ||
16 | footer={null} | 16 | footer={null} |
17 | > | 17 | > |
18 | <List | 18 | <List |
19 | - header={<div>Header</div>} | ||
20 | - footer={<div>Footer</div>} | ||
21 | bordered | 19 | bordered |
22 | dataSource={listItem} | 20 | dataSource={listItem} |
23 | - renderItem={(item) => ( | 21 | + renderItem={(item, key) => ( |
24 | <List.Item> | 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 | </Row> | 26 | </Row> |
29 | </List.Item> | 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,11 +220,14 @@ export default function QueryForm({ onChange, delearData, setSearchParams, inner | ||
220 | <Option value="0">否</Option> | 220 | <Option value="0">否</Option> |
221 | <Option value="1">是</Option> | 221 | <Option value="1">是</Option> |
222 | </Select> | 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 | <Option value="0">未售出</Option> | 228 | <Option value="0">未售出</Option> |
225 | <Option value="1"> 已售出</Option> | 229 | <Option value="1"> 已售出</Option> |
226 | </Select> | 230 | </Select> |
227 | - <div style={{ width: 180 }} /> | ||
228 | <div style={{ width: 180 }}> | 231 | <div style={{ width: 180 }}> |
229 | <Button | 232 | <Button |
230 | type="primary" | 233 | type="primary" |
src/pages/stock/RepertoryFw/index.tsx
@@ -12,6 +12,12 @@ import RecordModal from './comps/RecordModal'; | @@ -12,6 +12,12 @@ import RecordModal from './comps/RecordModal'; | ||
12 | import * as api from './api'; | 12 | import * as api from './api'; |
13 | import st from '../style.less'; | 13 | import st from '../style.less'; |
14 | import moment from 'moment'; | 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 | export default function Repertory() { | 22 | export default function Repertory() { |
17 | const { data: delearData, errMsg } = useInitail<CommonApi.OptionVO[], CommonApi.DealerParam>(getDealerApi, [], {}); | 23 | const { data: delearData, errMsg } = useInitail<CommonApi.OptionVO[], CommonApi.DealerParam>(getDealerApi, [], {}); |
@@ -19,6 +25,7 @@ export default function Repertory() { | @@ -19,6 +25,7 @@ export default function Repertory() { | ||
19 | const [showDetailModal, setShowDetailModal] = useState(false); | 25 | const [showDetailModal, setShowDetailModal] = useState(false); |
20 | const [listRecord, setListRecord] = useState<Repertory.RepertoryItem>({}); | 26 | const [listRecord, setListRecord] = useState<Repertory.RepertoryItem>({}); |
21 | const [recordVisible, setRecordVisible] = useState(false); | 27 | const [recordVisible, setRecordVisible] = useState(false); |
28 | + const [Optionals, setOptionals] = useState<Optionals>({ visible: false }); | ||
22 | 29 | ||
23 | const RecordContent = useMemo(() => ( | 30 | const RecordContent = useMemo(() => ( |
24 | <RecordModal | 31 | <RecordModal |
@@ -110,6 +117,12 @@ export default function Repertory() { | @@ -110,6 +117,12 @@ export default function Repertory() { | ||
110 | <Column title="前装车" dataIndex="decoratedCar" render={(text) => getColumnStyle(text)} width="5%" /> | 117 | <Column title="前装车" dataIndex="decoratedCar" render={(text) => getColumnStyle(text)} width="5%" /> |
111 | <Column title="加装车" dataIndex="optionalTag" render={(text) => (text ? "是" : "否")} width="5%" /> | 118 | <Column title="加装车" dataIndex="optionalTag" render={(text) => (text ? "是" : "否")} width="5%" /> |
112 | <Column title="厂家加装金额" dataIndex="optionalPrice" width="5%" /> | 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 | <Column title="锁车时长(天)" dataIndex="lockedDuration" render={(text) => text || "--"} sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.lockedDuration || 0) - (b.lockedDuration || 0)} width="6%" /> | 126 | <Column title="锁车时长(天)" dataIndex="lockedDuration" render={(text) => text || "--"} sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.lockedDuration || 0) - (b.lockedDuration || 0)} width="6%" /> |
114 | <Column title="调运次数" dataIndex="transportedNum" sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.transportedNum || 0) - (b.transportedNum || 0)} render={(text) => text || "--"} width="6%" /> | 127 | <Column title="调运次数" dataIndex="transportedNum" sorter={(a: Repertory.RepertoryItem, b: Repertory.RepertoryItem) => (a.transportedNum || 0) - (b.transportedNum || 0)} render={(text) => text || "--"} width="6%" /> |
115 | <Column title="启票商家" dataIndex="dealerName" width="8%" /> | 128 | <Column title="启票商家" dataIndex="dealerName" width="8%" /> |
@@ -143,6 +156,11 @@ export default function Repertory() { | @@ -143,6 +156,11 @@ export default function Repertory() { | ||
143 | }} | 156 | }} |
144 | listItem={listRecord} | 157 | listItem={listRecord} |
145 | /> | 158 | /> |
159 | + <OptionalDetails | ||
160 | + {...Optionals} | ||
161 | + onCancel={() => setOptionals({ visible: false, listItem: undefined })} | ||
162 | + /> | ||
163 | + | ||
146 | {/* <RecordModal | 164 | {/* <RecordModal |
147 | visible={recordVisible} | 165 | visible={recordVisible} |
148 | onCancel={() => { setRecordVisible(false); }} | 166 | onCancel={() => { setRecordVisible(false); }} |
src/pages/stock/RepertoryFw/interface.d.ts
@@ -37,6 +37,7 @@ declare namespace Repertory { | @@ -37,6 +37,7 @@ declare namespace Repertory { | ||
37 | tempLocked?: number; //临时锁车标识 | 37 | tempLocked?: number; //临时锁车标识 |
38 | sold?: number; //库存状态 | 38 | sold?: number; //库存状态 |
39 | storageId?: number; //库房取值 | 39 | storageId?: number; //库房取值 |
40 | + optionalTag?: boolean; // 加装车标识 | ||
40 | } | 41 | } |
41 | 42 | ||
42 | /** | 43 | /** |
@@ -95,6 +96,7 @@ declare namespace Repertory { | @@ -95,6 +96,7 @@ declare namespace Repertory { | ||
95 | shippingDay?: number; //发运天数 | 96 | shippingDay?: number; //发运天数 |
96 | optionalTag?: boolean; //加装车 | 97 | optionalTag?: boolean; //加装车 |
97 | optionalPrice?: number; | 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,7 +9,7 @@ import React, { useEffect, useState } from 'react'; | ||
9 | import st from './style.less'; | 9 | import st from './style.less'; |
10 | import moment from 'moment'; | 10 | import moment from 'moment'; |
11 | import { history } from "umi"; | 11 | import { history } from "umi"; |
12 | -import OptionalDetails from './SubPages/OptionalDetails'; | 12 | +import OptionalDetails from '@/pages/stock/Components/OptionalDetails'; |
13 | 13 | ||
14 | interface Optionals { | 14 | interface Optionals { |
15 | visible: boolean, | 15 | visible: boolean, |