Commit 2ca7483f8daf216ab881a3ed8530ece52f151a2f

Authored by zhongnanhuang
1 parent 317053aa

feat: update

src/access.ts
... ... @@ -3,8 +3,8 @@ export default (initialState: API.UserInfo) => {
3 3 // 参考文档 https://umijs.org/docs/max/access
4 4 const { roleSmallVO } = initialState;
5 5  
6   - console.log(roleSmallVO.code === 'admin');
  6 + console.log(roleSmallVO?.code === 'admin');
7 7 return {
8   - canReadAdmin: roleSmallVO.code === 'admin',
  8 + canReadAdmin: roleSmallVO?.code === 'admin',
9 9 };
10 10 };
... ...
src/pages/Order/components/CheckModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2   -import { postServiceOrderCheckOrder } from '@/services';
  2 +import {
  3 + postServiceOrderCheckOrder,
  4 + postServiceOrderFinanceCheckOrder,
  5 +} from '@/services';
3 6 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
4 7 import { Button, Form, message } from 'antd';
5   -export default ({ setCheckVisible, data, subOrders, onClose }) => {
  8 +import { CHECK_TYPE } from '../constant';
  9 +export default ({
  10 + setCheckVisible,
  11 + data,
  12 + subOrders,
  13 + orderCheckType,
  14 + onClose,
  15 +}) => {
6 16 const [form] = Form.useForm<{ name: string; company: string }>();
7 17 let subOrderIds: any[] = [];
8 18 //是单条子订单审核
... ... @@ -11,6 +21,7 @@ export default ({ setCheckVisible, data, subOrders, onClose }) =&gt; {
11 21 } else {
12 22 subOrderIds = subOrders.map((subOrder) => subOrder.id);
13 23 }
  24 +
14 25 async function doCheck(body: object) {
15 26 const data = await postServiceOrderCheckOrder({
16 27 data: body,
... ... @@ -20,6 +31,31 @@ export default ({ setCheckVisible, data, subOrders, onClose }) =&gt; {
20 31 onClose();
21 32 }
22 33 }
  34 +
  35 + /**
  36 + *
  37 + * @param body 财务审核
  38 + */
  39 + async function doFinancailCheck(body: object) {
  40 + const data = await postServiceOrderFinanceCheckOrder({
  41 + data: body,
  42 + });
  43 + if (data.result === RESPONSE_CODE.SUCCESS) {
  44 + message.success(data.message);
  45 + onClose();
  46 + }
  47 + }
  48 +
  49 + /**
  50 + * 审核类型
  51 + */
  52 + function checkType(check: string) {
  53 + if (orderCheckType === check) {
  54 + return true;
  55 + }
  56 + return false;
  57 + }
  58 +
23 59 return (
24 60 <ModalForm<{
25 61 name: string;
... ... @@ -40,30 +76,74 @@ export default ({ setCheckVisible, data, subOrders, onClose }) =&gt; {
40 76 }}
41 77 submitter={{
42 78 render: (props, defaultDoms) => {
43   - return [
  79 + let myDoms = [];
  80 + myDoms.push(
44 81 <Button
45 82 key="驳回"
46 83 onClick={() => {
47   - doCheck({
48   - flag: false,
49   - ids: subOrderIds,
  84 + if (checkType(CHECK_TYPE.NORMAL)) {
  85 + doCheck({
  86 + flag: false,
  87 + ids: subOrderIds,
  88 + externalProcurement: 0,
  89 + checkNotes: form.getFieldValue('name'),
  90 + });
  91 + return;
  92 + }
  93 +
  94 + //财务审核
  95 + doFinancailCheck({
50 96 checkNotes: form.getFieldValue('name'),
  97 + ids: subOrderIds,
  98 + checkPassOrReject: false,
51 99 });
52 100 }}
53 101 >
54 102 驳回
55 103 </Button>,
56   - defaultDoms[1],
57   - ];
  104 + );
  105 +
  106 + //如果不是财务审核,那么显示这个外部采购
  107 + if (checkType(CHECK_TYPE.NORMAL)) {
  108 + myDoms.push(
  109 + <Button
  110 + key="外部采购"
  111 + onClick={() => {
  112 + doCheck({
  113 + flag: false,
  114 + ids: subOrderIds,
  115 + externalProcurement: 1,
  116 + checkNotes: form.getFieldValue('name'),
  117 + });
  118 + }}
  119 + >
  120 + 外部采购
  121 + </Button>,
  122 + );
  123 + }
  124 +
  125 + //确认
  126 + myDoms.push(defaultDoms[1]);
  127 + return myDoms;
58 128 },
59 129 }}
60 130 submitTimeout={2000}
61 131 onFinish={async (values) => {
62   - //审核通过
63   - return doCheck({
64   - flag: true,
65   - ids: subOrderIds,
  132 + if (checkType(CHECK_TYPE.NORMAL)) {
  133 + //审核通过
  134 + return doCheck({
  135 + flag: true,
  136 + ids: subOrderIds,
  137 + externalProcurement: 0,
  138 + checkNotes: values.name,
  139 + });
  140 + }
  141 +
  142 + //财务审核
  143 + return doFinancailCheck({
66 144 checkNotes: values.name,
  145 + ids: subOrderIds,
  146 + checkPassOrReject: true,
67 147 });
68 148 }}
69 149 onOpenChange={setCheckVisible}
... ...
src/pages/Order/components/DeliverModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2   -import { postServiceOrderSendProduct } from '@/services';
  2 +import {
  3 + postServiceOrderSendProduct,
  4 + postServiceOrderSupplierSendOrder,
  5 +} from '@/services';
3 6 import { enumToSelect } from '@/utils';
4 7 import {
5 8 ProColumns,
... ... @@ -11,17 +14,31 @@ import {
11 14 import { Button, Input, InputNumber, Modal, Select, message } from 'antd';
12 15 import { cloneDeep } from 'lodash';
13 16 import { useEffect, useRef, useState } from 'react';
14   -import { LOGISTICS_STATUS_OPTIONS } from '../constant';
  17 +import { CHECK_TYPE, LOGISTICS_STATUS_OPTIONS } from '../constant';
15 18  
16 19 const DeliverModal = ({
17 20 data: propsData,
18 21 isSendProduct,
19 22 setVisible,
  23 + sendType,
20 24 onClose,
21 25 }) => {
22 26 const [data, setData] = useState(propsData || {});
23 27 const form = useRef();
24 28  
  29 + /**
  30 + * 是供应商发货还是普通发货
  31 + * @param typeString
  32 + * @returns
  33 + */
  34 + function optType(typeString: string) {
  35 + if (sendType === typeString) {
  36 + return true;
  37 + }
  38 +
  39 + return false;
  40 + }
  41 +
25 42 useEffect(() => {
26 43 setData(propsData);
27 44 }, [propsData]);
... ... @@ -136,7 +153,13 @@ const DeliverModal = ({
136 153 body.flag = true;
137 154 }
138 155 //发货请求
139   - const res = await postServiceOrderSendProduct({ data: body });
  156 + let res;
  157 + if (optType(CHECK_TYPE.SUPPLIER)) {
  158 + res = await postServiceOrderSupplierSendOrder({ data: body });
  159 + } else {
  160 + res = await postServiceOrderSendProduct({ data: body });
  161 + }
  162 +
140 163 if (res.result === RESPONSE_CODE.SUCCESS) {
141 164 message.success(res.message);
142 165 onClose();
... ...
src/pages/Order/constant.ts
... ... @@ -9,11 +9,12 @@ export const PAYMENT_CHANNEL_OPTIONS = {
9 9 };
10 10  
11 11 export const PAYMENT_METHOD_OPTIONS = {
12   - PAYMENT_IN_ADVANCE: '预付',
13   - CASH_ON_DELIVERY: '货到付款',
14 12 UNPAID: '未付款',
15   - PLATFORM_SETTLEMENT: '平台结算',
  13 + TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款',
  14 + PAYMENT_IN_ADVANCE: '预付款',
16 15 WITHHOLDING_ADVANCE_DEPOSIT: '扣预存',
  16 + PLATFORM_SETTLEMENT: '平台结算',
  17 + CASH_ON_DELIVERY: '货到付款',
17 18 };
18 19  
19 20 export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
... ... @@ -45,6 +46,18 @@ export const INVOCING_STATUS = {
45 46 };
46 47  
47 48 /**
  49 + * 普通审核
  50 + * 财务审核
  51 + * 采购审核
  52 + */
  53 +export const CHECK_TYPE = {
  54 + NORMAL: 'NORMAL',
  55 + FINALCIAL: 'FINALCIAL',
  56 + PROCURE: 'PROCURE',
  57 + SUPPLIER: 'SUPPLIER',
  58 +};
  59 +
  60 +/**
48 61 * 是否需要开票
49 62 * @param subOrder
50 63 */
... ... @@ -80,15 +93,21 @@ export const LOGISTICS_STATUS_OPTIONS = {
80 93 JINGDONG_LOGISTICS: '京东',
81 94 SF_EXPRESS: '顺丰',
82 95 DEBANG_LOGISTICS: '德邦物流',
  96 + OTHER_LOGISTICS: '其他物流方式',
83 97 };
84 98  
85 99 export const ORDER_STATUS_OPTIONS = {
86 100 UNAUDITED: '未审核',
87   - AUDIT_FAILED: '审核失败',
  101 + FINANCE_PROCESS: '财务已审核',
88 102 AUDITED: '已审核',
  103 + PROCURE_UN_PROCESS: '采购未审核',
  104 + PROCURE_PROCESS: '采购已审核',
  105 + SUPPLIER_WAIT_SHIP: '供应商-待发货',
  106 + SUPPLIER_SHIPPED: '供应商-已发货',
89 107 WAIT_SHIP: '待发货',
90 108 SHIPPED: '已发货',
91 109 CONFIRM_RECEIPT: '确认收货',
  110 + AUDIT_FAILED: '审核失败',
92 111 };
93 112  
94 113 export const FINANCIAL_STATUS_OPTIONS = {
... ... @@ -107,7 +126,12 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
107 126 ['WAIT_SHIP', 'processing'],
108 127 ['SHIPPED', 'processing'],
109 128 ['AUDIT_FAILED', 'error'],
110   - ['CONFIRM_RECEIPT', 'success'],
  129 + ['CONFIRM_RECEIPT', 'processing'],
  130 + ['FINANCE_PROCESS', 'processing'],
  131 + ['PROCURE_UN_PROCESS', 'processing'],
  132 + ['PROCURE_PROCESS', 'processing'],
  133 + ['SUPPLIER_WAIT_SHIP', 'processing'],
  134 + ['SUPPLIER_SHIPPED', 'processing'],
111 135 ]);
112 136  
113 137 export const SALES_CODE_OPTIONS = [
... ... @@ -168,6 +192,10 @@ export const HISTORY_OPT_TYPE = new Map&lt;string, string&gt;([
168 192 ['EDIT_ORDER', '财务编辑'],
169 193 ['MODIFY_SEN_INFORMATION', '发货信息编辑'],
170 194 ['UN_INVOICING', '财务取消开票'],
  195 + ['FINANCE_CHECK_ORDER', '财务审核'],
  196 + ['PROCURE_CHECK_ORDER', '采购审核'],
  197 + ['SUPPLIER_PRINT', '供应商打印'],
  198 + ['EXTERNAL_PROCUREMENT', '仓库操作外部采购子订单'],
171 199 ]);
172 200  
173 201 export const MAIN_ORDER_COLUMNS = [
... ...
src/pages/Order/index.tsx
... ... @@ -47,8 +47,10 @@ import HistoryModal from &#39;./components/HistoryModal&#39;;
47 47 import ImportModal from './components/ImportModal';
48 48 import OrderDrawer from './components/OrderDrawer';
49 49 import OrderNotesEditModal from './components/OrderNotesEditModal';
  50 +import ProcureCheckModal from './components/ProcureCheckModal';
50 51 import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal';
51 52 import {
  53 + CHECK_TYPE,
52 54 LOGISTICS_STATUS_OPTIONS,
53 55 MAIN_ORDER_COLUMNS,
54 56 ORDER_STATUS_OPTIONS,
... ... @@ -80,6 +82,8 @@ const OrderPage = () =&gt; {
80 82 const [isSendProduct, setIsSendProduct] = useState<boolean>(false);
81 83 const [isMainOrder, setIsMainOrder] = useState<boolean>(false);
82 84 const [importModalVisible, setImportModalVisible] = useState<boolean>(false);
  85 + const [procureCheckModalVisible, setProcureCheckModalVisible] =
  86 + useState<boolean>(false);
83 87 const [confirmReceiptVisible, setConfirmReceiptVisible] =
84 88 useState<boolean>(false);
85 89 const [deliverVisible, setDeliverVisible] = useState<boolean>(false);
... ... @@ -99,6 +103,7 @@ const OrderPage = () =&gt; {
99 103 const [selectedRowKeys, setSelectedRowKeys] = useState([]);
100 104 const [pageSize, setPageSize] = useState(10);
101 105 const [currentPage, setCurrentPage] = useState(1);
  106 + const [orderCheckType, setOrderCheckType] = useState('');
102 107 const mainTableRef = useRef();
103 108 const [messageApi, contextHolder] = message.useMessage();
104 109  
... ... @@ -382,6 +387,7 @@ const OrderPage = () =&gt; {
382 387 setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染
383 388 setDeliverVisible(true);
384 389 setIsSendProduct(true);
  390 + setOrderCheckType(CHECK_TYPE.NORMAL);
385 391 }}
386 392 >
387 393 发货
... ... @@ -390,7 +396,26 @@ const OrderPage = () =&gt; {
390 396 ''
391 397 )}
392 398  
393   - {optRecord.subPath.includes('queryAnnex') ? (
  399 + {optRecord.subPath.includes('supplierSendOrder') ? (
  400 + <Button
  401 + className="p-0"
  402 + type="link"
  403 + onClick={() => {
  404 + optRecord.mainOrderId = record.id;
  405 + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染
  406 + setDeliverVisible(true);
  407 + setIsSendProduct(true);
  408 + setOrderCheckType(CHECK_TYPE.SUPPLIER);
  409 + }}
  410 + >
  411 + 供应商发货
  412 + </Button>
  413 + ) : (
  414 + ''
  415 + )}
  416 +
  417 + {optRecord.subPath.includes('queryAnnex') &&
  418 + optRecord.listAnnex?.length > 0 ? (
394 419 <Button
395 420 className="p-0"
396 421 type="link"
... ... @@ -431,6 +456,7 @@ const OrderPage = () =&gt; {
431 456 setOrderPrintVisible(true);
432 457 setSelectedRows([optRecord]);
433 458 setOrderRow(record);
  459 + setOrderCheckType(CHECK_TYPE.NORMAL);
434 460 }}
435 461 >
436 462 打印
... ... @@ -438,6 +464,24 @@ const OrderPage = () =&gt; {
438 464 ) : (
439 465 ''
440 466 )}
  467 +
  468 + {optRecord.subPath.includes('supplierPrint') ? (
  469 + <Button
  470 + className="p-0"
  471 + type="link"
  472 + onClick={async () => {
  473 + setOrderPrintVisible(true);
  474 + setSelectedRows([optRecord]);
  475 + setOrderRow(record);
  476 + setOrderCheckType(CHECK_TYPE.SUPPLIER);
  477 + }}
  478 + >
  479 + 打印
  480 + </Button>
  481 + ) : (
  482 + ''
  483 + )}
  484 +
441 485 {optRecord.subPath.includes('editOrder') ? (
442 486 <Button
443 487 className="p-0"
... ... @@ -479,6 +523,7 @@ const OrderPage = () =&gt; {
479 523 setOrderRow(optRecord);
480 524 setCheckVisible(true);
481 525 setSelectedRows([optRecord]);
  526 + setOrderCheckType(CHECK_TYPE.NORMAL);
482 527 }}
483 528 >
484 529 审核
... ... @@ -487,6 +532,40 @@ const OrderPage = () =&gt; {
487 532 ''
488 533 )}
489 534  
  535 + {optRecord.subPath.includes('financeCheckOrder') ? (
  536 + <Button
  537 + className="p-0"
  538 + type="link"
  539 + onClick={() => {
  540 + setOrderRow(optRecord);
  541 + setCheckVisible(true);
  542 + setSelectedRows([optRecord]);
  543 + setOrderCheckType(CHECK_TYPE.FINALCIAL);
  544 + }}
  545 + >
  546 + 财务审核
  547 + </Button>
  548 + ) : (
  549 + ''
  550 + )}
  551 +
  552 + {optRecord.subPath.includes('procureCheckOrder') ? (
  553 + <Button
  554 + className="p-0"
  555 + type="link"
  556 + onClick={() => {
  557 + setOrderRow(optRecord);
  558 + setSelectedRows([optRecord]);
  559 + setOrderCheckType(CHECK_TYPE.PROCURE);
  560 + setProcureCheckModalVisible(true);
  561 + }}
  562 + >
  563 + 采购审核
  564 + </Button>
  565 + ) : (
  566 + ''
  567 + )}
  568 +
490 569 {optRecord.subPath.includes('rePrintOrder') ? (
491 570 <Button
492 571 className="p-0"
... ... @@ -740,6 +819,7 @@ const OrderPage = () =&gt; {
740 819 setSelectedRows(selectedRowObj[record.id]);
741 820 setDeliverVisible(true);
742 821 setIsSendProduct(true);
  822 + setOrderCheckType(CHECK_TYPE.NORMAL);
743 823 }}
744 824 >
745 825 发货
... ... @@ -747,6 +827,27 @@ const OrderPage = () =&gt; {
747 827 ) : (
748 828 ''
749 829 )}
  830 +
  831 + {/* 供应商发货 */}
  832 + {record.mainPath.includes('supplierSendOrder') ? (
  833 + <Button
  834 + className="p-0"
  835 + type="link"
  836 + onClick={() => {
  837 + if (!selectedRowObj[record.id]?.length) {
  838 + return message.error('请选择选择子订单');
  839 + }
  840 + setSelectedRows(selectedRowObj[record.id]);
  841 + setDeliverVisible(true);
  842 + setIsSendProduct(true);
  843 + setOrderCheckType(CHECK_TYPE.SUPPLIER);
  844 + }}
  845 + >
  846 + 供应商发货
  847 + </Button>
  848 + ) : (
  849 + ''
  850 + )}
750 851 {record.mainPath.includes('printOrder') ? (
751 852 <Button
752 853 className="p-0"
... ... @@ -758,6 +859,7 @@ const OrderPage = () =&gt; {
758 859 setSelectedRows(selectedRowObj[record.id]);
759 860 setOrderRow(record);
760 861 setOrderPrintVisible(true);
  862 + setOrderCheckType(CHECK_TYPE.NORMAL);
761 863 }}
762 864 >
763 865 打印
... ... @@ -765,6 +867,27 @@ const OrderPage = () =&gt; {
765 867 ) : (
766 868 ''
767 869 )}
  870 +
  871 + {record.mainPath.includes('supplierPrint') ? (
  872 + <Button
  873 + className="p-0"
  874 + type="link"
  875 + onClick={() => {
  876 + if (!selectedRowObj[record.id]?.length) {
  877 + return message.error('请选择选择子订单');
  878 + }
  879 + setSelectedRows(selectedRowObj[record.id]);
  880 + setOrderRow(record);
  881 + setOrderPrintVisible(true);
  882 + setOrderCheckType(CHECK_TYPE.SUPPLIER);
  883 + }}
  884 + >
  885 + 打印
  886 + </Button>
  887 + ) : (
  888 + ''
  889 + )}
  890 +
768 891 {record.mainPath.includes('rePrintOrder') ? (
769 892 <Button
770 893 className="p-0"
... ... @@ -889,6 +1012,38 @@ const OrderPage = () =&gt; {
889 1012 setSelectedRows(selectedSubOrders);
890 1013 if (selectedSubOrders === undefined) {
891 1014 setSelectedRows(record.subOrderInformationLists);
  1015 + }
  1016 + console.log(selectedRows);
  1017 + for (let i = 0; i < selectedRows.length; i++) {
  1018 + if (
  1019 + selectedRows[i].orderStatus !== 'UNAUDITED' &&
  1020 + selectedRows[i].orderStatus !== 'FINANCE_PROCESS'
  1021 + ) {
  1022 + message.error('请选择未审核的子订单进行审核');
  1023 + return;
  1024 + }
  1025 + }
  1026 + setOrderRow(record);
  1027 + setCheckVisible(true);
  1028 + setOrderCheckType(CHECK_TYPE.NORMAL);
  1029 + }}
  1030 + >
  1031 + 审核
  1032 + </Button>
  1033 + ) : (
  1034 + ''
  1035 + )}
  1036 +
  1037 + {/* 财务审核:主订单暂无 */}
  1038 + {record.mainPath.includes('financeCheckOrder') ? (
  1039 + <Button
  1040 + className="p-0"
  1041 + type="link"
  1042 + onClick={() => {
  1043 + let selectedSubOrders = selectedRowObj[record.id];
  1044 + setSelectedRows(selectedSubOrders);
  1045 + if (selectedSubOrders === undefined) {
  1046 + setSelectedRows(record.subOrderInformationLists);
892 1047 console.log(
893 1048 'subOrderInformationLists:' +
894 1049 record.subOrderInformationLists,
... ... @@ -897,19 +1052,52 @@ const OrderPage = () =&gt; {
897 1052 for (let i = 0; i < selectedRows.length; i++) {
898 1053 if (
899 1054 selectedRows[i].orderStatus !== 'UNAUDITED' &&
900   - selectedRows[i].orderStatus !== 'AUDIT_FAILED'
  1055 + selectedRows[i].orderStatus !== 'FINANCE_PROCESS'
901 1056 ) {
902   - message.error(
903   - '请选择未审核或者审核失败的子订单进行审核',
904   - );
  1057 + message.error('请选择未审核的子订单进行审核');
905 1058 return;
906 1059 }
907 1060 }
908 1061 setOrderRow(record);
909 1062 setCheckVisible(true);
  1063 + setOrderCheckType(CHECK_TYPE.FINALCIAL);
910 1064 }}
911 1065 >
912   - 审核
  1066 + 财务审核
  1067 + </Button>
  1068 + ) : (
  1069 + ''
  1070 + )}
  1071 +
  1072 + {/* 采购审核 */}
  1073 + {record.mainPath.includes('procureCheckOrder') ? (
  1074 + <Button
  1075 + className="p-0"
  1076 + type="link"
  1077 + onClick={() => {
  1078 + let selectedSubOrders = selectedRowObj[record.id];
  1079 + setSelectedRows(selectedSubOrders);
  1080 + if (selectedSubOrders === undefined) {
  1081 + setSelectedRows(record.subOrderInformationLists);
  1082 + console.log(
  1083 + 'subOrderInformationLists:' +
  1084 + record.subOrderInformationLists,
  1085 + );
  1086 + }
  1087 + for (let i = 0; i < selectedRows.length; i++) {
  1088 + if (
  1089 + selectedRows[i].orderStatus !== 'PROCURE_UN_PROCESS'
  1090 + ) {
  1091 + message.error('请选择未审核的子订单进行审核');
  1092 + return;
  1093 + }
  1094 + }
  1095 + setOrderRow(record);
  1096 + setProcureCheckModalVisible(true);
  1097 + setOrderCheckType(CHECK_TYPE.PROCURE);
  1098 + }}
  1099 + >
  1100 + 采购审核
913 1101 </Button>
914 1102 ) : (
915 1103 ''
... ... @@ -1197,6 +1385,7 @@ const OrderPage = () =&gt; {
1197 1385 setCheckVisible={setCheckVisible}
1198 1386 data={orderRow}
1199 1387 subOrders={selectedRows}
  1388 + orderCheckType={orderCheckType}
1200 1389 onClose={() => {
1201 1390 setCheckVisible(false);
1202 1391 setOrderRow({});
... ... @@ -1226,6 +1415,7 @@ const OrderPage = () =&gt; {
1226 1415 setVisible={(b: boolean) => {
1227 1416 setDeliverVisible(b);
1228 1417 }}
  1418 + sendType={orderCheckType}
1229 1419 onClose={() => {
1230 1420 setDeliverVisible(false);
1231 1421 setOrderRow({});
... ... @@ -1265,6 +1455,7 @@ const OrderPage = () =&gt; {
1265 1455 setVisible={(b: boolean) => {
1266 1456 setOrderPrintVisible(b);
1267 1457 }}
  1458 + printOptType={orderCheckType}
1268 1459 onClose={() => {
1269 1460 setOrderPrintVisible(false);
1270 1461 setOrderRow({});
... ... @@ -1334,6 +1525,30 @@ const OrderPage = () =&gt; {
1334 1525 />
1335 1526 )}
1336 1527  
  1528 + {deliverInfoDrawerVisible && (
  1529 + <DeliverInfoDrawer
  1530 + data={orderRow}
  1531 + onClose={() => {
  1532 + setDeliverInfoDrawerVisible(false);
  1533 + setOrderRow({});
  1534 + }}
  1535 + />
  1536 + )}
  1537 +
  1538 + {procureCheckModalVisible && (
  1539 + <ProcureCheckModal
  1540 + setCheckVisible={setProcureCheckModalVisible}
  1541 + data={orderRow}
  1542 + subOrders={selectedRows}
  1543 + onClose={() => {
  1544 + setProcureCheckModalVisible(false);
  1545 + setOrderRow({});
  1546 + setSelectedRows({});
  1547 + refreshTable();
  1548 + }}
  1549 + />
  1550 + )}
  1551 +
1337 1552 {contextHolder}
1338 1553 </PageContainer>
1339 1554 );
... ...
src/pages/OrderPrint/OrderPrintModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2 2 import '@/pages/OrderPrint/index.less';
3   -import { postServiceOrderPrintOrder } from '@/services';
  3 +import {
  4 + postServiceOrderPrintOrder,
  5 + postServiceOrderSupplierPrint,
  6 +} from '@/services';
4 7 import { ExclamationCircleFilled } from '@ant-design/icons';
5 8 import { Modal, Select, Space, message } from 'antd';
6 9 import printJS from 'print-js';
7 10 import { useState } from 'react';
  11 +import { CHECK_TYPE } from '../Order/constant';
8 12 import { printerCSS } from './PrinterCSS';
9 13 import DalangPrinter from './components/DalangPrinter';
10 14 import HoujiePrinter from './components/HoujiePrinter';
11 15 import ZhuguangPrinter from './components/ZhuguangPrinter';
12 16  
13   -export default ({ mainOrder, subOrders, isRePrint, setVisible, onClose }) => {
  17 +export default ({
  18 + mainOrder,
  19 + subOrders,
  20 + isRePrint,
  21 + setVisible,
  22 + printOptType,
  23 + onClose,
  24 +}) => {
14 25 const [printerType, setPrinterType] = useState('Houjie');
15 26 const { confirm } = Modal;
16 27 const handleChange = (value: string) => {
17 28 setPrinterType(value);
18 29 };
  30 + /**
  31 + * 是供应商打印还是普通打印
  32 + * @param typeString
  33 + * @returns
  34 + */
  35 + function optType(typeString: string) {
  36 + if (printOptType === typeString) {
  37 + return true;
  38 + }
  39 +
  40 + return false;
  41 + }
19 42 const showPropsConfirm = () => {
20 43 if (isRePrint) {
21 44 return;
... ... @@ -34,7 +57,19 @@ export default ({ mainOrder, subOrders, isRePrint, setVisible, onClose }) =&gt; {
34 57 return item.id;
35 58 }),
36 59 };
37   - const res = await postServiceOrderPrintOrder({ data: body });
  60 + let res;
  61 + if (optType(CHECK_TYPE.SUPPLIER)) {
  62 + res = await postServiceOrderSupplierPrint({
  63 + data: {
  64 + ids: subOrders.map((item) => {
  65 + return item.id;
  66 + }),
  67 + },
  68 + });
  69 + } else {
  70 + res = await postServiceOrderPrintOrder({ data: body });
  71 + }
  72 +
38 73 if (res.result === RESPONSE_CODE.SUCCESS) {
39 74 message.success(res.message);
40 75 onClose();
... ...
src/pages/OrderReport/components/OrderStatisticCard.tsx
... ... @@ -247,14 +247,14 @@ export default ({ data, statisticsMethod, reFreshData }) =&gt; {
247 247 </ProCard>
248 248 <ProCard
249 249 className="order-statictis-card"
250   - title={<CardTitle title={'未审核订单'} />}
  250 + title={<CardTitle title={'未审核订单'} />}
251 251 bordered
252 252 >
253 253 <CardContent unit="单" content={data.unCheckOrderNumber} />
254 254 </ProCard>
255 255 <ProCard
256 256 className="order-statictis-card"
257   - title={<CardTitle title={'未发货订单'} />}
  257 + title={<CardTitle title={'待发货子订单'} />}
258 258 bordered
259 259 >
260 260 <CardContent unit="单" content={data.unSendOrderNumber} />
... ...
src/services/definition.ts
... ... @@ -691,6 +691,19 @@ export interface OrderUpdateVO {
691 691 trackStageInfo?: OrderTrackStageVO;
692 692 }
693 693  
  694 +export interface ProcureCheckOrderDto {
  695 + /**
  696 + * @description
  697 + * 子订单集合
  698 + */
  699 + ids?: Array<number>;
  700 + /**
  701 + * @description
  702 + * 采购人姓名
  703 + */
  704 + supplier?: string;
  705 +}
  706 +
694 707 export interface ProductInformationDto {
695 708 /**
696 709 * @description
... ...
src/services/request.ts
... ... @@ -26,6 +26,7 @@ import type {
26 26 DictionaryQueryVO,
27 27 DictionaryVO,
28 28 Dto,
  29 + ModelAndView,
29 30 OrderAddVO,
30 31 OrderAuditLogQueryVO,
31 32 OrderBaseInfoQueryVO,
... ... @@ -34,6 +35,7 @@ import type {
34 35 OrderProfitAnalysisVo,
35 36 OrderUnlockFieldApplyVO,
36 37 OrderUpdateVO,
  38 + ProcureCheckOrderDto,
37 39 ProductInformationDto,
38 40 QueryAnnexDto,
39 41 QueryHistoryRecordDto,
... ... @@ -221,9 +223,7 @@ export interface GetErrorResponse {
221 223 * @description
222 224 * OK
223 225 */
224   - 200: {
225   - [propertyName: string]: any;
226   - };
  226 + 200: ModelAndView;
227 227 /**
228 228 * @description
229 229 * Unauthorized
... ... @@ -244,9 +244,9 @@ export interface GetErrorResponse {
244 244 export type GetErrorResponseSuccess = GetErrorResponse[200];
245 245 /**
246 246 * @description
247   - * error
  247 + * errorHtml
248 248 * @tags basic-error-controller
249   - * @produces *
  249 + * @produces text/html
250 250 */
251 251 export const getError = /* #__PURE__ */ (() => {
252 252 const method = 'get';
... ... @@ -270,9 +270,7 @@ export interface PutErrorResponse {
270 270 * @description
271 271 * OK
272 272 */
273   - 200: {
274   - [propertyName: string]: any;
275   - };
  273 + 200: ModelAndView;
276 274 /**
277 275 * @description
278 276 * Created
... ... @@ -298,9 +296,9 @@ export interface PutErrorResponse {
298 296 export type PutErrorResponseSuccess = PutErrorResponse[200];
299 297 /**
300 298 * @description
301   - * error
  299 + * errorHtml
302 300 * @tags basic-error-controller
303   - * @produces *
  301 + * @produces text/html
304 302 * @consumes application/json
305 303 */
306 304 export const putError = /* #__PURE__ */ (() => {
... ... @@ -325,9 +323,7 @@ export interface PostErrorResponse {
325 323 * @description
326 324 * OK
327 325 */
328   - 200: {
329   - [propertyName: string]: any;
330   - };
  326 + 200: ModelAndView;
331 327 /**
332 328 * @description
333 329 * Created
... ... @@ -353,9 +349,9 @@ export interface PostErrorResponse {
353 349 export type PostErrorResponseSuccess = PostErrorResponse[200];
354 350 /**
355 351 * @description
356   - * error
  352 + * errorHtml
357 353 * @tags basic-error-controller
358   - * @produces *
  354 + * @produces text/html
359 355 * @consumes application/json
360 356 */
361 357 export const postError = /* #__PURE__ */ (() => {
... ... @@ -380,9 +376,7 @@ export interface DeleteErrorResponse {
380 376 * @description
381 377 * OK
382 378 */
383   - 200: {
384   - [propertyName: string]: any;
385   - };
  379 + 200: ModelAndView;
386 380 /**
387 381 * @description
388 382 * No Content
... ... @@ -403,9 +397,9 @@ export interface DeleteErrorResponse {
403 397 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
404 398 /**
405 399 * @description
406   - * error
  400 + * errorHtml
407 401 * @tags basic-error-controller
408   - * @produces *
  402 + * @produces text/html
409 403 */
410 404 export const deleteError = /* #__PURE__ */ (() => {
411 405 const method = 'delete';
... ... @@ -429,9 +423,7 @@ export interface OptionsErrorResponse {
429 423 * @description
430 424 * OK
431 425 */
432   - 200: {
433   - [propertyName: string]: any;
434   - };
  426 + 200: ModelAndView;
435 427 /**
436 428 * @description
437 429 * No Content
... ... @@ -452,9 +444,9 @@ export interface OptionsErrorResponse {
452 444 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
453 445 /**
454 446 * @description
455   - * error
  447 + * errorHtml
456 448 * @tags basic-error-controller
457   - * @produces *
  449 + * @produces text/html
458 450 * @consumes application/json
459 451 */
460 452 export const optionsError = /* #__PURE__ */ (() => {
... ... @@ -479,9 +471,7 @@ export interface HeadErrorResponse {
479 471 * @description
480 472 * OK
481 473 */
482   - 200: {
483   - [propertyName: string]: any;
484   - };
  474 + 200: ModelAndView;
485 475 /**
486 476 * @description
487 477 * No Content
... ... @@ -502,9 +492,9 @@ export interface HeadErrorResponse {
502 492 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
503 493 /**
504 494 * @description
505   - * error
  495 + * errorHtml
506 496 * @tags basic-error-controller
507   - * @produces *
  497 + * @produces text/html
508 498 * @consumes application/json
509 499 */
510 500 export const headError = /* #__PURE__ */ (() => {
... ... @@ -529,9 +519,7 @@ export interface PatchErrorResponse {
529 519 * @description
530 520 * OK
531 521 */
532   - 200: {
533   - [propertyName: string]: any;
534   - };
  522 + 200: ModelAndView;
535 523 /**
536 524 * @description
537 525 * No Content
... ... @@ -552,9 +540,9 @@ export interface PatchErrorResponse {
552 540 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
553 541 /**
554 542 * @description
555   - * error
  543 + * errorHtml
556 544 * @tags basic-error-controller
557   - * @produces *
  545 + * @produces text/html
558 546 * @consumes application/json
559 547 */
560 548 export const patchError = /* #__PURE__ */ (() => {
... ... @@ -5350,6 +5338,77 @@ export const postServiceOrderFileProcess = /* #__PURE__ */ (() =&gt; {
5350 5338 return request;
5351 5339 })();
5352 5340  
  5341 +/** @description request parameter type for postServiceOrderFinanceCheckOrder */
  5342 +export interface PostServiceOrderFinanceCheckOrderOption {
  5343 + /**
  5344 + * @description
  5345 + * dto
  5346 + */
  5347 + body: {
  5348 + /**
  5349 + @description
  5350 + dto */
  5351 + dto: Dto;
  5352 + };
  5353 +}
  5354 +
  5355 +/** @description response type for postServiceOrderFinanceCheckOrder */
  5356 +export interface PostServiceOrderFinanceCheckOrderResponse {
  5357 + /**
  5358 + * @description
  5359 + * OK
  5360 + */
  5361 + 200: ServerResult;
  5362 + /**
  5363 + * @description
  5364 + * Created
  5365 + */
  5366 + 201: any;
  5367 + /**
  5368 + * @description
  5369 + * Unauthorized
  5370 + */
  5371 + 401: any;
  5372 + /**
  5373 + * @description
  5374 + * Forbidden
  5375 + */
  5376 + 403: any;
  5377 + /**
  5378 + * @description
  5379 + * Not Found
  5380 + */
  5381 + 404: any;
  5382 +}
  5383 +
  5384 +export type PostServiceOrderFinanceCheckOrderResponseSuccess =
  5385 + PostServiceOrderFinanceCheckOrderResponse[200];
  5386 +/**
  5387 + * @description
  5388 + * 财务审核订单
  5389 + * @tags 内部订单
  5390 + * @produces *
  5391 + * @consumes application/json
  5392 + */
  5393 +export const postServiceOrderFinanceCheckOrder = /* #__PURE__ */ (() => {
  5394 + const method = 'post';
  5395 + const url = '/service/order/financeCheckOrder';
  5396 + function request(
  5397 + option: PostServiceOrderFinanceCheckOrderOption,
  5398 + ): Promise<PostServiceOrderFinanceCheckOrderResponseSuccess> {
  5399 + return requester(request.url, {
  5400 + method: request.method,
  5401 + ...option,
  5402 + }) as unknown as Promise<PostServiceOrderFinanceCheckOrderResponseSuccess>;
  5403 + }
  5404 +
  5405 + /** http method */
  5406 + request.method = method;
  5407 + /** request url */
  5408 + request.url = url;
  5409 + return request;
  5410 +})();
  5411 +
5353 5412 /** @description request parameter type for postServiceOrderImportExcel */
5354 5413 export interface PostServiceOrderImportExcelOption {
5355 5414 /**
... ... @@ -5634,6 +5693,77 @@ export const postServiceOrderPrintOrder = /* #__PURE__ */ (() =&gt; {
5634 5693 return request;
5635 5694 })();
5636 5695  
  5696 +/** @description request parameter type for postServiceOrderProcureCheckOrder */
  5697 +export interface PostServiceOrderProcureCheckOrderOption {
  5698 + /**
  5699 + * @description
  5700 + * dto
  5701 + */
  5702 + body: {
  5703 + /**
  5704 + @description
  5705 + dto */
  5706 + dto: ProcureCheckOrderDto;
  5707 + };
  5708 +}
  5709 +
  5710 +/** @description response type for postServiceOrderProcureCheckOrder */
  5711 +export interface PostServiceOrderProcureCheckOrderResponse {
  5712 + /**
  5713 + * @description
  5714 + * OK
  5715 + */
  5716 + 200: ServerResult;
  5717 + /**
  5718 + * @description
  5719 + * Created
  5720 + */
  5721 + 201: any;
  5722 + /**
  5723 + * @description
  5724 + * Unauthorized
  5725 + */
  5726 + 401: any;
  5727 + /**
  5728 + * @description
  5729 + * Forbidden
  5730 + */
  5731 + 403: any;
  5732 + /**
  5733 + * @description
  5734 + * Not Found
  5735 + */
  5736 + 404: any;
  5737 +}
  5738 +
  5739 +export type PostServiceOrderProcureCheckOrderResponseSuccess =
  5740 + PostServiceOrderProcureCheckOrderResponse[200];
  5741 +/**
  5742 + * @description
  5743 + * 采购审核订单
  5744 + * @tags 内部订单
  5745 + * @produces *
  5746 + * @consumes application/json
  5747 + */
  5748 +export const postServiceOrderProcureCheckOrder = /* #__PURE__ */ (() => {
  5749 + const method = 'post';
  5750 + const url = '/service/order/procureCheckOrder';
  5751 + function request(
  5752 + option: PostServiceOrderProcureCheckOrderOption,
  5753 + ): Promise<PostServiceOrderProcureCheckOrderResponseSuccess> {
  5754 + return requester(request.url, {
  5755 + method: request.method,
  5756 + ...option,
  5757 + }) as unknown as Promise<PostServiceOrderProcureCheckOrderResponseSuccess>;
  5758 + }
  5759 +
  5760 + /** http method */
  5761 + request.method = method;
  5762 + /** request url */
  5763 + request.url = url;
  5764 + return request;
  5765 +})();
  5766 +
5637 5767 /** @description response type for getServiceOrderProvideInvoicingStatus */
5638 5768 export interface GetServiceOrderProvideInvoicingStatusResponse {
5639 5769 /**
... ... @@ -6376,6 +6506,60 @@ export const postServiceOrderQueryServiceOrder = /* #__PURE__ */ (() =&gt; {
6376 6506 return request;
6377 6507 })();
6378 6508  
  6509 +/** @description response type for postServiceOrderQuerySupplier */
  6510 +export interface PostServiceOrderQuerySupplierResponse {
  6511 + /**
  6512 + * @description
  6513 + * OK
  6514 + */
  6515 + 200: ServerResult;
  6516 + /**
  6517 + * @description
  6518 + * Created
  6519 + */
  6520 + 201: any;
  6521 + /**
  6522 + * @description
  6523 + * Unauthorized
  6524 + */
  6525 + 401: any;
  6526 + /**
  6527 + * @description
  6528 + * Forbidden
  6529 + */
  6530 + 403: any;
  6531 + /**
  6532 + * @description
  6533 + * Not Found
  6534 + */
  6535 + 404: any;
  6536 +}
  6537 +
  6538 +export type PostServiceOrderQuerySupplierResponseSuccess =
  6539 + PostServiceOrderQuerySupplierResponse[200];
  6540 +/**
  6541 + * @description
  6542 + * 提供供应商名单
  6543 + * @tags 内部订单
  6544 + * @produces *
  6545 + * @consumes application/json
  6546 + */
  6547 +export const postServiceOrderQuerySupplier = /* #__PURE__ */ (() => {
  6548 + const method = 'post';
  6549 + const url = '/service/order/querySupplier';
  6550 + function request(): Promise<PostServiceOrderQuerySupplierResponseSuccess> {
  6551 + return requester(request.url, {
  6552 + method: request.method,
  6553 + }) as unknown as Promise<PostServiceOrderQuerySupplierResponseSuccess>;
  6554 + }
  6555 +
  6556 + /** http method */
  6557 + request.method = method;
  6558 + /** request url */
  6559 + request.url = url;
  6560 + return request;
  6561 +})();
  6562 +
6379 6563 /** @description request parameter type for postServiceOrderSendProduct */
6380 6564 export interface PostServiceOrderSendProductOption {
6381 6565 /**
... ... @@ -6447,6 +6631,148 @@ export const postServiceOrderSendProduct = /* #__PURE__ */ (() =&gt; {
6447 6631 return request;
6448 6632 })();
6449 6633  
  6634 +/** @description request parameter type for postServiceOrderSupplierPrint */
  6635 +export interface PostServiceOrderSupplierPrintOption {
  6636 + /**
  6637 + * @description
  6638 + * dto
  6639 + */
  6640 + body: {
  6641 + /**
  6642 + @description
  6643 + dto */
  6644 + dto: Dto;
  6645 + };
  6646 +}
  6647 +
  6648 +/** @description response type for postServiceOrderSupplierPrint */
  6649 +export interface PostServiceOrderSupplierPrintResponse {
  6650 + /**
  6651 + * @description
  6652 + * OK
  6653 + */
  6654 + 200: ServerResult;
  6655 + /**
  6656 + * @description
  6657 + * Created
  6658 + */
  6659 + 201: any;
  6660 + /**
  6661 + * @description
  6662 + * Unauthorized
  6663 + */
  6664 + 401: any;
  6665 + /**
  6666 + * @description
  6667 + * Forbidden
  6668 + */
  6669 + 403: any;
  6670 + /**
  6671 + * @description
  6672 + * Not Found
  6673 + */
  6674 + 404: any;
  6675 +}
  6676 +
  6677 +export type PostServiceOrderSupplierPrintResponseSuccess =
  6678 + PostServiceOrderSupplierPrintResponse[200];
  6679 +/**
  6680 + * @description
  6681 + * 供应商打印
  6682 + * @tags 内部订单
  6683 + * @produces *
  6684 + * @consumes application/json
  6685 + */
  6686 +export const postServiceOrderSupplierPrint = /* #__PURE__ */ (() => {
  6687 + const method = 'post';
  6688 + const url = '/service/order/supplierPrint';
  6689 + function request(
  6690 + option: PostServiceOrderSupplierPrintOption,
  6691 + ): Promise<PostServiceOrderSupplierPrintResponseSuccess> {
  6692 + return requester(request.url, {
  6693 + method: request.method,
  6694 + ...option,
  6695 + }) as unknown as Promise<PostServiceOrderSupplierPrintResponseSuccess>;
  6696 + }
  6697 +
  6698 + /** http method */
  6699 + request.method = method;
  6700 + /** request url */
  6701 + request.url = url;
  6702 + return request;
  6703 +})();
  6704 +
  6705 +/** @description request parameter type for postServiceOrderSupplierSendOrder */
  6706 +export interface PostServiceOrderSupplierSendOrderOption {
  6707 + /**
  6708 + * @description
  6709 + * dto
  6710 + */
  6711 + body: {
  6712 + /**
  6713 + @description
  6714 + dto */
  6715 + dto: Dto;
  6716 + };
  6717 +}
  6718 +
  6719 +/** @description response type for postServiceOrderSupplierSendOrder */
  6720 +export interface PostServiceOrderSupplierSendOrderResponse {
  6721 + /**
  6722 + * @description
  6723 + * OK
  6724 + */
  6725 + 200: ServerResult;
  6726 + /**
  6727 + * @description
  6728 + * Created
  6729 + */
  6730 + 201: any;
  6731 + /**
  6732 + * @description
  6733 + * Unauthorized
  6734 + */
  6735 + 401: any;
  6736 + /**
  6737 + * @description
  6738 + * Forbidden
  6739 + */
  6740 + 403: any;
  6741 + /**
  6742 + * @description
  6743 + * Not Found
  6744 + */
  6745 + 404: any;
  6746 +}
  6747 +
  6748 +export type PostServiceOrderSupplierSendOrderResponseSuccess =
  6749 + PostServiceOrderSupplierSendOrderResponse[200];
  6750 +/**
  6751 + * @description
  6752 + * 供应商发货
  6753 + * @tags 内部订单
  6754 + * @produces *
  6755 + * @consumes application/json
  6756 + */
  6757 +export const postServiceOrderSupplierSendOrder = /* #__PURE__ */ (() => {
  6758 + const method = 'post';
  6759 + const url = '/service/order/supplierSendOrder';
  6760 + function request(
  6761 + option: PostServiceOrderSupplierSendOrderOption,
  6762 + ): Promise<PostServiceOrderSupplierSendOrderResponseSuccess> {
  6763 + return requester(request.url, {
  6764 + method: request.method,
  6765 + ...option,
  6766 + }) as unknown as Promise<PostServiceOrderSupplierSendOrderResponseSuccess>;
  6767 + }
  6768 +
  6769 + /** http method */
  6770 + request.method = method;
  6771 + /** request url */
  6772 + request.url = url;
  6773 + return request;
  6774 +})();
  6775 +
6450 6776 /** @description request parameter type for postServiceOrderUpdateAnnex */
6451 6777 export interface PostServiceOrderUpdateAnnexOption {
6452 6778 /**
... ...
src/utils/user.ts
... ... @@ -6,7 +6,7 @@ export const getUserInfo = () =&gt; {
6 6 let localUserInfo = localStorage.getItem('userInfo');
7 7  
8 8 if (localUserInfo === null || localUserInfo === undefined) {
9   - localUserInfo = '';
  9 + localUserInfo = '{}';
10 10 }
11 11 const userInfo = JSON.parse(localUserInfo);
12 12  
... ...