|
@@ -1,20 +1,148 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <el-empty description="暂无数据"></el-empty>
|
|
|
|
|
|
+ <div v-loading="loading">
|
|
|
|
+ <m-card>
|
|
|
|
+ <el-descriptions :column="3" border>
|
|
|
|
+ <el-descriptions-item
|
|
|
|
+ v-for="list in lists"
|
|
|
|
+ :key="list.prop"
|
|
|
|
+ :label="list.label"
|
|
|
|
+ >
|
|
|
|
+ {{ itemData[list.prop] }}
|
|
|
|
+ <!-- <el-tag>{{ itemData[list.prop] }}</el-tag> -->
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
|
|
+ <m-table
|
|
|
|
+ v-if="type === 'organization'"
|
|
|
|
+ card-title="下级机构"
|
|
|
|
+ class="mt-3"
|
|
|
|
+ shadow="never"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :items="itemData.items"
|
|
|
|
+ >
|
|
|
|
+ <template #organizationName="{ row }">
|
|
|
|
+ <span class="text-link" @click="onJump(row.organizationNo)">{{ row.organizationName }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </m-table>
|
|
|
|
+ </m-card>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import {
|
|
|
|
+ getRosterList,
|
|
|
|
+ getOrganizationDetails
|
|
|
|
+} from '@/api/system'
|
|
|
|
+import qs from 'qs'
|
|
export default {
|
|
export default {
|
|
name: 'panoramaDetailsBaseInfo',
|
|
name: 'panoramaDetailsBaseInfo',
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ headers: [
|
|
|
|
+ { label: '机构名称', prop: 'organizationName' },
|
|
|
|
+ { label: '机构类型', prop: 'organizationCategory' },
|
|
|
|
+ { label: '上级机构', prop: 'parentOrganizationName' },
|
|
|
|
+ { label: '上级机构类型', prop: 'parentOrganizationCategory' }
|
|
|
|
+ ],
|
|
|
|
+ itemData: {},
|
|
|
|
+ loading: false,
|
|
|
|
+ type: 'employee',
|
|
|
|
+ item: {}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ lists () {
|
|
|
|
+ if (this.type === 'employee') {
|
|
|
|
+ return [
|
|
|
|
+ { label: '员工名称', prop: 'employeeName' },
|
|
|
|
+ { label: '部门', prop: 'deptName' },
|
|
|
|
+ { label: '上级机构', prop: 'parentOrganizationName' },
|
|
|
|
+ { label: '人员类别', prop: 'personnelCategory' },
|
|
|
|
+ { label: '岗位名称', prop: 'postName' },
|
|
|
|
+ { label: '岗位序列', prop: 'positionSequence' },
|
|
|
|
+ { label: '岗位类别', prop: 'positionCategory' },
|
|
|
|
+ { label: '职务层级', prop: 'jobLevel' },
|
|
|
|
+ { label: '通行证号', prop: 'passes' },
|
|
|
|
+ { label: '工行时间', prop: 'tradeUnionsTimeText' },
|
|
|
|
+ { label: '薪酬档次', prop: 'salaryCategory' },
|
|
|
|
+ { label: '薪酬级别', prop: 'salaryLevel' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ return [
|
|
|
|
+ { prop: 'organizationName', label: '机构名称' },
|
|
|
|
+ { prop: 'organizationCategory', label: '机构类型' },
|
|
|
|
+ { prop: 'organizationNo', label: '机构编码' },
|
|
|
|
+ { prop: 'parentOrganizationName', label: '上级机构' },
|
|
|
|
+ { prop: 'parentOrganizationCategory', label: '上级机构类型' },
|
|
|
|
+ { prop: 'parentOrganizationNo', label: '上级机构编码' },
|
|
|
|
+ { prop: 'employeeTotal', label: '员工数' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 入口执行方法
|
|
onInitPanorama (organizationNo, employeeNo) {
|
|
onInitPanorama (organizationNo, employeeNo) {
|
|
if (employeeNo) {
|
|
if (employeeNo) {
|
|
// 个人全景
|
|
// 个人全景
|
|
|
|
+ this.type = 'employee'
|
|
|
|
+ this.getEmployeeInfo(employeeNo)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 机构全景
|
|
// 机构全景
|
|
- console.log('机构全景')
|
|
|
|
|
|
+ this.type = 'organization'
|
|
|
|
+ this.getOrganizationInfo(organizationNo)
|
|
|
|
+ },
|
|
|
|
+ async getEmployeeInfo (personnelCode) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await getRosterList({
|
|
|
|
+ entity: {
|
|
|
|
+ personnelCode
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.itemData = data.records.map(e => {
|
|
|
|
+ const date = new Date(e.tradeUnionsTime)
|
|
|
|
+ // 获取年、月、日
|
|
|
|
+ const year = date.getFullYear()
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,所以要加1
|
|
|
|
+ const day = String(date.getDate()).padStart(2, '0')
|
|
|
|
+ return {
|
|
|
|
+ ...e,
|
|
|
|
+ tradeUnionsTimeText: `${year}年${month}月${day}日`
|
|
|
|
+ }
|
|
|
|
+ }).pop() || {}
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.error(error)
|
|
|
|
+ } finally {
|
|
|
|
+ this.loading = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async getOrganizationInfo (organizationNo) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await getOrganizationDetails({
|
|
|
|
+ organizationNo
|
|
|
|
+ })
|
|
|
|
+ this.itemData = {
|
|
|
|
+ ...data.organization,
|
|
|
|
+ employeeTotal: data.employees.total,
|
|
|
|
+ items: data.childOrganization
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.error(error)
|
|
|
|
+ } finally {
|
|
|
|
+ this.loading = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onJump (organizationNo, employee) {
|
|
|
|
+ const _ROOT = this.$route.path
|
|
|
|
+ const query = {
|
|
|
|
+ organizationNo: organizationNo
|
|
|
|
+ }
|
|
|
|
+ if (employee) {
|
|
|
|
+ query.employeeNo = employee.personnelCode
|
|
|
|
+ query.employeeName = employee.employeeName
|
|
|
|
+ }
|
|
|
|
+ window.open(`${_ROOT}?${qs.stringify(query)}`)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|