Commit f8f768b072203119a03f5956925af06bb2b65db4

Authored by PurelzMgnead
1 parent 4681a0ab

feat: 售后

.umirc.ts
... ... @@ -14,9 +14,9 @@ export default defineConfig({
14 14 },
15 15 proxy: {
16 16 '/api/': {
17   - target: 'http://localhost:8085/',
  17 + // target: 'http://localhost:8085/',
18 18 // target: 'http://192.168.1.6:8085/',
19   - // target: 'http://39.108.227.113:8085/',
  19 + target: 'http://39.108.227.113:8085/',
20 20 changeOrigin: true,
21 21 pathRewrite: { '^/api': '' },
22 22 },
... ... @@ -51,7 +51,6 @@ export default defineConfig({
51 51 {
52 52 name: '订单预警',
53 53 path: 'OrderWarning',
54   - access: 'canReadAdminAndSales',
55 54 component: './Order/OrderWarning',
56 55 },
57 56 {
... ... @@ -149,7 +148,7 @@ export default defineConfig({
149 148 name: '客户管理',
150 149 path: '/Client',
151 150 icon: 'BookOutlined',
152   - access: 'canReadAdminAndSalesAndWarehouseKeeper',
  151 + access: 'canReadAdminAndSales',
153 152 routes: [
154 153 {
155 154 name: '客户列表',
... ...
src/pages/Order/FeedBack/OrderList.tsx
... ... @@ -8,6 +8,7 @@ import {
8 8 postKingdeeRepSalOrderSave,
9 9 postServiceConstCanApplyAfterInvoicingStatus,
10 10 postServiceInvoiceCancelApply,
  11 + postServiceOrderAfterSalesCheck,
11 12 postServiceOrderCancelSend,
12 13 postServiceOrderConfirmInvoice,
13 14 postServiceOrderGetCurrentOptNode,
... ... @@ -412,6 +413,16 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => {
412 413 return null;
413 414 }
414 415  
  416 + async function doAfterSalesCheck(body: object) {
  417 + const data = await postServiceOrderAfterSalesCheck({
  418 + data: body,
  419 + });
  420 + console.log(data);
  421 + if (data.data) {
  422 + refreshTable();
  423 + }
  424 + }
  425 +
415 426 /**
416 427 * 返回当前操作的主订单数据
417 428 */
... ... @@ -728,7 +739,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => {
728 739  
729 740 if (
730 741 orderStatus === 'AFTER_SALES_COMPLETION' ||
731   - orderStatus === 'IN_AFTER_SALES'
  742 + orderStatus === 'IN_AFTER_SALES' ||
  743 + orderStatus === 'AFTER_SALES_CHECK'
732 744 ) {
733 745 return (
734 746 <Tag
... ... @@ -1894,6 +1906,29 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
1894 1906 ''
1895 1907 )}
1896 1908  
  1909 + {optRecord.paths?.includes('afterSalesConfirm') ? (
  1910 + <ButtonConfirm
  1911 + className="p-0"
  1912 + title="确认通过?"
  1913 + text="售后已审核待确认"
  1914 + onConfirm={() => {
  1915 + setIsMainOrder(false);
  1916 + doAfterSalesCheck({
  1917 + applyType: 'after-sales',
  1918 + isAfterSalesSuccess: true,
  1919 + subOrderIds: isMainOrder
  1920 + ? [...record.subOrderInformationLists]
  1921 + .flat()
  1922 + ?.map((subOrder) => subOrder.id)
  1923 + : [optRecord.id],
  1924 + mainId: record.id,
  1925 + });
  1926 + }}
  1927 + />
  1928 + ) : (
  1929 + ''
  1930 + )}
  1931 +
1897 1932 {optRecord.paths?.includes('financeCheckOrder') ? (
1898 1933 <Button
1899 1934 className="p-0"
... ... @@ -3626,6 +3661,27 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
3626 3661 ''
3627 3662 )}
3628 3663  
  3664 + {record.paths?.includes('afterSalesConfirm') ? (
  3665 + <ButtonConfirm
  3666 + className="p-0"
  3667 + title="确认通过?"
  3668 + text="售后已审核待确认"
  3669 + onConfirm={() => {
  3670 + setIsMainOrder(true);
  3671 + doAfterSalesCheck({
  3672 + applyType: 'after-sales',
  3673 + isAfterSalesSuccess: true,
  3674 + subOrderIds: [...record.subOrderInformationLists]
  3675 + .flat()
  3676 + ?.map((subOrder) => subOrder.id),
  3677 + mainId: record.id,
  3678 + });
  3679 + }}
  3680 + />
  3681 + ) : (
  3682 + ''
  3683 + )}
  3684 +
3629 3685 {record.paths?.includes('noNeedSend') ? (
3630 3686 <ButtonConfirm
3631 3687 className="p-0"
... ... @@ -4230,6 +4286,9 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
4230 4286 afterSalesRadios.push(<Radio value={0}>全部</Radio>);
4231 4287 afterSalesRadios.push(<Radio value={'IN_AFTER_SALES'}>售后中</Radio>);
4232 4288 afterSalesRadios.push(
  4289 + <Radio value={'AFTER_SALES_CHECK'}>售后已审核</Radio>,
  4290 + );
  4291 + afterSalesRadios.push(
4233 4292 <Radio value={'AFTER_SALES_COMPLETION'}>售后完成</Radio>,
4234 4293 );
4235 4294 afterSalesRadios.push(
... ... @@ -4703,7 +4762,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
4703 4762 // @ts-ignore
4704 4763 sorter,
4705 4764 filter,
4706   - data: { ...params, ...paramsNew },
  4765 + data: { ...params, ...paramsNew, currentPath: 'feedBack' },
4707 4766 });
4708 4767  
4709 4768 setRolePath(data.specialPath);
... ...
src/pages/Order/FeedBack/constant.ts
... ... @@ -196,6 +196,7 @@ export const ORDER_STATUS_OPTIONS = {
196 196 CONFIRM_RECEIPT: '确认收货',
197 197 AUDIT_FAILED: '审核失败',
198 198 IN_AFTER_SALES: '售后中',
  199 + AFTER_SALES_CHECK: '售后已审核',
199 200 AFTER_SALES_COMPLETION: '售后完成',
200 201 AFTER_SALES_FAILURE: '售后失败',
201 202 NO_NEED_SEND: '无需发货',
... ... @@ -275,6 +276,7 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
275 276 ['SUPPLIER_WAIT_SHIP', 'processing'],
276 277 ['SUPPLIER_SHIPPED', 'processing'],
277 278 ['IN_AFTER_SALES', 'red'],
  279 + ['AFTER_SALES_CHECK', 'red'],
278 280 ['AFTER_SALES_COMPLETION', 'red'],
279 281 ['PROCURE_PROCESS_FOR_MINE', 'processing'],
280 282 ['PROCURE_WAIT_SHIP', 'processing'],
... ... @@ -584,6 +586,7 @@ export const MAIN_ORDER_COLUMNS = [
584 586 ([key]) =>
585 587 [
586 588 'IN_AFTER_SALES',
  589 + 'AFTER_SALES_CHECK',
587 590 'AFTER_SALES_COMPLETION',
588 591 'AFTER_SALES_FAILURE',
589 592 ].includes(key),
... ...
src/pages/Order/OrderList/OrderList.tsx
... ... @@ -9,6 +9,7 @@ import {
9 9 postKingdeeRepSalOrderSave,
10 10 postServiceConstCanApplyAfterInvoicingStatus,
11 11 postServiceInvoiceCancelApply,
  12 + postServiceOrderAfterSalesCheck,
12 13 postServiceOrderCancelSend,
13 14 postServiceOrderConfirmInvoice,
14 15 postServiceOrderGetCurrentOptNode,
... ... @@ -562,6 +563,16 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
562 563 }
563 564 };
564 565  
  566 + async function doAfterSalesCheck(body: object) {
  567 + const data = await postServiceOrderAfterSalesCheck({
  568 + data: body,
  569 + });
  570 + console.log(data);
  571 + if (data.data) {
  572 + refreshTable();
  573 + }
  574 + }
  575 +
565 576 const onCheckboxChange = (record: never) => {
566 577 let newSelectedMainOrderKeys = [];
567 578 if (selectedMainOrderKeys.includes(record.id)) {
... ... @@ -1908,6 +1919,29 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
1908 1919 ''
1909 1920 )}
1910 1921  
  1922 + {optRecord.paths?.includes('afterSalesConfirm') ? (
  1923 + <ButtonConfirm
  1924 + className="p-0"
  1925 + title="确认通过?"
  1926 + text="售后已审核待确认"
  1927 + onConfirm={() => {
  1928 + setIsMainOrder(false);
  1929 + doAfterSalesCheck({
  1930 + applyType: 'after-sales',
  1931 + isAfterSalesSuccess: true,
  1932 + subOrderIds: isMainOrder
  1933 + ? [...record.subOrderInformationLists]
  1934 + .flat()
  1935 + ?.map((subOrder) => subOrder.id)
  1936 + : [optRecord.id],
  1937 + mainId: record.id,
  1938 + });
  1939 + }}
  1940 + />
  1941 + ) : (
  1942 + ''
  1943 + )}
  1944 +
1911 1945 {optRecord.paths?.includes('financeCheckOrder') ? (
1912 1946 <Button
1913 1947 className="p-0"
... ... @@ -3640,6 +3674,27 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
3640 3674 ''
3641 3675 )}
3642 3676  
  3677 + {record.paths?.includes('afterSalesConfirm') ? (
  3678 + <ButtonConfirm
  3679 + className="p-0"
  3680 + title="确认通过?"
  3681 + text="售后已审核待确认"
  3682 + onConfirm={() => {
  3683 + setIsMainOrder(true);
  3684 + doAfterSalesCheck({
  3685 + applyType: 'after-sales',
  3686 + isAfterSalesSuccess: true,
  3687 + subOrderIds: [...record.subOrderInformationLists]
  3688 + .flat()
  3689 + ?.map((subOrder) => subOrder.id),
  3690 + mainId: record.id,
  3691 + });
  3692 + }}
  3693 + />
  3694 + ) : (
  3695 + ''
  3696 + )}
  3697 +
3643 3698 {record.paths?.includes('noNeedSend') ? (
3644 3699 <ButtonConfirm
3645 3700 className="p-0"
... ...
src/pages/Order/constant.ts
... ... @@ -197,6 +197,7 @@ export const ORDER_STATUS_OPTIONS = {
197 197 CONFIRM_RECEIPT: '确认收货',
198 198 AUDIT_FAILED: '审核失败',
199 199 IN_AFTER_SALES: '售后中',
  200 + AFTER_SALES_CHECK: '售后已审核',
200 201 AFTER_SALES_COMPLETION: '售后完成',
201 202 AFTER_SALES_FAILURE: '售后失败',
202 203 NO_NEED_SEND: '无需发货',
... ... @@ -270,6 +271,7 @@ export const TAGS_COLOR = new Map&lt;string, string&gt;([
270 271 ['SUPPLIER_WAIT_SHIP', 'processing'],
271 272 ['SUPPLIER_SHIPPED', 'processing'],
272 273 ['IN_AFTER_SALES', 'red'],
  274 + ['AFTER_SALES_CHECK', 'red'],
273 275 ['AFTER_SALES_COMPLETION', 'red'],
274 276 ['PROCURE_PROCESS_FOR_MINE', 'processing'],
275 277 ['PROCURE_WAIT_SHIP', 'processing'],
... ...