diff --git a/src/views/modules/shopOrder/productionReport/searchSfdcRollsReport.vue b/src/views/modules/shopOrder/productionReport/searchSfdcRollsReport.vue index daaaed2..7f740fe 100644 --- a/src/views/modules/shopOrder/productionReport/searchSfdcRollsReport.vue +++ b/src/views/modules/shopOrder/productionReport/searchSfdcRollsReport.vue @@ -1710,19 +1710,26 @@ import labelPrintTemplates from '@/mixins/labelPrintTemplates.js'; this._exportLoading = null } }, + formatExportText(value) { + if (value === '' || value === null || value === undefined) { + return '' + } + const safeValue = String(value).replace(/"/g, '""') + return `="${safeValue}"` + }, 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 //多语言