Commit 0a0810a3021ee1da5d160dfbae6e62ecf0bb1a17

Authored by 曾国涛
1 parent b4527016

feat: 开票功能开发

src/pages/Order/index.tsx
@@ -5,6 +5,7 @@ import ReissueModal from '@/pages/Order/components/ReissueModal'; @@ -5,6 +5,7 @@ import ReissueModal from '@/pages/Order/components/ReissueModal';
5 import { 5 import {
6 postKingdeeRepSalBillOutbound, 6 postKingdeeRepSalBillOutbound,
7 postKingdeeRepSalOrderSave, 7 postKingdeeRepSalOrderSave,
  8 + postServiceConstCanApplyAfterInvoicingStatus,
8 postServiceOrderCancelSend, 9 postServiceOrderCancelSend,
9 postServiceOrderNoNeedSend, 10 postServiceOrderNoNeedSend,
10 postServiceOrderOrderCancel, 11 postServiceOrderOrderCancel,
@@ -193,6 +194,8 @@ const OrderPage = () => { @@ -193,6 +194,8 @@ const OrderPage = () => {
193 shippingWarehouseChangeModalVisible, 194 shippingWarehouseChangeModalVisible,
194 setShippingWarehouseChangeModalVisible, 195 setShippingWarehouseChangeModalVisible,
195 ] = useState(false); 196 ] = useState(false);
  197 + const [canApplyAfterInvoicingStatus, setCanApplyAfterInvoicingStatus] =
  198 + useState([]);
196 const [ids, setIds] = useState([]); 199 const [ids, setIds] = useState([]);
197 const roleCode = userInfo?.roleSmallVO?.code; 200 const roleCode = userInfo?.roleSmallVO?.code;
198 201
@@ -4012,6 +4015,22 @@ const OrderPage = () => { @@ -4012,6 +4015,22 @@ const OrderPage = () => {
4012 key="inv" 4015 key="inv"
4013 onClick={() => { 4016 onClick={() => {
4014 setIsMainOrder(true); 4017 setIsMainOrder(true);
  4018 + if (isMainOrder) {
  4019 + let flat = [...subOrderSelectedMap.values()].flat();
  4020 + //获取flat的中每个元素的afterInvoicingStatus
  4021 + let afterInvoicingStatusList = flat.map((item) => {
  4022 + return item.afterInvoicingStatus;
  4023 + });
  4024 + //判断flat中的每个元素是否都存在于canApplyAfterInvoicingStatus中
  4025 + if (
  4026 + !afterInvoicingStatusList.every((item) => {
  4027 + return canApplyAfterInvoicingStatus.includes(item);
  4028 + })
  4029 + ) {
  4030 + message.error('订单状态不正确,请检查!');
  4031 + return;
  4032 + }
  4033 + }
4015 setInvoicingDrawerFormVisible(true); 4034 setInvoicingDrawerFormVisible(true);
4016 }} 4035 }}
4017 disabled={selectedSubOrderKeys?.length === 0} 4036 disabled={selectedSubOrderKeys?.length === 0}
@@ -4066,7 +4085,15 @@ const OrderPage = () => { @@ -4066,7 +4085,15 @@ const OrderPage = () => {
4066 return toolBtns; 4085 return toolBtns;
4067 } 4086 }
4068 4087
  4088 + let initEnum = async () => {
  4089 + let invoiceTypeRet = await postServiceConstCanApplyAfterInvoicingStatus();
  4090 + if (invoiceTypeRet.result === RESPONSE_CODE.SUCCESS) {
  4091 + setCanApplyAfterInvoicingStatus(invoiceTypeRet.data);
  4092 + }
  4093 + };
  4094 +
4069 useEffect(() => { 4095 useEffect(() => {
  4096 + initEnum();
4070 // 使用URLSearchParams来解析查询参数 4097 // 使用URLSearchParams来解析查询参数
4071 const params = new URLSearchParams(location.search); 4098 const params = new URLSearchParams(location.search);
4072 const id = params.get('id'); 4099 const id = params.get('id');
src/services/request.ts
@@ -54,7 +54,6 @@ import type { @@ -54,7 +54,6 @@ import type {
54 MaterialUnitListRes, 54 MaterialUnitListRes,
55 MeasureUnitListRes, 55 MeasureUnitListRes,
56 MessageQueryDTO, 56 MessageQueryDTO,
57 - ModelAndView,  
58 OrderAddVO, 57 OrderAddVO,
59 OrderAuditLogQueryVO, 58 OrderAuditLogQueryVO,
60 OrderBaseInfoQueryVO, 59 OrderBaseInfoQueryVO,
@@ -1541,7 +1540,9 @@ export interface GetErrorResponse { @@ -1541,7 +1540,9 @@ export interface GetErrorResponse {
1541 * @description 1540 * @description
1542 * OK 1541 * OK
1543 */ 1542 */
1544 - 200: ModelAndView; 1543 + 200: {
  1544 + [propertyName: string]: any;
  1545 + };
1545 /** 1546 /**
1546 * @description 1547 * @description
1547 * Unauthorized 1548 * Unauthorized
@@ -1562,9 +1563,9 @@ export interface GetErrorResponse { @@ -1562,9 +1563,9 @@ export interface GetErrorResponse {
1562 export type GetErrorResponseSuccess = GetErrorResponse[200]; 1563 export type GetErrorResponseSuccess = GetErrorResponse[200];
1563 /** 1564 /**
1564 * @description 1565 * @description
1565 - * errorHtml 1566 + * error
1566 * @tags basic-error-controller 1567 * @tags basic-error-controller
1567 - * @produces text/html 1568 + * @produces *
1568 */ 1569 */
1569 export const getError = /* #__PURE__ */ (() => { 1570 export const getError = /* #__PURE__ */ (() => {
1570 const method = 'get'; 1571 const method = 'get';
@@ -1588,7 +1589,9 @@ export interface PutErrorResponse { @@ -1588,7 +1589,9 @@ export interface PutErrorResponse {
1588 * @description 1589 * @description
1589 * OK 1590 * OK
1590 */ 1591 */
1591 - 200: ModelAndView; 1592 + 200: {
  1593 + [propertyName: string]: any;
  1594 + };
1592 /** 1595 /**
1593 * @description 1596 * @description
1594 * Created 1597 * Created
@@ -1614,9 +1617,9 @@ export interface PutErrorResponse { @@ -1614,9 +1617,9 @@ export interface PutErrorResponse {
1614 export type PutErrorResponseSuccess = PutErrorResponse[200]; 1617 export type PutErrorResponseSuccess = PutErrorResponse[200];
1615 /** 1618 /**
1616 * @description 1619 * @description
1617 - * errorHtml 1620 + * error
1618 * @tags basic-error-controller 1621 * @tags basic-error-controller
1619 - * @produces text/html 1622 + * @produces *
1620 * @consumes application/json 1623 * @consumes application/json
1621 */ 1624 */
1622 export const putError = /* #__PURE__ */ (() => { 1625 export const putError = /* #__PURE__ */ (() => {
@@ -1641,7 +1644,9 @@ export interface PostErrorResponse { @@ -1641,7 +1644,9 @@ export interface PostErrorResponse {
1641 * @description 1644 * @description
1642 * OK 1645 * OK
1643 */ 1646 */
1644 - 200: ModelAndView; 1647 + 200: {
  1648 + [propertyName: string]: any;
  1649 + };
1645 /** 1650 /**
1646 * @description 1651 * @description
1647 * Created 1652 * Created
@@ -1667,9 +1672,9 @@ export interface PostErrorResponse { @@ -1667,9 +1672,9 @@ export interface PostErrorResponse {
1667 export type PostErrorResponseSuccess = PostErrorResponse[200]; 1672 export type PostErrorResponseSuccess = PostErrorResponse[200];
1668 /** 1673 /**
1669 * @description 1674 * @description
1670 - * errorHtml 1675 + * error
1671 * @tags basic-error-controller 1676 * @tags basic-error-controller
1672 - * @produces text/html 1677 + * @produces *
1673 * @consumes application/json 1678 * @consumes application/json
1674 */ 1679 */
1675 export const postError = /* #__PURE__ */ (() => { 1680 export const postError = /* #__PURE__ */ (() => {
@@ -1694,7 +1699,9 @@ export interface DeleteErrorResponse { @@ -1694,7 +1699,9 @@ export interface DeleteErrorResponse {
1694 * @description 1699 * @description
1695 * OK 1700 * OK
1696 */ 1701 */
1697 - 200: ModelAndView; 1702 + 200: {
  1703 + [propertyName: string]: any;
  1704 + };
1698 /** 1705 /**
1699 * @description 1706 * @description
1700 * No Content 1707 * No Content
@@ -1715,9 +1722,9 @@ export interface DeleteErrorResponse { @@ -1715,9 +1722,9 @@ export interface DeleteErrorResponse {
1715 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; 1722 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
1716 /** 1723 /**
1717 * @description 1724 * @description
1718 - * errorHtml 1725 + * error
1719 * @tags basic-error-controller 1726 * @tags basic-error-controller
1720 - * @produces text/html 1727 + * @produces *
1721 */ 1728 */
1722 export const deleteError = /* #__PURE__ */ (() => { 1729 export const deleteError = /* #__PURE__ */ (() => {
1723 const method = 'delete'; 1730 const method = 'delete';
@@ -1741,7 +1748,9 @@ export interface OptionsErrorResponse { @@ -1741,7 +1748,9 @@ export interface OptionsErrorResponse {
1741 * @description 1748 * @description
1742 * OK 1749 * OK
1743 */ 1750 */
1744 - 200: ModelAndView; 1751 + 200: {
  1752 + [propertyName: string]: any;
  1753 + };
1745 /** 1754 /**
1746 * @description 1755 * @description
1747 * No Content 1756 * No Content
@@ -1762,9 +1771,9 @@ export interface OptionsErrorResponse { @@ -1762,9 +1771,9 @@ export interface OptionsErrorResponse {
1762 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; 1771 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
1763 /** 1772 /**
1764 * @description 1773 * @description
1765 - * errorHtml 1774 + * error
1766 * @tags basic-error-controller 1775 * @tags basic-error-controller
1767 - * @produces text/html 1776 + * @produces *
1768 * @consumes application/json 1777 * @consumes application/json
1769 */ 1778 */
1770 export const optionsError = /* #__PURE__ */ (() => { 1779 export const optionsError = /* #__PURE__ */ (() => {
@@ -1789,7 +1798,9 @@ export interface HeadErrorResponse { @@ -1789,7 +1798,9 @@ export interface HeadErrorResponse {
1789 * @description 1798 * @description
1790 * OK 1799 * OK
1791 */ 1800 */
1792 - 200: ModelAndView; 1801 + 200: {
  1802 + [propertyName: string]: any;
  1803 + };
1793 /** 1804 /**
1794 * @description 1805 * @description
1795 * No Content 1806 * No Content
@@ -1810,9 +1821,9 @@ export interface HeadErrorResponse { @@ -1810,9 +1821,9 @@ export interface HeadErrorResponse {
1810 export type HeadErrorResponseSuccess = HeadErrorResponse[200]; 1821 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
1811 /** 1822 /**
1812 * @description 1823 * @description
1813 - * errorHtml 1824 + * error
1814 * @tags basic-error-controller 1825 * @tags basic-error-controller
1815 - * @produces text/html 1826 + * @produces *
1816 * @consumes application/json 1827 * @consumes application/json
1817 */ 1828 */
1818 export const headError = /* #__PURE__ */ (() => { 1829 export const headError = /* #__PURE__ */ (() => {
@@ -1837,7 +1848,9 @@ export interface PatchErrorResponse { @@ -1837,7 +1848,9 @@ export interface PatchErrorResponse {
1837 * @description 1848 * @description
1838 * OK 1849 * OK
1839 */ 1850 */
1840 - 200: ModelAndView; 1851 + 200: {
  1852 + [propertyName: string]: any;
  1853 + };
1841 /** 1854 /**
1842 * @description 1855 * @description
1843 * No Content 1856 * No Content
@@ -1858,9 +1871,9 @@ export interface PatchErrorResponse { @@ -1858,9 +1871,9 @@ export interface PatchErrorResponse {
1858 export type PatchErrorResponseSuccess = PatchErrorResponse[200]; 1871 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
1859 /** 1872 /**
1860 * @description 1873 * @description
1861 - * errorHtml 1874 + * error
1862 * @tags basic-error-controller 1875 * @tags basic-error-controller
1863 - * @produces text/html 1876 + * @produces *
1864 * @consumes application/json 1877 * @consumes application/json
1865 */ 1878 */
1866 export const patchError = /* #__PURE__ */ (() => { 1879 export const patchError = /* #__PURE__ */ (() => {
@@ -7883,6 +7896,61 @@ export const postServiceBankStatementQueryBankStatement = @@ -7883,6 +7896,61 @@ export const postServiceBankStatementQueryBankStatement =
7883 return request; 7896 return request;
7884 })(); 7897 })();
7885 7898
  7899 +/** @description response type for postServiceConstCanApplyAfterInvoicingStatus */
  7900 +export interface PostServiceConstCanApplyAfterInvoicingStatusResponse {
  7901 + /**
  7902 + * @description
  7903 + * OK
  7904 + */
  7905 + 200: ServerResult;
  7906 + /**
  7907 + * @description
  7908 + * Created
  7909 + */
  7910 + 201: any;
  7911 + /**
  7912 + * @description
  7913 + * Unauthorized
  7914 + */
  7915 + 401: any;
  7916 + /**
  7917 + * @description
  7918 + * Forbidden
  7919 + */
  7920 + 403: any;
  7921 + /**
  7922 + * @description
  7923 + * Not Found
  7924 + */
  7925 + 404: any;
  7926 +}
  7927 +
  7928 +export type PostServiceConstCanApplyAfterInvoicingStatusResponseSuccess =
  7929 + PostServiceConstCanApplyAfterInvoicingStatusResponse[200];
  7930 +/**
  7931 + * @description
  7932 + * 开具类型
  7933 + * @tags front-const-controller
  7934 + * @produces *
  7935 + * @consumes application/json
  7936 + */
  7937 +export const postServiceConstCanApplyAfterInvoicingStatus =
  7938 + /* #__PURE__ */ (() => {
  7939 + const method = 'post';
  7940 + const url = '/service/const/canApplyAfterInvoicingStatus';
  7941 + function request(): Promise<PostServiceConstCanApplyAfterInvoicingStatusResponseSuccess> {
  7942 + return requester(request.url, {
  7943 + method: request.method,
  7944 + }) as unknown as Promise<PostServiceConstCanApplyAfterInvoicingStatusResponseSuccess>;
  7945 + }
  7946 +
  7947 + /** http method */
  7948 + request.method = method;
  7949 + /** request url */
  7950 + request.url = url;
  7951 + return request;
  7952 + })();
  7953 +
7886 /** @description response type for postServiceConstInvoiceType */ 7954 /** @description response type for postServiceConstInvoiceType */
7887 export interface PostServiceConstInvoiceTypeResponse { 7955 export interface PostServiceConstInvoiceTypeResponse {
7888 /** 7956 /**