This commit is contained in:
linfso 2024-12-14 17:26:48 +08:00
parent 426cc4c30a
commit 1c6ad4be1d
2 changed files with 374 additions and 62 deletions

View File

@ -19,6 +19,7 @@
<el-select v-model="coData.batchType" placeholder="" style="width:100%">
<el-option key="1" label="一程批次" value="1"></el-option>
<el-option key="2" label="二程批次" value="2"></el-option>
<el-option key="3" label="网点互寄" value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -63,9 +64,9 @@
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发出时间" prop="carTime">
<el-form-item label="发出时间" prop="etd">
<el-date-picker clearable
v-model="coData.carTime"
v-model="coData.etd"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发出时间"
@ -171,6 +172,8 @@
storageName="emisCoPackDetail_main_240702"
ref="refTable"
id="emisCoPackDetail"
:data="emisCoPackDetail"
:showSearch.sync="showSearch"
@ -205,11 +208,10 @@
<el-button style="margin-right: 5px;"
type="warning"
plain
:disabled="single"
icon="el-icon-download"
size="mini"
@click="handleDownBatchDtl"
>导出批次明细</el-button>
>导出</el-button>
</el-col>
</el-row>
</div>
@ -855,7 +857,7 @@ export default {
return;
}
this.coData.etd = parseTime(this.coData.carTime, '{y}-{m}-{d} {h}:{i}:{s}');
// this.coData.etd = parseTime(this.coData.carTime, '{y}-{m}-{d} {h}:{i}:{s}');
// 新增
if(this.coPackType == "add")
@ -1297,53 +1299,230 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisTmsPack/export', {
// ...this.queryParams
// }, `emisTmsPack_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisTmsSiteBatch(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','组批次号','组批次名称','组批次时间','目的国家','目的国家名称','是否可拆','发出网点','下一网点','下一站','总件数','总运单数','总体积','总重量','组批次状态','扩展数据','操作员','ext1','ext2','ext3','ext4','备注','租户ID','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建网点','更新网点',];
const filterVal = ['id','packNo','packName','packDate','destCountry','destCountryName','blUnpack','sendSiteCode','nextSiteCode','nextStation','totalParcelQty','totalWaybillQty','totalVolume','totalWeight','packStatus','extData','opMan','ext1','ext2','ext3','ext4','remark','tenantId','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: 'TMS组批次',
autoWidth: true
})
loadingInstance.close()
})
}
});
/** 导出按钮操作 */
handleDownBatchDtl() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
let qExportParam={
pageNum:1,
pageSize:20000,
batchNo: this.coData.batchNo
};
listEmisTmsSiteBatchDtl(qExportParam).then(response => {
if (response.code === 200) {
this.exportData(response.rows,loadingInstance);
}
});
},
exportData(selData,loadingInstance){
const curList =selData
import('@/vendor/Export2Excel').then(excel => {
const exportParam=this.$refs.refTable.getExportParam();
const tHeader = exportParam.header;
const filterVal = exportParam.filter;
console.log("===>filterVal===>",filterVal);
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 => {
// console.log("===>1111===>",v);
if (j === 'index') {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
if (j === 'kjlx') {
return v['waybillDetail']['sendSiteName']+'--'+v['waybillDetail']['dispatchUnderlingSiteName'];
}
if (j === 'fjr') {
return v['sendName']+'--'+v['receiveName'];
}
if (j === 'receiveCountryName') {
return v['waybillDetail']['receiveCountryName'];
}
if (j === 'sendCountryName') {
return v['waybillDetail']['sendCountryName'];
}
if (j === 'estimateDate') {
return v['waybillDetail']['estimateDate'];
}
if (j === 'sendSiteName') {
return v['waybillDetail']['sendSiteName'];
}
if (j === 'sendName') {
return v['waybillDetail']['sendName'];
}
if (j === 'receiveName') {
return v['waybillDetail']['receiveName'];
}
if (j === 'sendDate') {
return v['waybillDetail']['sendDate'];
}
if (j === 'sendCompany') {
return v['waybillDetail']['sendCompany'];
}
if (j === 'receiveCompany') {
return v['waybillDetail']['receiveCompany'];
}
if (j === 'transLineTypeName') {
return v['waybillDetail']['transLineTypeName'];
}
if (j === 'productTypeName') {
return v['waybillDetail']['productTypeName'];
}
if (j === 'sendName') {
return v['waybillDetail']['sendName'];
}
if (j === 'parcelQty') {
return v['waybillDetail']['parcelQty'];
}
if (j === 'billWeight') {
return v['waybillDetail']['billWeight'];
}
if (j === 'volumeWeight') {
return v['waybillDetail']['volumeWeight'];
}
if (j === 'totalVolume') {
return v['waybillDetail']['totalVolume'];
}
if (j === 'settlementWeight') {
return v['waybillDetail']['settlementWeight'];
}
if (j === 'freight') {
return v['waybillDetail']['freight'];
}
if (j === 'realFee') {
return v['waybillDetail']['realFee'];
}
if (j === 'remark') {
return v['waybillDetail']['remark'];
}
if (j === 'feeRemark') {
return v['waybillDetail']['feeRemark'];
}
if (j === 'salesmen') {
return v['waybillDetail']['salesmen'];
}
if (j === 'payee') {
return v['waybillDetail']['payee'];
}
if (j === 'payee') {
return v['waybillDetail']['payee'];
}
if (j === 'problemTypeName') {
return v['waybillDetail']['problemTypeName'];
}
if (j === 'problemCause') {
return v['waybillDetail']['problemCause'];
}
if (j === 'sendMobile') {
return "";
}
if (j === 'calcFeeType') {
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
}
if (j === 'waybillDetail.paymentStatus') {
return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']);
}
if (j === 'pickupMethod') {
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['waybillDetail']['pickupMethod']);
}
if (j === 'customsEclaration') {
return this.selectDictLabel(this.dict.type.emis_declare_mode,v['waybillDetail']['customsEclaration']);
}
if (j === 'customsClear') {
return this.selectDictLabel(this.dict.type.emis_customs_clear,v['waybillDetail']['customsClear']);
}
if (j === 'packType') {
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
}
if (j === 'dispatchMethod') {
if(v['waybillDetail']['dispatchMethod'] == 1){
return '派送';
}else{
return '自提';
}
return statusStr;
}
if (j === 'blMessage') {
if(v['waybillDetail']['blMessage'] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blAcceptMessage') {
if(v['waybillDetail']['blAcceptMessage'] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blSign') {
if(v['waybillDetail']['blSign'] == 1){
return '已签收';
}else{
return '未签收';
}
}
if (j === 'paymentType') {
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']);
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1

View File

@ -150,6 +150,7 @@
<template slot-scope="scope">
<span v-if="scope.row.batchType==1">一程批次</span>
<span v-else-if="scope.row.batchType==2">二程批次</span>
<span v-else-if="scope.row.batchType==3">网点互寄</span>
</template>
</el-table-column>
<!-- <el-table-column :label="$t('报关资料状态')" align="center" prop="declareResStatus" min-width="170">
@ -218,7 +219,10 @@ import PackListView from '@/views/emis/emisTmsSiteBatch/packListView';
export default {
name: "CenterGenBatchMgnt",
components: { EmisGetNextSitePicker, CountryPicker, EmisSiteSimplePicker, elDateAdvPicker, emisTmsPackForm, TransLinePicker, TransProductPicker, PackListView},
dicts: ['emis_waybill_status', 'emis_payment_type', 'emis_biz_shipping_method', 'emis_qujian_fangshi', 'cebp_return_status'],
dicts: [
'emis_waybill_status', 'emis_payment_type', 'emis_biz_shipping_method', 'emis_qujian_fangshi', 'cebp_return_status','emis_declare_mode','emis_customs_clear',
],
data() {
return {
// 遮罩层
@ -566,9 +570,10 @@ export default {
pageSize:20000,
batchNo: item.batchNo
};
let batchName=item.batchNo;
listEmisTmsSiteBatchDtl(qExportParam).then(response => {
if (response.code === 200) {
this.exportDataDtl(response.rows,loadingInstance);
this.exportDataDtl(batchName,response.rows,loadingInstance);
}
});
@ -579,12 +584,36 @@ export default {
const curList =selData
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['运单号','寄件国家','目的国家','线路','产品类型','预计到达时间','总件数','实际重量','总体积','体积重量','结算重量','收件人','收件公司','取件方式','付款方式','运费','寄件人','寄件公司','录单备注','寄件网点','清关方式','报关方式'];
const filterVal = ['billCode','sendCountryName','receiveCountryName','transLineTypeName','productTypeName','estimateDate','parcelQty','billWeight','totalVolume','volumeWeight','settlementWeight','receiveName','receiveCompany','pickupMethod','paymentType','freight','sendName','sendCompany','remark','sendSiteName','customsClear','customsEclaration'];
const filterVal=[
"billCode",
"sendCountryName",
"receiveCountryName",
"transLineTypeName",
"productTypeName",
"estimateDate",
"parcelQty",
"billWeight",
"totalVolume",
"volumeWeight",
"settlementWeight",
"receiveName",
"receiveCompany",
"pickupMethod",
"paymentType",
"freight",
"sendName",
"sendCompany",
"remark",
"sendSiteName",
"customsEclaration",
"customsClear"
];
const data = this.formatJsonDtl(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: batchName+'-批次明细表',
filename: batchName+'批次明细表',
autoWidth: true
})
loadingInstance.close()
@ -594,74 +623,178 @@ export default {
let index = 0
return jsonData.map(v => filterVal.map(j => {
if (j === 'index') {
return ++index
}
if (j === 'kjlx') {
return v['sendSiteName']+'--'+v['dispatchUnderlingSiteName'];
return v['waybillDetail']['sendSiteName']+'--'+v['waybillDetail']['dispatchUnderlingSiteName'];
}
if (j === 'fjr') {
return v['sendName']+'--'+v['receiveName'];
}
if (j === 'custName') {
let paymentType=v['paymentType'];
if(paymentType==2 || paymentType==4 || paymentType==5 ){
return v['custName'];
}else{
return "";
}
if (j === 'receiveCountryName') {
return v['waybillDetail']['receiveCountryName'];
}
if (j === 'sendCountryName') {
return v['waybillDetail']['sendCountryName'];
}
if (j === 'estimateDate') {
return v['waybillDetail']['estimateDate'];
}
if (j === 'sendSiteName') {
return v['waybillDetail']['sendSiteName'];
}
if (j === 'sendName') {
return v['waybillDetail']['sendName'];
}
if (j === 'receiveName') {
return v['waybillDetail']['receiveName'];
}
if (j === 'sendDate') {
return v['waybillDetail']['sendDate'];
}
if (j === 'sendCompany') {
return v['waybillDetail']['sendCompany'];
}
if (j === 'receiveCompany') {
return v['waybillDetail']['receiveCompany'];
}
if (j === 'transLineTypeName') {
return v['waybillDetail']['transLineTypeName'];
}
if (j === 'productTypeName') {
return v['waybillDetail']['productTypeName'];
}
if (j === 'sendName') {
return v['waybillDetail']['sendName'];
}
if (j === 'parcelQty') {
return v['waybillDetail']['parcelQty'];
}
if (j === 'billWeight') {
return v['waybillDetail']['billWeight'];
}
if (j === 'volumeWeight') {
return v['waybillDetail']['volumeWeight'];
}
if (j === 'totalVolume') {
return v['waybillDetail']['totalVolume'];
}
if (j === 'settlementWeight') {
return v['waybillDetail']['settlementWeight'];
}
if (j === 'freight') {
return v['waybillDetail']['freight'];
}
if (j === 'realFee') {
return v['waybillDetail']['realFee'];
}
if (j === 'remark') {
return v['waybillDetail']['remark'];
}
if (j === 'feeRemark') {
return v['waybillDetail']['feeRemark'];
}
if (j === 'salesmen') {
return v['waybillDetail']['salesmen'];
}
if (j === 'payee') {
return v['waybillDetail']['payee'];
}
if (j === 'payee') {
return v['waybillDetail']['payee'];
}
if (j === 'problemTypeName') {
return v['waybillDetail']['problemTypeName'];
}
if (j === 'problemCause') {
return v['waybillDetail']['problemCause'];
}
if (j === 'sendMobile') {
return "";
}
if (j === 'paymentStatus') {
return this.selectDictLabel(this.dict.type.emis_payment_status,v[j]);
if (j === 'calcFeeType') {
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
}
if (j === 'waybillDetail.paymentStatus') {
return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']);
}
if (j === 'pickupMethod') {
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v[j]);
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['waybillDetail']['pickupMethod']);
}
if (j === 'customsEclaration') {
return this.selectDictLabel(this.dict.type.emis_declare_mode,v[j]);
return this.selectDictLabel(this.dict.type.emis_declare_mode,v['waybillDetail']['customsEclaration']);
}
if (j === 'customsClear') {
return this.selectDictLabel(this.dict.type.emis_customs_clear,v[j]);
return this.selectDictLabel(this.dict.type.emis_customs_clear,v['waybillDetail']['customsClear']);
}
if (j === 'packType') {
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v[j]);
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
}
if (j === 'dispatchMethod') {
if(v[j] == 1){
if(v['waybillDetail']['dispatchMethod'] == 1){
return '派送';
}else{
return '自提';
}
}
if (j === 'blMessage') {
if(v[j] == 1){
if(v['waybillDetail']['blMessage'] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blAcceptMessage') {
if(v[j] == 1){
if(v['waybillDetail']['blAcceptMessage'] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blSign') {
if(v[j] == 1){
if(v['waybillDetail']['blSign'] == 1){
return '已签收';
}else{
return '未签收';
}
}
if (j === 'paymentType') {
return this.selectDictLabel(this.dict.type.emis_payment_type,v[j]);
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']);
}
return v[j]
}))