|
|
|
@ -394,14 +394,34 @@ export default { |
|
|
|
this.content = this.transformSheets(sheets); |
|
|
|
this.content = this.transformSheets(sheets); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
.catch((err) => { |
|
|
|
|
|
|
|
console.log(err) |
|
|
|
this.$message.error(err); |
|
|
|
this.$message.error(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//读取日期格式 |
|
|
|
|
|
|
|
formatDate(numb, format) { |
|
|
|
|
|
|
|
const old = numb - 1; |
|
|
|
|
|
|
|
const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60); |
|
|
|
|
|
|
|
const time = new Date(1900, 0, old, 0, 0, t); |
|
|
|
|
|
|
|
const year = time.getFullYear(); |
|
|
|
|
|
|
|
const month = time.getMonth() + 1; |
|
|
|
|
|
|
|
const date = time.getDate(); |
|
|
|
|
|
|
|
console.log(time.getHours()); |
|
|
|
|
|
|
|
console.log(time.getMinutes()); |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
year + |
|
|
|
|
|
|
|
format + |
|
|
|
|
|
|
|
(month < 10 ? "0" + month : month) + |
|
|
|
|
|
|
|
format + |
|
|
|
|
|
|
|
(date < 10 ? "0" + date : date) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
transformSheets(sheets) { |
|
|
|
transformSheets(sheets) { |
|
|
|
const content1 = []; |
|
|
|
const content1 = []; |
|
|
|
for (const key in sheets) { |
|
|
|
for (const key in sheets) { |
|
|
|
content1.push(XLSX.utils.sheet_to_json(sheets[key])); |
|
|
|
content1.push(XLSX.utils.sheet_to_json(sheets[key])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(content1) |
|
|
|
this.dayData.push( |
|
|
|
this.dayData.push( |
|
|
|
{ name: "收件量", data: content1[0][0].日总收件量, huanbi: content1[0][0].收件量日总环比 }, |
|
|
|
{ name: "收件量", data: content1[0][0].日总收件量, huanbi: content1[0][0].收件量日总环比 }, |
|
|
|
{ name: "发件量", data: content1[0][0].日总发件量, huanbi: content1[0][0].发件量日总环比 }, |
|
|
|
{ name: "发件量", data: content1[0][0].日总发件量, huanbi: content1[0][0].发件量日总环比 }, |
|
|
|
@ -418,14 +438,15 @@ export default { |
|
|
|
{ name: "签件量", data: content1[0][0].月总签件量, huanbi: content1[0][0].签件量月总环比 } |
|
|
|
{ name: "签件量", data: content1[0][0].月总签件量, huanbi: content1[0][0].签件量月总环比 } |
|
|
|
); |
|
|
|
); |
|
|
|
this.totalData = this.dayData; |
|
|
|
this.totalData = this.dayData; |
|
|
|
|
|
|
|
this.updateTime = this.formatDate(content1[0][0].日期,'/'); |
|
|
|
|
|
|
|
console.log(this.updateTime) |
|
|
|
content1[1].map((item) => { |
|
|
|
content1[1].map((item) => { |
|
|
|
this.xData.unshift(item.日期.substring(item.日期.length - 5).replace(".", "-")); |
|
|
|
// item.日期.substring(item.日期.length - 5).replace(".", "-") |
|
|
|
|
|
|
|
this.xData.unshift(this.formatDate(item.日期,'-').substring(this.formatDate(item.日期,'-').length - 5).replace(".", "-")); |
|
|
|
this.yData1.push(item.到件量); |
|
|
|
this.yData1.push(item.到件量); |
|
|
|
this.yData2.push(item.派件量); |
|
|
|
this.yData2.push(item.派件量); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// this.dateTime = content1[0][0].日期.replaceAll(".", "/"); |
|
|
|
console.log(this.xData) |
|
|
|
this.updateTime = content1[0][0].日期.replace(/\D/g, "/"); |
|
|
|
|
|
|
|
// this.$message.success(content1[0][0].日期); |
|
|
|
|
|
|
|
content1[3].map((item) => { |
|
|
|
content1[3].map((item) => { |
|
|
|
this.villageData.push({ name: item.村点名称, upData: item.上行, downData: item.下行 }); |
|
|
|
this.villageData.push({ name: item.村点名称, upData: item.上行, downData: item.下行 }); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|