verce-vue-test 0.0.141 → 0.0.142

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.141",
3
+ "version": "0.0.142",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,120 +1,57 @@
1
1
  import baseHttpClient from '@/utils/baseHttpClient'
2
- import {
3
- type BusinessType,
4
- type ClientType,
5
- type ForecastStatus,
6
- type ForecastType,
7
- type ForecastWay,
8
- type ForeignExchangeType,
9
- type ForeignPositionForecast,
10
- type PaymentDirection,
11
- type VerifyStatus,
12
- } from './model'
13
- import type { ForecastEditorValue } from './editor'
14
-
15
- export type ForeignPositionForecastQuery = {
16
- valueDate: string
17
- payDirection: string
18
- forecastStatuses: ForecastStatus[]
19
- foreignExchangeType: string
20
- forecastWay: string
21
- verifyStatuses: VerifyStatus[]
22
- organizationName: string
23
- clientName: string
24
- businessType: string
25
- currencies: string[]
26
- authirization: string
27
- ftuFilter: string
28
- minAmount: any
29
- maxAmount: any
30
- }
31
-
32
- export type ForeignPositionForecastSort = {
33
- amtOrder: string
34
- predOrder: string
35
- timeOrder: string
36
- }
37
-
38
- export type ForeignPositionForecastSearchParams = ForeignPositionForecastQuery & ForeignPositionForecastSort
39
-
40
- // TAM 原始字段会随交易和历史版本变化,只在这里使用宽松类型,页面数据仍统一成前端模型。
41
- type TamRecord = Record<string, any>
42
- type TamResponse = {
43
- head?: {
44
- retMsg?: string
45
- }
46
- body?: any
47
- }
48
-
49
- type ForeignPositionForecastOperationResponse = {
50
- message?: string
51
- }
52
-
53
- export type ForeignPositionForecastQueryResult = {
54
- resultList: ForeignPositionForecast[]
55
- totalCount: number
56
- totalPage: number
57
- }
58
-
59
- /** 将前端状态码数组转换为 TAM 接口要求的逗号分隔数字。 */
60
- function toProtocolStatusList(values: string[], prefix: string) {
61
- return values
62
- .map((value) => value.replace(prefix, ''))
63
- .map((value) => String(Number(value)))
64
- .join(',')
65
- }
2
+ import type { ForeignPositionForecast } from './model'
66
3
 
67
4
  /** 将接口金额转换为可安全使用的数字。 */
68
- function toNumber(value: unknown) {
5
+ function toNumber(value: any) {
69
6
  const number = Number(String(value ?? '').replaceAll(',', ''))
70
7
  return Number.isFinite(number) ? number : 0
71
8
  }
72
9
 
73
10
  /** 将接口预报方式转换为前端枚举。 */
74
- function toForecastWay(value: any): ForecastWay {
11
+ function toForecastWay(value: any) {
75
12
  return value === 'PW02' || value === 'PW03' ? value : 'PW01'
76
13
  }
77
14
 
78
15
  /** 将接口预报状态转换为前端枚举。 */
79
- function toForecastStatus(value: any): ForecastStatus {
16
+ function toForecastStatus(value: any) {
80
17
  const number = Number(String(value || '').replace(/^PS/i, ''))
81
18
  return number >= 1 && number <= 8
82
- ? `PS${String(number).padStart(2, '0')}` as ForecastStatus
19
+ ? `PS${String(number).padStart(2, '0')}`
83
20
  : 'PS01'
84
21
  }
85
22
 
86
23
  /** 将接口预报类型转换为前端枚举。 */
87
- function toForecastType(value: any): ForecastType {
24
+ function toForecastType(value: any) {
88
25
  return value === 'PT02' || value === 'PT03' ? value : 'PT01'
89
26
  }
90
27
 
91
28
  /** 将接口核销状态转换为前端枚举。 */
92
- function toVerifyStatus(value: any): VerifyStatus {
29
+ function toVerifyStatus(value: any) {
93
30
  const number = Number(String(value || '').replace(/^VS/i, ''))
94
31
  return number >= 1 && number <= 3
95
- ? `VS${String(number).padStart(2, '0')}` as VerifyStatus
32
+ ? `VS${String(number).padStart(2, '0')}`
96
33
  : 'VS01'
97
34
  }
98
35
 
99
36
  /** 将接口业务类型转换为前端枚举。 */
100
- function toBusinessType(value: any): BusinessType {
37
+ function toBusinessType(value: any) {
101
38
  return value === '11' || value === '12' || value === '13' ? value : '10'
102
39
  }
103
40
 
104
41
  /** 将接口原币购汇类型转换为前端枚举。 */
105
- function toForeignExchangeType(value: any): ForeignExchangeType {
42
+ function toForeignExchangeType(value: any) {
106
43
  return value === '01' || value === '02' || value === '03' ? value : ''
107
44
  }
108
45
 
109
46
  /** 兼容接口客户类型的数字值和前端枚举值。 */
110
- function toClientType(value: any): ClientType {
47
+ function toClientType(value: any) {
111
48
  if (value === 'CT01' || value === '1') return 'CT01'
112
49
  if (value === 'CT02' || value === '2') return 'CT02'
113
50
  return ''
114
51
  }
115
52
 
116
53
  /** 兼容接口汇款路线的数字值和前端枚举值。 */
117
- function toPaymentRoute(value: any): ForeignPositionForecast['paymentRoute'] {
54
+ function toPaymentRoute(value: any) {
118
55
  if (value === '02' || value === '2') return '02'
119
56
  if (value === '03' || value === '3') return '03'
120
57
  return '01'
@@ -130,7 +67,7 @@ function toFrontendDate(value: any) {
130
67
  }
131
68
 
132
69
  /** 将 TAM 返回记录转换为页面使用的预报数据。 */
133
- function toFrontendRow(row: TamRecord): ForeignPositionForecast {
70
+ export function toFrontendRow(row: any): ForeignPositionForecast {
134
71
  const organizationCode = String(row.groundBranch || '')
135
72
  const clientName = String(row.clientName || '')
136
73
 
@@ -176,23 +113,18 @@ function toFrontendRow(row: TamRecord): ForeignPositionForecast {
176
113
  }
177
114
 
178
115
  /** 获取 TAM 返回消息,不存在时使用默认文案。 */
179
- function getResponseMessage(payload: TamResponse, fallback: string) {
116
+ function getResponseMessage(payload: any, fallback: string) {
180
117
  return payload.head?.retMsg || fallback
181
118
  }
182
119
 
183
120
  /** 查询指定编号的外币头寸预报详情。 */
184
- export async function getForeignPositionForecast(predRefNo: string, signal?: AbortSignal) {
121
+ export async function getForeignPositionForecast(predRefNo: string) {
185
122
  const normalizedPredRefNo = predRefNo.trim()
186
- const payload = await baseHttpClient.post<TamResponse>(
123
+ const payload = await baseHttpClient.post<any>(
187
124
  '/TAM/0001/140201004',
188
125
  { predRefNo: normalizedPredRefNo },
189
- { signal },
190
126
  )
191
127
 
192
- if (!payload.body || typeof payload.body !== 'object') {
193
- throw new Error('外币头寸预报详情接口返回结构不正确')
194
- }
195
-
196
128
  return toFrontendRow({
197
129
  ...payload.body,
198
130
  predRefNo: payload.body.predRefNo || normalizedPredRefNo,
@@ -200,8 +132,8 @@ export async function getForeignPositionForecast(predRefNo: string, signal?: Abo
200
132
  }
201
133
 
202
134
  /** 查询当前用户可用的 UAA 机构树。 */
203
- export function queryForeignPositionOrganizationTree(signal?: AbortSignal) {
204
- return baseHttpClient.get<any>('/uaa/org/tree', { signal })
135
+ export function queryForeignPositionOrganizationTree() {
136
+ return baseHttpClient.get<any>('/uaa/org/tree')
205
137
  }
206
138
 
207
139
  export type ForeignPositionAccountBankOption = {
@@ -211,30 +143,24 @@ export type ForeignPositionAccountBankOption = {
211
143
 
212
144
  /** 根据币种、汇款路径和业务类型查询外币预报可用的我方账户行。 */
213
145
  export async function queryForeignPositionAccountBanks(
214
- params: {
215
- ccy: string
216
- paymentRoute: string
217
- tranType: string
218
- },
219
- signal?: AbortSignal,
146
+ params: any,
220
147
  ) {
221
- const payload = await baseHttpClient.post<TamResponse>(
148
+ const payload = await baseHttpClient.post<any>(
222
149
  '/TAM/0001/140201002',
223
150
  {
224
151
  ccy: params.ccy.trim(),
225
152
  paymentRoute: params.paymentRoute.trim(),
226
153
  tranType: params.tranType.trim(),
227
154
  },
228
- { signal },
229
155
  )
230
156
 
231
- const bankAcctList = payload.body?.bankAcctList
157
+ const bankAcctList = payload.body.bankAcctList
232
158
  if (!Array.isArray(bankAcctList)) {
233
159
  throw new Error('我方账户行接口返回结构不正确')
234
160
  }
235
161
 
236
162
  const seen = new Set<string>()
237
- return bankAcctList.reduce<ForeignPositionAccountBankOption[]>((result, item) => {
163
+ return bankAcctList.reduce<any[]>((result, item) => {
238
164
  const bankAcct = String(item ?? '').trim()
239
165
  if (!bankAcct || seen.has(bankAcct)) return result
240
166
 
@@ -245,12 +171,12 @@ export async function queryForeignPositionAccountBanks(
245
171
  }
246
172
 
247
173
  /** 将前端日期转换为 TAM 报文日期。 */
248
- function toMutationDate(value: string) {
174
+ function toMutationDate(value: any) {
249
175
  return value.trim().slice(0, 10).replaceAll('-', '')
250
176
  }
251
177
 
252
178
  /** 构建新增和修改共用的外币头寸预报请求体。 */
253
- function buildForeignPositionForecastMutationBody(value: ForecastEditorValue) {
179
+ function buildForeignPositionForecastMutationBody(value: any) {
254
180
  return {
255
181
  bankAcct: value.bankAccount.trim(),
256
182
  ccy: value.currency.trim(),
@@ -284,7 +210,7 @@ function buildForeignPositionForecastMutationBody(value: ForecastEditorValue) {
284
210
  }
285
211
 
286
212
  /** 新增外币头寸预报。 */
287
- export function createForeignPositionForecast(value: ForecastEditorValue) {
213
+ export function createForeignPositionForecast(value: any) {
288
214
  return baseHttpClient.post<any>(
289
215
  '/TAM/0001/120201001',
290
216
  {
@@ -295,7 +221,7 @@ export function createForeignPositionForecast(value: ForecastEditorValue) {
295
221
  }
296
222
 
297
223
  /** 修改指定编号的外币头寸预报。 */
298
- export function updateForeignPositionForecast(predRefNo: string, value: ForecastEditorValue) {
224
+ export function updateForeignPositionForecast(predRefNo: string, value: any) {
299
225
  return baseHttpClient.post<any>(
300
226
  '/TAM/0001/120201002',
301
227
  {
@@ -308,16 +234,20 @@ export function updateForeignPositionForecast(predRefNo: string, value: Forecast
308
234
 
309
235
  /** 删除指定编号的外币头寸预报。 */
310
236
  export function deleteForeignPositionForecast(predRefNo: string) {
311
- return baseHttpClient.delete<ForeignPositionForecast>(
312
- `/foreign-position-forecasts/${encodeURIComponent(predRefNo)}`,
237
+ return baseHttpClient.post<any>(
238
+ '/TAM/0001/120201003',
239
+ { predRefNo: predRefNo.trim() },
313
240
  )
314
241
  }
315
242
 
316
243
  /** 批量通过或拒绝选中的外币头寸预报。 */
317
244
  export function approveForeignPositionForecasts(predRefNos: string[], approved: boolean) {
318
- return baseHttpClient.post<ForeignPositionForecastOperationResponse>(
319
- '/foreign-position-forecasts/approval',
320
- { predRefNos, approved },
245
+ return baseHttpClient.post<any>(
246
+ '/TAM/0001/120201004',
247
+ {
248
+ flag: approved ? '1' : '0',
249
+ predRefNos: predRefNos.map((predRefNo) => predRefNo.trim()).filter(Boolean).join(','),
250
+ },
321
251
  )
322
252
  }
323
253
 
@@ -328,62 +258,19 @@ export async function updateForeignPositionForecastAuthorization(
328
258
  pageIndex: number,
329
259
  pageSize: number,
330
260
  ) {
331
- const payload = await baseHttpClient.post<TamResponse>(
261
+ const payload = await baseHttpClient.post<any>(
332
262
  '/TAM/0001/120201006',
333
263
  {
334
264
  authorization,
335
265
  predRefNos: predRefNo,
336
- },
337
- { tamHead: { pageIndex, pageSize } },
266
+ pageIndex, pageSize
267
+ }
338
268
  )
339
269
 
340
270
  return getResponseMessage(payload, authorization === '1' ? '授权成功' : '取消授权成功')
341
271
  }
342
272
 
343
- /** 按筛选、排序和分页条件查询外币头寸预报。 */
344
- export async function queryForeignPositionForecasts(
345
- searchParams: ForeignPositionForecastSearchParams,
346
- pageIndex: number,
347
- pageSize: number,
348
- signal?: AbortSignal,
349
- ): Promise<ForeignPositionForecastQueryResult> {
350
- const payload = await baseHttpClient.post<TamResponse>(
351
- '/TAM/0001/140201001',
352
- {
353
- orgName: searchParams.organizationName.trim(),
354
- clientName: searchParams.clientName.trim(),
355
- tranType: searchParams.businessType,
356
- ccy: searchParams.currencies.join(','),
357
- tranDate: searchParams.valueDate,
358
- payDirec: searchParams.payDirection,
359
- predStatus: toProtocolStatusList(searchParams.forecastStatuses, 'PS'),
360
- originalForeign: searchParams.foreignExchangeType,
361
- predWay: searchParams.forecastWay,
362
- verifyStatus: toProtocolStatusList(searchParams.verifyStatuses, 'VS'),
363
- startAmt: searchParams.minAmount === null ? '' : String(searchParams.minAmount),
364
- endAmt: searchParams.maxAmount === null ? '' : String(searchParams.maxAmount),
365
- filter: searchParams.ftuFilter,
366
- authorization: searchParams.authirization,
367
- amtOrder: searchParams.amtOrder,
368
- predOrder: searchParams.predOrder,
369
- timeOrder: searchParams.timeOrder,
370
- },
371
- {
372
- signal,
373
- tamHead: { pageIndex, pageSize },
374
- },
375
- )
376
- const responseBody = payload.body
377
- if (!responseBody || !Array.isArray(responseBody.resultInfos)) {
378
- throw new Error('外币头寸预报接口返回结构不正确')
379
- }
380
-
381
- const totalCount = Number(responseBody.totalCount)
382
- const totalPage = Number(responseBody.totalPage)
383
-
384
- return {
385
- resultList: responseBody.resultInfos.map(toFrontendRow),
386
- totalCount: Number.isFinite(totalCount) ? totalCount : responseBody.resultInfos.length,
387
- totalPage: Number.isFinite(totalPage) ? totalPage : 0,
388
- }
273
+ /** 按传入参数原样查询外币头寸预报。 */
274
+ export function queryForeignPositionForecasts(params: any) {
275
+ return baseHttpClient.post<any>('/TAM/0001/140201001', params)
389
276
  }
@@ -418,7 +418,6 @@ async function loadAccountBanks() {
418
418
  paymentRoute: form.paymentRoute,
419
419
  tranType: form.businessType,
420
420
  },
421
- controller.signal,
422
421
  )
423
422
  if (controller.signal.aborted || accountBankRequestController !== controller) return
424
423
  accountBankOptions.value = result
@@ -481,7 +480,7 @@ async function searchOrganizations(keyword: string) {
481
480
  organizationLoading.value = true
482
481
 
483
482
  try {
484
- const response = await queryForeignPositionOrganizationTree(controller.signal)
483
+ const response = await queryForeignPositionOrganizationTree()
485
484
  if (controller.signal.aborted || organizationRequestController !== controller) return
486
485
  organizationOptions.value = toForeignPositionOrganizationOptions(response.data, normalizedKeyword)
487
486
  } catch (error) {
@@ -29,8 +29,7 @@ import {
29
29
  deleteForeignPositionForecast,
30
30
  getForeignPositionForecast,
31
31
  queryForeignPositionForecasts,
32
- type ForeignPositionForecastSearchParams,
33
- type ForeignPositionForecastSort,
32
+ toFrontendRow,
34
33
  updateForeignPositionForecast,
35
34
  updateForeignPositionForecastAuthorization,
36
35
  } from './api'
@@ -84,12 +83,12 @@ const { clearTableSelection, resetFilterForm } = forecastStore
84
83
  const amountRangeValid = ref(true)
85
84
  const amountRangeRef = ref<any>(null)
86
85
  const authorizationActionPredRefNo = ref('')
87
- const forecastSort = ref<ForeignPositionForecastSort>({
86
+ const forecastSort = ref<any>({
88
87
  amtOrder: '1',
89
88
  predOrder: '',
90
89
  timeOrder: '',
91
90
  })
92
- const sharedSearchParams = computed<ForeignPositionForecastSearchParams>(() => ({
91
+ const sharedSearchParams = computed<any>(() => ({
93
92
  ...cloneFilters(appliedFilters.value),
94
93
  ...forecastSort.value,
95
94
  }))
@@ -125,6 +124,218 @@ function formatMoney(value: number) {
125
124
  })
126
125
  }
127
126
 
127
+ type ForeignForecastTableColumnRender = 'text' | 'option' | 'money' | 'empty-dash'
128
+
129
+ type ForeignForecastTableColumn = {
130
+ key: keyof ForeignPositionForecast
131
+ prop: keyof ForeignPositionForecast
132
+ label: string
133
+ width: number
134
+ align?: 'left' | 'right' | 'center'
135
+ fixed?: 'left' | 'right'
136
+ render: ForeignForecastTableColumnRender
137
+ options?: SelectOption[]
138
+ showOverflowTooltip?: boolean
139
+ sortable?: 'custom'
140
+ sortOrders?: Array<'ascending' | 'descending'>
141
+ }
142
+
143
+ /** 普通业务字段统一由列配置维护,避免模板重复声明列结构。 */
144
+ const forecastTableColumns: ForeignForecastTableColumn[] = [
145
+ {
146
+ key: 'predRefNo',
147
+ prop: 'predRefNo',
148
+ label: '预报流水号',
149
+ width: 168,
150
+ fixed: 'left',
151
+ render: 'text',
152
+ showOverflowTooltip: true,
153
+ },
154
+ {
155
+ key: 'predWay',
156
+ prop: 'predWay',
157
+ label: '预报方式',
158
+ width: 108,
159
+ render: 'option',
160
+ options: forecastWayOptions,
161
+ },
162
+ {
163
+ key: 'predStatus',
164
+ prop: 'predStatus',
165
+ label: '预报状态',
166
+ width: 136,
167
+ render: 'option',
168
+ options: forecastStatusOptions,
169
+ },
170
+ {
171
+ key: 'predType',
172
+ prop: 'predType',
173
+ label: '预报类型',
174
+ width: 102,
175
+ render: 'option',
176
+ options: forecastTypeOptions,
177
+ },
178
+ {
179
+ key: 'groundBranch',
180
+ prop: 'groundBranch',
181
+ label: '落地机构',
182
+ width: 160,
183
+ render: 'text',
184
+ showOverflowTooltip: true,
185
+ },
186
+ {
187
+ key: 'payDirection',
188
+ prop: 'payDirection',
189
+ label: '收支方向',
190
+ width: 88,
191
+ render: 'option',
192
+ options: payDirectionOptions,
193
+ },
194
+ {
195
+ key: 'bankAccount',
196
+ prop: 'bankAccount',
197
+ label: '账户行',
198
+ width: 188,
199
+ render: 'text',
200
+ showOverflowTooltip: true,
201
+ },
202
+ {
203
+ key: 'currency',
204
+ prop: 'currency',
205
+ label: '币种',
206
+ width: 82,
207
+ render: 'text',
208
+ },
209
+ {
210
+ key: 'predAmount',
211
+ prop: 'predAmount',
212
+ label: '预报金额(元)',
213
+ width: 152,
214
+ align: 'right',
215
+ render: 'money',
216
+ sortable: 'custom',
217
+ sortOrders: ['descending', 'ascending'],
218
+ },
219
+ {
220
+ key: 'valueDate',
221
+ prop: 'valueDate',
222
+ label: '起息日',
223
+ width: 116,
224
+ render: 'text',
225
+ },
226
+ {
227
+ key: 'verifyStatus',
228
+ prop: 'verifyStatus',
229
+ label: '核销状态',
230
+ width: 108,
231
+ render: 'option',
232
+ options: verifyStatusOptions,
233
+ },
234
+ {
235
+ key: 'verifyAmount',
236
+ prop: 'verifyAmount',
237
+ label: '核销金额(元)',
238
+ width: 148,
239
+ align: 'right',
240
+ render: 'money',
241
+ },
242
+ {
243
+ key: 'businessType',
244
+ prop: 'businessType',
245
+ label: '业务类型',
246
+ width: 120,
247
+ render: 'option',
248
+ options: businessTypeOptions,
249
+ },
250
+ {
251
+ key: 'clientName',
252
+ prop: 'clientName',
253
+ label: '客户名称',
254
+ width: 218,
255
+ render: 'text',
256
+ showOverflowTooltip: true,
257
+ },
258
+ {
259
+ key: 'clientAccount',
260
+ prop: 'clientAccount',
261
+ label: '客户账号',
262
+ width: 198,
263
+ render: 'text',
264
+ showOverflowTooltip: true,
265
+ },
266
+ {
267
+ key: 'counterpartyName',
268
+ prop: 'counterpartyName',
269
+ label: '交易对手名称',
270
+ width: 220,
271
+ render: 'text',
272
+ showOverflowTooltip: true,
273
+ },
274
+ {
275
+ key: 'counterpartyAccount',
276
+ prop: 'counterpartyAccount',
277
+ label: '交易对手账号',
278
+ width: 190,
279
+ render: 'text',
280
+ showOverflowTooltip: true,
281
+ },
282
+ {
283
+ key: 'receivingBank',
284
+ prop: 'receivingBank',
285
+ label: '交易对手行名称',
286
+ width: 210,
287
+ render: 'text',
288
+ showOverflowTooltip: true,
289
+ },
290
+ {
291
+ key: 'receivingBankSwiftCode',
292
+ prop: 'receivingBankSwiftCode',
293
+ label: '交易对手行 SWIFTCODE',
294
+ width: 205,
295
+ render: 'text',
296
+ showOverflowTooltip: true,
297
+ },
298
+ {
299
+ key: 'foreignExchangeType',
300
+ prop: 'foreignExchangeType',
301
+ label: '结汇/购汇/现汇',
302
+ width: 136,
303
+ render: 'option',
304
+ options: foreignExchangeTypeOptions,
305
+ },
306
+ {
307
+ key: 'forecastTime',
308
+ prop: 'forecastTime',
309
+ label: '预报时间',
310
+ width: 170,
311
+ render: 'text',
312
+ sortable: 'custom',
313
+ sortOrders: ['descending', 'ascending'],
314
+ showOverflowTooltip: true,
315
+ },
316
+ {
317
+ key: 'approvalTime',
318
+ prop: 'approvalTime',
319
+ label: '审批时间',
320
+ width: 170,
321
+ render: 'empty-dash',
322
+ sortable: 'custom',
323
+ sortOrders: ['descending', 'ascending'],
324
+ showOverflowTooltip: true,
325
+ },
326
+ ]
327
+
328
+ function getTableColumnText(
329
+ column: ForeignForecastTableColumn,
330
+ row: ForeignPositionForecast,
331
+ ) {
332
+ const value = row[column.prop]
333
+ if (column.render === 'money') return formatMoney(Number(value ?? 0))
334
+ if (column.options) return getOptionLabel(column.options, String(value ?? ''))
335
+ if (column.render === 'empty-dash') return String(value ?? '') || '—'
336
+ return String(value ?? '')
337
+ }
338
+
128
339
  function validateAmountRange() {
129
340
  const { minAmount, maxAmount } = filterForm.value
130
341
  const componentValid = amountRangeRef.value?.validate() ?? amountRangeValid.value
@@ -144,6 +355,13 @@ function isAbortError(error: unknown) {
144
355
  return error instanceof Error && error.name === 'AbortError'
145
356
  }
146
357
 
358
+ function toProtocolStatusList(values: string[], prefix: string) {
359
+ return values
360
+ .map((value) => value.replace(prefix, ''))
361
+ .map((value) => String(Number(value)))
362
+ .join(',')
363
+ }
364
+
147
365
  async function loadForecastRows() {
148
366
  listRequestController?.abort()
149
367
  const controller = new AbortController()
@@ -151,17 +369,40 @@ async function loadForecastRows() {
151
369
  isLoading.value = true
152
370
 
153
371
  try {
154
- const response = await queryForeignPositionForecasts(
155
- sharedSearchParams.value,
156
- currentPage.value,
157
- pageSize.value,
158
- controller.signal,
159
- )
372
+ const searchParams = sharedSearchParams.value
373
+ const response = await queryForeignPositionForecasts({
374
+ orgName: searchParams.organizationName.trim(),
375
+ clientName: searchParams.clientName.trim(),
376
+ tranType: searchParams.businessType,
377
+ ccy: searchParams.currencies.join(','),
378
+ tranDate: searchParams.valueDate,
379
+ payDirec: searchParams.payDirection,
380
+ predStatus: toProtocolStatusList(searchParams.forecastStatuses, 'PS'),
381
+ originalForeign: searchParams.foreignExchangeType,
382
+ predWay: searchParams.forecastWay,
383
+ verifyStatus: toProtocolStatusList(searchParams.verifyStatuses, 'VS'),
384
+ startAmt: searchParams.minAmount === null ? '' : String(searchParams.minAmount),
385
+ endAmt: searchParams.maxAmount === null ? '' : String(searchParams.maxAmount),
386
+ filter: searchParams.ftuFilter,
387
+ authorization: searchParams.authirization,
388
+ amtOrder: searchParams.amtOrder,
389
+ predOrder: searchParams.predOrder,
390
+ timeOrder: searchParams.timeOrder,
391
+ pageIndex: currentPage.value,
392
+ pageSize: pageSize.value,
393
+ })
160
394
 
161
395
  if (controller.signal.aborted || listRequestController !== controller) return false
162
396
 
163
- allRows.value = response.resultList
164
- totalCount.value = response.totalCount
397
+ const responseBody = response.body
398
+ const resultInfos = Array.isArray(responseBody?.resultInfos)
399
+ ? responseBody.resultInfos
400
+ : []
401
+ const responseTotalCount = Number(responseBody?.totalCount)
402
+ allRows.value = resultInfos.map(toFrontendRow)
403
+ totalCount.value = Number.isFinite(responseTotalCount)
404
+ ? responseTotalCount
405
+ : resultInfos.length
165
406
  successfulFilters.value = cloneFilters(appliedFilters.value)
166
407
  successfulPage.value = currentPage.value
167
408
  successfulPageSize.value = pageSize.value
@@ -226,7 +467,7 @@ async function handleSortChange({
226
467
  if (order !== 'ascending' && order !== 'descending') return
227
468
 
228
469
  const direction = order === 'descending' ? '1' : '2'
229
- const nextSort: ForeignPositionForecastSort = {
470
+ const nextSort: any = {
230
471
  amtOrder: prop === 'predAmount' ? direction : '',
231
472
  predOrder: prop === 'forecastTime' ? direction : '',
232
473
  timeOrder: prop === 'approvalTime' ? direction : '',
@@ -389,9 +630,9 @@ async function handleDelete(row: ForeignPositionForecast) {
389
630
  }
390
631
 
391
632
  try {
392
- const updatedRow = await deleteForeignPositionForecast(row.predRefNo)
633
+ await deleteForeignPositionForecast(row.predRefNo)
393
634
  clearTableSelection()
394
- ElMessage.success(updatedRow.predStatus === 'PS05' ? '删除成功' : '删除申请已提交,等待分行确认')
635
+ ElMessage.success(row.predStatus === 'PS01' ? '删除成功' : '删除申请已提交,等待分行确认')
395
636
  await refreshAfterMutation()
396
637
  } catch (error) {
397
638
  ElMessage.error(error instanceof Error ? error.message : '预报删除失败')
@@ -490,7 +731,7 @@ async function handleApproval(approved: boolean) {
490
731
  approved,
491
732
  )
492
733
  clearTableSelection()
493
- ElMessage.success(response.message || `审批${actionText}操作成功`)
734
+ ElMessage.success(response.head.retMsg || `审批${actionText}操作成功`)
494
735
  await refreshAfterMutation()
495
736
  } catch (error) {
496
737
  ElMessage.error(error instanceof Error ? error.message : `审批${actionText}操作失败`)
@@ -796,70 +1037,24 @@ onBeforeUnmount(() => {
796
1037
 
797
1038
  <el-table-column type="selection" column-key="selection" width="48" fixed="left" reserve-selection disabled />
798
1039
  <el-table-column type="index" column-key="sequence" label="序号" width="62" fixed="left" :index="(index: number) => (currentPage - 1) * pageSize + index + 1" disabled />
799
- <el-table-column prop="predRefNo" label="预报流水号" width="168" fixed="left" show-overflow-tooltip />
800
- <el-table-column label="预报方式" width="108">
801
- <template #default="{ row }">{{ getOptionLabel(forecastWayOptions, row.predWay) }}</template>
802
- </el-table-column>
803
- <el-table-column label="预报状态" width="136">
804
- <template #default="{ row }">{{ getOptionLabel(forecastStatusOptions, row.predStatus) }}</template>
805
- </el-table-column>
806
- <el-table-column label="预报类型" width="102">
807
- <template #default="{ row }">{{ getOptionLabel(forecastTypeOptions, row.predType) }}</template>
808
- </el-table-column>
809
- <el-table-column prop="groundBranch" label="落地机构" width="160" show-overflow-tooltip />
810
- <el-table-column label="收支方向" width="88">
811
- <template #default="{ row }">{{ getOptionLabel(payDirectionOptions, row.payDirection) }}</template>
812
- </el-table-column>
813
- <el-table-column prop="bankAccount" label="账户行" width="188" show-overflow-tooltip />
814
- <el-table-column prop="currency" label="币种" width="82">
815
- <template #default="{ row }">{{ row.currency }}</template>
816
- </el-table-column>
817
- <el-table-column
818
- prop="predAmount"
819
- label="预报金额(元)"
820
- width="152"
821
- align="right"
822
- sortable="custom"
823
- :sort-orders="['descending', 'ascending']"
824
- >
825
- <template #default="{ row }"><span class="money-cell">{{ formatMoney(row.predAmount) }}</span></template>
826
- </el-table-column>
827
- <el-table-column prop="valueDate" label="起息日" width="116" />
828
- <el-table-column label="核销状态" width="108">
829
- <template #default="{ row }">{{ getOptionLabel(verifyStatusOptions, row.verifyStatus) }}</template>
830
- </el-table-column>
831
- <el-table-column prop="verifyAmount" label="核销金额(元)" width="148" align="right">
832
- <template #default="{ row }"><span class="money-cell">{{ formatMoney(row.verifyAmount) }}</span></template>
833
- </el-table-column>
834
- <el-table-column label="业务类型" width="120">
835
- <template #default="{ row }">{{ getOptionLabel(businessTypeOptions, row.businessType) }}</template>
836
- </el-table-column>
837
- <el-table-column prop="clientName" label="客户名称" width="218" show-overflow-tooltip />
838
- <el-table-column prop="clientAccount" label="客户账号" width="198" show-overflow-tooltip />
839
- <el-table-column prop="counterpartyName" label="交易对手名称" width="220" show-overflow-tooltip />
840
- <el-table-column prop="counterpartyAccount" label="交易对手账号" width="190" show-overflow-tooltip />
841
- <el-table-column prop="receivingBank" label="交易对手行名称" width="210" show-overflow-tooltip />
842
- <el-table-column prop="receivingBankSwiftCode" label="交易对手行 SWIFTCODE" width="205" show-overflow-tooltip />
843
- <el-table-column label="结汇/购汇/现汇" width="136">
844
- <template #default="{ row }">{{ getOptionLabel(foreignExchangeTypeOptions, row.foreignExchangeType) }}</template>
845
- </el-table-column>
846
- <el-table-column
847
- prop="forecastTime"
848
- label="预报时间"
849
- width="170"
850
- sortable="custom"
851
- :sort-orders="['descending', 'ascending']"
852
- show-overflow-tooltip
853
- />
854
1040
  <el-table-column
855
- prop="approvalTime"
856
- label="审批时间"
857
- width="170"
858
- sortable="custom"
859
- :sort-orders="['descending', 'ascending']"
860
- show-overflow-tooltip
1041
+ v-for="column in forecastTableColumns"
1042
+ :key="column.key"
1043
+ :column-key="column.key"
1044
+ :prop="column.prop"
1045
+ :label="column.label"
1046
+ :width="column.width"
1047
+ :align="column.align"
1048
+ :fixed="column.fixed"
1049
+ :sortable="column.sortable"
1050
+ :sort-orders="column.sortOrders"
1051
+ :show-overflow-tooltip="column.showOverflowTooltip"
861
1052
  >
862
- <template #default="{ row }">{{ row.approvalTime || '—' }}</template>
1053
+ <template #default="{ row }">
1054
+ <span :class="{ 'money-cell': column.render === 'money' }">
1055
+ {{ getTableColumnText(column, row) }}
1056
+ </span>
1057
+ </template>
863
1058
  </el-table-column>
864
1059
  </ElTablePro>
865
1060
  </section>
@@ -1,10 +1,9 @@
1
1
  import { computed, reactive, ref } from 'vue'
2
2
  import { defineStore } from 'pinia'
3
- import type { ForeignPositionForecastQuery } from './api'
4
3
  import type { ForecastEditorMode } from './editor'
5
4
  import type { ForeignPositionForecast } from './model'
6
5
 
7
- export type FilterState = ForeignPositionForecastQuery
6
+ export type FilterState = any
8
7
  export type ApprovalAction = any
9
8
  export type PageMode = string
10
9