构建父链
This commit is contained in:
@@ -46,3 +46,11 @@ export function syncLbDepartmentUserFromDailyUserTrade(params) {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function syncLbDepartmentUserFromLbUser(params) {
|
||||||
|
return request({
|
||||||
|
url: '/lbDepartmentUser/syncFromLbUser',
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,15 @@
|
|||||||
>
|
>
|
||||||
自动同步
|
自动同步
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-connection"
|
||||||
|
:loading="syncParentChainLoading"
|
||||||
|
style="margin-left: 12px"
|
||||||
|
@click="handleSyncFromLbUser"
|
||||||
|
>
|
||||||
|
构建父链
|
||||||
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="table-container" shadow="never">
|
<el-card class="table-container" shadow="never">
|
||||||
@@ -53,12 +62,14 @@
|
|||||||
{{ scope.row.parentName || scope.row.parentUserName || '-' }}
|
{{ scope.row.parentName || scope.row.parentUserName || '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="地址" prop="address" min-width="160" show-overflow-tooltip />
|
<el-table-column label="组织链" prop="orgChain" min-width="220" show-overflow-tooltip>
|
||||||
<el-table-column label="行业" prop="industry" min-width="120" />
|
|
||||||
<el-table-column label="加入日期" prop="joinDate" min-width="120" />
|
|
||||||
<el-table-column label="创建时间" prop="createTime" min-width="170">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ formatDateTime(scope.row.createTime) }}
|
{{ scope.row.orgChain || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="加入日期" prop="joinDate" min-width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.joinDate || '-' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="更新时间" prop="updateTime" min-width="170">
|
<el-table-column label="更新时间" prop="updateTime" min-width="170">
|
||||||
@@ -214,8 +225,10 @@ import {
|
|||||||
deleteLbDepartmentUser,
|
deleteLbDepartmentUser,
|
||||||
getLbDepartmentUserList,
|
getLbDepartmentUserList,
|
||||||
syncLbDepartmentUserFromDailyUserTrade,
|
syncLbDepartmentUserFromDailyUserTrade,
|
||||||
|
syncLbDepartmentUserFromLbUser,
|
||||||
updateLbDepartmentUser
|
updateLbDepartmentUser
|
||||||
} from '@/api/lb-department-user'
|
} from '@/api/lb-department-user'
|
||||||
|
import { getBusinessHeaders } from '@/utils/business-headers'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LbDepartmentUser',
|
name: 'LbDepartmentUser',
|
||||||
@@ -224,6 +237,7 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
syncLoading: false,
|
syncLoading: false,
|
||||||
|
syncParentChainLoading: false,
|
||||||
parentBindLoading: false,
|
parentBindLoading: false,
|
||||||
list: [],
|
list: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
@@ -346,6 +360,11 @@ export default {
|
|||||||
this.$refs.dataForm && this.$refs.dataForm.clearValidate()
|
this.$refs.dataForm && this.$refs.dataForm.clearValidate()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getTenantIdFromBusinessHeaders() {
|
||||||
|
const headers = getBusinessHeaders()
|
||||||
|
const value = headers && headers['X-Tenant-Id']
|
||||||
|
return value ? String(value).trim() : ''
|
||||||
|
},
|
||||||
handleSyncFromDailyUserTrade() {
|
handleSyncFromDailyUserTrade() {
|
||||||
if (!Array.isArray(this.syncDateRange) || this.syncDateRange.length !== 2) {
|
if (!Array.isArray(this.syncDateRange) || this.syncDateRange.length !== 2) {
|
||||||
this.$message.warning('请选择同步开始日期和结束日期')
|
this.$message.warning('请选择同步开始日期和结束日期')
|
||||||
@@ -371,6 +390,27 @@ export default {
|
|||||||
this.syncLoading = false
|
this.syncLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleSyncFromLbUser() {
|
||||||
|
const tenantId = this.getTenantIdFromBusinessHeaders()
|
||||||
|
if (!tenantId) {
|
||||||
|
this.$message.error('未获取到租户ID,请先登录或配置业务请求头中的租户')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.syncParentChainLoading = true
|
||||||
|
syncLbDepartmentUserFromLbUser({ tenantId })
|
||||||
|
.then((res) => {
|
||||||
|
const isSuccess = res && (res.success === true || res.code === 200 || res.code === 20000)
|
||||||
|
if (!isSuccess) {
|
||||||
|
this.$message.error((res && res.message) || '构建父链失败')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$message.success((res && res.message) || '构建父链成功')
|
||||||
|
this.fetchList()
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.syncParentChainLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
handleEdit(row) {
|
handleEdit(row) {
|
||||||
this.dialogTitle = '编辑部门人员'
|
this.dialogTitle = '编辑部门人员'
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
|
|||||||
Reference in New Issue
Block a user