This commit is contained in:
wuweihua
2026-11-11 14:50:58 +08:00
2 changed files with 65 additions and 1 deletions
+50 -1
View File
@@ -154,6 +154,43 @@
</template>
</el-dialog>
<!-- TMS 用户同步结果:展示本次新增用户及同步统计 -->
<el-dialog title="TMS 用户同步结果" v-model="syncResultVisible" width="980px" append-to-body>
<el-descriptions :column="3" border size="small" class="sync-result-summary">
<el-descriptions-item label="TMS员工数">{{ syncResult.total }}</el-descriptions-item>
<el-descriptions-item label="已存在用户">{{ syncResult.existCount }}</el-descriptions-item>
<el-descriptions-item label="本次新增">{{ syncResult.insertCount }}</el-descriptions-item>
<el-descriptions-item label="跳过记录">{{ syncResult.skipCount }}</el-descriptions-item>
<el-descriptions-item label="部门未匹配">{{ syncResult.orgFallbackCount }}</el-descriptions-item>
<el-descriptions-item label="耗时">{{ syncResult.costMs }} ms</el-descriptions-item>
</el-descriptions>
<el-alert
class="sync-result-tip"
title="下表展示本次新建的用户;已存在和跳过的记录可查看上方统计。"
type="info"
:closable="false"
show-icon
/>
<el-table :data="syncResult.createdUsers" border stripe max-height="480">
<el-table-column prop="userName" label="工号" min-width="140" show-overflow-tooltip />
<el-table-column prop="nickName" label="用户昵称" min-width="140" show-overflow-tooltip />
<el-table-column prop="deptName" label="归属部门" min-width="180" show-overflow-tooltip />
<el-table-column prop="phonenumber" label="手机号码" min-width="130" />
<el-table-column label="状态" width="100" align="center">
<template #default="{ row }">
<el-tag :type="row.status === '0' ? 'success' : 'info'">
{{ row.status === '0' ? '正常' : '停用' }}
</el-tag>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="syncResultVisible = false">关 闭</el-button>
</div>
</template>
</el-dialog>
<!-- 用户详情抽屉 -->
<user-view-drawer ref="userViewRef" />
<!-- 用户导入对话框 -->
@@ -179,6 +216,8 @@ const { sys_normal_disable, sys_user_sex } = useDict("sys_normal_disable", "sys_
const tableRef = ref()
const syncLoading = ref(false)
const syncResultVisible = ref(false)
const syncResult = ref({ total: 0, existCount: 0, insertCount: 0, skipCount: 0, orgFallbackCount: 0, costMs: 0, createdUsers: [] })
const open = ref(false)
const title = ref("")
const deptOptions = ref(undefined)
@@ -276,7 +315,17 @@ function handleSyncFromOracle() {
syncLoading.value = true
return syncUsersFromOracle()
}).then(res => {
proxy.$modal.msgSuccess(res.msg || '同步成功')
const result = res.data || {}
syncResult.value = {
total: result.total || 0,
existCount: result.existCount || 0,
insertCount: result.insertCount || 0,
skipCount: result.skipCount || 0,
orgFallbackCount: result.orgFallbackCount || 0,
costMs: result.costMs || 0,
createdUsers: Array.isArray(result.createdUsers) ? result.createdUsers : []
}
syncResultVisible.value = true
getDeptTree()
tableRef.value.refresh()
}).catch(() => {}).finally(() => {