Commit 3432e885efb8668d61cafab1abb8b07cdd123d61

Authored by 曾国涛
1 parent 0c58fbdf

feat: 开票后确认发货功能开发。

src/pages/Order/components/CheckModal.tsx
@@ -34,6 +34,7 @@ import { @@ -34,6 +34,7 @@ import {
34 } from '@/utils'; 34 } from '@/utils';
35 import { PlusOutlined } from '@ant-design/icons'; 35 import { PlusOutlined } from '@ant-design/icons';
36 import { cloneDeep } from 'lodash'; 36 import { cloneDeep } from 'lodash';
  37 +
37 export default ({ 38 export default ({
38 setCheckVisible, 39 setCheckVisible,
39 data, 40 data,
@@ -43,6 +44,7 @@ export default ({ @@ -43,6 +44,7 @@ export default ({
43 onClose, 44 onClose,
44 }) => { 45 }) => {
45 const [previewOpen, setPreviewOpen] = useState(false); 46 const [previewOpen, setPreviewOpen] = useState(false);
  47 + const [aPopoverTitle, setAPopoverTitle] = useState('审核');
46 const [previewImage, setPreviewImage] = useState(''); 48 const [previewImage, setPreviewImage] = useState('');
47 const [previewTitle, setPreviewTitle] = useState(''); 49 const [previewTitle, setPreviewTitle] = useState('');
48 const [paymentReceiptsImages, setPymentReceiptsImages] = useState<any[]>([]); 50 const [paymentReceiptsImages, setPymentReceiptsImages] = useState<any[]>([]);
@@ -116,6 +118,9 @@ export default ({ @@ -116,6 +118,9 @@ export default ({
116 }; 118 };
117 119
118 useEffect(() => { 120 useEffect(() => {
  121 + if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) {
  122 + setAPopoverTitle('确认发货');
  123 + }
119 getOrderAfterSalesInfo(); 124 getOrderAfterSalesInfo();
120 125
121 let paymentReceiptsImagesList: any[] = []; 126 let paymentReceiptsImagesList: any[] = [];
@@ -347,6 +352,32 @@ export default ({ @@ -347,6 +352,32 @@ export default ({
347 } 352 }
348 } 353 }
349 354
  355 + function computeType() {
  356 + let type: string = '';
  357 + if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) {
  358 + type = 'confirm_deliver';
  359 + }
  360 + if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) {
  361 + type = 'warehouse_audit';
  362 + }
  363 + if (checkType(CHECK_TYPE.WAITING_FOR_POST_AUDIT)) {
  364 + type = 'post_audit';
  365 + }
  366 + if (checkType(CHECK_TYPE.NODE_OPERATING_AUDIT)) {
  367 + type = 'node_operating_audit';
  368 + }
  369 + if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) {
  370 + type = 'modify_leader_audit';
  371 + }
  372 + if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) {
  373 + type = 'urgent_invoice_audit';
  374 + }
  375 + if (checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT)) {
  376 + type = 'payment_receipt_audit';
  377 + }
  378 + return type;
  379 + }
  380 +
350 return ( 381 return (
351 <> 382 <>
352 <ModalForm<{ 383 <ModalForm<{
@@ -355,7 +386,7 @@ export default ({ @@ -355,7 +386,7 @@ export default ({
355 }> 386 }>
356 width={500} 387 width={500}
357 open 388 open
358 - title="审核" 389 + title={aPopoverTitle}
359 form={form} 390 form={form}
360 autoFocusFirstInput 391 autoFocusFirstInput
361 modalProps={{ 392 modalProps={{
@@ -369,77 +400,63 @@ export default ({ @@ -369,77 +400,63 @@ export default ({
369 submitter={{ 400 submitter={{
370 render: (props, defaultDoms) => { 401 render: (props, defaultDoms) => {
371 let myDoms = []; 402 let myDoms = [];
372 - myDoms.push(  
373 - <Button  
374 - key="驳回"  
375 - onClick={async () => {  
376 - if (checkType(CHECK_TYPE.AFTER_SALES)) {  
377 - doAfterSalesCheck({  
378 - applyType: 'after-sales',  
379 - isAfterSalesSuccess: false,  
380 - subOrderIds: subOrderIds,  
381 - mainId: mainOrderId,  
382 - afterSalesRejectionNotes: form.getFieldValue('name'),  
383 - });  
384 - return;  
385 - } 403 + if (!checkType(CHECK_TYPE.CONFIRM_DELIVER)) {
  404 + myDoms.push(
  405 + <Button
  406 + key="驳回"
  407 + onClick={async () => {
  408 + if (checkType(CHECK_TYPE.AFTER_SALES)) {
  409 + doAfterSalesCheck({
  410 + applyType: 'after-sales',
  411 + isAfterSalesSuccess: false,
  412 + subOrderIds: subOrderIds,
  413 + mainId: mainOrderId,
  414 + afterSalesRejectionNotes: form.getFieldValue('name'),
  415 + });
  416 + return;
  417 + }
386 418
387 - if (checkType(CHECK_TYPE.FINALCIAL)) {  
388 - let values = { name: form.getFieldValue('name') };  
389 - doFinancailCheck(values, false);  
390 - return;  
391 - } 419 + if (checkType(CHECK_TYPE.FINALCIAL)) {
  420 + let values = { name: form.getFieldValue('name') };
  421 + doFinancailCheck(values, false);
  422 + return;
  423 + }
392 424
393 - if (checkType(CHECK_TYPE.LEADER_AUDIT)) {  
394 - doLeaderCheck({  
395 - pass: false,  
396 - subOrderIds: subOrderIds,  
397 - reason: form.getFieldValue('name'),  
398 - });  
399 - return;  
400 - } 425 + if (checkType(CHECK_TYPE.LEADER_AUDIT)) {
  426 + doLeaderCheck({
  427 + pass: false,
  428 + subOrderIds: subOrderIds,
  429 + reason: form.getFieldValue('name'),
  430 + });
  431 + return;
  432 + }
  433 +
  434 + if (checkType(CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT)) {
  435 + doAfterSalesCheck({
  436 + applyType: 'order-change-normal',
  437 + isAfterSalesSuccess: false,
  438 + subOrderIds: subOrderIds,
  439 + mainId: mainOrderId,
  440 + afterSalesRejectionNotes: form.getFieldValue('name'),
  441 + });
  442 + return;
  443 + }
401 444
402 - if (checkType(CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT)) {  
403 - doAfterSalesCheck({  
404 - applyType: 'order-change-normal',  
405 - isAfterSalesSuccess: false, 445 + let type = '';
  446 + type = computeType();
  447 + console.log('type:' + type);
  448 + doCheck({
  449 + pass: false,
406 subOrderIds: subOrderIds, 450 subOrderIds: subOrderIds,
407 - mainId: mainOrderId,  
408 - afterSalesRejectionNotes: form.getFieldValue('name'), 451 + type: type,
  452 + notes: form.getFieldValue('name'),
409 }); 453 });
410 - return;  
411 - }  
412 -  
413 - let type = '';  
414 - if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) {  
415 - type = 'warehouse_audit';  
416 - }  
417 - if (checkType(CHECK_TYPE.WAITING_FOR_POST_AUDIT)) {  
418 - type = 'post_audit';  
419 - }  
420 - if (checkType(CHECK_TYPE.NODE_OPERATING_AUDIT)) {  
421 - type = 'node_operating_audit';  
422 - }  
423 - if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) {  
424 - type = 'modify_leader_audit';  
425 - }  
426 - if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) {  
427 - type = 'urgent_invoice_audit';  
428 - }  
429 - if (checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT)) {  
430 - type = 'payment_receipt_audit';  
431 - }  
432 - doCheck({  
433 - pass: false,  
434 - subOrderIds: subOrderIds,  
435 - type: type,  
436 - notes: form.getFieldValue('name'),  
437 - });  
438 - }}  
439 - >  
440 - 驳回  
441 - </Button>,  
442 - ); 454 + }}
  455 + >
  456 + 驳回
  457 + </Button>,
  458 + );
  459 + }
443 460
444 //如果是仓库审核,那么显示这个外部采购 461 //如果是仓库审核,那么显示这个外部采购
445 if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) { 462 if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) {
@@ -508,24 +525,7 @@ export default ({ @@ -508,24 +525,7 @@ export default ({
508 } 525 }
509 526
510 let type = ''; 527 let type = '';
511 - if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) {  
512 - type = 'warehouse_audit';  
513 - }  
514 - if (checkType(CHECK_TYPE.WAITING_FOR_POST_AUDIT)) {  
515 - type = 'post_audit';  
516 - }  
517 - if (checkType(CHECK_TYPE.NODE_OPERATING_AUDIT)) {  
518 - type = 'node_operating_audit';  
519 - }  
520 - if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) {  
521 - type = 'modify_leader_audit';  
522 - }  
523 - if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) {  
524 - type = 'urgent_invoice_audit';  
525 - }  
526 - if (checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT)) {  
527 - type = 'payment_receipt_audit';  
528 - } 528 + type = computeType();
529 doCheck({ 529 doCheck({
530 pass: true, 530 pass: true,
531 subOrderIds: subOrderIds, 531 subOrderIds: subOrderIds,
@@ -578,12 +578,14 @@ export default ({ @@ -578,12 +578,14 @@ export default ({
578 )} 578 )}
579 579
580 <div>请特别注意订单总金额与订单金额。</div> 580 <div>请特别注意订单总金额与订单金额。</div>
581 - {checkType(CHECK_TYPE.FINALCIAL) && ( 581 + {!checkType(CHECK_TYPE.CONFIRM_DELIVER) ? (
582 <ProFormTextArea 582 <ProFormTextArea
583 width="lg" 583 width="lg"
584 name="name" 584 name="name"
585 placeholder="若驳回,请填写驳回理由" 585 placeholder="若驳回,请填写驳回理由"
586 /> 586 />
  587 + ) : (
  588 + <></>
587 )} 589 )}
588 590
589 {checkType(CHECK_TYPE.FINALCIAL) ? ( 591 {checkType(CHECK_TYPE.FINALCIAL) ? (
src/pages/Order/constant.ts
@@ -159,6 +159,7 @@ export const PAYMENT_RECEIPTS_STATUS_OPTIONS = { @@ -159,6 +159,7 @@ export const PAYMENT_RECEIPTS_STATUS_OPTIONS = {
159 }; 159 };
160 160
161 export const ORDER_STATUS_OPTIONS = { 161 export const ORDER_STATUS_OPTIONS = {
  162 + WAIT_CONFIRM_DELIVER_AFTER_INVOICE: '待开票后确认发货',
162 UNAUDITED: '未审核', 163 UNAUDITED: '未审核',
163 LEADER_PROCESS: '领导待审核', 164 LEADER_PROCESS: '领导待审核',
164 MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核', 165 MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核',
src/pages/Order/index.tsx
@@ -1933,8 +1933,8 @@ const OrderPage = () =&gt; { @@ -1933,8 +1933,8 @@ const OrderPage = () =&gt; {
1933 type="link" 1933 type="link"
1934 onClick={() => { 1934 onClick={() => {
1935 createOptObject(optRecord.id, record.id); 1935 createOptObject(optRecord.id, record.id);
1936 - setCheckVisible(true);  
1937 setOrderCheckType(CHECK_TYPE.CONFIRM_DELIVER); 1936 setOrderCheckType(CHECK_TYPE.CONFIRM_DELIVER);
  1937 + setCheckVisible(true);
1938 }} 1938 }}
1939 > 1939 >
1940 确认发货 1940 确认发货