Commit 3201699b76da79362b0ec9a1d73bb8ead931e078

Authored by 曾国涛
1 parent 2d6efa55

Merge branch 'master' into zgt移除ManualInvoicingModal中的非必要注释代码

发现并删除了ManualInvoicingModal组件中未使用的注释代码,以提高代码清晰度和维护性。
src/pages/Client/index.tsx
@@ -256,7 +256,6 @@ export default () => { @@ -256,7 +256,6 @@ export default () => {
256 return data; 256 return data;
257 }} 257 }}
258 search={{ 258 search={{
259 - defaultCollapsed: false,  
260 optionRender: (searchConfig, formProps, dom) => [ 259 optionRender: (searchConfig, formProps, dom) => [
261 ...dom.reverse(), 260 ...dom.reverse(),
262 <Button 261 <Button
src/pages/Invoice/InvoiceRecord/index.tsx
@@ -53,11 +53,13 @@ const InvoiceRecord = () =&gt; { @@ -53,11 +53,13 @@ const InvoiceRecord = () =&gt; {
53 { 53 {
54 dataIndex: 'index', 54 dataIndex: 'index',
55 valueType: 'indexBorder', 55 valueType: 'indexBorder',
  56 + width: 50,
56 }, 57 },
57 { 58 {
58 title: '开票编号', 59 title: '开票编号',
59 valueType: 'text', 60 valueType: 'text',
60 dataIndex: 'id', 61 dataIndex: 'id',
  62 + width: 100,
61 copyable: true, 63 copyable: true,
62 ellipsis: true, 64 ellipsis: true,
63 }, 65 },
@@ -65,13 +67,14 @@ const InvoiceRecord = () =&gt; { @@ -65,13 +67,14 @@ const InvoiceRecord = () =&gt; {
65 title: '发票号码', 67 title: '发票号码',
66 valueType: 'text', 68 valueType: 'text',
67 dataIndex: 'invoiceNumber', 69 dataIndex: 'invoiceNumber',
  70 + width: 150,
68 copyable: true, 71 copyable: true,
69 ellipsis: true, 72 ellipsis: true,
70 }, 73 },
71 { 74 {
72 title: '重开发票', 75 title: '重开发票',
73 key: 'reissueInvoiceNumbers', 76 key: 'reissueInvoiceNumbers',
74 - width: 120, 77 + width: 150,
75 ellipsis: true, 78 ellipsis: true,
76 hideInSearch: true, 79 hideInSearch: true,
77 render: (_, record) => { 80 render: (_, record) => {
@@ -101,6 +104,7 @@ const InvoiceRecord = () =&gt; { @@ -101,6 +104,7 @@ const InvoiceRecord = () =&gt; {
101 title: '发票类型', 104 title: '发票类型',
102 valueType: 'Text', 105 valueType: 'Text',
103 dataIndex: 'typeText', 106 dataIndex: 'typeText',
  107 + width: 100,
104 hideInSearch: true, 108 hideInSearch: true,
105 ellipsis: true, 109 ellipsis: true,
106 }, 110 },
@@ -108,6 +112,7 @@ const InvoiceRecord = () =&gt; { @@ -108,6 +112,7 @@ const InvoiceRecord = () =&gt; {
108 title: '发票状态', 112 title: '发票状态',
109 valueType: 'Text', 113 valueType: 'Text',
110 dataIndex: 'statusText', 114 dataIndex: 'statusText',
  115 + width: 100,
111 hideInSearch: true, 116 hideInSearch: true,
112 ellipsis: true, 117 ellipsis: true,
113 }, 118 },
@@ -122,6 +127,7 @@ const InvoiceRecord = () =&gt; { @@ -122,6 +127,7 @@ const InvoiceRecord = () =&gt; {
122 title: '联系人', 127 title: '联系人',
123 valueType: 'text', 128 valueType: 'text',
124 dataIndex: 'contacts', 129 dataIndex: 'contacts',
  130 + width: 100,
125 hideInSearch: true, 131 hideInSearch: true,
126 ellipsis: true, 132 ellipsis: true,
127 }, 133 },
@@ -141,6 +147,7 @@ const InvoiceRecord = () =&gt; { @@ -141,6 +147,7 @@ const InvoiceRecord = () =&gt; {
141 { 147 {
142 title: '申请人', 148 title: '申请人',
143 valueType: 'text', 149 valueType: 'text',
  150 + width: 100,
144 dataIndex: 'createByName', 151 dataIndex: 'createByName',
145 hideInSearch: true, 152 hideInSearch: true,
146 ellipsis: true, 153 ellipsis: true,
@@ -149,6 +156,7 @@ const InvoiceRecord = () =&gt; { @@ -149,6 +156,7 @@ const InvoiceRecord = () =&gt; {
149 title: '开票金额(元)', 156 title: '开票金额(元)',
150 valueType: 'money', 157 valueType: 'money',
151 dataIndex: 'price', 158 dataIndex: 'price',
  159 + width: 100,
152 hideInSearch: true, 160 hideInSearch: true,
153 ellipsis: true, 161 ellipsis: true,
154 }, 162 },
@@ -395,7 +403,7 @@ const InvoiceRecord = () =&gt; { @@ -395,7 +403,7 @@ const InvoiceRecord = () =&gt; {
395 form={{}} 403 form={{}}
396 dateFormatter="string" 404 dateFormatter="string"
397 headerTitle="待开票列表" 405 headerTitle="待开票列表"
398 - scroll={{ x: 1400, y: 360 }} 406 + scroll={{ x: 2400, y: 360 }}
399 toolBarRender={() => []} 407 toolBarRender={() => []}
400 /> 408 />
401 409
src/pages/Invoice/waitProcessRecord/index.tsx
@@ -135,6 +135,14 @@ const InvoiceRecord = () =&gt; { @@ -135,6 +135,14 @@ const InvoiceRecord = () =&gt; {
135 ellipsis: true, 135 ellipsis: true,
136 }, 136 },
137 { 137 {
  138 + title: '联系人',
  139 + valueType: 'text',
  140 + dataIndex: 'contacts',
  141 + width: 100,
  142 + hideInSearch: true,
  143 + ellipsis: true,
  144 + },
  145 + {
138 title: '购方税号', 146 title: '购方税号',
139 valueType: 'text', 147 valueType: 'text',
140 hideInSearch: true, 148 hideInSearch: true,
@@ -194,6 +202,12 @@ const InvoiceRecord = () =&gt; { @@ -194,6 +202,12 @@ const InvoiceRecord = () =&gt; {
194 hideInTable: true, 202 hideInTable: true,
195 }, 203 },
196 { 204 {
  205 + title: '联系人',
  206 + valueType: 'text',
  207 + dataIndex: 'contactsLike',
  208 + hideInTable: true,
  209 + },
  210 + {
197 title: '收款单位', 211 title: '收款单位',
198 valueType: 'select', 212 valueType: 'select',
199 dataIndex: 'partyB', 213 dataIndex: 'partyB',
@@ -402,7 +416,7 @@ const InvoiceRecord = () =&gt; { @@ -402,7 +416,7 @@ const InvoiceRecord = () =&gt; {
402 form={{}} 416 form={{}}
403 dateFormatter="string" 417 dateFormatter="string"
404 headerTitle="待开票列表" 418 headerTitle="待开票列表"
405 - scroll={{ x: 2400, y: 500 }} 419 + scroll={{ x: 2000, y: 500 }}
406 /> 420 />
407 {invoiceRecordDetailVisible ? ( 421 {invoiceRecordDetailVisible ? (
408 <InvoiceRecordDetailModal 422 <InvoiceRecordDetailModal
src/pages/Order/index.tsx
@@ -77,7 +77,7 @@ import { @@ -77,7 +77,7 @@ import {
77 } from 'antd'; 77 } from 'antd';
78 import Base64 from 'base-64'; 78 import Base64 from 'base-64';
79 import { cloneDeep } from 'lodash'; 79 import { cloneDeep } from 'lodash';
80 -import React, { Key, useEffect, useRef, useState } from 'react'; 80 +import React, { Key, useEffect, useMemo, useRef, useState } from 'react';
81 import OrderPrintModal from '../OrderPrint/OrderPrintModal'; 81 import OrderPrintModal from '../OrderPrint/OrderPrintModal';
82 import AfterSalesDrawer from './components/AfterSalesDrawer'; 82 import AfterSalesDrawer from './components/AfterSalesDrawer';
83 import ApplyForInvoicingModal from './components/ApplyForInvoicingModal'; 83 import ApplyForInvoicingModal from './components/ApplyForInvoicingModal';
@@ -188,7 +188,7 @@ const OrderPage = () =&gt; { @@ -188,7 +188,7 @@ const OrderPage = () =&gt; {
188 const [imagesViewerOptType, setImagesViewerOptType] = useState(''); 188 const [imagesViewerOptType, setImagesViewerOptType] = useState('');
189 const [filterCondifion, setFilterCondition] = useState(0); 189 const [filterCondifion, setFilterCondition] = useState(0);
190 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据 190 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
191 - const [subOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合 191 + const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
192 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id 192 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
193 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id 193 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
194 const [subOrderCount, setSubOrderCount] = useState(0); 194 const [subOrderCount, setSubOrderCount] = useState(0);
@@ -206,6 +206,18 @@ const OrderPage = () =&gt; { @@ -206,6 +206,18 @@ const OrderPage = () =&gt; {
206 const [ids, setIds] = useState([]); 206 const [ids, setIds] = useState([]);
207 const [recordOptNode, setRecordOptNode] = useState(null); 207 const [recordOptNode, setRecordOptNode] = useState(null);
208 const roleCode = userInfo?.roleSmallVO?.code; 208 const roleCode = userInfo?.roleSmallVO?.code;
  209 + const canMergeInvoicing = useMemo(() => {
  210 + if (subOrderSelectedMap.size === 0) {
  211 + return false;
  212 + }
  213 + // 检查 value.items 中的每个元素
  214 + console.log(
  215 + 'map' + JSON.stringify([...subOrderSelectedMap.values()].flat()),
  216 + );
  217 + return [...subOrderSelectedMap.values()]
  218 + .flat()
  219 + .every((subItem) => subItem.paths.includes('applyInvoicing_old'));
  220 + }, [selectedSubOrderKeys]);
209 221
210 const triggerRecordOptNode = async (id) => { 222 const triggerRecordOptNode = async (id) => {
211 const res = await postServiceOrderGetCurrentOptNode({ 223 const res = await postServiceOrderGetCurrentOptNode({
@@ -227,12 +239,6 @@ const OrderPage = () =&gt; { @@ -227,12 +239,6 @@ const OrderPage = () =&gt; {
227 const exportLoadingDestory = () => { 239 const exportLoadingDestory = () => {
228 messageApi.destroy(); 240 messageApi.destroy();
229 }; 241 };
230 - useEffect(() => {  
231 - console.log(  
232 - 'selectedRows',  
233 - selectedRows.every((item) => item.paths.includes('applyInvoicing_old')),  
234 - );  
235 - }, [selectedRows]);  
236 242
237 const refreshTable = () => { 243 const refreshTable = () => {
238 mainTableRef.current?.reload(); 244 mainTableRef.current?.reload();
@@ -580,6 +586,7 @@ const OrderPage = () =&gt; { @@ -580,6 +586,7 @@ const OrderPage = () =&gt; {
580 mainOrderSelectedMap.set(record.id, record); 586 mainOrderSelectedMap.set(record.id, record);
581 //选中子订单 587 //选中子订单
582 subOrderSelectedMap.set(record.id, record.subOrderInformationLists); 588 subOrderSelectedMap.set(record.id, record.subOrderInformationLists);
  589 + setSubOrderSelectedMap(new Map(subOrderSelectedMap));
583 590
584 //如果所有主订单都勾选上了,那么勾选上总选中按钮 591 //如果所有主订单都勾选上了,那么勾选上总选中按钮
585 if ( 592 if (
@@ -2347,7 +2354,7 @@ const OrderPage = () =&gt; { @@ -2347,7 +2354,7 @@ const OrderPage = () =&gt; {
2347 } 2354 }
2348 2355
2349 //如果该主订单已经没有子订单选中,删除key 2356 //如果该主订单已经没有子订单选中,删除key
2350 - if (currentMainOrderSelectedSubOrderList.length === 0) { 2357 + if (currentMainOrderSelectedSubOrderList?.length === 0) {
2351 subOrderSelectedMap.delete(record.id); 2358 subOrderSelectedMap.delete(record.id);
2352 } else { 2359 } else {
2353 subOrderSelectedMap.set( 2360 subOrderSelectedMap.set(
@@ -4322,12 +4329,7 @@ const OrderPage = () =&gt; { @@ -4322,12 +4329,7 @@ const OrderPage = () =&gt; {
4322 setIsMainOrder(true); 4329 setIsMainOrder(true);
4323 setApplyForInvoicingVisible(true); 4330 setApplyForInvoicingVisible(true);
4324 }} 4331 }}
4325 - disabled={  
4326 - selectedRows.length === 0 ||  
4327 - !selectedRows.every((item) =>  
4328 - item.paths.includes('applyInvoicing_old'),  
4329 - )  
4330 - } /*{selectedSubOrderKeys?.length === 0}*/ 4332 + disabled={!canMergeInvoicing} /*{selectedSubOrderKeys?.length === 0}*/
4331 > 4333 >
4332 {roleCode === 'admin' ? '合并(销售)' : '合并开票'} 4334 {roleCode === 'admin' ? '合并(销售)' : '合并开票'}
4333 </Button>, 4335 </Button>,
src/pages/procure/components/AddDrawer.tsx
  1 +import { RESPONSE_CODE } from '@/constants/enum';
1 import { 2 import {
2 postOrderErpOrderStagesUpload, 3 postOrderErpOrderStagesUpload,
  4 + postProcureReturnBillAdd,
3 postServiceConstStores, 5 postServiceConstStores,
4 } from '@/services'; 6 } from '@/services';
5 import { enumToSelect } from '@/utils'; 7 import { enumToSelect } from '@/utils';
@@ -13,7 +15,7 @@ import { @@ -13,7 +15,7 @@ import {
13 import { Button, Form, message } from 'antd'; 15 import { Button, Form, message } from 'antd';
14 import { RcFile } from 'antd/es/upload'; 16 import { RcFile } from 'antd/es/upload';
15 17
16 -export default () => { 18 +export default ({ reloadTable }) => {
17 const [form] = Form.useForm(); 19 const [form] = Form.useForm();
18 return ( 20 return (
19 <DrawerForm 21 <DrawerForm
@@ -33,8 +35,15 @@ export default () =&gt; { @@ -33,8 +35,15 @@ export default () =&gt; {
33 }} 35 }}
34 submitTimeout={2000} 36 submitTimeout={2000}
35 onFinish={async (values) => { 37 onFinish={async (values) => {
36 - console.log(values.name); 38 + const res = await postProcureReturnBillAdd({
  39 + data: values,
  40 + });
  41 + if (res.result === RESPONSE_CODE.SUCCESS) {
  42 + message.success('新增成功');
  43 + return true;
  44 + }
37 message.success('提交成功'); 45 message.success('提交成功');
  46 + reloadTable();
38 // 不返回不会关闭弹框 47 // 不返回不会关闭弹框
39 return true; 48 return true;
40 }} 49 }}
@@ -84,7 +93,7 @@ export default () =&gt; { @@ -84,7 +93,7 @@ export default () =&gt; {
84 ]} 93 ]}
85 ></ProFormTextArea> 94 ></ProFormTextArea>
86 <ProFormSelect 95 <ProFormSelect
87 - name="sendStore" 96 + name="sendStoreCode"
88 label="发货仓库" 97 label="发货仓库"
89 request={async () => { 98 request={async () => {
90 const res = await postServiceConstStores(); 99 const res = await postServiceConstStores();
@@ -106,22 +115,26 @@ export default () =&gt; { @@ -106,22 +115,26 @@ export default () =&gt; {
106 label="附件" 115 label="附件"
107 name="attachmentsFile" 116 name="attachmentsFile"
108 action="upload.do" 117 action="upload.do"
109 - onChange={({ fileList: newFileList }) => {  
110 - if (newFileList.length > 0) {  
111 - const formData = new FormData();  
112 - formData.append('file', newFileList[0].originFileObj as RcFile);  
113 - const res = await postOrderErpOrderStagesUpload({  
114 - data: formData,  
115 - headers: {  
116 - 'Content-Type':  
117 - 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',  
118 - },  
119 - });  
120 - const url = res.data;  
121 - form.setFieldValue('attachments', url);  
122 - } else {  
123 - form.setFieldValue('attachments', null);  
124 - } 118 + onChange={(info) => {
  119 + const uploadFile = async ({ fileList: newFileList }) => {
  120 + if (newFileList.length > 0) {
  121 + const formData = new FormData();
  122 + formData.append('file', newFileList[0].originFileObj as RcFile);
  123 + const res = await postOrderErpOrderStagesUpload({
  124 + data: formData,
  125 + headers: {
  126 + 'Content-Type':
  127 + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  128 + },
  129 + });
  130 + const url = res.data;
  131 + console.log('attachments' + JSON.stringify(url));
  132 + form.setFieldValue('attachments', url);
  133 + } else {
  134 + form.setFieldValue('attachments', null);
  135 + }
  136 + };
  137 + uploadFile(info);
125 }} 138 }}
126 max={1} 139 max={1}
127 /> 140 />