Commit 0c58fbdf94422bc80b4fe65a44781ee7c377cccd

Authored by 曾国涛
1 parent 11109695

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

src/pages/Order/components/CheckModal.tsx
@@ -8,7 +8,17 @@ import { @@ -8,7 +8,17 @@ import {
8 postServiceOrderToProcureAudit, 8 postServiceOrderToProcureAudit,
9 } from '@/services'; 9 } from '@/services';
10 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components'; 10 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
11 -import { Button, Col, Form, Modal, Row, UploadFile, message, Image, Divider } from 'antd'; 11 +import {
  12 + Button,
  13 + Col,
  14 + Divider,
  15 + Form,
  16 + Image,
  17 + Modal,
  18 + Row,
  19 + UploadFile,
  20 + message,
  21 +} from 'antd';
12 import Upload, { RcFile, UploadProps } from 'antd/es/upload'; 22 import Upload, { RcFile, UploadProps } from 'antd/es/upload';
13 import { useEffect, useRef, useState } from 'react'; 23 import { useEffect, useRef, useState } from 'react';
14 import { 24 import {
@@ -113,7 +123,7 @@ export default ({ @@ -113,7 +123,7 @@ export default ({
113 if (item.paymentReceiptAnnexList) { 123 if (item.paymentReceiptAnnexList) {
114 paymentReceiptsImagesList.push(...item.paymentReceiptAnnexList); 124 paymentReceiptsImagesList.push(...item.paymentReceiptAnnexList);
115 } 125 }
116 - }) 126 + });
117 //去重 127 //去重
118 paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)]; 128 paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)];
119 setPymentReceiptsImages(paymentReceiptsImagesList); 129 setPymentReceiptsImages(paymentReceiptsImagesList);
@@ -205,8 +215,8 @@ export default ({ @@ -205,8 +215,8 @@ export default ({
205 setPreviewOpen(true); 215 setPreviewOpen(true);
206 setPreviewTitle( 216 setPreviewTitle(
207 file.name || 217 file.name ||
208 - file.originFileObj?.name ||  
209 - file.url!.substring(file.url!.lastIndexOf('/') + 1), 218 + file.originFileObj?.name ||
  219 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
210 ); 220 );
211 }; 221 };
212 222
@@ -543,35 +553,39 @@ export default ({ @@ -543,35 +553,39 @@ export default ({
543 '' 553 ''
544 )} 554 )}
545 555
546 - {  
547 - checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT) ? (  
548 - <>  
549 - <Divider orientation="center"><span className='text-sm'>回款凭证</span></Divider>  
550 - <Image.PreviewGroup  
551 - className="mr-10"  
552 - preview={{  
553 - onChange: (current, prev) =>  
554 - console.log(`current index: ${current}, prev index: ${prev}`),  
555 - }}  
556 - >  
557 - {paymentReceiptsImages.map((url) => (  
558 - <>  
559 - <Image width={120} src={url} /> <Divider type="vertical" />  
560 - </>  
561 - ))}  
562 - </Image.PreviewGroup>  
563 - <Divider></Divider>  
564 - </>  
565 - )  
566 - : ""  
567 - } 556 + {checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT) ? (
  557 + <>
  558 + <Divider orientation="center">
  559 + <span className="text-sm">回款凭证</span>
  560 + </Divider>
  561 + <Image.PreviewGroup
  562 + className="mr-10"
  563 + preview={{
  564 + onChange: (current, prev) =>
  565 + console.log(`current index: ${current}, prev index: ${prev}`),
  566 + }}
  567 + >
  568 + {paymentReceiptsImages.map((url) => (
  569 + <>
  570 + <Image width={120} src={url} /> <Divider type="vertical" />
  571 + </>
  572 + ))}
  573 + </Image.PreviewGroup>
  574 + <Divider></Divider>
  575 + </>
  576 + ) : (
  577 + ''
  578 + )}
568 579
569 <div>请特别注意订单总金额与订单金额。</div> 580 <div>请特别注意订单总金额与订单金额。</div>
570 - <ProFormTextArea  
571 - width="lg"  
572 - name="name"  
573 - placeholder="若驳回,请填写驳回理由"  
574 - /> 581 + {checkType(CHECK_TYPE.FINALCIAL) && (
  582 + <ProFormTextArea
  583 + width="lg"
  584 + name="name"
  585 + placeholder="若驳回,请填写驳回理由"
  586 + />
  587 + )}
  588 +
575 {checkType(CHECK_TYPE.FINALCIAL) ? ( 589 {checkType(CHECK_TYPE.FINALCIAL) ? (
576 <> 590 <>
577 <div className="pb-4 text-xs decoration-gray-50"> 591 <div className="pb-4 text-xs decoration-gray-50">
src/pages/Order/components/FinancialDrawer.tsx
@@ -117,7 +117,7 @@ export default ({ @@ -117,7 +117,7 @@ export default ({
117 '' 117 ''
118 )} 118 )}
119 119
120 - <ProFormText 120 + <ProFormTextArea
121 width="lg" 121 width="lg"
122 name="invoiceIdentificationNumber" 122 name="invoiceIdentificationNumber"
123 label="开票信息" 123 label="开票信息"
src/pages/Order/components/OrderDrawer.tsx
@@ -87,6 +87,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -87,6 +87,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
87 deleteSubOrderLists: []; 87 deleteSubOrderLists: [];
88 filePaths: []; 88 filePaths: [];
89 notes: ''; 89 notes: '';
  90 + invoiceFirst: boolean;
90 list: [ 91 list: [
91 { 92 {
92 productCode: ''; 93 productCode: '';
@@ -1106,10 +1107,30 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1106,10 +1107,30 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1106 form.setFieldValue('invoiceIdentificationNumber', undefined); 1107 form.setFieldValue('invoiceIdentificationNumber', undefined);
1107 form.setFieldValue('bank', undefined); 1108 form.setFieldValue('bank', undefined);
1108 form.setFieldValue('bankAccountNumber', undefined); 1109 form.setFieldValue('bankAccountNumber', undefined);
  1110 + form.setFieldValue('invoiceFirst', false);
1109 } 1111 }
1110 }} 1112 }}
1111 rules={[{ required: true, message: '是否需要开票必填' }]} 1113 rules={[{ required: true, message: '是否需要开票必填' }]}
1112 /> 1114 />
  1115 + <ProFormSelect
  1116 + placeholder="是否开票后发货"
  1117 + name="invoiceFirst"
  1118 + width="lg"
  1119 + key="invoiceFirst"
  1120 + label="是否开票后发货"
  1121 + disabled={optType('after-sales-check')}
  1122 + hidden={invoicingStatus === 'UN_INVOICE'}
  1123 + options={[
  1124 + {
  1125 + value: true,
  1126 + label: '是',
  1127 + },
  1128 + {
  1129 + value: false,
  1130 + label: '否',
  1131 + },
  1132 + ]}
  1133 + />
1113 1134
1114 <ProFormSelect 1135 <ProFormSelect
1115 placeholder="收款单位" 1136 placeholder="收款单位"
src/pages/Order/constant.ts
@@ -91,6 +91,7 @@ export const INVOCING_STATUS = { @@ -91,6 +91,7 @@ export const INVOCING_STATUS = {
91 * 采购审核 91 * 采购审核
92 */ 92 */
93 export const CHECK_TYPE = { 93 export const CHECK_TYPE = {
  94 + CONFIRM_DELIVER: 'CONFIRM_DELIVER',
94 WEARHOUSE_KEEPER: 'WEARHOUSE_KEEPER', 95 WEARHOUSE_KEEPER: 'WEARHOUSE_KEEPER',
95 FINALCIAL: 'FINALCIAL', 96 FINALCIAL: 'FINALCIAL',
96 PROCURE: 'PROCURE', 97 PROCURE: 'PROCURE',
@@ -258,6 +259,7 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([ @@ -258,6 +259,7 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
258 ['WAIT_AUDIT', 'warning'], 259 ['WAIT_AUDIT', 'warning'],
259 ['AUDIT_PASS', 'success'], 260 ['AUDIT_PASS', 'success'],
260 ['AUDIT_NOTPASS', 'error'], 261 ['AUDIT_NOTPASS', 'error'],
  262 + ['WAIT_CONFIRM_DELIVER_AFTER_INVOICE', 'processing'],
261 ]); 263 ]);
262 export const SALES_CODE_OPTIONS = [ 264 export const SALES_CODE_OPTIONS = [
263 { label: 'D-Linda', value: 'D-Linda' }, 265 { label: 'D-Linda', value: 'D-Linda' },
src/pages/Order/index.tsx
@@ -616,7 +616,15 @@ const OrderPage = () =&gt; { @@ -616,7 +616,15 @@ const OrderPage = () =&gt; {
616 ORDER_STATUS_OPTIONS, 616 ORDER_STATUS_OPTIONS,
617 ); 617 );
618 618
619 - //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【仓库待审核】 619 + if (orderStatus === 'WAIT_CONFIRM_DELIVER_AFTER_INVOICE') {
  620 + if (optRecord.afterInvoicingStatus !== 'COMPLETE_INVOICING') {
  621 + orderStatusTagText = '待开票';
  622 + } else {
  623 + orderStatusTagText = '待确认发货';
  624 + }
  625 + }
  626 +
  627 + //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】
620 if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') { 628 if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') {
621 if (paymentMethod === 'PAYMENT_IN_ADVANCE') { 629 if (paymentMethod === 'PAYMENT_IN_ADVANCE') {
622 orderStatusTagText = '财务待审核'; 630 orderStatusTagText = '财务待审核';
@@ -1919,6 +1927,22 @@ const OrderPage = () =&gt; { @@ -1919,6 +1927,22 @@ const OrderPage = () =&gt; {
1919 '' 1927 ''
1920 )} 1928 )}
1921 1929
  1930 + {optRecord.subPath?.includes('confirmDeliver') ? (
  1931 + <Button
  1932 + className="p-0"
  1933 + type="link"
  1934 + onClick={() => {
  1935 + createOptObject(optRecord.id, record.id);
  1936 + setCheckVisible(true);
  1937 + setOrderCheckType(CHECK_TYPE.CONFIRM_DELIVER);
  1938 + }}
  1939 + >
  1940 + 确认发货
  1941 + </Button>
  1942 + ) : (
  1943 + ''
  1944 + )}
  1945 +
1922 {optRecord.subPath?.includes('orderCancel') ? ( 1946 {optRecord.subPath?.includes('orderCancel') ? (
1923 <ButtonConfirm 1947 <ButtonConfirm
1924 className="p-0" 1948 className="p-0"