人员档案列表修改

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>
<a-card :bordered="false" title="人员档案">
<div class="table-page-search-wrapper">
<SearchCom :form="queryParam" :list="queryOptions" :orgTree="orgTreeOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}"></SearchCom>
<div style="width: 100%; height: 32px; margin-bottom: 8px;">
<a-button type="primary" :style="{float: 'right'}">导出</a-button>
</div>
</div>
<s-table ref="table" size="small" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.archivesUserPageNum) || 1">
<template slot="action" slot-scope="text, record">
<a-dropdown v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list') || hasPerm('archives:user:selfStudy:list') || hasPerm('archives:user:violation:list')">
<a class="ant-dropdown-link">操作
<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-row :gutter="24" >
<a-col :md="5" :sm="24">
<a-card :bordered="false" :loading="treeLoading">
<div v-if="this.orgTree != ''">
<a-tree
:treeData="orgTree"
:onLoadData="orgTree"
v-if="orgTree.length"
@select="handleClick"
:defaultExpandAll="false"
:defaultExpandedKeys="expandedKeys"
:defaultSelectedKeys="selectedKeys"
:replaceFields="replaceFields" />
</div>
<div v-else>
<a-empty :image="simpleImage" />
</div>
</a-card>
</a-col>
<a-col :md="19" :sm="24">
<a-card :bordered="false" title="人员档案">
<div class="table-page-search-wrapper">
<SearchCom :form="queryParam" :list="queryOptions" :orgTree="orgTreeOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}"></SearchCom>
<div style="width: 100%; height: 32px; margin-bottom: 8px;">
<!-- <a-button type="primary" :style="{float: 'right'}">导出</a-button> -->
</div>
</div>
<s-table ref="table" size="small" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.archivesUserPageNum) || 1">
<template slot="action" slot-scope="text, record">
<a-dropdown v-if="hasPerm('archives:user:autotrain:list') || hasPerm('archives:user:terminaltrain:list') || hasPerm('archives:user:selfStudy:list') || hasPerm('archives:user:violation:list')">
<a class="ant-dropdown-link">操作
<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>
<script>
import { STable, SearchCom } from '@/components'
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 {
components: { STable, SearchCom },
data() {
return {
queryParam: { name: this.$route.query.archivesUserName || '', orgId: this.$route.query.archivesUserOrgId || '' },
queryParam: { name: this.$route.query.archivesUserName || ''},
columns: [
{ 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: 'bmOrgName', key: 'bmOrgName' },
{ 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: '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: {
@ -67,7 +111,39 @@ export default {
return { ifshow: true, formKey: 'orgId', startOrganizationId: '', defaultOrganizationId: '' };
}
},
created () {
this.getOrgTree()
},
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() {
this.$refs.table.refresh(true)
},
@ -77,7 +153,7 @@ export default {
path: '/archives/user/Project', query: {
id: record.id,
archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId,
archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current
}
});
@ -88,7 +164,7 @@ export default {
path: '/archives/user/SelfStudy', query: {
id: record.id,
archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId,
archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current
}
});
@ -99,7 +175,7 @@ export default {
path: '/archives/user/Violation', query: {
id: record.id,
archivesUserName: this.queryParam.name,
archivesUserOrgId: this.queryParam.orgId,
archivesUserOrgId: this.orgId,
archivesUserPageNum: this.$refs.table.localPagination.current
}
});