first commit
This commit is contained in:
@@ -0,0 +1,273 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava" padding="0 5%">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="pull-right offscreen-right mt5">
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="transUnit2">全部设为二级单位
|
||||
</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" 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>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
active: 'info',
|
||||
pullLoading: false,
|
||||
pageForm: {
|
||||
searchName: "username",
|
||||
},
|
||||
|
||||
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: {
|
||||
actionDropdownCommand(command) {
|
||||
const {action} = command
|
||||
if (action === 'transUnit2') {
|
||||
this.transUnit2()
|
||||
}
|
||||
},
|
||||
|
||||
transUnit2() {
|
||||
this.$confirm('是否需要将所有用户的所属单位转化为其所在的二级单位?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post(loc() + '/transUnit2')
|
||||
requestLaterMsgFun(this, resp, () => {
|
||||
this.pageData()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
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))})
|
||||
requestLaterMsgFun(this, resp, async () => {
|
||||
this.$refs.table.clearSelection();
|
||||
this.doSearch()
|
||||
}, null, () => {
|
||||
this.delLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val;
|
||||
},
|
||||
pull() {
|
||||
this.$confirm('确定要从数据中心拉取数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.pullLoading = true
|
||||
const resp = await $.post(loc() + '/pull')
|
||||
requestLaterMsgFun(this, resp, () => {
|
||||
this.pageData()
|
||||
}, null, () => {
|
||||
this.pullLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
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])});
|
||||
|
||||
requestLaterMsgFun(this, resp, async () => {
|
||||
this.pageData()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
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()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user