verce-vue-test 0.0.165 → 0.0.166

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verce-vue-test",
3
- "version": "0.0.165",
3
+ "version": "0.0.166",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -370,11 +370,7 @@ function isPendingStatus(status: string) {
370
370
  }
371
371
 
372
372
  function canEditStatus(status: string) {
373
- return ['N', 'C'].includes(statusCode(status))
374
- }
375
-
376
- function canDeleteStatus(status: string) {
377
- return ['N', 'C'].includes(statusCode(status))
373
+ return ['N', 'Y', 'C'].includes(statusCode(status))
378
374
  }
379
375
 
380
376
  function handleSelectionChange(rows: ForeignCurrencyFundAllocationRow[]) {
@@ -526,7 +522,7 @@ function handleAccountSelectVisibleChange(mode: AllocationFormMode, visible: boo
526
522
 
527
523
  function openEdit(row: ForeignCurrencyFundAllocationRow) {
528
524
  if (!canEditStatus(row.status)) {
529
- ElMessage.warning('只有审批未通过或草稿状态的调拨记录才能修改')
525
+ ElMessage.warning('只有审批未通过、审批已通过或草稿状态的调拨记录才能修改')
530
526
  return
531
527
  }
532
528
  accountBankRequestId += 1
@@ -637,15 +633,6 @@ async function handleDelete() {
637
633
  await ElMessageBox.alert('请至少选择一条调拨记录', '操作提醒', { type: 'warning' })
638
634
  return
639
635
  }
640
- const invalidRows = selectedRows.value.filter((row) => !canDeleteStatus(row.status))
641
- if (invalidRows.length > 0) {
642
- await ElMessageBox.alert(
643
- `调拨单号 ${invalidRows.map((row) => row.refNo).join('、')} 不符合删除条件,只有审批未通过或草稿状态的调拨记录才能删除。`,
644
- '操作提醒',
645
- { type: 'warning' },
646
- )
647
- return
648
- }
649
636
  const refNos = selectedRows.value.map((row) => row.refNo).join(',')
650
637
 
651
638
  try {
@@ -978,7 +965,7 @@ onMounted(() => {
978
965
  size="small"
979
966
  :icon="EditPen"
980
967
  :disabled="!canEditStatus(row.status) || activeBatchAction !== null"
981
- title="仅审批未通过或草稿状态可修改"
968
+ title="审批未通过、审批已通过或草稿状态可修改"
982
969
  @click.stop="openEdit(row)"
983
970
  >
984
971
  修改
@@ -75,3 +75,13 @@ export function getRmbPositionForecastDetail(
75
75
  params,
76
76
  )
77
77
  }
78
+
79
+ /** 调用 TAM 140101003 查询指定预报对应的预报信息和流水信息。 */
80
+ export function getRmbPositionTransactionStatus(
81
+ params: { predRefNo: string },
82
+ ) {
83
+ return baseHttpClient.post<any>(
84
+ '/TAM/0001/140101003',
85
+ params,
86
+ )
87
+ }
@@ -888,7 +888,12 @@ onBeforeUnmount(() => {
888
888
  </el-select>
889
889
  </el-form-item>
890
890
 
891
- <el-form-item label="客户名称" prop="clientName" data-editor-field="clientName">
891
+ <el-form-item
892
+ label="客户名称"
893
+ prop="clientName"
894
+ :required="isFieldRequired('clientName')"
895
+ data-editor-field="clientName"
896
+ >
892
897
  <div class="client-editor-control">
893
898
  <CorporateCustomerSelect
894
899
  v-if="shouldUseCorporateCustomerSelector"
@@ -0,0 +1,431 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ /**
4
+ * 人民币头寸预报对应交易状态。
5
+ * 预报信息和流水信息均由 TAM 140101003 一次返回,本页不追加分页请求。
6
+ */
7
+ import { computed, onBeforeUnmount, ref, watch } from 'vue'
8
+ import { ArrowLeft } from '@element-plus/icons-vue'
9
+ import { ElMessage } from 'element-plus'
10
+
11
+ import { getRmbPositionTransactionStatus } from '../api'
12
+ import {
13
+ businessTypeOptions,
14
+ forecastStatusOptions,
15
+ payChannelOptions,
16
+ payDirectionOptions,
17
+ verifyStatusOptions,
18
+ } from '../model'
19
+
20
+ type TableRow = Record<string, unknown>
21
+ type TableFormatter = (value: unknown, row: TableRow) => string
22
+ type TableColumn = {
23
+ prop: string
24
+ label: string
25
+ minWidth?: number
26
+ width?: number
27
+ formatter?: TableFormatter
28
+ }
29
+
30
+ const props = defineProps<{
31
+ predRefNo: string
32
+ }>()
33
+
34
+ const emit = defineEmits<{
35
+ back: []
36
+ }>()
37
+
38
+ const predictionRows = ref<TableRow[]>([])
39
+ const transactionRows = ref<TableRow[]>([])
40
+ const isLoading = ref(false)
41
+ const loadError = ref('')
42
+ let requestId = 0
43
+ let requestController: AbortController | null = null
44
+
45
+ const predRefNo = computed(() => String(props.predRefNo ?? '').trim())
46
+
47
+ const moneyFormatter = new Intl.NumberFormat('zh-CN', {
48
+ minimumFractionDigits: 2,
49
+ maximumFractionDigits: 2,
50
+ })
51
+
52
+ const optionLabel = (options: Array<{ value: string; label: string }>, value: unknown) => {
53
+ const code = String(value ?? '').trim()
54
+ return options.find((option) => option.value === code)?.label || ''
55
+ }
56
+
57
+ function formatDisplayValue(value: unknown) {
58
+ if (value === undefined || value === null || String(value).trim() === '') return '—'
59
+ return String(value)
60
+ }
61
+
62
+ function formatDate(value: unknown) {
63
+ const text = String(value ?? '').trim()
64
+ if (!text) return '—'
65
+ if (/^\d{8}$/.test(text)) {
66
+ return `${text.slice(0, 4)}-${text.slice(4, 6)}-${text.slice(6, 8)}`
67
+ }
68
+ return text
69
+ }
70
+
71
+ function formatTimestamp(value: unknown) {
72
+ const text = String(value ?? '').trim()
73
+ if (!text) return '—'
74
+ if (/^\d{8}\s+\d{2}:\d{2}:\d{2}$/.test(text)) {
75
+ return `${text.slice(0, 4)}-${text.slice(4, 6)}-${text.slice(6, 8)}${text.slice(8)}`
76
+ }
77
+ return text
78
+ }
79
+
80
+ function formatAmount(value: unknown) {
81
+ const text = String(value ?? '').replaceAll(',', '').trim()
82
+ if (!text) return '—'
83
+ const amount = Number(text)
84
+ return Number.isFinite(amount) ? moneyFormatter.format(amount) : String(value)
85
+ }
86
+
87
+ function formatOption(options: Array<{ value: string; label: string }>): TableFormatter {
88
+ return (value) => optionLabel(options, value) || formatDisplayValue(value)
89
+ }
90
+
91
+ const predictionColumns: TableColumn[] = [
92
+ { prop: 'predStatus', label: '预报状态', minWidth: 150, formatter: formatOption(forecastStatusOptions) },
93
+ { prop: 'payDirec', label: '收支方向', minWidth: 100, formatter: formatOption(payDirectionOptions) },
94
+ { prop: 'predAmt', label: '预报金额(元)', minWidth: 150, formatter: formatAmount },
95
+ { prop: 'verifyAmt', label: '已核销金额(元)', minWidth: 160, formatter: formatAmount },
96
+ { prop: 'groundBranch', label: '落地机构', minWidth: 150 },
97
+ { prop: 'clientName', label: '客户名称', minWidth: 150 },
98
+ { prop: 'competName', label: '交易对手名称', minWidth: 150 },
99
+ { prop: 'standardName', label: '标准名称', minWidth: 140 },
100
+ { prop: 'competAcct', label: '交易对手账号', minWidth: 150 },
101
+ { prop: 'billNo', label: '票号', minWidth: 120 },
102
+ { prop: 'billDate', label: '出票日', minWidth: 110, formatter: formatDate },
103
+ { prop: 'payChannel', label: '支付渠道', minWidth: 110, formatter: formatOption(payChannelOptions) },
104
+ { prop: 'tranDate', label: '交易日期', minWidth: 110, formatter: formatDate },
105
+ { prop: 'busiType', label: '业务类型', minWidth: 170, formatter: formatOption(businessTypeOptions) },
106
+ { prop: 'predDate', label: '预报日期', minWidth: 110, formatter: formatDate },
107
+ ]
108
+
109
+ const transactionColumns: TableColumn[] = [
110
+ { prop: 'tranAmt', label: '交易金额', minWidth: 150, formatter: formatAmount },
111
+ { prop: 'tranDate', label: '交易日期', minWidth: 110, formatter: formatDate },
112
+ { prop: 'tranTimeStamp', label: '交易时间', minWidth: 170, formatter: formatTimestamp },
113
+ { prop: 'verifyStatus', label: '核销状态', minWidth: 110, formatter: formatOption(verifyStatusOptions) },
114
+ { prop: 'acctBranch', label: '记账机构', minWidth: 140 },
115
+ { prop: 'othAcctName', label: '对方户名', minWidth: 150 },
116
+ { prop: 'othAcctNo', label: '对方账号', minWidth: 150 },
117
+ { prop: 'branch', label: '我方机构', minWidth: 140 },
118
+ { prop: 'acctName', label: '我方户名', minWidth: 150 },
119
+ { prop: 'acctNo', label: '我方账号', minWidth: 150 },
120
+ { prop: 'billNo', label: '票号', minWidth: 120 },
121
+ { prop: 'billDate', label: '出票日', minWidth: 110, formatter: formatDate },
122
+ { prop: 'consignDate', label: '委托日期', minWidth: 110, formatter: formatDate },
123
+ { prop: 'busiType', label: '业务类型', minWidth: 170, formatter: formatOption(businessTypeOptions) },
124
+ { prop: 'format', label: '支付渠道', minWidth: 110, formatter: formatOption(payChannelOptions) },
125
+ { prop: 'remark', label: '备注', minWidth: 150 },
126
+ { prop: 'sendBankCode', label: '发起行行号', minWidth: 140 },
127
+ { prop: 'sendSettleBank', label: '发起清算行行号', minWidth: 160 },
128
+ { prop: 'rcvBankCode', label: '接收行行号', minWidth: 140 },
129
+ { prop: 'rcvSettleBank', label: '接收清算行行号', minWidth: 160 },
130
+ ]
131
+
132
+ function getCellText(row: TableRow, column: TableColumn) {
133
+ const value = row[column.prop]
134
+ return column.formatter ? column.formatter(value, row) : formatDisplayValue(value)
135
+ }
136
+
137
+ function toRows(value: unknown): TableRow[] {
138
+ return Array.isArray(value)
139
+ ? value.filter((item): item is TableRow => Boolean(item && typeof item === 'object'))
140
+ : []
141
+ }
142
+
143
+ async function loadTransactionStatus() {
144
+ const currentRequestId = ++requestId
145
+ requestController?.abort()
146
+ requestController = new AbortController()
147
+ predictionRows.value = []
148
+ transactionRows.value = []
149
+ loadError.value = ''
150
+
151
+ if (!predRefNo.value) {
152
+ loadError.value = '缺少预报流水号,无法查询对应交易状态'
153
+ return
154
+ }
155
+
156
+ isLoading.value = true
157
+ try {
158
+ const response = await getRmbPositionTransactionStatus({
159
+ predRefNo: predRefNo.value,
160
+ }) as any
161
+ if (currentRequestId !== requestId) return
162
+
163
+ const body = response?.body && typeof response.body === 'object'
164
+ ? response.body
165
+ : {}
166
+ predictionRows.value = toRows(body.predList)
167
+ transactionRows.value = toRows(body.msgList ?? body.tranList)
168
+ } catch (error) {
169
+ if (currentRequestId !== requestId) return
170
+ loadError.value = error instanceof Error ? error.message : '对应交易状态查询失败'
171
+ ElMessage.error(loadError.value)
172
+ } finally {
173
+ if (currentRequestId === requestId) {
174
+ requestController = null
175
+ isLoading.value = false
176
+ }
177
+ }
178
+ }
179
+
180
+ function returnToList() {
181
+ emit('back')
182
+ }
183
+
184
+ watch(predRefNo, () => {
185
+ void loadTransactionStatus()
186
+ }, { immediate: true })
187
+
188
+ onBeforeUnmount(() => {
189
+ requestId += 1
190
+ requestController?.abort()
191
+ })
192
+ </script>
193
+
194
+ <template>
195
+ <main v-loading="isLoading" class="rmb-transaction-status-page">
196
+ <header class="transaction-status-heading">
197
+ <el-button class="back-button" :icon="ArrowLeft" @click="returnToList">
198
+ 返回
199
+ </el-button>
200
+ <div class="heading-copy">
201
+ <h1>对应交易状态</h1>
202
+ </div>
203
+ </header>
204
+
205
+ <section v-if="loadError" class="transaction-status-state is-error">
206
+ <strong>对应交易状态查询失败</strong>
207
+ <p>{{ loadError }}</p>
208
+ <el-button type="primary" @click="loadTransactionStatus">重新查询</el-button>
209
+ </section>
210
+
211
+ <div v-else class="transaction-status-content">
212
+ <section class="transaction-status-section" aria-label="预报信息">
213
+ <div class="section-heading">
214
+ <div>
215
+ <h2>预报信息</h2>
216
+ <p>与当前预报流水号对应的预报记录</p>
217
+ </div>
218
+ <span class="section-count">{{ predictionRows.length }} 条</span>
219
+ </div>
220
+ <div class="status-table-wrapper">
221
+ <ElTablePro
222
+ :data="predictionRows"
223
+ :pagination="false"
224
+ border
225
+ stripe
226
+ size="small"
227
+ row-key="predRefNo"
228
+ empty-text="暂无预报信息"
229
+ table-key="rmb-position-transaction-status-prediction"
230
+ col-btn-size="small"
231
+ class="status-table"
232
+ >
233
+ <el-table-column
234
+ v-for="column in predictionColumns"
235
+ :key="column.prop"
236
+ :prop="column.prop"
237
+ :label="column.label"
238
+ :min-width="column.minWidth"
239
+ :width="column.width"
240
+ >
241
+ <template #default="{ row }">
242
+ {{ getCellText(row, column) }}
243
+ </template>
244
+ </el-table-column>
245
+ </ElTablePro>
246
+ </div>
247
+ </section>
248
+
249
+ <section class="transaction-status-section" aria-label="流水信息">
250
+ <div class="section-heading">
251
+ <div>
252
+ <h2>流水信息</h2>
253
+ <p>与当前预报关联的实际交易流水</p>
254
+ </div>
255
+ <span class="section-count">{{ transactionRows.length }} 条</span>
256
+ </div>
257
+ <div class="status-table-wrapper">
258
+ <ElTablePro
259
+ :data="transactionRows"
260
+ :pagination="false"
261
+ border
262
+ stripe
263
+ size="small"
264
+ row-key="msgSeqNo"
265
+ empty-text="暂无流水信息"
266
+ table-key="rmb-position-transaction-status-transaction"
267
+ col-btn-size="small"
268
+ class="status-table"
269
+ >
270
+ <el-table-column
271
+ v-for="column in transactionColumns"
272
+ :key="column.prop"
273
+ :prop="column.prop"
274
+ :label="column.label"
275
+ :min-width="column.minWidth"
276
+ :width="column.width"
277
+ >
278
+ <template #default="{ row }">
279
+ {{ getCellText(row, column) }}
280
+ </template>
281
+ </el-table-column>
282
+ </ElTablePro>
283
+ </div>
284
+ </section>
285
+ </div>
286
+ </main>
287
+ </template>
288
+
289
+ <style scoped>
290
+ .rmb-transaction-status-page {
291
+ --page-blue: #1f62d6;
292
+ --page-ink: #172033;
293
+ --page-muted: #667085;
294
+ --page-line: #dce3ec;
295
+ min-width: 0;
296
+ min-height: 100%;
297
+ padding-bottom: 18px;
298
+ color: var(--page-ink);
299
+ font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
300
+ }
301
+
302
+ .transaction-status-heading,
303
+ .transaction-status-section {
304
+ border: 1px solid var(--page-line);
305
+ border-radius: 7px;
306
+ background: #fff;
307
+ box-shadow: 0 3px 12px rgba(30, 55, 90, .045);
308
+ }
309
+
310
+ .transaction-status-heading {
311
+ display: flex;
312
+ align-items: center;
313
+ gap: 14px;
314
+ margin-bottom: 10px;
315
+ padding: 12px 14px;
316
+ }
317
+
318
+ .back-button {
319
+ flex: 0 0 auto;
320
+ }
321
+
322
+ .heading-copy {
323
+ min-width: 0;
324
+ }
325
+
326
+ .heading-copy h1 {
327
+ margin: 0;
328
+ color: #172033;
329
+ font-size: 18px;
330
+ line-height: 28px;
331
+ }
332
+
333
+ .heading-copy p {
334
+ margin: 2px 0 0;
335
+ color: var(--page-muted);
336
+ font-size: 12px;
337
+ line-height: 18px;
338
+ }
339
+
340
+ .transaction-status-content {
341
+ display: flex;
342
+ flex-direction: column;
343
+ gap: 10px;
344
+ }
345
+
346
+ .transaction-status-section {
347
+ min-width: 0;
348
+ padding: 12px 12px 10px;
349
+ }
350
+
351
+ .section-heading {
352
+ display: flex;
353
+ align-items: center;
354
+ justify-content: space-between;
355
+ gap: 12px;
356
+ margin: 0 2px 10px;
357
+ }
358
+
359
+ .section-heading h2 {
360
+ margin: 0;
361
+ color: #172033;
362
+ font-size: 15px;
363
+ line-height: 22px;
364
+ }
365
+
366
+ .section-heading p {
367
+ margin: 2px 0 0;
368
+ color: var(--page-muted);
369
+ font-size: 12px;
370
+ line-height: 18px;
371
+ }
372
+
373
+ .section-count {
374
+ flex: 0 0 auto;
375
+ color: var(--page-muted);
376
+ font-size: 12px;
377
+ white-space: nowrap;
378
+ }
379
+
380
+ .status-table-wrapper {
381
+ min-width: 0;
382
+ overflow-x: auto;
383
+ }
384
+
385
+ .status-table {
386
+ width: 100%;
387
+ }
388
+
389
+ .status-table :deep(.el-table__cell) {
390
+ white-space: nowrap;
391
+ }
392
+
393
+ .status-table :deep(.cell) {
394
+ white-space: nowrap;
395
+ }
396
+
397
+ .transaction-status-state {
398
+ padding: 42px 24px;
399
+ border: 1px solid var(--page-line);
400
+ border-radius: 7px;
401
+ background: #fff;
402
+ text-align: center;
403
+ }
404
+
405
+ .transaction-status-state strong {
406
+ display: block;
407
+ color: #172033;
408
+ font-size: 15px;
409
+ }
410
+
411
+ .transaction-status-state p {
412
+ margin: 8px 0 18px;
413
+ color: var(--page-muted);
414
+ font-size: 13px;
415
+ }
416
+
417
+ @media (max-width: 760px) {
418
+ .transaction-status-heading {
419
+ align-items: flex-start;
420
+ padding: 10px;
421
+ }
422
+
423
+ .heading-copy h1 {
424
+ font-size: 16px;
425
+ }
426
+
427
+ .transaction-status-section {
428
+ padding: 10px 8px 8px;
429
+ }
430
+ }
431
+ </style>
@@ -70,6 +70,9 @@ const RmbPositionForecastDetail = defineAsyncComponent(
70
70
  const RmbPositionForecastForm = defineAsyncComponent(
71
71
  () => import('./form.vue'),
72
72
  )
73
+ const RmbPositionTransactionStatus = defineAsyncComponent(
74
+ () => import('./components/RmbPositionTransactionStatus.vue'),
75
+ )
73
76
 
74
77
  const moneyFormatter = new Intl.NumberFormat('zh-CN', {
75
78
  minimumFractionDigits: 2,
@@ -428,8 +431,10 @@ function handleSelectedCopy() {
428
431
  openCopyPage(row)
429
432
  }
430
433
 
431
- /** 对应交易状态入口暂保留,待业务接口明确后接入。 */
434
+ /** 打开当前预报对应的交易状态组件页。 */
432
435
  function handleTransactionStatusClick() {
436
+ if (!singleSelectedRow.value) return
437
+ showInlineView('transaction-status', singleSelectedRow.value.predRefNo)
433
438
  }
434
439
 
435
440
  /** 打开新增页;新增不需要先加载来源记录。 */
@@ -699,7 +704,7 @@ function handleExport() {
699
704
  :plain="!singleSelectedRow"
700
705
  @click="handleTransactionStatusClick"
701
706
  >
702
- 对应交易状态
707
+ 查看对应交易状态
703
708
  </el-button>
704
709
  </span>
705
710
  </el-tooltip>
@@ -823,6 +828,13 @@ function handleExport() {
823
828
  @back="showList"
824
829
  />
825
830
 
831
+ <RmbPositionTransactionStatus
832
+ v-else-if="activeView === 'transaction-status'"
833
+ :key="`transaction-status-${activePredRefNo}`"
834
+ :pred-ref-no="activePredRefNo"
835
+ @back="showList"
836
+ />
837
+
826
838
  <RmbPositionForecastForm
827
839
  v-else
828
840
  :key="`${activeFormMode}-${activePredRefNo || 'new'}`"