问题描述:
订单列表在导出订单时丢失订单类型条件。
解决方法:
src/pages/order/orderList/components/tableList.vue,找到这个文件,修改exports()方法。
async exports(value) {
this.exportListOn = this.exportList.findIndex(
(item) => item.name === value
)
let [th, filekey, data, fileName] = [[], [], [], '']
let excelData = {
...this.where,
page: 1,
export_type: value,
ids: this.checkUidList.join(),
plat_type: this.currentTab,
}
for (let i = 0; i < excelData.page; i++) {
let lebData = await this.downOrderData(excelData)
if (!lebData.export.length) {
break;
}
if (!fileName) {
fileName = lebData.filename
}
if (!filekey.length) {
filekey = lebData.filekey
}
if (!th.length) {
th = lebData.header
}
data = data.concat(lebData.export)
excelData.page++
}
let sheetData = []
for (let j = 0; j < data.length; j++) {
let goodsList = data[j].goods_name.split('\n')
for (let k = 0; k < goodsList.length; k++) {
let row = {...data[j]}
row.goods_name = goodsList[k]
if (k) {
for (const key in row) {
if (Object.hasOwnProperty.call(row, key)) {
if (key !== 'goods_name') {
row[key] = null
}
}
}
}
sheetData.push(row)
}
}
exportExcel(th, filekey, fileName, sheetData)
},
修改完成后需要重新打包,打包文档: https://doc.crmeb.com/pro/crmebprov3_1/15816