Commit 0c58fbdf94422bc80b4fe65a44781ee7c377cccd

Authored by 曾国涛
1 parent 11109695

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

src/pages/Order/components/CheckModal.tsx
... ... @@ -8,7 +8,17 @@ import {
8 8 postServiceOrderToProcureAudit,
9 9 } from '@/services';
10 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 22 import Upload, { RcFile, UploadProps } from 'antd/es/upload';
13 23 import { useEffect, useRef, useState } from 'react';
14 24 import {
... ... @@ -113,7 +123,7 @@ export default ({
113 123 if (item.paymentReceiptAnnexList) {
114 124 paymentReceiptsImagesList.push(...item.paymentReceiptAnnexList);
115 125 }
116   - })
  126 + });
117 127 //去重
118 128 paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)];
119 129 setPymentReceiptsImages(paymentReceiptsImagesList);
... ... @@ -205,8 +215,8 @@ export default ({
205 215 setPreviewOpen(true);
206 216 setPreviewTitle(
207 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 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 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 589 {checkType(CHECK_TYPE.FINALCIAL) ? (
576 590 <>
577 591 <div className="pb-4 text-xs decoration-gray-50">
... ...
src/pages/Order/components/FinancialDrawer.tsx
... ... @@ -117,7 +117,7 @@ export default ({
117 117 ''
118 118 )}
119 119  
120   - <ProFormText
  120 + <ProFormTextArea
121 121 width="lg"
122 122 name="invoiceIdentificationNumber"
123 123 label="开票信息"
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -87,6 +87,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
87 87 deleteSubOrderLists: [];
88 88 filePaths: [];
89 89 notes: '';
  90 + invoiceFirst: boolean;
90 91 list: [
91 92 {
92 93 productCode: '';
... ... @@ -1106,10 +1107,30 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1106 1107 form.setFieldValue('invoiceIdentificationNumber', undefined);
1107 1108 form.setFieldValue('bank', undefined);
1108 1109 form.setFieldValue('bankAccountNumber', undefined);
  1110 + form.setFieldValue('invoiceFirst', false);
1109 1111 }
1110 1112 }}
1111 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 1135 <ProFormSelect
1115 1136 placeholder="收款单位"
... ...
src/pages/Order/constant.ts
... ... @@ -91,6 +91,7 @@ export const INVOCING_STATUS = {
91 91 * 采购审核
92 92 */
93 93 export const CHECK_TYPE = {
  94 + CONFIRM_DELIVER: 'CONFIRM_DELIVER',
94 95 WEARHOUSE_KEEPER: 'WEARHOUSE_KEEPER',
95 96 FINALCIAL: 'FINALCIAL',
96 97 PROCURE: 'PROCURE',
... ... @@ -258,6 +259,7 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
258 259 ['WAIT_AUDIT', 'warning'],
259 260 ['AUDIT_PASS', 'success'],
260 261 ['AUDIT_NOTPASS', 'error'],
  262 + ['WAIT_CONFIRM_DELIVER_AFTER_INVOICE', 'processing'],
261 263 ]);
262 264 export const SALES_CODE_OPTIONS = [
263 265 { label: 'D-Linda', value: 'D-Linda' },
... ...
src/pages/Order/index.tsx
... ... @@ -616,7 +616,15 @@ const OrderPage = () =&gt; {
616 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 628 if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') {
621 629 if (paymentMethod === 'PAYMENT_IN_ADVANCE') {
622 630 orderStatusTagText = '财务待审核';
... ... @@ -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 1946 {optRecord.subPath?.includes('orderCancel') ? (
1923 1947 <ButtonConfirm
1924 1948 className="p-0"
... ...