人员档案列表修改

This commit is contained in:
QuAoLi 2022-03-12 17:28:51 +08:00
parent c9c2828a20
commit 2aad29c848
1 changed files with 116 additions and 40 deletions

View File

@ -1,51 +1,78 @@
<template> <template>
<a-card :bordered="false" title="人员档案"> <a-row :gutter="24" >
<div class="table-page-search-wrapper"> <a-col :md="5" :sm="24">
<SearchCom :form="queryParam" :list="queryOptions" :orgTree="orgTreeOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}"></SearchCom> <a-card :bordered="false" :loading="treeLoading">
<div style="width: 100%; height: 32px; margin-bottom: 8px;"> <div v-if="this.orgTree != ''">
<a-button type="primary" :style="{float: 'right'}">导出</a-button> <a-tree
</div> :treeData="orgTree"
</div> :onLoadData="orgTree"
<s-table ref="table" size="small" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.archivesUserPageNum) || 1"> v-if="orgTree.length"
<template slot="action" slot-scope="text, record"> @select="handleClick"
<a-dropdown v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list') || hasPerm('archives:user:selfStudy:list') || hasPerm('archives:user:violation:list')"> :defaultExpandAll="false"
<a class="ant-dropdown-link">操作 :defaultExpandedKeys="expandedKeys"
<a-icon type="down" /> :defaultSelectedKeys="selectedKeys"
</a> :replaceFields="replaceFields" />
<a-menu slot="overlay"> </div>
<a-menu-item v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list')"> <div v-else>
<a href="javascript:;" @click="archivesProject(record)">项目档案</a> <a-empty :image="simpleImage" />
</a-menu-item> </div>
<a-menu-item v-if="hasPerm('archives:user:selfStudy:list')">
<a href="javascript:;" @click="archivesSelfStudy(record)">自学档案</a> </a-card>
</a-menu-item> </a-col>
<a-menu-item v-if="hasPerm('archives:user:violation:list')"> <a-col :md="19" :sm="24">
<a href="javascript:;" @click="archivesViolation(record)">违章档案</a> <a-card :bordered="false" title="人员档案">
</a-menu-item> <div class="table-page-search-wrapper">
<a-menu-item> <SearchCom :form="queryParam" :list="queryOptions" :orgTree="orgTreeOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}"></SearchCom>
<a-popconfirm title="确认导出?" cancelText="取消" okText="确认" @confirm="() => handleDelete(record)"> <div style="width: 100%; height: 32px; margin-bottom: 8px;">
<a href="javascript:;"> 导出 </a> <!-- <a-button type="primary" :style="{float: 'right'}">导出</a-button> -->
</a-popconfirm> </div>
</a-menu-item> </div>
</a-menu> <s-table ref="table" size="small" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.archivesUserPageNum) || 1">
</a-dropdown> <template slot="action" slot-scope="text, record">
</template> <a-dropdown v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list') || hasPerm('archives:user:selfStudy:list') || hasPerm('archives:user:violation:list')">
</s-table> <a class="ant-dropdown-link">操作
</a-card> <a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list')">
<a href="javascript:;" @click="archivesProject(record)">项目档案</a>
</a-menu-item>
<!-- <a-menu-item v-if="hasPerm('archives:user:selfStudy:list')">
<a href="javascript:;" @click="archivesSelfStudy(record)">自学档案</a>
</a-menu-item> -->
<a-menu-item v-if="hasPerm('archives:user:violation:list')">
<a href="javascript:;" @click="archivesViolation(record)">违章档案</a>
</a-menu-item>
<!-- <a-menu-item>
<a-popconfirm title="确认导出?" cancelText="取消" okText="确认" @confirm="() => handleDelete(record)">
<a href="javascript:;"> 导出 </a>
</a-popconfirm>
</a-menu-item> -->
</a-menu>
</a-dropdown>
</template>
</s-table>
</a-card>
</a-col>
</a-row>
</template> </template>
<script> <script>
import { STable, SearchCom } from '@/components' import { STable, SearchCom } from '@/components'
import { getArchivesUserList } from '@/api/archives/user' import { getArchivesUserList } from '@/api/archives/user'
import { Empty } from 'ant-design-vue'
import { orgList } from '@/api/org/org'
import { listToTree } from '@/utils/util'
export default { export default {
components: { STable, SearchCom }, components: { STable, SearchCom },
data() { data() {
return { return {
queryParam: { name: this.$route.query.archivesUserName || '', orgId: this.$route.query.archivesUserOrgId || '' }, queryParam: { name: this.$route.query.archivesUserName || ''},
columns: [ columns: [
{ title: '姓名', width: '100px', align: 'center', dataIndex: 'name', key: 'name' }, { title: '姓名', width: '100px', align: 'center', dataIndex: 'name', key: 'name' },
{ title: '受训角色', width: 'auto', align: 'center', dataIndex: 'roleName', key: 'roleName' }, // { title: '', width: 'auto', align: 'center', dataIndex: 'roleName', key: 'roleName' },
{ title: '单位信息', width: 'auto', align: 'center', dataIndex: 'dwOrgName', key: 'dwOrgName' }, { title: '单位信息', width: 'auto', align: 'center', dataIndex: 'dwOrgName', key: 'dwOrgName' },
{ title: '部门信息', width: 'auto', align: 'center', dataIndex: 'bmOrgName', key: 'bmOrgName' }, { title: '部门信息', width: 'auto', align: 'center', dataIndex: 'bmOrgName', key: 'bmOrgName' },
{ title: '年度学时要求/时', width: 'auto', align: 'center', dataIndex: 'yearClassHourRequire', key: 'yearClassHourRequire' }, { title: '年度学时要求/时', width: 'auto', align: 'center', dataIndex: 'yearClassHourRequire', key: 'yearClassHourRequire' },
@ -54,7 +81,24 @@ export default {
{ title: '项目学时', width: 'auto', align: 'center', dataIndex: 'projectClassHour', key: 'projectClassHour' }, { title: '项目学时', width: 'auto', align: 'center', dataIndex: 'projectClassHour', key: 'projectClassHour' },
{ title: '操作', width: '70px', key: 'operation', align: 'center', scopedSlots: { customRender: 'action' } } { title: '操作', width: '70px', key: 'operation', align: 'center', scopedSlots: { customRender: 'action' } }
], ],
loadData: parameter => { return getArchivesUserList(Object.assign(parameter, this.queryParam)).then(res => { return res }) } loadData: parameter => {
if (!this.orgId) return []
return getArchivesUserList(Object.assign(parameter, this.queryParam, { orgId: this.orgId })).then(res => {
return res
})
},
treeLoading: true,
orgTree: [],
expandedKeys: [],
selectedKeys: [],
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
replaceFields: {
children: 'children',
title: 'name',
key: 'id',
value: 'id'
},
orgId: null
} }
}, },
computed: { computed: {
@ -67,7 +111,39 @@ export default {
return { ifshow: true, formKey: 'orgId', startOrganizationId: '', defaultOrganizationId: '' }; return { ifshow: true, formKey: 'orgId', startOrganizationId: '', defaultOrganizationId: '' };
} }
}, },
created () {
this.getOrgTree()
},
methods: { methods: {
getOrgTree () {
orgList({ orgType: 1 }).then(res => {
this.treeLoading = false
this.expandedKeys = []
this.selectedKeys = []
if (!res.code === 200 || !res.data.length) {
this.orgTree = []
this.$refs.table.refresh(true)
return
}
this.orgTree = listToTree(res.data, [], 0)
console.log(this.orgTree)
this.orgId = this.orgTree[0].id
this.selectedKeys.push(this.orgId)
//
this.orgTree.forEach(item => {
this.expandedKeys.push(item.id)
})
this.handleClick(this.orgId)
})
},
/**
* 点击左侧机构树查询列表
*/
handleClick (e) {
this.orgId = e.toString()
this.$refs.table.refresh(true)
},
handleRefresh() { handleRefresh() {
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}, },
@ -77,7 +153,7 @@ export default {
path: '/archives/user/Project', query: { path: '/archives/user/Project', query: {
id: record.id, id: record.id,
archivesUserName: this.queryParam.name, archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId, archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current archivesUserPageNum: this.$refs.table.localPagination.current
} }
}); });
@ -88,7 +164,7 @@ export default {
path: '/archives/user/SelfStudy', query: { path: '/archives/user/SelfStudy', query: {
id: record.id, id: record.id,
archivesUserName: this.queryParam.name, archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId, archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current archivesUserPageNum: this.$refs.table.localPagination.current
} }
}); });
@ -99,7 +175,7 @@ export default {
path: '/archives/user/Violation', query: { path: '/archives/user/Violation', query: {
id: record.id, id: record.id,
archivesUserName: this.queryParam.name, archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId, archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current archivesUserPageNum: this.$refs.table.localPagination.current
} }
}); });
@ -115,4 +191,4 @@ export default {
.ant-card-body { .ant-card-body {
padding: 15px; padding: 15px;
} }
</style> </style>