Commit 38661cbaa175776e9d64a1be5c7260fe35564dac

Authored by 曾国涛
1 parent 72d8abdb

feat: 开票功能开发

src/pages/Invoice/components/InvoiceDetailTable.tsx
1 import InvoiceDetailImportModal from '@/pages/Invoice/components/InvoiceDetailImportModal'; 1 import InvoiceDetailImportModal from '@/pages/Invoice/components/InvoiceDetailImportModal';
2 -import type { ProColumns } from '@ant-design/pro-components';  
3 -import { EditableProTable } from '@ant-design/pro-components'; 2 +import { InvoiceProjectSelect } from '@/pages/Invoice/components/InvoiceProjectSelect';
  3 +import { EditableProTable, ProColumns } from '@ant-design/pro-components';
4 import { useEffect, useState } from 'react'; 4 import { useEffect, useState } from 'react';
5 5
6 export default ({ recordId, details, updateDetails, readOnly }) => { 6 export default ({ recordId, details, updateDetails, readOnly }) => {
@@ -16,10 +16,12 @@ export default ({ recordId, details, updateDetails, readOnly }) => { @@ -16,10 +16,12 @@ export default ({ recordId, details, updateDetails, readOnly }) => {
16 const columns: ProColumns[] = [ 16 const columns: ProColumns[] = [
17 { 17 {
18 title: '项目名称', 18 title: '项目名称',
19 - readonly: readOnly,  
20 dataIndex: 'projectName', 19 dataIndex: 'projectName',
21 - valueType: 'text',  
22 ellipsis: true, 20 ellipsis: true,
  21 + readonly: readOnly,
  22 + renderFormItem: () => {
  23 + return <InvoiceProjectSelect />;
  24 + },
23 }, 25 },
24 { 26 {
25 title: '规格型号', 27 title: '规格型号',
src/pages/Invoice/components/InvoiceProjectSelect.tsx 0 → 100644
  1 +import { postServiceConstListInvoiceDetailNames } from '@/services';
  2 +import { enumToSelect } from '@/utils';
  3 +import { ProFormSelect } from '@ant-design/pro-components';
  4 +
  5 +export const InvoiceProjectSelect = () => {
  6 + const fetchOptions = async (keywords) => {
  7 + const res = await postServiceConstListInvoiceDetailNames({
  8 + data: {
  9 + nameLike: keywords,
  10 + },
  11 + });
  12 + const data = res.data;
  13 + console.log('invoiceProject' + JSON.stringify(data));
  14 + return enumToSelect(data);
  15 + };
  16 +
  17 + return (
  18 + <ProFormSelect
  19 + key="project"
  20 + width={500}
  21 + showSearch
  22 + name="project"
  23 + placeholder="请选择开票项目"
  24 + fieldProps={{
  25 + filterOption() {
  26 + return true;
  27 + },
  28 + }}
  29 + debounceTime={1000}
  30 + request={async (value, {}) => {
  31 + const keywords = value.keywords;
  32 + const data = await fetchOptions(keywords);
  33 + return data;
  34 + }}
  35 + />
  36 + );
  37 +};
src/services/definition.ts
@@ -2047,6 +2047,16 @@ export interface QueryInvoiceDetailDto { @@ -2047,6 +2047,16 @@ export interface QueryInvoiceDetailDto {
2047 invoiceId?: number; 2047 invoiceId?: number;
2048 } 2048 }
2049 2049
  2050 +export interface QueryInvoiceProjectDto {
  2051 + /** @format int32 */
  2052 + current?: number;
  2053 + nameLike?: string;
  2054 + /** @format int32 */
  2055 + pageSize?: number;
  2056 + /** @format int32 */
  2057 + total?: number;
  2058 +}
  2059 +
2050 export interface QueryInvoiceRecordDto { 2060 export interface QueryInvoiceRecordDto {
2051 /** 2061 /**
2052 * @description 2062 * @description
src/services/request.ts
@@ -55,6 +55,7 @@ import type { @@ -55,6 +55,7 @@ import type {
55 MaterialUnitListRes, 55 MaterialUnitListRes,
56 MeasureUnitListRes, 56 MeasureUnitListRes,
57 MessageQueryDTO, 57 MessageQueryDTO,
  58 + ModelAndView,
58 OrderAddVO, 59 OrderAddVO,
59 OrderAuditLogQueryVO, 60 OrderAuditLogQueryVO,
60 OrderBaseInfoQueryVO, 61 OrderBaseInfoQueryVO,
@@ -73,6 +74,7 @@ import type { @@ -73,6 +74,7 @@ import type {
73 QueryCustomerInformationDto, 74 QueryCustomerInformationDto,
74 QueryHistoryRecordDto, 75 QueryHistoryRecordDto,
75 QueryInvoiceDetailDto, 76 QueryInvoiceDetailDto,
  77 + QueryInvoiceProjectDto,
76 QueryInvoiceRecordDto, 78 QueryInvoiceRecordDto,
77 QueryMainOrderDto, 79 QueryMainOrderDto,
78 QueryReportFormsDto, 80 QueryReportFormsDto,
@@ -1618,9 +1620,7 @@ export interface GetErrorResponse { @@ -1618,9 +1620,7 @@ export interface GetErrorResponse {
1618 * @description 1620 * @description
1619 * OK 1621 * OK
1620 */ 1622 */
1621 - 200: {  
1622 - [propertyName: string]: any;  
1623 - }; 1623 + 200: ModelAndView;
1624 /** 1624 /**
1625 * @description 1625 * @description
1626 * Unauthorized 1626 * Unauthorized
@@ -1641,9 +1641,9 @@ export interface GetErrorResponse { @@ -1641,9 +1641,9 @@ export interface GetErrorResponse {
1641 export type GetErrorResponseSuccess = GetErrorResponse[200]; 1641 export type GetErrorResponseSuccess = GetErrorResponse[200];
1642 /** 1642 /**
1643 * @description 1643 * @description
1644 - * error 1644 + * errorHtml
1645 * @tags basic-error-controller 1645 * @tags basic-error-controller
1646 - * @produces * 1646 + * @produces text/html
1647 */ 1647 */
1648 export const getError = /* #__PURE__ */ (() => { 1648 export const getError = /* #__PURE__ */ (() => {
1649 const method = 'get'; 1649 const method = 'get';
@@ -1667,9 +1667,7 @@ export interface PutErrorResponse { @@ -1667,9 +1667,7 @@ export interface PutErrorResponse {
1667 * @description 1667 * @description
1668 * OK 1668 * OK
1669 */ 1669 */
1670 - 200: {  
1671 - [propertyName: string]: any;  
1672 - }; 1670 + 200: ModelAndView;
1673 /** 1671 /**
1674 * @description 1672 * @description
1675 * Created 1673 * Created
@@ -1695,9 +1693,9 @@ export interface PutErrorResponse { @@ -1695,9 +1693,9 @@ export interface PutErrorResponse {
1695 export type PutErrorResponseSuccess = PutErrorResponse[200]; 1693 export type PutErrorResponseSuccess = PutErrorResponse[200];
1696 /** 1694 /**
1697 * @description 1695 * @description
1698 - * error 1696 + * errorHtml
1699 * @tags basic-error-controller 1697 * @tags basic-error-controller
1700 - * @produces * 1698 + * @produces text/html
1701 * @consumes application/json 1699 * @consumes application/json
1702 */ 1700 */
1703 export const putError = /* #__PURE__ */ (() => { 1701 export const putError = /* #__PURE__ */ (() => {
@@ -1722,9 +1720,7 @@ export interface PostErrorResponse { @@ -1722,9 +1720,7 @@ export interface PostErrorResponse {
1722 * @description 1720 * @description
1723 * OK 1721 * OK
1724 */ 1722 */
1725 - 200: {  
1726 - [propertyName: string]: any;  
1727 - }; 1723 + 200: ModelAndView;
1728 /** 1724 /**
1729 * @description 1725 * @description
1730 * Created 1726 * Created
@@ -1750,9 +1746,9 @@ export interface PostErrorResponse { @@ -1750,9 +1746,9 @@ export interface PostErrorResponse {
1750 export type PostErrorResponseSuccess = PostErrorResponse[200]; 1746 export type PostErrorResponseSuccess = PostErrorResponse[200];
1751 /** 1747 /**
1752 * @description 1748 * @description
1753 - * error 1749 + * errorHtml
1754 * @tags basic-error-controller 1750 * @tags basic-error-controller
1755 - * @produces * 1751 + * @produces text/html
1756 * @consumes application/json 1752 * @consumes application/json
1757 */ 1753 */
1758 export const postError = /* #__PURE__ */ (() => { 1754 export const postError = /* #__PURE__ */ (() => {
@@ -1777,9 +1773,7 @@ export interface DeleteErrorResponse { @@ -1777,9 +1773,7 @@ export interface DeleteErrorResponse {
1777 * @description 1773 * @description
1778 * OK 1774 * OK
1779 */ 1775 */
1780 - 200: {  
1781 - [propertyName: string]: any;  
1782 - }; 1776 + 200: ModelAndView;
1783 /** 1777 /**
1784 * @description 1778 * @description
1785 * No Content 1779 * No Content
@@ -1800,9 +1794,9 @@ export interface DeleteErrorResponse { @@ -1800,9 +1794,9 @@ export interface DeleteErrorResponse {
1800 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; 1794 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
1801 /** 1795 /**
1802 * @description 1796 * @description
1803 - * error 1797 + * errorHtml
1804 * @tags basic-error-controller 1798 * @tags basic-error-controller
1805 - * @produces * 1799 + * @produces text/html
1806 */ 1800 */
1807 export const deleteError = /* #__PURE__ */ (() => { 1801 export const deleteError = /* #__PURE__ */ (() => {
1808 const method = 'delete'; 1802 const method = 'delete';
@@ -1826,9 +1820,7 @@ export interface OptionsErrorResponse { @@ -1826,9 +1820,7 @@ export interface OptionsErrorResponse {
1826 * @description 1820 * @description
1827 * OK 1821 * OK
1828 */ 1822 */
1829 - 200: {  
1830 - [propertyName: string]: any;  
1831 - }; 1823 + 200: ModelAndView;
1832 /** 1824 /**
1833 * @description 1825 * @description
1834 * No Content 1826 * No Content
@@ -1849,9 +1841,9 @@ export interface OptionsErrorResponse { @@ -1849,9 +1841,9 @@ export interface OptionsErrorResponse {
1849 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; 1841 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
1850 /** 1842 /**
1851 * @description 1843 * @description
1852 - * error 1844 + * errorHtml
1853 * @tags basic-error-controller 1845 * @tags basic-error-controller
1854 - * @produces * 1846 + * @produces text/html
1855 * @consumes application/json 1847 * @consumes application/json
1856 */ 1848 */
1857 export const optionsError = /* #__PURE__ */ (() => { 1849 export const optionsError = /* #__PURE__ */ (() => {
@@ -1876,9 +1868,7 @@ export interface HeadErrorResponse { @@ -1876,9 +1868,7 @@ export interface HeadErrorResponse {
1876 * @description 1868 * @description
1877 * OK 1869 * OK
1878 */ 1870 */
1879 - 200: {  
1880 - [propertyName: string]: any;  
1881 - }; 1871 + 200: ModelAndView;
1882 /** 1872 /**
1883 * @description 1873 * @description
1884 * No Content 1874 * No Content
@@ -1899,9 +1889,9 @@ export interface HeadErrorResponse { @@ -1899,9 +1889,9 @@ export interface HeadErrorResponse {
1899 export type HeadErrorResponseSuccess = HeadErrorResponse[200]; 1889 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
1900 /** 1890 /**
1901 * @description 1891 * @description
1902 - * error 1892 + * errorHtml
1903 * @tags basic-error-controller 1893 * @tags basic-error-controller
1904 - * @produces * 1894 + * @produces text/html
1905 * @consumes application/json 1895 * @consumes application/json
1906 */ 1896 */
1907 export const headError = /* #__PURE__ */ (() => { 1897 export const headError = /* #__PURE__ */ (() => {
@@ -1926,9 +1916,7 @@ export interface PatchErrorResponse { @@ -1926,9 +1916,7 @@ export interface PatchErrorResponse {
1926 * @description 1916 * @description
1927 * OK 1917 * OK
1928 */ 1918 */
1929 - 200: {  
1930 - [propertyName: string]: any;  
1931 - }; 1919 + 200: ModelAndView;
1932 /** 1920 /**
1933 * @description 1921 * @description
1934 * No Content 1922 * No Content
@@ -1949,9 +1937,9 @@ export interface PatchErrorResponse { @@ -1949,9 +1937,9 @@ export interface PatchErrorResponse {
1949 export type PatchErrorResponseSuccess = PatchErrorResponse[200]; 1937 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
1950 /** 1938 /**
1951 * @description 1939 * @description
1952 - * error 1940 + * errorHtml
1953 * @tags basic-error-controller 1941 * @tags basic-error-controller
1954 - * @produces * 1942 + * @produces text/html
1955 * @consumes application/json 1943 * @consumes application/json
1956 */ 1944 */
1957 export const patchError = /* #__PURE__ */ (() => { 1945 export const patchError = /* #__PURE__ */ (() => {
@@ -8433,7 +8421,7 @@ export type PostServiceConstAfterInvoicingInvoiceRecordStatusResponseSuccess = @@ -8433,7 +8421,7 @@ export type PostServiceConstAfterInvoicingInvoiceRecordStatusResponseSuccess =
8433 PostServiceConstAfterInvoicingInvoiceRecordStatusResponse[200]; 8421 PostServiceConstAfterInvoicingInvoiceRecordStatusResponse[200];
8434 /** 8422 /**
8435 * @description 8423 * @description
8436 - * 开票后的开票状态 8424 + * 开票后的开票记录状态
8437 * @tags front-const-controller 8425 * @tags front-const-controller
8438 * @produces * 8426 * @produces *
8439 * @consumes application/json 8427 * @consumes application/json
@@ -8542,7 +8530,7 @@ export type PostServiceConstBeforeInvoicingInvoiceRecordStatusResponseSuccess = @@ -8542,7 +8530,7 @@ export type PostServiceConstBeforeInvoicingInvoiceRecordStatusResponseSuccess =
8542 PostServiceConstBeforeInvoicingInvoiceRecordStatusResponse[200]; 8530 PostServiceConstBeforeInvoicingInvoiceRecordStatusResponse[200];
8543 /** 8531 /**
8544 * @description 8532 * @description
8545 - * 开票前的开票状态 8533 + * 开票前的开票记录状态
8546 * @tags front-const-controller 8534 * @tags front-const-controller
8547 * @produces * 8535 * @produces *
8548 * @consumes application/json 8536 * @consumes application/json
@@ -8781,6 +8769,200 @@ export const postServiceConstInvoicingType = /* #__PURE__ */ (() =&gt; { @@ -8781,6 +8769,200 @@ export const postServiceConstInvoicingType = /* #__PURE__ */ (() =&gt; {
8781 return request; 8769 return request;
8782 })(); 8770 })();
8783 8771
  8772 +/** @description request parameter type for postServiceConstListInvoiceDetailNames */
  8773 +export interface PostServiceConstListInvoiceDetailNamesOption {
  8774 + /**
  8775 + * @description
  8776 + * queryInvoiceProjectDto
  8777 + */
  8778 + body: {
  8779 + /**
  8780 + @description
  8781 + queryInvoiceProjectDto */
  8782 + queryInvoiceProjectDto: QueryInvoiceProjectDto;
  8783 + };
  8784 +}
  8785 +
  8786 +/** @description response type for postServiceConstListInvoiceDetailNames */
  8787 +export interface PostServiceConstListInvoiceDetailNamesResponse {
  8788 + /**
  8789 + * @description
  8790 + * OK
  8791 + */
  8792 + 200: ServerResult;
  8793 + /**
  8794 + * @description
  8795 + * Created
  8796 + */
  8797 + 201: any;
  8798 + /**
  8799 + * @description
  8800 + * Unauthorized
  8801 + */
  8802 + 401: any;
  8803 + /**
  8804 + * @description
  8805 + * Forbidden
  8806 + */
  8807 + 403: any;
  8808 + /**
  8809 + * @description
  8810 + * Not Found
  8811 + */
  8812 + 404: any;
  8813 +}
  8814 +
  8815 +export type PostServiceConstListInvoiceDetailNamesResponseSuccess =
  8816 + PostServiceConstListInvoiceDetailNamesResponse[200];
  8817 +/**
  8818 + * @description
  8819 + * 根据公司名获取收款方
  8820 + * @tags front-const-controller
  8821 + * @produces *
  8822 + * @consumes application/json
  8823 + */
  8824 +export const postServiceConstListInvoiceDetailNames = /* #__PURE__ */ (() => {
  8825 + const method = 'post';
  8826 + const url = '/service/const/listInvoiceDetailNames';
  8827 + function request(
  8828 + option: PostServiceConstListInvoiceDetailNamesOption,
  8829 + ): Promise<PostServiceConstListInvoiceDetailNamesResponseSuccess> {
  8830 + return requester(request.url, {
  8831 + method: request.method,
  8832 + ...option,
  8833 + }) as unknown as Promise<PostServiceConstListInvoiceDetailNamesResponseSuccess>;
  8834 + }
  8835 +
  8836 + /** http method */
  8837 + request.method = method;
  8838 + /** request url */
  8839 + request.url = url;
  8840 + return request;
  8841 +})();
  8842 +
  8843 +/** @description response type for postServiceConstNotCanModifyInvoiceRecordStatus */
  8844 +export interface PostServiceConstNotCanModifyInvoiceRecordStatusResponse {
  8845 + /**
  8846 + * @description
  8847 + * OK
  8848 + */
  8849 + 200: ServerResult;
  8850 + /**
  8851 + * @description
  8852 + * Created
  8853 + */
  8854 + 201: any;
  8855 + /**
  8856 + * @description
  8857 + * Unauthorized
  8858 + */
  8859 + 401: any;
  8860 + /**
  8861 + * @description
  8862 + * Forbidden
  8863 + */
  8864 + 403: any;
  8865 + /**
  8866 + * @description
  8867 + * Not Found
  8868 + */
  8869 + 404: any;
  8870 +}
  8871 +
  8872 +export type PostServiceConstNotCanModifyInvoiceRecordStatusResponseSuccess =
  8873 + PostServiceConstNotCanModifyInvoiceRecordStatusResponse[200];
  8874 +/**
  8875 + * @description
  8876 + * 不能修改的开票记录状态
  8877 + * @tags front-const-controller
  8878 + * @produces *
  8879 + * @consumes application/json
  8880 + */
  8881 +export const postServiceConstNotCanModifyInvoiceRecordStatus =
  8882 + /* #__PURE__ */ (() => {
  8883 + const method = 'post';
  8884 + const url = '/service/const/notCanModifyInvoiceRecordStatus';
  8885 + function request(): Promise<PostServiceConstNotCanModifyInvoiceRecordStatusResponseSuccess> {
  8886 + return requester(request.url, {
  8887 + method: request.method,
  8888 + }) as unknown as Promise<PostServiceConstNotCanModifyInvoiceRecordStatusResponseSuccess>;
  8889 + }
  8890 +
  8891 + /** http method */
  8892 + request.method = method;
  8893 + /** request url */
  8894 + request.url = url;
  8895 + return request;
  8896 + })();
  8897 +
  8898 +/** @description request parameter type for getServiceInvoiceListInvoiceProject */
  8899 +export interface GetServiceInvoiceListInvoiceProjectOption {
  8900 + /** @format int32 */
  8901 + query?: {
  8902 + /**
  8903 + @format int32 */
  8904 + current?: number;
  8905 + nameLike?: string;
  8906 + /**
  8907 + @format int32 */
  8908 + pageSize?: number;
  8909 + /**
  8910 + @format int32 */
  8911 + total?: number;
  8912 + };
  8913 +}
  8914 +
  8915 +/** @description response type for getServiceInvoiceListInvoiceProject */
  8916 +export interface GetServiceInvoiceListInvoiceProjectResponse {
  8917 + /**
  8918 + * @description
  8919 + * OK
  8920 + */
  8921 + 200: any;
  8922 + /**
  8923 + * @description
  8924 + * Unauthorized
  8925 + */
  8926 + 401: any;
  8927 + /**
  8928 + * @description
  8929 + * Forbidden
  8930 + */
  8931 + 403: any;
  8932 + /**
  8933 + * @description
  8934 + * Not Found
  8935 + */
  8936 + 404: any;
  8937 +}
  8938 +
  8939 +export type GetServiceInvoiceListInvoiceProjectResponseSuccess =
  8940 + GetServiceInvoiceListInvoiceProjectResponse[200];
  8941 +/**
  8942 + * @description
  8943 + * invoiceProjectList
  8944 + * @tags 发票
  8945 + * @produces *
  8946 + */
  8947 +export const getServiceInvoiceListInvoiceProject = /* #__PURE__ */ (() => {
  8948 + const method = 'get';
  8949 + const url = '/service/invoice/ListInvoiceProject';
  8950 + function request(
  8951 + option?: GetServiceInvoiceListInvoiceProjectOption,
  8952 + ): Promise<GetServiceInvoiceListInvoiceProjectResponseSuccess> {
  8953 + return requester(request.url, {
  8954 + method: request.method,
  8955 + ...option,
  8956 + }) as unknown as Promise<GetServiceInvoiceListInvoiceProjectResponseSuccess>;
  8957 + }
  8958 +
  8959 + /** http method */
  8960 + request.method = method;
  8961 + /** request url */
  8962 + request.url = url;
  8963 + return request;
  8964 +})();
  8965 +
8784 /** @description request parameter type for postServiceInvoiceAddInvoice */ 8966 /** @description request parameter type for postServiceInvoiceAddInvoice */
8785 export interface PostServiceInvoiceAddInvoiceOption { 8967 export interface PostServiceInvoiceAddInvoiceOption {
8786 /** 8968 /**