Commit c0569851ae56463b044914a626cdd982d7bd1c20
1 parent
c48ef7a2
促销负激励确认折让差异,接口联调
Showing
3 changed files
with
26 additions
and
20 deletions
src/pages/stock/AllowanceConfirm/EditComfirm/components/AddRewardsModal.tsx
... | ... | @@ -50,7 +50,6 @@ export default function CreateModal(props: Props) { |
50 | 50 | |
51 | 51 | useEffect(() => { |
52 | 52 | if (visible) { |
53 | - console.log("currentItem", currentItem); | |
54 | 53 | setAmount(currentItem.actualRebateAmount || 0); |
55 | 54 | // 选中商家 |
56 | 55 | if (currentItem.costSharing && currentItem.costSharing.length) { | ... | ... |
src/pages/stock/AllowanceConfirm/EditComfirm/components/PromotionConfig.tsx
... | ... | @@ -15,7 +15,7 @@ import { savePromotionApi } from "../api"; |
15 | 15 | import { useStore } from "../index"; |
16 | 16 | import { debounce } from "lodash"; |
17 | 17 | import WaitConfirmList from "./WaitConfirmList"; |
18 | -import { getRemoveCheckListApi } from "@/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/api"; | |
18 | +import { getRemoveCheckListApi, savePromotionNegativeApi } from "@/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/api"; | |
19 | 19 | import AddRewardsModal from "@/pages/stock/AllowanceConfirm/EditComfirm/components/AddRewardsModal"; |
20 | 20 | import { AwardTypeEnum, SubjectTypeEnum } from "@/pages/stock/AllowanceConfirm/entity"; |
21 | 21 | |
... | ... | @@ -35,6 +35,7 @@ export default function PromotionConfig(props: Props) { |
35 | 35 | loading, |
36 | 36 | promotionReward, |
37 | 37 | discountPromotion, |
38 | + setDiscountLoading, | |
38 | 39 | setRewardParams, |
39 | 40 | setDiscountParams, |
40 | 41 | RewardPagination, //正激励 |
... | ... | @@ -55,20 +56,21 @@ export default function PromotionConfig(props: Props) { |
55 | 56 | ); |
56 | 57 | const [activityVisible, setActivityVisible] = useState<boolean>(false); |
57 | 58 | const [awardType, setAwardType] = useState<number>(); |
58 | - | |
59 | + | |
60 | + /**保存促销负激励折让差异 */ | |
59 | 61 | function handSubmit() { |
60 | 62 | if (saveLoading) return; |
61 | 63 | const pa = { |
62 | 64 | rebateId, |
63 | 65 | promotionId: saveItem.promotionId, |
64 | 66 | reason: saveItem.reason, |
65 | - actualSupportStandard: saveItem.actualSupportStandard, | |
67 | + actualRebateAmount: saveItem.actualRebateAmount, | |
66 | 68 | }; |
67 | 69 | setSaveLoading(true); |
68 | - savePromotionApi(pa) | |
70 | + savePromotionNegativeApi(pa) | |
69 | 71 | .then((res) => { |
70 | 72 | setSaveLoading(false); |
71 | - setLoading(true); | |
73 | + setDiscountLoading(true); | |
72 | 74 | setSaveLoading(false); |
73 | 75 | setSaveVissible(false); |
74 | 76 | message.success("操作成功"); |
... | ... | @@ -137,7 +139,7 @@ export default function PromotionConfig(props: Props) { |
137 | 139 | rowKey="id" |
138 | 140 | loading={loading} |
139 | 141 | > |
140 | - <Column title="促销名称" width="15%" dataIndex="fundsName" /> | |
142 | + <Column title="促销名称" width="20%" dataIndex="fundsName" /> | |
141 | 143 | <Column |
142 | 144 | title="考核类型" |
143 | 145 | width="10%" |
... | ... | @@ -157,7 +159,7 @@ export default function PromotionConfig(props: Props) { |
157 | 159 | /> |
158 | 160 | <Column |
159 | 161 | title="实际折让金额(元)" |
160 | - width="10%" | |
162 | + width="15%" | |
161 | 163 | dataIndex="actualRebateAmount" |
162 | 164 | /> |
163 | 165 | {/* <Column |
... | ... | @@ -184,7 +186,7 @@ export default function PromotionConfig(props: Props) { |
184 | 186 | /> |
185 | 187 | <Column |
186 | 188 | width="10%" |
187 | - title={awardType === 1 ? "符合条件车辆" : "折让分摊"} | |
189 | + title={awardType === 1 ? "符合条件车辆" : "操作"} | |
188 | 190 | render={ |
189 | 191 | (_, record: FvmAllowance.PromotionVo) => (awardType === 1 ? ( |
190 | 192 | <a |
... | ... | @@ -200,10 +202,12 @@ export default function PromotionConfig(props: Props) { |
200 | 202 | </a> |
201 | 203 | ) : record.subjectType === 1 ? ( |
202 | 204 | <a onClick={() => onEdit(record)}> |
203 | - {readOnly ? "查看" : "设置"} | |
205 | + {readOnly ? "查看" : "折让分摊"} | |
204 | 206 | </a> |
205 | 207 | ) : ( |
206 | - "--" | |
208 | + <a onClick={() => { setSaveItem(record); setSaveVissible(true); }}> | |
209 | + {readOnly ? "查看" : "确认折让差异"} | |
210 | + </a> | |
207 | 211 | )) |
208 | 212 | } |
209 | 213 | /> |
... | ... | @@ -306,7 +310,8 @@ export default function PromotionConfig(props: Props) { |
306 | 310 | <Modal |
307 | 311 | title={ |
308 | 312 | <div style={{ marginRight: 80, color: "#666" }}> |
309 | - {`${saveItem.fundsName} ——实际支持标准单价确认`} | |
313 | + {/* {`${saveItem.fundsName} ——实际折让金额确认`} */} | |
314 | + 实际折让金额确认 | |
310 | 315 | </div> |
311 | 316 | } |
312 | 317 | centered |
... | ... | @@ -318,18 +323,19 @@ export default function PromotionConfig(props: Props) { |
318 | 323 | }} |
319 | 324 | onOk={handSubmit} |
320 | 325 | > |
326 | + <div style={{ marginBottom: 15 }}>促销名称:{saveItem.fundsName}</div> | |
321 | 327 | <Row style={{ alignItems: "center", marginBottom: 20 }}> |
322 | - <span>实际支持标准单价(元):</span> | |
328 | + <span>实际折让金额(元):</span> | |
323 | 329 | <InputNumber |
324 | 330 | precision={2} |
325 | - style={{ width: "60%"}} | |
326 | - value={saveItem.actualSupportStandard} | |
331 | + style={{ width: "60%" }} | |
332 | + value={saveItem.actualRebateAmount} | |
327 | 333 | placeholder="输入折让实际金额" |
328 | - onChange={(v) => setSaveItem({ ...saveItem, actualSupportStandard: v })} | |
334 | + onChange={(v) => setSaveItem({ ...saveItem, actualRebateAmount: v })} | |
329 | 335 | /> |
330 | 336 | </Row> |
331 | - <span>差异原因:</span> | |
332 | - <Input.TextArea placeholder="折让不足原因" onChange={(v) => setSaveItem({ ...saveItem, reason: v.target.value })} /> | |
337 | + <span style={{ marginLeft: 53 }}>差异原因:</span> | |
338 | + <Input style={{ width: "60%" }} placeholder="折让不足原因" onChange={(v) => setSaveItem({ ...saveItem, reason: v.target.value })} /> | |
333 | 339 | </Modal> |
334 | 340 | {/* 厂家促销==》选择待确认活动 */} |
335 | 341 | <WaitConfirmList | ... | ... |
src/pages/stock/AllowanceConfirm/EditComfirm/store.ts
... | ... | @@ -53,7 +53,7 @@ export default function useStore() { |
53 | 53 | /** |
54 | 54 | * 查询促销折让提交详情(厂家促销--负激励) |
55 | 55 | */ |
56 | - const { list: discountPromotion, setParams: setDiscountParams, paginationConfig: DiscountPagination } = usePagination(queryDetailListApi, { | |
56 | + const { list: discountPromotion, setLoading: setDiscountLoading, setParams: setDiscountParams, paginationConfig: DiscountPagination } = usePagination(queryDetailListApi, { | |
57 | 57 | rebateId, |
58 | 58 | awardType: 2 |
59 | 59 | }, { delay }); |
... | ... | @@ -244,7 +244,8 @@ export default function useStore() { |
244 | 244 | DiscountPagination, //负激励 |
245 | 245 | setDiscountParams, //负激励 |
246 | 246 | discountPromotion, //负激励list |
247 | - | |
247 | + setDiscountLoading, | |
248 | + | |
248 | 249 | /** 移除提交清单 */ |
249 | 250 | commonRemoveCheckList, |
250 | 251 | /** 加入提交清单 */ | ... | ... |