签收记录查询导出

This commit is contained in:
wuteng 2026-03-27 11:12:10 +08:00
parent 4b47213d65
commit 260b78e7b9

View File

@ -62,7 +62,7 @@
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
ref="refTable"
v-loading="loading"
border
size="mini"
@ -118,7 +118,7 @@
<span>{{ parseTime(scope.row.waybillDetail.estimateDate) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('线路')" align="center" prop="" min-width="100">
<el-table-column :label="$t('线路')" align="center" prop="transLineTypeName" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.waybillDetail.transLineTypeName }}</span>
</template>
@ -128,7 +128,7 @@
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.waybillDetail.paymentType"/>
</template>
</el-table-column>
<el-table-column :label="$t('产品类型')" align="center" prop="" min-width="100">
<el-table-column :label="$t('产品类型')" align="center" prop="productTypeName" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.waybillDetail.productTypeName }}</span>
</template>
@ -320,22 +320,7 @@ export default {
/** 查询扫描记录列表 */
getList() {
this.loading = true;
console.log("---->this.queryParams,", this.queryParams);
let queryParams = Object.assign({},this.queryParams);
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
queryParams.params.beginScanDate = dateToStr(new Date(this.dateTimeRange[0]));
queryParams.params.endScanDate = dateToStr(new Date(this.dateTimeRange[1]));
}else{
queryParams.params.beginScanDate = null;
queryParams.params.endScanDate = null;
}
if(this.queryParams.params.queryOrderType == "1"){
queryParams.orderSN=null;
}else if(this.queryParams.params.queryOrderType == "0"){
queryParams.orderSN=this.queryParams.billCode;
queryParams.billCode=null;
}
queryParams.scanType="50";
let queryParams = this.initQueryParams();
listEmisTmsScanRecord(queryParams).then(response => {
this.tmsScanList = [];
this.loading = false;
@ -356,6 +341,24 @@ export default {
}
});
},
initQueryParams() {
let qParam = Object.assign({}, this.queryParams);
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
qParam.params.beginScanDate = dateToStr(new Date(this.dateTimeRange[0]));
qParam.params.endScanDate = dateToStr(new Date(this.dateTimeRange[1]));
} else {
qParam.params.beginScanDate = null;
qParam.params.endScanDate = null;
}
if (this.queryParams.params.queryOrderType == "1") {
qParam.orderSN = null;
} else if (this.queryParams.params.queryOrderType == "0") {
qParam.orderSN = this.queryParams.billCode;
qParam.billCode = null;
}
qParam.scanType = "50";
return qParam;
},
onStaffSelect(item){
this.form.dispatchOrSendMan=item.empName || this.$store.getters.empName;
this.form.dispatchOrSendManCode=item.empCode || this.$store.getters.empCode;
@ -443,22 +446,9 @@ export default {
const loadingInstance = this.$loading({
text: '正在导出...'
})
let queryParams = Object.assign({},this.queryParams);
queryParams.pageNum=1;
queryParams.pageSize=5000;
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
queryParams.params.beginSignDate = this.dateTimeRange[0];
queryParams.params.endSignDate = this.dateTimeRange[1];
}else{
queryParams.params.beginSignDate = null;
queryParams.params.endSignDate = null;
}
if(this.queryParams.params.queryOrderType == "1"){
queryParams.orderSN=null;
}else if(this.queryParams.params.queryOrderType == "0"){
queryParams.orderSN=this.queryParams.billCode;
queryParams.billCode=null;
}
let queryParams = this.initQueryParams();
queryParams.pageNum = 1;
queryParams.pageSize = 5000;
listEmisTmsScanRecord(queryParams).then(response => {
this.downloadLoading = false
let rows = response.rows;
@ -467,39 +457,26 @@ export default {
this.$modal.msgError("未查到单号");
return;
}
// for (let index = 0; index < rows.length; index++) {
// let scanRstItem = rows[index];
// console.log(scanRstItem);
// let record =Object.assign({}, scanRstItem)
// record.queryType = this.queryParams.queryType;
// record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
// record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
// this.tmsScanList.push(record);
// }
if (response.code === 200) {
const curList = []
for (let index = 0; index < response.rows.length; index++) {
let scanRstItem = response.rows[index];
let record =Object.assign({}, scanRstItem)
record.orderType = this.queryParams.orderType;
record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
curList.push(record);
this.exportData(rows,loadingInstance);
}
});
},
exportData(selData, loadingInstance) {
const curList = selData
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 exportParam = this.$refs.refTable.getExportParam();
const tHeader = exportParam.header;
const filterVal = exportParam.filter;
const data = this.formatJson(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '签收记录',
filename: '签收记录列表',
autoWidth: true
})
loadingInstance.close()
})
}
});
},
formatJson(filterVal, jsonData, resData) {
let index = 0
@ -508,11 +485,43 @@ export default {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
return '已签收';
}
return statusStr;
if (j === 'sendDate') {
//formatJson
return v['waybillDetail']?.[j]||'';
}
//waybillDetail.estimateDate
if (j === 'estimateDate') {
return v['waybillDetail']?.[j]||'';
}
//waybillDetail.transLineTypeName
if (j === 'transLineTypeName') {
return v['waybillDetail']?.[j]||'';
}
//paymentType
if (j === 'paymentType') {
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail'][j]);
}
//waybillDetail.timeType
if (j === 'timeType') {
return v['waybillDetail']?.[j]||'';
}
//waybillDetail.customerName
if (j === 'customerName') {
return v['waybillDetail']?.[j]||'';
}
//waybillDetail.receiveCountryName
if (j === 'waybillDetail.receiveCountryName') {
return v['waybillDetail']?.['receiveCountryName']||'';
}
// waybillDetail.receiveProvinceName
if (j === 'waybillDetail.receiveProvinceName') {
return v['waybillDetail']?.['receiveProvinceName']||'';
}
//waybillDetail.productTypeName
if (j === 'productTypeName') {
return v['waybillDetail']?.[j]||'';
}
return v[j]
}))
@ -530,23 +539,23 @@ export default {
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
.query-label {
}
.query-label {
.el-radio{
display: block;
line-height: 23px;
white-space: normal;
margin-right: 0;
}
}
.ellipsis {
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
}
}
</style>