verce-vue-test 0.0.78 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.vue +5 -0
- package/src/router/index.ts +5 -0
- package/src/views/ForecastInfo/api.ts +60 -0
- package/src/views/ForecastInfo/components/FlowInfoPanel.vue +33 -6
- package/src/views/ForecastInfo/components/ForecastInfoPanel.vue +25 -15
- package/src/views/ForecastInfo/store.ts +62 -497
- package/src/views/rmb-position-estimation/README.md +543 -0
- package/src/views/rmb-position-estimation/index.vue +3 -2
- package/src/views/rmb-position-forecast/index.vue +1496 -0
- package/src/views/rmb-position-forecast/mock.ts +165 -0
- package/src/views/rmb-position-forecast/options.ts +82 -0
- package/src/views/rmb-position-forecast/types.ts +110 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, ref } from 'vue'
|
|
2
2
|
import { defineStore } from 'pinia'
|
|
3
|
+
import forecastInfoApi from './api'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* forecast-info 页面共用状态。
|
|
@@ -9,9 +10,7 @@ import { defineStore } from 'pinia'
|
|
|
9
10
|
* - 保存两个表格的查询参数、分页、loading、数据和总数;
|
|
10
11
|
* - 按业务 key 保存多个表格的多选结果;
|
|
11
12
|
* - 统一处理匡算、核销、撤销核销等跨表业务操作;
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
* 真实接口对接时,只需要替换本文件中的 queryForecastInfoList 和 queryFlowInfoList。
|
|
13
|
+
* - 通过 TAM 接口查询数据并执行核销、撤销核销。
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
/** 页面卡片排列方式:vertical=上下卡片,horizontal=左右卡片。 */
|
|
@@ -44,7 +43,7 @@ export type ForecastInfoQueryParams = {
|
|
|
44
43
|
clientName: string
|
|
45
44
|
/** 交易对手名称。 */
|
|
46
45
|
competName: string
|
|
47
|
-
/**
|
|
46
|
+
/** 截止金额,单位元。 */
|
|
48
47
|
endTransAmt: string
|
|
49
48
|
/** 落地机构。 */
|
|
50
49
|
groundBranch: string
|
|
@@ -56,7 +55,7 @@ export type ForecastInfoQueryParams = {
|
|
|
56
55
|
payChannel: string
|
|
57
56
|
/** 收支方向。 */
|
|
58
57
|
payDirec: string
|
|
59
|
-
/**
|
|
58
|
+
/** 起始金额,单位元。 */
|
|
60
59
|
startTransAmt: string
|
|
61
60
|
/** 交易日期,格式 YYYYMMDD。 */
|
|
62
61
|
tranDate: string
|
|
@@ -116,7 +115,7 @@ export type FlowInfoQueryParams = {
|
|
|
116
115
|
clientName: string
|
|
117
116
|
/** 对方户名。 */
|
|
118
117
|
competName: string
|
|
119
|
-
/**
|
|
118
|
+
/** 截止金额,单位元。 */
|
|
120
119
|
endTransAmt: string
|
|
121
120
|
/** 我方机构。 */
|
|
122
121
|
groundBranch: string
|
|
@@ -126,7 +125,7 @@ export type FlowInfoQueryParams = {
|
|
|
126
125
|
payChannel: string
|
|
127
126
|
/** 收支方向。 */
|
|
128
127
|
payDirec: string
|
|
129
|
-
/**
|
|
128
|
+
/** 起始金额,单位元。 */
|
|
130
129
|
startTransAmt: string
|
|
131
130
|
/** 交易日期,格式 YYYYMMDD。 */
|
|
132
131
|
tranDate: string
|
|
@@ -234,444 +233,32 @@ export type VerificationRequestParams = {
|
|
|
234
233
|
tranList: VerificationTranItem[]
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
// ---- 模拟接口数据 ----
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* 预报 mock 数据保留后端原始字段名和编码,方便真实接口接入时直接替换返回体。
|
|
241
|
-
* 表格中的展示转换(如金额千分位、状态文本)始终由组件层负责。
|
|
242
|
-
*/
|
|
243
|
-
/** 预报信息 mock 返回。真实接口未接入前用于页面联调。 */
|
|
244
|
-
const mockForecastInfoResponse: ForecastInfoListResponse = {
|
|
245
|
-
resultList: [
|
|
246
|
-
{
|
|
247
|
-
busiType: '1',
|
|
248
|
-
competName: '1234',
|
|
249
|
-
groundBranch: '北京银行总行核算中心',
|
|
250
|
-
payChannel: '1',
|
|
251
|
-
payDirec: '1',
|
|
252
|
-
predAmt: '1234',
|
|
253
|
-
predDate: '20260707 15:43:31',
|
|
254
|
-
predRefNo: '2026070702352125',
|
|
255
|
-
predStatus: '1',
|
|
256
|
-
tranDate: '20260707',
|
|
257
|
-
verifyAmt: '0',
|
|
258
|
-
clientType: '3',
|
|
259
|
-
verifyStatus: '1',
|
|
260
|
-
billDate: '',
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
busiType: '1',
|
|
264
|
-
competName: '424234',
|
|
265
|
-
groundBranch: '北京银行总行核算中心',
|
|
266
|
-
payChannel: '1',
|
|
267
|
-
payDirec: '1',
|
|
268
|
-
predAmt: '11123',
|
|
269
|
-
predDate: '20260707 11:10:28',
|
|
270
|
-
predRefNo: '2026070702334161',
|
|
271
|
-
predStatus: '1',
|
|
272
|
-
tranDate: '20260707',
|
|
273
|
-
verifyAmt: '11123',
|
|
274
|
-
clientType: '3',
|
|
275
|
-
verifyStatus: '2',
|
|
276
|
-
billDate: '',
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
busiType: '1',
|
|
280
|
-
competName: '424234',
|
|
281
|
-
groundBranch: '北京银行总行核算中心',
|
|
282
|
-
payChannel: '1',
|
|
283
|
-
payDirec: '1',
|
|
284
|
-
predAmt: '11123',
|
|
285
|
-
predDate: '20260707 10:31:58',
|
|
286
|
-
predRefNo: '2026070702334153',
|
|
287
|
-
predStatus: '1',
|
|
288
|
-
tranDate: '20260707',
|
|
289
|
-
verifyAmt: '0',
|
|
290
|
-
clientType: '3',
|
|
291
|
-
verifyStatus: '1',
|
|
292
|
-
billDate: '',
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
busiType: '1',
|
|
296
|
-
competName: '424234',
|
|
297
|
-
groundBranch: '北京银行总行核算中心',
|
|
298
|
-
payChannel: '1',
|
|
299
|
-
payDirec: '1',
|
|
300
|
-
predAmt: '11123',
|
|
301
|
-
predDate: '20260707 10:31:54',
|
|
302
|
-
predRefNo: '2026070702334152',
|
|
303
|
-
predStatus: '1',
|
|
304
|
-
tranDate: '20260707',
|
|
305
|
-
verifyAmt: '0',
|
|
306
|
-
clientType: '3',
|
|
307
|
-
verifyStatus: '1',
|
|
308
|
-
billDate: '',
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
busiType: '1',
|
|
312
|
-
competName: '424234',
|
|
313
|
-
groundBranch: '北京银行总行核算中心',
|
|
314
|
-
payChannel: '1',
|
|
315
|
-
payDirec: '1',
|
|
316
|
-
predAmt: '11123',
|
|
317
|
-
predDate: '20260707 10:31:52',
|
|
318
|
-
predRefNo: '2026070702334151',
|
|
319
|
-
predStatus: '1',
|
|
320
|
-
tranDate: '20260707',
|
|
321
|
-
verifyAmt: '0',
|
|
322
|
-
clientType: '3',
|
|
323
|
-
verifyStatus: '1',
|
|
324
|
-
billDate: '',
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
busiType: '1',
|
|
328
|
-
competName: '424234',
|
|
329
|
-
groundBranch: '北京银行总行核算中心',
|
|
330
|
-
payChannel: '1',
|
|
331
|
-
payDirec: '1',
|
|
332
|
-
predAmt: '11123',
|
|
333
|
-
predDate: '20260707 10:31:49',
|
|
334
|
-
predRefNo: '2026070702334150',
|
|
335
|
-
predStatus: '1',
|
|
336
|
-
tranDate: '20260707',
|
|
337
|
-
verifyAmt: '0',
|
|
338
|
-
clientType: '3',
|
|
339
|
-
verifyStatus: '1',
|
|
340
|
-
billDate: '',
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
busiType: '1',
|
|
344
|
-
competName: '424234',
|
|
345
|
-
groundBranch: '北京银行总行核算中心',
|
|
346
|
-
payChannel: '1',
|
|
347
|
-
payDirec: '1',
|
|
348
|
-
predAmt: '11123',
|
|
349
|
-
predDate: '20260707 10:31:47',
|
|
350
|
-
predRefNo: '2026070702334149',
|
|
351
|
-
predStatus: '1',
|
|
352
|
-
tranDate: '20260707',
|
|
353
|
-
verifyAmt: '0',
|
|
354
|
-
clientType: '3',
|
|
355
|
-
verifyStatus: '1',
|
|
356
|
-
billDate: '',
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
busiType: '1',
|
|
360
|
-
competName: '424234',
|
|
361
|
-
groundBranch: '北京银行总行核算中心',
|
|
362
|
-
payChannel: '1',
|
|
363
|
-
payDirec: '1',
|
|
364
|
-
predAmt: '11123',
|
|
365
|
-
predDate: '20260707 10:31:45',
|
|
366
|
-
predRefNo: '2026070702334148',
|
|
367
|
-
predStatus: '1',
|
|
368
|
-
tranDate: '20260707',
|
|
369
|
-
verifyAmt: '0',
|
|
370
|
-
clientType: '3',
|
|
371
|
-
verifyStatus: '1',
|
|
372
|
-
billDate: '',
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
busiType: '1',
|
|
376
|
-
competName: '424234',
|
|
377
|
-
groundBranch: '北京银行总行核算中心',
|
|
378
|
-
payChannel: '1',
|
|
379
|
-
payDirec: '1',
|
|
380
|
-
predAmt: '11123',
|
|
381
|
-
predDate: '20260707 10:27:59',
|
|
382
|
-
predRefNo: '2026070702334147',
|
|
383
|
-
predStatus: '1',
|
|
384
|
-
tranDate: '20260707',
|
|
385
|
-
verifyAmt: '0',
|
|
386
|
-
clientType: '3',
|
|
387
|
-
verifyStatus: '1',
|
|
388
|
-
billDate: '',
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
busiType: '1',
|
|
392
|
-
competName: '424234',
|
|
393
|
-
groundBranch: '北京银行总行核算中心',
|
|
394
|
-
payChannel: '1',
|
|
395
|
-
payDirec: '1',
|
|
396
|
-
predAmt: '11123',
|
|
397
|
-
predDate: '20260707 10:26:54',
|
|
398
|
-
predRefNo: '2026070702334146',
|
|
399
|
-
predStatus: '1',
|
|
400
|
-
tranDate: '20260707',
|
|
401
|
-
verifyAmt: '0',
|
|
402
|
-
clientType: '3',
|
|
403
|
-
verifyStatus: '1',
|
|
404
|
-
billDate: '',
|
|
405
|
-
},
|
|
406
|
-
],
|
|
407
|
-
totalCount: '10',
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/** 流水 mock 数据同样保留后端原始编码,totalCount 可大于当前 mock 页数据条数。 */
|
|
411
|
-
/** 流水信息 mock 返回。真实接口未接入前用于页面联调。 */
|
|
412
|
-
const mockFlowInfoResponse: FlowInfoListResponse = {
|
|
413
|
-
resultList: [
|
|
414
|
-
{
|
|
415
|
-
refNo: '2022102700394594',
|
|
416
|
-
verifyStatus: '2',
|
|
417
|
-
payDirec: '1',
|
|
418
|
-
amt: '500000100',
|
|
419
|
-
groundBranch: '总行营业部',
|
|
420
|
-
clientName: 'app03-2010账号',
|
|
421
|
-
clientAcct: '01090321000120109095525',
|
|
422
|
-
competName: '中岛美嘉',
|
|
423
|
-
competAcct: '1111000000003388',
|
|
424
|
-
standardName: '名称维护表无此对手',
|
|
425
|
-
billDate: '',
|
|
426
|
-
payChannel: 'HVPS',
|
|
427
|
-
tranDate: '20260604',
|
|
428
|
-
tranTimeStamp: '',
|
|
429
|
-
busiType: 'A105-退汇',
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
refNo: '2022102700394599',
|
|
433
|
-
verifyStatus: '2',
|
|
434
|
-
payDirec: '1',
|
|
435
|
-
amt: '500000100',
|
|
436
|
-
groundBranch: '总行营业部',
|
|
437
|
-
clientName: 'app03-2010账号',
|
|
438
|
-
clientAcct: '01090321000120109095525',
|
|
439
|
-
competName: '北京华运源国际物流有限公司HDR(脱敏)',
|
|
440
|
-
competAcct: '500120101015264',
|
|
441
|
-
standardName: '名称维护表无此对手',
|
|
442
|
-
billDate: '',
|
|
443
|
-
payChannel: 'HVPS',
|
|
444
|
-
tranDate: '20260604',
|
|
445
|
-
tranTimeStamp: '',
|
|
446
|
-
busiType: 'A105-退汇',
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
refNo: '2022102700394604',
|
|
450
|
-
verifyStatus: '2',
|
|
451
|
-
payDirec: '1',
|
|
452
|
-
amt: '500000100',
|
|
453
|
-
groundBranch: '总行营业部',
|
|
454
|
-
clientName: 'app03-2010账号',
|
|
455
|
-
clientAcct: '01090321000120109095525',
|
|
456
|
-
competName: '北京华运源国际物流有限公司HDR(脱敏)',
|
|
457
|
-
competAcct: '500120101015264',
|
|
458
|
-
standardName: '名称维护表无此对手',
|
|
459
|
-
billDate: '',
|
|
460
|
-
payChannel: 'HVPS',
|
|
461
|
-
tranDate: '20260604',
|
|
462
|
-
tranTimeStamp: '',
|
|
463
|
-
busiType: 'A105-退汇',
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
refNo: '2022102700394605',
|
|
467
|
-
verifyStatus: '2',
|
|
468
|
-
payDirec: '1',
|
|
469
|
-
amt: '500000100',
|
|
470
|
-
groundBranch: '总行营业部',
|
|
471
|
-
clientName: 'app03-2010账号',
|
|
472
|
-
clientAcct: '01090321000120109095525',
|
|
473
|
-
competName: '中岛美嘉',
|
|
474
|
-
competAcct: '1111000000003388',
|
|
475
|
-
standardName: '名称维护表无此对手',
|
|
476
|
-
billDate: '',
|
|
477
|
-
payChannel: 'HVPS',
|
|
478
|
-
tranDate: '20260604',
|
|
479
|
-
tranTimeStamp: '',
|
|
480
|
-
busiType: 'A105-退汇',
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
refNo: '2022102700394668',
|
|
484
|
-
verifyStatus: '1',
|
|
485
|
-
payDirec: '0',
|
|
486
|
-
amt: '7128700',
|
|
487
|
-
groundBranch: '总行营业部',
|
|
488
|
-
clientName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
489
|
-
clientAcct: '01090520500120109043212',
|
|
490
|
-
competName: '123',
|
|
491
|
-
competAcct: '2344',
|
|
492
|
-
standardName: '名称维护表无此对手',
|
|
493
|
-
billDate: '',
|
|
494
|
-
payChannel: 'HVPS',
|
|
495
|
-
tranDate: '20260604',
|
|
496
|
-
tranTimeStamp: '2026-06-09 11:09:16',
|
|
497
|
-
busiType: 'A100-普通汇兑',
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
refNo: '2022102700394669',
|
|
501
|
-
verifyStatus: '1',
|
|
502
|
-
payDirec: '1',
|
|
503
|
-
amt: '7128700',
|
|
504
|
-
groundBranch: '北京核算中心',
|
|
505
|
-
clientName: '123',
|
|
506
|
-
clientAcct: '2344',
|
|
507
|
-
competName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
508
|
-
competAcct: '01090520500120109043212',
|
|
509
|
-
standardName: '名称维护表无此对手',
|
|
510
|
-
billDate: '',
|
|
511
|
-
payChannel: 'HVPS',
|
|
512
|
-
tranDate: '20260604',
|
|
513
|
-
tranTimeStamp: '2026-06-09 11:09:24',
|
|
514
|
-
busiType: 'A100-普通汇兑',
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
refNo: '2022102700394671',
|
|
518
|
-
verifyStatus: '1',
|
|
519
|
-
payDirec: '0',
|
|
520
|
-
amt: '800000',
|
|
521
|
-
groundBranch: '总行营业部',
|
|
522
|
-
clientName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
523
|
-
clientAcct: '01090520500120109043212',
|
|
524
|
-
competName: '123',
|
|
525
|
-
competAcct: '1231',
|
|
526
|
-
standardName: '名称维护表无此对手',
|
|
527
|
-
billDate: '',
|
|
528
|
-
payChannel: 'HVPS',
|
|
529
|
-
tranDate: '20260604',
|
|
530
|
-
tranTimeStamp: '2026-06-09 11:09:28',
|
|
531
|
-
busiType: 'A100-普通汇兑',
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
refNo: '2022102700394673',
|
|
535
|
-
verifyStatus: '1',
|
|
536
|
-
payDirec: '1',
|
|
537
|
-
amt: '800000',
|
|
538
|
-
groundBranch: '北京核算中心',
|
|
539
|
-
clientName: '123',
|
|
540
|
-
clientAcct: '1231',
|
|
541
|
-
competName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
542
|
-
competAcct: '01090520500120109043212',
|
|
543
|
-
standardName: '名称维护表无此对手',
|
|
544
|
-
billDate: '',
|
|
545
|
-
payChannel: 'HVPS',
|
|
546
|
-
tranDate: '20260604',
|
|
547
|
-
tranTimeStamp: '2026-06-09 11:07:54',
|
|
548
|
-
busiType: 'A100-普通汇兑',
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
refNo: '2022102700394674',
|
|
552
|
-
verifyStatus: '1',
|
|
553
|
-
payDirec: '0',
|
|
554
|
-
amt: '7128700',
|
|
555
|
-
groundBranch: '北京核算中心',
|
|
556
|
-
clientName: '123',
|
|
557
|
-
clientAcct: '2344',
|
|
558
|
-
competName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
559
|
-
competAcct: '01090520500120109043212',
|
|
560
|
-
standardName: '名称维护表无此对手',
|
|
561
|
-
billDate: '',
|
|
562
|
-
payChannel: 'HVPS',
|
|
563
|
-
tranDate: '20260604',
|
|
564
|
-
tranTimeStamp: '2026-06-09 11:07:58',
|
|
565
|
-
busiType: 'A105-退汇',
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
refNo: '2022102700394675',
|
|
569
|
-
verifyStatus: '1',
|
|
570
|
-
payDirec: '0',
|
|
571
|
-
amt: '800000',
|
|
572
|
-
groundBranch: '北京核算中心',
|
|
573
|
-
clientName: '123',
|
|
574
|
-
clientAcct: '1231',
|
|
575
|
-
competName: '北京华清恒信科技有限公司SBR(脱敏)',
|
|
576
|
-
competAcct: '01090520500120109043212',
|
|
577
|
-
standardName: '名称维护表无此对手',
|
|
578
|
-
billDate: '',
|
|
579
|
-
payChannel: 'HVPS',
|
|
580
|
-
tranDate: '20260604',
|
|
581
|
-
tranTimeStamp: '2026-06-09 11:08:01',
|
|
582
|
-
busiType: 'A105-退汇',
|
|
583
|
-
},
|
|
584
|
-
],
|
|
585
|
-
totalCount: '353',
|
|
586
|
-
}
|
|
587
|
-
|
|
588
236
|
// ---- 接口适配与通用工具 ----
|
|
589
237
|
|
|
590
|
-
|
|
591
|
-
const error = new Error('请求已取消')
|
|
592
|
-
error.name = 'AbortError'
|
|
593
|
-
return error
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
function isAbortError(error: unknown) {
|
|
597
|
-
return error instanceof Error && error.name === 'AbortError'
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
/** 模拟接口请求延迟,支持页面离开时取消;真实接口接入后可以删除。 */
|
|
601
|
-
function mockRequest<T>(response: T, signal: AbortSignal) {
|
|
602
|
-
return new Promise<T>((resolve, reject) => {
|
|
603
|
-
if (signal.aborted) {
|
|
604
|
-
reject(createAbortError())
|
|
605
|
-
return
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
const timer = window.setTimeout(() => {
|
|
609
|
-
signal.removeEventListener('abort', handleAbort)
|
|
610
|
-
resolve(response)
|
|
611
|
-
}, 200)
|
|
612
|
-
|
|
613
|
-
function handleAbort() {
|
|
614
|
-
window.clearTimeout(timer)
|
|
615
|
-
signal.removeEventListener('abort', handleAbort)
|
|
616
|
-
reject(createAbortError())
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
signal.addEventListener('abort', handleAbort, { once: true })
|
|
620
|
-
})
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* 预报信息列表查询接口预留入口。
|
|
625
|
-
*
|
|
626
|
-
* 对接真实接口时,替换当前函数体即可,建议保持返回结构为:
|
|
627
|
-
* { resultList: ForecastInfoRow[], totalCount: string | number }
|
|
628
|
-
*
|
|
629
|
-
* params:页面组装后的完整筛选参数,未选择字段已经是空字符串。
|
|
630
|
-
* pageParams:当前页码和每页条数,可按后端字段名转换。
|
|
631
|
-
*/
|
|
238
|
+
/** 通过 TAM 交易查询预报信息。 */
|
|
632
239
|
async function queryForecastInfoList(
|
|
633
240
|
params: ForecastInfoQueryParams,
|
|
634
241
|
pageParams: ListPageParams,
|
|
635
|
-
signal: AbortSignal,
|
|
636
242
|
): Promise<ForecastInfoListResponse> {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
// ...params,
|
|
644
|
-
// pageNum: pageParams.page,
|
|
645
|
-
// pageSize: pageParams.pageSize,
|
|
646
|
-
// }, { signal })
|
|
647
|
-
return mockRequest(mockForecastInfoResponse, signal)
|
|
243
|
+
const response = await forecastInfoApi.forecastQueryAPI({
|
|
244
|
+
...params,
|
|
245
|
+
pageNum: pageParams.page,
|
|
246
|
+
pageSize: pageParams.pageSize,
|
|
247
|
+
})
|
|
248
|
+
return response.body
|
|
648
249
|
}
|
|
649
250
|
|
|
650
|
-
/**
|
|
651
|
-
* 流水信息列表查询接口预留入口。
|
|
652
|
-
*
|
|
653
|
-
* 对接真实接口时,替换当前函数体即可,建议保持返回结构为:
|
|
654
|
-
* { resultList: FlowInfoRow[], totalCount: string | number }
|
|
655
|
-
*
|
|
656
|
-
* params:页面组装后的完整筛选参数,未选择字段已经是空字符串。
|
|
657
|
-
* pageParams:当前页码和每页条数,可按后端字段名转换。
|
|
658
|
-
*/
|
|
251
|
+
/** 通过 TAM 交易查询流水信息。 */
|
|
659
252
|
async function queryFlowInfoList(
|
|
660
253
|
params: FlowInfoQueryParams,
|
|
661
254
|
pageParams: ListPageParams,
|
|
662
|
-
signal: AbortSignal,
|
|
663
255
|
): Promise<FlowInfoListResponse> {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
// ...params,
|
|
671
|
-
// pageNum: pageParams.page,
|
|
672
|
-
// pageSize: pageParams.pageSize,
|
|
673
|
-
// }, { signal })
|
|
674
|
-
return mockRequest(mockFlowInfoResponse, signal)
|
|
256
|
+
const response = await forecastInfoApi.flowQueryAPI({
|
|
257
|
+
...params,
|
|
258
|
+
pageNum: pageParams.page,
|
|
259
|
+
pageSize: pageParams.pageSize,
|
|
260
|
+
})
|
|
261
|
+
return response.body
|
|
675
262
|
}
|
|
676
263
|
|
|
677
264
|
/** 兼容后端 totalCount 返回 string/number。totalCount 非数字时退回当前页数据条数。 */
|
|
@@ -743,9 +330,17 @@ function sumAmount<T extends object>(rows: T[], key: keyof T) {
|
|
|
743
330
|
return rows.reduce((total, row) => total + parseAmount(row[key]), 0)
|
|
744
331
|
}
|
|
745
332
|
|
|
746
|
-
/**
|
|
747
|
-
|
|
748
|
-
|
|
333
|
+
/** 不同操作允许的核销状态:3(部分核销)既可继续核销,也可撤销核销。 */
|
|
334
|
+
const verificationAllowedStatuses = {
|
|
335
|
+
verify: new Set(['1', '3']),
|
|
336
|
+
cancelVerify: new Set(['2', '3']),
|
|
337
|
+
} satisfies Record<'verify' | 'cancelVerify', Set<string>>
|
|
338
|
+
|
|
339
|
+
function canChangeVerificationStatus(
|
|
340
|
+
row: { verifyStatus?: string },
|
|
341
|
+
action: 'verify' | 'cancelVerify',
|
|
342
|
+
) {
|
|
343
|
+
return verificationAllowedStatuses[action].has(String(row.verifyStatus ?? '').trim())
|
|
749
344
|
}
|
|
750
345
|
|
|
751
346
|
/** 将后端可选字段转换为请求体要求的字符串,避免传出 undefined。 */
|
|
@@ -805,9 +400,7 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
805
400
|
/** 匡算弹窗显示状态,与共享匡算结果保持一致。 */
|
|
806
401
|
const calculationDialogVisible = ref(false)
|
|
807
402
|
|
|
808
|
-
/**
|
|
809
|
-
let forecastRequestController: AbortController | null = null
|
|
810
|
-
let flowRequestController: AbortController | null = null
|
|
403
|
+
/** 两类列表请求各自维护代次,防止旧请求在离页或新查询后回写状态。 */
|
|
811
404
|
let forecastRequestGeneration = 0
|
|
812
405
|
let flowRequestGeneration = 0
|
|
813
406
|
|
|
@@ -861,14 +454,10 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
861
454
|
tableSelectionResetKey.value += 1
|
|
862
455
|
}
|
|
863
456
|
|
|
864
|
-
/**
|
|
457
|
+
/** 页面离开时使当前请求代次失效,并清理本 Store 的 loading。 */
|
|
865
458
|
function cancelPendingRequests() {
|
|
866
459
|
forecastRequestGeneration += 1
|
|
867
460
|
flowRequestGeneration += 1
|
|
868
|
-
forecastRequestController?.abort()
|
|
869
|
-
flowRequestController?.abort()
|
|
870
|
-
forecastRequestController = null
|
|
871
|
-
flowRequestController = null
|
|
872
461
|
forecastLoading.value = false
|
|
873
462
|
flowLoading.value = false
|
|
874
463
|
}
|
|
@@ -915,14 +504,12 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
915
504
|
* 校验预报、流水联动的核销选择。
|
|
916
505
|
*
|
|
917
506
|
* 预报信息可单独操作,也可和流水信息一起操作;流水信息不能单独操作。
|
|
918
|
-
*
|
|
507
|
+
* 核销允许未核销或部分核销,撤销核销允许已核销或部分核销。
|
|
919
508
|
*/
|
|
920
509
|
function validateVerificationSelection(
|
|
921
510
|
action: 'verify' | 'cancelVerify',
|
|
922
511
|
): ForecastInfoOperationResult {
|
|
923
512
|
const actionLabel = action === 'verify' ? '核销' : '撤销核销'
|
|
924
|
-
const expectedVerified = action === 'cancelVerify'
|
|
925
|
-
const invalidStatusLabel = expectedVerified ? '未核销' : '已核销'
|
|
926
513
|
|
|
927
514
|
if (!forecastHasSelectedRows.value) {
|
|
928
515
|
if (flowHasSelectedRows.value) {
|
|
@@ -935,17 +522,17 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
935
522
|
return { success: false, message: '请选择预报信息数据' }
|
|
936
523
|
}
|
|
937
524
|
|
|
938
|
-
if (forecastSelectedRows.value.some((row) =>
|
|
525
|
+
if (forecastSelectedRows.value.some((row) => !canChangeVerificationStatus(row, action))) {
|
|
939
526
|
return {
|
|
940
527
|
success: false,
|
|
941
|
-
message:
|
|
528
|
+
message: `所选预报信息中包含不可${actionLabel}的数据,请重新选择`,
|
|
942
529
|
}
|
|
943
530
|
}
|
|
944
531
|
|
|
945
|
-
if (flowSelectedRows.value.some((row) =>
|
|
532
|
+
if (flowSelectedRows.value.some((row) => !canChangeVerificationStatus(row, action))) {
|
|
946
533
|
return {
|
|
947
534
|
success: false,
|
|
948
|
-
message:
|
|
535
|
+
message: `所选流水信息中包含不可${actionLabel}的数据,请重新选择`,
|
|
949
536
|
}
|
|
950
537
|
}
|
|
951
538
|
|
|
@@ -974,7 +561,7 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
974
561
|
|
|
975
562
|
/**
|
|
976
563
|
* 校验预报信息及其已选流水信息的核销操作。
|
|
977
|
-
*
|
|
564
|
+
* 返回的成功结果仅表示前端业务校验通过,真实更新由 TAM 接口执行。
|
|
978
565
|
*/
|
|
979
566
|
function verifySelectedForecastRows(): ForecastInfoOperationResult {
|
|
980
567
|
const result = validateVerificationSelection('verify')
|
|
@@ -982,12 +569,12 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
982
569
|
return result
|
|
983
570
|
}
|
|
984
571
|
|
|
985
|
-
return { success: true, message: '
|
|
572
|
+
return { success: true, message: '' }
|
|
986
573
|
}
|
|
987
574
|
|
|
988
575
|
/**
|
|
989
576
|
* 校验预报信息及其已选流水信息的撤销核销操作。
|
|
990
|
-
*
|
|
577
|
+
* 返回的成功结果仅表示前端业务校验通过,真实更新由 TAM 接口执行。
|
|
991
578
|
*/
|
|
992
579
|
function cancelVerifySelectedForecastRows(): ForecastInfoOperationResult {
|
|
993
580
|
const result = validateVerificationSelection('cancelVerify')
|
|
@@ -995,7 +582,7 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
995
582
|
return result
|
|
996
583
|
}
|
|
997
584
|
|
|
998
|
-
return { success: true, message: '
|
|
585
|
+
return { success: true, message: '' }
|
|
999
586
|
}
|
|
1000
587
|
|
|
1001
588
|
/** 打开匡算弹窗前的统一业务入口。 */
|
|
@@ -1022,43 +609,35 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
1022
609
|
|
|
1023
610
|
/** 预报信息核销按钮的统一业务入口。 */
|
|
1024
611
|
async function handleForecastVerify() {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
612
|
+
const validationResult = verifySelectedForecastRows()
|
|
613
|
+
if (!validationResult.success) return validationResult
|
|
1027
614
|
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
return result
|
|
615
|
+
const params = buildVerificationRequestParams()
|
|
616
|
+
const response = await forecastInfoApi.verifyAPI(params)
|
|
617
|
+
const refreshed = await refreshVerificationLists()
|
|
618
|
+
if (!refreshed) return null
|
|
619
|
+
return response.body
|
|
1036
620
|
}
|
|
1037
621
|
|
|
1038
622
|
/** 预报信息撤销核销按钮的统一业务入口。 */
|
|
1039
623
|
async function handleForecastCancelVerify() {
|
|
1040
|
-
const
|
|
1041
|
-
|
|
624
|
+
const validationResult = cancelVerifySelectedForecastRows()
|
|
625
|
+
if (!validationResult.success) return validationResult
|
|
1042
626
|
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
return result
|
|
627
|
+
const params = buildVerificationRequestParams()
|
|
628
|
+
const response = await forecastInfoApi.cancelVerifyAPI(params)
|
|
629
|
+
const refreshed = await refreshVerificationLists()
|
|
630
|
+
if (!refreshed) return null
|
|
631
|
+
return response.body
|
|
1051
632
|
}
|
|
1052
633
|
|
|
1053
634
|
/**
|
|
1054
635
|
* 查询预报信息列表。
|
|
1055
636
|
*
|
|
1056
637
|
* 组件点击查询、分页变化时调用这个方法。
|
|
1057
|
-
*
|
|
638
|
+
* 页面组件不需要感知 TAM 报文包装细节。
|
|
1058
639
|
*/
|
|
1059
640
|
async function loadForecastInfoList(params: ForecastInfoQueryParams = forecastQueryParams.value) {
|
|
1060
|
-
forecastRequestController?.abort()
|
|
1061
|
-
const controller = new AbortController()
|
|
1062
641
|
const generation = ++forecastRequestGeneration
|
|
1063
642
|
const queryParams = { ...params }
|
|
1064
643
|
const pageParams = {
|
|
@@ -1066,28 +645,22 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
1066
645
|
pageSize: forecastPageSize.value,
|
|
1067
646
|
}
|
|
1068
647
|
|
|
1069
|
-
forecastRequestController = controller
|
|
1070
648
|
forecastLoading.value = true
|
|
1071
649
|
forecastQueryParams.value = queryParams
|
|
1072
650
|
|
|
1073
651
|
try {
|
|
1074
|
-
const response = await queryForecastInfoList(queryParams, pageParams
|
|
652
|
+
const response = await queryForecastInfoList(queryParams, pageParams)
|
|
1075
653
|
|
|
1076
|
-
if (
|
|
654
|
+
if (generation !== forecastRequestGeneration) return false
|
|
1077
655
|
|
|
1078
656
|
forecastRows.value = response.resultList.map((item) => ({ ...item }))
|
|
1079
657
|
forecastTotal.value = normalizeTotalCount(response)
|
|
1080
658
|
// 数据替换后再次通知表格清理,避免表头全选状态沿用上一批数据。
|
|
1081
659
|
resetAllTableSelections()
|
|
1082
660
|
return true
|
|
1083
|
-
} catch (error) {
|
|
1084
|
-
// Axios 等请求库可能抛出 CanceledError;以当前控制器状态为准,避免离页取消进入全局错误处理。
|
|
1085
|
-
if (controller.signal.aborted || isAbortError(error)) return false
|
|
1086
|
-
throw error
|
|
1087
661
|
} finally {
|
|
1088
662
|
if (generation === forecastRequestGeneration) {
|
|
1089
663
|
forecastLoading.value = false
|
|
1090
|
-
forecastRequestController = null
|
|
1091
664
|
}
|
|
1092
665
|
}
|
|
1093
666
|
}
|
|
@@ -1104,11 +677,9 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
1104
677
|
* 查询流水信息列表。
|
|
1105
678
|
*
|
|
1106
679
|
* 组件点击查询、分页变化时调用这个方法。
|
|
1107
|
-
*
|
|
680
|
+
* 页面组件不需要感知 TAM 报文包装细节。
|
|
1108
681
|
*/
|
|
1109
682
|
async function loadFlowInfoList(params: FlowInfoQueryParams = flowQueryParams.value) {
|
|
1110
|
-
flowRequestController?.abort()
|
|
1111
|
-
const controller = new AbortController()
|
|
1112
683
|
const generation = ++flowRequestGeneration
|
|
1113
684
|
const queryParams = { ...params }
|
|
1114
685
|
const pageParams = {
|
|
@@ -1116,28 +687,22 @@ export const useForecastInfoStore = defineStore('rmb-position-settlement-forecas
|
|
|
1116
687
|
pageSize: flowPageSize.value,
|
|
1117
688
|
}
|
|
1118
689
|
|
|
1119
|
-
flowRequestController = controller
|
|
1120
690
|
flowLoading.value = true
|
|
1121
691
|
flowQueryParams.value = queryParams
|
|
1122
692
|
|
|
1123
693
|
try {
|
|
1124
|
-
const response = await queryFlowInfoList(queryParams, pageParams
|
|
694
|
+
const response = await queryFlowInfoList(queryParams, pageParams)
|
|
1125
695
|
|
|
1126
|
-
if (
|
|
696
|
+
if (generation !== flowRequestGeneration) return false
|
|
1127
697
|
|
|
1128
698
|
flowRows.value = response.resultList.map((item) => ({ ...item }))
|
|
1129
699
|
flowTotal.value = normalizeTotalCount(response)
|
|
1130
700
|
// 数据替换后再次通知表格清理,避免表头全选状态沿用上一批数据。
|
|
1131
701
|
resetAllTableSelections()
|
|
1132
702
|
return true
|
|
1133
|
-
} catch (error) {
|
|
1134
|
-
// Axios 等请求库可能抛出 CanceledError;以当前控制器状态为准,避免离页取消进入全局错误处理。
|
|
1135
|
-
if (controller.signal.aborted || isAbortError(error)) return false
|
|
1136
|
-
throw error
|
|
1137
703
|
} finally {
|
|
1138
704
|
if (generation === flowRequestGeneration) {
|
|
1139
705
|
flowLoading.value = false
|
|
1140
|
-
flowRequestController = null
|
|
1141
706
|
}
|
|
1142
707
|
}
|
|
1143
708
|
}
|