|
|
@ -1710,19 +1710,26 @@ import labelPrintTemplates from '@/mixins/labelPrintTemplates.js'; |
|
|
this._exportLoading = null |
|
|
this._exportLoading = null |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
formatExportText(value) { |
|
|
|
|
|
if (value === '' || value === null || value === undefined) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const safeValue = String(value).replace(/"/g, '""') |
|
|
|
|
|
return `="${safeValue}"` |
|
|
|
|
|
}, |
|
|
fields() { |
|
|
fields() { |
|
|
let json = "{" |
|
|
|
|
|
this.columnList.forEach((item, index) => { |
|
|
|
|
|
if (index == this.columnList.length - 1) { |
|
|
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|
|
|
|
|
} else { |
|
|
|
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|
|
|
|
|
|
|
|
const fieldMap = {} |
|
|
|
|
|
this.columnList.forEach(item => { |
|
|
|
|
|
if (item.columnProp === 'packingList') { |
|
|
|
|
|
fieldMap[item.columnLabel] = { |
|
|
|
|
|
field: item.columnProp, |
|
|
|
|
|
callback: value => this.formatExportText(value) |
|
|
|
|
|
} |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
fieldMap[item.columnLabel] = item.columnProp |
|
|
}) |
|
|
}) |
|
|
json += "}" |
|
|
|
|
|
let s = eval("(" + json + ")") |
|
|
|
|
|
|
|
|
|
|
|
return s |
|
|
|
|
|
|
|
|
return fieldMap |
|
|
}, |
|
|
}, |
|
|
// 导出 end |
|
|
// 导出 end |
|
|
//多语言 |
|
|
//多语言 |
|
|
|