|
|
@@ -220,7 +220,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "年龄",
|
|
|
- prop: "status",
|
|
|
+ prop: "age",
|
|
|
hidden: true,
|
|
|
},
|
|
|
{
|
|
|
@@ -266,7 +266,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "简历完成度",
|
|
|
- prop: "remark",
|
|
|
+ prop: "completenessLabel",
|
|
|
hidden: true,
|
|
|
width:"240px"
|
|
|
},
|
|
|
@@ -491,12 +491,39 @@ export default {
|
|
|
item.email = item.recruitResumeVo.email
|
|
|
item.workYear = item.recruitResumeVo.startYear?(nowYear-item.recruitResumeVo.startYear) +'年':'暂无数据'
|
|
|
item.jobType = item.recruitResumeVo.jobType
|
|
|
+ item.completenessLabel = item.recruitResumeVo.completeness+'%'
|
|
|
+ let userBirth = new Date(item.recruitResumeVo.userBirth);
|
|
|
+ let birthday = [userBirth.getFullYear(),userBirth.getMonth()+1,userBirth.getDate()]
|
|
|
+ item.age = item.recruitResumeVo.userBirth==null?'暂无数据':this.getAge(birthday)[0]+'岁'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.loading = false;
|
|
|
},
|
|
|
+ getAge(birthday) {
|
|
|
+ // 新建日期对象
|
|
|
+ let date = new Date()
|
|
|
+ // 今天日期,数组,同 birthday
|
|
|
+ let today = [date.getFullYear(), date.getMonth() + 1, date.getDate()]
|
|
|
+ // 分别计算年月日差值
|
|
|
+ let age = today.map((value, index) => {
|
|
|
+ return value - birthday[index]
|
|
|
+ })
|
|
|
+ // 当天数为负数时,月减 1,天数加上月总天数
|
|
|
+ if (age[2] < 0) {
|
|
|
+ // 简单获取上个月总天数的方法,不会错
|
|
|
+ let lastMonth = new Date(today[0], today[1], 0)
|
|
|
+ age[1]--
|
|
|
+ age[2] += lastMonth.getDate()
|
|
|
+ }
|
|
|
+ // 当月数为负数时,年减 1,月数加上 12
|
|
|
+ if (age[1] < 0) {
|
|
|
+ age[0]--
|
|
|
+ age[1] += 12
|
|
|
+ }
|
|
|
+ return age
|
|
|
+ },
|
|
|
init() {
|
|
|
this.search();
|
|
|
},
|