批量导出成本导出异常数据

This commit is contained in:
wuteng 2026-02-25 09:34:12 +08:00
parent bcb7cf7bb2
commit 130ecfc07a

View File

@ -25,6 +25,16 @@
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
plain
type="warning"
icon="el-icon-download"
size="mini"
:disabled="tmpErrorList.length==0"
@click="handleExport"
>导出异常数据</el-button>
</el-col>
</el-row>
</div>
</div>
@ -168,6 +178,7 @@ export default {
// 运单列表表格数据
orderList: [],
tmpDataList: [],
tmpErrorList:[],
selectionList:[],
selectionIndexList: [],
@ -282,7 +293,7 @@ export default {
prop: key
}));
// 转换费用类型
that.feeItemMap=new Map();;
that.feeItemMap=new Map();
for(let i=0;i<that.dict.type.emis_cost_fee_type.length;i++){
let item=that.dict.type.emis_cost_fee_type[i];
that.feeItemMap[""+item.label+""]=item.value;
@ -627,6 +638,7 @@ export default {
}
this.orderList = this.orderList.concat(this.tmpDataList);
this.tmpErrorList = this.orderList.filter(item => item.uploadStatus === -1);
this.tmpDataList=[];
this.openUploadForm = false;
@ -672,6 +684,7 @@ export default {
})
})
that.$refs.multipleTable.clearSelection();
that.tmpErrorList = that.orderList.filter(item => item.uploadStatus === -1);
}).then(() => {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
@ -681,7 +694,7 @@ export default {
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
//指定列求和
//指定列求和
getSummaries(param) {
const { columns, data } = param;
const sums = [];
@ -713,6 +726,47 @@ export default {
}
});
return sums;
},
handleExport(){
const loadingInstance = this.$loading({
text: '正在导出...'
})
this.exportData(this.tmpErrorList,loadingInstance);
},
exportData(selData, loadingInstance) {
const curList = selData
import('@/vendor/Export2Excel').then(excel => {
// const exportParam = this.$refs.multipleTable.getExportParam();
const tHeader = ['状态','异常信息',...this.dynamicCol.map(item => item.label)];
const filterVal = ['uploadStatus','errorInfo',...this.dynamicCol.map(item => item.prop)];
const data = this.formatJson(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '寄件运单列表',
autoWidth: true
})
loadingInstance.close()
})
},
formatJson(filterVal, jsonData, resData) {
let index = 0
return jsonData.map(v => filterVal.map(j => {
if (j === 'index') {
return ++index
}
if(j === 'uploadStatus'){
if(v[j] === -1){
return '异常'
}else if(v[j] === 0){
return '待处理'
}else{
return '成功'
}
}
return v[j]
}))
}
}
};