Files
UNION_NSI/target/classes/views/platform/data/user/SourceUser.html
T
2026-09-08 19:49:21 +08:00

335 lines
14 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
.sourceCheckBox .el-checkbox__label {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-date-picker
style="width: 150px"
v-model="pageForm.importDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="拉取日期">
</el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 100px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
<el-row class="btn-group tool-button mt5">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 200px;" clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-row>
<div class="btn-group tool-button mt5">
<dict-select v-model="pageForm.personType" style="width: 200px" clearable placeholder="人员类型"
code="UserType"></dict-select>
</div>
<div class="btn-group tool-button mt5">
<dict-select v-model="pageForm.userState" style="width: 200px" clearable placeholder="在职状态"
code="UserState"></dict-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
<span style="color: red">温馨提醒:对接数据方式是拉取</span>
</div>
<div class="pull-right offscreen-right mt5">
<div class="btn-group tool-button" v-show="!selection.length">
<el-button icon="el-icon-delete" type="danger" @click="openDeleteUser">删除
</el-button>
</div>
<div class="btn-group tool-button" v-show="selection.length">
<el-button icon="el-icon-delete" type="danger" :loading="delLoading" @click="doDeleteUsers">删除
</el-button>
</div>
<div class="btn-group tool-button">
<el-button type="primary" :loading="pullLoading" @click="pull">
拉取<i class="el-icon-download"></i>
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" ref="table" @selection-change="handleSelectionChange">
<el-table-column :reserve-selection="true"
type="selection"
width="30">
</el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="70px"></el-table-column>
<el-table-column label="工号" prop="loginname" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="姓名" prop="username" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="性别" prop="sex" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="联系电话" prop="mobile" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="出生日期" prop="birthday" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="身份证" prop="idcard" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="人员类型" prop="personType" header-align="center" sortable
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="在职状态" prop="userState" header-align="center" sortable
align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="所属单位" prop="unitid" header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.unitid"> {{row.unitname}}({{row.unitid}})</span>
</template>
</el-table-column>
<el-table-column label="拉取时间" prop="pullTime" min-width="100px" header-align="center" sortable
align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
min-width="80px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<el-tabs v-model="active">
<el-tab-pane label="个人信息" name="info">
<member ref="memberInfo" source="user_source" :id="userId" view></member>
</el-tab-pane>
</el-tabs>
</template>
</guava>
<el-dialog
title="选择数据源"
:visible.sync="dialogVisible"
width="30%">
<el-checkbox-group class="checkGroup" v-model="sourceTime" style="width: 100%">
<el-row v-for="item in latelyDeleteTimes" style="margin-bottom: 10px" class="sourceCheckBox">
<el-checkbox :key="item.pullTime" style="width: 100%"
:label="item.pullTime" border>
时间:{{item.pullTime}}<span
style="float: right;color: #F56C6C">rows: {{item.num}}</span>
</el-checkbox>
</el-row>
</el-checkbox-group>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" :loading="deleteLoading" @click="doDeleteUser">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dialogVisible: false,
deleteLoading: false,
sourceTime: [],
active: 'info',
pullLoading: false,
pageForm: {
searchName: "username",
},
latelyDeleteTimes: [],
userId: "",
unions: [],
units: [],
active: 'info',
delLoading: false,
selection: [],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
},
methods: {
doDeleteUser() {
if (this.sourceTime.length === 0) {
this.$notify({
title: '警告',
message: '请选择数据源',
type: 'warning'
});
return
}
this.$confirm('是否确定删除用户数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.deleteLoading = true
const resp = await $.post(loc() + '/deleteUser', {sourceTime: JSON.stringify(this.sourceTime)})
this.deleteLoading = false
if (resp.code === 0) {
this.notifySuccess((resp.msg))
this.pageData()
this.getLatelyUpdateTimes()
this.dialogVisible = false
} else {
this.notifyWarning(resp.msg)
}
})
},
async getLatelyUpdateTimes() {
const resp = await $.get("/platform/data/user/update/latelyUpdateTimes")
if(resp.code===0){
this.latelyDeleteTimes = resp.data
}else{
this.notifyWarning(resp.msg)
}
},
openDeleteUser() {
if (!this.latelyDeleteTimes.length) {
this.$notify({
title: '警告',
message: '没有可供删除的数据源',
type: 'warning'
});
return
}
this.sourceTime = []
this.dialogVisible = true
},
handleCommand(command) {
this.pull(command === 'increment')
},
async doDeleteUsers() {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.delLoading = true
const resp = await $.post(loc() + "/delete", {ids: JSON.stringify(this.selection.map(v => v.id))})
this.delLoading = false
if (resp.code === 0) {
this.$refs.table.clearSelection();
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
},
handleSelectionChange(val) {
this.selection = val;
},
pull(isIncrement) {
this.$confirm('确定要从数据中心拉取数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.pullLoading = true
const resp = await $.post(loc() + '/pull')
this.pullLoading = false
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
})
},
doDelete(userId) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/delete", {ids: JSON.stringify([userId])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
openView(userId) {
this.active = 'info'
this.userId = userId
this.$refs.guava.view()
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data.id)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
},
async created() {
this.pageData();
this.units = await getUnits()
await this.getLatelyUpdateTimes()
}
})
</script>
<!--#
}
#-->