verce-vue-test 0.0.125 → 0.0.127
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/views/foreign-currency-position-forecast/api.ts +67 -23
- package/src/views/foreign-currency-position-forecast/components/ForeignPositionForecastEditor.vue +14 -9
- package/src/views/foreign-currency-position-forecast/index.vue +11 -3
- package/src/views/foreign-currency-position-forecast/options.ts +3 -3
package/package.json
CHANGED
|
@@ -35,6 +35,8 @@ export type ForeignPositionForecastSort = {
|
|
|
35
35
|
timeOrder: '' | '1' | '2'
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export type ForeignPositionForecastSearchParams = ForeignPositionForecastQuery & ForeignPositionForecastSort
|
|
39
|
+
|
|
38
40
|
type TamResultInfo = {
|
|
39
41
|
predRefNo?: string
|
|
40
42
|
predWay?: string
|
|
@@ -92,6 +94,13 @@ type TamDetailResponse = {
|
|
|
92
94
|
body?: TamResultInfo
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
type TamAccountBankResponse = {
|
|
98
|
+
head?: TamResponse['head']
|
|
99
|
+
body?: {
|
|
100
|
+
bankAcctList?: unknown[]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
95
104
|
type ForeignPositionForecastOperationResponse = {
|
|
96
105
|
success: boolean
|
|
97
106
|
message: string
|
|
@@ -261,6 +270,46 @@ export function queryForeignPositionOrganizationTree(signal?: AbortSignal) {
|
|
|
261
270
|
return baseHttpClient.get<{ data?: unknown }>('/uaa/org/tree', { signal })
|
|
262
271
|
}
|
|
263
272
|
|
|
273
|
+
export type ForeignPositionAccountBankOption = {
|
|
274
|
+
bankAcct: string
|
|
275
|
+
bankName: string
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** 根据币种、汇款路径和业务类型查询外币预报可用的我方账户行。 */
|
|
279
|
+
export async function queryForeignPositionAccountBanks(
|
|
280
|
+
params: {
|
|
281
|
+
ccy: string
|
|
282
|
+
paymentRoute: string
|
|
283
|
+
tranType: string
|
|
284
|
+
},
|
|
285
|
+
signal?: AbortSignal,
|
|
286
|
+
) {
|
|
287
|
+
const payload = await baseHttpClient.post<TamAccountBankResponse>(
|
|
288
|
+
'/TAM/0001/140201002',
|
|
289
|
+
{
|
|
290
|
+
ccy: params.ccy.trim(),
|
|
291
|
+
paymentRoute: params.paymentRoute.trim(),
|
|
292
|
+
tranType: params.tranType.trim(),
|
|
293
|
+
},
|
|
294
|
+
{ signal },
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
const bankAcctList = payload.body?.bankAcctList
|
|
298
|
+
if (!Array.isArray(bankAcctList)) {
|
|
299
|
+
throw new Error('我方账户行接口返回结构不正确')
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const seen = new Set<string>()
|
|
303
|
+
return bankAcctList.reduce<ForeignPositionAccountBankOption[]>((result, item) => {
|
|
304
|
+
const bankAcct = String(item ?? '').trim()
|
|
305
|
+
if (!bankAcct || seen.has(bankAcct)) return result
|
|
306
|
+
|
|
307
|
+
seen.add(bankAcct)
|
|
308
|
+
result.push({ bankAcct, bankName: bankAcct })
|
|
309
|
+
return result
|
|
310
|
+
}, [])
|
|
311
|
+
}
|
|
312
|
+
|
|
264
313
|
/** 将前端日期转换为 TAM 报文日期。 */
|
|
265
314
|
function toMutationDate(value: string) {
|
|
266
315
|
return value.trim().slice(0, 10).replaceAll('-', '')
|
|
@@ -359,36 +408,31 @@ export async function updateForeignPositionForecastAuthorization(
|
|
|
359
408
|
|
|
360
409
|
/** 按筛选、排序和分页条件查询外币头寸预报。 */
|
|
361
410
|
export async function queryForeignPositionForecasts(
|
|
362
|
-
|
|
411
|
+
searchParams: ForeignPositionForecastSearchParams,
|
|
363
412
|
pageIndex: number,
|
|
364
413
|
pageSize: number,
|
|
365
|
-
sort: ForeignPositionForecastSort = {
|
|
366
|
-
amtOrder: '1',
|
|
367
|
-
predOrder: '',
|
|
368
|
-
timeOrder: '',
|
|
369
|
-
},
|
|
370
414
|
signal?: AbortSignal,
|
|
371
415
|
): Promise<ForeignPositionForecastQueryResult> {
|
|
372
416
|
const payload = await baseHttpClient.post<TamResponse>(
|
|
373
417
|
'/TAM/0001/140201001',
|
|
374
418
|
{
|
|
375
|
-
orgName:
|
|
376
|
-
clientName:
|
|
377
|
-
tranType:
|
|
378
|
-
ccy:
|
|
379
|
-
tranDate:
|
|
380
|
-
payDirec:
|
|
381
|
-
predStatus: toProtocolStatusList(
|
|
382
|
-
originalForeign:
|
|
383
|
-
predWay:
|
|
384
|
-
verifyStatus: toProtocolStatusList(
|
|
385
|
-
startAmt:
|
|
386
|
-
endAmt:
|
|
387
|
-
filter:
|
|
388
|
-
authorization:
|
|
389
|
-
amtOrder:
|
|
390
|
-
predOrder:
|
|
391
|
-
timeOrder:
|
|
419
|
+
orgName: searchParams.organizationName.trim(),
|
|
420
|
+
clientName: searchParams.clientName.trim(),
|
|
421
|
+
tranType: searchParams.businessType,
|
|
422
|
+
ccy: searchParams.currencies.join(','),
|
|
423
|
+
tranDate: searchParams.valueDate,
|
|
424
|
+
payDirec: searchParams.payDirection,
|
|
425
|
+
predStatus: toProtocolStatusList(searchParams.forecastStatuses, 'PS'),
|
|
426
|
+
originalForeign: searchParams.foreignExchangeType,
|
|
427
|
+
predWay: searchParams.forecastWay,
|
|
428
|
+
verifyStatus: toProtocolStatusList(searchParams.verifyStatuses, 'VS'),
|
|
429
|
+
startAmt: searchParams.minAmount === null ? '' : String(searchParams.minAmount),
|
|
430
|
+
endAmt: searchParams.maxAmount === null ? '' : String(searchParams.maxAmount),
|
|
431
|
+
filter: searchParams.ftuFilter,
|
|
432
|
+
authorization: searchParams.authirization,
|
|
433
|
+
amtOrder: searchParams.amtOrder,
|
|
434
|
+
predOrder: searchParams.predOrder,
|
|
435
|
+
timeOrder: searchParams.timeOrder,
|
|
392
436
|
},
|
|
393
437
|
{
|
|
394
438
|
signal,
|
package/src/views/foreign-currency-position-forecast/components/ForeignPositionForecastEditor.vue
CHANGED
|
@@ -3,10 +3,10 @@ import dayjs from 'dayjs'
|
|
|
3
3
|
import { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'
|
|
4
4
|
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
queryForeignPositionAccountBanks,
|
|
7
|
+
queryForeignPositionOrganizationTree,
|
|
8
|
+
type ForeignPositionAccountBankOption,
|
|
9
|
+
} from '../api'
|
|
10
10
|
import { formatChineseCurrency } from '../currency'
|
|
11
11
|
import type { ForecastEditorMode, ForecastEditorValue } from '../editor'
|
|
12
12
|
import {
|
|
@@ -107,7 +107,7 @@ const emit = defineEmits<{
|
|
|
107
107
|
}>()
|
|
108
108
|
|
|
109
109
|
const formRef = ref<FormInstance>()
|
|
110
|
-
const accountBankOptions = ref<
|
|
110
|
+
const accountBankOptions = ref<ForeignPositionAccountBankOption[]>([])
|
|
111
111
|
const accountBankLoading = ref(false)
|
|
112
112
|
let accountBankRequestController: AbortController | null = null
|
|
113
113
|
const organizationOptions = ref<ForeignPositionOrganizationOption[]>([])
|
|
@@ -433,9 +433,13 @@ async function loadAccountBanks() {
|
|
|
433
433
|
accountBankLoading.value = true
|
|
434
434
|
|
|
435
435
|
try {
|
|
436
|
-
const result = await
|
|
437
|
-
{
|
|
438
|
-
|
|
436
|
+
const result = await queryForeignPositionAccountBanks(
|
|
437
|
+
{
|
|
438
|
+
ccy: form.currency,
|
|
439
|
+
paymentRoute: form.paymentRoute,
|
|
440
|
+
tranType: form.businessType,
|
|
441
|
+
},
|
|
442
|
+
controller.signal,
|
|
439
443
|
)
|
|
440
444
|
if (controller.signal.aborted || accountBankRequestController !== controller) return
|
|
441
445
|
accountBankOptions.value = result
|
|
@@ -463,7 +467,8 @@ async function handlePaymentRouteChange(value: PaymentRoute) {
|
|
|
463
467
|
: ''
|
|
464
468
|
|
|
465
469
|
if (missingMessage) {
|
|
466
|
-
//
|
|
470
|
+
// 前置条件不足时不保留本次无效选择,并清空关联的数据源。
|
|
471
|
+
form.paymentRoute = ''
|
|
467
472
|
form.receivingBankSwiftCode = ''
|
|
468
473
|
ElMessage.warning(missingMessage)
|
|
469
474
|
} else {
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
deleteForeignPositionForecast,
|
|
32
32
|
getForeignPositionForecast,
|
|
33
33
|
queryForeignPositionForecasts,
|
|
34
|
+
type ForeignPositionForecastSearchParams,
|
|
34
35
|
type ForeignPositionForecastSort,
|
|
35
36
|
updateForeignPositionForecast,
|
|
36
37
|
updateForeignPositionForecastAuthorization,
|
|
@@ -90,6 +91,10 @@ const forecastSort = ref<ForeignPositionForecastSort>({
|
|
|
90
91
|
predOrder: '',
|
|
91
92
|
timeOrder: '',
|
|
92
93
|
})
|
|
94
|
+
const sharedSearchParams = computed<ForeignPositionForecastSearchParams>(() => ({
|
|
95
|
+
...cloneFilters(appliedFilters.value),
|
|
96
|
+
...forecastSort.value,
|
|
97
|
+
}))
|
|
93
98
|
const tableDefaultSort = computed<{
|
|
94
99
|
prop: 'predAmount' | 'forecastTime' | 'approvalTime'
|
|
95
100
|
order: 'ascending' | 'descending'
|
|
@@ -166,10 +171,9 @@ async function loadForecastRows() {
|
|
|
166
171
|
|
|
167
172
|
try {
|
|
168
173
|
const response = await queryForeignPositionForecasts(
|
|
169
|
-
|
|
174
|
+
sharedSearchParams.value,
|
|
170
175
|
currentPage.value,
|
|
171
176
|
pageSize.value,
|
|
172
|
-
forecastSort.value,
|
|
173
177
|
controller.signal,
|
|
174
178
|
)
|
|
175
179
|
|
|
@@ -218,6 +222,10 @@ function handleReset() {
|
|
|
218
222
|
clearTableSelection()
|
|
219
223
|
}
|
|
220
224
|
|
|
225
|
+
function handleExport() {
|
|
226
|
+
console.log('外币头寸预报导出参数:', sharedSearchParams.value)
|
|
227
|
+
}
|
|
228
|
+
|
|
221
229
|
function handleSelectionChange(rows: ForeignPositionForecast[]) {
|
|
222
230
|
selectedRows.value = rows
|
|
223
231
|
}
|
|
@@ -710,7 +718,7 @@ onBeforeUnmount(() => {
|
|
|
710
718
|
>
|
|
711
719
|
审批拒绝
|
|
712
720
|
</el-button>
|
|
713
|
-
<el-button size="small" :icon="Download">导出</el-button>
|
|
721
|
+
<el-button size="small" :icon="Download" @click="handleExport">导出</el-button>
|
|
714
722
|
</div>
|
|
715
723
|
</template>
|
|
716
724
|
|
|
@@ -78,7 +78,7 @@ export const clientTypeOptions = [
|
|
|
78
78
|
] satisfies SelectOption[]
|
|
79
79
|
|
|
80
80
|
export const paymentRouteOptions = [
|
|
81
|
-
{ value: '01', label: '
|
|
82
|
-
{ value: '02', label: '
|
|
83
|
-
{ value: '03', label: '
|
|
81
|
+
{ value: '01', label: '人行境内外币支付' },
|
|
82
|
+
{ value: '02', label: '境外汇款' },
|
|
83
|
+
{ value: '03', label: '境内汇款走境外汇路' },
|
|
84
84
|
] satisfies SelectOption[]
|