部分模块增加中英文

This commit is contained in:
zhangshun
2026-05-28 14:50:55 +08:00
parent d8750f35fe
commit f7a4641a6f
18 changed files with 1525 additions and 624 deletions

View File

@@ -2,14 +2,16 @@
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" v-if="item.meta.title" :key="item.path">
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span> <span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ translateMenuTitle(item.meta.title) }}</span>
<router-link v-else :to="item.redirect||item.path">{{ item.meta.title }}</router-link> <router-link v-else :to="item.redirect||item.path">{{ translateMenuTitle(item.meta.title) }}</router-link>
</el-breadcrumb-item> </el-breadcrumb-item>
</transition-group> </transition-group>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
<script> <script>
import { translateMenuTitle } from '@/utils/i18n'
export default { export default {
data() { data() {
return { return {
@@ -25,6 +27,7 @@ export default {
this.getBreadcrumb() this.getBreadcrumb()
}, },
methods: { methods: {
translateMenuTitle,
getBreadcrumb() { getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.name) let matched = this.$route.matched.filter(item => item.name)
const first = matched[0] const first = matched[0]

View File

@@ -10,5 +10,399 @@ export default {
language: 'Language', language: 'Language',
chinese: 'Chinese', chinese: 'Chinese',
english: 'English' english: 'English'
},
login: {
systemName: 'Intelligent Assembly Line Information Management System',
usernamePlaceholder: 'Please enter username',
passwordPlaceholder: 'Please enter password',
rememberPassword: 'Remember password',
changePassword: 'Change password',
loginButton: 'Login',
account: 'Attendance No.',
oldPassword: 'Old password',
newPassword: 'New password',
confirmPassword: 'Confirm password',
confirmPasswordPlaceholder: 'Please enter confirm password',
oldPasswordPlaceholder: 'Please enter old password',
newPasswordPlaceholder: 'Please enter new password',
passwordNotSame: 'The two passwords do not match',
changeSuccess: 'Changed successfully',
editFailed: 'Edit failed',
accountPasswordError: 'Incorrect username or password'
},
menuManagement: {
filterPlaceholder: 'Enter keyword to filter',
menuName: 'Menu Name',
firstLevelMenuName: 'First-Level Menu',
secondLevelMenuName: 'Second-Level Menu',
roleName: 'Role Name',
role: 'Role:',
selectPlaceholder: 'Please select',
sequence: 'No.',
addFirstLevelModule: 'Add First-Level Menu',
assignFirstLevelTooltip: 'Assign the selected first-level menu to this role',
assignSecondLevelTooltip: 'Assign the selected second-level menu to the selected first-level menu of this role',
moveUp: 'Move Up',
moveDown: 'Move Down',
remove: 'Remove',
prompt: 'Prompt',
confirmReturnMenu: 'Confirm removing the assigned menu?',
confirmAssignFirstLevelMenu: 'Confirm assigning the selected first-level menu to the selected role?',
confirmAssignSecondLevelMenu: 'Confirm assigning the selected second-level menu to the selected first-level menu of the selected role?',
operationSuccess: 'Operation succeeded',
operationFailed: 'Operation failed',
operationCanceled: 'Operation canceled',
moveUpSuccess: 'Moved up successfully',
moveUpFailed: 'Failed to move up',
alreadyFirst: 'The current item is already first',
alreadyLast: 'The current item is already last',
assignOneFirstLevelOnly: 'Can only assign to one first-level menu',
requiredInput: 'Please enter'
},
personnelManagement: {
add: 'Add',
edit: 'Edit',
delete: 'Delete',
peopleName: 'Employee Name:',
peopleNamePlaceholder: 'Please enter employee name',
resign: 'Resign',
resignedList: 'Resigned List',
move: 'Move',
selectDepartmentPlaceholder: 'Please select department',
departmentMaintenance: 'Department Maintenance',
expand: 'Expand',
sequence: 'No.',
departmentName: 'Dep. Name',
attendanceNo: 'Employee ID',
jobNo: 'Employee ID',
password: 'Password',
employeeName: 'User Name',
operation: 'Operation',
addDepartment: 'Add Department',
editDepartment: 'Edit Department',
addEmployee: 'Add Employee',
editEmployeeTitle: 'Edit Employee',
uploadPicture: 'Upload Picture',
prompt: 'Prompt',
requiredInput: 'Please enter',
confirmDeleteResignedEmployee: 'This action will permanently delete the resigned employee record. Continue?',
confirmDeleteImage: 'This action will permanently delete the image. Continue?',
confirmDeleteDepartment: 'This action will permanently delete this data. Continue?',
confirmResign: 'This action will permanently remove this row. Continue?',
deleteSuccess: 'Deleted successfully',
deleteFailed: 'Delete failed',
deleteCanceled: 'Delete canceled',
cancelDelete: 'Deletion canceled',
uploadSuccess: 'Uploaded successfully!',
imageOnly: 'Only image files can be uploaded',
uploadLimitOne: 'Only one photo can be uploaded',
selectDepartmentToEdit: 'Please select the department to edit',
addSuccess: 'Added successfully',
addFailed: 'Add failed',
editSuccess: 'Edited successfully',
editFailed: 'Edit failed',
deleteCompleted: 'Deleted successfully',
selectDepartment: 'Please select department',
enterPeopleName: 'Please enter employee name',
selectDepartmentName: 'Please select department name',
selectEmployeesForResign: 'Please select employees to resign',
resignSuccess: 'Resigned successfully',
resignFailed: 'Resign failed',
resignCanceled: 'Resign operation canceled',
moveGroupSuccess: 'Moved successfully',
updateFailed: 'Update failed',
selectAtLeastOnePerson: 'Please select at least one person'
},
systemRoleMaintenance: {
add: 'Add',
roleCode: 'Role Code',
roleFunction: 'Role Function',
operation: 'Operation',
addRole: 'Add Role',
editRole: 'Edit Role',
roleName: 'Role Name',
roleFunctionPlaceholder: 'Role function',
enterRoleName: 'Please enter role name',
prompt: 'Prompt',
addSuccess: 'Added successfully',
addFailed: 'Add failed',
editSuccess: 'Edited successfully',
editFailed: 'Edit failed',
confirmDelete: 'This action will permanently delete this row. Continue?',
deleteSuccess: 'Deleted successfully',
deleteFailed: 'Delete failed',
deleteCanceled: 'Delete canceled'
},
workshopPersonnelRoleMana: {
staffName: 'Staff Name',
roleName: 'Role Name',
search: 'Search',
add: 'Add',
edit: 'Edit',
sequence: 'No.',
departmentName: 'Department',
attendanceNo: 'Attendance No.',
operation: 'Operation',
personnelInfo: 'Personnel Info',
name: 'Name',
gender: 'Gender',
doubleClickSelect: 'Double-click to select',
selectStaffName: 'Please select employee name',
selectStaffRole: 'Please select employee role',
prompt: 'Prompt',
addSuccess: 'Added successfully',
addFailed: 'Add failed',
editSuccess: 'Updated successfully',
editFailed: 'Update failed',
confirmDelete: 'This action will permanently delete this row. Continue?',
deleteSuccess: 'Deleted successfully',
deleteFailed: 'Delete failed',
deleteCanceled: 'Delete canceled'
},
stationInformationMaintenance: {
sequence: 'No.',
stationNumber: 'Station No.',
stationName: 'Station Name',
stationMESFunction: 'MES Function',
enabled: 'Enabled',
disabled: 'Disabled',
mesDll: 'MES_DLL',
operation: 'Operation',
edit: 'Edit',
add: 'Add',
addStationInfo: 'Add Station Info',
editStationInfo: 'Edit Station Info',
electricalComponents: 'Electrical Components',
number: 'Number',
description: 'Description',
disabledStatus: 'Disabled Status',
remarks: 'Remarks',
import: 'Import',
importToDatabase: 'Import to Database',
enterStationName: 'Please enter station name',
selectStationMES: 'Please select whether to enable station MES',
prompt: 'Prompt',
addSuccess: 'Added successfully',
addFailed: 'Add failed!',
editSuccess: 'Updated successfully',
editFailed: 'Update failed!',
deleteSuccess: 'Deleted successfully',
deleteFailed: 'Delete failed!',
deleteCanceled: 'Delete canceled',
duplicateStationCode: 'Duplicate station code. Please re-enter.',
confirmClose: 'Confirm close?',
noData: 'No data',
selectRowToCopy: 'Please select a row to copy.',
confirmDelete: 'This action will permanently delete this row. Continue?',
alreadyExistsCheckFile: ' already exists. Please check whether the file is correct',
stationNumberRequired: 'Station number cannot be empty',
confirmImportFile: 'Please check whether the import file is correct',
importCompleted: 'Import completed',
importFailedCountPrefix: 'Import failed count: ',
importFailedCountSuffix: '. Please check whether the file is correct',
importDataErrorFile: 'Import data error. Please check whether the import file is correct',
importFailedForStation: ' import failed',
duplicateDataForStation: ' has duplicate data',
importDataError: 'Import data error'
},
releaseOfProductionPlan: {
orderNumberLabel: 'Order No.',
filterOrderNumber: 'Please enter order number',
productModelLabel: 'Product Model',
selectProductModel: 'Please select product model',
startDateLabel: 'Start Date',
endDateLabel: 'End Date',
selectStartDate: 'Please select start date',
selectEndDate: 'Please select end date',
searchOrder: 'Search',
createOrder: 'Create Order',
loadingData: 'Loading data',
sort: 'Sort',
sequence: 'No.',
crankcaseAssemblyNo: 'Crankcase Assembly No.',
onlineTime: 'Online Time',
offlineTime: 'Offline Time',
orderNumber: 'Order No.',
productModel: 'Pro. Model',
planQuantity: 'Planned Qty',
planStartDate: 'Planned Start Time',
planEndDate: 'Planned Finish Time',
productionStatus: 'Production Status',
notStarted: 'Not Started',
inProduction: 'In Production',
completed: 'Completed',
operation: 'Operation',
completeOrder: 'Complete',
modify: 'Edit',
delete: 'Delete',
issue: 'Issue',
withdraw: 'Withdraw',
moveUp: 'Up',
moveDown: 'Down',
createProductionOrder: 'Create Production Order',
editProductionOrder: 'Edit Production Order',
enterOrderNumber: 'Please enter order number',
enterPlanQuantity: 'Please enter planned quantity',
planStartTime: 'Start Time',
planEndTime: 'Finish Time',
selectStartTime: 'Please select start time',
selectEndTime: 'Please select end time',
orderImport: 'Order Import',
importToDatabase: 'Import to Database',
printTransmissionBarcode: 'Print Transmission Barcode',
enterProductModel: 'Please enter product model',
assemblyNo: 'Assembly No.',
enterAssemblyNo: 'Please enter assembly number',
serialNo: 'Start Serial No.',
enterEightDigitSerialNo: 'Please enter an 8-digit start serial number',
printDate: 'Print Date',
selectPrintDate: 'Please select print date',
printQuantity: 'Print Quantity',
enterPrintQuantity: 'Please enter print quantity',
printProgress: 'Print Progress: ',
enterAssemblyNoRequired: 'Please enter assembly number',
enterOrderNumberRequired: 'Please enter order number',
enterProductModelRequired: 'Please enter product model',
serialNoMinLength: 'Minimum length is 8 characters',
selectPrintDateRequired: 'Please select print date',
enterPrintQuantityRequired: 'Please enter print quantity',
enterPlanQuantityRequired: 'Please enter planned quantity',
selectEngineTypeRequired: 'Please select model',
selectAssemblyNoRequired: 'Please select assembly number',
selectPlanStartTimeRequired: 'Please select planned start time',
selectPlanEndTimeRequired: 'Please select planned finish time',
enterPlannedCompletionRequired: 'Please enter planned completion quantity',
enterIssuedQuantityRequired: 'Please enter issued quantity',
prompt: 'Prompt',
noPartCodeForModel: 'No part number is mapped to this model',
orderCreateSuccess: 'Order created successfully',
orderDuplicateCreateFailed: 'Duplicate order. Creation failed!',
orderCreateFailed: 'Order creation failed!',
startPrintingTransmissionBarcode: 'Start printing transmission barcodes',
printTransmissionBarcodeFailed: 'Failed to print transmission barcode!',
allBarcodesPrinted: 'All barcodes printed',
recordFailed: 'Record failed!',
confirmDeleteOrder: 'This action will permanently delete this row. Continue?',
orderDeleteSuccess: 'Order deleted successfully',
orderDeleteFailed: 'Order deletion failed!',
deleteCanceled: 'Deletion canceled',
orderEditSuccess: 'Order updated successfully',
confirmIssueOrder: 'Confirm issuing order {orderNo}?',
orderIssueSuccess: 'Order issued successfully!',
orderIssueFailed: 'Order issuance failed!',
confirmWithdrawOrder: 'Confirm withdrawing order {orderNo}?',
orderWithdrawSuccess: 'Order withdrawn successfully!',
orderWithdrawFailed: 'Order withdrawal failed!',
contentEmpty: 'Content is empty',
materialDictionaryUpdated: 'Material dictionary updated successfully',
alreadyExistsCheckFile: '{name} already exists. Please check whether the file is correct',
orderNumberRequired: 'Order number cannot be empty',
planQuantityRequired: 'Planned quantity cannot be empty',
confirmImportFile: 'Please check whether the import file is correct',
importCompleted: 'Import completed',
importFailedCount: 'Import failed count: {count}. Please check whether the file is correct',
importDataErrorFile: 'Import data error. Please check whether the import file is correct',
importFailedSuffix: '{value} import failed',
duplicateDataSuffix: '{value} has duplicate data',
importDataError: 'Import data error',
noData: 'No data',
selectOrder: 'Please select an order!',
confirmCompleteOrder: 'Confirm early completion for order {orderNo}?'
},
menu: {
'主页': 'Home',
'菜单管理': 'Menus',
'系统管理': 'Admin',
'工厂日历': 'Calendar',
'人员管理': 'Users',
'系统角色维护': 'Roles',
'人员角色分配': 'User Roles',
'生产计划管理': 'Prod. Planning',
'生产计划': 'Prod. Plan',
'计划状态查看': 'Plan Status',
'工艺管理': 'Process',
'MES消息维护': 'MES Message',
'界面标签语言维护': 'UI Labels',
'界面模块维护': 'UI Modules',
'检查内容维护': 'Inspection',
'工艺图片维护': 'Process Images',
'物料扫码维护': 'Material Scan',
'工艺PDF维护': 'Process PDFs',
'Andon呼叫维护': 'Andon Calls',
'工艺参数维护': 'Process Params',
'测量范围维护': 'Meas. Range',
'工艺节拍维护': 'Takt Time',
'拧紧位置维护': 'Tightening',
'线外工位验证维护': 'Offline Verify',
'质量管理': 'Quality',
'质量数据查询': 'Quality Data',
'物料数据查询': 'Material Data',
'过站信息查询': 'Station Pass',
'分线质量查询': 'Line Quality',
'分线物料查询': 'Line Material',
'生产计划订单完工': 'Order Complete',
'SPC分析': 'SPC Analysis',
'基本趋势图': 'Trend Chart',
'样本趋势图': 'Sample Trend',
'直方图': 'Histogram',
'工序能力分析': 'Process Capability',
'排列图': 'Pareto',
'均值极差图': 'Xbar-R',
'均值标准差图': 'Xbar-S',
'SPC': 'SPC',
'设备运行分析': 'Equip. Ops',
'设备基本信息维护': 'Equip. Info',
'设备状态监控': 'Equip. Status',
'设备维修记录': 'Repair Records',
'设备实时状态': 'Live Status',
'设备保养计划': 'Maint. Plan',
'设备保养内容': 'Maint. Content',
'设备当前保养计划': 'Current Maint.',
'设备能耗信息': 'Energy Usage',
'ANDON系统': 'ANDON',
'物料ANDON查询': 'Material ANDON',
'物料ANDON统计': 'Material ANDON',
'质量ANDON查询': 'Quality ANDON',
'质量ANDON统计': 'Quality ANDON',
'设备ANDON查询': 'Equip. ANDON',
'设备ANDON统计': 'Equip. Stats',
'班次管理': 'Shifts',
'配方管理': 'Recipes',
'基础数据管理': 'Basic Data',
'产品型号': 'Product Model',
'电气元件参数': 'Elec. Params',
'基础数据维护': 'Basic Data',
'工位信息维护': 'Station Info',
'基本变量写入': 'Write Variable',
'分配工位号': 'Assign Station',
'基本变量查询': 'Query Variable',
'变量设备类型维护': 'Var. Equip. Types',
'FTT趋势图': 'FTT Trend',
'JPH趋势图': 'JPH Trend',
'OEE趋势图': 'OEE Trend',
'点检信息维护': 'Spot Check',
'点检记录查询': 'Spot Check Logs',
'报警变量维护': 'Alarm Vars',
'监控数据查询': 'Monitor Data',
'BOM管理': 'BOM',
'工序工位计划管理': 'Station Plans',
'系统日志': 'System Logs',
'扫码记录': 'Scan Logs',
'工位录入项维护': 'Station Inputs',
'工位录入查询': 'Station Logs',
'每日数据统计': 'Daily Stats',
'工位报警日志': 'Station Alarms',
'停机记录查询': 'Downtime',
'检查记录查询': 'Inspection Logs',
'工位呼叫统计': 'Call Stats',
'类型呼叫统计': 'Call Type Stats',
'接口维护': 'Interfaces',
'接口列表': 'Interface List',
'工位接口设置': 'IF Settings',
'工位接口监控': 'IF Monitor',
'首件管理': 'First Article',
'数据录入': 'Data Entry',
'检测项维护': 'Inspect Items',
'看板参数管理': 'TV Params'
} }
} }

View File

@@ -10,5 +10,399 @@ export default {
language: '语言', language: '语言',
chinese: '中文', chinese: '中文',
english: 'English' english: 'English'
},
login: {
systemName: '智能装配线信息管理系统',
usernamePlaceholder: '请输入用户名',
passwordPlaceholder: '请输入密码',
rememberPassword: '记住密码',
changePassword: '修改密码',
loginButton: '登录',
account: '考勤编号',
oldPassword: '原始密码',
newPassword: '新密码',
confirmPassword: '确认密码',
confirmPasswordPlaceholder: '请输入确认密码',
oldPasswordPlaceholder: '请输入原始密码',
newPasswordPlaceholder: '请输入新密码',
passwordNotSame: '两次输入密码不同',
changeSuccess: '修改成功',
editFailed: '编辑失败',
accountPasswordError: '用户名或密码不正确'
},
menuManagement: {
filterPlaceholder: '输入关键字进行过滤',
menuName: '菜单名称',
firstLevelMenuName: '一级菜单名称',
secondLevelMenuName: '二级菜单名称',
roleName: '角色名称',
role: '角色:',
selectPlaceholder: '请选择',
sequence: '序号',
addFirstLevelModule: '新增一级菜单',
assignFirstLevelTooltip: '将选中一级菜单分配给该角色',
assignSecondLevelTooltip: '将选中二级菜单分配给该角色选中的一级菜单',
moveUp: '上移',
moveDown: '下移',
remove: '移除',
prompt: '提示',
confirmReturnMenu: '确定撤回分配菜单?',
confirmAssignFirstLevelMenu: '确定将选中的一级菜单分配给选中角色?',
confirmAssignSecondLevelMenu: '确定将选中的二级菜单分配给选中角色的选中一级菜单?',
operationSuccess: '操作成功',
operationFailed: '操作失败',
operationCanceled: '取消操作',
moveUpSuccess: '上移成功',
moveUpFailed: '上移失败',
alreadyFirst: '当前已经排在第一',
alreadyLast: '当前已经排在最后',
assignOneFirstLevelOnly: '只可以分配给一个一级菜单',
requiredInput: '请输入'
},
personnelManagement: {
add: '新增',
edit: '编辑',
delete: '删除',
peopleName: '人员名称:',
peopleNamePlaceholder: '请输入人员名称',
resign: '离职',
resignedList: '离职名单',
move: '移动',
selectDepartmentPlaceholder: '请选择部门',
departmentMaintenance: '部门维护',
expand: '展开',
sequence: '序号',
departmentName: '部门名称',
attendanceNo: '考勤编号',
jobNo: '工号',
password: '密码',
employeeName: '姓名',
operation: '操作',
addDepartment: '新增部门',
editDepartment: '编辑部门',
addEmployee: '新增人员',
editEmployeeTitle: '编辑人员',
uploadPicture: '上传图片',
prompt: '提示',
requiredInput: '请输入',
confirmDeleteResignedEmployee: '此操作将永久删除该离职员工信息, 是否继续?',
confirmDeleteImage: '此操作将永久删除该图片, 是否继续?',
confirmDeleteDepartment: '此操作将永久删除该数据, 是否继续?',
confirmResign: '此操作将永久删除该行, 是否继续?',
deleteSuccess: '删除成功',
deleteFailed: '删除失败',
deleteCanceled: '已取消删除',
cancelDelete: '取消删除',
uploadSuccess: '上传成功!',
imageOnly: '只能上传图片',
uploadLimitOne: '仅可上传一张照片',
selectDepartmentToEdit: '请选择要修改的部门',
addSuccess: '添加成功',
addFailed: '添加失败',
editSuccess: '编辑成功',
editFailed: '编辑失败',
deleteCompleted: '已被成功删除',
selectDepartment: '请选择部门',
enterPeopleName: '请输入人员姓名',
selectDepartmentName: '请选择部门名称',
selectEmployeesForResign: '请选择进行离职操作的员工',
resignSuccess: '离职成功',
resignFailed: '离职失败',
resignCanceled: '已取消离职操作',
moveGroupSuccess: '移组成功',
updateFailed: '更新失败',
selectAtLeastOnePerson: '请至少选择一个人员'
},
systemRoleMaintenance: {
add: '增加',
roleCode: '角色编号',
roleFunction: '角色功能',
operation: '操作',
addRole: '新增角色',
editRole: '编辑角色',
roleName: '角色名称',
roleFunctionPlaceholder: '角色功能',
enterRoleName: '请输入角色名称',
prompt: '提示',
addSuccess: '增加成功',
addFailed: '增加失败',
editSuccess: '编辑成功',
editFailed: '编辑失败',
confirmDelete: '此操作将永久删除该行, 是否继续?',
deleteSuccess: '删除成功',
deleteFailed: '删除失败',
deleteCanceled: '已取消删除'
},
workshopPersonnelRoleMana: {
staffName: '员工姓名',
roleName: '角色名称',
search: '查询',
add: '增加',
edit: '编辑',
sequence: '序号',
departmentName: '所属部门',
attendanceNo: '考勤编号',
operation: '操作',
personnelInfo: '人员信息',
name: '姓名',
gender: '性别',
doubleClickSelect: '请双击选择',
selectStaffName: '请选择员工姓名',
selectStaffRole: '请选择员工角色',
prompt: '提示',
addSuccess: '增加成功',
addFailed: '增加失败',
editSuccess: '修改成功',
editFailed: '修改失败',
confirmDelete: '此操作将永久删除该行, 是否继续?',
deleteSuccess: '删除成功',
deleteFailed: '删除失败',
deleteCanceled: '已取消删除'
},
stationInformationMaintenance: {
sequence: '序号',
stationNumber: '工位号',
stationName: '工位名称',
stationMESFunction: '工位MES功能',
enabled: '启用',
disabled: '禁用',
mesDll: 'MES_DLL',
operation: '操作',
edit: '编辑',
add: '增加',
addStationInfo: '添加工位信息',
editStationInfo: '编辑工位信息',
electricalComponents: '电气元器件',
number: '编号',
description: '描述',
disabledStatus: '是否禁用',
remarks: '备注',
import: '导入',
importToDatabase: '导入到数据库',
enterStationName: '请输入工位名称',
selectStationMES: '请选择是否启用工位MES',
prompt: '提示',
addSuccess: '增加成功',
addFailed: '增加失败!',
editSuccess: '修改成功',
editFailed: '修改失败!',
deleteSuccess: '删除成功',
deleteFailed: '删除失败!',
deleteCanceled: '已取消删除',
duplicateStationCode: '工位代码重复,请重新输入!',
confirmClose: '确认关闭?',
noData: '暂无数据',
selectRowToCopy: '请选中一行信息进行复制!',
confirmDelete: '此操作将永久删除该行, 是否继续?',
alreadyExistsCheckFile: '已经存在,请确认文件是否正确',
stationNumberRequired: '工位号不能为空',
confirmImportFile: '请确认导入文件是否正确',
importCompleted: '导入完成',
importFailedCountPrefix: '导入失败零件个数为',
importFailedCountSuffix: ',请检查文件是否正确',
importDataErrorFile: '导入数据错误,请检查导入文件是否正确',
importFailedForStation: '导入失败',
duplicateDataForStation: '存在重复数据',
importDataError: '导入数据错误'
},
releaseOfProductionPlan: {
orderNumberLabel: '订单号',
filterOrderNumber: '请输入订单号',
productModelLabel: '产品型号',
selectProductModel: '请选择产品型号',
startDateLabel: '开始日期',
endDateLabel: '结束日期',
selectStartDate: '请选择开始日期',
selectEndDate: '请选择结束日期',
searchOrder: '查询',
createOrder: '创建订单',
loadingData: '数据加载中',
sort: '排序',
sequence: '序号',
crankcaseAssemblyNo: '曲轴箱总成号',
onlineTime: '上线时间',
offlineTime: '下线时间',
orderNumber: '订单号',
productModel: '产品型号',
planQuantity: '计划数量',
planStartDate: '计划开始时间',
planEndDate: '计划完成时间',
productionStatus: '生产状态',
notStarted: '未开始',
inProduction: '生产中',
completed: '已完成',
operation: '操作',
completeOrder: '完工',
modify: '修改',
delete: '删除',
issue: '下发',
withdraw: '撤回',
moveUp: '上移',
moveDown: '下移',
createProductionOrder: '创建生产订单',
editProductionOrder: '修改生产订单',
enterOrderNumber: '请输入订单号',
enterPlanQuantity: '请输入计划数量',
planStartTime: '计划开始时间',
planEndTime: '计划完成时间',
selectStartTime: '请选择开始时间',
selectEndTime: '请选择结束时间',
orderImport: '订单导入',
importToDatabase: '导入到数据库',
printTransmissionBarcode: '打印变速器条码',
enterProductModel: '请输入产品型号',
assemblyNo: '总成号',
enterAssemblyNo: '请输入总成号',
serialNo: '起始号码',
enterEightDigitSerialNo: '请输入八位起始号码',
printDate: '打印日期',
selectPrintDate: '请选择打印日期',
printQuantity: '打印数量',
enterPrintQuantity: '请输入打印数量',
printProgress: '打印进度:',
enterAssemblyNoRequired: '请输入总成号',
enterOrderNumberRequired: '请输入订单号',
enterProductModelRequired: '请输入产品型号',
serialNoMinLength: '长度最少为八位',
selectPrintDateRequired: '请选择打印日期',
enterPrintQuantityRequired: '请输入打印数量',
enterPlanQuantityRequired: '请输入计划数量',
selectEngineTypeRequired: '请选择机型',
selectAssemblyNoRequired: '请选择总成号',
selectPlanStartTimeRequired: '请选择计划开始时间',
selectPlanEndTimeRequired: '请选择计划结束时间',
enterPlannedCompletionRequired: '请输入计划完成数量',
enterIssuedQuantityRequired: '请输入订单下发数量',
prompt: '提示',
noPartCodeForModel: '该机型没有对应的零件号',
orderCreateSuccess: '订单创建成功',
orderDuplicateCreateFailed: '订单重复,创建失败!',
orderCreateFailed: '订单创建失败!',
startPrintingTransmissionBarcode: '开始打印变速器条码',
printTransmissionBarcodeFailed: '打印变速器条码失败!',
allBarcodesPrinted: '全部条码打印完成',
recordFailed: '记录失败!',
confirmDeleteOrder: '此操作将永久删除该行, 是否继续?',
orderDeleteSuccess: '订单删除成功',
orderDeleteFailed: '订单删除失败!',
deleteCanceled: '已取消删除',
orderEditSuccess: '订单修改成功',
confirmIssueOrder: '确定下达订单{orderNo}吗?',
orderIssueSuccess: '订单下发成功!',
orderIssueFailed: '订单下发失败!',
confirmWithdrawOrder: '确定取消订单{orderNo}吗?',
orderWithdrawSuccess: '订单撤回成功!',
orderWithdrawFailed: '订单撤回失败!',
contentEmpty: '内容为空',
materialDictionaryUpdated: '物料字典信息更新成功',
alreadyExistsCheckFile: '{name}已经存在,请确认文件是否正确',
orderNumberRequired: '订单号不能为空',
planQuantityRequired: '计划数量不能为空',
confirmImportFile: '请确认导入文件是否正确',
importCompleted: '导入完成',
importFailedCount: '导入失败零件个数为{count},请检查文件是否正确',
importDataErrorFile: '导入数据错误,请检查导入文件是否正确',
importFailedSuffix: '{value}导入失败',
duplicateDataSuffix: '{value}存在重复数据',
importDataError: '导入数据错误',
noData: '暂无数据',
selectOrder: '请选择订单!',
confirmCompleteOrder: '确定要提前完工订单:{orderNo}吗?'
},
menu: {
'主页': '主页',
'菜单管理': '菜单管理',
'系统管理': '系统管理',
'工厂日历': '工厂日历',
'人员管理': '人员管理',
'系统角色维护': '系统角色维护',
'人员角色分配': '人员角色分配',
'生产计划管理': '生产计划管理',
'生产计划': '生产计划',
'计划状态查看': '计划状态查看',
'工艺管理': '工艺管理',
'MES消息维护': 'MES消息维护',
'界面标签语言维护': '界面标签语言维护',
'界面模块维护': '界面模块维护',
'检查内容维护': '检查内容维护',
'工艺图片维护': '工艺图片维护',
'物料扫码维护': '物料扫码维护',
'工艺PDF维护': '工艺PDF维护',
'Andon呼叫维护': 'Andon呼叫维护',
'工艺参数维护': '工艺参数维护',
'测量范围维护': '测量范围维护',
'工艺节拍维护': '工艺节拍维护',
'拧紧位置维护': '拧紧位置维护',
'线外工位验证维护': '线外工位验证维护',
'质量管理': '质量管理',
'质量数据查询': '质量数据查询',
'物料数据查询': '物料数据查询',
'过站信息查询': '过站信息查询',
'分线质量查询': '分线质量查询',
'分线物料查询': '分线物料查询',
'生产计划订单完工': '生产计划订单完工',
'SPC分析': 'SPC分析',
'基本趋势图': '基本趋势图',
'样本趋势图': '样本趋势图',
'直方图': '直方图',
'工序能力分析': '工序能力分析',
'排列图': '排列图',
'均值极差图': '均值极差图',
'均值标准差图': '均值标准差图',
'SPC': 'SPC',
'设备运行分析': '设备运行分析',
'设备基本信息维护': '设备基本信息维护',
'设备状态监控': '设备状态监控',
'设备维修记录': '设备维修记录',
'设备实时状态': '设备实时状态',
'设备保养计划': '设备保养计划',
'设备保养内容': '设备保养内容',
'设备当前保养计划': '设备当前保养计划',
'设备能耗信息': '设备能耗信息',
'ANDON系统': 'ANDON系统',
'物料ANDON查询': '物料ANDON查询',
'物料ANDON统计': '物料ANDON统计',
'质量ANDON查询': '质量ANDON查询',
'质量ANDON统计': '质量ANDON统计',
'设备ANDON查询': '设备ANDON查询',
'设备ANDON统计': '设备ANDON统计',
'班次管理': '班次管理',
'配方管理': '配方管理',
'基础数据管理': '基础数据管理',
'产品型号': '产品型号',
'电气元件参数': '电气元件参数',
'基础数据维护': '基础数据维护',
'工位信息维护': '工位信息维护',
'基本变量写入': '基本变量写入',
'分配工位号': '分配工位号',
'基本变量查询': '基本变量查询',
'变量设备类型维护': '变量设备类型维护',
'FTT趋势图': 'FTT趋势图',
'JPH趋势图': 'JPH趋势图',
'OEE趋势图': 'OEE趋势图',
'点检信息维护': '点检信息维护',
'点检记录查询': '点检记录查询',
'报警变量维护': '报警变量维护',
'监控数据查询': '监控数据查询',
'BOM管理': 'BOM管理',
'工序工位计划管理': '工序工位计划管理',
'系统日志': '系统日志',
'扫码记录': '扫码记录',
'工位录入项维护': '工位录入项维护',
'工位录入查询': '工位录入查询',
'每日数据统计': '每日数据统计',
'工位报警日志': '工位报警日志',
'停机记录查询': '停机记录查询',
'检查记录查询': '检查记录查询',
'工位呼叫统计': '工位呼叫统计',
'类型呼叫统计': '类型呼叫统计',
'接口维护': '接口维护',
'接口列表': '接口列表',
'工位接口设置': '工位接口设置',
'工位接口监控': '工位接口监控',
'首件管理': '首件管理',
'数据录入': '数据录入',
'检测项维护': '检测项维护',
'看板参数管理': '看板参数管理'
} }
} }

14
src/utils/i18n.js Normal file
View File

@@ -0,0 +1,14 @@
import i18n, { DEFAULT_LOCALE } from '@/lang'
export function translateMenuTitle(title, locale) {
if (!title) return title
const normalizedTitle = String(title).trim()
const currentLocale = locale || i18n.locale
const messages = i18n.getLocaleMessage(currentLocale) || {}
const defaultMessages = i18n.getLocaleMessage(DEFAULT_LOCALE) || {}
const menuMessages = messages.menu || {}
const defaultMenuMessages = defaultMessages.menu || {}
return menuMessages[normalizedTitle] || defaultMenuMessages[normalizedTitle] || title
}

View File

@@ -7,7 +7,7 @@
<!-- </el-card>--> <!-- </el-card>-->
<el-card style="height: 550px"> <el-card style="height: 550px">
<div slot="header"> <div slot="header">
<el-input v-model="filterTextLeft" clearable placeholder="输入关键字进行过滤" size="small"/> <el-input v-model="filterTextLeft" clearable :placeholder="$t('menuManagement.filterPlaceholder')" size="small"/>
</div> </div>
<el-table <el-table
ref="multipleTableLeft" ref="multipleTableLeft"
@@ -19,16 +19,16 @@
@selection-change="handleSelectionChangeLeft"> @selection-change="handleSelectionChangeLeft">
<el-table-column :selectable="selectable" align="center" type="selection" width="55"/> <el-table-column :selectable="selectable" align="center" type="selection" width="55"/>
<el-table-column align="center" type="index" width="60"/> <el-table-column align="center" type="index" width="60"/>
<el-table-column align="center" label="模块名称"> <el-table-column align="center" :label="$t('menuManagement.firstLevelMenuName')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.title }} {{ translateMenuTitle(scope.row.title) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
<el-tooltip class="item" content="将选中一级菜单分配给该角色" effect="dark" placement="top-start"> <el-tooltip class="item" :content="$t('menuManagement.assignFirstLevelTooltip')" effect="dark" placement="top-start">
<el-button <el-button
:disabled="!roleName || selectLeft.length === 0" :disabled="!roleName || selectLeft.length === 0"
icon="el-icon-right" icon="el-icon-right"
@@ -44,11 +44,11 @@
<!-- </el-card>--> <!-- </el-card>-->
<el-card style="height: 550px"> <el-card style="height: 550px">
<div slot="header"> <div slot="header">
<span>角色:</span> <span>{{ $t('menuManagement.role') }}</span>
<el-select <el-select
v-model="roleName" v-model="roleName"
filterable filterable
placeholder="请选择" :placeholder="$t('menuManagement.selectPlaceholder')"
size="small" size="small"
style="width:150px;margin-left:10px" style="width:150px;margin-left:10px"
@change="getModule"> @change="getModule">
@@ -58,7 +58,7 @@
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<el-input v-model="filterText" clearable placeholder="输入关键字进行过滤" size="small" style="width:200px;margin-left:10px"/> <el-input v-model="filterText" clearable :placeholder="$t('menuManagement.filterPlaceholder')" size="small" style="width:200px;margin-left:10px"/>
</div> </div>
<el-tree <el-tree
ref="moduleTree" ref="moduleTree"
@@ -71,26 +71,26 @@
show-checkbox show-checkbox
@check-change="treeCheck"> @check-change="treeCheck">
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ node.label }}</span> <span>{{ translateMenuTitle(node.label) }}</span>
<span> <span>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@click="() => moveUp(node, data)"> @click="() => moveUp(node, data)">
上移 {{ $t('menuManagement.moveUp') }}
</el-button> </el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@click="() => moveDown(node, data)"> @click="() => moveDown(node, data)">
下移 {{ $t('menuManagement.moveDown') }}
</el-button> </el-button>
<el-button <el-button
:disabled="data.children && data.children.length!==0" :disabled="data.children && data.children.length!==0"
size="mini" size="mini"
type="text" type="text"
@click="() => returnModule(node, data)"> @click="() => returnModule(node, data)">
移除 {{ $t('menuManagement.remove') }}
</el-button> </el-button>
</span> </span>
</span> </span>
@@ -98,7 +98,7 @@
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="1"> <el-col :span="1">
<el-tooltip class="item" content="将选中二级菜单分配给该角色选中的一级菜单" effect="dark" placement="top-start"> <el-tooltip class="item" :content="$t('menuManagement.assignSecondLevelTooltip')" effect="dark" placement="top-start">
<el-button <el-button
:disabled="treeCheckList.length !== 1 || selectRight.length === 0 || treeCheckListJudge" :disabled="treeCheckList.length !== 1 || selectRight.length === 0 || treeCheckListJudge"
icon="el-icon-back" icon="el-icon-back"
@@ -117,7 +117,7 @@
<!-- </el-card>--> <!-- </el-card>-->
<el-card style="height: 550px;"> <el-card style="height: 550px;">
<div slot="header"> <div slot="header">
<el-input v-model="filterTextRight" clearable placeholder="输入关键字进行过滤" size="small"/> <el-input v-model="filterTextRight" clearable :placeholder="$t('menuManagement.filterPlaceholder')" size="small"/>
</div> </div>
<el-table <el-table
ref="multipleTableRight" ref="multipleTableRight"
@@ -129,9 +129,9 @@
@selection-change="handleSelectionChangeRight"> @selection-change="handleSelectionChangeRight">
<el-table-column :selectable="selectable" align="center" type="selection" width="55"/> <el-table-column :selectable="selectable" align="center" type="selection" width="55"/>
<el-table-column align="center" type="index" width="60"/> <el-table-column align="center" type="index" width="60"/>
<el-table-column align="center" label="模块名称"> <el-table-column align="center" :label="$t('menuManagement.secondLevelMenuName')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.title }} {{ translateMenuTitle(scope.row.title) }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -145,20 +145,20 @@
<el-select <el-select
v-model="TitleValue" v-model="TitleValue"
filterable filterable
placeholder="请选择" :placeholder="$t('menuManagement.selectPlaceholder')"
size="small" size="small"
style="width:200px;margin-left:10px" style="width:200px;margin-left:10px"
@change="getTitle"> @change="getTitle">
<el-option <el-option
v-for="item in Title" v-for="item in Title"
:key="item.value" :key="item.value"
:label="item.label" :label="translateMenuTitle(item.label)"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
</div> </div>
<el-table :data="RoleNameasd" border height="200" size="mini" stripe style="width: 465px"> <el-table :data="RoleNameasd" border height="200" size="mini" stripe style="width: 465px">
<el-table-column align="center" label="序号" type="index" width="50"/> <el-table-column align="center" :label="$t('menuManagement.sequence')" type="index" width="50"/>
<el-table-column align="center" label="模块名称" width="400"> <el-table-column align="center" :label="$t('menuManagement.roleName')" width="400">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.角色功能 }} {{ scope.row.角色功能 }}
</template> </template>
@@ -167,7 +167,7 @@
</el-card> </el-card>
</el-row> </el-row>
<el-dialog :visible.sync="dialogVisible1" center style="min-height: 300px" title="新增一级模块" width="400px"> <el-dialog :visible.sync="dialogVisible1" center style="min-height: 300px" :title="$t('menuManagement.addFirstLevelModule')" width="400px">
<el-form <el-form
ref="form1" ref="form1"
:model="form1" :model="form1"
@@ -175,7 +175,7 @@
class="demo-ruleForm" class="demo-ruleForm"
label-position="left" label-position="left"
label-width="110px"> label-width="110px">
<el-form-item label="模块名称" prop="moduleName"> <el-form-item :label="$t('menuManagement.menuName')" prop="moduleName">
<el-input <el-input
v-model="form1.moduleName" v-model="form1.moduleName"
size="small" size="small"
@@ -183,14 +183,15 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1=false">取消</el-button> <el-button @click="dialogVisible1=false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="submitAdd()">确定</el-button> <el-button type="primary" @click="submitAdd()">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { translateMenuTitle } from '@/utils/i18n'
import { import {
getRole, getRole,
getModule, getModule,
@@ -262,12 +263,13 @@ export default {
this.getRoleTitle() this.getRoleTitle()
}, },
methods: { methods: {
// 撤回分配模块 translateMenuTitle,
// 撤回分配菜单
returnModule(node, data) { returnModule(node, data) {
console.log(node, data, 123) console.log(node, data, 123)
this.$confirm('确定撤回分配模块?', '提示', { this.$confirm(this.$t('menuManagement.confirmReturnMenu'), this.$t('menuManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
returnModule(data.id, this.roleName).then(response => { returnModule(data.id, this.roleName).then(response => {
@@ -278,15 +280,15 @@ export default {
this.getModule() this.getModule()
this.initFisrtLevel() this.initFisrtLevel()
this.initSecondLevel() this.initSecondLevel()
this.$message.success('操作成功') this.$message.success(this.$t('menuManagement.operationSuccess'))
} else { } else {
this.$message.error('操作失败') this.$message.error(this.$t('menuManagement.operationFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '取消操作' message: this.$t('menuManagement.operationCanceled')
}) })
}) })
}, },
@@ -301,13 +303,13 @@ export default {
this.getModule() this.getModule()
this.initFisrtLevel() this.initFisrtLevel()
this.initSecondLevel() this.initSecondLevel()
this.$message.success('上移成功') this.$message.success(this.$t('menuManagement.moveUpSuccess'))
} else { } else {
this.$message.error('上移失败') this.$message.error(this.$t('menuManagement.moveUpFailed'))
} }
}) })
} else { } else {
this.$message.error('当前已经排在第一') this.$message.error(this.$t('menuManagement.alreadyFirst'))
} }
}) })
}, },
@@ -322,21 +324,21 @@ export default {
this.getModule() this.getModule()
this.initFisrtLevel() this.initFisrtLevel()
this.initSecondLevel() this.initSecondLevel()
this.$message.success('操作成功') this.$message.success(this.$t('menuManagement.operationSuccess'))
} else { } else {
this.$message.error('操作失败') this.$message.error(this.$t('menuManagement.operationFailed'))
} }
}) })
} else { } else {
this.$message.error('当前已经排在最后') this.$message.error(this.$t('menuManagement.alreadyLast'))
} }
}) })
}, },
// 分配一级 // 分配一级菜单
giveFirstLevel() { giveFirstLevel() {
this.$confirm('确定将选中的一级模块分配给选中角色?', '提示', { this.$confirm(this.$t('menuManagement.confirmAssignFirstLevelMenu'), this.$t('menuManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
giveFirstLevel(this.selectLeft, this.roleName).then(response => { giveFirstLevel(this.selectLeft, this.roleName).then(response => {
@@ -347,24 +349,24 @@ export default {
this.getModule() this.getModule()
this.initFisrtLevel() this.initFisrtLevel()
this.initSecondLevel() this.initSecondLevel()
this.$message.success('操作成功') this.$message.success(this.$t('menuManagement.operationSuccess'))
} else { } else {
this.$message.error('操作失败') this.$message.error(this.$t('menuManagement.operationFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '取消操作' message: this.$t('menuManagement.operationCanceled')
}) })
}) })
}, },
// 分配二级 // 分配二级菜单
giveSecondLevel() { giveSecondLevel() {
if (this.$refs.moduleTree.getCheckedKeys().length === 1) { if (this.$refs.moduleTree.getCheckedKeys().length === 1) {
this.$confirm('确定将选中的二级模块分配给选中角色的选中一级模块?', '提示', { this.$confirm(this.$t('menuManagement.confirmAssignSecondLevelMenu'), this.$t('menuManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
giveSecondLevel(this.selectRight, this.roleName, this.$refs.moduleTree.getCheckedKeys()).then(response => { giveSecondLevel(this.selectRight, this.roleName, this.$refs.moduleTree.getCheckedKeys()).then(response => {
@@ -375,19 +377,19 @@ export default {
this.getModule() this.getModule()
this.initFisrtLevel() this.initFisrtLevel()
this.initSecondLevel() this.initSecondLevel()
this.$message.success('操作成功') this.$message.success(this.$t('menuManagement.operationSuccess'))
} else { } else {
this.$message.error('操作失败') this.$message.error(this.$t('menuManagement.operationFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '取消操作' message: this.$t('menuManagement.operationCanceled')
}) })
}) })
} else { } else {
this.$message.error('只可以分配给一个一级菜单') this.$message.error(this.$t('menuManagement.assignOneFirstLevelOnly'))
} }
}, },
// 控制某行是否可选 // 控制某行是否可选
@@ -494,7 +496,7 @@ export default {
} }
}) })
}, },
// 根据角色查模块 // 根据角色查菜单
getModule() { getModule() {
this.$refs.multipleTableLeft.clearSelection() this.$refs.multipleTableLeft.clearSelection()
this.$refs.multipleTableRight.clearSelection() this.$refs.multipleTableRight.clearSelection()
@@ -511,7 +513,7 @@ export default {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
// 初始化模块 // 初始化菜单
getRoleTitle() { getRoleTitle() {
getRoleTitle().then(response => { getRoleTitle().then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {

View File

@@ -7,29 +7,29 @@
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
size="small" size="small"
type="distribution" type="distribution"
@click="handleAdd('department_Form')">新增 @click="handleAdd('department_Form')">{{ $t('personnelManagement.add') }}
</el-button> </el-button>
<el-button icon="el-icon-edit" plain size="small" type="warning" @click="handleEdit()">编辑</el-button> <el-button icon="el-icon-edit" plain size="small" type="warning" @click="handleEdit()">{{ $t('personnelManagement.edit') }}</el-button>
<el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteTable()">删除</el-button> <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteTable()">{{ $t('personnelManagement.delete') }}</el-button>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
<el-card> <el-card>
<span>人员名称:</span> <span>{{ $t('personnelManagement.peopleName') }}</span>
<el-input <el-input
v-model="Name" v-model="Name"
class="input-with-select" class="input-with-select"
clearable clearable
placeholder="请输入人员名称" :placeholder="$t('personnelManagement.peopleNamePlaceholder')"
size="small" size="small"
style="width: 200px; margin-right: 15px"> style="width: 200px; margin-right: 15px">
<el-button slot="append" icon="el-icon-search" @click="fetchPeopleForName"/> <el-button slot="append" icon="el-icon-search" @click="fetchPeopleForName"/>
</el-input> </el-input>
<el-button icon="el-icon-circle-plus-outline" size="small" type="distribution" @click="addPeople()">新增 <el-button icon="el-icon-circle-plus-outline" size="small" type="distribution" @click="addPeople()">{{ $t('personnelManagement.add') }}
</el-button> </el-button>
<el-button icon="el-icon-circle-close-outline" plain size="small" type="danger" @click="Quit()">离职 <el-button icon="el-icon-circle-close-outline" plain size="small" type="danger" @click="Quit()">{{ $t('personnelManagement.resign') }}
</el-button> </el-button>
<el-button plain size="small" style="float: right" type="text" @click="searchLeavingList">离职名单</el-button> <el-button plain size="small" style="float: right" type="text" @click="searchLeavingList">{{ $t('personnelManagement.resignedList') }}</el-button>
<el-button <el-button
v-popover:popover4 v-popover:popover4
:disabled="disabledMove" :disabled="disabledMove"
@@ -37,7 +37,7 @@
plain plain
size="small" size="small"
type="success" type="success"
@click="moveGroup">移动 @click="moveGroup">{{ $t('personnelManagement.move') }}
</el-button> </el-button>
<!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>--> <!--<el-button size="small" @click="postMaintain()">岗位维护</el-button>-->
<el-popover <el-popover
@@ -51,10 +51,10 @@
<el-input <el-input
v-model="nodeName1" v-model="nodeName1"
:disabled="true" :disabled="true"
placeholder="请选择部门" :placeholder="$t('personnelManagement.selectDepartmentPlaceholder')"
size="small"/> size="small"/>
<el-button size="small" style="margin-left: 50px; margin-top: 15px" type="text" @click="moveGroupConfim"> <el-button size="small" style="margin-left: 50px; margin-top: 15px" type="text" @click="moveGroupConfim">
确认 {{ $t('common.confirm') }}
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-tree <el-tree
@@ -76,8 +76,8 @@
<el-col :span="6"> <el-col :span="6">
<el-card class="box-card" style="min-height: 600px; max-height: 650px"> <el-card class="box-card" style="min-height: 600px; max-height: 650px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>部门维护</span> <span>{{ $t('personnelManagement.departmentMaintenance') }}</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="expandALL()">展开</el-button> <el-button style="float: right; padding: 3px 0" type="text" @click="expandALL()">{{ $t('personnelManagement.expand') }}</el-button>
</div> </div>
<div style="height: 600px"> <div style="height: 600px">
<el-tree <el-tree
@@ -107,7 +107,7 @@
align="center" align="center"
type="selection" type="selection"
width="50"/> width="50"/>
<el-table-column align="center" type="index" label="序号" /> <el-table-column align="center" type="index" :label="$t('personnelManagement.sequence')" />
<!--<el-table-column align="center" label="照片" width="200">--> <!--<el-table-column align="center" label="照片" width="200">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <el-popover--> <!-- <el-popover-->
@@ -136,22 +136,22 @@
<!-- </span>--> <!-- </span>-->
<!-- </template>--> <!-- </template>-->
<!--</el-table-column>--> <!--</el-table-column>-->
<el-table-column align="center" label="部门名称" width="120"> <el-table-column align="center" :label="$t('personnelManagement.departmentName')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.节点名称 }} {{ scope.row.节点名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="考勤编号" width="140"> <el-table-column align="center" :label="$t('personnelManagement.attendanceNo')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.考勤编号 }} {{ scope.row.考勤编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="密码" width="150"> <el-table-column align="center" :label="$t('personnelManagement.password')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.密码 }} {{ scope.row.密码 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="姓名" width="120"> <el-table-column align="center" :label="$t('personnelManagement.employeeName')" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
@@ -210,7 +210,7 @@
<!-- {{ scope.row.家庭住址 }}--> <!-- {{ scope.row.家庭住址 }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column align="center" label="操作" width="150"> <el-table-column align="center" :label="$t('personnelManagement.operation')" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- :disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"--> <!-- :disabled="scope.row.文件标识 && scope.row.文件标识 !== 'null'"-->
@@ -222,7 +222,7 @@
icon="el-icon-edit" icon="el-icon-edit"
size="mini" size="mini"
type="primary" type="primary"
@click="handleEditPeople(scope.row)">编辑 @click="handleEditPeople(scope.row)">{{ $t('personnelManagement.edit') }}
</el-button> </el-button>
<!--<el-button--> <!--<el-button-->
<!--size="mini"--> <!--size="mini"-->
@@ -249,7 +249,7 @@
<!--新增和编辑部门--> <!--新增和编辑部门-->
<el-dialog <el-dialog
v-el-drag-dialog v-el-drag-dialog
:title="department_Title" :title="departmentDialogTitle"
:visible.sync="department_DFV" :visible.sync="department_DFV"
center center
style="min-height: 200px" style="min-height: 200px"
@@ -261,30 +261,30 @@
class="demo-ruleForm" class="demo-ruleForm"
label-position="left" label-position="left"
label-width="110px"> label-width="110px">
<el-form-item label="部门名称" prop="DepartmentName"> <el-form-item :label="$t('personnelManagement.departmentName')" prop="DepartmentName">
<el-input v-model="department_Form.DepartmentName" size="small" style="width:200px"/> <el-input v-model="department_Form.DepartmentName" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">{{ $t('common.cancel') }}</el-button>
<el-button <el-button
v-if="department_Title==='新增部门'" v-if="department_Title==='add'"
:disabled="handleAdd_disable" :disabled="handleAdd_disable"
type="primary" type="primary"
@click="submitAdd('department_Form')">确定 @click="submitAdd('department_Form')">{{ $t('common.confirm') }}
</el-button> </el-button>
<el-button <el-button
v-else-if="department_Title==='编辑部门'" v-else-if="department_Title==='edit'"
:disabled="handleAdd_disable" :disabled="handleAdd_disable"
type="primary" type="primary"
@click="submitEdit('department_Form')">确定 @click="submitEdit('department_Form')">{{ $t('common.confirm') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
v-el-drag-dialog v-el-drag-dialog
:title="people_title" :title="peopleDialogTitle"
:visible.sync="people_DFV" :visible.sync="people_DFV"
center center
style="min-height: 200px" style="min-height: 200px"
@@ -297,13 +297,13 @@
label-position="left" label-position="left"
label-width="110px"> label-width="110px">
<el-row> <el-row>
<el-form-item label="姓名" prop="Name"> <el-form-item :label="$t('personnelManagement.employeeName')" prop="Name">
<el-input v-model="people_form.Name" size="small" style="width:200px"/> <el-input v-model="people_form.Name" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="工号" prop="AccountNumber"> <el-form-item :label="$t('personnelManagement.jobNo')" prop="AccountNumber">
<el-input v-model="people_form.AccountNumber" size="small" style="width:200px"/> <el-input v-model="people_form.AccountNumber" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="Password"> <el-form-item :label="$t('personnelManagement.password')" prop="Password">
<el-input v-model="people_form.Password" size="small" style="width:200px"/> <el-input v-model="people_form.Password" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
@@ -407,20 +407,20 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button :loading="btnLoading" @click="cancel">取消</el-button> <el-button :loading="btnLoading" @click="cancel">{{ $t('common.cancel') }}</el-button>
<el-button <el-button
v-if="people_title === '新增人员'" v-if="people_title === 'add'"
:disabled="addPeople_disable" :disabled="addPeople_disable"
:loading="btnLoading" :loading="btnLoading"
type="primary" type="primary"
@click="submitAddPeople">确定 @click="submitAddPeople">{{ $t('common.confirm') }}
</el-button> </el-button>
<el-button <el-button
v-else-if="people_title === '编辑人员'" v-else-if="people_title === 'edit'"
:disabled="addPeople_disable" :disabled="addPeople_disable"
:loading="btnLoading" :loading="btnLoading"
type="primary" type="primary"
@click="submitEditPeople">确定 @click="submitEditPeople">{{ $t('common.confirm') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -431,7 +431,7 @@
:visible.sync="LeavingListVisiable" :visible.sync="LeavingListVisiable"
center center
style="height: 800px" style="height: 800px"
title="离职名单" :title="$t('personnelManagement.resignedList')"
width="40%"> width="40%">
<el-table <el-table
:data="LeavingList" :data="LeavingList"
@@ -442,23 +442,23 @@
stripe stripe
style="width: 100%" style="width: 100%"
tooltip-effect="dark"> tooltip-effect="dark">
<el-table-column align="center" type="index" label="序号" /> <el-table-column align="center" type="index" :label="$t('personnelManagement.sequence')" />
<el-table-column align="center" label="部门名称" width="100"> <el-table-column align="center" :label="$t('personnelManagement.departmentName')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.节点名称 }} {{ scope.row.节点名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="工号" width="100"> <el-table-column align="center" :label="$t('personnelManagement.jobNo')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.考勤编号 }} {{ scope.row.考勤编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="密码" width="100"> <el-table-column align="center" :label="$t('personnelManagement.password')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.密码 }} {{ scope.row.密码 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="姓名" > <el-table-column align="center" :label="$t('personnelManagement.employeeName')" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
@@ -512,13 +512,13 @@
<!-- {{ scope.row.家庭住址 }}--> <!-- {{ scope.row.家庭住址 }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column align="center" label="操作" width="100"> <el-table-column align="center" :label="$t('personnelManagement.operation')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
icon="el-icon-circle-close-outline" icon="el-icon-circle-close-outline"
size="mini" size="mini"
type="danger" type="danger"
@click="deletePeople(scope.row)">删除 @click="deletePeople(scope.row)">{{ $t('personnelManagement.delete') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -539,7 +539,7 @@
:visible.sync="dialogFormVisible" :visible.sync="dialogFormVisible"
center center
style="height: 800px" style="height: 800px"
title="上传图片" :title="$t('personnelManagement.uploadPicture')"
width="300px"> width="300px">
<el-upload <el-upload
id="invoiceScan" id="invoiceScan"
@@ -560,8 +560,8 @@
<i class="el-icon-plus"/> <i class="el-icon-plus"/>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible=false">取消</el-button> <el-button @click="dialogFormVisible=false">{{ $t('common.cancel') }}</el-button>
<el-button style="width: 70px" type="primary" @click="submitPerson()">确定</el-button> <el-button style="width: 70px" type="primary" @click="submitPerson()">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -588,6 +588,7 @@ import request, { readFile, url } from '@/utils/request'
// import { base64ImgtoFile } from '../../../utils/tool' // import { base64ImgtoFile } from '../../../utils/tool'
export default { export default {
name: 'PersonnelManagement',
data() { data() {
// const validateUsername = (rule, value, callback) => { // const validateUsername = (rule, value, callback) => {
// if (!isvalidUsername(value)) { // if (!isvalidUsername(value)) {
@@ -669,11 +670,39 @@ export default {
PeopleID: null, PeopleID: null,
TeamValue: '' TeamValue: ''
}, },
rules: { SexData: [{
Name: [{ required: true, message: '请输入', trigger: 'blur' }], value: 1,
AccountNumber: [{ required: true, message: '请输入', trigger: 'blur' }], label: '男'
}, {
value: 2,
label: '女'
}],
EducationDate: [],
PostData: [],
multipleSelection: [],
nodeName1: '',
count1: 0,
count2: 0,
isShowPersonnelUpLoad: false
}
},
computed: {
departmentDialogTitle() {
return this.department_Title === 'edit'
? this.$t('personnelManagement.editDepartment')
: this.$t('personnelManagement.addDepartment')
},
peopleDialogTitle() {
return this.people_title === 'edit'
? this.$t('personnelManagement.editEmployeeTitle')
: this.$t('personnelManagement.addEmployee')
},
rules() {
return {
Name: [{ required: true, message: this.$t('personnelManagement.requiredInput'), trigger: 'blur' }],
AccountNumber: [{ required: true, message: this.$t('personnelManagement.requiredInput'), trigger: 'blur' }],
// AccountNumber: [{ required: true, trigger: 'blur', validator: validateUsername }], // AccountNumber: [{ required: true, trigger: 'blur', validator: validateUsername }],
Password: [{ required: true, message: '请输入', trigger: 'blur' }] Password: [{ required: true, message: this.$t('personnelManagement.requiredInput'), trigger: 'blur' }]
// Sex: [{ required: true, message: '请输入', trigger: 'change' }], // Sex: [{ required: true, message: '请输入', trigger: 'change' }],
// Birthday: [{ required: true, message: '请输入', trigger: 'change' }], // Birthday: [{ required: true, message: '请输入', trigger: 'change' }],
// IDcard: [{ required: true, message: '请输入', trigger: 'blur' }, { // IDcard: [{ required: true, message: '请输入', trigger: 'blur' }, {
@@ -700,21 +729,7 @@ export default {
// PositionStatus: [{ required: true, message: '请输入', trigger: 'change' }], // PositionStatus: [{ required: true, message: '请输入', trigger: 'change' }],
// Education: [{ required: true, message: '请输入', trigger: 'change' }], // Education: [{ required: true, message: '请输入', trigger: 'change' }],
// DepartmentName: [{ required: true, message: '请输入', trigger: 'blur' }] // DepartmentName: [{ required: true, message: '请输入', trigger: 'blur' }]
}, }
SexData: [{
value: 1,
label: '男'
}, {
value: 2,
label: '女'
}],
EducationDate: [],
PostData: [],
multipleSelection: [],
nodeName1: '',
count1: 0,
count2: 0,
isShowPersonnelUpLoad: false
} }
}, },
created() { created() {
@@ -752,9 +767,9 @@ export default {
}, },
// 删除离职人员信息 // 删除离职人员信息
deletePeople(row) { deletePeople(row) {
this.$confirm('此操作将永久删除该离职员工信息, 是否继续?', '提示', { this.$confirm(this.$t('personnelManagement.confirmDeleteResignedEmployee'), this.$t('personnelManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
var param = [] var param = []
@@ -762,24 +777,24 @@ export default {
var Data = this.CreateData('12', '人事档案管理_离职人员_删除数据', param) var Data = this.CreateData('12', '人事档案管理_离职人员_删除数据', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success(this.$t('personnelManagement.deleteSuccess'))
this.searchLeavingList() this.searchLeavingList()
} else { } else {
this.$message.error('删除失败') this.$message.error(this.$t('personnelManagement.deleteFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('personnelManagement.deleteCanceled')
}) })
}) })
}, },
// 删除人员照片 // 删除人员照片
deletePhoto(row) { deletePhoto(row) {
this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', { this.$confirm(this.$t('personnelManagement.confirmDeleteImage'), this.$t('personnelManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
@@ -791,16 +806,16 @@ export default {
} }
}).then(response => { }).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success(this.$t('personnelManagement.deleteSuccess'))
this.handleNodeClick() this.handleNodeClick()
} else { } else {
this.$message.error('删除失败') this.$message.error(this.$t('personnelManagement.deleteFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '取消删除' message: this.$t('personnelManagement.cancelDelete')
}) })
}) })
}, },
@@ -870,7 +885,7 @@ export default {
} }
}, },
uploadSuccess(res) { // 上传成功回调 uploadSuccess(res) { // 上传成功回调
this.$message.success('上传成功!') this.$message.success(this.$t('personnelManagement.uploadSuccess'))
this.getTableData() this.getTableData()
this.dialogFormVisible = false this.dialogFormVisible = false
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
@@ -884,12 +899,12 @@ export default {
beforeUpload(file) { // 上传前检测 beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type) const isJPG = /^image\/.*/.test(file.type)
if (!isJPG) { if (!isJPG) {
this.$message.error('只能上传图片。。') this.$message.error(this.$t('personnelManagement.imageOnly'))
} }
return isJPG return isJPG
}, },
warningExceed() { warningExceed() {
this.$message.error('仅可上传一张照片') this.$message.error(this.$t('personnelManagement.uploadLimitOne'))
}, },
handlePicture(row) { handlePicture(row) {
this.dialogFormVisible = true this.dialogFormVisible = true
@@ -919,7 +934,7 @@ export default {
if (this.count1 !== 1) { if (this.count1 !== 1) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
} }
this.department_Title = '新增部门' this.department_Title = 'add'
this.handleAdd_disable = false this.handleAdd_disable = false
this.department_DFV = true this.department_DFV = true
}, },
@@ -929,12 +944,12 @@ export default {
handleEdit() { handleEdit() {
this.addForm('department_Form') this.addForm('department_Form')
if (this.id) { if (this.id) {
this.department_Title = '编辑部门' this.department_Title = 'edit'
this.department_Form.DepartmentName = this.nodeName this.department_Form.DepartmentName = this.nodeName
this.handleAdd_disable = false this.handleAdd_disable = false
this.department_DFV = true this.department_DFV = true
} else { } else {
this.$message.warning(`请选择要修改的部门`) this.$message.warning(this.$t('personnelManagement.selectDepartmentToEdit'))
} }
}, },
submitAdd(formName) { submitAdd(formName) {
@@ -946,20 +961,20 @@ export default {
addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => { addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.getTreeData() this.getTreeData()
this.$message.success('添加成功') this.$message.success(this.$t('personnelManagement.addSuccess'))
this.i = 0 this.i = 0
} else { } else {
this.$message.error('添加失败') this.$message.error(this.$t('personnelManagement.addFailed'))
} }
}) })
} else { } else {
addDepartmentName(0, this.department_Form.DepartmentName, 0).then(response => { addDepartmentName(0, this.department_Form.DepartmentName, 0).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.getTreeData() this.getTreeData()
this.$message.success('添加成功') this.$message.success(this.$t('personnelManagement.addSuccess'))
this.i = 1 this.i = 1
} else { } else {
this.$message.error('添加失败') this.$message.error(this.$t('personnelManagement.addFailed'))
} }
}) })
} }
@@ -976,9 +991,9 @@ export default {
editList(this.id, this.department_Form.DepartmentName).then(response => { editList(this.id, this.department_Form.DepartmentName).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.getTreeData() this.getTreeData()
this.$message.success('编辑成功') this.$message.success(this.$t('personnelManagement.editSuccess'))
} else { } else {
this.$message.error('编辑失败') this.$message.error(this.$t('personnelManagement.editFailed'))
} }
}) })
} else { } else {
@@ -988,9 +1003,9 @@ export default {
}, },
deleteTable() { deleteTable() {
if (this.id) { if (this.id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm(this.$t('personnelManagement.confirmDeleteDepartment'), this.$t('personnelManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delList(this.id).then(response => { delList(this.id).then(response => {
@@ -999,7 +1014,7 @@ export default {
this.i = 1 this.i = 1
this.id = '' this.id = ''
this.$message({ this.$message({
message: '已被成功删除', message: this.$t('personnelManagement.deleteCompleted'),
type: 'success' type: 'success'
}) })
} }
@@ -1007,11 +1022,11 @@ export default {
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('personnelManagement.deleteCanceled')
}) })
}) })
} else { } else {
this.$message.warning(`请选择部门`) this.$message.warning(this.$t('personnelManagement.selectDepartment'))
} }
}, },
cancel() { cancel() {
@@ -1033,18 +1048,18 @@ export default {
this.List = response.data this.List = response.data
}) })
} else { } else {
this.$message.warning(`请输入人员姓名`) this.$message.warning(this.$t('personnelManagement.enterPeopleName'))
this.List = [] this.List = []
} }
}, },
addPeople() { addPeople() {
if (this.id) { if (this.id) {
this.people_title = '新增人员' this.people_title = 'add'
this.addPeople_disable = false this.addPeople_disable = false
this.people_DFV = true this.people_DFV = true
this.addForm('people_form') this.addForm('people_form')
} else { } else {
this.$message.warning(`请选择部门名称`) this.$message.warning(this.$t('personnelManagement.selectDepartmentName'))
} }
}, },
submitAddPeople() { submitAddPeople() {
@@ -1056,16 +1071,16 @@ export default {
this.people_DFV = false this.people_DFV = false
this.i = 0 this.i = 0
this.handleNodeClick() this.handleNodeClick()
this.$message.success('添加成功') this.$message.success(this.$t('personnelManagement.addSuccess'))
} else { } else {
this.$message.error('添加失败') this.$message.error(this.$t('personnelManagement.addFailed'))
this.addPeople_disable = false this.addPeople_disable = false
} }
}) })
}, },
handleEditPeople(row) { handleEditPeople(row) {
console.log(row, 'roworowowow') console.log(row, 'roworowowow')
this.people_title = '编辑人员' this.people_title = 'edit'
this.people_DFV = true this.people_DFV = true
this.addPeople_disable = false this.addPeople_disable = false
this.addForm('people_form') this.addForm('people_form')
@@ -1104,10 +1119,10 @@ export default {
} else { } else {
this.feathPeopleForName() this.feathPeopleForName()
} }
this.$message.success('编辑成功') this.$message.success(this.$t('personnelManagement.editSuccess'))
this.people_DFV = false this.people_DFV = false
} else { } else {
this.$message.error('编辑失败') this.$message.error(this.$t('personnelManagement.editFailed'))
this.addPeople_disable = false this.addPeople_disable = false
} }
}) })
@@ -1144,31 +1159,31 @@ export default {
}, },
Quit() { Quit() {
if (this.multipleSelection.length === 0) { if (this.multipleSelection.length === 0) {
this.$message.warning('请选择进行离职操作的员工') this.$message.warning(this.$t('personnelManagement.selectEmployeesForResign'))
} else { } else {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', { this.$confirm(this.$t('personnelManagement.confirmResign'), this.$t('personnelManagement.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
quit(this.multipleSelection[i].人员编号).then(response => { quit(this.multipleSelection[i].人员编号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('离职成功') this.$message.success(this.$t('personnelManagement.resignSuccess'))
this.getTableData() this.getTableData()
// getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => { // getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
// this.List = response.data.rows // this.List = response.data.rows
// this.total = response.data.total // this.total = response.data.total
// }) // })
} else { } else {
this.$message.error('离职失败') this.$message.error(this.$t('personnelManagement.resignFailed'))
} }
}) })
} }
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消离职操作' message: this.$t('personnelManagement.resignCanceled')
}) })
}) })
} }
@@ -1184,10 +1199,10 @@ export default {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.handleNodeClick() this.handleNodeClick()
if (i === this.multipleSelection.length - 1) { if (i === this.multipleSelection.length - 1) {
this.$message.success('移组成功') this.$message.success(this.$t('personnelManagement.moveGroupSuccess'))
} }
} else { } else {
this.$message.error('更新失败') this.$message.error(this.$t('personnelManagement.updateFailed'))
} }
}) })
} }
@@ -1198,7 +1213,7 @@ export default {
}, },
moveGroup() { moveGroup() {
if (this.multipleSelection.length === 0) { if (this.multipleSelection.length === 0) {
this.$message.warning('请至少选择一个人员') this.$message.warning(this.$t('personnelManagement.selectAtLeastOnePerson'))
} }
}, },
NodeClick(data) { NodeClick(data) {
@@ -1244,4 +1259,3 @@ export default {
<style scoped> <style scoped>
</style> </style>

View File

@@ -3,14 +3,14 @@
<el-card> <el-card>
<!--<el-input v-model="RoleFunctioning" size="small" clearable placeholder="请输入角色功能" style="width:200px"/>--> <!--<el-input v-model="RoleFunctioning" size="small" clearable placeholder="请输入角色功能" style="width:200px"/>-->
<!--<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 15px" plain @click="searchData()">查询</el-button>--> <!--<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 15px" plain @click="searchData()">查询</el-button>-->
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">增加</el-button> <el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">{{ $t('systemRoleMaintenance.add') }}</el-button>
<el-table v-loading="loading" :data="tableData" height="640" highlight-current-row border style="width: 550px;"> <el-table v-loading="loading" :data="tableData" height="640" highlight-current-row border style="width: 550px;">
<el-table-column align="center" label="角色编号" width="100"> <el-table-column align="center" :label="$t('systemRoleMaintenance.roleCode')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.角色编号 }} {{ scope.row.角色编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="角色功能" width="300"> <el-table-column align="center" :label="$t('systemRoleMaintenance.roleFunction')" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.角色功能 }} {{ scope.row.角色功能 }}
</template> </template>
@@ -20,7 +20,7 @@
<!--{{ scope.row.操作日期 }}--> <!--{{ scope.row.操作日期 }}-->
<!--</template>--> <!--</template>-->
<!--</el-table-column>--> <!--</el-table-column>-->
<el-table-column label="操作" fixed="right" align="center"> <el-table-column :label="$t('systemRoleMaintenance.operation')" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" plain icon="el-icon-edit" @click="handleEdit(scope.row)"/> <el-button size="mini" type="text" plain icon="el-icon-edit" @click="handleEdit(scope.row)"/>
<el-button size="mini" type="text" plain icon="el-icon-delete" @click="handleDelete(scope.row)"/> <el-button size="mini" type="text" plain icon="el-icon-delete" @click="handleDelete(scope.row)"/>
@@ -39,37 +39,37 @@
<!-- </div>--> <!-- </div>-->
</el-card> </el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="新增角色" center style="min-height: 200px" width="400px"> <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" :title="$t('systemRoleMaintenance.addRole')" center style="min-height: 200px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
<el-form-item label="角色名称" prop="角色功能" style="display: inline-block"> <el-form-item :label="$t('systemRoleMaintenance.roleName')" prop="角色功能" style="display: inline-block">
<el-input <el-input
v-model="form.角色功能" v-model="form.角色功能"
clearable clearable
size="small" size="small"
placeholder="角色功能" :placeholder="$t('systemRoleMaintenance.roleFunctionPlaceholder')"
style="width: 200px;"/> style="width: 200px;"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible1 = false">取消</el-button> <el-button size="small" @click="dialogFormVisible1 = false">{{ $t('common.cancel') }}</el-button>
<el-button :disabled="handleAdd_disable" type="primary" size="small" @click="submitAdd1('form')">确定</el-button> <el-button :disabled="handleAdd_disable" type="primary" size="small" @click="submitAdd1('form')">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="编辑角色" center style="min-height: 200px" width="400px"> <el-dialog :visible.sync="dialogFormVisible2" :title="$t('systemRoleMaintenance.editRole')" center style="min-height: 200px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px"> <el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px">
<el-form-item label="角色名称" prop="角色功能" style="display: inline-block"> <el-form-item :label="$t('systemRoleMaintenance.roleName')" prop="角色功能" style="display: inline-block">
<el-input <el-input
v-model="form2.角色功能" v-model="form2.角色功能"
clearable clearable
size="small" size="small"
placeholder="角色功能" :placeholder="$t('systemRoleMaintenance.roleFunctionPlaceholder')"
style="width: 200px;"/> style="width: 200px;"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible2 = false">取消</el-button> <el-button size="small" @click="dialogFormVisible2 = false">{{ $t('common.cancel') }}</el-button>
<el-button :disabled="handleAdd_disable" type="primary" size="small" @click="submitAdd2('form2')">确定</el-button> <el-button :disabled="handleAdd_disable" type="primary" size="small" @click="submitAdd2('form2')">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -78,6 +78,7 @@
<script> <script>
import { InitRolefunction, deleteData, searchTable, addData, addData2 } from '@/api/BasicData/SystemRrolemaintenance' import { InitRolefunction, deleteData, searchTable, addData, addData2 } from '@/api/BasicData/SystemRrolemaintenance'
export default { export default {
name: 'SystemRrolemaintenance',
data() { data() {
return { return {
handleAdd_disable: false, handleAdd_disable: false,
@@ -94,11 +95,23 @@ export default {
form2: { form2: {
角色功能: '' 角色功能: ''
}, },
rules: { rules: {},
角色功能: [{ required: true, message: '请输入角色名称', trigger: 'blur' }] rules2: {}
}
}, },
rules2: { computed: {
角色功能: [{ required: true, message: '请输入角色名称', trigger: 'blur' }] roleRules() {
return {
角色功能: [{ required: true, message: this.$t('systemRoleMaintenance.enterRoleName'), trigger: 'blur' }]
}
}
},
watch: {
roleRules: {
immediate: true,
handler(val) {
this.rules = val
this.rules2 = val
} }
} }
}, },
@@ -144,10 +157,10 @@ export default {
this.handleAdd_disable = true this.handleAdd_disable = true
addData2(this.form2.角色功能, this.num).then(response => { addData2(this.form2.角色功能, this.num).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('编辑成功') this.$message.success(this.$t('systemRoleMaintenance.editSuccess'))
this.fetchData() this.fetchData()
this.dialogFormVisible2 = false this.dialogFormVisible2 = false
} else { this.$message.error('编辑失败') } } else { this.$message.error(this.$t('systemRoleMaintenance.editFailed')) }
}) })
} }
}) })
@@ -158,11 +171,11 @@ export default {
this.handleAdd_disable = true this.handleAdd_disable = true
addData(this.form.角色功能).then(response => { addData(this.form.角色功能).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('增加成功') this.$message.success(this.$t('systemRoleMaintenance.addSuccess'))
this.form.角色功能 = '' this.form.角色功能 = ''
this.fetchData() this.fetchData()
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') } } else { this.$message.error(this.$t('systemRoleMaintenance.addFailed')) }
}) })
} }
}) })
@@ -175,23 +188,23 @@ export default {
this.dialogFormVisible1 = true this.dialogFormVisible1 = true
}, },
handleDelete(row) { // 删除 handleDelete(row) { // 删除
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', { this.$confirm(this.$t('systemRoleMaintenance.confirmDelete'), this.$t('systemRoleMaintenance.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteData(row.角色编号).then(response => { deleteData(row.角色编号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success(this.$t('systemRoleMaintenance.deleteSuccess'))
} else { } else {
this.$message.error('删除失败') this.$message.error(this.$t('systemRoleMaintenance.deleteFailed'))
} }
this.fetchData() this.fetchData()
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('systemRoleMaintenance.deleteCanceled')
}) })
}) })
} }
@@ -203,4 +216,3 @@ export default {
margin: 5px; margin: 5px;
} }
</style> </style>

View File

@@ -2,40 +2,40 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div style="margin-top: 7px; margin-bottom: 7px"> <div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="staffName" placeholder="员工姓名" size="small" clearable style="width:200px"/> <el-input v-model="staffName" :placeholder="$t('workshopPersonnelRoleMana.staffName')" size="small" clearable style="width:200px"/>
<el-select v-model="roleName" placeholder="角色名称" clearable size="small" style="width:200px;margin-left:10px"> <el-select v-model="roleName" :placeholder="$t('workshopPersonnelRoleMana.roleName')" clearable size="small" style="width:200px;margin-left:10px">
<el-option <el-option
v-for="item in roleNames" v-for="item in roleNames"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"/> :value="item.value"/>
</el-select> </el-select>
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="searchData">查询</el-button> <el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="searchData">{{ $t('workshopPersonnelRoleMana.search') }}</el-button>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="handelAdd">增加</el-button> <el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="handelAdd">{{ $t('workshopPersonnelRoleMana.add') }}</el-button>
</div> </div>
<el-table :data="tableData" highlight-current-row stripe size="mini" height="630" border style="width: 70%"> <el-table :data="tableData" highlight-current-row stripe size="mini" height="630" border style="width: 70%">
<el-table-column label="序号" align="center" type="index" width="70"/> <el-table-column :label="$t('workshopPersonnelRoleMana.sequence')" align="center" type="index" width="70"/>
<el-table-column label="员工姓名" align="center"> <el-table-column :label="$t('workshopPersonnelRoleMana.staffName')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column disabled label="所属部门" align="center"> <el-table-column disabled :label="$t('workshopPersonnelRoleMana.departmentName')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.部门名称 }} {{ scope.row.部门名称 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="角色名称" align="center"> <el-table-column :label="$t('workshopPersonnelRoleMana.roleName')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.角色功能 }} {{ scope.row.角色功能 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="考勤编号" align="center"> <el-table-column :label="$t('workshopPersonnelRoleMana.attendanceNo')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.考勤编号 }} {{ scope.row.考勤编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column :label="$t('workshopPersonnelRoleMana.operation')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="small" size="small"
@@ -52,7 +52,7 @@
</el-table> </el-table>
</el-card> </el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="人员信息" center width="750px"> <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="$t('workshopPersonnelRoleMana.personnelInfo')" center width="750px">
<div style="height: 500px"> <div style="height: 500px">
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px"> <div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
<el-tree <el-tree
@@ -65,36 +65,36 @@
/> />
</div> </div>
<el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange"> <el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange">
<el-table-column label="考勤编号" align="center" > <el-table-column :label="$t('workshopPersonnelRoleMana.attendanceNo')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.考勤编号 }} {{ scope.row.考勤编号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" > <el-table-column :label="$t('workshopPersonnelRoleMana.name')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.姓名 }} {{ scope.row.姓名 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="性别" align="center"> <el-table-column :label="$t('workshopPersonnelRoleMana.gender')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.性别 }} {{ scope.row.性别 }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-button style="margin-left: 260px" @click="dialogFormVisible = false">取消</el-button> <el-button style="margin-left: 260px" @click="dialogFormVisible = false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button> <el-button type="primary" style="margin-top: 20px" @click="getName">{{ $t('common.confirm') }}</el-button>
</el-dialog> </el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="增加" center style="min-height: 270px" width="800px"> <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" :title="$t('workshopPersonnelRoleMana.add')" center style="min-height: 270px" width="800px">
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm"> <el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="员工姓名" prop="staffName"> <el-form-item :label="$t('workshopPersonnelRoleMana.staffName')" prop="staffName">
<el-input v-model="form1.staffName" placeholder="请双击选择" size="small" readonly clearable style="width:200px" @dblclick.native="dialogTableVisible()"/> <el-input v-model="form1.staffName" :placeholder="$t('workshopPersonnelRoleMana.doubleClickSelect')" size="small" readonly clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
</el-form-item> </el-form-item>
<el-form-item label="角色名称" prop="roleName"> <el-form-item :label="$t('workshopPersonnelRoleMana.roleName')" prop="roleName">
<el-select v-model="form1.roleName" placeholder="角色名称" size="small" clearable style="width:200px"> <el-select v-model="form1.roleName" :placeholder="$t('workshopPersonnelRoleMana.roleName')" size="small" clearable style="width:200px">
<el-option <el-option
v-for="item in roleNames" v-for="item in roleNames"
:key="item.value" :key="item.value"
@@ -104,34 +104,34 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考勤编号" > <el-form-item :label="$t('workshopPersonnelRoleMana.attendanceNo')" >
<el-input <el-input
v-model="attendanceNumber" v-model="attendanceNumber"
disabled disabled
size="small" size="small"
style="width:200px"/> style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="所属部门" > <el-form-item :label="$t('workshopPersonnelRoleMana.departmentName')" >
<el-input v-model="department" size="small" style="width:200px"/> <el-input v-model="department" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOFF"> </el-button> <el-button @click="callOFF">{{ $t('common.cancel') }}</el-button>
<el-button :disabled="handelAdd_disable" type="primary" @click="submitAdd1()"> </el-button> <el-button :disabled="handelAdd_disable" type="primary" @click="submitAdd1()">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="编辑" center style="min-height: 270px" width="800px"> <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" :title="$t('workshopPersonnelRoleMana.edit')" center style="min-height: 270px" width="800px">
<el-form ref="form2" :model="form2" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm"> <el-form ref="form2" :model="form2" :rules="rules1" label-position="left" label-width="120px" class="demo-ruleForm">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="员工姓名" > <el-form-item :label="$t('workshopPersonnelRoleMana.staffName')" >
<el-input v-model="form2.staffName" disabled size="small" clearable style="width:200px"/> <el-input v-model="form2.staffName" disabled size="small" clearable style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="角色名称" prop="roleName"> <el-form-item :label="$t('workshopPersonnelRoleMana.roleName')" prop="roleName">
<el-select v-model="form2.roleName" placeholder="角色名称" clearable size="small" style="width:200px"> <el-select v-model="form2.roleName" :placeholder="$t('workshopPersonnelRoleMana.roleName')" clearable size="small" style="width:200px">
<el-option <el-option
v-for="item in roleNames" v-for="item in roleNames"
:key="item.value" :key="item.value"
@@ -141,22 +141,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考勤编号" > <el-form-item :label="$t('workshopPersonnelRoleMana.attendanceNo')" >
<el-input <el-input
v-model="attendanceNumber" v-model="attendanceNumber"
disabled disabled
size="small" size="small"
style="width:200px"/> style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item disabled="true" label="所属部门" > <el-form-item disabled="true" :label="$t('workshopPersonnelRoleMana.departmentName')" >
<el-input v-model="department" disabled size="small" style="width:200px"/> <el-input v-model="department" disabled size="small" style="width:200px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOFF">取消</el-button> <el-button @click="callOFF">{{ $t('common.cancel') }}</el-button>
<el-button :disabled="handelAdd_disable" type="primary" @click="submitAdd2()">确定</el-button> <el-button :disabled="handelAdd_disable" type="primary" @click="submitAdd2()">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -166,6 +166,7 @@
<script> <script>
import { fn } from '@/api/BasicData/WorkshopPersonnelRoleMana' import { fn } from '@/api/BasicData/WorkshopPersonnelRoleMana'
export default { export default {
name: 'WorkshopPersonnelRoleMana',
data() { data() {
return { return {
handelAdd_disable: false, // 禁止二次出发 handelAdd_disable: false, // 禁止二次出发
@@ -178,13 +179,8 @@ export default {
staffName: '', // 员工姓名 staffName: '', // 员工姓名
roleName: '' // 角色姓名 roleName: '' // 角色姓名
}, },
rules: { // 表单验证 rules: {},
staffName: [{ required: true, message: '请选择员工姓名', trigger: 'change' }], rules1: {},
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
},
rules1: { // 表单验证
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
},
staffName: '', // 员工姓名 staffName: '', // 员工姓名
attendanceNumber: '', // 考勤编号 attendanceNumber: '', // 考勤编号
List1: [], // 人员列表 List1: [], // 人员列表
@@ -205,6 +201,33 @@ export default {
dialogFormVisible: false // 控制人员对话框显示 dialogFormVisible: false // 控制人员对话框显示
} }
}, },
computed: {
addRules() {
return {
staffName: [{ required: true, message: this.$t('workshopPersonnelRoleMana.selectStaffName'), trigger: 'change' }],
roleName: [{ required: true, message: this.$t('workshopPersonnelRoleMana.selectStaffRole'), trigger: 'change' }]
}
},
editRules() {
return {
roleName: [{ required: true, message: this.$t('workshopPersonnelRoleMana.selectStaffRole'), trigger: 'change' }]
}
}
},
watch: {
addRules: {
immediate: true,
handler(val) {
this.rules = val
}
},
editRules: {
immediate: true,
handler(val) {
this.rules1 = val
}
}
},
created() { created() {
this.fetchData() this.fetchData()
}, },
@@ -290,13 +313,13 @@ export default {
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_增加数据', param) var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_增加数据', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('增加成功') this.$message.success(this.$t('workshopPersonnelRoleMana.addSuccess'))
this.department = '' this.department = ''
this.form1.staffName = '' this.form1.staffName = ''
this.form1.roleName = '' this.form1.roleName = ''
this.searchData() this.searchData()
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') } } else { this.$message.error(this.$t('workshopPersonnelRoleMana.addFailed')) }
}) })
} else { } else {
console.log('error submit!!') console.log('error submit!!')
@@ -315,11 +338,11 @@ export default {
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_修改数据', param) var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_修改数据', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('修改成功') this.$message.success(this.$t('workshopPersonnelRoleMana.editSuccess'))
this.department = '' this.department = ''
this.searchData() this.searchData()
this.dialogFormVisible2 = false this.dialogFormVisible2 = false
} else { this.$message.error('修改失败') } } else { this.$message.error(this.$t('workshopPersonnelRoleMana.editFailed')) }
}) })
} else { } else {
console.log('error submit!!') console.log('error submit!!')
@@ -337,9 +360,9 @@ export default {
}) })
}, },
handleDelete(row) { // 删除 handleDelete(row) { // 删除
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', { this.$confirm(this.$t('workshopPersonnelRoleMana.confirmDelete'), this.$t('workshopPersonnelRoleMana.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
var param = [] var param = []
@@ -347,14 +370,14 @@ export default {
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_删除数据', param) var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_删除数据', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('删除成功') this.$message.success(this.$t('workshopPersonnelRoleMana.deleteSuccess'))
} else { this.$message.error('删除失败') } } else { this.$message.error(this.$t('workshopPersonnelRoleMana.deleteFailed')) }
this.searchData() this.searchData()
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('workshopPersonnelRoleMana.deleteCanceled')
}) })
}) })
}, },
@@ -382,4 +405,3 @@ export default {
margin: 5px; margin: 5px;
} }
</style> </style>

View File

@@ -12,7 +12,7 @@
style="width: 70%" style="width: 70%"
@row-click="rowClick" @row-click="rowClick"
> >
<el-table-column type="index" width="60" label="序号" align="center"/> <el-table-column type="index" width="60" :label="$t('stationInformationMaintenance.sequence')" align="center"/>
<!-- <el-table-column label="MES工序号" width="110" align="center">--> <!-- <el-table-column label="MES工序号" width="110" align="center">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <template>--> <!-- <template>-->
@@ -27,14 +27,14 @@
<!-- </template>--> <!-- </template>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="工位号" width="110" align="center"> <el-table-column :label="$t('stationInformationMaintenance.stationNumber')" width="110" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template> <template>
{{ scope.row.工位号 }} {{ scope.row.工位号 }}
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工位名称" min-width="150px" align="center"> <el-table-column :label="$t('stationInformationMaintenance.stationName')" min-width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template> <template>
{{ scope.row.工位名称 }} {{ scope.row.工位名称 }}
@@ -42,14 +42,14 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工位MES功能" width="110px" align="center"> <el-table-column :label="$t('stationInformationMaintenance.stationMESFunction')" width="110px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.是否启用MES" size="mini" type="success">启用</el-tag> <el-tag v-if="scope.row.是否启用MES" size="mini" type="success">{{ $t('stationInformationMaintenance.enabled') }}</el-tag>
<el-tag v-else size="mini" type="warning">禁用</el-tag> <el-tag v-else size="mini" type="warning">{{ $t('stationInformationMaintenance.disabled') }}</el-tag>
<!-- <el-checkbox v-model="scope.row.是否启用MES" @change="updateUsedMes(scope.row)" />--> <!-- <el-checkbox v-model="scope.row.是否启用MES" @change="updateUsedMes(scope.row)" />-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="MES_DLL" width="110px" align="center"> <el-table-column :label="$t('stationInformationMaintenance.mesDll')" width="110px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template> <template>
<span v-if="scope.row.是否启用MES">{{ scope.row.MesDll }}</span> <span v-if="scope.row.是否启用MES">{{ scope.row.MesDll }}</span>
@@ -57,7 +57,7 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150" align="center"> <el-table-column :label="$t('stationInformationMaintenance.operation')" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@@ -65,12 +65,12 @@
plain plain
icon="el-icon-edit" icon="el-icon-edit"
@click="editShiftTable(scope.row)" @click="editShiftTable(scope.row)"
>编辑</el-button> >{{ $t('stationInformationMaintenance.edit') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="title" center style="min-height: 200px;" width="400px"> <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="translateDialogTitle(title)" center style="min-height: 200px;" width="400px">
<el-form ref="formData" :model="formData" :rules="rules" label-position="right" label-width="120px"> <el-form ref="formData" :model="formData" :rules="rules" label-position="right" label-width="120px">
<!-- <el-form-item label="MES工序号" prop="fileName">--> <!-- <el-form-item label="MES工序号" prop="fileName">-->
<!-- <el-input v-model="formData.fileName" readonly class="myReadOnly-input" size="small" placeholder="指南工位号"/>--> <!-- <el-input v-model="formData.fileName" readonly class="myReadOnly-input" size="small" placeholder="指南工位号"/>-->
@@ -78,31 +78,31 @@
<!-- <el-form-item label="MES资源号" prop="nameIndustrialComputer">--> <!-- <el-form-item label="MES资源号" prop="nameIndustrialComputer">-->
<!-- <el-input v-model="formData.nameIndustrialComputer" readonly class="myReadOnly-input" size="small" placeholder="指南工位号"/>--> <!-- <el-input v-model="formData.nameIndustrialComputer" readonly class="myReadOnly-input" size="small" placeholder="指南工位号"/>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="工位号" prop="stationNumber"> <el-form-item :label="$t('stationInformationMaintenance.stationNumber')" prop="stationNumber">
<el-input v-model="formData.stationNumber" readonly class="myReadOnly-input" size="small" placeholder="工位号"/> <el-input v-model="formData.stationNumber" readonly class="myReadOnly-input" size="small" :placeholder="$t('stationInformationMaintenance.stationNumber')"/>
</el-form-item> </el-form-item>
<el-form-item label="工位名称" prop="stationName"> <el-form-item :label="$t('stationInformationMaintenance.stationName')" prop="stationName">
<el-input v-model="formData.stationName" clearable size="small" placeholder="工位名称"/> <el-input v-model="formData.stationName" clearable size="small" :placeholder="$t('stationInformationMaintenance.stationName')"/>
</el-form-item> </el-form-item>
<el-form-item label="工位MES功能" prop="enableMES"> <el-form-item :label="$t('stationInformationMaintenance.stationMESFunction')" prop="enableMES">
<!-- <el-checkbox v-model="formData.enableMES" />--> <!-- <el-checkbox v-model="formData.enableMES" />-->
<el-tag v-if="formData.enableMES" size="mini" type="success">启用</el-tag> <el-tag v-if="formData.enableMES" size="mini" type="success">{{ $t('stationInformationMaintenance.enabled') }}</el-tag>
<el-tag v-else size="mini" type="warning">禁用</el-tag> <el-tag v-else size="mini" type="warning">{{ $t('stationInformationMaintenance.disabled') }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.enableMES" label="MES_DLL" prop="MesDll"> <el-form-item v-if="formData.enableMES" :label="$t('stationInformationMaintenance.mesDll')" prop="MesDll">
<el-input v-model="formData.MesDll" readonly class="myReadOnly-input" size="small" placeholder="MES_DLL"/> <el-input v-model="formData.MesDll" readonly class="myReadOnly-input" size="small" :placeholder="$t('stationInformationMaintenance.mesDll')"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="callOff('formData')">取消</el-button> <el-button @click="callOff('formData')">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="submitAdd1('formData')">确定</el-button> <el-button type="primary" @click="submitAdd1('formData')">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogFormVisible1" :title="title" center style="min-height: 200px;" width="400px"> <el-dialog :visible.sync="dialogFormVisible1" :title="translateDialogTitle(title)" center style="min-height: 200px;" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
<el-form-item label="电气元器件" prop="dataTypeValue"> <el-form-item :label="$t('stationInformationMaintenance.electricalComponents')" prop="dataTypeValue">
<el-select v-model="form.dataTypeValue" placeholder="电气元器件" clearable size="small" style="width:200px" @change="changeName(form.dataTypeValue)"> <el-select v-model="form.dataTypeValue" :placeholder="$t('stationInformationMaintenance.electricalComponents')" clearable size="small" style="width:200px" @change="changeName(form.dataTypeValue)">
<el-option <el-option
v-for="item in dataType" v-for="item in dataType"
:key="item.value" :key="item.value"
@@ -111,43 +111,43 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="编号" prop="value"> <el-form-item :label="$t('stationInformationMaintenance.number')" prop="value">
<el-input v-model="form.value" clearable size="small" placeholder="序号"/> <el-input v-model="form.value" clearable size="small" :placeholder="$t('stationInformationMaintenance.sequence')"/>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="descript"> <el-form-item :label="$t('stationInformationMaintenance.description')" prop="descript">
<el-input <el-input
v-model="form.descript" v-model="form.descript"
clearable clearable
size="small" size="small"
placeholder="描述" :placeholder="$t('stationInformationMaintenance.description')"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否禁用" prop="active"> <el-form-item :label="$t('stationInformationMaintenance.disabledStatus')" prop="active">
<el-select v-model="form.active" placeholder="是否禁用" clearable size="small" style="width:200px"> <el-select v-model="form.active" :placeholder="$t('stationInformationMaintenance.disabledStatus')" clearable size="small" style="width:200px">
<el-option <el-option
v-for="item in active" v-for="item in activeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="comments"> <el-form-item :label="$t('stationInformationMaintenance.remarks')" prop="comments">
<el-input <el-input
v-model="form.comments" v-model="form.comments"
clearable clearable
size="small" size="small"
placeholder="备注" :placeholder="$t('stationInformationMaintenance.remarks')"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button> <el-button size="small" @click="callOff('form')">{{ $t('common.cancel') }}</el-button>
<el-button v-if="title === '增加'" type="primary" size="small" @click="submitAdd('form')">确定</el-button> <el-button v-if="title === '增加'" type="primary" size="small" @click="submitAdd('form')">{{ $t('common.confirm') }}</el-button>
<el-button v-if="title === '编辑'" type="primary" size="small" @click="submitAdd1('form')">确定</el-button> <el-button v-if="title === '编辑'" type="primary" size="small" @click="submitAdd1('form')">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="导入" center style="min-height: 200px" width="900px"> <el-dialog :visible.sync="dialogFormVisible3" :title="$t('stationInformationMaintenance.import')" center style="min-height: 200px" width="900px">
<div class="app-container"> <div class="app-container">
<upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/> <upload-excel-component style="margin-left: 15%" @on-selected-file="selected"/>
<div style="margin-left: 395px"> <div style="margin-left: 395px">
@@ -155,7 +155,7 @@
<el-upload :on-remove="handleRemove" :file-list="itemFile" style="width: 220px" action=""/> <el-upload :on-remove="handleRemove" :file-list="itemFile" style="width: 220px" action=""/>
</div> </div>
<div v-if="worksheet.length !== 0" style="margin: 3px 0 0 395px"> <div v-if="worksheet.length !== 0" style="margin: 3px 0 0 395px">
<el-button icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">导入到数据库</el-button> <el-button icon="el-icon-upload2" type="primary" size="small" @click="basicPartsToSQL">{{ $t('stationInformationMaintenance.importToDatabase') }}</el-button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@@ -182,13 +182,6 @@ export default {
PLCIP: [], PLCIP: [],
tableData: [], tableData: [],
activeValue: '', activeValue: '',
active: [{
label: '启用',
value: 1
}, {
label: '禁用',
value: 0
}],
dialogFormVisible: false, dialogFormVisible: false,
dialogFormVisible1: false, dialogFormVisible1: false,
dialogFormVisible3: false, dialogFormVisible3: false,
@@ -201,10 +194,7 @@ export default {
active: '', active: '',
dataTypeValue: '' dataTypeValue: ''
}, },
rules: { // 表单验证规则 rules: {},
stationName: [{ required: true, message: '请输入工位名称', trigger: 'blur' }],
enableMES: [{ required: true, message: '请选择是否启用工位MES', trigger: 'blur' }]
},
formData: { formData: {
ID: '', // ID ID: '', // ID
stationCode: '', // 工位代码 stationCode: '', // 工位代码
@@ -280,6 +270,28 @@ export default {
total: 0 total: 0
} }
}, },
computed: {
activeOptions() {
return [{
label: this.$t('stationInformationMaintenance.enabled'),
value: 1
}, {
label: this.$t('stationInformationMaintenance.disabled'),
value: 0
}]
}
},
watch: {
'$i18n.locale': {
immediate: true,
handler() {
this.rules = {
stationName: [{ required: true, message: this.$t('stationInformationMaintenance.enterStationName'), trigger: 'blur' }],
enableMES: [{ required: true, message: this.$t('stationInformationMaintenance.selectStationMES'), trigger: 'blur' }]
}
}
}
},
created() { created() {
this.getIP() this.getIP()
this.getNumber() this.getNumber()
@@ -294,29 +306,38 @@ export default {
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '修改成功', message: this.$t('stationInformationMaintenance.editSuccess'),
type: 'success' type: 'success'
}) })
this.searchTable() this.searchTable()
} else { } else {
this.$message.error('修改失败!') this.$message.error(this.$t('stationInformationMaintenance.editFailed'))
} }
}) })
}, },
selectCode(val) { selectCode(val) {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
if (val === this.tableData[i].工位代码) { if (val === this.tableData[i].工位代码) {
this.$message.error('工位代码重复,请重新输入!') this.$message.error(this.$t('stationInformationMaintenance.duplicateStationCode'))
} }
} }
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm(this.$t('stationInformationMaintenance.confirmClose'))
.then(_ => { .then(_ => {
done() done()
}) })
.catch(_ => {}) .catch(_ => {})
}, },
translateDialogTitle(title) {
const titleMap = {
'添加工位信息': this.$t('stationInformationMaintenance.addStationInfo'),
'编辑工位信息': this.$t('stationInformationMaintenance.editStationInfo'),
'增加': this.$t('stationInformationMaintenance.add'),
'编辑': this.$t('stationInformationMaintenance.edit')
}
return titleMap[title] || title
},
getNumber() { getNumber() {
this.dataType = [] this.dataType = []
request({ request({
@@ -396,7 +417,7 @@ export default {
var Data = this.CreateData('2001', '基础数据_工位信息维护_导出', param) var Data = this.CreateData('2001', '基础数据_工位信息维护_导出', param)
this.exportExcel_NPOI(Data) this.exportExcel_NPOI(Data)
} else { } else {
this.$message.warning('暂无数据') this.$message.warning(this.$t('stationInformationMaintenance.noData'))
} }
}, },
addShiftTable(formName) { addShiftTable(formName) {
@@ -545,13 +566,13 @@ export default {
console.log(response) console.log(response)
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '增加成功', message: this.$t('stationInformationMaintenance.addSuccess'),
type: 'success' type: 'success'
}) })
this.dialogFormVisible = false this.dialogFormVisible = false
this.searchTable() this.searchTable()
} else { } else {
this.$message.error('增加失败!') this.$message.error(this.$t('stationInformationMaintenance.addFailed'))
} }
}) })
this.drawer = false this.drawer = false
@@ -768,17 +789,17 @@ export default {
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '增加成功', message: this.$t('stationInformationMaintenance.addSuccess'),
type: 'success' type: 'success'
}) })
this.dialogFormVisible = false this.dialogFormVisible = false
this.searchTable() this.searchTable()
} else { } else {
this.$message.error('增加失败!') this.$message.error(this.$t('stationInformationMaintenance.addFailed'))
} }
}) })
} else { } else {
this.$message.error('请选中一行信息进行复制!') this.$message.error(this.$t('stationInformationMaintenance.selectRowToCopy'))
} }
}, },
submitAdd1() { submitAdd1() {
@@ -857,13 +878,13 @@ export default {
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '修改成功', message: this.$t('stationInformationMaintenance.editSuccess'),
type: 'success' type: 'success'
}) })
this.searchTable() this.searchTable()
this.dialogFormVisible = false this.dialogFormVisible = false
} else { } else {
this.$message.error('修改失败!') this.$message.error(this.$t('stationInformationMaintenance.editFailed'))
} }
}) })
} else { } else {
@@ -872,9 +893,9 @@ export default {
}) })
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', { this.$confirm(this.$t('stationInformationMaintenance.confirmDelete'), this.$t('stationInformationMaintenance.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('common.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('common.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
var param = [] var param = []
@@ -883,18 +904,18 @@ export default {
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message({ this.$message({
message: '删除成功', message: this.$t('stationInformationMaintenance.deleteSuccess'),
type: 'success' type: 'success'
}) })
this.searchTable() this.searchTable()
} else { } else {
this.$message.error('删除失败!') this.$message.error(this.$t('stationInformationMaintenance.deleteFailed'))
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('stationInformationMaintenance.deleteCanceled')
}) })
}) })
}, },
@@ -998,7 +1019,7 @@ export default {
const response = await this.ExecDatabase(Data) const response = await this.ExecDatabase(Data)
const res = response.data const res = response.data
if (res[0].Column1 !== 0) { if (res[0].Column1 !== 0) {
this.$notify.error(`${this.worksheet[j].B2.v}已经存在,请确认文件是否正确`) this.$notify.error(`${this.worksheet[j].B2.v}${this.$t('stationInformationMaintenance.alreadyExistsCheckFile')}`)
this.loading = false this.loading = false
this.disabled = false this.disabled = false
return return
@@ -1138,7 +1159,7 @@ export default {
if (!stationCode && !stationNumber && !guideStationNumber && !machineType && !stationName && !lineType) { if (!stationCode && !stationNumber && !guideStationNumber && !machineType && !stationName && !lineType) {
break break
} else if (!stationNumber) { // 名称不能为空 } else if (!stationNumber) { // 名称不能为空
this.$notify.error(`工位号不能为空`) this.$notify.error(this.$t('stationInformationMaintenance.stationNumberRequired'))
break break
} else { } else {
if (stationNumber) { if (stationNumber) {
@@ -1211,7 +1232,7 @@ export default {
} else { } else {
this.loading = false this.loading = false
this.disabled = false this.disabled = false
this.$notify.error(`请确认导入文件是否正确`) this.$notify.error(this.$t('stationInformationMaintenance.confirmImportFile'))
return return
} }
} }
@@ -1219,14 +1240,16 @@ export default {
} }
this.itemFile.splice(j, 1) this.itemFile.splice(j, 1)
this.worksheet.splice(j, 1) this.worksheet.splice(j, 1)
this.err === 0 ? this.$message.success(`导入完成`) : this.$message.error(`导入失败零件个数为${this.err},请检查文件是否正确`) this.err === 0
? this.$message.success(this.$t('stationInformationMaintenance.importCompleted'))
: this.$message.error(`${this.$t('stationInformationMaintenance.importFailedCountPrefix')}${this.err}${this.$t('stationInformationMaintenance.importFailedCountSuffix')}`)
} }
this.loading = false this.loading = false
this.searchTable() this.searchTable()
} catch (e) { } catch (e) {
this.err++ this.err++
this.loading = false this.loading = false
this.$notify.error(`导入数据错误,请检查导入文件是否正确`) this.$notify.error(this.$t('stationInformationMaintenance.importDataErrorFile'))
console.log(`导入数据错误${e}`) console.log(`导入数据错误${e}`)
} }
}, },
@@ -1369,19 +1392,19 @@ export default {
const res = response.data const res = response.data
if (Object.prototype.hasOwnProperty.call(res, 'output') === false) { if (Object.prototype.hasOwnProperty.call(res, 'output') === false) {
if (res[0].result === '0') { if (res[0].result === '0') {
this.$notify.error(`${stationNumber}导入失败`) this.$notify.error(`${stationNumber}${this.$t('stationInformationMaintenance.importFailedForStation')}`)
} }
} else { } else {
if (res.result[0].result === '0') { if (res.result[0].result === '0') {
this.$notify.error(`${stationNumber}导入失败`) this.$notify.error(`${stationNumber}${this.$t('stationInformationMaintenance.importFailedForStation')}`)
} }
if (res.output[0].导入类型 === '2') { if (res.output[0].导入类型 === '2') {
this.$notify.warning(`${stationNumber}存在重复数据`) this.$notify.warning(`${stationNumber}${this.$t('stationInformationMaintenance.duplicateDataForStation')}`)
} }
} }
} catch (e) { } catch (e) {
this.err++ this.err++
this.$message.error(`导入数据错误`) this.$message.error(this.$t('stationInformationMaintenance.importDataError'))
console.log(`导入数据错误${e}`) console.log(`导入数据错误${e}`)
} }
}, },
@@ -1419,4 +1442,3 @@ export default {
display: none; display: none;
} }
</style> </style>

View File

@@ -150,6 +150,12 @@
{{ scope.row.工位号 }} {{ scope.row.工位号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="产品编号">
<template slot-scope="scope">
{{ scope.row.发动机号 }}
</template>
</el-table-column>
<el-table-column align="center" label="产品型号"> <el-table-column align="center" label="产品型号">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.发动机型号 }} {{ scope.row.发动机型号 }}
@@ -175,11 +181,6 @@
<!-- {{ scope.row.单元号 }}--> <!-- {{ scope.row.单元号 }}-->
<!-- </template>--> <!-- </template>-->
<!--</el-table-column>--> <!--</el-table-column>-->
<!-- <el-table-column align="center" label="产品编号">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.发动机号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!--<el-table-column align="center" label="工位名称">--> <!--<el-table-column align="center" label="工位名称">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
@@ -324,7 +325,6 @@ export default {
var param = [] var param = []
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param) var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data.length) this.stationNumberValue = response.data[0].工位号
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.stationNumber.push({ this.stationNumber.push({
label: `${response.data[i].工位号}${response.data[i].工位名称}`, label: `${response.data[i].工位号}${response.data[i].工位名称}`,
@@ -339,7 +339,6 @@ export default {
var param = [] var param = []
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param) var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
if (response.data.length) this.engineTypeValue = response.data[0].发动机机型标志
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.engineType.push({ this.engineType.push({
label: response.data[i].发动机型号 + '-' + response.data[i].标识字符, label: response.data[i].发动机型号 + '-' + response.data[i].标识字符,
@@ -521,7 +520,6 @@ export default {
param[28] = ['ItemCount', '1111', 'int', '1'] param[28] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param) var Data = this.CreateData('11', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) { if (response.data.result.length !== 0) {
this.tableData = response.data.result this.tableData = response.data.result
} }

View File

@@ -465,7 +465,6 @@ export default {
param[20] = ['ItemCount', '1111', 'int', '1'] param[20] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', '质量数据_发动机分线质量数据_综合查询', param) var Data = this.CreateData('11', '质量数据_发动机分线质量数据_综合查询', param)
this.ExecDatabase(Data).then(response => { this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) { if (response.data.result.length !== 0) {
this.tableData = response.data.result this.tableData = response.data.result
} }

View File

@@ -133,17 +133,16 @@
{{ scope.row.订单号 }} {{ scope.row.订单号 }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="产品编号">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.发动机号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="工位号" width="100px"> <el-table-column align="center" label="工位号" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.工位号 }} {{ scope.row.工位号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="产品编号">
<template slot-scope="scope">
{{ scope.row.发动机号 }}
</template>
</el-table-column>
<el-table-column align="center" label="产品型号" width="120px"> <el-table-column align="center" label="产品型号" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.发动机型号 }} {{ scope.row.发动机型号 }}

View File

@@ -17,12 +17,12 @@
<div v-for="(value1,index1) in fathers" :key="index1" style="width:100%;background: white;margin-bottom: 15px"> <div v-for="(value1,index1) in fathers" :key="index1" style="width:100%;background: white;margin-bottom: 15px">
<div style="width: 100%;height: 40px;line-height: 40px;background: rgb(127,172,237);color:white"> <div style="width: 100%;height: 40px;line-height: 40px;background: rgb(127,172,237);color:white">
<svg-icon :icon-class="value1.icon" style="color: white;margin: 5px 5px 0px 10px;border: 0 solid black;width:20px;height:20px"/> <svg-icon :icon-class="value1.icon" style="color: white;margin: 5px 5px 0px 10px;border: 0 solid black;width:20px;height:20px"/>
{{ value1.title }} {{ translateMenuTitle(value1.title) }}
</div> </div>
<router-link v-for="(value2,index2) in sons" v-if="value2.pid === value1.id" :key="index2" :to="value2.path"> <router-link v-for="(value2,index2) in sons" v-if="value2.pid === value1.id" :key="index2" :to="value2.path">
<el-card shadow="hover" class="sudoku_item1" style="height:130px;width:175px;margin: 5px;display: inline-block;background: rgba(255,255,255,0.4);border: 2px solid rgb(208,222,234)"> <el-card shadow="hover" class="sudoku_item1" style="height:130px;width:175px;margin: 5px;display: inline-block;background: rgba(255,255,255,0.4);border: 2px solid rgb(208,222,234)">
<svg-icon :icon-class="value2.icon" class="bgc" style="color: rgb(37,89,164);display:block;margin: auto;border: 0px solid black;width:40px;height:40px"/> <svg-icon :icon-class="value2.icon" class="bgc" style="color: rgb(37,89,164);display:block;margin: auto;border: 0px solid black;width:40px;height:40px"/>
<h4 style="margin-top: 10px;color:rgb(37,89,164);text-align:center">{{ value2.title }}</h4> <h4 style="margin-top: 10px;color:rgb(37,89,164);text-align:center">{{ translateMenuTitle(value2.title) }}</h4>
</el-card> </el-card>
</router-link> </router-link>
</div> </div>
@@ -35,6 +35,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import request from '@/utils/request' import request from '@/utils/request'
import { translateMenuTitle } from '@/utils/i18n'
export default { export default {
name: 'Dashboard', name: 'Dashboard',
data() { data() {
@@ -64,6 +65,7 @@ export default {
clearInterval(this.timer) clearInterval(this.timer)
}, },
methods: { methods: {
translateMenuTitle,
async initFirstModule() { async initFirstModule() {
await request({ await request({
url: '', url: '',

View File

@@ -1,4 +1,6 @@
<script> <script>
import { translateMenuTitle } from '@/utils/i18n'
export default { export default {
name: 'MenuItem', name: 'MenuItem',
functional: true, functional: true,
@@ -15,13 +17,14 @@ export default {
render(h, context) { render(h, context) {
const { icon, title } = context.props const { icon, title } = context.props
const vnodes = [] const vnodes = []
const vm = context.parent
if (icon) { if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>) vnodes.push(<svg-icon icon-class={icon}/>)
} }
if (title) { if (title) {
vnodes.push(<span slot='title'>{(title)}</span>) vnodes.push(<span slot='title'>{translateMenuTitle(title, vm && vm.$i18n && vm.$i18n.locale)}</span>)
} }
return vnodes return vnodes
} }

View File

@@ -5,14 +5,14 @@
<router-link v-if="item.children.length===1 && !item.children[0].children" :key="item.children[0].name" :to="item.path+'/'+item.children[0].path"> <router-link v-if="item.children.length===1 && !item.children[0].children" :key="item.children[0].name" :to="item.path+'/'+item.children[0].path">
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"/> <svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"/>
<span v-if="item.children[0].meta&&item.children[0].meta.title">{{ item.children[0].meta.title }}</span> <span v-if="item.children[0].meta&&item.children[0].meta.title">{{ translateMenuTitle(item.children[0].meta.title) }}</span>
</el-menu-item> </el-menu-item>
</router-link> </router-link>
<!--二级--> <!--二级-->
<el-submenu v-else :key="item.name" :index="item.name||item.path"> <el-submenu v-else :key="item.name" :index="item.name||item.path">
<template slot="title"> <template slot="title">
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"/> <svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"/>
<span v-if="item.meta&&item.meta.title">{{ item.meta.title }}</span> <span v-if="item.meta&&item.meta.title">{{ translateMenuTitle(item.meta.title) }}</span>
</template> </template>
<template v-for="child in item.children" v-if="!child.hidden"> <template v-for="child in item.children" v-if="!child.hidden">
@@ -20,7 +20,7 @@
<router-link v-else :key="child.name" :to="item.path+child.path"> <router-link v-else :key="child.name" :to="item.path+child.path">
<el-menu-item :index="item.path+'/'+child.path"> <el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"/> <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"/>
<span v-if="child.meta&&child.meta.title">{{ child.meta.title }}</span> <span v-if="child.meta&&child.meta.title">{{ translateMenuTitle(child.meta.title) }}</span>
{{ item.path+'/'+child.path }} {{ item.path+'/'+child.path }}
</el-menu-item> </el-menu-item>
</router-link> </router-link>
@@ -32,6 +32,8 @@
</template> </template>
<script> <script>
import { translateMenuTitle } from '@/utils/i18n'
export default { export default {
name: 'SidebarItem', name: 'SidebarItem',
props: { props: {
@@ -43,6 +45,9 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
} }
},
methods: {
translateMenuTitle
} }
} }
</script> </script>

View File

@@ -2,7 +2,7 @@
<div class="tags-view-container"> <div class="tags-view-container">
<scroll-pane ref="scrollPane" class="tags-view-wrapper" style="background: rgb(255,255,255)!important;"> <scroll-pane ref="scrollPane" class="tags-view-wrapper" style="background: rgb(255,255,255)!important;">
<router-link v-for="tag in Array.from(visitedViews)" ref="tag" :class="isActive(tag)?'active':''" :to="tag.path" :key="tag.path" class="tags-view-item" @contextmenu.prevent.native="openMenu(tag,$event)" > <router-link v-for="tag in Array.from(visitedViews)" ref="tag" :class="isActive(tag)?'active':''" :to="tag.path" :key="tag.path" class="tags-view-item" @contextmenu.prevent.native="openMenu(tag,$event)" >
{{ tag.title }} {{ translateMenuTitle(tag.title) }}
<span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/> <span class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/>
</router-link> </router-link>
</scroll-pane> </scroll-pane>
@@ -18,6 +18,7 @@
<script> <script>
import ScrollPane from '@/components/ScrollPane' import ScrollPane from '@/components/ScrollPane'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import { translateMenuTitle } from '@/utils/i18n'
export default { export default {
components: { ScrollPane }, components: { ScrollPane },
@@ -53,6 +54,7 @@ export default {
this.addViewTags() this.addViewTags()
}, },
methods: { methods: {
translateMenuTitle,
// generateTitle, // generateTitle by vue-i18n // generateTitle, // generateTitle by vue-i18n
// generateRoute() { // generateRoute() {
// if (this.$route.name) { // if (this.$route.name) {

View File

@@ -14,16 +14,32 @@
<img :src="require('@/assets/img/LOGO.png')" alt="" style="height: 50px;align-items: center;"> <img :src="require('@/assets/img/LOGO.png')" alt="" style="height: 50px;align-items: center;">
<div style="margin-left: 65px"> <div style="margin-left: 65px">
<!-- <div>550KV GIS隔离开关</div> --> <!-- <div>550KV GIS隔离开关</div> -->
<div>智能装配线信息管理系统</div> <div>{{ $t('login.systemName') }}</div>
</div> </div>
</h1> </h1>
<el-dropdown class="login-language" trigger="click" @command="changeLanguage">
<el-button class="login-language-button" size="mini" type="text">
{{ currentLocaleLabel }}
<i class="el-icon-arrow-down el-icon--right"/>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="item in localeOptions"
:key="item.value"
:command="item.value"
:disabled="item.value === currentLocale"
>
{{ item.label }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<div class="line"/> <div class="line"/>
<div class="content"> <div class="content">
<el-form-item prop="username"> <el-form-item prop="username">
<span class="svg-container svg-container_login"> <span class="svg-container svg-container_login">
<svg-icon icon-class="username" /> <svg-icon icon-class="username" />
</span> </span>
<el-input v-model="loginForm.username" name="username" type="text" auto-complete="off" placeholder="请输入用户名" @input.native="changeUser" /> <el-input v-model="loginForm.username" name="username" type="text" auto-complete="off" :placeholder="$t('login.usernamePlaceholder')" @input.native="changeUser" />
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<span class="svg-container"> <span class="svg-container">
@@ -34,39 +50,39 @@
v-model="loginForm.password" v-model="loginForm.password"
name="password" name="password"
auto-complete="on" auto-complete="on"
placeholder="请输入密码" :placeholder="$t('login.passwordPlaceholder')"
@keyup.enter.native="handleLogin"/> @keyup.enter.native="handleLogin"/>
<span class="show-pwd" @click="showPwd"><svg-icon icon-class="eye" /></span> <span class="show-pwd" @click="showPwd"><svg-icon icon-class="eye" /></span>
</el-form-item> </el-form-item>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<el-checkbox v-model="loginForm.checked" class="remeberPassword">记住密码</el-checkbox> <el-checkbox v-model="loginForm.checked" class="remeberPassword">{{ $t('login.rememberPassword') }}</el-checkbox>
<el-button type="text" style="margin-left: 190px;color: #1576e8" @click="handleEdit('form')">修改密码</el-button> <el-button type="text" class="change-password-button" @click="handleEdit('form')">{{ $t('login.changePassword') }}</el-button>
</div> </div>
<el-button :loading="loading" class="signIn" type="primary" style="width:100%;" @click.native.prevent="handleLogin"> <el-button :loading="loading" class="signIn" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span style="font-size: 20px!important;">登录</span> <span style="font-size: 20px!important;">{{ $t('login.loginButton') }}</span>
</el-button> </el-button>
</div> </div>
</el-form> </el-form>
</div> </div>
<el-dialog :visible.sync="dialogFormVisible" title="修改密码" center style="min-height: 200px" width="400px"> <el-dialog :visible.sync="dialogFormVisible" :title="$t('login.changePassword')" center style="min-height: 200px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
<el-form-item label="考勤编号" prop="Account" style="display: inline-block"> <el-form-item :label="$t('login.account')" prop="Account" style="display: inline-block">
<el-input v-model="form.Account" size="small" style="width:200px"/> <el-input v-model="form.Account" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="原始密码" prop="beforPassword" style="display: inline-block"> <el-form-item :label="$t('login.oldPassword')" prop="beforPassword" style="display: inline-block">
<el-input v-model="form.beforPassword" size="small" style="width:200px"/> <el-input v-model="form.beforPassword" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="新密码" prop="newPassword" style="display: inline-block"> <el-form-item :label="$t('login.newPassword')" prop="newPassword" style="display: inline-block">
<el-input v-model="form.newPassword" size="small" style="width:200px"/> <el-input v-model="form.newPassword" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
<el-form-item label="确认密码" prop="againPassword" style="display: inline-block"> <el-form-item :label="$t('login.confirmPassword')" prop="againPassword" style="display: inline-block">
<el-input v-model="form.againPassword" size="small" style="width:200px"/> <el-input v-model="form.againPassword" size="small" style="width:200px"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff()">取消</el-button> <el-button size="small" @click="callOff()">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" size="small" @click="EditPassword('form')">确定</el-button> <el-button type="primary" size="small" @click="EditPassword('form')">{{ $t('common.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -74,42 +90,13 @@
</template> </template>
<script> <script>
import { cloudEditPassword, editPassword } from '@/api/login' import { cloudEditPassword, editPassword } from '@/api/login'
import { setLocale, SUPPORT_LOCALES } from '@/lang'
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
export default { export default {
name: 'Login', name: 'Login',
data() { data() {
const validateValue = (rules, value, callback) => {
if (this.form.newPassword !== this.form.againPassword) {
callback(new Error('两次输入密码不同'))
} else {
callback()
}
}
const validateUsername = (rule, value, callback) => {
// if (!isvalidUsername(value)) {
// callback(new Error('请输入4-5位工号'))
// } else {
// callback()
// }
callback()
}
// const validatePass = (rule, value, callback) => {
// if (value.length < 5) {
// callback(new Error('密码不能小于5位'))
// } else {
// callback()
// }
// }
return { return {
rules: {
againPassword: [
{ required: true, message: '请输入确认密码', trigger: 'blur' },
{ required: true, trigger: 'blur', validator: validateValue }],
Account: [{ required: true, trigger: 'blur', validator: validateUsername }],
beforPassword: [{ required: true, message: '请输入原始密码', trigger: 'blur' }],
newPassword: [{ required: true, message: '请输入新密码', trigger: 'blur' }]
},
list: [], list: [],
form: { form: {
againPassword: '', againPassword: '',
@@ -123,19 +110,59 @@ export default {
password: '', password: '',
checked: false checked: false
}, },
loginRules: { localeOptions: [
username: [{ required: true, trigger: 'blur', validator: validateUsername }] { value: 'zh-CN', label: '中文' },
// password: [{ required: true, trigger: 'blur', validator: validatePass }] { value: 'en-US', label: 'English' }
}, ],
loading: false, loading: false,
pwdType: 'password' pwdType: 'password'
} }
}, },
computed: {
currentLocale() {
return this.$i18n.locale
},
currentLocaleLabel() {
const current = this.localeOptions.find(item => item.value === this.currentLocale)
return current ? current.label : this.$t('common.language')
},
rules() {
return {
againPassword: [
{ required: true, message: this.$t('login.confirmPasswordPlaceholder'), trigger: 'blur' },
{ required: true, trigger: 'blur', validator: this.validateConfirmPassword }],
Account: [{ required: true, trigger: 'blur', validator: this.validateUsername }],
beforPassword: [{ required: true, message: this.$t('login.oldPasswordPlaceholder'), trigger: 'blur' }],
newPassword: [{ required: true, message: this.$t('login.newPasswordPlaceholder'), trigger: 'blur' }]
}
},
loginRules() {
return {
username: [{ required: true, trigger: 'blur', validator: this.validateUsername }]
// password: [{ required: true, trigger: 'blur', validator: validatePass }]
}
}
},
// 页面加载调用获取cookie值 // 页面加载调用获取cookie值
mounted() { mounted() {
this.getCookie() this.getCookie()
}, },
methods: { methods: {
validateConfirmPassword(rules, value, callback) {
if (this.form.newPassword !== this.form.againPassword) {
callback(new Error(this.$t('login.passwordNotSame')))
} else {
callback()
}
},
validateUsername(rule, value, callback) {
// if (!isvalidUsername(value)) {
// callback(new Error('请输入4-5位工号'))
// } else {
// callback()
// }
callback()
},
showPwd() { showPwd() {
if (this.pwdType === 'password') { if (this.pwdType === 'password') {
this.pwdType = '' this.pwdType = ''
@@ -191,6 +218,11 @@ export default {
callOff() { callOff() {
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
changeLanguage(locale) {
if (SUPPORT_LOCALES.indexOf(locale) === -1 || locale === this.currentLocale) return
setLocale(locale)
this.$message.success(this.$t('common.language') + ': ' + this.currentLocaleLabel)
},
EditPassword(formName) { EditPassword(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
@@ -200,17 +232,17 @@ export default {
cloudEditPassword(this.form.Account, this.form.newPassword).then(response => { cloudEditPassword(this.form.Account, this.form.newPassword).then(response => {
console.log(response, 333) console.log(response, 333)
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('修改成功') this.$message.success(this.$t('login.changeSuccess'))
this.dialogFormVisible = false this.dialogFormVisible = false
} else { } else {
this.$message.error('编辑失败') this.$message.error(this.$t('login.editFailed'))
} }
}) })
} else { } else {
this.$message.error('用户名或密码不正确') this.$message.error(this.$t('login.accountPasswordError'))
} }
} else { } else {
this.$message.error('编辑失败') this.$message.error(this.$t('login.editFailed'))
} }
}) })
} }
@@ -297,6 +329,22 @@ export default {
padding: 35px 15px 15px 15px; padding: 35px 15px 15px 15px;
margin: 120px auto; margin: 120px auto;
} }
.login-language {
position: absolute;
right: 20px;
top: 14px;
.login-language-button {
min-width: 78px;
padding: 6px 8px;
color: #1576e8;
font-size: 13px;
cursor: pointer;
}
.login-language-button:hover,
.login-language-button:focus {
color: #0f5eb8;
}
}
.tips { .tips {
font-size: 14px; font-size: 14px;
color: #fff; color: #fff;
@@ -334,6 +382,10 @@ export default {
.remeberPassword{ .remeberPassword{
color: #1576e8; color: #1576e8;
} }
.change-password-button {
margin-left: auto;
color: #1576e8;
}
.show-pwd { .show-pwd {
position: absolute; position: absolute;
right: 10px; right: 10px;