|
@ -18,6 +18,7 @@ const ImportPerformanceSummaryModal = props => { |
|
|
const confirm = () => { |
|
|
const confirm = () => { |
|
|
if (postData.length) { |
|
|
if (postData.length) { |
|
|
setLoading(true) |
|
|
setLoading(true) |
|
|
|
|
|
console.log(postData,'-------------------') |
|
|
// dispatch(businessManagement.importSalePerformance(postData)).then(res => { |
|
|
// dispatch(businessManagement.importSalePerformance(postData)).then(res => { |
|
|
// if (res.success) { |
|
|
// if (res.success) { |
|
|
// onCancel() |
|
|
// onCancel() |
|
@ -64,13 +65,14 @@ const ImportPerformanceSummaryModal = props => { |
|
|
if (window.FileReader) { |
|
|
if (window.FileReader) { |
|
|
let reader = new FileReader(); |
|
|
let reader = new FileReader(); |
|
|
reader.readAsBinaryString(request.response); |
|
|
reader.readAsBinaryString(request.response); |
|
|
|
|
|
|
|
|
reader.onload = event => { |
|
|
reader.onload = event => { |
|
|
try { |
|
|
try { |
|
|
const { result } = event.target; |
|
|
const { result } = event.target; |
|
|
// 以二进制流方式读取得到整份excel表格对象 |
|
|
// 以二进制流方式读取得到整份excel表格对象 |
|
|
const workbook = XLSX.read(result, { |
|
|
const workbook = XLSX.read(result, { |
|
|
type: "binary", |
|
|
type: "binary", |
|
|
cellDates: true,//设为true,将天数的时间戳转为时间格式 |
|
|
// cellDates: true,//设为true,将天数的时间戳转为时间格式 |
|
|
codepage: 936,//解决了乱码问题 |
|
|
codepage: 936,//解决了乱码问题 |
|
|
}); |
|
|
}); |
|
|
let data = []; // 存储获取到的数据 |
|
|
let data = []; // 存储获取到的数据 |
|
|