Commit 567327652a0679e6db8fce056cf5975c2fa4c4ac
1 parent
1db0a60c
修改员工界面部分bug
Showing
9 changed files
with
222 additions
and
366 deletions
src/components/oa/chooseOrgTree.vue deleted
| 1 | -<template> | |
| 2 | - <el-dialog | |
| 3 | - :title="$t('staffAttendance.chooseOrg')" | |
| 4 | - :visible.sync="visible" | |
| 5 | - width="60%" | |
| 6 | - @close="handleClose" | |
| 7 | - > | |
| 8 | - <el-tree | |
| 9 | - ref="orgTree" | |
| 10 | - :data="orgs" | |
| 11 | - node-key="id" | |
| 12 | - :props="defaultProps" | |
| 13 | - :highlight-current="true" | |
| 14 | - @node-click="handleNodeClick" | |
| 15 | - ></el-tree> | |
| 16 | - | |
| 17 | - <span slot="footer" class="dialog-footer"> | |
| 18 | - <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 19 | - <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button> | |
| 20 | - </span> | |
| 21 | - </el-dialog> | |
| 22 | -</template> | |
| 23 | - | |
| 24 | -<script> | |
| 25 | -import { getCommunityId } from '@/api/community/communityApi' | |
| 26 | -import { listOrgTree } from '@/api/oa/staffAttendanceManageApi' | |
| 27 | - | |
| 28 | -export default { | |
| 29 | - name: 'ChooseOrgTree', | |
| 30 | - data() { | |
| 31 | - return { | |
| 32 | - visible: false, | |
| 33 | - orgs: [], | |
| 34 | - currentOrg: {}, | |
| 35 | - defaultProps: { | |
| 36 | - children: 'children', | |
| 37 | - label: 'name' | |
| 38 | - } | |
| 39 | - } | |
| 40 | - }, | |
| 41 | - methods: { | |
| 42 | - open() { | |
| 43 | - this.visible = true | |
| 44 | - this.loadOrgs() | |
| 45 | - }, | |
| 46 | - | |
| 47 | - async loadOrgs() { | |
| 48 | - try { | |
| 49 | - const params = { | |
| 50 | - communityId: getCommunityId() | |
| 51 | - } | |
| 52 | - const { data } = await listOrgTree(params) | |
| 53 | - this.orgs = data || [] | |
| 54 | - } catch (error) { | |
| 55 | - console.error('Failed to load orgs:', error) | |
| 56 | - this.$message.error(this.$t('staffAttendance.loadOrgFailed')) | |
| 57 | - } | |
| 58 | - }, | |
| 59 | - | |
| 60 | - handleNodeClick(data) { | |
| 61 | - this.currentOrg = data | |
| 62 | - }, | |
| 63 | - | |
| 64 | - handleConfirm() { | |
| 65 | - if (!this.currentOrg || !this.currentOrg.id) { | |
| 66 | - this.$message.warning(this.$t('staffAttendance.selectOrgFirst')) | |
| 67 | - return | |
| 68 | - } | |
| 69 | - | |
| 70 | - this.$emit('switchOrg', { | |
| 71 | - orgId: this.currentOrg.id, | |
| 72 | - allOrgName: this.getOrgFullName(this.currentOrg) | |
| 73 | - }) | |
| 74 | - this.visible = false | |
| 75 | - }, | |
| 76 | - | |
| 77 | - getOrgFullName(node) { | |
| 78 | - if (!node) return '' | |
| 79 | - | |
| 80 | - let names = [] | |
| 81 | - let currentNode = node | |
| 82 | - | |
| 83 | - while (currentNode) { | |
| 84 | - names.unshift(currentNode.name) | |
| 85 | - currentNode = this.$parent ? this.$parent.getNode(currentNode.parentId) : null | |
| 86 | - } | |
| 87 | - | |
| 88 | - return names.join('/') | |
| 89 | - }, | |
| 90 | - | |
| 91 | - handleClose() { | |
| 92 | - this.currentOrg = {} | |
| 93 | - } | |
| 94 | - } | |
| 95 | -} | |
| 96 | -</script> | |
| 97 | - | |
| 98 | -<style lang="scss" scoped> | |
| 99 | -.el-tree { | |
| 100 | - max-height: 500px; | |
| 101 | - overflow-y: auto; | |
| 102 | -} | |
| 103 | - | |
| 104 | -.dialog-footer { | |
| 105 | - text-align: right; | |
| 106 | -} | |
| 107 | -</style> | |
| 108 | 0 | \ No newline at end of file |
src/components/org/ChooseOrgTree.vue
| ... | ... | @@ -35,7 +35,7 @@ export default { |
| 35 | 35 | }, |
| 36 | 36 | defaultProps: { |
| 37 | 37 | children: 'children', |
| 38 | - label: 'name' | |
| 38 | + label: 'text' | |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | }, |
| ... | ... | @@ -50,11 +50,48 @@ export default { |
| 50 | 50 | communityId: getCommunityId() |
| 51 | 51 | } |
| 52 | 52 | const { data } = await listOrgTree(params) |
| 53 | - this.chooseOrgInfo.orgs = data | |
| 53 | + | |
| 54 | + // 确保数据是数组格式 | |
| 55 | + let treeData = data | |
| 56 | + | |
| 57 | + // 如果返回的是对象而不是数组,尝试提取数组 | |
| 58 | + if (Array.isArray(treeData)) { | |
| 59 | + this.chooseOrgInfo.orgs = treeData | |
| 60 | + } else if (treeData && Array.isArray(treeData.children)) { | |
| 61 | + this.chooseOrgInfo.orgs = treeData.children | |
| 62 | + } else if (treeData && Array.isArray(treeData.data)) { | |
| 63 | + this.chooseOrgInfo.orgs = treeData.data | |
| 64 | + } else if (treeData && Array.isArray(treeData.list)) { | |
| 65 | + this.chooseOrgInfo.orgs = treeData.list | |
| 66 | + } else { | |
| 67 | + // 如果都不是数组,转换为数组格式 | |
| 68 | + this.chooseOrgInfo.orgs = Array.isArray(treeData) ? treeData : [treeData] | |
| 69 | + } | |
| 70 | + | |
| 71 | + // 确保每个节点都有 children 属性且为数组 | |
| 72 | + this.processTreeData(this.chooseOrgInfo.orgs) | |
| 54 | 73 | } catch (error) { |
| 55 | 74 | console.error('获取组织树失败:', error) |
| 75 | + this.chooseOrgInfo.orgs = [] | |
| 56 | 76 | } |
| 57 | 77 | }, |
| 78 | + processTreeData(nodes) { | |
| 79 | + if (!Array.isArray(nodes)) return | |
| 80 | + | |
| 81 | + nodes.forEach(node => { | |
| 82 | + // 确保每个节点都有 children 属性且为数组 | |
| 83 | + if (!node.children) { | |
| 84 | + node.children = [] | |
| 85 | + } else if (!Array.isArray(node.children)) { | |
| 86 | + node.children = [] | |
| 87 | + } | |
| 88 | + | |
| 89 | + // 递归处理子节点 | |
| 90 | + if (node.children && node.children.length > 0) { | |
| 91 | + this.processTreeData(node.children) | |
| 92 | + } | |
| 93 | + }) | |
| 94 | + }, | |
| 58 | 95 | handleNodeClick(data) { |
| 59 | 96 | this.chooseOrgInfo.curOrg = data |
| 60 | 97 | this.chooseOrgInfo.curOrg.orgId = data.id | ... | ... |
src/components/staff/chooseOrgTree.vue deleted
| 1 | -<template> | |
| 2 | - <el-dialog | |
| 3 | - :title="$t('staffCommunity.chooseOrgTitle')" | |
| 4 | - :visible.sync="visible" | |
| 5 | - width="60%" | |
| 6 | - > | |
| 7 | - <el-tree | |
| 8 | - ref="orgTree" | |
| 9 | - :data="orgs" | |
| 10 | - node-key="id" | |
| 11 | - show-checkbox | |
| 12 | - :props="defaultProps" | |
| 13 | - @check-change="handleCheckChange" | |
| 14 | - /> | |
| 15 | - <div slot="footer" class="dialog-footer"> | |
| 16 | - <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | |
| 17 | - <el-button type="primary" @click="confirmChoose">{{ $t('common.confirm') }}</el-button> | |
| 18 | - </div> | |
| 19 | - </el-dialog> | |
| 20 | -</template> | |
| 21 | - | |
| 22 | -<script> | |
| 23 | -import { listOrgTree } from '@/api/staff/staffCommunityApi' | |
| 24 | -import { getCommunityId } from '@/api/community/communityApi' | |
| 25 | - | |
| 26 | -export default { | |
| 27 | - name: 'ChooseOrgTree', | |
| 28 | - data() { | |
| 29 | - return { | |
| 30 | - visible: false, | |
| 31 | - orgs: [], | |
| 32 | - currentOrg: {}, | |
| 33 | - defaultProps: { | |
| 34 | - children: 'children', | |
| 35 | - label: 'name' | |
| 36 | - } | |
| 37 | - } | |
| 38 | - }, | |
| 39 | - methods: { | |
| 40 | - open() { | |
| 41 | - this.visible = true | |
| 42 | - this.loadOrgs() | |
| 43 | - }, | |
| 44 | - async loadOrgs() { | |
| 45 | - try { | |
| 46 | - const { data } = await listOrgTree({ | |
| 47 | - communityId: getCommunityId() | |
| 48 | - }) | |
| 49 | - this.orgs = data | |
| 50 | - } catch (error) { | |
| 51 | - this.$message.error(this.$t('staffCommunity.fetchOrgError')) | |
| 52 | - } | |
| 53 | - }, | |
| 54 | - handleCheckChange(data, checked) { | |
| 55 | - if (checked) { | |
| 56 | - this.currentOrg = { | |
| 57 | - orgId: data.id, | |
| 58 | - allOrgName: data.name | |
| 59 | - } | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - confirmChoose() { | |
| 63 | - if (!this.currentOrg.orgId) { | |
| 64 | - this.$message.warning(this.$t('staffCommunity.selectOrgTip')) | |
| 65 | - return | |
| 66 | - } | |
| 67 | - this.$emit('switchOrg', this.currentOrg) | |
| 68 | - this.visible = false | |
| 69 | - } | |
| 70 | - } | |
| 71 | -} | |
| 72 | -</script> | |
| 73 | - | |
| 74 | -<style scoped> | |
| 75 | -.dialog-footer { | |
| 76 | - text-align: right; | |
| 77 | -} | |
| 78 | -</style> | |
| 79 | 0 | \ No newline at end of file |
src/components/system/searchCommunityDataList.vue
| ... | ... | @@ -155,7 +155,7 @@ |
| 155 | 155 | </template> |
| 156 | 156 | |
| 157 | 157 | <script> |
| 158 | -import { searchCommunityData, getTelMachine, postTelMachineMsg } from '@/api/system/searchCommunityDataApi' | |
| 158 | +import { searchCommunityData, getTelMachineInfo, saveTelMachineMsg } from '@/api/system/searchCommunityDataApi' | |
| 159 | 159 | import { getCommunityId } from '@/api/community/communityApi' |
| 160 | 160 | |
| 161 | 161 | export default { |
| ... | ... | @@ -196,7 +196,7 @@ export default { |
| 196 | 196 | if (!this.communityId || this.communityId === '-1') { |
| 197 | 197 | return |
| 198 | 198 | } |
| 199 | - getTelMachine({ | |
| 199 | + getTelMachineInfo({ | |
| 200 | 200 | page: 1, |
| 201 | 201 | row: 1, |
| 202 | 202 | communityId: this.communityId |
| ... | ... | @@ -361,7 +361,7 @@ export default { |
| 361 | 361 | data.communityId = this.communityId |
| 362 | 362 | data.machineId = this.machine.machineId |
| 363 | 363 | |
| 364 | - postTelMachineMsg(data).then(res => { | |
| 364 | + saveTelMachineMsg(data).then(res => { | |
| 365 | 365 | if (res.code !== 0) { |
| 366 | 366 | console.error('Failed to save tel machine message:', res.msg) |
| 367 | 367 | return | ... | ... |
src/views/oa/staffAttendanceManageList.vue
| ... | ... | @@ -71,6 +71,7 @@ |
| 71 | 71 | </el-row> |
| 72 | 72 | |
| 73 | 73 | <!-- 子组件 --> |
| 74 | + | |
| 74 | 75 | <choose-org-tree ref="chooseOrgTree" @switchOrg="handleSwitchOrg"></choose-org-tree> |
| 75 | 76 | <staff-attendance-detail ref="staffAttendanceDetail"></staff-attendance-detail> |
| 76 | 77 | <staff-attendance-replenish-check-in ref="staffAttendanceReplenishCheckIn"></staff-attendance-replenish-check-in> |
| ... | ... | @@ -85,13 +86,16 @@ import { |
| 85 | 86 | |
| 86 | 87 | } from '@/api/oa/staffAttendanceManageApi' |
| 87 | 88 | import { dateFormat } from '@/utils/dateUtil' |
| 89 | +import ChooseOrgTree from '@/components/org/ChooseOrgTree' | |
| 90 | +import StaffAttendanceDetail from '@/components/oa/staffAttendanceDetail' | |
| 91 | +import StaffAttendanceReplenishCheckIn from '@/components/oa/staffAttendanceReplenishCheckIn' | |
| 88 | 92 | |
| 89 | 93 | export default { |
| 90 | 94 | name: 'StaffAttendanceManageList', |
| 91 | 95 | components: { |
| 92 | - 'choose-org-tree': () => import('@/components/oa/chooseOrgTree'), | |
| 93 | - 'staff-attendance-detail': () => import('@/components/oa/staffAttendanceDetail'), | |
| 94 | - 'staff-attendance-replenish-check-in': () => import('@/components/oa/staffAttendanceReplenishCheckIn') | |
| 96 | + ChooseOrgTree, | |
| 97 | + StaffAttendanceDetail, | |
| 98 | + StaffAttendanceReplenishCheckIn | |
| 95 | 99 | }, |
| 96 | 100 | data() { |
| 97 | 101 | return { | ... | ... |
src/views/staff/aStaffLang.js
| 1 | 1 | export const messages = { |
| 2 | 2 | en: { |
| 3 | - staff: { | |
| 4 | - searchConditions: 'Search Conditions', | |
| 5 | - staffIdPlaceholder: 'Enter Staff ID', | |
| 6 | - staffNamePlaceholder: 'Enter Staff Name', | |
| 7 | - phonePlaceholder: 'Enter Phone Number', | |
| 8 | - search: 'Search', | |
| 9 | - staffInfo: 'Staff Information', | |
| 10 | - add: 'Add', | |
| 11 | - staffId: 'Staff ID', | |
| 12 | - name: 'Name', | |
| 13 | - phone: 'Phone', | |
| 14 | - relatedOrg: 'Related Organization', | |
| 15 | - position: 'Position', | |
| 16 | - idCard: 'ID Card', | |
| 17 | - address: 'Address', | |
| 18 | - gender: 'Gender', | |
| 19 | - male: 'Male', | |
| 20 | - female: 'Female', | |
| 21 | - operations: 'Operations', | |
| 22 | - edit: 'Edit', | |
| 23 | - resetPwd: 'Reset Password', | |
| 24 | - delete: 'Delete', | |
| 25 | - details: 'Details', | |
| 26 | - tip: 'Tip: The default password for new employees is 123456. After assigning roles and permissions to the community and associating roles with employees, they can log in.', | |
| 27 | - confirmOperation: 'Please confirm your operation', | |
| 28 | - confirmReset: 'Are you sure to reset the password?', | |
| 29 | - confirmResetPassword: 'Are you sure to reset the password?', | |
| 30 | - cancel: 'Cancel', | |
| 31 | - confirmResetBtn: 'Confirm Reset', | |
| 32 | - editStaff: 'Edit Staff', | |
| 33 | - requiredName: 'Required, enter staff name', | |
| 34 | - requiredPosition: 'Required, select position', | |
| 35 | - optionalIdCard: 'Optional, enter ID card', | |
| 36 | - requiredPhone: 'Required, enter phone number', | |
| 37 | - requiredGender: 'Required, select gender', | |
| 38 | - requiredAddress: 'Required, enter address', | |
| 39 | - uploadPhoto: 'Upload Photo', | |
| 40 | - confirmDelete: 'Are you sure to delete? Before deleting an employee, please confirm that the employee has completed the relevant approval process. After deletion, the relevant process cannot continue. Please operate with caution!', | |
| 41 | - confirmDeleteBtn: 'Confirm Delete' | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - zh: { | |
| 45 | - staff: { | |
| 46 | - searchConditions: '查询条件', | |
| 47 | - staffIdPlaceholder: '请输入员工ID', | |
| 48 | - staffNamePlaceholder: '请输入员工名称', | |
| 49 | - phonePlaceholder: '请输入手机号', | |
| 50 | - search: '查询', | |
| 51 | - staffInfo: '员工信息', | |
| 52 | - add: '添加', | |
| 53 | - staffId: '员工编号', | |
| 54 | - name: '名称', | |
| 55 | - phone: '手机号', | |
| 56 | - relatedOrg: '关联组织', | |
| 57 | - position: '岗位', | |
| 58 | - idCard: '身份证', | |
| 59 | - address: '地址', | |
| 60 | - gender: '性别', | |
| 61 | - male: '男', | |
| 62 | - female: '女', | |
| 63 | - operations: '操作', | |
| 64 | - edit: '修改', | |
| 65 | - resetPwd: '重置密码', | |
| 66 | - delete: '删除', | |
| 67 | - details: '详情', | |
| 68 | - tip: '温馨提示:新添加员工默认密码为123456,角色权限分配小区并且角色关联员工后可登录', | |
| 69 | - confirmOperation: '请确认您的操作', | |
| 70 | - confirmReset: '确认是否重置密码', | |
| 71 | - confirmResetPassword: '确认是否重置密码', | |
| 72 | - cancel: '点错了', | |
| 73 | - confirmResetBtn: '确认重置', | |
| 74 | - editStaff: '修改员工', | |
| 75 | - requiredName: '必填,请填写员工名称', | |
| 76 | - requiredPosition: '必填,请选择岗位', | |
| 77 | - optionalIdCard: '可选,请填写身份证', | |
| 78 | - requiredPhone: '必填,请填写手机号码', | |
| 79 | - requiredGender: '必填,请选择员工性别', | |
| 80 | - requiredAddress: '必填,请填写家庭住址', | |
| 81 | - uploadPhoto: '上传照片', | |
| 82 | - confirmDelete: '确认是否删除,删除员工前请确认员工已完成相关审批流程,删除后相关流程将无法继续进行,请慎重操作!', | |
| 83 | - confirmDeleteBtn: '确认删除' | |
| 84 | - } | |
| 85 | - } | |
| 3 | + // staff: { | |
| 4 | + // searchConditions: 'Search Conditions', | |
| 5 | + // staffIdPlaceholder: 'Enter Staff ID', | |
| 6 | + // staffNamePlaceholder: 'Enter Staff Name', | |
| 7 | + // phonePlaceholder: 'Enter Phone Number', | |
| 8 | + // search: 'Search', | |
| 9 | + // staffInfo: 'Staff Information', | |
| 10 | + // add: 'Add', | |
| 11 | + // staffId: 'Staff ID', | |
| 12 | + // name: 'Name', | |
| 13 | + // phone: 'Phone', | |
| 14 | + // relatedOrg: 'Related Organization', | |
| 15 | + // position: 'Position', | |
| 16 | + // idCard: 'ID Card', | |
| 17 | + // address: 'Address', | |
| 18 | + // gender: 'Gender', | |
| 19 | + // male: 'Male', | |
| 20 | + // female: 'Female', | |
| 21 | + // operations: 'Operations', | |
| 22 | + // edit: 'Edit', | |
| 23 | + // resetPwd: 'Reset Password', | |
| 24 | + // delete: 'Delete', | |
| 25 | + // details: 'Details', | |
| 26 | + // tip: 'Tip: The default password for new employees is 123456. After assigning roles and permissions to the community and associating roles with employees, they can log in.', | |
| 27 | + // confirmOperation: 'Please confirm your operation', | |
| 28 | + // confirmReset: 'Are you sure to reset the password?', | |
| 29 | + // confirmResetPassword: 'Are you sure to reset the password?', | |
| 30 | + // cancel: 'Cancel', | |
| 31 | + // confirmResetBtn: 'Confirm Reset', | |
| 32 | + // editStaff: 'Edit Staff', | |
| 33 | + // requiredName: 'Required, enter staff name', | |
| 34 | + // requiredPosition: 'Required, select position', | |
| 35 | + // optionalIdCard: 'Optional, enter ID card', | |
| 36 | + // requiredPhone: 'Required, enter phone number', | |
| 37 | + // requiredGender: 'Required, select gender', | |
| 38 | + // requiredAddress: 'Required, enter address', | |
| 39 | + // uploadPhoto: 'Upload Photo', | |
| 40 | + // confirmDelete: 'Are you sure to delete? Before deleting an employee, please confirm that the employee has completed the relevant approval process. After deletion, the relevant process cannot continue. Please operate with caution!', | |
| 41 | + // confirmDeleteBtn: 'Confirm Delete' | |
| 42 | + // } | |
| 43 | + // }, | |
| 44 | + // zh: { | |
| 45 | + // staff: { | |
| 46 | + // searchConditions: '查询条件', | |
| 47 | + // staffIdPlaceholder: '请输入员工ID', | |
| 48 | + // staffNamePlaceholder: '请输入员工名称', | |
| 49 | + // phonePlaceholder: '请输入手机号', | |
| 50 | + // search: '查询', | |
| 51 | + // staffInfo: '员工信息', | |
| 52 | + // add: '添加', | |
| 53 | + // staffId: '员工编号', | |
| 54 | + // name: '名称', | |
| 55 | + // phone: '手机号', | |
| 56 | + // relatedOrg: '关联组织', | |
| 57 | + // position: '岗位', | |
| 58 | + // idCard: '身份证', | |
| 59 | + // address: '地址', | |
| 60 | + // gender: '性别', | |
| 61 | + // male: '男', | |
| 62 | + // female: '女', | |
| 63 | + // operations: '操作', | |
| 64 | + // edit: '修改', | |
| 65 | + // resetPwd: '重置密码', | |
| 66 | + // delete: '删除', | |
| 67 | + // details: '详情', | |
| 68 | + // tip: '温馨提示:新添加员工默认密码为123456,角色权限分配小区并且角色关联员工后可登录', | |
| 69 | + // confirmOperation: '请确认您的操作', | |
| 70 | + // confirmReset: '确认是否重置密码', | |
| 71 | + // confirmResetPassword: '确认是否重置密码', | |
| 72 | + // cancel: '点错了', | |
| 73 | + // confirmResetBtn: '确认重置', | |
| 74 | + // editStaff: '修改员工', | |
| 75 | + // requiredName: '必填,请填写员工名称', | |
| 76 | + // requiredPosition: '必填,请选择岗位', | |
| 77 | + // optionalIdCard: '可选,请填写身份证', | |
| 78 | + // requiredPhone: '必填,请填写手机号码', | |
| 79 | + // requiredGender: '必填,请选择员工性别', | |
| 80 | + // requiredAddress: '必填,请填写家庭住址', | |
| 81 | + // uploadPhoto: '上传照片', | |
| 82 | + // confirmDelete: '确认是否删除,删除员工前请确认员工已完成相关审批流程,删除后相关流程将无法继续进行,请慎重操作!', | |
| 83 | + // confirmDeleteBtn: '确认删除' | |
| 84 | + // } | |
| 85 | + } | |
| 86 | 86 | } |
| 87 | 87 | \ No newline at end of file | ... | ... |
src/views/staff/addStaff.vue
src/views/staff/staffLang.js
| 1 | 1 | // views/staff/staffLang.js |
| 2 | 2 | export const messages = { |
| 3 | - en: { | |
| 4 | - staff: { | |
| 5 | - searchConditions: 'Search Conditions', | |
| 6 | - staffName: 'Staff Name', | |
| 7 | - phoneNumber: 'Phone Number', | |
| 8 | - staffId: 'Staff ID', | |
| 9 | - search: 'Search', | |
| 10 | - reset: 'Reset', | |
| 11 | - staffManagement: 'Staff Management', | |
| 12 | - add: 'Add', | |
| 13 | - staffNumber: 'Staff Number', | |
| 14 | - name: 'Name', | |
| 15 | - phone: 'Phone', | |
| 16 | - relatedOrg: 'Related Organization', | |
| 17 | - email: 'Email', | |
| 18 | - address: 'Address', | |
| 19 | - gender: 'Gender', | |
| 20 | - male: 'Male', | |
| 21 | - female: 'Female', | |
| 22 | - operations: 'Operations', | |
| 23 | - edit: 'Edit', | |
| 24 | - resetPassword: 'Reset Password', | |
| 25 | - delete: 'Delete', | |
| 26 | - details: 'Details', | |
| 27 | - tips: 'Tip: The default password for newly added staff is 123456. After assigning community permissions and associating roles with staff, they can log in.', | |
| 28 | - confirmOperation: 'Please confirm your operation', | |
| 29 | - confirmResetPassword: 'Are you sure to reset the password?', | |
| 30 | - wrongClick: 'Wrong click', | |
| 31 | - confirmReset: 'Confirm Reset', | |
| 32 | - modifyStaff: 'Modify Staff', | |
| 33 | - requiredName: 'Required, please enter staff name', | |
| 34 | - requiredPhone: 'Required, please enter phone number', | |
| 35 | - requiredGender: 'Required, please select gender', | |
| 36 | - requiredAddress: 'Required, please enter address', | |
| 37 | - optionalEmail: 'Optional, please enter email', | |
| 38 | - uploadPhoto: 'Upload Photo', | |
| 39 | - cancel: 'Cancel', | |
| 40 | - confirmDelete: 'Are you sure to delete? Before deleting staff, please confirm that the staff has completed the relevant approval process. After deletion, the relevant process will not be able to continue. Please operate carefully!', | |
| 41 | - confirmDeleteAction: 'Confirm Delete' | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - zh: { | |
| 45 | - staff: { | |
| 46 | - searchConditions: '查询条件', | |
| 47 | - staffName: '员工名称', | |
| 48 | - phoneNumber: '手机号', | |
| 49 | - staffId: '员工ID', | |
| 50 | - search: '查询', | |
| 51 | - reset: '重置', | |
| 52 | - staffManagement: '员工管理', | |
| 53 | - add: '添加', | |
| 54 | - staffNumber: '员工编号', | |
| 55 | - name: '名称', | |
| 56 | - phone: '手机号', | |
| 57 | - relatedOrg: '关联组织', | |
| 58 | - email: '邮箱', | |
| 59 | - address: '地址', | |
| 60 | - gender: '性别', | |
| 61 | - male: '男', | |
| 62 | - female: '女', | |
| 63 | - operations: '操作', | |
| 64 | - edit: '修改', | |
| 65 | - resetPassword: '重置密码', | |
| 66 | - delete: '删除', | |
| 67 | - details: '详情', | |
| 68 | - tips: '温馨提示:新添加员工默认密码为123456,角色权限分配小区并且角色关联员工后可登录', | |
| 69 | - confirmOperation: '请确认您的操作', | |
| 70 | - confirmResetPassword: '确认是否重置密码', | |
| 71 | - wrongClick: '点错了', | |
| 72 | - confirmReset: '确认重置', | |
| 73 | - modifyStaff: '修改员工', | |
| 74 | - requiredName: '必填,请填写员工名称', | |
| 75 | - requiredPhone: '必填,请填写手机号码', | |
| 76 | - requiredGender: '必填,请选择员工性别', | |
| 77 | - requiredAddress: '必填,请填写家庭住址', | |
| 78 | - optionalEmail: '可选,请填写员工名称', | |
| 79 | - uploadPhoto: '上传照片', | |
| 80 | - cancel: '取消', | |
| 81 | - confirmDelete: '确认是否删除,删除员工前请确认员工已完成相关审批流程,删除后相关流程将无法继续进行,请慎重操作!', | |
| 82 | - confirmDeleteAction: '确认删除' | |
| 83 | - } | |
| 3 | + en: { | |
| 4 | + staff: { | |
| 5 | + searchConditions: 'Search Conditions', | |
| 6 | + staffName: 'Staff Name', | |
| 7 | + phoneNumber: 'Phone Number', | |
| 8 | + staffId: 'Staff ID', | |
| 9 | + search: 'Search', | |
| 10 | + reset: 'Reset', | |
| 11 | + staffManagement: 'Staff Management', | |
| 12 | + add: 'Add', | |
| 13 | + staffNumber: 'Staff Number', | |
| 14 | + name: 'Name', | |
| 15 | + phone: 'Phone', | |
| 16 | + relatedOrg: 'Related Organization', | |
| 17 | + email: 'Email', | |
| 18 | + address: 'Address', | |
| 19 | + gender: 'Gender', | |
| 20 | + male: 'Male', | |
| 21 | + female: 'Female', | |
| 22 | + operations: 'Operations', | |
| 23 | + edit: 'Edit', | |
| 24 | + resetPassword: 'Reset Password', | |
| 25 | + delete: 'Delete', | |
| 26 | + details: 'Details', | |
| 27 | + tips: 'Tip: The default password for newly added staff is 123456. After assigning community permissions and associating roles with staff, they can log in.', | |
| 28 | + confirmOperation: 'Please confirm your operation', | |
| 29 | + confirmResetPassword: 'Are you sure to reset the password?', | |
| 30 | + wrongClick: 'Wrong click', | |
| 31 | + confirmReset: 'Confirm Reset', | |
| 32 | + modifyStaff: 'Modify Staff', | |
| 33 | + requiredName: 'Required, please enter staff name', | |
| 34 | + requiredPhone: 'Required, please enter phone number', | |
| 35 | + requiredGender: 'Required, please select gender', | |
| 36 | + requiredAddress: 'Required, please enter address', | |
| 37 | + optionalEmail: 'Optional, please enter email', | |
| 38 | + uploadPhoto: 'Upload Photo', | |
| 39 | + cancel: 'Cancel', | |
| 40 | + confirmDelete: 'Are you sure to delete? Before deleting staff, please confirm that the staff has completed the relevant approval process. After deletion, the relevant process will not be able to continue. Please operate carefully!', | |
| 41 | + confirmDeleteAction: 'Confirm Delete' | |
| 84 | 42 | } |
| 85 | - } | |
| 86 | 43 | \ No newline at end of file |
| 44 | + }, | |
| 45 | + zh: { | |
| 46 | + staff: { | |
| 47 | + searchConditions: '查询条件', | |
| 48 | + staffName: '员工名称', | |
| 49 | + phoneNumber: '手机号', | |
| 50 | + staffId: '员工ID', | |
| 51 | + search: '查询', | |
| 52 | + reset: '重置', | |
| 53 | + staffManagement: '员工管理', | |
| 54 | + add: '添加', | |
| 55 | + staffNumber: '员工编号', | |
| 56 | + name: '名称', | |
| 57 | + phone: '手机号', | |
| 58 | + relatedOrg: '关联组织', | |
| 59 | + email: '邮箱', | |
| 60 | + address: '地址', | |
| 61 | + gender: '性别', | |
| 62 | + male: '男', | |
| 63 | + female: '女', | |
| 64 | + operations: '操作', | |
| 65 | + edit: '修改', | |
| 66 | + resetPassword: '重置密码', | |
| 67 | + delete: '删除', | |
| 68 | + details: '详情', | |
| 69 | + tips: '温馨提示:新添加员工默认密码为123456,角色权限分配小区并且角色关联员工后可登录', | |
| 70 | + confirmOperation: '请确认您的操作', | |
| 71 | + confirmResetPassword: '确认是否重置密码', | |
| 72 | + wrongClick: '点错了', | |
| 73 | + confirmReset: '确认重置', | |
| 74 | + modifyStaff: '修改员工', | |
| 75 | + requiredName: '必填,请填写员工名称', | |
| 76 | + requiredPhone: '必填,请填写手机号码', | |
| 77 | + requiredGender: '必填,请选择员工性别', | |
| 78 | + requiredAddress: '必填,请填写家庭住址', | |
| 79 | + optionalEmail: '可选,请填写员工名称', | |
| 80 | + uploadPhoto: '上传照片', | |
| 81 | + cancel: '取消', | |
| 82 | + confirmDelete: '确认是否删除,删除员工前请确认员工已完成相关审批流程,删除后相关流程将无法继续进行,请慎重操作!', | |
| 83 | + confirmDeleteAction: '确认删除' | |
| 84 | + } | |
| 85 | + } | |
| 86 | +} | |
| 87 | 87 | \ No newline at end of file | ... | ... |
src/views/staff/staffList.vue
| ... | ... | @@ -20,11 +20,11 @@ |
| 20 | 20 | <el-col :span="6"> |
| 21 | 21 | <el-button type="primary" @click="_queryStaffMethod"> |
| 22 | 22 | <i class="el-icon-search"></i> |
| 23 | - {{ $t('staff.search') }} | |
| 23 | + {{ $t('common.search') }} | |
| 24 | 24 | </el-button> |
| 25 | 25 | <el-button @click="_resetStaffMethod"> |
| 26 | 26 | <i class="el-icon-refresh"></i> |
| 27 | - {{ $t('staff.reset') }} | |
| 27 | + {{ $t('common.reset') }} | |
| 28 | 28 | </el-button> |
| 29 | 29 | </el-col> |
| 30 | 30 | </el-row> |
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | <delete-staff :visible.sync="deleteStaffVisible" :staff-info="currentStaff" @success="handleSuccess" /> |
| 90 | 90 | </div> |
| 91 | 91 | </template> |
| 92 | - | |
| 92 | + | |
| 93 | 93 | <script> |
| 94 | 94 | import { queryStaffInfos, listOrgs } from '@/api/staff/staffApi' |
| 95 | 95 | import ResetStaffPwd from '@/components/staff/resetStaffPwd' |
| ... | ... | @@ -157,7 +157,7 @@ export default { |
| 157 | 157 | }, |
| 158 | 158 | created() { |
| 159 | 159 | this.loadData(1, 10) |
| 160 | - this._getOrgsByOrgLevelStaff(1, 10, 2, '') | |
| 160 | + //this._getOrgsByOrgLevelStaff(1, 10, 2, '') | |
| 161 | 161 | }, |
| 162 | 162 | methods: { |
| 163 | 163 | async loadData(page, size) { |
| ... | ... | @@ -169,8 +169,8 @@ export default { |
| 169 | 169 | ...this.staffInfo.conditions |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - const { data, records } = await queryStaffInfos(params) | |
| 173 | - this.staffData = data | |
| 172 | + const { staffs, records } = await queryStaffInfos(params) | |
| 173 | + this.staffData = staffs | |
| 174 | 174 | this.page.total = records |
| 175 | 175 | } catch (error) { |
| 176 | 176 | this.$message.error(error.message) |
| ... | ... | @@ -246,7 +246,7 @@ export default { |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | </script> |
| 249 | - | |
| 249 | + | |
| 250 | 250 | <style lang="scss" scoped> |
| 251 | 251 | .staff-container { |
| 252 | 252 | padding: 20px; | ... | ... |