Commit 26a8b0f94ee6287bdfae9c39566e9a057b17801f
1 parent
fe10c73e
feat: update 单据保存、下推按钮
Showing
3 changed files
with
228 additions
and
70 deletions
src/pages/Order/index.tsx
1 | import ButtonConfirm from '@/components/ButtomConfirm'; | 1 | import ButtonConfirm from '@/components/ButtomConfirm'; |
2 | import { RESPONSE_CODE } from '@/constants/enum'; | 2 | import { RESPONSE_CODE } from '@/constants/enum'; |
3 | import { | 3 | import { |
4 | + postKingdeeRepSalBillOutbound, | ||
5 | + postKingdeeRepSalOrderSave, | ||
4 | postServiceOrderNoNeedSend, | 6 | postServiceOrderNoNeedSend, |
5 | postServiceOrderOrderCancel, | 7 | postServiceOrderOrderCancel, |
6 | postServiceOrderProcureOrder, | 8 | postServiceOrderProcureOrder, |
@@ -1978,6 +1980,50 @@ const OrderPage = () => { | @@ -1978,6 +1980,50 @@ const OrderPage = () => { | ||
1978 | '' | 1980 | '' |
1979 | )} */} | 1981 | )} */} |
1980 | 1982 | ||
1983 | + {record.mainPath?.includes('salOrderSave') ? ( | ||
1984 | + <ButtonConfirm | ||
1985 | + className="p-0" | ||
1986 | + title="是否推送至金蝶ERP?" | ||
1987 | + text="推送ERP" | ||
1988 | + onConfirm={async () => { | ||
1989 | + let res = await postKingdeeRepSalOrderSave({ | ||
1990 | + data: { | ||
1991 | + id: record.id, | ||
1992 | + }, | ||
1993 | + }); | ||
1994 | + | ||
1995 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
1996 | + message.success('推送成功'); | ||
1997 | + mainTableRef.current.reload(); | ||
1998 | + } | ||
1999 | + }} | ||
2000 | + /> | ||
2001 | + ) : ( | ||
2002 | + '' | ||
2003 | + )} | ||
2004 | + | ||
2005 | + {record.mainPath?.includes('salBillOutbound') ? ( | ||
2006 | + <ButtonConfirm | ||
2007 | + className="p-0" | ||
2008 | + title="是否下推金蝶ERP出库单?" | ||
2009 | + text="下推出库" | ||
2010 | + onConfirm={async () => { | ||
2011 | + let res = await postKingdeeRepSalBillOutbound({ | ||
2012 | + data: { | ||
2013 | + id: record.id, | ||
2014 | + }, | ||
2015 | + }); | ||
2016 | + | ||
2017 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
2018 | + message.success('下推成功'); | ||
2019 | + mainTableRef.current.reload(); | ||
2020 | + } | ||
2021 | + }} | ||
2022 | + /> | ||
2023 | + ) : ( | ||
2024 | + '' | ||
2025 | + )} | ||
2026 | + | ||
1981 | {record.mainPath?.includes('orderCancel') ? ( | 2027 | {record.mainPath?.includes('orderCancel') ? ( |
1982 | <ButtonConfirm | 2028 | <ButtonConfirm |
1983 | className="p-0" | 2029 | className="p-0" |
src/services/definition.ts
@@ -1269,6 +1269,10 @@ export interface ResetPwdVO { | @@ -1269,6 +1269,10 @@ export interface ResetPwdVO { | ||
1269 | userId?: number; | 1269 | userId?: number; |
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | +export interface SalOrderSaveDto { | ||
1273 | + id?: string; | ||
1274 | +} | ||
1275 | + | ||
1272 | export interface SaveReply { | 1276 | export interface SaveReply { |
1273 | idNumberMap?: { | 1277 | idNumberMap?: { |
1274 | [propertyName: string]: string; | 1278 | [propertyName: string]: string; |
src/services/request.ts
@@ -38,7 +38,6 @@ import type { | @@ -38,7 +38,6 @@ import type { | ||
38 | MaterialStockRes, | 38 | MaterialStockRes, |
39 | MaterialUnitListRes, | 39 | MaterialUnitListRes, |
40 | MeasureUnitListRes, | 40 | MeasureUnitListRes, |
41 | - ModelAndView, | ||
42 | OrderAddVO, | 41 | OrderAddVO, |
43 | OrderAuditLogQueryVO, | 42 | OrderAuditLogQueryVO, |
44 | OrderBaseInfoQueryVO, | 43 | OrderBaseInfoQueryVO, |
@@ -60,6 +59,7 @@ import type { | @@ -60,6 +59,7 @@ import type { | ||
60 | QueryMainOrderDto, | 59 | QueryMainOrderDto, |
61 | QueryReportFormsDto, | 60 | QueryReportFormsDto, |
62 | ResetPwdVO, | 61 | ResetPwdVO, |
62 | + SalOrderSaveDto, | ||
63 | SaveReply, | 63 | SaveReply, |
64 | ServerResult, | 64 | ServerResult, |
65 | SysLogQueryVO, | 65 | SysLogQueryVO, |
@@ -246,7 +246,9 @@ export interface GetErrorResponse { | @@ -246,7 +246,9 @@ export interface GetErrorResponse { | ||
246 | * @description | 246 | * @description |
247 | * OK | 247 | * OK |
248 | */ | 248 | */ |
249 | - 200: ModelAndView; | 249 | + 200: { |
250 | + [propertyName: string]: any; | ||
251 | + }; | ||
250 | /** | 252 | /** |
251 | * @description | 253 | * @description |
252 | * Unauthorized | 254 | * Unauthorized |
@@ -267,9 +269,9 @@ export interface GetErrorResponse { | @@ -267,9 +269,9 @@ export interface GetErrorResponse { | ||
267 | export type GetErrorResponseSuccess = GetErrorResponse[200]; | 269 | export type GetErrorResponseSuccess = GetErrorResponse[200]; |
268 | /** | 270 | /** |
269 | * @description | 271 | * @description |
270 | - * errorHtml | 272 | + * error |
271 | * @tags basic-error-controller | 273 | * @tags basic-error-controller |
272 | - * @produces text/html | 274 | + * @produces * |
273 | */ | 275 | */ |
274 | export const getError = /* #__PURE__ */ (() => { | 276 | export const getError = /* #__PURE__ */ (() => { |
275 | const method = 'get'; | 277 | const method = 'get'; |
@@ -293,7 +295,9 @@ export interface PutErrorResponse { | @@ -293,7 +295,9 @@ export interface PutErrorResponse { | ||
293 | * @description | 295 | * @description |
294 | * OK | 296 | * OK |
295 | */ | 297 | */ |
296 | - 200: ModelAndView; | 298 | + 200: { |
299 | + [propertyName: string]: any; | ||
300 | + }; | ||
297 | /** | 301 | /** |
298 | * @description | 302 | * @description |
299 | * Created | 303 | * Created |
@@ -319,9 +323,9 @@ export interface PutErrorResponse { | @@ -319,9 +323,9 @@ export interface PutErrorResponse { | ||
319 | export type PutErrorResponseSuccess = PutErrorResponse[200]; | 323 | export type PutErrorResponseSuccess = PutErrorResponse[200]; |
320 | /** | 324 | /** |
321 | * @description | 325 | * @description |
322 | - * errorHtml | 326 | + * error |
323 | * @tags basic-error-controller | 327 | * @tags basic-error-controller |
324 | - * @produces text/html | 328 | + * @produces * |
325 | * @consumes application/json | 329 | * @consumes application/json |
326 | */ | 330 | */ |
327 | export const putError = /* #__PURE__ */ (() => { | 331 | export const putError = /* #__PURE__ */ (() => { |
@@ -346,7 +350,9 @@ export interface PostErrorResponse { | @@ -346,7 +350,9 @@ export interface PostErrorResponse { | ||
346 | * @description | 350 | * @description |
347 | * OK | 351 | * OK |
348 | */ | 352 | */ |
349 | - 200: ModelAndView; | 353 | + 200: { |
354 | + [propertyName: string]: any; | ||
355 | + }; | ||
350 | /** | 356 | /** |
351 | * @description | 357 | * @description |
352 | * Created | 358 | * Created |
@@ -372,9 +378,9 @@ export interface PostErrorResponse { | @@ -372,9 +378,9 @@ export interface PostErrorResponse { | ||
372 | export type PostErrorResponseSuccess = PostErrorResponse[200]; | 378 | export type PostErrorResponseSuccess = PostErrorResponse[200]; |
373 | /** | 379 | /** |
374 | * @description | 380 | * @description |
375 | - * errorHtml | 381 | + * error |
376 | * @tags basic-error-controller | 382 | * @tags basic-error-controller |
377 | - * @produces text/html | 383 | + * @produces * |
378 | * @consumes application/json | 384 | * @consumes application/json |
379 | */ | 385 | */ |
380 | export const postError = /* #__PURE__ */ (() => { | 386 | export const postError = /* #__PURE__ */ (() => { |
@@ -399,7 +405,9 @@ export interface DeleteErrorResponse { | @@ -399,7 +405,9 @@ export interface DeleteErrorResponse { | ||
399 | * @description | 405 | * @description |
400 | * OK | 406 | * OK |
401 | */ | 407 | */ |
402 | - 200: ModelAndView; | 408 | + 200: { |
409 | + [propertyName: string]: any; | ||
410 | + }; | ||
403 | /** | 411 | /** |
404 | * @description | 412 | * @description |
405 | * No Content | 413 | * No Content |
@@ -420,9 +428,9 @@ export interface DeleteErrorResponse { | @@ -420,9 +428,9 @@ export interface DeleteErrorResponse { | ||
420 | export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; | 428 | export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; |
421 | /** | 429 | /** |
422 | * @description | 430 | * @description |
423 | - * errorHtml | 431 | + * error |
424 | * @tags basic-error-controller | 432 | * @tags basic-error-controller |
425 | - * @produces text/html | 433 | + * @produces * |
426 | */ | 434 | */ |
427 | export const deleteError = /* #__PURE__ */ (() => { | 435 | export const deleteError = /* #__PURE__ */ (() => { |
428 | const method = 'delete'; | 436 | const method = 'delete'; |
@@ -446,7 +454,9 @@ export interface OptionsErrorResponse { | @@ -446,7 +454,9 @@ export interface OptionsErrorResponse { | ||
446 | * @description | 454 | * @description |
447 | * OK | 455 | * OK |
448 | */ | 456 | */ |
449 | - 200: ModelAndView; | 457 | + 200: { |
458 | + [propertyName: string]: any; | ||
459 | + }; | ||
450 | /** | 460 | /** |
451 | * @description | 461 | * @description |
452 | * No Content | 462 | * No Content |
@@ -467,9 +477,9 @@ export interface OptionsErrorResponse { | @@ -467,9 +477,9 @@ export interface OptionsErrorResponse { | ||
467 | export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; | 477 | export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; |
468 | /** | 478 | /** |
469 | * @description | 479 | * @description |
470 | - * errorHtml | 480 | + * error |
471 | * @tags basic-error-controller | 481 | * @tags basic-error-controller |
472 | - * @produces text/html | 482 | + * @produces * |
473 | * @consumes application/json | 483 | * @consumes application/json |
474 | */ | 484 | */ |
475 | export const optionsError = /* #__PURE__ */ (() => { | 485 | export const optionsError = /* #__PURE__ */ (() => { |
@@ -494,7 +504,9 @@ export interface HeadErrorResponse { | @@ -494,7 +504,9 @@ export interface HeadErrorResponse { | ||
494 | * @description | 504 | * @description |
495 | * OK | 505 | * OK |
496 | */ | 506 | */ |
497 | - 200: ModelAndView; | 507 | + 200: { |
508 | + [propertyName: string]: any; | ||
509 | + }; | ||
498 | /** | 510 | /** |
499 | * @description | 511 | * @description |
500 | * No Content | 512 | * No Content |
@@ -515,9 +527,9 @@ export interface HeadErrorResponse { | @@ -515,9 +527,9 @@ export interface HeadErrorResponse { | ||
515 | export type HeadErrorResponseSuccess = HeadErrorResponse[200]; | 527 | export type HeadErrorResponseSuccess = HeadErrorResponse[200]; |
516 | /** | 528 | /** |
517 | * @description | 529 | * @description |
518 | - * errorHtml | 530 | + * error |
519 | * @tags basic-error-controller | 531 | * @tags basic-error-controller |
520 | - * @produces text/html | 532 | + * @produces * |
521 | * @consumes application/json | 533 | * @consumes application/json |
522 | */ | 534 | */ |
523 | export const headError = /* #__PURE__ */ (() => { | 535 | export const headError = /* #__PURE__ */ (() => { |
@@ -542,7 +554,9 @@ export interface PatchErrorResponse { | @@ -542,7 +554,9 @@ export interface PatchErrorResponse { | ||
542 | * @description | 554 | * @description |
543 | * OK | 555 | * OK |
544 | */ | 556 | */ |
545 | - 200: ModelAndView; | 557 | + 200: { |
558 | + [propertyName: string]: any; | ||
559 | + }; | ||
546 | /** | 560 | /** |
547 | * @description | 561 | * @description |
548 | * No Content | 562 | * No Content |
@@ -563,9 +577,9 @@ export interface PatchErrorResponse { | @@ -563,9 +577,9 @@ export interface PatchErrorResponse { | ||
563 | export type PatchErrorResponseSuccess = PatchErrorResponse[200]; | 577 | export type PatchErrorResponseSuccess = PatchErrorResponse[200]; |
564 | /** | 578 | /** |
565 | * @description | 579 | * @description |
566 | - * errorHtml | 580 | + * error |
567 | * @tags basic-error-controller | 581 | * @tags basic-error-controller |
568 | - * @produces text/html | 582 | + * @produces * |
569 | * @consumes application/json | 583 | * @consumes application/json |
570 | */ | 584 | */ |
571 | export const patchError = /* #__PURE__ */ (() => { | 585 | export const patchError = /* #__PURE__ */ (() => { |
@@ -797,54 +811,6 @@ export const postKingdeeRepCustomerSave = /* #__PURE__ */ (() => { | @@ -797,54 +811,6 @@ export const postKingdeeRepCustomerSave = /* #__PURE__ */ (() => { | ||
797 | return request; | 811 | return request; |
798 | })(); | 812 | })(); |
799 | 813 | ||
800 | -/** @description response type for getKingdeeRepGetToken */ | ||
801 | -export interface GetKingdeeRepGetTokenResponse { | ||
802 | - /** | ||
803 | - * @description | ||
804 | - * OK | ||
805 | - */ | ||
806 | - 200: string; | ||
807 | - /** | ||
808 | - * @description | ||
809 | - * Unauthorized | ||
810 | - */ | ||
811 | - 401: any; | ||
812 | - /** | ||
813 | - * @description | ||
814 | - * Forbidden | ||
815 | - */ | ||
816 | - 403: any; | ||
817 | - /** | ||
818 | - * @description | ||
819 | - * Not Found | ||
820 | - */ | ||
821 | - 404: any; | ||
822 | -} | ||
823 | - | ||
824 | -export type GetKingdeeRepGetTokenResponseSuccess = | ||
825 | - GetKingdeeRepGetTokenResponse[200]; | ||
826 | -/** | ||
827 | - * @description | ||
828 | - * getToken | ||
829 | - * @tags kingdee-erp-controller | ||
830 | - * @produces * | ||
831 | - */ | ||
832 | -export const getKingdeeRepGetToken = /* #__PURE__ */ (() => { | ||
833 | - const method = 'get'; | ||
834 | - const url = '/kingdee/rep/getToken'; | ||
835 | - function request(): Promise<GetKingdeeRepGetTokenResponseSuccess> { | ||
836 | - return requester(request.url, { | ||
837 | - method: request.method, | ||
838 | - }) as unknown as Promise<GetKingdeeRepGetTokenResponseSuccess>; | ||
839 | - } | ||
840 | - | ||
841 | - /** http method */ | ||
842 | - request.method = method; | ||
843 | - /** request url */ | ||
844 | - request.url = url; | ||
845 | - return request; | ||
846 | -})(); | ||
847 | - | ||
848 | /** @description request parameter type for postKingdeeRepMaterial */ | 814 | /** @description request parameter type for postKingdeeRepMaterial */ |
849 | export interface PostKingdeeRepMaterialOption { | 815 | export interface PostKingdeeRepMaterialOption { |
850 | /** | 816 | /** |
@@ -1129,6 +1095,148 @@ export const postKingdeeRepMeasureUnit = /* #__PURE__ */ (() => { | @@ -1129,6 +1095,148 @@ export const postKingdeeRepMeasureUnit = /* #__PURE__ */ (() => { | ||
1129 | return request; | 1095 | return request; |
1130 | })(); | 1096 | })(); |
1131 | 1097 | ||
1098 | +/** @description request parameter type for postKingdeeRepSalBillOutbound */ | ||
1099 | +export interface PostKingdeeRepSalBillOutboundOption { | ||
1100 | + /** | ||
1101 | + * @description | ||
1102 | + * salOrderSaveDto | ||
1103 | + */ | ||
1104 | + body: { | ||
1105 | + /** | ||
1106 | + @description | ||
1107 | + salOrderSaveDto */ | ||
1108 | + salOrderSaveDto: SalOrderSaveDto; | ||
1109 | + }; | ||
1110 | +} | ||
1111 | + | ||
1112 | +/** @description response type for postKingdeeRepSalBillOutbound */ | ||
1113 | +export interface PostKingdeeRepSalBillOutboundResponse { | ||
1114 | + /** | ||
1115 | + * @description | ||
1116 | + * OK | ||
1117 | + */ | ||
1118 | + 200: ServerResult; | ||
1119 | + /** | ||
1120 | + * @description | ||
1121 | + * Created | ||
1122 | + */ | ||
1123 | + 201: any; | ||
1124 | + /** | ||
1125 | + * @description | ||
1126 | + * Unauthorized | ||
1127 | + */ | ||
1128 | + 401: any; | ||
1129 | + /** | ||
1130 | + * @description | ||
1131 | + * Forbidden | ||
1132 | + */ | ||
1133 | + 403: any; | ||
1134 | + /** | ||
1135 | + * @description | ||
1136 | + * Not Found | ||
1137 | + */ | ||
1138 | + 404: any; | ||
1139 | +} | ||
1140 | + | ||
1141 | +export type PostKingdeeRepSalBillOutboundResponseSuccess = | ||
1142 | + PostKingdeeRepSalBillOutboundResponse[200]; | ||
1143 | +/** | ||
1144 | + * @description | ||
1145 | + * salBillOutbound | ||
1146 | + * @tags kingdee-erp-controller | ||
1147 | + * @produces * | ||
1148 | + * @consumes application/json | ||
1149 | + */ | ||
1150 | +export const postKingdeeRepSalBillOutbound = /* #__PURE__ */ (() => { | ||
1151 | + const method = 'post'; | ||
1152 | + const url = '/kingdee/rep/salBillOutbound'; | ||
1153 | + function request( | ||
1154 | + option: PostKingdeeRepSalBillOutboundOption, | ||
1155 | + ): Promise<PostKingdeeRepSalBillOutboundResponseSuccess> { | ||
1156 | + return requester(request.url, { | ||
1157 | + method: request.method, | ||
1158 | + ...option, | ||
1159 | + }) as unknown as Promise<PostKingdeeRepSalBillOutboundResponseSuccess>; | ||
1160 | + } | ||
1161 | + | ||
1162 | + /** http method */ | ||
1163 | + request.method = method; | ||
1164 | + /** request url */ | ||
1165 | + request.url = url; | ||
1166 | + return request; | ||
1167 | +})(); | ||
1168 | + | ||
1169 | +/** @description request parameter type for postKingdeeRepSalOrderSave */ | ||
1170 | +export interface PostKingdeeRepSalOrderSaveOption { | ||
1171 | + /** | ||
1172 | + * @description | ||
1173 | + * salOrderSaveDto | ||
1174 | + */ | ||
1175 | + body: { | ||
1176 | + /** | ||
1177 | + @description | ||
1178 | + salOrderSaveDto */ | ||
1179 | + salOrderSaveDto: SalOrderSaveDto; | ||
1180 | + }; | ||
1181 | +} | ||
1182 | + | ||
1183 | +/** @description response type for postKingdeeRepSalOrderSave */ | ||
1184 | +export interface PostKingdeeRepSalOrderSaveResponse { | ||
1185 | + /** | ||
1186 | + * @description | ||
1187 | + * OK | ||
1188 | + */ | ||
1189 | + 200: ServerResult; | ||
1190 | + /** | ||
1191 | + * @description | ||
1192 | + * Created | ||
1193 | + */ | ||
1194 | + 201: any; | ||
1195 | + /** | ||
1196 | + * @description | ||
1197 | + * Unauthorized | ||
1198 | + */ | ||
1199 | + 401: any; | ||
1200 | + /** | ||
1201 | + * @description | ||
1202 | + * Forbidden | ||
1203 | + */ | ||
1204 | + 403: any; | ||
1205 | + /** | ||
1206 | + * @description | ||
1207 | + * Not Found | ||
1208 | + */ | ||
1209 | + 404: any; | ||
1210 | +} | ||
1211 | + | ||
1212 | +export type PostKingdeeRepSalOrderSaveResponseSuccess = | ||
1213 | + PostKingdeeRepSalOrderSaveResponse[200]; | ||
1214 | +/** | ||
1215 | + * @description | ||
1216 | + * salOrderSave | ||
1217 | + * @tags kingdee-erp-controller | ||
1218 | + * @produces * | ||
1219 | + * @consumes application/json | ||
1220 | + */ | ||
1221 | +export const postKingdeeRepSalOrderSave = /* #__PURE__ */ (() => { | ||
1222 | + const method = 'post'; | ||
1223 | + const url = '/kingdee/rep/salOrderSave'; | ||
1224 | + function request( | ||
1225 | + option: PostKingdeeRepSalOrderSaveOption, | ||
1226 | + ): Promise<PostKingdeeRepSalOrderSaveResponseSuccess> { | ||
1227 | + return requester(request.url, { | ||
1228 | + method: request.method, | ||
1229 | + ...option, | ||
1230 | + }) as unknown as Promise<PostKingdeeRepSalOrderSaveResponseSuccess>; | ||
1231 | + } | ||
1232 | + | ||
1233 | + /** http method */ | ||
1234 | + request.method = method; | ||
1235 | + /** request url */ | ||
1236 | + request.url = url; | ||
1237 | + return request; | ||
1238 | +})(); | ||
1239 | + | ||
1132 | /** @description request parameter type for postKingdeeRepSystemCustomField */ | 1240 | /** @description request parameter type for postKingdeeRepSystemCustomField */ |
1133 | export interface PostKingdeeRepSystemCustomFieldOption { | 1241 | export interface PostKingdeeRepSystemCustomFieldOption { |
1134 | /** | 1242 | /** |