| src/settings.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/utils/myUtil.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/settings.js
@@ -21,18 +21,18 @@ // tx-manager控制台 txUrl: 'http://localhost:8501/admin/index.html#/login', // 文件上传地址 filesUploadUrl: 'http://120.24.23.155:8301/hr/filesUpload', filesUploadUrl: 'http://127.0.0.1:8301/hr/filesUpload', // 个人文件上传地址 uploadSinglePath: 'http://120.24.23.155:8301/hr/empAccessory', uploadSinglePath: 'http://127.0.0.1:8301/hr/empAccessory', // 个人文件上传地址 getEmpBaseInfoImage: 'http://120.24.23.155:8301/hr/empBaseInfo/image/', getEmpBaseInfoImage: 'http://127.0.0.1:8301/hr/empBaseInfo/image/', // 下载员工导入模版 downloadEmpExcel: 'http://120.24.23.155:8000/员工信息.xls', downloadEmpExcel: 'http://127.0.0.1:8000/员工信息.xls', // 导入员工 uploadEmpExcel: 'http://120.24.23.155:8301/hr/empBaseInfo/importEmp', uploadEmpExcel: 'http://127.0.0.1:8301/hr/empBaseInfo/importEmp', // 获取图片 getFilesUploadImage: 'http://120.24.23.155:8301/hr/filesUpload/image/', getFilesUploadImage: 'http://127.0.0.1:8301/hr/filesUpload/image/', // 获取图片 getAccessoryImage: 'http://120.24.23.155:8301/hr/empAccessory/image/' getAccessoryImage: 'http://127.0.0.1:8301/hr/empAccessory/image/' } } src/utils/myUtil.js
@@ -37,20 +37,39 @@ export function calculateSeniority(val) { // eslint-disable-next-line eqeqeq if (val.length === 0) { return 0 return '0年0月' } var myDate = new Date() var month = myDate.getMonth() + 1 var day = myDate.getDate() var entryDate = new Date(val) var age = myDate.getFullYear() - entryDate.getFullYear() if (entryDate.getMonth < month || entryDate.getMonth === month && entryDate.getDay <= day) { age++ var sDate = new Date(val) var eDate = new Date() // 获得各自的年、月、日 var sY = sDate.getFullYear() var sM = sDate.getMonth() + 1 var sD = sDate.getDate() var eY = eDate.getFullYear() var eM = eDate.getMonth() + 1 var eD = eDate.getDate() // var flagD = 0 var flagM = 0 var flagY = 0 // var months = 0 var d = eD - sD if (d > 0 && d >= 15) { flagM = 1 } if (age <= 0) { age = 0 if (d < 0 && 30 + d < 15) { flagM = -1 } return age var m = eM + flagM - sM if (m < 0) { flagY = -1 m = 12 + m } var y = eY + flagY - sY return y + '年' + m + '月' } /**