订单状态
This commit is contained in:
parent
4ed0d66757
commit
0e870d1fd1
|
|
@ -715,14 +715,15 @@ function downloadCsvTemplate() {
|
|||
function handleCsvImport(file: File) {
|
||||
const reader = new FileReader()
|
||||
reader.onload = async (e) => {
|
||||
const text = (e.target?.result as string) || ''
|
||||
const raw = (e.target?.result as string) || ''
|
||||
const text = raw.replace(/^\uFEFF/, '')
|
||||
const lines = text.split(/\r?\n/).map(l => l.trim()).filter(Boolean)
|
||||
const barcodes: string[] = []
|
||||
for (const line of lines) {
|
||||
const val = line.split(',')[0].trim()
|
||||
if (!val) continue
|
||||
if (/条[型形]码/i.test(val)) continue
|
||||
if (val === 'barcode') continue
|
||||
if (/^barcode$/i.test(val)) continue
|
||||
barcodes.push(val)
|
||||
}
|
||||
if (barcodes.length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user