diff --git a/src/pages/Invoice/components/InvoicingModal.tsx b/src/pages/Invoice/components/InvoicingModal.tsx index 39a60fc..c0efc63 100644 --- a/src/pages/Invoice/components/InvoicingModal.tsx +++ b/src/pages/Invoice/components/InvoicingModal.tsx @@ -1,6 +1,9 @@ import { RESPONSE_CODE } from '@/constants/enum'; -import { postServiceInvoiceInvoicing } from '@/services'; -import { ModalForm } from '@ant-design/pro-components'; +import { + postServiceInvoiceGetInvoicingAccount, + postServiceInvoiceInvoicing, +} from '@/services'; +import { ModalForm, ProFormSelect } from '@ant-design/pro-components'; import { Button, Form, message } from 'antd'; export default ({ selectedRowKeys, reloadRecordTable }) => { @@ -23,9 +26,10 @@ export default ({ selectedRowKeys, reloadRecordTable }) => { onCancel: () => console.log('run'), }} submitTimeout={2000} - onFinish={async () => { + onFinish={async (values) => { let res = await postServiceInvoiceInvoicing({ data: { + ...values, invoiceRecordIds: selectedRowKeys, }, }); @@ -36,6 +40,22 @@ export default ({ selectedRowKeys, reloadRecordTable }) => { message.success('提交成功'); return true; }} - ></ModalForm> + > + <ProFormSelect + name="invoicingAccount" + label="开票账号" + request={async () => { + const res = await postServiceInvoiceGetInvoicingAccount(); + return res.data.map((item) => { + return { + label: item.accountText, + value: item.account, + }; + }); + }} + placeholder="请选择开票账号" + rules={[{ required: true, message: '请选择开票账号!' }]} + /> + </ModalForm> ); }; diff --git a/src/services/definition.ts b/src/services/definition.ts index b846f51..482d759 100644 --- a/src/services/definition.ts +++ b/src/services/definition.ts @@ -221,6 +221,21 @@ export interface AdminDeptVO { pid?: number; } +export interface AdminInvoicingAccountDto { + account?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; + /** @format int64 */ + id?: number; + logicDelete?: boolean; + password?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; + userNames?: Array<string>; +} + export interface AdminJobQueryVO { /** @format int32 */ current?: number; diff --git a/src/services/request.ts b/src/services/request.ts index 67cb5f6..498a6e3 100644 --- a/src/services/request.ts +++ b/src/services/request.ts @@ -9,6 +9,7 @@ import type { AdminClientDto, AdminDeptQueryVO, AdminDeptVO, + AdminInvoicingAccountDto, AdminJobQueryVO, AdminJobVO, AdminMenuQueryVO, @@ -62,6 +63,7 @@ import type { MaterialUnitListRes, MeasureUnitListRes, MessageQueryDTO, + ModelAndView, OrderAddVO, OrderAuditLogQueryVO, OrderBaseInfoQueryVO, @@ -3170,9 +3172,7 @@ export interface GetErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * Unauthorized @@ -3193,9 +3193,9 @@ export interface GetErrorResponse { export type GetErrorResponseSuccess = GetErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html */ export const getError = /* #__PURE__ */ (() => { const method = 'get'; @@ -3219,9 +3219,7 @@ export interface PutErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * Created @@ -3247,9 +3245,9 @@ export interface PutErrorResponse { export type PutErrorResponseSuccess = PutErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html * @consumes application/json */ export const putError = /* #__PURE__ */ (() => { @@ -3274,9 +3272,7 @@ export interface PostErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * Created @@ -3302,9 +3298,9 @@ export interface PostErrorResponse { export type PostErrorResponseSuccess = PostErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html * @consumes application/json */ export const postError = /* #__PURE__ */ (() => { @@ -3329,9 +3325,7 @@ export interface DeleteErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * No Content @@ -3352,9 +3346,9 @@ export interface DeleteErrorResponse { export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html */ export const deleteError = /* #__PURE__ */ (() => { const method = 'delete'; @@ -3378,9 +3372,7 @@ export interface OptionsErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * No Content @@ -3401,9 +3393,9 @@ export interface OptionsErrorResponse { export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html * @consumes application/json */ export const optionsError = /* #__PURE__ */ (() => { @@ -3428,9 +3420,7 @@ export interface HeadErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * No Content @@ -3451,9 +3441,9 @@ export interface HeadErrorResponse { export type HeadErrorResponseSuccess = HeadErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html * @consumes application/json */ export const headError = /* #__PURE__ */ (() => { @@ -3478,9 +3468,7 @@ export interface PatchErrorResponse { * @description * OK */ - 200: { - [propertyName: string]: any; - }; + 200: ModelAndView; /** * @description * No Content @@ -3501,9 +3489,9 @@ export interface PatchErrorResponse { export type PatchErrorResponseSuccess = PatchErrorResponse[200]; /** * @description - * error + * errorHtml * @tags basic-error-controller - * @produces * + * @produces text/html * @consumes application/json */ export const patchError = /* #__PURE__ */ (() => { @@ -12418,6 +12406,77 @@ export const postServiceInvoiceAddInvoice = /* #__PURE__ */ (() => { return request; })(); +/** @description request parameter type for postServiceInvoiceAddInvoicingAccount */ +export interface PostServiceInvoiceAddInvoicingAccountOption { + /** + * @description + * dto + */ + body: { + /** + @description + dto */ + dto: AdminInvoicingAccountDto; + }; +} + +/** @description response type for postServiceInvoiceAddInvoicingAccount */ +export interface PostServiceInvoiceAddInvoicingAccountResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostServiceInvoiceAddInvoicingAccountResponseSuccess = + PostServiceInvoiceAddInvoicingAccountResponse[200]; +/** + * @description + * 添加开票账号 + * @tags 发票 + * @produces * + * @consumes application/json + */ +export const postServiceInvoiceAddInvoicingAccount = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/service/invoice/addInvoicingAccount'; + function request( + option: PostServiceInvoiceAddInvoicingAccountOption, + ): Promise<PostServiceInvoiceAddInvoicingAccountResponseSuccess> { + return requester(request.url, { + method: request.method, + ...option, + }) as unknown as Promise<PostServiceInvoiceAddInvoicingAccountResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description request parameter type for postServiceInvoiceApplyInvoice */ export interface PostServiceInvoiceApplyInvoiceOption { /** @@ -13182,6 +13241,60 @@ export const postServiceInvoiceGetInvoiceRecord = /* #__PURE__ */ (() => { return request; })(); +/** @description response type for postServiceInvoiceGetInvoicingAccount */ +export interface PostServiceInvoiceGetInvoicingAccountResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostServiceInvoiceGetInvoicingAccountResponseSuccess = + PostServiceInvoiceGetInvoicingAccountResponse[200]; +/** + * @description + * 获取开票账号 + * @tags 发票 + * @produces * + * @consumes application/json + */ +export const postServiceInvoiceGetInvoicingAccount = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/service/invoice/getInvoicingAccount'; + function request(): Promise<PostServiceInvoiceGetInvoicingAccountResponseSuccess> { + return requester(request.url, { + method: request.method, + }) as unknown as Promise<PostServiceInvoiceGetInvoicingAccountResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description request parameter type for postServiceInvoiceImportInvoiceDetails */ export interface PostServiceInvoiceImportInvoiceDetailsOption { /**