diff --git a/src/components/userinfo/usercenter/components/mybill.vue b/src/components/userinfo/usercenter/components/mybill.vue index d37bed6..6825ec4 100644 --- a/src/components/userinfo/usercenter/components/mybill.vue +++ b/src/components/userinfo/usercenter/components/mybill.vue @@ -130,7 +130,7 @@
  • {{ item.statusTag }}面试时间: {{ item.interviewTime }} + >{{ statusTimeInfo }}: {{ statusShowTime }}
  • @@ -195,8 +195,8 @@ import { userBillApi } from "../../../../api/userinfo"; import { getUserApplyOrderStatusById, - formatDateYMDHMS, isEmptyCheck, + formatDateYMDHM, } from "../../../../utils/commonUtil"; export default { @@ -225,6 +225,8 @@ export default { billList: [], isunfold: false, + statusTimeInfo: "", // 状态的时间类型 + statusShowTime: "", // 状态时间 }; }, // 计算属性 @@ -268,7 +270,7 @@ export default { }, async getBill() { console.log("click"); - // let that = this; + let that = this; console.log(this.pagination.status); try { this.isspinning = true; @@ -328,15 +330,17 @@ export default { item.isDown = false; } item.statusTag = getUserApplyOrderStatusById(item.status); - item.interviewTime = formatDateYMDHMS(item.interviewTime); + item.interviewTime = formatDateYMDHM(item.interviewTime); + item.entryTime = formatDateYMDHM(item.entryTime); + item.leaveTime = formatDateYMDHM(item.leaveTime); // item.updateTime = formatDateYMDHMS(item.updateTime); // item.createTime = formatDateYMDHMS(item.createTime); item.updateTime = isEmptyCheck(item.updateTime) ? "2022-03-16 14:19" - : formatDateYMDHMS(item.updateTime); + : formatDateYMDHM(item.updateTime); item.createTime = isEmptyCheck(item.createTime) ? "2022-03-16 14:19" - : formatDateYMDHMS(item.createTime); + : formatDateYMDHM(item.createTime); item.index = index + 1; // console.log(that.$refs["Control" + index][0]); @@ -356,11 +360,24 @@ export default { item.isunfold = false; } item.controlUnfold = true; + if (item.status == 10 || item.status == 20 || item.status == 30) { + that.statusTimeInfo = "面试时间"; + that.statusShowTime = item.interviewTime; + } else if (item.status == 40 || item.status == 50) { + that.statusTimeInfo = "入职时间"; + that.statusShowTime = item.entryTime; + } else { + that.statusTimeInfo = "离职时间"; + that.statusShowTime = item.leaveTime; + } // console.log("controlUnfold", item.controlUnfold); // console.log("isunfold", item.isunfold); + console.log(item); }); - }, 0); + }, 100); + this.pagination.total = data.data.recordCount; + this.$forceUpdate(); this.totop(); } } catch (error) { diff --git a/src/utils/commonUtil.js b/src/utils/commonUtil.js index ea7852d..70a9bf0 100644 --- a/src/utils/commonUtil.js +++ b/src/utils/commonUtil.js @@ -1143,7 +1143,50 @@ export function formatDateYMDHMS(val) { return fmt; } } - +/** + * 时间格式化 2017-01-01 01:01 + * @param val + * @returns {string} + */ +export function formatDateYMDHM(val) { + // model -> view,在更新 `` 元素之前格式化值 + if (isEmptyCheck(val)) { + return ""; + } else { + if ((val != null || val == "") && typeof val == "string") { + val = val.replace("-", "/").replace("-", "/"); + } + var value = new Date(val); + //console.log(val); + var fmt = "yyyy-MM-dd HH:mm"; + var o = { + "M+": value.getMonth() + 1, //月份 + "d+": value.getDate(), //日 + "H+": value.getHours(), //小时 + //"h+": val.getHours()%12 == 0 ? 12 : val.getHours()%12, //小时 + "m+": value.getMinutes(), //分 + // "s+": value.getSeconds() //秒 + //"S": val.getMilliseconds() //毫秒 + //"q+": Math.floor((val.getMonth() + 3) / 3) //季度 + }; + if (/(y+)/.test(fmt)) + fmt = fmt.replace( + RegExp.$1, + (value.getFullYear() + "").substr(4 - RegExp.$1.length) + ); + for (var k in o) { + if (new RegExp("(" + k + ")").test(fmt)) { + fmt = fmt.replace( + RegExp.$1, + RegExp.$1.length == 1 + ? o[k] + : ("00" + o[k]).substr(("" + o[k]).length) + ); + } + } + return fmt; + } +} function getJobSpecialLabelNamesArray(jobSpecialLabelNames) { if (isNotEmptyCheck(jobSpecialLabelNames)) { return jobSpecialLabelNames.split(", ");