自动同步人员部门信息
This commit is contained in:
@@ -38,3 +38,11 @@ export function bindLbDepartmentUserParent(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function syncLbDepartmentUserFromDailyUserTrade(params) {
|
||||
return request({
|
||||
url: '/lbDepartmentUser/syncFromDailyUserTrade',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,6 +23,23 @@
|
||||
|
||||
<el-card class="action-container" shadow="never">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-date-picker
|
||||
v-model="syncDateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="同步开始日期"
|
||||
end-placeholder="同步结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 280px; margin-left: 12px"
|
||||
/>
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-refresh"
|
||||
:loading="syncLoading"
|
||||
@click="handleSyncFromDailyUserTrade"
|
||||
>
|
||||
自动同步
|
||||
</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card class="table-container" shadow="never">
|
||||
@@ -196,6 +213,7 @@ import {
|
||||
bindLbDepartmentUserParent,
|
||||
deleteLbDepartmentUser,
|
||||
getLbDepartmentUserList,
|
||||
syncLbDepartmentUserFromDailyUserTrade,
|
||||
updateLbDepartmentUser
|
||||
} from '@/api/lb-department-user'
|
||||
|
||||
@@ -205,6 +223,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
syncLoading: false,
|
||||
parentBindLoading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
@@ -218,6 +237,7 @@ export default {
|
||||
parentTotal: 0,
|
||||
parentSelectedRows: [],
|
||||
lastSelectedParentRow: null,
|
||||
syncDateRange: [],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
@@ -326,6 +346,31 @@ export default {
|
||||
this.$refs.dataForm && this.$refs.dataForm.clearValidate()
|
||||
})
|
||||
},
|
||||
handleSyncFromDailyUserTrade() {
|
||||
if (!Array.isArray(this.syncDateRange) || this.syncDateRange.length !== 2) {
|
||||
this.$message.warning('请选择同步开始日期和结束日期')
|
||||
return
|
||||
}
|
||||
const [startDate, endDate] = this.syncDateRange
|
||||
if (!startDate || !endDate) {
|
||||
this.$message.warning('请选择同步开始日期和结束日期')
|
||||
return
|
||||
}
|
||||
this.syncLoading = true
|
||||
syncLbDepartmentUserFromDailyUserTrade({ startDate, endDate })
|
||||
.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.syncLoading = false
|
||||
})
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.dialogTitle = '编辑部门人员'
|
||||
this.isEdit = true
|
||||
|
||||
Reference in New Issue
Block a user