|
@@ -0,0 +1,341 @@
|
|
1
|
+<template>
|
|
2
|
+ <a-layout>
|
|
3
|
+ <a-layout-content>
|
|
4
|
+ <a-card title="授权查询" :bordered="false">
|
|
5
|
+ <a-form :model="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
|
|
6
|
+ <a-row :gutter="24">
|
|
7
|
+ <a-col :span="8">
|
|
8
|
+ <a-form-item label="交易行号" required>
|
|
9
|
+ <a-input v-model:value="form.unitNo" @blur="handleUnitNoBlur" :max-length="20" />
|
|
10
|
+ </a-form-item>
|
|
11
|
+ </a-col>
|
|
12
|
+ <a-col :span="8">
|
|
13
|
+ <a-form-item label="操作员号">
|
|
14
|
+ <a-input v-model:value="form.tellerNo" />
|
|
15
|
+ </a-form-item>
|
|
16
|
+ </a-col>
|
|
17
|
+ <a-col :span="8">
|
|
18
|
+ <a-form-item label="授权类型" required>
|
|
19
|
+ <a-select v-model:value="form.authType">
|
|
20
|
+ <a-select-option v-for="item in authTypes" :key="item.value" :value="item.value">
|
|
21
|
+ {{ item.label }}
|
|
22
|
+ </a-select-option>
|
|
23
|
+ </a-select>
|
|
24
|
+ </a-form-item>
|
|
25
|
+ </a-col>
|
|
26
|
+ </a-row>
|
|
27
|
+ <a-row :gutter="24">
|
|
28
|
+ <a-col :span="8">
|
|
29
|
+ <a-form-item label="起始日期" required>
|
|
30
|
+ <a-date-picker v-model:value="form.startDate" style="width: 100%" format="YYYYMMDD"
|
|
31
|
+ value-format="YYYYMMDD" />
|
|
32
|
+ </a-form-item>
|
|
33
|
+ </a-col>
|
|
34
|
+ <a-col :span="8">
|
|
35
|
+ <a-form-item label="终止日期" required>
|
|
36
|
+ <a-date-picker v-model:value="form.endDate" style="width: 100%" format="YYYYMMDD"
|
|
37
|
+ value-format="YYYYMMDD" />
|
|
38
|
+ </a-form-item>
|
|
39
|
+ </a-col>
|
|
40
|
+ <a-col :span="8">
|
|
41
|
+ <a-form-item :wrapper-col="{ offset: 6 }">
|
|
42
|
+ <a-button type="primary" @click="handleQuery">查询</a-button>
|
|
43
|
+ </a-form-item>
|
|
44
|
+ </a-col>
|
|
45
|
+ </a-row>
|
|
46
|
+ </a-form>
|
|
47
|
+ </a-card>
|
|
48
|
+
|
|
49
|
+ <a-card :bordered="false" style="margin-top: 24px">
|
|
50
|
+ <div class="table-container">
|
|
51
|
+ <a-table :data-source="taskList" :columns="visibleColumns" bordered :scroll="{ x: 'max-content' }"
|
|
52
|
+ size="middle">
|
|
53
|
+ <template #bodyCell="{ column, record }">
|
|
54
|
+ <template v-if="column.dataIndex === 'action'">
|
|
55
|
+ <a-button type="link" @click="handlePrint(record)">打印</a-button>
|
|
56
|
+ </template>
|
|
57
|
+ <template v-else-if="column.dataIndex === 'authDate'">
|
|
58
|
+ {{ formatDateTime(record.authDate) }}
|
|
59
|
+ </template>
|
|
60
|
+ </template>
|
|
61
|
+ </a-table>
|
|
62
|
+ </div>
|
|
63
|
+ </a-card>
|
|
64
|
+ </a-layout-content>
|
|
65
|
+ </a-layout>
|
|
66
|
+</template>
|
|
67
|
+
|
|
68
|
+<script lang="ts" setup>
|
|
69
|
+import { ref, reactive, onMounted, computed } from 'vue'
|
|
70
|
+import { message } from 'ant-design-vue'
|
|
71
|
+import dayjs from 'dayjs'
|
|
72
|
+import * as service from '../services';
|
|
73
|
+//import { useUserStore } from '@/stores/user'
|
|
74
|
+
|
|
75
|
+//const userStore = useUserStore()
|
|
76
|
+
|
|
77
|
+// 表单数据
|
|
78
|
+const form = reactive({
|
|
79
|
+ unitNo: '',
|
|
80
|
+ tellerNo: '',
|
|
81
|
+ authType: '',
|
|
82
|
+ startDate: '',
|
|
83
|
+ endDate: ''
|
|
84
|
+})
|
|
85
|
+
|
|
86
|
+// 授权类型选项
|
|
87
|
+const authTypes = ref([
|
|
88
|
+ { value: '0', label: '全部' },
|
|
89
|
+ { value: '1', label: '本地授权' },
|
|
90
|
+ { value: '2', label: '远程授权' },
|
|
91
|
+ { value: '3', label: '预授权' }
|
|
92
|
+])
|
|
93
|
+
|
|
94
|
+// 任务列表
|
|
95
|
+const taskList = ref<any[]>([])
|
|
96
|
+
|
|
97
|
+// 版本控制标志
|
|
98
|
+const flag = ref('')
|
|
99
|
+
|
|
100
|
+// 完整列配置
|
|
101
|
+const allColumns = ref([
|
|
102
|
+ { title: '申请日期', dataIndex: 'applyDate', key: 'applyDate', visible: true },
|
|
103
|
+ { title: '账号', dataIndex: 'account', key: 'account', visible: false },
|
|
104
|
+ { title: '户名', dataIndex: 'accountName', key: 'accountName', visible: false },
|
|
105
|
+ { title: '金额/基数', dataIndex: 'amount', key: 'amount', visible: true },
|
|
106
|
+ { title: '交易', dataIndex: 'trade', key: 'trade', visible: true },
|
|
107
|
+ { title: '申请机构号', dataIndex: 'applyOrgNo', key: 'applyOrgNo', visible: false },
|
|
108
|
+ { title: '申请柜员号', dataIndex: 'applyTellerNo', key: 'applyTellerNo', visible: true },
|
|
109
|
+ { title: '申请柜员名称', dataIndex: 'applyTellerName', key: 'applyTellerName', visible: false },
|
|
110
|
+ { title: '授权日期', dataIndex: 'authDate', key: 'authDate', visible: false },
|
|
111
|
+ { title: '授权机构号', dataIndex: 'authOrgNo', key: 'authOrgNo', visible: false },
|
|
112
|
+ { title: '授权柜员号', dataIndex: 'authTellerNo', key: 'authTellerNo', visible: true },
|
|
113
|
+ { title: '授权柜员名称', dataIndex: 'authTellerName', key: 'authTellerName', visible: false },
|
|
114
|
+ { title: '授权使用时间', dataIndex: 'authUseTime', key: 'authUseTime', visible: true },
|
|
115
|
+ { title: '授权岗位', dataIndex: 'authPost', key: 'authPost', visible: false },
|
|
116
|
+ { title: '授权级别', dataIndex: 'authLevel', key: 'authLevel', visible: false },
|
|
117
|
+ { title: '授权模式', dataIndex: 'authMode', key: 'authMode', visible: false },
|
|
118
|
+ { title: '核心流水', dataIndex: 'coreFlow', key: 'coreFlow', visible: true },
|
|
119
|
+ { title: '核心日期', dataIndex: 'coreDate', key: 'coreDate', visible: false },
|
|
120
|
+ { title: '授权业务描述', dataIndex: 'authBizDesc', key: 'authBizDesc', visible: false },
|
|
121
|
+ { title: '状态', dataIndex: 'status', key: 'status', visible: true },
|
|
122
|
+ { title: '附加信息', dataIndex: 'extraInfo', key: 'extraInfo', visible: false },
|
|
123
|
+ { title: '操作', dataIndex: 'action', key: 'action', visible: true }
|
|
124
|
+])
|
|
125
|
+
|
|
126
|
+// 计算可见列
|
|
127
|
+const visibleColumns = computed(() => {
|
|
128
|
+ return allColumns.value.filter(col => col.visible)
|
|
129
|
+})
|
|
130
|
+
|
|
131
|
+// 初始化页面
|
|
132
|
+onMounted(() => {
|
|
133
|
+ initPage()
|
|
134
|
+ // 获取版本配置
|
|
135
|
+ getSystemConfig().then(config => {
|
|
136
|
+ flag.value = config
|
|
137
|
+ console.log("版本号", flag.value);
|
|
138
|
+ updateColumnVisibility()
|
|
139
|
+ })
|
|
140
|
+})
|
|
141
|
+
|
|
142
|
+// 初始化页面数据
|
|
143
|
+const initPage = () => {
|
|
144
|
+ form.authType = '0'
|
|
145
|
+ form.startDate = dayjs().format('YYYYMMDD')
|
|
146
|
+ form.endDate = dayjs().format('YYYYMMDD')
|
|
147
|
+ //form.unitNo = userStore.kinbrNo || ''
|
|
148
|
+}
|
|
149
|
+
|
|
150
|
+// 更新列可见性
|
|
151
|
+const updateColumnVisibility = () => {
|
|
152
|
+ if (['V10', 'V13', 'V18', 'V21', 'V22', 'V23', 'V24'].includes(flag.value)) {
|
|
153
|
+ allColumns.value.forEach(col => {
|
|
154
|
+ if (['account', 'accountName', 'applyOrgNo', 'applyTellerName', 'authDate',
|
|
155
|
+ 'authOrgNo', 'authTellerName', 'authPost', 'authLevel', 'authMode',
|
|
156
|
+ 'coreDate', 'authBizDesc', 'extraInfo'].includes(col.key)) {
|
|
157
|
+ col.visible = false
|
|
158
|
+ }
|
|
159
|
+ })
|
|
160
|
+ }
|
|
161
|
+}
|
|
162
|
+
|
|
163
|
+// 绑定数据
|
|
164
|
+const bindGrid = async () => {
|
|
165
|
+ const startTime = form.startDate + '000000'
|
|
166
|
+ const endTime = form.endDate + '235959'
|
|
167
|
+
|
|
168
|
+ try {
|
|
169
|
+ const data = await getAuthRecords(form.unitNo, form.tellerNo, form.authType, startTime, endTime)
|
|
170
|
+ if (data) {
|
|
171
|
+ taskList.value = processData(data)
|
|
172
|
+ }
|
|
173
|
+ } catch (error) {
|
|
174
|
+ message.error('获取授权记录失败')
|
|
175
|
+ }
|
|
176
|
+}
|
|
177
|
+
|
|
178
|
+// 处理数据
|
|
179
|
+const processData = (data: string[]) => {
|
|
180
|
+ if (!data || data.length === 0) return []
|
|
181
|
+
|
|
182
|
+ // 针对返回的数据做排序
|
|
183
|
+ let list = [...data]
|
|
184
|
+
|
|
185
|
+ if (flag.value !== "V10" && flag.value !== "V18") {
|
|
186
|
+ list.sort((x, y) => {
|
|
187
|
+ try {
|
|
188
|
+ const tellerX = x.split('|')[6]
|
|
189
|
+ const tellerY = y.split('|')[6]
|
|
190
|
+ return tellerX.localeCompare(tellerY)
|
|
191
|
+ } catch {
|
|
192
|
+ return -1
|
|
193
|
+ }
|
|
194
|
+ })
|
|
195
|
+ } else {
|
|
196
|
+ // 齐丰-申请柜员号排序后,再以授权时间进行排序
|
|
197
|
+ list = list
|
|
198
|
+ .map(item => ({ item, parts: item.split('|') }))
|
|
199
|
+ .sort((a, b) => {
|
|
200
|
+ const tellerCompare = a.parts[6].localeCompare(b.parts[6])
|
|
201
|
+ return tellerCompare !== 0 ? tellerCompare : a.parts[8].localeCompare(b.parts[8])
|
|
202
|
+ })
|
|
203
|
+ .map(({ item }) => item)
|
|
204
|
+ }
|
|
205
|
+
|
|
206
|
+ const processedData: any[] = []
|
|
207
|
+ let prevItem: string[] | null = null
|
|
208
|
+
|
|
209
|
+ list.forEach(item => {
|
|
210
|
+ if (!item) return
|
|
211
|
+
|
|
212
|
+ const currentItem = item.replace(/null/g, '').split('|')
|
|
213
|
+
|
|
214
|
+ if (!prevItem) {
|
|
215
|
+ prevItem = currentItem
|
|
216
|
+ return
|
|
217
|
+ }
|
|
218
|
+
|
|
219
|
+ // 检查是否需要合并
|
|
220
|
+ if (currentItem[0] === prevItem[0] && currentItem[16] === prevItem[16]) {
|
|
221
|
+ // 合并授权岗位
|
|
222
|
+ if (currentItem[13] && currentItem[13] !== prevItem[13]) {
|
|
223
|
+ prevItem[13] = prevItem[13] ? `${prevItem[13]}/${currentItem[13]}` : currentItem[13]
|
|
224
|
+ }
|
|
225
|
+ // 更新附加信息
|
|
226
|
+ if (currentItem[20]) {
|
|
227
|
+ prevItem[20] = currentItem[20]
|
|
228
|
+ }
|
|
229
|
+ } else {
|
|
230
|
+ // 添加前一项到结果
|
|
231
|
+ processedData.push(createRecord(prevItem))
|
|
232
|
+ prevItem = currentItem
|
|
233
|
+ }
|
|
234
|
+ })
|
|
235
|
+
|
|
236
|
+ // 添加最后一项
|
|
237
|
+ if (prevItem) {
|
|
238
|
+ processedData.push(createRecord(prevItem))
|
|
239
|
+ }
|
|
240
|
+
|
|
241
|
+ return processedData
|
|
242
|
+}
|
|
243
|
+
|
|
244
|
+// 创建记录对象
|
|
245
|
+const createRecord = (parts: string[]) => {
|
|
246
|
+ return {
|
|
247
|
+ applyDate: parts[0],
|
|
248
|
+ account: parts[1],
|
|
249
|
+ accountName: parts[2],
|
|
250
|
+ amount: parts[3],
|
|
251
|
+ trade: parts[4],
|
|
252
|
+ applyOrgNo: parts[5],
|
|
253
|
+ applyTellerNo: parts[6],
|
|
254
|
+ applyTellerName: parts[7],
|
|
255
|
+ authDate: parts[8],
|
|
256
|
+ authOrgNo: parts[9],
|
|
257
|
+ authTellerNo: parts[10],
|
|
258
|
+ authTellerName: parts[11],
|
|
259
|
+ authUseTime: parts[12],
|
|
260
|
+ authPost: parts[13],
|
|
261
|
+ authLevel: parts[14],
|
|
262
|
+ authMode: parts[15],
|
|
263
|
+ coreFlow: parts[16],
|
|
264
|
+ coreDate: parts[17],
|
|
265
|
+ authBizDesc: parts[18],
|
|
266
|
+ status: parts[19],
|
|
267
|
+ extraInfo: parts[20]
|
|
268
|
+ }
|
|
269
|
+}
|
|
270
|
+
|
|
271
|
+// 查询按钮点击事件
|
|
272
|
+const handleQuery = () => {
|
|
273
|
+ alert("提交成功")
|
|
274
|
+ if (parseInt(form.startDate) > parseInt(form.endDate)) {
|
|
275
|
+ message.error('终止日期不能小于起始日期!')
|
|
276
|
+ return
|
|
277
|
+ }
|
|
278
|
+ bindGrid()
|
|
279
|
+}
|
|
280
|
+
|
|
281
|
+// 交易行号失去焦点事件
|
|
282
|
+const handleUnitNoBlur = async () => {
|
|
283
|
+ const isValid = await validateUnitNo(form.unitNo)
|
|
284
|
+ if (!isValid) {
|
|
285
|
+ message.error('该法人无此机构请重新输入!')
|
|
286
|
+ }
|
|
287
|
+}
|
|
288
|
+
|
|
289
|
+// 打印按钮点击事件
|
|
290
|
+const handlePrint = (record: any) => {
|
|
291
|
+ printRecord(record)
|
|
292
|
+}
|
|
293
|
+
|
|
294
|
+// 获取系统配置
|
|
295
|
+const getSystemConfig = async (): Promise<string> => {
|
|
296
|
+ return service.TT_SYSCONFIG_GetConfigValueByConfigID("123")
|
|
297
|
+}
|
|
298
|
+
|
|
299
|
+// 获取授权记录
|
|
300
|
+const getAuthRecords = async (unitNo: string, tellerNo: string, authType: string, startTime: string, endTime: string): Promise<string[]> => {
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+ return []
|
|
305
|
+}
|
|
306
|
+
|
|
307
|
+// 验证交易行号
|
|
308
|
+const validateUnitNo = async (unitNo: string): Promise<boolean> => {
|
|
309
|
+ // 实际验证逻辑
|
|
310
|
+ return true
|
|
311
|
+}
|
|
312
|
+
|
|
313
|
+// 打印记录
|
|
314
|
+const printRecord = (record: any) => {
|
|
315
|
+ // 实际打印逻辑
|
|
316
|
+ console.log('打印记录:', record)
|
|
317
|
+}
|
|
318
|
+
|
|
319
|
+// 格式化日期时间
|
|
320
|
+const formatDateTime = (dateTime: string) => {
|
|
321
|
+ if (dateTime && dateTime.length === 14) {
|
|
322
|
+ return dayjs(dateTime).format('YYYY-MM-DD HH:mm:ss')
|
|
323
|
+ }
|
|
324
|
+ return dateTime
|
|
325
|
+}
|
|
326
|
+</script>
|
|
327
|
+
|
|
328
|
+<style scoped>
|
|
329
|
+.ant-card {
|
|
330
|
+ margin-bottom: 24px;
|
|
331
|
+}
|
|
332
|
+
|
|
333
|
+.table-container {
|
|
334
|
+ width: 100%;
|
|
335
|
+ overflow-x: auto;
|
|
336
|
+}
|
|
337
|
+
|
|
338
|
+:deep(.ant-table) {
|
|
339
|
+ min-width: 1800px;
|
|
340
|
+}
|
|
341
|
+</style>
|