Commit b559aad7f6ad362cf23818301c2f46ce3db311f3

Authored by zhongnanhuang
1 parent cc919860

feat: update取消申请开票、仓库编辑

src/pages/Order/components/CheckModal.tsx
@@ -4,7 +4,6 @@ import { @@ -4,7 +4,6 @@ import {
4 postServiceOrderCheckOrder, 4 postServiceOrderCheckOrder,
5 postServiceOrderFileProcess, 5 postServiceOrderFileProcess,
6 postServiceOrderFinanceCheckOrder, 6 postServiceOrderFinanceCheckOrder,
7 - postServiceOrderQueryAfterSalesInfoSnapshot,  
8 } from '@/services'; 7 } from '@/services';
9 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components'; 8 import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
10 import { Button, Col, Form, Modal, Row, UploadFile, message } from 'antd'; 9 import { Button, Col, Form, Modal, Row, UploadFile, message } from 'antd';
@@ -62,21 +61,22 @@ export default ({ @@ -62,21 +61,22 @@ export default ({
62 } 61 }
63 62
64 const getOrderAfterSalesInfo = async () => { 63 const getOrderAfterSalesInfo = async () => {
65 - let res = await postServiceOrderQueryAfterSalesInfoSnapshot({  
66 - data: { subOrderIds: subOrderIds },  
67 - }); 64 + // let res = await postServiceOrderQueryAfterSalesInfoSnapshot({
  65 + // data: { subOrderIds: subOrderIds },
  66 + // });
68 67
69 //附件 68 //附件
70 - let annex = res?.data[0]?.afterSalesAnnexList;  
71 - 69 + let annex = subOrders[0].afterAnnexList;
72 let annexLinks = annex?.map((f) => { 70 let annexLinks = annex?.map((f) => {
73 return ( 71 return (
74 - <Button type="link" key="key" href={f}> 72 + <Button className="p-0 pr-1" type="link" key="key" href={f}>
75 {getAliYunOSSFileNameFromUrl(f)} 73 {getAliYunOSSFileNameFromUrl(f)}
76 </Button> 74 </Button>
77 ); 75 );
78 }); 76 });
79 77
  78 + console.log(annexLinks);
  79 +
80 setAfterSalesInfo( 80 setAfterSalesInfo(
81 <div className="my-5"> 81 <div className="my-5">
82 <Row gutter={[16, 24]}> 82 <Row gutter={[16, 24]}>
@@ -85,14 +85,14 @@ export default ({ @@ -85,14 +85,14 @@ export default ({
85 </Col> 85 </Col>
86 <Col span={18}> 86 <Col span={18}>
87 {enumValueToLabel( 87 {enumValueToLabel(
88 - res?.data[0]?.afterSalesPlan, 88 + subOrders[0]?.afterSalesPlan,
89 AFTE_SALES_PLAN_OPTIONS, 89 AFTE_SALES_PLAN_OPTIONS,
90 )} 90 )}
91 </Col> 91 </Col>
92 <Col span={6}> 92 <Col span={6}>
93 <span className="className='text-[#333333]'">售后原因</span> 93 <span className="className='text-[#333333]'">售后原因</span>
94 </Col> 94 </Col>
95 - <Col span={18}>{res?.data[0]?.afterSalesNotes}</Col> 95 + <Col span={18}>{subOrders[0]?.afterSalesNotes}</Col>
96 <Col span={6}> 96 <Col span={6}>
97 <span className="className='text-[#333333]'">附件</span> 97 <span className="className='text-[#333333]'">附件</span>
98 </Col> 98 </Col>
src/pages/Order/components/OrderDrawer.tsx
@@ -204,14 +204,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -204,14 +204,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
204 * 回显金蝶信息 204 * 回显金蝶信息
205 */ 205 */
206 async function showKindeeInfo() { 206 async function showKindeeInfo() {
  207 + console.log(copyData);
207 //客户信息 208 //客户信息
208 - if (data.customerId) { 209 + if (copyData.customerId) {
209 //客户回显 210 //客户回显
210 - autoFillCustomerContactSelectOptions(data.customerId); 211 + autoFillCustomerContactSelectOptions(copyData.customerId);
211 } 212 }
212 213
213 //商品单位回显 214 //商品单位回显
214 - let list = data?.subOrderInformationLists; 215 + let list = copyData?.subOrderInformationLists;
215 if (list) { 216 if (list) {
216 let newProductUnitOptionsList = [...productUnitOptionsList]; 217 let newProductUnitOptionsList = [...productUnitOptionsList];
217 for (let i = 0; i < list.length; i++) { 218 for (let i = 0; i < list.length; i++) {
@@ -276,9 +277,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -276,9 +277,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
276 } 277 }
277 278
278 getSalesCodeOptions(); 279 getSalesCodeOptions();
279 - showKindeeInfo(); 280 + if (!optType('after-sales-check')) {
  281 + showKindeeInfo();
  282 + }
280 } 283 }
281 284
  285 + /**
  286 + * 获取旧订单信息
  287 + * @param id
  288 + */
282 async function getOldOrderData(id: any) { 289 async function getOldOrderData(id: any) {
283 let res = await postServiceOrderAfterSalesQuerySnapshotOrder({ 290 let res = await postServiceOrderAfterSalesQuerySnapshotOrder({
284 data: { 291 data: {
@@ -286,11 +293,16 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -286,11 +293,16 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
286 }, 293 },
287 }); 294 });
288 295
289 - console.log(res);  
290 copyData = res.data.mainOrder; 296 copyData = res.data.mainOrder;
291 copyData.subOrderInformationLists = res.data.subOrders; 297 copyData.subOrderInformationLists = res.data.subOrders;
292 originSubOrders = res.data.subOrders; 298 originSubOrders = res.data.subOrders;
293 299
  300 + //客户显示
  301 + form.setFieldValue('erpCustomerId', {
  302 + label: copyData.erpCustomerName,
  303 + value: copyData.customerId,
  304 + });
  305 +
294 buildOrderData(); 306 buildOrderData();
295 } 307 }
296 308
@@ -503,6 +515,23 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -503,6 +515,23 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
503 form.setFieldValue('totalPayment', totalPayment); 515 form.setFieldValue('totalPayment', totalPayment);
504 } 516 }
505 517
  518 + /**
  519 + * 检查客户是否可以编辑
  520 + * @returns
  521 + */
  522 + const customerEditable = () => {
  523 + let erpCustomerId = form.getFieldValue('erpCustomerId');
  524 + if (
  525 + optType('after-sales-check') ||
  526 + erpCustomerId === null ||
  527 + erpCustomerId === undefined
  528 + ) {
  529 + return false;
  530 + }
  531 +
  532 + return true;
  533 + };
  534 +
506 useEffect(() => { 535 useEffect(() => {
507 if (optType('after-sales-check')) { 536 if (optType('after-sales-check')) {
508 getOldOrderData(data.id); 537 getOldOrderData(data.id);
@@ -547,6 +576,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -547,6 +576,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
547 onClick={() => { 576 onClick={() => {
548 setSubmitBtnLoading(true); 577 setSubmitBtnLoading(true);
549 props.submit(); 578 props.submit();
  579 + setSubmitBtnLoading(false);
550 }} 580 }}
551 > 581 >
552 确定 582 确定
@@ -705,12 +735,19 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -705,12 +735,19 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
705 key="erpCustomerId" 735 key="erpCustomerId"
706 width="lg" 736 width="lg"
707 showSearch 737 showSearch
  738 + disabled={optType('after-sales-check')}
708 label={ 739 label={
709 <> 740 <>
710 <span>客户</span> 741 <span>客户</span>
711 <span 742 <span
712 - className="pl-2 text-xs text-[#1677ff] cursor-pointer" 743 + className={
  744 + 'pl-2 text-xs cursor-pointer ' +
  745 + (customerEditable() ? 'text-[#1677ff]' : 'text-gray-400')
  746 + }
713 onClick={() => { 747 onClick={() => {
  748 + if (!customerEditable()) {
  749 + return;
  750 + }
714 let customerId = form.getFieldValue('erpCustomerId'); 751 let customerId = form.getFieldValue('erpCustomerId');
715 if (typeof customerId === 'string') { 752 if (typeof customerId === 'string') {
716 setCustomer({ ...customer, id: customerId }); 753 setCustomer({ ...customer, id: customerId });
@@ -728,17 +765,17 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -728,17 +765,17 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
728 rules={[{ required: true, message: '客户必填' }]} 765 rules={[{ required: true, message: '客户必填' }]}
729 onChange={(_, option) => { 766 onChange={(_, option) => {
730 //新增客户 767 //新增客户
731 - if (option.type === 'add') {  
732 - setCustomer({ name: option.name }); 768 + if (option?.type === 'add') {
  769 + setCustomer({ name: option?.name });
733 setKingdeeCstomerModalVisible(true); 770 setKingdeeCstomerModalVisible(true);
734 return; 771 return;
735 } 772 }
736 - autoFillCustomerContactSelectOptions(option.id); 773 + autoFillCustomerContactSelectOptions(option?.id);
737 }} 774 }}
738 initialValue={{ 775 initialValue={{
739 - label: data?.erpCustomerName,  
740 - value: data?.customerId,  
741 - id: data?.customerId, 776 + label: copyData?.erpCustomerName,
  777 + value: copyData?.customerId,
  778 + id: copyData?.customerId,
742 }} 779 }}
743 fieldProps={{ 780 fieldProps={{
744 optionItemRender(item) { 781 optionItemRender(item) {
@@ -813,6 +850,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -813,6 +850,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
813 }} 850 }}
814 initialValue={data.contactAddress} 851 initialValue={data.contactAddress}
815 options={productCustomerContactOptions} 852 options={productCustomerContactOptions}
  853 + disabled={optType('after-sales-check')}
816 /> 854 />
817 855
818 <ProFormText 856 <ProFormText
@@ -864,13 +902,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -864,13 +902,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
864 <Button 902 <Button
865 className="rounded-l-none" 903 className="rounded-l-none"
866 type="primary" 904 type="primary"
  905 + disabled={optType('after-sales-check')}
867 onClick={computeTotalPayment} 906 onClick={computeTotalPayment}
868 > 907 >
869 计算 908 计算
870 </Button> 909 </Button>
871 ), 910 ),
872 }} 911 }}
873 - // disabled={mainInfoDisbled} 912 + disabled={optType('after-sales-check')}
874 /> 913 />
875 </div> 914 </div>
876 915
@@ -882,7 +921,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -882,7 +921,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
882 label="支付渠道" 921 label="支付渠道"
883 options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)} 922 options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
884 rules={[{ required: true, message: '支付渠道必填' }]} 923 rules={[{ required: true, message: '支付渠道必填' }]}
885 - // disabled={mainInfoDisbled} 924 + disabled={optType('after-sales-check')}
886 /> 925 />
887 <ProFormSelect 926 <ProFormSelect
888 placeholder="请输入支付方式" 927 placeholder="请输入支付方式"
@@ -892,7 +931,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -892,7 +931,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
892 label="支付方式" 931 label="支付方式"
893 options={enumToSelect(PAYMENT_METHOD_OPTIONS)} 932 options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
894 rules={[{ required: true, message: '支付方式必填' }]} 933 rules={[{ required: true, message: '支付方式必填' }]}
895 - // disabled={mainInfoDisbled} 934 + disabled={optType('after-sales-check')}
896 /> 935 />
897 <ProFormSelect 936 <ProFormSelect
898 placeholder="选择是否需要开票" 937 placeholder="选择是否需要开票"
@@ -901,7 +940,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -901,7 +940,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
901 key="invoicingStatus" 940 key="invoicingStatus"
902 label="是否需要开票" 941 label="是否需要开票"
903 options={getInvoicingSelect()} 942 options={getInvoicingSelect()}
904 - // disabled={mainInfoDisbled} 943 + disabled={optType('after-sales-check')}
905 onChange={(_, option) => { 944 onChange={(_, option) => {
906 setInvoicingStatus(option.value); 945 setInvoicingStatus(option.value);
907 if (option.value === 'UN_INVOICE') { 946 if (option.value === 'UN_INVOICE') {
@@ -917,7 +956,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -917,7 +956,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
917 name="invoiceIdentificationNumber" 956 name="invoiceIdentificationNumber"
918 label="开票信息" 957 label="开票信息"
919 key="invoiceIdentificationNumber" 958 key="invoiceIdentificationNumber"
920 - // disabled={mainInfoDisbled} 959 + disabled={optType('after-sales-check')}
921 hidden={invoicingStatus === 'UN_INVOICE'} 960 hidden={invoicingStatus === 'UN_INVOICE'}
922 placeholder="请输入开票信息" 961 placeholder="请输入开票信息"
923 rules={[ 962 rules={[
@@ -933,7 +972,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -933,7 +972,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
933 width="lg" 972 width="lg"
934 key="invoicingTime" 973 key="invoicingTime"
935 name="invoicingTime" 974 name="invoicingTime"
936 - // disabled={mainInfoDisbled} 975 + disabled={optType('after-sales-check')}
937 hidden={invoicingStatus === 'UN_INVOICE'} 976 hidden={invoicingStatus === 'UN_INVOICE'}
938 label="开票时间" 977 label="开票时间"
939 placeholder="请输入开票时间" 978 placeholder="请输入开票时间"
@@ -946,7 +985,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -946,7 +985,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
946 name="bank" 985 name="bank"
947 key="bank" 986 key="bank"
948 label="开户银行" 987 label="开户银行"
949 - // disabled={mainInfoDisbled} 988 + disabled={optType('after-sales-check')}
950 hidden={invoicingStatus === 'UN_INVOICE'} 989 hidden={invoicingStatus === 'UN_INVOICE'}
951 placeholder="请输入开户银行" 990 placeholder="请输入开户银行"
952 /> 991 />
@@ -956,7 +995,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -956,7 +995,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
956 name="bankAccountNumber" 995 name="bankAccountNumber"
957 hidden={invoicingStatus === 'UN_INVOICE'} 996 hidden={invoicingStatus === 'UN_INVOICE'}
958 label="银行账号" 997 label="银行账号"
959 - // disabled={mainInfoDisbled} 998 + disabled={optType('after-sales-check')}
960 placeholder="请输入银行账号" 999 placeholder="请输入银行账号"
961 /> 1000 />
962 <ProFormTextArea 1001 <ProFormTextArea
@@ -964,7 +1003,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -964,7 +1003,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
964 name="notes" 1003 name="notes"
965 label="备注" 1004 label="备注"
966 key="notes" 1005 key="notes"
967 - // disabled={mainInfoDisbled} 1006 + disabled={optType('after-sales-check')}
968 placeholder="请输入备注" 1007 placeholder="请输入备注"
969 rules={[ 1008 rules={[
970 { 1009 {
@@ -976,7 +1015,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -976,7 +1015,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
976 1015
977 <h2>商品信息</h2> 1016 <h2>商品信息</h2>
978 <ProFormList 1017 <ProFormList
979 - creatorButtonProps={{ disabled: false }} 1018 + creatorButtonProps={{ disabled: optType('after-sales-check') }}
  1019 + deleteIconProps={!optType('after-sales-check')}
980 name="list" 1020 name="list"
981 label="" 1021 label=""
982 copyIconProps={false} //复制按钮不显示 1022 copyIconProps={false} //复制按钮不显示
@@ -991,10 +1031,11 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -991,10 +1031,11 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
991 }, 1031 },
992 ]} 1032 ]}
993 actionGuard={{ 1033 actionGuard={{
994 - beforeRemoveRow: async (index) => { 1034 + beforeRemoveRow: async () => {
995 return new Promise((resolve) => { 1035 return new Promise((resolve) => {
996 - if (index === 0) {  
997 - message.error('第一行数据不能删除'); 1036 + let list = form.getFieldValue('list');
  1037 + if (list && list.length === 1) {
  1038 + message.error('至少需要保留一个商品');
998 resolve(false); 1039 resolve(false);
999 return; 1040 return;
1000 } 1041 }
@@ -1038,7 +1079,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1038,7 +1079,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1038 width="lg" 1079 width="lg"
1039 showSearch 1080 showSearch
1040 name="productName" 1081 name="productName"
1041 - // options={options} 1082 + disabled={optType('after-sales-check')}
1042 placeholder="请搜索商品" 1083 placeholder="请搜索商品"
1043 rules={[{ required: true, message: '商品名称必填' }]} 1084 rules={[{ required: true, message: '商品名称必填' }]}
1044 onChange={(_, option) => { 1085 onChange={(_, option) => {
@@ -1119,6 +1160,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1119,6 +1160,15 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1119 }} 1160 }}
1120 />, 1161 />,
1121 <ProFormText 1162 <ProFormText
  1163 + key="orderStatus"
  1164 + name="orderStatus"
  1165 + width="lg"
  1166 + disabled
  1167 + label="orderStatus"
  1168 + placeholder="orderStatus"
  1169 + hidden
  1170 + />,
  1171 + <ProFormText
1122 key={'productCode' + listMeta.index} 1172 key={'productCode' + listMeta.index}
1123 width="lg" 1173 width="lg"
1124 name="productCode" 1174 name="productCode"
@@ -1150,7 +1200,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1150,7 +1200,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1150 rules={[{ required: true, message: '商品参数必填' }]} 1200 rules={[{ required: true, message: '商品参数必填' }]}
1151 disabled={ 1201 disabled={
1152 productParametersDisabledFlagList[listMeta.index] !== 1202 productParametersDisabledFlagList[listMeta.index] !==
1153 - false 1203 + false || optType('after-sales-check')
1154 } 1204 }
1155 />, 1205 />,
1156 <ProFormDigit 1206 <ProFormDigit
@@ -1165,6 +1215,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1165,6 +1215,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1165 }, 1215 },
1166 }} 1216 }}
1167 placeholder="请输入商品数量" 1217 placeholder="请输入商品数量"
  1218 + disabled={optType('after-sales-check')}
1168 rules={[{ required: true, message: '商品数量必填' }]} 1219 rules={[{ required: true, message: '商品数量必填' }]}
1169 />, 1220 />,
1170 <ProFormDigit 1221 <ProFormDigit
@@ -1179,6 +1230,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1179,6 +1230,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1179 }, 1230 },
1180 }} 1231 }}
1181 placeholder="请输入商品单价" 1232 placeholder="请输入商品单价"
  1233 + disabled={optType('after-sales-check')}
1182 rules={[{ required: true, message: '商品单价必填' }]} 1234 rules={[{ required: true, message: '商品单价必填' }]}
1183 />, 1235 />,
1184 <ProFormText 1236 <ProFormText
src/pages/Order/constant.ts
@@ -19,6 +19,7 @@ export const RECEIPTS_RECORD_TYPES = { @@ -19,6 +19,7 @@ export const RECEIPTS_RECORD_TYPES = {
19 export const PAYMENT_METHOD_OPTIONS = { 19 export const PAYMENT_METHOD_OPTIONS = {
20 UNPAID: '未付款', 20 UNPAID: '未付款',
21 TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款', 21 TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款',
  22 + OFFICIAL_WEBSITE_ORDER_HAS_BEEN_PAID: '官网订单已付款',
22 PAYMENT_IN_ADVANCE: '预付款', 23 PAYMENT_IN_ADVANCE: '预付款',
23 WITHHOLDING_ADVANCE_DEPOSIT: '扣预存', 24 WITHHOLDING_ADVANCE_DEPOSIT: '扣预存',
24 PLATFORM_SETTLEMENT: '平台结算', 25 PLATFORM_SETTLEMENT: '平台结算',
src/pages/Order/index.tsx
@@ -8,6 +8,7 @@ import { @@ -8,6 +8,7 @@ import {
8 postServiceOrderProcureOrder, 8 postServiceOrderProcureOrder,
9 postServiceOrderProcurePrint, 9 postServiceOrderProcurePrint,
10 postServiceOrderQueryServiceOrder, 10 postServiceOrderQueryServiceOrder,
  11 + postServiceOrderSaleCancelInvoicing,
11 } from '@/services'; 12 } from '@/services';
12 import { orderExport } from '@/services/order'; 13 import { orderExport } from '@/services/order';
13 import { 14 import {
@@ -717,6 +718,27 @@ const OrderPage = () =&gt; { @@ -717,6 +718,27 @@ const OrderPage = () =&gt; {
717 </div> 718 </div>
718 </Flex> 719 </Flex>
719 <Flex className="w-[18%]" wrap="wrap" gap="small"> 720 <Flex className="w-[18%]" wrap="wrap" gap="small">
  721 + {optRecord.subPath?.includes('saleCancelInvoicing') ? (
  722 + <ButtonConfirm
  723 + className="p-0"
  724 + title="确认取消申请开票?"
  725 + text="取消申请"
  726 + onConfirm={async () => {
  727 + let res = await postServiceOrderSaleCancelInvoicing({
  728 + data: {
  729 + subOrderIds: [optRecord.id],
  730 + },
  731 + });
  732 +
  733 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  734 + message.success(res.message);
  735 + refreshTable();
  736 + }
  737 + }}
  738 + />
  739 + ) : (
  740 + ''
  741 + )}
720 {optRecord.subPath?.includes('noNeedInvoicingEdit') ? ( 742 {optRecord.subPath?.includes('noNeedInvoicingEdit') ? (
721 <Button 743 <Button
722 className="p-0" 744 className="p-0"
@@ -1662,6 +1684,7 @@ const OrderPage = () =&gt; { @@ -1662,6 +1684,7 @@ const OrderPage = () =&gt; {
1662 type="link" 1684 type="link"
1663 onClick={() => { 1685 onClick={() => {
1664 //勾选的子订单:如果有勾选,后面只校验有勾选的 1686 //勾选的子订单:如果有勾选,后面只校验有勾选的
  1687 +
1665 let selectedSubOrders = selectedRowObj[record.id]; 1688 let selectedSubOrders = selectedRowObj[record.id];
1666 if ( 1689 if (
1667 selectedSubOrders === undefined || 1690 selectedSubOrders === undefined ||
@@ -1676,15 +1699,31 @@ const OrderPage = () =&gt; { @@ -1676,15 +1699,31 @@ const OrderPage = () =&gt; {
1676 ) { 1699 ) {
1677 let orderStatus = 1700 let orderStatus =
1678 selectedSubOrders[index].orderStatus; 1701 selectedSubOrders[index].orderStatus;
1679 - //是审核通过及之后的订单 1702 + //仓库管理员在审核之后的任何时候都可以编辑
1680 if ( 1703 if (
1681 - orderStatus !== 'UNAUDITED' &&  
1682 - orderStatus !== 'AUDIT_FAILED' 1704 + userInfo.roleSmallVO.code !== 'warehouseKeeper' &&
  1705 + userInfo.roleSmallVO.code !== 'admin'
1683 ) { 1706 ) {
1684 - message.error(  
1685 - '请选择未审核或者审核失败的订单进行编辑',  
1686 - );  
1687 - return; 1707 + //是审核通过及之后的订单
  1708 + if (
  1709 + orderStatus !== 'UNAUDITED' &&
  1710 + orderStatus !== 'AUDIT_FAILED'
  1711 + ) {
  1712 + message.error(
  1713 + '请选择未审核或者审核失败的订单进行编辑',
  1714 + );
  1715 + return;
  1716 + }
  1717 + } else {
  1718 + //仓库管理员只能编辑是还未审核的订单
  1719 + if (
  1720 + userInfo.roleSmallVO.code !== 'admin' &&
  1721 + (orderStatus === 'UNAUDITED' ||
  1722 + orderStatus === 'AUDIT_FAILED')
  1723 + ) {
  1724 + message.error('请选择已审核的订单进行编辑');
  1725 + return;
  1726 + }
1688 } 1727 }
1689 } 1728 }
1690 setOrderDrawerVisible(true); 1729 setOrderDrawerVisible(true);
@@ -1830,6 +1869,46 @@ const OrderPage = () =&gt; { @@ -1830,6 +1869,46 @@ const OrderPage = () =&gt; {
1830 '' 1869 ''
1831 )} 1870 )}
1832 1871
  1872 + {record.mainPath?.includes('saleCancelInvoicing') ? (
  1873 + <ButtonConfirm
  1874 + className="p-0"
  1875 + title="确认取消申请开票?"
  1876 + text="取消申请"
  1877 + onConfirm={async () => {
  1878 + let selectedSubOrders = selectedRowObj[record.id];
  1879 + if (selectedSubOrders === undefined) {
  1880 + selectedSubOrders = record.subOrderInformationLists;
  1881 + }
  1882 + setSelectedRows(selectedSubOrders);
  1883 + for (let i = 0; i < selectedSubOrders.length; i++) {
  1884 + if (
  1885 + selectedSubOrders[i].afterInvoicingStatus !==
  1886 + 'APPLY_FOR_INVOICING'
  1887 + ) {
  1888 + message.error(
  1889 + '请选择已[申请开票]的子订单进行取消申请',
  1890 + );
  1891 + return;
  1892 + }
  1893 + }
  1894 + let res = await postServiceOrderSaleCancelInvoicing({
  1895 + data: {
  1896 + subOrderIds: selectedSubOrders.map((item) => {
  1897 + return item.id;
  1898 + }),
  1899 + },
  1900 + });
  1901 +
  1902 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  1903 + message.success(res.message);
  1904 + refreshTable();
  1905 + }
  1906 + }}
  1907 + />
  1908 + ) : (
  1909 + ''
  1910 + )}
  1911 +
1833 {/* 财务审核:主订单暂无 */} 1912 {/* 财务审核:主订单暂无 */}
1834 {record.mainPath?.includes('financeCheckOrder') ? ( 1913 {record.mainPath?.includes('financeCheckOrder') ? (
1835 <Button 1914 <Button
src/services/definition.ts
@@ -1600,12 +1600,7 @@ export interface View { @@ -1600,12 +1600,7 @@ export interface View {
1600 export interface Dto { 1600 export interface Dto {
1601 /** 1601 /**
1602 * @description 1602 * @description
1603 - * 审核备注  
1604 - */  
1605 - checkNotes?: string;  
1606 - /**  
1607 - * @description  
1608 * 子订单id集合 1603 * 子订单id集合
1609 */ 1604 */
1610 - subIds?: Array<number>; 1605 + subOrderIds?: Array<number>;
1611 } 1606 }
src/services/request.ts
@@ -39,7 +39,6 @@ import type { @@ -39,7 +39,6 @@ import type {
39 MaterialStockRes, 39 MaterialStockRes,
40 MaterialUnitListRes, 40 MaterialUnitListRes,
41 MeasureUnitListRes, 41 MeasureUnitListRes,
42 - ModelAndView,  
43 OrderAddVO, 42 OrderAddVO,
44 OrderAuditLogQueryVO, 43 OrderAuditLogQueryVO,
45 OrderBaseInfoQueryVO, 44 OrderBaseInfoQueryVO,
@@ -248,7 +247,9 @@ export interface GetErrorResponse { @@ -248,7 +247,9 @@ export interface GetErrorResponse {
248 * @description 247 * @description
249 * OK 248 * OK
250 */ 249 */
251 - 200: ModelAndView; 250 + 200: {
  251 + [propertyName: string]: any;
  252 + };
252 /** 253 /**
253 * @description 254 * @description
254 * Unauthorized 255 * Unauthorized
@@ -269,9 +270,9 @@ export interface GetErrorResponse { @@ -269,9 +270,9 @@ export interface GetErrorResponse {
269 export type GetErrorResponseSuccess = GetErrorResponse[200]; 270 export type GetErrorResponseSuccess = GetErrorResponse[200];
270 /** 271 /**
271 * @description 272 * @description
272 - * errorHtml 273 + * error
273 * @tags basic-error-controller 274 * @tags basic-error-controller
274 - * @produces text/html 275 + * @produces *
275 */ 276 */
276 export const getError = /* #__PURE__ */ (() => { 277 export const getError = /* #__PURE__ */ (() => {
277 const method = 'get'; 278 const method = 'get';
@@ -295,7 +296,9 @@ export interface PutErrorResponse { @@ -295,7 +296,9 @@ export interface PutErrorResponse {
295 * @description 296 * @description
296 * OK 297 * OK
297 */ 298 */
298 - 200: ModelAndView; 299 + 200: {
  300 + [propertyName: string]: any;
  301 + };
299 /** 302 /**
300 * @description 303 * @description
301 * Created 304 * Created
@@ -321,9 +324,9 @@ export interface PutErrorResponse { @@ -321,9 +324,9 @@ export interface PutErrorResponse {
321 export type PutErrorResponseSuccess = PutErrorResponse[200]; 324 export type PutErrorResponseSuccess = PutErrorResponse[200];
322 /** 325 /**
323 * @description 326 * @description
324 - * errorHtml 327 + * error
325 * @tags basic-error-controller 328 * @tags basic-error-controller
326 - * @produces text/html 329 + * @produces *
327 * @consumes application/json 330 * @consumes application/json
328 */ 331 */
329 export const putError = /* #__PURE__ */ (() => { 332 export const putError = /* #__PURE__ */ (() => {
@@ -348,7 +351,9 @@ export interface PostErrorResponse { @@ -348,7 +351,9 @@ export interface PostErrorResponse {
348 * @description 351 * @description
349 * OK 352 * OK
350 */ 353 */
351 - 200: ModelAndView; 354 + 200: {
  355 + [propertyName: string]: any;
  356 + };
352 /** 357 /**
353 * @description 358 * @description
354 * Created 359 * Created
@@ -374,9 +379,9 @@ export interface PostErrorResponse { @@ -374,9 +379,9 @@ export interface PostErrorResponse {
374 export type PostErrorResponseSuccess = PostErrorResponse[200]; 379 export type PostErrorResponseSuccess = PostErrorResponse[200];
375 /** 380 /**
376 * @description 381 * @description
377 - * errorHtml 382 + * error
378 * @tags basic-error-controller 383 * @tags basic-error-controller
379 - * @produces text/html 384 + * @produces *
380 * @consumes application/json 385 * @consumes application/json
381 */ 386 */
382 export const postError = /* #__PURE__ */ (() => { 387 export const postError = /* #__PURE__ */ (() => {
@@ -401,7 +406,9 @@ export interface DeleteErrorResponse { @@ -401,7 +406,9 @@ export interface DeleteErrorResponse {
401 * @description 406 * @description
402 * OK 407 * OK
403 */ 408 */
404 - 200: ModelAndView; 409 + 200: {
  410 + [propertyName: string]: any;
  411 + };
405 /** 412 /**
406 * @description 413 * @description
407 * No Content 414 * No Content
@@ -422,9 +429,9 @@ export interface DeleteErrorResponse { @@ -422,9 +429,9 @@ export interface DeleteErrorResponse {
422 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; 429 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
423 /** 430 /**
424 * @description 431 * @description
425 - * errorHtml 432 + * error
426 * @tags basic-error-controller 433 * @tags basic-error-controller
427 - * @produces text/html 434 + * @produces *
428 */ 435 */
429 export const deleteError = /* #__PURE__ */ (() => { 436 export const deleteError = /* #__PURE__ */ (() => {
430 const method = 'delete'; 437 const method = 'delete';
@@ -448,7 +455,9 @@ export interface OptionsErrorResponse { @@ -448,7 +455,9 @@ export interface OptionsErrorResponse {
448 * @description 455 * @description
449 * OK 456 * OK
450 */ 457 */
451 - 200: ModelAndView; 458 + 200: {
  459 + [propertyName: string]: any;
  460 + };
452 /** 461 /**
453 * @description 462 * @description
454 * No Content 463 * No Content
@@ -469,9 +478,9 @@ export interface OptionsErrorResponse { @@ -469,9 +478,9 @@ export interface OptionsErrorResponse {
469 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; 478 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
470 /** 479 /**
471 * @description 480 * @description
472 - * errorHtml 481 + * error
473 * @tags basic-error-controller 482 * @tags basic-error-controller
474 - * @produces text/html 483 + * @produces *
475 * @consumes application/json 484 * @consumes application/json
476 */ 485 */
477 export const optionsError = /* #__PURE__ */ (() => { 486 export const optionsError = /* #__PURE__ */ (() => {
@@ -496,7 +505,9 @@ export interface HeadErrorResponse { @@ -496,7 +505,9 @@ export interface HeadErrorResponse {
496 * @description 505 * @description
497 * OK 506 * OK
498 */ 507 */
499 - 200: ModelAndView; 508 + 200: {
  509 + [propertyName: string]: any;
  510 + };
500 /** 511 /**
501 * @description 512 * @description
502 * No Content 513 * No Content
@@ -517,9 +528,9 @@ export interface HeadErrorResponse { @@ -517,9 +528,9 @@ export interface HeadErrorResponse {
517 export type HeadErrorResponseSuccess = HeadErrorResponse[200]; 528 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
518 /** 529 /**
519 * @description 530 * @description
520 - * errorHtml 531 + * error
521 * @tags basic-error-controller 532 * @tags basic-error-controller
522 - * @produces text/html 533 + * @produces *
523 * @consumes application/json 534 * @consumes application/json
524 */ 535 */
525 export const headError = /* #__PURE__ */ (() => { 536 export const headError = /* #__PURE__ */ (() => {
@@ -544,7 +555,9 @@ export interface PatchErrorResponse { @@ -544,7 +555,9 @@ export interface PatchErrorResponse {
544 * @description 555 * @description
545 * OK 556 * OK
546 */ 557 */
547 - 200: ModelAndView; 558 + 200: {
  559 + [propertyName: string]: any;
  560 + };
548 /** 561 /**
549 * @description 562 * @description
550 * No Content 563 * No Content
@@ -565,9 +578,9 @@ export interface PatchErrorResponse { @@ -565,9 +578,9 @@ export interface PatchErrorResponse {
565 export type PatchErrorResponseSuccess = PatchErrorResponse[200]; 578 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
566 /** 579 /**
567 * @description 580 * @description
568 - * errorHtml 581 + * error
569 * @tags basic-error-controller 582 * @tags basic-error-controller
570 - * @produces text/html 583 + * @produces *
571 * @consumes application/json 584 * @consumes application/json
572 */ 585 */
573 export const patchError = /* #__PURE__ */ (() => { 586 export const patchError = /* #__PURE__ */ (() => {
@@ -9294,6 +9307,77 @@ export const postServiceOrderQuerySupplier = /* #__PURE__ */ (() =&gt; { @@ -9294,6 +9307,77 @@ export const postServiceOrderQuerySupplier = /* #__PURE__ */ (() =&gt; {
9294 return request; 9307 return request;
9295 })(); 9308 })();
9296 9309
  9310 +/** @description request parameter type for postServiceOrderSaleCancelInvoicing */
  9311 +export interface PostServiceOrderSaleCancelInvoicingOption {
  9312 + /**
  9313 + * @description
  9314 + * dto
  9315 + */
  9316 + body: {
  9317 + /**
  9318 + @description
  9319 + dto */
  9320 + dto: Dto;
  9321 + };
  9322 +}
  9323 +
  9324 +/** @description response type for postServiceOrderSaleCancelInvoicing */
  9325 +export interface PostServiceOrderSaleCancelInvoicingResponse {
  9326 + /**
  9327 + * @description
  9328 + * OK
  9329 + */
  9330 + 200: ServerResult;
  9331 + /**
  9332 + * @description
  9333 + * Created
  9334 + */
  9335 + 201: any;
  9336 + /**
  9337 + * @description
  9338 + * Unauthorized
  9339 + */
  9340 + 401: any;
  9341 + /**
  9342 + * @description
  9343 + * Forbidden
  9344 + */
  9345 + 403: any;
  9346 + /**
  9347 + * @description
  9348 + * Not Found
  9349 + */
  9350 + 404: any;
  9351 +}
  9352 +
  9353 +export type PostServiceOrderSaleCancelInvoicingResponseSuccess =
  9354 + PostServiceOrderSaleCancelInvoicingResponse[200];
  9355 +/**
  9356 + * @description
  9357 + * 销售取消申请开票
  9358 + * @tags 内部订单
  9359 + * @produces *
  9360 + * @consumes application/json
  9361 + */
  9362 +export const postServiceOrderSaleCancelInvoicing = /* #__PURE__ */ (() => {
  9363 + const method = 'post';
  9364 + const url = '/service/order/saleCancelInvoicing';
  9365 + function request(
  9366 + option: PostServiceOrderSaleCancelInvoicingOption,
  9367 + ): Promise<PostServiceOrderSaleCancelInvoicingResponseSuccess> {
  9368 + return requester(request.url, {
  9369 + method: request.method,
  9370 + ...option,
  9371 + }) as unknown as Promise<PostServiceOrderSaleCancelInvoicingResponseSuccess>;
  9372 + }
  9373 +
  9374 + /** http method */
  9375 + request.method = method;
  9376 + /** request url */
  9377 + request.url = url;
  9378 + return request;
  9379 +})();
  9380 +
9297 /** @description request parameter type for postServiceOrderSendProduct */ 9381 /** @description request parameter type for postServiceOrderSendProduct */
9298 export interface PostServiceOrderSendProductOption { 9382 export interface PostServiceOrderSendProductOption {
9299 /** 9383 /**