Commit 70550778ebd715353642b132ed6b75c69bc585fa
1 parent
0d00c8c5
refactor(Order): 重构开票申请功能
- 新增 type 参数区分申请开票和重新申请- 优化界面布局和字段显示逻辑 - 提高代码复用性和可维护性
Showing
3 changed files
with
120 additions
and
23 deletions
src/pages/Order/OrderList/InvoicingDrawerForm.tsx
... | ... | @@ -34,7 +34,13 @@ import { |
34 | 34 | import { Button, Divider, Form, Space, Tooltip, message } from 'antd'; |
35 | 35 | import { useEffect, useRef, useState } from 'react'; |
36 | 36 | |
37 | -export default ({ dataList, setVisible, mainOrder, onClose }) => { | |
37 | +export default ({ | |
38 | + dataList, | |
39 | + setVisible, | |
40 | + mainOrder, | |
41 | + onClose, | |
42 | + type = 'applyInvoicing', | |
43 | +}) => { | |
38 | 44 | // let subOrderIds = dataList?.map((item) => { |
39 | 45 | // return item.id; |
40 | 46 | // }) |
... | ... | @@ -76,7 +82,12 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { |
76 | 82 | }, []); |
77 | 83 | |
78 | 84 | useEffect(() => {}, [projectOptions]); |
79 | - | |
85 | + const types = new Map(); | |
86 | + types.set('applyInvoicing', { | |
87 | + title: '申请开票', | |
88 | + subOrderIdsName: '开票订单', | |
89 | + }); | |
90 | + types.set('reissue', { title: '重新申请', subOrderIdsName: '重开订单' }); | |
80 | 91 | function copyToClipboard(text: string) { |
81 | 92 | // 创建一个临时的textarea元素 |
82 | 93 | const textarea = document.createElement('textarea'); |
... | ... | @@ -119,7 +130,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { |
119 | 130 | return ( |
120 | 131 | <DrawerForm |
121 | 132 | open |
122 | - title="申请开票" | |
133 | + title={types.get(type).title} | |
123 | 134 | resize={{ |
124 | 135 | maxWidth: window.innerWidth * 0.8, |
125 | 136 | minWidth: 500, |
... | ... | @@ -188,7 +199,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { |
188 | 199 | <ProFormList |
189 | 200 | name="subOrderIdObjs" |
190 | 201 | readonly={true} |
191 | - label="开票订单" | |
202 | + label={types.get(type).subOrderIdsName} | |
192 | 203 | initialValue={dataListCopy.map((item) => { |
193 | 204 | return { |
194 | 205 | value: item.id, |
... | ... | @@ -202,6 +213,23 @@ export default ({ dataList, setVisible, mainOrder, onClose }) => { |
202 | 213 | </ProFormGroup> |
203 | 214 | </ProFormList> |
204 | 215 | <ProFormSelect |
216 | + name="invoices" | |
217 | + label="invoices" | |
218 | + request={async () => { | |
219 | + let reissueIds = dataListCopy.map((item) => { | |
220 | + return item.id; | |
221 | + }); | |
222 | + let res = await postServiceInvoiceWaitReissueInvoices({ | |
223 | + data: reissueIds, | |
224 | + }); | |
225 | + return enum2ReverseSelect(res.data); | |
226 | + }} | |
227 | + fieldProps={{ | |
228 | + mode: 'multiple', | |
229 | + }} | |
230 | + placeholder="请选择要重开的发票" | |
231 | + /> | |
232 | + <ProFormSelect | |
205 | 233 | name="ReissueInvoiceRecordIds" |
206 | 234 | label="重开的发票" |
207 | 235 | fieldProps={{ | ... | ... |
src/services/definition.ts
... | ... | @@ -2553,23 +2553,16 @@ export interface OrderStagesFromDo { |
2553 | 2553 | } |
2554 | 2554 | |
2555 | 2555 | export interface OrderStagesPayWay { |
2556 | - createByName?: string; | |
2557 | - /** @format date-time */ | |
2558 | - createTime?: string; | |
2559 | 2556 | /** @format date-time */ |
2560 | 2557 | dateRange?: string; |
2561 | 2558 | fileName?: string; |
2562 | 2559 | fileUrl?: string; |
2563 | 2560 | /** @format int32 */ |
2564 | 2561 | id?: number; |
2565 | - logicDelete?: boolean; | |
2566 | 2562 | /** @format int32 */ |
2567 | 2563 | number?: number; |
2568 | 2564 | /** @format int32 */ |
2569 | 2565 | ossId?: number; |
2570 | - updateByName?: string; | |
2571 | - /** @format date-time */ | |
2572 | - updateTime?: string; | |
2573 | 2566 | } |
2574 | 2567 | |
2575 | 2568 | export interface OrderStagesPayWayDo { |
... | ... | @@ -3940,15 +3933,16 @@ export interface SystemCustomFieldReq { |
3940 | 3933 | entityNumber?: string; |
3941 | 3934 | } |
3942 | 3935 | |
3936 | +export interface TicketsDeteleVo { | |
3937 | + ids?: Array<number>; | |
3938 | +} | |
3939 | + | |
3943 | 3940 | export interface TicketsSearchVo { |
3944 | 3941 | annexName?: string; |
3945 | 3942 | annexUrl?: string; |
3946 | 3943 | assignPeople?: string; |
3947 | 3944 | createByName?: string; |
3948 | - /** @format date-time */ | |
3949 | - createTimeBegin?: string; | |
3950 | - /** @format date-time */ | |
3951 | - createTimeEnd?: string; | |
3945 | + createTime?: Array<LocalDateTime>; | |
3952 | 3946 | /** @format int32 */ |
3953 | 3947 | current?: number; |
3954 | 3948 | detailText?: string; |
... | ... | @@ -3959,10 +3953,7 @@ export interface TicketsSearchVo { |
3959 | 3953 | origin?: string; |
3960 | 3954 | /** @format int32 */ |
3961 | 3955 | pageSize?: number; |
3962 | - /** @format date-time */ | |
3963 | - resolveTimeBegin?: string; | |
3964 | - /** @format date-time */ | |
3965 | - resolveTimeEnd?: string; | |
3956 | + resolveTime?: Array<LocalDateTime>; | |
3966 | 3957 | /** @format int32 */ |
3967 | 3958 | start?: number; |
3968 | 3959 | status?: string; |
... | ... | @@ -3981,6 +3972,9 @@ export interface TicketsVo { |
3981 | 3972 | /** @format int64 */ |
3982 | 3973 | id?: number; |
3983 | 3974 | origin?: string; |
3975 | + result?: string; | |
3976 | + resultAnnexName?: string; | |
3977 | + resultAnnexUrl?: string; | |
3984 | 3978 | status?: string; |
3985 | 3979 | type?: string; |
3986 | 3980 | } |
... | ... | @@ -4367,6 +4361,7 @@ export interface ClientCommunicationInfo { |
4367 | 4361 | ticketsAttachments?: string; |
4368 | 4362 | ticketsDetail?: string; |
4369 | 4363 | ticketsType?: string; |
4364 | + ticketsTypeText?: string; | |
4370 | 4365 | /** |
4371 | 4366 | * @description |
4372 | 4367 | * 客户状态 |
... | ... | @@ -4992,3 +4987,5 @@ export interface Dto { |
4992 | 4987 | */ |
4993 | 4988 | subOrderIds?: Array<string>; |
4994 | 4989 | } |
4990 | + | |
4991 | +export type LocalDateTime = any; | ... | ... |
src/services/request.ts
... | ... | @@ -133,6 +133,7 @@ import type { |
133 | 133 | StoreOrderInvoiceRequest, |
134 | 134 | SysLogQueryVO, |
135 | 135 | SystemCustomFieldReq, |
136 | + TicketsDeteleVo, | |
136 | 137 | TicketsSearchVo, |
137 | 138 | TicketsVo, |
138 | 139 | ToProcureAuditDto, |
... | ... | @@ -5218,6 +5219,77 @@ export const postOrderErpAuditWaitAuditList = /* #__PURE__ */ (() => { |
5218 | 5219 | return request; |
5219 | 5220 | })(); |
5220 | 5221 | |
5222 | +/** @description request parameter type for postOrderErpAuthGenerateToken */ | |
5223 | +export interface PostOrderErpAuthGenerateTokenOption { | |
5224 | + /** | |
5225 | + * @description | |
5226 | + * tokenApiDto | |
5227 | + */ | |
5228 | + body: { | |
5229 | + /** | |
5230 | + @description | |
5231 | + tokenApiDto */ | |
5232 | + tokenApiDto: TokenApiDto; | |
5233 | + }; | |
5234 | +} | |
5235 | + | |
5236 | +/** @description response type for postOrderErpAuthGenerateToken */ | |
5237 | +export interface PostOrderErpAuthGenerateTokenResponse { | |
5238 | + /** | |
5239 | + * @description | |
5240 | + * OK | |
5241 | + */ | |
5242 | + 200: ServerResult; | |
5243 | + /** | |
5244 | + * @description | |
5245 | + * Created | |
5246 | + */ | |
5247 | + 201: any; | |
5248 | + /** | |
5249 | + * @description | |
5250 | + * Unauthorized | |
5251 | + */ | |
5252 | + 401: any; | |
5253 | + /** | |
5254 | + * @description | |
5255 | + * Forbidden | |
5256 | + */ | |
5257 | + 403: any; | |
5258 | + /** | |
5259 | + * @description | |
5260 | + * Not Found | |
5261 | + */ | |
5262 | + 404: any; | |
5263 | +} | |
5264 | + | |
5265 | +export type PostOrderErpAuthGenerateTokenResponseSuccess = | |
5266 | + PostOrderErpAuthGenerateTokenResponse[200]; | |
5267 | +/** | |
5268 | + * @description | |
5269 | + * 生成token | |
5270 | + * @tags login-controller | |
5271 | + * @produces * | |
5272 | + * @consumes application/json | |
5273 | + */ | |
5274 | +export const postOrderErpAuthGenerateToken = /* #__PURE__ */ (() => { | |
5275 | + const method = 'post'; | |
5276 | + const url = '/order/erp/auth/generateToken'; | |
5277 | + function request( | |
5278 | + option: PostOrderErpAuthGenerateTokenOption, | |
5279 | + ): Promise<PostOrderErpAuthGenerateTokenResponseSuccess> { | |
5280 | + return requester(request.url, { | |
5281 | + method: request.method, | |
5282 | + ...option, | |
5283 | + }) as unknown as Promise<PostOrderErpAuthGenerateTokenResponseSuccess>; | |
5284 | + } | |
5285 | + | |
5286 | + /** http method */ | |
5287 | + request.method = method; | |
5288 | + /** request url */ | |
5289 | + request.url = url; | |
5290 | + return request; | |
5291 | +})(); | |
5292 | + | |
5221 | 5293 | /** @description request parameter type for postOrderErpAuthLoginByPhone */ |
5222 | 5294 | export interface PostOrderErpAuthLoginByPhoneOption { |
5223 | 5295 | /** |
... | ... | @@ -9985,13 +10057,13 @@ export const postOrderErpTicketsCreate = /* #__PURE__ */ (() => { |
9985 | 10057 | export interface PostOrderErpTicketsDeleteOption { |
9986 | 10058 | /** |
9987 | 10059 | * @description |
9988 | - * ids | |
10060 | + * ticketsDeteleVo | |
9989 | 10061 | */ |
9990 | - query: { | |
10062 | + body: { | |
9991 | 10063 | /** |
9992 | 10064 | @description |
9993 | - ids */ | |
9994 | - ids: Array<number>; | |
10065 | + ticketsDeteleVo */ | |
10066 | + ticketsDeteleVo: TicketsDeteleVo; | |
9995 | 10067 | }; |
9996 | 10068 | } |
9997 | 10069 | ... | ... |