|
@ -104,17 +104,17 @@ const ImportBackModal = props => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const judgeNull = (value) => { |
|
|
// const judgeNull = (value) => { |
|
|
return value ? String(value).trim().replace(/\s*/g, "") : null; |
|
|
// return value ? String(value).trim().replace(/\s*/g, "") : null; |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
const judgeNullTime = (v) => { |
|
|
// const judgeNullTime = (v) => { |
|
|
//注意的点:xlsx将excel中的时间内容解析后,会小一天 |
|
|
// //注意的点:xlsx将excel中的时间内容解析后,会小一天 |
|
|
//如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 |
|
|
// //如2020/8/1,xlsx会解析成 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 v ? a : null; |
|
|
// return v ? a : null; |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
const judgeTimeValid = (time) => { |
|
|
const judgeTimeValid = (time) => { |
|
|
let valid = true; |
|
|
let valid = true; |
|
@ -178,11 +178,11 @@ const ImportBackModal = props => { |
|
|
let d = res[i]; |
|
|
let d = res[i]; |
|
|
let obj = {}; |
|
|
let obj = {}; |
|
|
Object.keys(backMoneyColumnKeys).map(key => { |
|
|
Object.keys(backMoneyColumnKeys).map(key => { |
|
|
if (['receivableDate', 'incomeConfirmdate'].indexOf(key) != -1) {//两个时间 |
|
|
// if (['receivableDate', 'incomeConfirmdate'].indexOf(key) != -1) {//两个时间 |
|
|
obj[key] = judgeNullTime(d[backMoneyColumnKeys[key]]); |
|
|
// obj[key] = judgeNullTime(d[backMoneyColumnKeys[key]]); |
|
|
} else { |
|
|
// } else { |
|
|
obj[key] = d[backMoneyColumnKeys[key]] || null; |
|
|
obj[key] = d[backMoneyColumnKeys[key]] || null; |
|
|
} |
|
|
//} |
|
|
}) |
|
|
}) |
|
|
//年度 序号 编号必填 |
|
|
//年度 序号 编号必填 |
|
|
if (!obj.year || !obj.serialNo || !obj.number) { |
|
|
if (!obj.year || !obj.serialNo || !obj.number) { |
|
|