Browse Source

(*)合同明细、开票明细导入验证修改

master
zmh 2 years ago
parent
commit
6d1c6e6d3d
  1. 17
      web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js
  2. 15
      web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js

17
web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js

@ -107,14 +107,6 @@ const ImportContractDetailsModal = props => {
})
}
const judgeNullTime = (v) => {
//注意的点:xlsx将excel中的时间内容解析后,会小一天
//如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒
let a = new Date(v);
a.setTime(a.getTime() + 43 * 1000);
return v ? a : null;
}
const judgeTimeValid = (time) => {
let valid = true;
if (!time) {
@ -176,12 +168,7 @@ const ImportContractDetailsModal = props => {
let d = res[i];
let obj = {};
Object.keys(contractDetailsColumnKeys).map(key => {
//四个日期验证“申请日期”、“收到合同日期”、“验收日期”、“收入确认时间”
if (ColumnDateKey.indexOf(key) != -1) {//两个时间
obj[key] = judgeNullTime(d[contractDetailsColumnKeys[key]]);
} else {
obj[key] = d[contractDetailsColumnKeys[key]] || null;
}
obj[key] = d[contractDetailsColumnKeys[key]] || null;
})
//年度 序号 编号必填
if (!obj.year || !obj.serialNo || !obj.number) {
@ -207,7 +194,7 @@ const ImportContractDetailsModal = props => {
error(`${i + 2}行【编号】重复,请更改后重新上传`)
return
}
//日期验证“申请日期”、“收到合同日期”、“验收日期”、“收入确认时间”
for (let k = 0; k < ColumnDateKey.length; k++) {
let cValid = judgeTimeValid(obj[ColumnDateKey[k]]);
if (!cValid) {

15
web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js

@ -107,14 +107,6 @@ const ImportInvoicingDetailsModal = props => {
})
}
const judgeNullTime = (v) => {
//注意的点:xlsx将excel中的时间内容解析后,会小一天
//如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒
let a = new Date(v);
a.setTime(a.getTime() + 43 * 1000);
return v ? a : null;
}
const judgeTimeValid = (time) => {
let valid = true;
if (!time) {
@ -176,12 +168,7 @@ const ImportInvoicingDetailsModal = props => {
let d = res[i];
let obj = {};
Object.keys(invoicingDetailsColumnKeys).map(key => {
//日期验证“开票日期”
if (ColumnDateKey.indexOf(key) != -1) {//两个时间
obj[key] = judgeNullTime(d[invoicingDetailsColumnKeys[key]]);
} else {
obj[key] = d[invoicingDetailsColumnKeys[key]] || null;
}
obj[key] = d[invoicingDetailsColumnKeys[key]] || null;
})
//年度 序号 编号必填
if (!obj.year || !obj.serialNo || !obj.number) {

Loading…
Cancel
Save