Browse Source

期初导入界面完成

YL2767 1 month ago
parent
commit
cde1beab19
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      src/view/ware/InStore.vue

+ 7
- 3
src/view/ware/InStore.vue View File

@@ -172,15 +172,19 @@
172 172
 						var XLSX = require('xlsx');
173 173
 						if (rABS) {
174 174
 							wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
175
-								type: 'base64'
175
+								type: 'base64',cellDates: true
176 176
 							});
177 177
 						} else {
178 178
 							wb = XLSX.read(binary, {
179
-								type: 'binary'
179
+								type: 'binary',cellDates: true
180 180
 							});
181 181
 						}
182
-						outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是你想要的东西
182
+						outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], {
183
+									raw: false,      // 使用格式化值
184
+									dateNF: 'yyyy-mm-dd HH:mm:ss' // 指定日期格式
185
+								}); //outdata就是你想要的东西
183 186
 						// console.log(JSON.stringify(outdata))
187
+						// this.processExcelData(outdata);
184 188
 						_this.imTableData = outdata
185 189
 					}
186 190
 					reader.readAsArrayBuffer(f);

Loading…
Cancel
Save