This commit is contained in:
2026-09-09 16:16:22 +08:00
parent ebffbab428
commit ba3a985c40
3749 changed files with 29 additions and 608551 deletions
@@ -1,486 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__body {
height: calc(100% - 40px);
}
.el-transfer-panel__list {
height: 100%;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input
@input="(val)=>{$refs.tree.filter(val)}"
placeholder="输入关键字进行查找" clearable
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" v-loading="treeLoading" node-key="id"
:props="{label:'groupName'}"
:expand-on-click-node="false"
:default-expanded-keys="['1']"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;
{{ data.label }}
</div>
<div v-if="node.level==2" style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0 10px">
<el-tabs v-model="tabActive" @tab-click="doSearch" type="card" style="box-shadow: none">
<el-tab-pane v-if="currentNode.level===1" label="小组信息" name="groupInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="组成单位"
name="componentUnit"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="小组人员" name="userInfo"></el-tab-pane>
</el-tabs>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button v-if="tabActive==='groupInfo' && ${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}" type="primary" icon="el-icon-plus"
@click="openAddGroup">新增小组
</el-button>
<el-button v-if="tabActive==='componentUnit' && ${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}" type="primary" icon="el-icon-plus"
@click="openAddComponentUnit">新增组成单位
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div id="secondaryTableWrap" data-bottom="80">
<el-table :data="groupTableData" height="100%" v-if="tabActive==='groupInfo'">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="groupName" label="小组名称"></el-table-column>
<el-table-column prop="groupCode" label="小组代码"></el-table-column>
<el-table-column label="操作" width="200px" v-if="${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}">
<template scope="{row}">
<el-button size="mini"
@click="groupDialogVisible=true;groupFormData={...row}">
编辑
</el-button>
<el-button size="mini" type="danger" @click="deleteGroup(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="componentUnitTableData" height="100%"
v-else-if="tabActive==='componentUnit'">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="name" label="单位名称"></el-table-column>
<el-table-column prop="unitcode" label="单位代码"></el-table-column>
</el-table>
<el-table :data="userTableData" height="100%" v-else-if="tabActive==='userInfo'">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="unitname" label="所属单位"
show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会"
show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="身份"></el-table-column>
<el-table-column label="操作" width="100px" v-if="${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')}">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action:setGroupLeader,value:row}"
v-if="row.roleCode==null">
设为组长
</el-dropdown-item>
<el-dropdown-item :command="{action:removeGroupLeader,value:row}"
v-if="row.roleCode!=null">
取消组长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="(val)=>{pageForm.pageSize=val;pageData()}"
@current-change="(val)=>{pageForm.pageNumber=val;pageData()}"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</guava>
<el-dialog :visible.sync="groupDialogVisible" title="小组">
<el-form :model="groupFormData" label-width="120px" ref="form">
<el-form-item label="小组名称" prop="groupName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="groupFormData.groupName" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="小组代码" prop="groupCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="groupFormData.groupCode"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="groupDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetGroup">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="componentUnitDialogVisible" title="组成单位">
<el-transfer v-model="groupComponentUnit" :data="groupComponentUnitLeft"
ref="componentUnitTransfer"
:props="{
key: 'id',
label: 'name'
}"
></el-transfer>
<span slot="footer" class="dialog-footer">
<el-button @click="componentUnitDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetComponentUnit">确定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
treeLoading: false,
treeData: [],
filterText: null,
currentData: null,
currentNode: {level: 1},
tabActive: 'groupInfo',
//小组table
groupTableData: [],
groupDialogVisible: false,
groupFormData: {
groupName: null,
groupCode: null,
id: null
},
//组成单位table
componentUnitTableData: [],
componentUnitDialogVisible: false,
groupComponentUnit: [],
groupComponentUnitLeft: [],
userTableData: []
}
},
methods: {
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
if (this.tabActive === 'groupInfo') {
this.groupPageData()
} else if (this.tabActive === 'componentUnit') {
this.componentUnitPageData()
} else if (this.tabActive === 'userInfo') {
this.getGroupUser()
}
},
handleNodeClick(data, node) {
this.currentData = data
this.currentNode = node
if (node.level === 1) {
this.tabActive = 'groupInfo'
this.groupPageData()
} else if (node.level === 2) {
this.tabActive = 'componentUnit'
this.componentUnitPageData()
}
},
filterNode(value, data, node) {
if (!value) return true
return data.label.includes(value)
},
//左侧树数据
async getTree() {
const resp = await $.post(loc() + '/getTree')
if (resp.code === 0) {
this.treeData = resp.data
if (this.$refs.tree && this.$refs.tree.root.childNodes) {
this.currentNode = this.$refs.tree.root.childNodes[0]
}
} else {
this.notifyWarning(resp.msg)
}
},
//打开新增小组模态框
openAddGroup() {
this.groupDialogVisible = true
this.$nextTick(() => {
this.groupFormData = {
groupName: null,
groupCode: null,
id: null
}
this.$refs.form.resetFields()
})
},
//新增、编辑小组
async doSetGroup() {
const resp = await $.post(loc() + '/doSetGroup', this.groupFormData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.groupDialogVisible = false
this.getTree()
this.groupPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//小组分页数据
async groupPageData() {
const resp = await $.post(loc() + '/groupPageData', this.pageForm)
if (resp.code === 0) {
this.groupTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
},
//删除小组
deleteGroup(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deleteGroup', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTree()
this.groupPageData()
} else {
this.notifyWarning(resp.msg)
}
})
},
//组成单位分页数据
async componentUnitPageData() {
const resp = await $.post(loc() + '/componentUnitPageData', {
...this.pageForm,
groupId: this.currentData.id
})
if (resp.code === 0) {
this.componentUnitTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
},
openAddComponentUnit() {
this.componentUnitDialogVisible = true
const groupId = this.currentData.id
this.getNotSetUnit(groupId)
this.getGroupComponentUnit(groupId)
if (this.$refs.componentUnitTransfer) {
this.$refs.componentUnitTransfer.clearQuery('left')
this.$refs.componentUnitTransfer.clearQuery('right')
}
},
//小组组成单位
async getGroupComponentUnit(groupId) {
const resp = await $.post(loc() + '/groupComponentUnit', {groupId})
if (resp.code === 0) {
this.groupComponentUnit = resp.data
}
},
async getNotSetUnit(groupId) {
const resp = await $.post(loc() + '/notSetUnit', {groupId})
if (resp.code === 0) {
this.groupComponentUnitLeft = resp.data
}
},
async doSetComponentUnit() {
const params = {
groupId: this.currentData.id,
units: JSON.stringify(this.groupComponentUnit)
}
const resp = await $.post(loc() + '/doSetComponentUnit', params)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.componentUnitDialogVisible = false
this.componentUnitPageData()
} else {
this.notifyWarning(resp.msg)
}
},
async getGroupUser() {
const resp = await $.post(loc() + '/groupUser', {...this.pageForm, groupId: this.currentData.id})
if (resp.code === 0) {
this.userTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.notifyWarning(resp.msg)
}
},
setGroupLeader(user) {
this.$confirm('您确定要将' + user.username + '设为小组组长吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/setGroupLeader', {
userId: user.id,
groupId: this.currentData.id
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getGroupUser()
} else {
this.notifyWarning(resp.msg)
}
})
},
removeGroupLeader(user) {
this.$confirm('您确定要将' + user.username + '设为小组组员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/removeGroupLeader', {
userId: user.id,
groupId: this.currentData.id
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getGroupUser()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async mounted() {
//动态改变table高度
await httpVueLoader('/components/plugins/Guava.vue', 'Guava')()
await httpVueLoader('/components/plugins/TreeLayout.vue', 'tree-layout')()
calcTableHeight(['secondaryTableWrap'])
window.onresize = () => {
calcTableHeight(['secondaryTableWrap'])
}
},
created() {
this.getTree()
this.groupPageData()
console.log(${@shiro.hasAnyRoles('ltbzr,ltbfzr,ltbms,sysadmin')})
}
})
</script>
<!--#
}
#-->
@@ -1,99 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">所属小组:</div>
<div class="search-item-option">
<el-select placeholder="所属小组" v-model="retiredGroupId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in retiredGroupOption" :label="item.groupName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="getData" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="statisticsData"
header-align="center"
align="center"
show-summary
:summary-method="summaryMethod"
border
highlight-current-row>
<el-table-column label="序号" type="index" width="70px"></el-table-column>
<el-table-column label="小组名称" prop="groupName"></el-table-column>
<el-table-column label="小组代码" prop="groupCode" sortable></el-table-column>
<el-table-column label="组成单位" prop="componentUnit"></el-table-column>
<el-table-column label="人数" prop="retireCount" sortable></el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
data() {
return {
retiredGroupId: null,
statisticsData: [],
retiredGroupOption: []
}
},
methods: {
async getData() {
const resp = await $.post(loc() + '/data', {retiredGroupId: this.retiredGroupId})
if (resp.code === 0) {
this.statisticsData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
summaryMethod(param) {
const {columns, data} = param
let sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'retireCount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
})
return sums
},
async getRetiredGroup() {
const resp = await $.post(loc() + '/retiredGroup')
this.retiredGroupOption = resp.data
},
},
created() {
this.getData()
this.getRetiredGroup()
}
})
</script>
<!--#
}
#-->
@@ -1,577 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__body {
height: calc(100% - 40px);
}
.el-transfer-panel__list {
height: 100%;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input
@input="(val)=>{$refs.tree.filter(val)}"
placeholder="输入关键字进行查找" clearable
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" v-loading="treeLoading" node-key="id"
:props="{label:'partyBranchName'}"
:expand-on-click-node="false"
:default-expanded-keys="['1']"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;
{{ data.label }}
</div>
<div v-if="node.level==2" style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0 10px">
<el-tabs v-model="tabActive" @tab-click="doSearch" type="card" style="box-shadow: none">
<el-tab-pane v-if="currentNode.level===1" label="党支部信息" name="groupInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="党支部人员" name="userInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="党支部委员会"
name="committee"></el-tab-pane>
</el-tabs>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button v-if="tabActive==='groupInfo'" type="primary" icon="el-icon-plus"
@click="openAddPartyBranch">新增党支部
</el-button>
<el-button v-if="tabActive==='userInfo'" type="primary" icon="el-icon-plus"
@click="openAddUser">新增党支部人员
</el-button>
<el-button v-if="tabActive==='committee'" type="primary" icon="el-icon-plus"
@click="openAddCommittee">新增支部委员会人员
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div id="secondaryTableWrap" data-bottom="80">
<el-table :data="partyBranchTableData" height="100%" v-if="tabActive==='groupInfo'"
key="partyBranchTable">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="partyBranchName" label="党支部名称"></el-table-column>
<el-table-column prop="partyBranchCode" label="党支部代码"></el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button size="mini"
@click="partyBranchDialogVisible=true;partyBranchFormData={...row}">
编辑
</el-button>
<el-button size="mini" type="danger" @click="deleteGroup(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="userTableData" height="100%" v-else-if="tabActive==='userInfo'"
key="userTable">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="unitname" label="所属单位"
show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" type="danger" @click="deleteUser(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="committeeTableData" height="100%" v-else-if="tabActive==='committee'"
key="committeeTable">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="roleName" label="身份"></el-table-column>
<el-table-column label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" type="danger" @click="deleteCommittee(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="(val)=>{pageForm.pageSize=val;pageData()}"
@current-change="(val)=>{pageForm.pageNumber=val;pageData()}"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</guava>
<el-dialog :visible.sync="partyBranchDialogVisible" title="党支部">
<el-form :model="partyBranchFormData" label-width="120px" ref="form">
<el-form-item label="党支部名称" prop="partyBranchName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="partyBranchFormData.partyBranchName" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="党支部代码" prop="partyBranchCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="partyBranchFormData.partyBranchCode"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="partyBranchDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetPartyBranch">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="人员">
<el-form :model="partyBranchUserFormData" label-width="120px" ref="partyBranchUserForm">
<el-form-item label="人员" prop="userIds"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchUserFormData.userIds"
style="width: 100%"
multiple
filterable
remote
reserve-keyword
placeholder="请输入姓名或者工号查询"
:remote-method="queryNonSetUser">
<el-option
v-for="item in nonSetUserOptions"
:key="item.id"
:label="item.username"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="userDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doAddBranchPartyUser">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="committeeDialogVisible" title="支部委员会">
<el-form :model="partyBranchCommitteeFormData" label-width="120px" ref="partyBranchCommitteeForm">
<el-form-item label="人员" prop="userId"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.userId"
style="width: 100%"
filterable
remote
placeholder="请输入姓名或者工号查询"
:remote-method="queryUserByPartyBranchId">
<el-option
v-for="item in committeeUserOptions"
:key="item.id"
:label="item.username"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份" prop="roleCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.roleCode">
<el-option v-for="item in retiredPartyBranchCommitteeRoleOptions"
:label="item.name"
:value="item.code"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="committeeDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doAddCommitteeUser">确定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
treeLoading: false,
treeData: [],
filterText: null,
currentData: null,
currentNode: {level: 1},
tabActive: 'groupInfo',
//党支部table
partyBranchTableData: [],
partyBranchDialogVisible: false,
partyBranchFormData: {
partyBranchName: null,
partyBranchCode: null,
id: null
},
partyBranchUserFormData: {
userIds: []
},
userTableData: [],
userDialogVisible: false,
nonSetUserOptions: [],
//支部委员会信息
retiredPartyBranchCommitteeRoleOptions: [],
committeeDialogVisible: false,
committeeUserOptions: [],
partyBranchCommitteeFormData: {
userId: null,
roleCode: null
},
committeeTableData: []
}
},
methods: {
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
if (this.tabActive === 'groupInfo') {
this.partyBranchPageData()
} else if (this.tabActive === 'userInfo') {
this.partyBranchUserPageData()
} else if (this.tabActive === 'committee') {
this.partyBranchCommitteePageData()
}
},
handleNodeClick(data, node) {
this.currentData = data
this.currentNode = node
if (node.level === 1) {
this.tabActive = 'groupInfo'
this.partyBranchPageData()
} else if (node.level === 2) {
this.tabActive = 'userInfo'
this.partyBranchUserPageData()
}
},
filterNode(value, data, node) {
if (!value) return true
return data.label.includes(value)
},
//左侧树数据
async getTree() {
const resp = await $.post(loc() + '/getTree')
if (resp.code === 0) {
this.treeData = resp.data
if (this.$refs.tree && this.$refs.tree.root.childNodes) {
this.currentNode = this.$refs.tree.root.childNodes[0]
}
} else {
this.notifyWarning(resp.msg)
}
},
//打开新增党支部模态框
openAddPartyBranch() {
this.partyBranchDialogVisible = true
this.$nextTick(() => {
this.partyBranchFormData = {
partyBranchName: null,
partyBranchCode: null,
id: null
}
this.$refs.form.resetFields()
})
},
//新增、编辑党支部
async doSetPartyBranch() {
const resp = await $.post(loc() + '/doSetPartyBranch', this.partyBranchFormData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.partyBranchDialogVisible = false
this.getTree()
this.partyBranchPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//党支部分页数据
async partyBranchPageData() {
const resp = await $.post(loc() + '/partyBranchPageData', this.pageForm)
if (resp.code === 0) {
this.partyBranchTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
},
//删除党支部
deletePartyBranch(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deletePartyBranch', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTree()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
},
async partyBranchUserPageData() {
const resp = await $.post(loc() + '/partyBranchUserPageData', {
...this.pageForm,
partyBranchId: this.currentData.id
})
if (resp.code === 0) {
this.userTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.notifyWarning(resp.msg)
}
},
openAddUser() {
this.userDialogVisible = true
this.partyBranchUserFormData.userIds = []
this.queryNonSetUser(null)
},
async queryNonSetUser(val) {
if (val !== '') {
const resp = await $.post(loc() + '/queryNonSetUser', {val})
if (resp.code === 0) {
this.nonSetUserOptions = resp.data
}
} else {
this.nonSetUserOptions = []
}
},
async doAddBranchPartyUser() {
this.$refs['partyBranchUserForm'].validate(async valid => {
if (valid) {
const userIds = JSON.stringify(this.partyBranchUserFormData.userIds)
const partyBranchId = this.currentData.id
const resp = await $.post(loc() + '/doAddBranchPartyUser', {
partyBranchId,
userIds
})
if (resp.code === 0) {
this.userDialogVisible = false
this.notifySuccess(resp.msg)
this.partyBranchUserPageData()
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async deleteUser(userId) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deleteUser', {userId, partyBranchId: this.currentData.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
},
//打开新增支部委员会
openAddCommittee() {
this.committeeDialogVisible = true
this.partyBranchCommitteeFormData = {
userId: null,
roleCode: null
}
this.queryUserByPartyBranchId(null)
},
//查询党支部下的人员
async queryUserByPartyBranchId(val) {
if (val) {
const resp = await $.post(loc() + '/queryUserByPartyBranchId', {
val,
partyBranchId: this.currentData.id
})
if (resp.code === 0) {
this.committeeUserOptions = resp.data
}
} else {
this.committeeUserOptions = []
}
},
//添加党支部委员会人员
doAddCommitteeUser() {
this.$refs['partyBranchCommitteeForm'].validate(async valid => {
if (valid) {
const resp = await $.post(loc() + '/doAddCommitteeUser', {partyBranchId: this.currentData.id, ...this.partyBranchCommitteeFormData})
if (resp.code === 0) {
this.committeeDialogVisible = false
this.partyBranchCommitteePageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async partyBranchCommitteePageData() {
const resp = await $.post(loc() + '/partyBranchCommitteePageData', {
...this.pageForm,
partyBranchId: this.currentData.id
})
if (resp.code === 0) {
this.committeeTableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.notifyWarning(resp.msg)
}
},
deleteCommittee(userId) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/deleteCommittee', {userId, partyBranchId: this.currentData.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async mounted() {
//动态改变table高度
await httpVueLoader('/components/plugins/Guava.vue', 'Guava')()
await httpVueLoader('/components/plugins/TreeLayout.vue', 'tree-layout')()
calcTableHeight(['secondaryTableWrap'])
window.onresize = () => {
calcTableHeight(['secondaryTableWrap'])
}
},
created() {
this.getTree()
this.partyBranchPageData()
getDictByCode('retiredPartyBranchCommitteeRole').then(res => {
this.retiredPartyBranchCommitteeRoleOptions = res
})
}
})
</script>
<!--#
}
#-->
@@ -1,99 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">所属支部:</div>
<div class="search-item-option">
<el-select placeholder="所属支部" v-model="retiredPartyBranchId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in retiredPartyBranchOption" :label="item.partyBranchName"
:value="item.id" :key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="getData" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="statisticsData"
header-align="center"
align="center"
show-summary
:summary-method="summaryMethod"
border
highlight-current-row>
<el-table-column label="序号" type="index" width="70px"></el-table-column>
<el-table-column label="党支部名称" prop="partyBranchName"></el-table-column>
<el-table-column label="党支部代码" prop="partyBranchCode" sortable
:summary-method="()=>{}"></el-table-column>
<el-table-column label="党员人数" prop="userCount" sortable></el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
data() {
return {
retiredPartyBranchId: null,
retiredPartyBranchOption: [],
statisticsData: [],
}
},
methods: {
async getData() {
const resp = await $.post(loc() + '/data', {retiredPartyBranchId: this.retiredPartyBranchId})
if (resp.code === 0) {
this.statisticsData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
summaryMethod(param) {
const {columns, data} = param
let sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'userCount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
})
return sums
},
async getRetiredPartyBranch() {
const resp = await $.post(loc() + '/retiredPartyBranch')
this.retiredPartyBranchOption = resp.data
}
},
created() {
this.getData()
this.getRetiredPartyBranch()
}
})
</script>
<!--#
}
#-->
@@ -1,177 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">变更类型:</div>
<div class="search-item-option">
<el-select v-model="pageForm.changeType" style="width: 100%" clearable>
<el-option v-for="item in changeTypes" :label="item.desc" :value="item.code"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input v-model="pageForm.searchKeyword" clearable maxlength="20"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this"></table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='unitname'" scope="{row}">
{{isDisPlayCode?''+row.unitcode+'':null}}{{row.unitname}}
</template>
<template v-else-if="column.prop==='unionname'" scope="{row}">
{{isDisPlayCode?''+row.unioncode+'':null}}{{row.unionname}}
</template>
<template v-else-if="column.prop==='changeType'" scope="{row}">
{{changeTypes.find(v=>v.code===row.changeType).desc}}
</template>
</el-table-column>
<!--<el-table-column align="center" header-align="center" label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" @click="openView(row.id)">查看</el-button>
</template>
</el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idcard', label: '身份证号', width: 170},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'jobTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
{prop: 'political', label: '政治面貌', checked: 0},
{prop: 'changeType', label: '变更类型'}
],
changeTypes: [],
pageForm: {
year: (new Date().getFullYear()).toString()
}
}
},
methods: {
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}) {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
openChange(row) {
this.$confirm('您确定要将' + row.username + '设为死亡吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/changeToDie', {userId: row.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async created() {
this.pageData()
this.changeTypes = await getEnumOptions('RetiredUserChangeType')
this.unions = await getUnions(null)
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -1,245 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">关键字:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this">
<template #func>
<el-button size="small" type="primary" @click="openAdd">新增退休人员</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='unitname'" scope="{row}">
{{isDisPlayCode?''+row.unitcode+'':null}}{{row.unitname}}
</template>
<template v-else-if="column.prop==='unionname'" scope="{row}">
{{isDisPlayCode?''+row.unioncode+'':null}}{{row.unionname}}
</template>
<template v-else-if="column.prop==='memberJoinTime'" scope="{row}">
{{moment(row.memberJoinTime).format('YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" @click="openView(row.id)">查看</el-button>
<el-button size="mini" type="primary" @click="openChange(row)">去世</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-drawer title="新增退休人员" :visible.sync="retireUserAddDialogVisible" size="70%">
<el-timeline>
<el-timeline-item timestamp="" placement="top">
<el-input placeholder="请输入内容" clearable v-model="nonRetiredUserPageForm.searchKeyword"
@keyup.enter.native="nonRetiredUserPageForm.pageNumber=1;nonRetiredUserPageData()"
style="width: 300px">
<el-select v-model="nonRetiredUserPageForm.searchName" slot="prepend" style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
<el-button type="primary" icon="el-icon-search"
@click="nonRetiredUserPageForm.pageNumber=1;nonRetiredUserPageData()"></el-button>
</el-timeline-item>
<el-timeline-item timestamp="" placement="top">
<el-table :data="nonRetiredUserTableData" style="width: 100%" row-key="id"
ref="nonRetiredUserTable">
<el-table-column type="selection" reserve-selection></el-table-column>
<el-table-column label="工号" prop="loginname" align="center"></el-table-column>
<el-table-column label="姓名" prop="username" align="center"></el-table-column>
<el-table-column label="性别" prop="sex" align="center"></el-table-column>
<el-table-column label="电话" prop="mobile" align="center"></el-table-column>
<el-table-column label="在职状态" prop="userState" align="center"></el-table-column>
<el-table-column label="人员类型" prop="personType" align="center"></el-table-column>
<el-table-column label="单位" prop="unitname" align="center"></el-table-column>
<el-table-column label="工会" prop="unionname" align="center"></el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="(val)=>{nonRetiredUserPageForm.pageSize=val;nonRetiredUserPageData()}"
@current-change="(val)=>{nonRetiredUserPageForm.pageNumber=val;nonRetiredUserPageData()}"
:current-page="nonRetiredUserPageForm.pageNumber"
:page-size="nonRetiredUserPageForm.pageSize"
layout="total, prev, pager, next"
:total="nonRetiredUserPageForm.totalCount">
</el-pagination>
</el-row>
</el-timeline-item>
</el-timeline>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="retireUserAddDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doBatchJoinRetire">确定</el-button>
</span>
</el-drawer>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
retireUserAddDialogVisible: false,
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idcard', label: '身份证号', width: 170},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'jobTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
{prop: 'political', label: '政治面貌', checked: 0},
],
nonRetiredUserPageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0
},
nonRetiredUserTableData: []
}
},
methods: {
openAdd() {
this.retireUserAddDialogVisible = true
this.nonRetiredUserPageForm.pageNumber = 1
this.nonRetiredUserPageData()
if (this.$refs.nonRetiredUserTable) {
this.$refs.nonRetiredUserTable.clearSelection()
}
},
async nonRetiredUserPageData() {
const resp = await $.post(loc() + '/nonRetiredUserPageData', this.nonRetiredUserPageForm)
if (resp.code === 0) {
this.nonRetiredUserTableData = resp.data.list
this.nonRetiredUserPageForm.totalCount = resp.data.totalCount
} else {
this.notifyWarning(resp.msg)
}
},
async doBatchJoinRetire() {
const selection = this.$refs.nonRetiredUserTable.selection
if (!selection.length) {
this.notifyWarning("请先勾选需要设置为退休的人员")
return
}
const resp = await $.post(loc() + "/doBatchJoinRetire", {userIds: JSON.stringify(selection.map(v => v.id))})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.retireUserAddDialogVisible = false
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}) {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
openChange(row) {
this.$confirm('您确定要将' + row.username + '设为死亡吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/changeToDie', {userId: row.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async created() {
this.pageData()
this.unions = await getUnions(null)
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -1,159 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">关键字:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this"></table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='unitname'" scope="{row}">
{{isDisPlayCode?''+row.unitcode+'':null}}{{row.unitname}}
</template>
<template v-else-if="column.prop==='unionname'" scope="{row}">
{{isDisPlayCode?''+row.unioncode+'':null}}{{row.unionname}}
</template>
<template v-else-if="column.prop==='memberJoinTime'" scope="{row}">
{{moment(row.memberJoinTime).format('YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" @click="openView(row.id)">查看</el-button>
<el-button size="mini" type="primary" @click="openChange(row)">去世</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog title="退休人员变更" :visible.sync="retireUserChangeDialogVisible" width="50%"
:close-on-click-modal="false">
</el-dialog>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
retireUserChangeDialogVisible: false,
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idcard', label: '身份证号', width: 170},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'jobTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
{prop: 'political', label: '政治面貌', checked: 0},
],
}
},
methods: {
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}) {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
openChange(row) {
this.$confirm('您确定要将' + row.username + '设为死亡吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/changeToDie', {userId: row.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async created() {
// this.pageData()
this.unions = await getUnions(null)
this.flushUnits()
}
})
</script>
<!--#
}
#-->