扫描记录查询页的导出功能完成
This commit is contained in:
parent
19cd003bbc
commit
d4484268d8
@ -93,6 +93,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<xd-table v-loading="loading"
|
<xd-table v-loading="loading"
|
||||||
|
ref="dataTable"
|
||||||
border stripe
|
border stripe
|
||||||
size="small"
|
size="small"
|
||||||
:data="emisElectronicPagApplyList"
|
:data="emisElectronicPagApplyList"
|
||||||
@ -138,7 +139,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="getList"
|
@click="handleExport"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -154,7 +155,7 @@
|
|||||||
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
<el-table-column :label="$t('单号')" align="center" prop="queryType" min-width="170">
|
<el-table-column :label="$t('单号')" align="center" prop="billCode" min-width="170">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{scope.row.queryType=="1"?scope.row.billCode:scope.row.orderSN}}</span>
|
<span>{{scope.row.queryType=="1"?scope.row.billCode:scope.row.orderSN}}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -658,71 +659,72 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// this.download('emis/emisElectronicPagApply/export', {
|
let that = this;
|
||||||
// ...this.queryParams
|
|
||||||
// }, `emisElectronicPagApply_${new Date().getTime()}.xlsx`)
|
|
||||||
const loadingInstance = this.$loading({
|
const loadingInstance = this.$loading({
|
||||||
text: '正在导出...'
|
text: '正在导出...'
|
||||||
})
|
})
|
||||||
var qParam = {...this.queryParams};
|
var qParam = {...this.queryParams};
|
||||||
qParam.pageNum=1;
|
qParam.pageNum=1;
|
||||||
qParam.pageSize=5000;
|
qParam.pageSize=20;
|
||||||
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
|
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
|
||||||
this.queryParams.params["beginScanDate"] = dateToStr(this.dateTimeRange[0]);
|
qParam.params.beginScanDate = dateToStr(new Date(this.dateTimeRange[0]));
|
||||||
this.queryParams.params["endScanDate"] = dateToStr(this.dateTimeRange[1]);
|
qParam.params.endScanDate = dateToStr(new Date(this.dateTimeRange[1]));
|
||||||
|
}else{
|
||||||
|
qParam.params.beginScanDate = null;
|
||||||
|
qParam.params.endScanDate = null;
|
||||||
}
|
}
|
||||||
this.queryParams.params["queryType"] = this.queryParams.queryType;//1:yd;2:dd;
|
qParam.params.queryType = this.queryParams.queryType;//1:yd;2:dd;
|
||||||
this.queryParams.params["isSubBill"] = this.queryParams.isSubBill;//1:子单;0:主单
|
qParam.params.isSubBill = this.queryParams.isSubBill;//1:子单;0:主单
|
||||||
|
|
||||||
listEmisTmsScanRecord(this.queryParams).then(response => {
|
let queryType = this.queryParams.queryType;
|
||||||
this.downloadLoading = false
|
if(queryType == "1"){
|
||||||
|
qParam.orderSN=null;
|
||||||
|
}else if(queryType == "0"){
|
||||||
|
qParam.orderSN=this.queryParams.billCode;
|
||||||
|
qParam.billCode=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
listEmisTmsScanRecord(qParam).then(response => {
|
||||||
|
this.loadingInstance = false
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const curList = []
|
const curList = []
|
||||||
for (let index = 0; index < response.rows.length; index++) {
|
for (let index = 0; index < response.rows.length; index++) {
|
||||||
let scanRstItem = response.rows[index];
|
let scanRstItem = response.rows[index];
|
||||||
let record =Object.assign({}, scanRstItem)
|
let record =Object.assign({}, scanRstItem)
|
||||||
record.orderType = this.queryParams.orderType;
|
if(this.queryParams.queryType!="1"){
|
||||||
|
record.billCode = qParam.orderSN;
|
||||||
|
}
|
||||||
record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
|
record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
|
||||||
record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
|
record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
|
||||||
|
record.scanDate = parseTime(record.scanDate);
|
||||||
|
record.createTime = parseTime(record.createTime);
|
||||||
|
debugger
|
||||||
|
console.log(that)
|
||||||
|
record.scanType = that.dict.label.emis_scan_type[record.scanType];
|
||||||
curList.push(record);
|
curList.push(record);
|
||||||
}
|
}
|
||||||
|
let tHeader = [];// ['id','单号','单号类型','车牌号','扫描时间','扫描类型','扫描网点','上/下一网点','扫描员','录入时间','扫描重量'];
|
||||||
|
let filterVal = [];// ['id','billCode','orderType','carNo','scanDate','scanType','scanSite','preOrNextStation','scanMan','createTime','scanWeight'];
|
||||||
|
|
||||||
|
for(let sl = 0; sl < this.$refs.dataTable.storageList.length; sl++){
|
||||||
|
if(this.$refs.dataTable.storageList[sl].show){
|
||||||
|
tHeader.push(this.$refs.dataTable.storageList[sl].label);
|
||||||
|
filterVal.push(this.$refs.dataTable.storageList[sl].prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debugger
|
||||||
import('@/vendor/Export2Excel').then(excel => {
|
import('@/vendor/Export2Excel').then(excel => {
|
||||||
const tHeader = ['id','单号','单号类型','车牌号','扫描时间','扫描类型','扫描网点','上/下一网点','扫描员','录入时间','扫描重量'];
|
|
||||||
const filterVal = ['id','billCode','orderType','carNo','scanDate','scanType','scanSite','preOrNextStation','scanMan','createTime','scanWeight'];
|
|
||||||
const data = this.formatJson(filterVal, curList, curList)
|
const data = this.formatJson(filterVal, curList, curList)
|
||||||
excel.export_json_to_excel({
|
excel.export_json_to_excel({
|
||||||
header: tHeader,
|
header: tHeader,
|
||||||
data,
|
data,
|
||||||
filename: '网点电子面单申请',
|
filename: '扫描记录查询',
|
||||||
autoWidth: true
|
autoWidth: true
|
||||||
})
|
})
|
||||||
loadingInstance.close()
|
loadingInstance.close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// listEmisTmsScanRecord(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
|
|
||||||
// this.emisElectronicPagApplyList = [];
|
|
||||||
// this.loading = false;
|
|
||||||
// let rows = response.rows;
|
|
||||||
// this.total = response.total;
|
|
||||||
// if(!rows || rows.length == 0){
|
|
||||||
// this.$message.error("未查到单号");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// for (let index = 0; index < rows.length; index++) {
|
|
||||||
// let scanRstItem = rows[index];
|
|
||||||
// console.log(scanRstItem);
|
|
||||||
|
|
||||||
// let record =Object.assign({}, scanRstItem)
|
|
||||||
// record.orderType = this.queryParams.orderType;
|
|
||||||
// record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
|
|
||||||
// record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
|
|
||||||
// this.emisElectronicPagApplyList.push(record);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
formatJson(filterVal, jsonData, resData) {
|
formatJson(filterVal, jsonData, resData) {
|
||||||
let index = 0
|
let index = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user