Browse Source

(*)岗位绩效导入修复:评级时间增加单元格为时间格式支持

master
周沫沫历险记 2 years ago
parent
commit
7a72c5e9ca
  1. 14
      web/client/src/sections/humanAffairs/components/importPositionRating.jsx

14
web/client/src/sections/humanAffairs/components/importPositionRating.jsx

@ -89,7 +89,7 @@ const ImportPositionRatingModal = props => {
//2020/8/1xlsx Fri Jul 31 2020 23:59:17 GMT+0800 43 //2020/8/1xlsx Fri Jul 31 2020 23:59:17 GMT+0800 43
let a = new Date(v); let a = new Date(v);
a.setTime(a.getTime() + 43 * 1000); a.setTime(a.getTime() + 43 * 1000);
return a; return a.getFullYear() + '-' + a.getMonth() + '-' + a.getDay();
} }
return ( return (
@ -169,8 +169,16 @@ const ImportPositionRatingModal = props => {
} }
} }
else if ("ratingTime" == item) { else if ("ratingTime" == item) {
if (obj.ratingTime.toString().match(/^(\d{1,4})(-|.|\/)(\d{1,2})\2(\d{1,2})$/)) { if (!isNaN(Date.parse(obj.ratingTime))) {
obj["ratingTime"] = changeTime(obj.ratingTime); if ("object" == typeof obj.ratingTime) {//
obj["ratingTime"] = changeTime(obj.ratingTime);
}
else {
if (!obj.ratingTime.toString().match(/^(\d{1,4})(-|.|\/)(\d{1,2})\2(\d{1,2})$/)) {
errmsg = `${i + 2}行【${IMPORT_FIELD[item].label}】不合法,请将单元格更改为时间格式`;
break;
}
}
} else { } else {
errmsg = `${i + 2}行【${IMPORT_FIELD[item].label}】不合法,请修改`; errmsg = `${i + 2}行【${IMPORT_FIELD[item].label}】不合法,请修改`;
break; break;

Loading…
Cancel
Save