verce-vue-test 0.0.138 → 0.0.139
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/rmb-position-forecast/components/RmbPositionForecastEditor.vue +106 -154
- package/src/views/rmb-position-forecast/detail.vue +2 -3
- package/src/views/rmb-position-forecast/form.vue +0 -1
- package/src/views/rmb-position-forecast/index.vue +0 -12
- package/src/views/rmb-position-forecast/model.ts +50 -4
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ref,
|
|
15
15
|
watch,
|
|
16
16
|
} from 'vue'
|
|
17
|
-
import { Check
|
|
17
|
+
import { Check } from '@element-plus/icons-vue'
|
|
18
18
|
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
|
19
19
|
|
|
20
20
|
import {
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
payDirectionOptions,
|
|
40
40
|
requiresCustomerAccountQuery,
|
|
41
41
|
toRmbPositionCustomerAccountSequence,
|
|
42
|
-
|
|
42
|
+
toRmbPositionOrganizationCascaderOptions,
|
|
43
43
|
type EditorControlledField,
|
|
44
44
|
type EditorForm,
|
|
45
45
|
type RmbPositionForecastMutationValue,
|
|
46
|
-
type
|
|
46
|
+
type RmbPositionOrganizationCascaderOption,
|
|
47
47
|
} from '../model'
|
|
48
48
|
import {
|
|
49
49
|
getLocalDateString,
|
|
@@ -95,12 +95,29 @@ let editorSessionId = 0
|
|
|
95
95
|
const isClientAccountQuerying = ref(false)
|
|
96
96
|
let clientAccountQueryController: AbortController | null = null
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
/** 落地机构级联树及其请求状态。 */
|
|
99
|
+
const organizationCascaderOptions = ref<RmbPositionOrganizationCascaderOption[]>([])
|
|
100
|
+
const isOrganizationTreeLoading = ref(false)
|
|
101
|
+
const hasOrganizationTreeLoaded = ref(false)
|
|
102
|
+
let organizationTreeController: AbortController | null = null
|
|
103
|
+
const organizationCascaderProps = {
|
|
104
|
+
checkStrictly: true,
|
|
105
|
+
emitPath: false,
|
|
106
|
+
}
|
|
107
|
+
/** 机构树尚未加载或未包含环境默认机构时,仍使用当前名称和代码正确回显。 */
|
|
108
|
+
const displayedOrganizationCascaderOptions = computed(() => {
|
|
109
|
+
const options = organizationCascaderOptions.value
|
|
110
|
+
const currentCode = form.groundBranchCode.trim()
|
|
111
|
+
if (!currentCode || findOrganizationOption(options, currentCode)) return options
|
|
112
|
+
|
|
113
|
+
const currentName = form.groundBranch.trim() || currentCode
|
|
114
|
+
return [{
|
|
115
|
+
value: currentCode,
|
|
116
|
+
label: currentName,
|
|
117
|
+
organizationCode: currentCode,
|
|
118
|
+
organizationName: currentName,
|
|
119
|
+
}, ...options]
|
|
120
|
+
})
|
|
104
121
|
|
|
105
122
|
/** 新增只展示可选客户类型,修改则保留旧协议的“不适用”编码。 */
|
|
106
123
|
const clientTypeOptionsForEditor = computed(() => {
|
|
@@ -151,7 +168,7 @@ const focusOrder = computed(() => {
|
|
|
151
168
|
|
|
152
169
|
const billBusiness = isBillBusinessType(form.businessType)
|
|
153
170
|
const accountingCenter = isAccountingCenter(form.groundBranchCode)
|
|
154
|
-
const order = ['businessType', 'groundBranch'
|
|
171
|
+
const order = ['businessType', 'groundBranch']
|
|
155
172
|
|
|
156
173
|
if (billBusiness) {
|
|
157
174
|
order.push('billNo', 'billDate')
|
|
@@ -350,13 +367,11 @@ function resetClientSelection() {
|
|
|
350
367
|
form.customerInfoSequence = ''
|
|
351
368
|
}
|
|
352
369
|
|
|
353
|
-
/**
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
organizationSearchVisible.value = false
|
|
359
|
-
isOrganizationSearching.value = false
|
|
370
|
+
/** 取消仍在进行的机构树请求,已加载的树继续复用。 */
|
|
371
|
+
function resetOrganizationTreeRequest() {
|
|
372
|
+
organizationTreeController?.abort()
|
|
373
|
+
organizationTreeController = null
|
|
374
|
+
isOrganizationTreeLoading.value = false
|
|
360
375
|
}
|
|
361
376
|
|
|
362
377
|
/** 清空客户及其查询流水号,供业务类型/机构/客户类型切换复用。 */
|
|
@@ -392,7 +407,7 @@ function assignForm() {
|
|
|
392
407
|
Object.assign(form, createEditorForm(getEditorContext(), props.sourceRecord, props.mode))
|
|
393
408
|
syncAmountText()
|
|
394
409
|
resetClientSelection()
|
|
395
|
-
|
|
410
|
+
resetOrganizationTreeRequest()
|
|
396
411
|
if (props.mode !== 'edit') normalizeCreateEditorForm(form, fieldPolicy.value)
|
|
397
412
|
clearValidation()
|
|
398
413
|
}
|
|
@@ -407,86 +422,78 @@ function handleBusinessTypeChange() {
|
|
|
407
422
|
normalizeCreateLinkage()
|
|
408
423
|
}
|
|
409
424
|
|
|
410
|
-
/**
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
425
|
+
/** 按机构代码递归查找级联节点,用于回填提交所需的机构名称。 */
|
|
426
|
+
function findOrganizationOption(
|
|
427
|
+
options: RmbPositionOrganizationCascaderOption[],
|
|
428
|
+
organizationCode: string,
|
|
429
|
+
): RmbPositionOrganizationCascaderOption | undefined {
|
|
430
|
+
for (const option of options) {
|
|
431
|
+
if (option.organizationCode === organizationCode) return option
|
|
432
|
+
const child = option.children
|
|
433
|
+
? findOrganizationOption(option.children, organizationCode)
|
|
434
|
+
: undefined
|
|
435
|
+
if (child) return child
|
|
436
|
+
}
|
|
437
|
+
return undefined
|
|
421
438
|
}
|
|
422
439
|
|
|
423
|
-
/**
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (!form.groundBranchCode) return
|
|
432
|
-
|
|
433
|
-
form.groundBranchCode = ''
|
|
434
|
-
clearCustomerFields()
|
|
435
|
-
clearCounterpartyFields()
|
|
436
|
-
clearBillFields()
|
|
437
|
-
form.payChannel = ''
|
|
438
|
-
normalizeCreateLinkage()
|
|
440
|
+
/** el-cascader 的搜索同时匹配机构名称和机构代码。 */
|
|
441
|
+
function filterOrganizationNode(node: any, keyword: string) {
|
|
442
|
+
const option = node?.data as RmbPositionOrganizationCascaderOption | undefined
|
|
443
|
+
const normalizedKeyword = keyword.trim().toLocaleLowerCase('zh-CN')
|
|
444
|
+
return Boolean(option && (
|
|
445
|
+
option.organizationName.toLocaleLowerCase('zh-CN').includes(normalizedKeyword)
|
|
446
|
+
|| option.organizationCode.toLocaleLowerCase('zh-CN').includes(normalizedKeyword)
|
|
447
|
+
))
|
|
439
448
|
}
|
|
440
449
|
|
|
441
|
-
/**
|
|
442
|
-
async function
|
|
443
|
-
|
|
444
|
-
if (!keyword) {
|
|
445
|
-
ElMessage.warning('机构名称不能为空')
|
|
446
|
-
return
|
|
447
|
-
}
|
|
450
|
+
/** 首次展开级联面板时加载完整 UAA 机构树,后续打开复用同一份数据。 */
|
|
451
|
+
async function loadOrganizationTree() {
|
|
452
|
+
if (hasOrganizationTreeLoaded.value || isOrganizationTreeLoading.value) return
|
|
448
453
|
|
|
449
|
-
|
|
454
|
+
organizationTreeController?.abort()
|
|
450
455
|
const controller = new AbortController()
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
isOrganizationSearching.value = true
|
|
456
|
+
organizationTreeController = controller
|
|
457
|
+
isOrganizationTreeLoading.value = true
|
|
454
458
|
|
|
455
459
|
try {
|
|
456
460
|
const response = await queryRmbPositionOrganizationTree() as any
|
|
457
|
-
if (controller.signal.aborted ||
|
|
458
|
-
const options =
|
|
461
|
+
if (controller.signal.aborted || organizationTreeController !== controller) return
|
|
462
|
+
const options = toRmbPositionOrganizationCascaderOptions(response.data)
|
|
459
463
|
|
|
460
|
-
|
|
461
|
-
|
|
464
|
+
organizationCascaderOptions.value = options
|
|
465
|
+
hasOrganizationTreeLoaded.value = true
|
|
462
466
|
if (options.length === 0) {
|
|
463
|
-
ElMessage.info('
|
|
464
|
-
} else {
|
|
465
|
-
await nextTick()
|
|
466
|
-
organizationSearchResultsRef.value?.querySelector<HTMLElement>('button')?.focus()
|
|
467
|
+
ElMessage.info('未查询到可用的落地机构')
|
|
467
468
|
}
|
|
468
469
|
} catch (error) {
|
|
469
470
|
if (controller.signal.aborted) return
|
|
470
|
-
ElMessage.error(error instanceof Error ? error.message : '
|
|
471
|
+
ElMessage.error(error instanceof Error ? error.message : '落地机构树加载失败')
|
|
471
472
|
} finally {
|
|
472
|
-
if (
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
if (organizationTreeController === controller) {
|
|
474
|
+
organizationTreeController = null
|
|
475
|
+
isOrganizationTreeLoading.value = false
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
function handleOrganizationCascaderVisibleChange(visible: boolean) {
|
|
481
|
+
if (visible) void loadOrganizationTree()
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/** 级联选中后回填机构名称和代码,并保持原新增/复制联动清理逻辑。 */
|
|
485
|
+
function handleGroundBranchChange(value: unknown) {
|
|
486
|
+
if (props.mode === 'edit') return
|
|
487
|
+
const organizationCode = String(Array.isArray(value) ? value.at(-1) ?? '' : value ?? '').trim()
|
|
488
|
+
const option = findOrganizationOption(displayedOrganizationCascaderOptions.value, organizationCode)
|
|
489
|
+
form.groundBranchCode = organizationCode
|
|
490
|
+
form.groundBranch = option?.organizationName ?? ''
|
|
483
491
|
clearCustomerFields()
|
|
484
492
|
clearCounterpartyFields()
|
|
485
493
|
clearBillFields()
|
|
486
494
|
form.payChannel = ''
|
|
487
|
-
organizationSearchVisible.value = false
|
|
488
495
|
normalizeCreateLinkage()
|
|
489
|
-
focusNextField('
|
|
496
|
+
if (organizationCode) nextTick(() => focusNextField('groundBranch'))
|
|
490
497
|
}
|
|
491
498
|
|
|
492
499
|
/** 新增/复制切换客户类型会清空支付渠道、客户查询和交易对手,要求重新选择。 */
|
|
@@ -728,7 +735,7 @@ watch(
|
|
|
728
735
|
onBeforeUnmount(() => {
|
|
729
736
|
editorSessionId += 1
|
|
730
737
|
clientAccountQueryController?.abort()
|
|
731
|
-
|
|
738
|
+
organizationTreeController?.abort()
|
|
732
739
|
})
|
|
733
740
|
</script>
|
|
734
741
|
|
|
@@ -748,7 +755,6 @@ onBeforeUnmount(() => {
|
|
|
748
755
|
:validate-on-rule-change="false"
|
|
749
756
|
label-position="right"
|
|
750
757
|
label-width="112px"
|
|
751
|
-
size="small"
|
|
752
758
|
class="editor-form"
|
|
753
759
|
@submit.prevent
|
|
754
760
|
@keydown.enter.capture="handleEnter"
|
|
@@ -774,46 +780,26 @@ onBeforeUnmount(() => {
|
|
|
774
780
|
</el-form-item>
|
|
775
781
|
|
|
776
782
|
<el-form-item label="落地机构" prop="groundBranch" data-editor-field="groundBranch">
|
|
777
|
-
<
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
>
|
|
793
|
-
<
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
type="button"
|
|
798
|
-
class="client-search-option"
|
|
799
|
-
@click="selectOrganization(option)"
|
|
800
|
-
>
|
|
801
|
-
<span>{{ option.organizationName }}</span>
|
|
802
|
-
<small>{{ option.organizationCode }}</small>
|
|
803
|
-
</button>
|
|
804
|
-
</div>
|
|
805
|
-
<template #reference>
|
|
806
|
-
<el-button
|
|
807
|
-
data-editor-focus="groundBranchSearch"
|
|
808
|
-
:icon="Search"
|
|
809
|
-
:loading="isOrganizationSearching"
|
|
810
|
-
@click="handleOrganizationSearch"
|
|
811
|
-
>
|
|
812
|
-
查询
|
|
813
|
-
</el-button>
|
|
814
|
-
</template>
|
|
815
|
-
</el-popover>
|
|
816
|
-
</div>
|
|
783
|
+
<el-cascader
|
|
784
|
+
v-model="form.groundBranchCode"
|
|
785
|
+
data-editor-focus="groundBranch"
|
|
786
|
+
class="organization-cascader"
|
|
787
|
+
:options="displayedOrganizationCascaderOptions"
|
|
788
|
+
:props="organizationCascaderProps"
|
|
789
|
+
:disabled="isFieldDisabled('groundBranch')"
|
|
790
|
+
:placeholder="isOrganizationTreeLoading ? '正在加载机构…' : '请选择落地机构'"
|
|
791
|
+
:filter-method="filterOrganizationNode"
|
|
792
|
+
:show-all-levels="false"
|
|
793
|
+
clearable
|
|
794
|
+
filterable
|
|
795
|
+
@visible-change="handleOrganizationCascaderVisibleChange"
|
|
796
|
+
@change="handleGroundBranchChange"
|
|
797
|
+
>
|
|
798
|
+
<template #default="{ data }">
|
|
799
|
+
<span>{{ data.organizationName }}</span>
|
|
800
|
+
<small class="organization-cascader-code">{{ data.organizationCode }}</small>
|
|
801
|
+
</template>
|
|
802
|
+
</el-cascader>
|
|
817
803
|
</el-form-item>
|
|
818
804
|
|
|
819
805
|
<el-form-item label="交易日期" prop="tradeDate" data-editor-field="tradeDate">
|
|
@@ -945,10 +931,6 @@ onBeforeUnmount(() => {
|
|
|
945
931
|
/>
|
|
946
932
|
</el-form-item>
|
|
947
933
|
|
|
948
|
-
<el-form-item label="标准名称" class="editor-full-row">
|
|
949
|
-
<el-input v-model="form.standardName" disabled placeholder="由详情接口返回" />
|
|
950
|
-
</el-form-item>
|
|
951
|
-
|
|
952
934
|
</div>
|
|
953
935
|
</section>
|
|
954
936
|
|
|
@@ -1132,6 +1114,7 @@ onBeforeUnmount(() => {
|
|
|
1132
1114
|
}
|
|
1133
1115
|
|
|
1134
1116
|
.editor-form :deep(.el-input),
|
|
1117
|
+
.editor-form :deep(.el-cascader),
|
|
1135
1118
|
.editor-form :deep(.el-select),
|
|
1136
1119
|
.editor-form :deep(.el-date-editor),
|
|
1137
1120
|
.editor-form :deep(.el-input-number) {
|
|
@@ -1248,41 +1231,10 @@ onBeforeUnmount(() => {
|
|
|
1248
1231
|
color: #12805c;
|
|
1249
1232
|
}
|
|
1250
1233
|
|
|
1251
|
-
.
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
overflow-y: auto;
|
|
1255
|
-
flex-direction: column;
|
|
1256
|
-
gap: 5px;
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
.client-search-option {
|
|
1260
|
-
display: flex;
|
|
1261
|
-
align-items: center;
|
|
1262
|
-
justify-content: space-between;
|
|
1263
|
-
width: 100%;
|
|
1264
|
-
gap: 12px;
|
|
1265
|
-
padding: 9px 10px;
|
|
1266
|
-
border: 0;
|
|
1267
|
-
border-radius: 5px;
|
|
1268
|
-
background: #f7f9fc;
|
|
1269
|
-
color: #27364f;
|
|
1270
|
-
cursor: pointer;
|
|
1271
|
-
font: inherit;
|
|
1272
|
-
text-align: left;
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
.client-search-option:hover,
|
|
1276
|
-
.client-search-option:focus-visible {
|
|
1277
|
-
outline: none;
|
|
1278
|
-
background: #eaf2ff;
|
|
1279
|
-
color: var(--editor-blue);
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
.client-search-option small {
|
|
1283
|
-
color: #667085;
|
|
1234
|
+
.organization-cascader-code {
|
|
1235
|
+
margin-left: 8px;
|
|
1236
|
+
color: #7b8798;
|
|
1284
1237
|
font-size: 11px;
|
|
1285
|
-
text-align: right;
|
|
1286
1238
|
}
|
|
1287
1239
|
|
|
1288
1240
|
.editor-actions {
|
|
@@ -136,7 +136,7 @@ onBeforeUnmount(() => {
|
|
|
136
136
|
<!-- @vue-skip -->
|
|
137
137
|
<main class="rmb-forecast-detail-page">
|
|
138
138
|
<section class="detail-page-heading">
|
|
139
|
-
<el-button class="back-button"
|
|
139
|
+
<el-button class="back-button" :icon="ArrowLeft" @click="returnToList">
|
|
140
140
|
返回
|
|
141
141
|
</el-button>
|
|
142
142
|
<div class="heading-copy">
|
|
@@ -151,7 +151,6 @@ onBeforeUnmount(() => {
|
|
|
151
151
|
<span>预报状态</span>
|
|
152
152
|
<el-tag
|
|
153
153
|
:type="forecastStatusTagType(detailRecord.predStatus)"
|
|
154
|
-
size="small"
|
|
155
154
|
effect="light"
|
|
156
155
|
>
|
|
157
156
|
{{ getOptionLabel(forecastStatusOptions, detailRecord.predStatus) }}
|
|
@@ -200,7 +199,7 @@ onBeforeUnmount(() => {
|
|
|
200
199
|
<div class="detail-item" data-detail-field="verifyStatus">
|
|
201
200
|
<dt>核销状态</dt>
|
|
202
201
|
<dd>
|
|
203
|
-
<el-tag :type="verifyStatusTagType(detailRecord.verifyStatus)"
|
|
202
|
+
<el-tag :type="verifyStatusTagType(detailRecord.verifyStatus)" effect="plain">
|
|
204
203
|
{{ getOptionLabel(verifyStatusOptions, detailRecord.verifyStatus) }}
|
|
205
204
|
</el-tag>
|
|
206
205
|
</dd>
|
|
@@ -654,7 +654,6 @@ function handleExport() {
|
|
|
654
654
|
row-key="predRefNo"
|
|
655
655
|
border
|
|
656
656
|
stripe
|
|
657
|
-
:fit="false"
|
|
658
657
|
:height="tableHeight"
|
|
659
658
|
empty-text="暂无人民币头寸预报记录"
|
|
660
659
|
class="forecast-table"
|
|
@@ -1006,18 +1005,7 @@ function handleExport() {
|
|
|
1006
1005
|
}
|
|
1007
1006
|
|
|
1008
1007
|
.forecast-table :deep(.cell) {
|
|
1009
|
-
overflow: visible;
|
|
1010
|
-
text-overflow: clip;
|
|
1011
1008
|
white-space: nowrap;
|
|
1012
|
-
word-break: normal;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
/* 列宽按内容自然展开,超出页面宽度时由表格内部横向滚动承载。 */
|
|
1016
|
-
.forecast-table :deep(.el-table__inner-wrapper > .el-table__body-wrapper .el-table__body),
|
|
1017
|
-
.forecast-table :deep(.el-table__inner-wrapper > .el-table__header-wrapper .el-table__header),
|
|
1018
|
-
.forecast-table :deep(.el-table__inner-wrapper > .el-table__footer-wrapper .el-table__footer) {
|
|
1019
|
-
width: max-content !important;
|
|
1020
|
-
min-width: 100%;
|
|
1021
1009
|
}
|
|
1022
1010
|
|
|
1023
1011
|
.forecast-table :deep(.el-table__row) {
|
|
@@ -132,6 +132,13 @@ export type RmbPositionOrganizationOption = {
|
|
|
132
132
|
organizationName: string
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/** Element Plus Cascader 使用的机构树节点,同时保留提交所需的机构名称和代码。 */
|
|
136
|
+
export type RmbPositionOrganizationCascaderOption = RmbPositionOrganizationOption & {
|
|
137
|
+
value: string
|
|
138
|
+
label: string
|
|
139
|
+
children?: RmbPositionOrganizationCascaderOption[]
|
|
140
|
+
}
|
|
141
|
+
|
|
135
142
|
/** 140101001 需要的旧 JSP/TAM 查询字段。金额字段传元的字符串。 */
|
|
136
143
|
export type RmbPositionForecastQueryParams = {
|
|
137
144
|
busiType: string
|
|
@@ -258,7 +265,6 @@ export type EditorForm = {
|
|
|
258
265
|
customerReferenceSequence: string
|
|
259
266
|
counterpartyName: string
|
|
260
267
|
counterpartyAccount: string
|
|
261
|
-
standardName: string
|
|
262
268
|
businessType: string
|
|
263
269
|
billNo: string
|
|
264
270
|
billDate: string
|
|
@@ -346,7 +352,6 @@ export function createEditorForm(
|
|
|
346
352
|
: '',
|
|
347
353
|
counterpartyName: String(row?.counterpartyName ?? ''),
|
|
348
354
|
counterpartyAccount: String(row?.counterpartyAccount ?? ''),
|
|
349
|
-
standardName: String(row?.standardName ?? ''),
|
|
350
355
|
businessType: String(row?.businessType ?? ''),
|
|
351
356
|
billNo: String(row?.billNo ?? ''),
|
|
352
357
|
billDate: String(row?.billDate ?? ''),
|
|
@@ -390,7 +395,6 @@ export function createEditorFieldPolicy(
|
|
|
390
395
|
payDirection: 'disabled',
|
|
391
396
|
predAmount: editAmountAndDateLocked ? 'disabled' : 'required',
|
|
392
397
|
tradeDate: editAmountAndDateLocked ? 'disabled' : 'required',
|
|
393
|
-
standardName: 'disabled',
|
|
394
398
|
}
|
|
395
399
|
}
|
|
396
400
|
|
|
@@ -418,7 +422,6 @@ export function createEditorFieldPolicy(
|
|
|
418
422
|
payDirection: 'required',
|
|
419
423
|
predAmount: 'required',
|
|
420
424
|
tradeDate: 'required',
|
|
421
|
-
standardName: 'disabled',
|
|
422
425
|
}
|
|
423
426
|
}
|
|
424
427
|
|
|
@@ -836,3 +839,46 @@ export function toRmbPositionOrganizationOptions(
|
|
|
836
839
|
|| option.organizationCode.toLocaleLowerCase('zh-CN').includes(normalizedKeyword)
|
|
837
840
|
)).slice(0, 20)
|
|
838
841
|
}
|
|
842
|
+
|
|
843
|
+
/** 将 UAA 机构树转换为 Cascader 层级选项;无有效机构信息的虚拟根节点会被自动展开。 */
|
|
844
|
+
function createOrganizationCascaderOptions(
|
|
845
|
+
node: unknown,
|
|
846
|
+
seenCodes: Set<string>,
|
|
847
|
+
): RmbPositionOrganizationCascaderOption[] {
|
|
848
|
+
if (Array.isArray(node)) {
|
|
849
|
+
return node.flatMap((item) => createOrganizationCascaderOptions(item, seenCodes))
|
|
850
|
+
}
|
|
851
|
+
if (!node || typeof node !== 'object') return []
|
|
852
|
+
|
|
853
|
+
const current = toProtocolRecord(node)
|
|
854
|
+
const attributes = toProtocolRecord(current.attributes)
|
|
855
|
+
const organizationCode = String(
|
|
856
|
+
attributes.orgNo ?? attributes.orgId ?? current.id ?? '',
|
|
857
|
+
).trim()
|
|
858
|
+
const organizationName = String(attributes.orgName ?? current.text ?? '').trim()
|
|
859
|
+
const children = createOrganizationCascaderOptions(current.children, seenCodes)
|
|
860
|
+
const isSelectableOrganization = Boolean(
|
|
861
|
+
organizationCode
|
|
862
|
+
&& organizationCode !== '-1'
|
|
863
|
+
&& organizationName
|
|
864
|
+
&& !seenCodes.has(organizationCode),
|
|
865
|
+
)
|
|
866
|
+
|
|
867
|
+
if (!isSelectableOrganization) return children
|
|
868
|
+
|
|
869
|
+
seenCodes.add(organizationCode)
|
|
870
|
+
return [{
|
|
871
|
+
value: organizationCode,
|
|
872
|
+
label: organizationName,
|
|
873
|
+
organizationCode,
|
|
874
|
+
organizationName,
|
|
875
|
+
...(children.length > 0 ? { children } : {}),
|
|
876
|
+
}]
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/** 保留机构父子层级供 el-cascader 展示和内置过滤。 */
|
|
880
|
+
export function toRmbPositionOrganizationCascaderOptions(
|
|
881
|
+
tree: unknown,
|
|
882
|
+
): RmbPositionOrganizationCascaderOption[] {
|
|
883
|
+
return createOrganizationCascaderOptions(tree, new Set<string>())
|
|
884
|
+
}
|