批量导出成本导出异常数据
This commit is contained in:
parent
bcb7cf7bb2
commit
130ecfc07a
@ -25,6 +25,16 @@
|
|||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</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>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -168,6 +178,7 @@ export default {
|
|||||||
// 运单列表表格数据
|
// 运单列表表格数据
|
||||||
orderList: [],
|
orderList: [],
|
||||||
tmpDataList: [],
|
tmpDataList: [],
|
||||||
|
tmpErrorList:[],
|
||||||
selectionList:[],
|
selectionList:[],
|
||||||
selectionIndexList: [],
|
selectionIndexList: [],
|
||||||
|
|
||||||
@ -282,7 +293,7 @@ export default {
|
|||||||
prop: key
|
prop: key
|
||||||
}));
|
}));
|
||||||
// 转换费用类型
|
// 转换费用类型
|
||||||
that.feeItemMap=new Map();;
|
that.feeItemMap=new Map();
|
||||||
for(let i=0;i<that.dict.type.emis_cost_fee_type.length;i++){
|
for(let i=0;i<that.dict.type.emis_cost_fee_type.length;i++){
|
||||||
let item=that.dict.type.emis_cost_fee_type[i];
|
let item=that.dict.type.emis_cost_fee_type[i];
|
||||||
that.feeItemMap[""+item.label+""]=item.value;
|
that.feeItemMap[""+item.label+""]=item.value;
|
||||||
@ -627,6 +638,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.orderList = this.orderList.concat(this.tmpDataList);
|
this.orderList = this.orderList.concat(this.tmpDataList);
|
||||||
|
this.tmpErrorList = this.orderList.filter(item => item.uploadStatus === -1);
|
||||||
this.tmpDataList=[];
|
this.tmpDataList=[];
|
||||||
this.openUploadForm = false;
|
this.openUploadForm = false;
|
||||||
|
|
||||||
@ -672,6 +684,7 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
that.$refs.multipleTable.clearSelection();
|
that.$refs.multipleTable.clearSelection();
|
||||||
|
that.tmpErrorList = that.orderList.filter(item => item.uploadStatus === -1);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
@ -713,6 +726,47 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return sums;
|
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]
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user