Commit c05a875576c3653b8375a3b3eee39a16473f218e
1 parent
7a5c2411
feat(fvm): 促销超额完成支持标准配置
Showing
1 changed file
with
59 additions
and
3 deletions
src/pages/stock/ManufacturerPromotion/components/PolicyConditions.tsx
... | ... | @@ -3,7 +3,7 @@ import { List, Row, Button, Popconfirm, InputNumber, message, Select, DatePicker |
3 | 3 | import { EditOutlined, DeleteOutlined, PlusSquareOutlined } from '@ant-design/icons'; |
4 | 4 | import type { FormInstance } from 'antd/lib/form'; |
5 | 5 | import moment from 'moment'; |
6 | -import { StandardTypeEnum, JudgeTypeEnum, ConditionTypeEnum } from '../entity'; | |
6 | +import { StandardTypeEnum, JudgeTypeEnum, ConditionTypeEnum, modeTypeList1, modeTypeList2 } from '../entity'; | |
7 | 7 | import AddconditionsModal from './AddconditionsModal'; |
8 | 8 | import LadderSupport from './LadderSupport'; |
9 | 9 | import type * as IF from '../interface'; |
... | ... | @@ -279,7 +279,7 @@ export default function PolicyConditions(props: Props) { |
279 | 279 | </span> |
280 | 280 | )} |
281 | 281 | </div> |
282 | - {item.standardType == 1 || item.standardType == 4 ? ( | |
282 | + {item.standardType == 1 ? ( | |
283 | 283 | <Row style={{ alignItems: 'center' }}> |
284 | 284 | <Select |
285 | 285 | disabled |
... | ... | @@ -305,7 +305,6 @@ export default function PolicyConditions(props: Props) { |
305 | 305 | </Select.Option> |
306 | 306 | ))} |
307 | 307 | </Select> |
308 | - {item.standardType == 4 && <span>超额部分:</span>} | |
309 | 308 | <InputNumber |
310 | 309 | value={item.supportStandard} |
311 | 310 | onChange={(v) => { |
... | ... | @@ -392,6 +391,63 @@ export default function PolicyConditions(props: Props) { |
392 | 391 | value={item.modeTwo} |
393 | 392 | /> |
394 | 393 | ) : null} |
394 | + {/** 超额部分 */} | |
395 | + {item.standardType == 4 ? ( | |
396 | + <div> | |
397 | + <Row style={{ alignItems: 'center', marginTop: 10 }}> | |
398 | + <Select | |
399 | + onChange={(v) => { | |
400 | + handSave({ key: index, modeType: v }); | |
401 | + }} | |
402 | + placeholder="支持条件类型" | |
403 | + value={item.modeType} | |
404 | + style={{ width: 150, marginRight: 10 }} | |
405 | + > | |
406 | + {(supportType == 1 ? modeTypeList1 : modeTypeList2).map((mode) => ( | |
407 | + <Select.Option key={mode.value} value={mode.value}> | |
408 | + {mode.label} | |
409 | + </Select.Option> | |
410 | + ))} | |
411 | + </Select> | |
412 | + <Select | |
413 | + onChange={(v) => { | |
414 | + handSave({ key: index, judgeType: v }); | |
415 | + }} | |
416 | + placeholder="判断类型" | |
417 | + value={item.judgeType} | |
418 | + style={{ width: 100, marginRight: 10 }} | |
419 | + > | |
420 | + {[ | |
421 | + { value: 1, label: '>' }, | |
422 | + { value: 2, label: '≥' }, | |
423 | + ].map((i) => ( | |
424 | + <Select.Option value={i.value} key={i.value}> | |
425 | + {i.label} | |
426 | + </Select.Option> | |
427 | + ))} | |
428 | + </Select> | |
429 | + <InputNumber | |
430 | + value={item.judgeValue} | |
431 | + onChange={(v) => handSave({ key: index, judgeValue: v })} | |
432 | + style={{ width: 150 }} | |
433 | + addonAfter={item.modeType && [1, 3].includes(item.modeType) ? '元' : '%'} | |
434 | + placeholder="判断值" | |
435 | + /> | |
436 | + </Row> | |
437 | + <div style={{ marginTop: 10, alignItems: 'center', display: 'flex' }}> | |
438 | + <span>超额完成支持标准:</span> | |
439 | + <InputNumber | |
440 | + value={item.supportStandard} | |
441 | + onChange={(v) => { | |
442 | + handSave({ key: index, supportStandard: v }); | |
443 | + }} | |
444 | + addonAfter="元/辆" | |
445 | + disabled={disabled} | |
446 | + placeholder="请输入" | |
447 | + /> | |
448 | + </div> | |
449 | + </div> | |
450 | + ) : null} | |
395 | 451 | </div> |
396 | 452 | ); |
397 | 453 | } | ... | ... |