Commit 2043dafad69f5751954a0396f85eff610a723c07
1 parent
de4ea95b
fix: 排查回款bug
Showing
2 changed files
with
40 additions
and
7 deletions
Too many changes to show.
To preserve performance only 2 of 3 files are displayed.
dist.zip
0 → 100644
No preview for this file type
src/pages/Order/OrderWarning/index.tsx
... | ... | @@ -188,7 +188,9 @@ const OrderPage = () => { |
188 | 188 | const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据 |
189 | 189 | const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合 |
190 | 190 | const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id |
191 | + // const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id | |
191 | 192 | const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id |
193 | + // const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id | |
192 | 194 | const [subOrderCount, setSubOrderCount] = useState(0); |
193 | 195 | const [sorted] = useState(false); |
194 | 196 | const mainTableRef = useRef<ActionType>(); |
... | ... | @@ -331,8 +333,10 @@ const OrderPage = () => { |
331 | 333 | * @param mainId |
332 | 334 | */ |
333 | 335 | function createOptObject(subId: any, mainId: any) { |
336 | + console.log(currentOptMainId, '5656createOptObject1', curretnOptSubId); | |
334 | 337 | setCurrentMainId(mainId); |
335 | 338 | setCurretnOptSubId(subId); |
339 | + console.log(currentOptMainId, '5656createOptObject2', curretnOptSubId); | |
336 | 340 | } |
337 | 341 | |
338 | 342 | /** |
... | ... | @@ -381,7 +385,12 @@ const OrderPage = () => { |
381 | 385 | * 返回当前操作的主订单数据 |
382 | 386 | */ |
383 | 387 | function buildMainOrder() { |
384 | - if (currentOptMainId === undefined || currentOptMainId === null) { | |
388 | + console.log( | |
389 | + currentOptMainId, | |
390 | + '5656buildMainOrder currentOptMainId/curretnOptSubId', | |
391 | + curretnOptSubId, | |
392 | + ); | |
393 | + if (!currentOptMainId) { | |
385 | 394 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); |
386 | 395 | return; |
387 | 396 | } |
... | ... | @@ -390,14 +399,14 @@ const OrderPage = () => { |
390 | 399 | let matchedData = data.filter((item) => { |
391 | 400 | return item.id === currentOptMainId; |
392 | 401 | }); |
402 | + console.log(data, '5656buildMainOrder2 data/matchedData', matchedData); | |
393 | 403 | if (matchedData.length > 0) { |
394 | 404 | mainOrderClone = cloneDeep(matchedData[0]); |
395 | 405 | } |
396 | - | |
397 | - if (mainOrderClone === null) { | |
406 | + console.log(mainOrderClone, '5656buildMainOrder mainOrderClone'); | |
407 | + if (!mainOrderClone) { | |
398 | 408 | message.error('页面错误:当前操作的主订单数据不存在,请联系系统管理员'); |
399 | 409 | } |
400 | - | |
401 | 410 | return mainOrderClone; |
402 | 411 | } |
403 | 412 | |
... | ... | @@ -405,7 +414,12 @@ const OrderPage = () => { |
405 | 414 | * 返回当前操作的子订单集合 |
406 | 415 | */ |
407 | 416 | function buildSubOrders() { |
408 | - if (currentOptMainId === undefined || currentOptMainId === null) { | |
417 | + console.log( | |
418 | + curretnOptSubId, | |
419 | + '5656buildSubOrders currentOptMainId/currentOptMainId', | |
420 | + currentOptMainId, | |
421 | + ); | |
422 | + if (!currentOptMainId) { | |
409 | 423 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); |
410 | 424 | return; |
411 | 425 | } |
... | ... | @@ -414,8 +428,14 @@ const OrderPage = () => { |
414 | 428 | |
415 | 429 | //如果没有传当前操作的子订单id,说明是操作主订单 |
416 | 430 | if (curretnOptSubId === undefined || curretnOptSubId === null) { |
431 | + // if (!curretnOptSubId) { | |
417 | 432 | //如果有选中子订单,那么取选中的子订单为操作对象,否则取当前主订单的全部子订单为操作对象 |
418 | 433 | let currentOptSubOrders = subOrderSelectedMap.get(currentOptMainId); |
434 | + console.log( | |
435 | + subOrderSelectedMap, | |
436 | + '5656buildSubOrders subOrderSelectedMap/currentOptSubOrders', | |
437 | + currentOptSubOrders, | |
438 | + ); | |
419 | 439 | if ( |
420 | 440 | currentOptSubOrders === null || |
421 | 441 | currentOptSubOrders === undefined || |
... | ... | @@ -435,6 +455,11 @@ const OrderPage = () => { |
435 | 455 | } |
436 | 456 | } else { |
437 | 457 | //操作的是子订单 |
458 | + console.log( | |
459 | + subOrderSelectedMap, | |
460 | + '5656buildSubOrders2 subOrderSelectedMap/data', | |
461 | + data, | |
462 | + ); | |
438 | 463 | for (let item of data) { |
439 | 464 | if (item.id === currentOptMainId) { |
440 | 465 | for (let subOrder of item?.subOrderInformationLists) { |
... | ... | @@ -446,12 +471,15 @@ const OrderPage = () => { |
446 | 471 | } |
447 | 472 | } |
448 | 473 | } |
449 | - | |
474 | + console.log( | |
475 | + cloneSubOrders, | |
476 | + '5656cloneSubOrders/length', | |
477 | + cloneSubOrders.length, | |
478 | + ); | |
450 | 479 | if (cloneSubOrders.length === 0) { |
451 | 480 | message.error('页面错误:当前操作的订单数据不存在,请联系系统管理员'); |
452 | 481 | return; |
453 | 482 | } |
454 | - | |
455 | 483 | return cloneSubOrders; |
456 | 484 | } |
457 | 485 | |
... | ... | @@ -1334,6 +1362,11 @@ const OrderPage = () => { |
1334 | 1362 | className="p-0" |
1335 | 1363 | type="link" |
1336 | 1364 | onClick={() => { |
1365 | + console.log( | |
1366 | + optRecord.id, | |
1367 | + '5656optRecord.id, record.id', | |
1368 | + record.id, | |
1369 | + ); | |
1337 | 1370 | createOptObject(optRecord.id, record.id); |
1338 | 1371 | setUploadPayBillModalVisible(true); |
1339 | 1372 | }} |
... | ... |