|
@@ -85,7 +85,7 @@
|
|
|
:on-change="importClick" :show-file-list="false"
|
|
|
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
:auto-upload="false">
|
|
|
- <el-button type="primary">导入</el-button>
|
|
|
+ <ws-button type="primary">导入</ws-button>
|
|
|
</el-upload>
|
|
|
</template>
|
|
|
<template slot="right"> </template>
|
|
@@ -514,7 +514,7 @@
|
|
|
var reader = new FileReader();
|
|
|
//if (!FileReader.prototype.readAsBinaryString) {
|
|
|
FileReader.prototype.readAsBinaryString = function(f) {
|
|
|
- var binary = "";
|
|
|
+ var binary = '';
|
|
|
var rABS = false; //是否将文件读取为二进制字符串
|
|
|
var pt = this;
|
|
|
var wb; //读取完成的数据
|
|
@@ -556,7 +556,8 @@
|
|
|
obj.tare = v.皮重
|
|
|
obj.netWeight = v.净重
|
|
|
obj.dryGrainPrice = v.单价
|
|
|
- obj.qualityDate = v.日期
|
|
|
+ obj.qualityDate = _this.formatDate(v.日期,'-')
|
|
|
+ debugger
|
|
|
_this.excelFreightspace.push(obj)
|
|
|
})
|
|
|
if (_this.excelFreightspace) {
|
|
@@ -586,6 +587,15 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ 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() ;
|
|
|
+ return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date)+' 00:00:00'
|
|
|
+ },
|
|
|
invoicingClose() {
|
|
|
this.invoicingshow = false
|
|
|
},
|