emis-frontend/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue

1436 lines
52 KiB
Vue
Raw Normal View History

2024-11-15 06:56:01 +00:00
<template>
<div style="margin-bottom: 20px;">
2025-02-14 07:57:04 +00:00
<el-form ref="form" size="mini" :model="form" :rules="rules" :disabled="disabled" label-width="80px" class="overflowhidden" >
2024-11-16 00:39:39 +00:00
<el-row :gutter="20" style="display: flex;flex-wrap: wrap;">
2025-08-07 09:45:56 +00:00
<el-col :span="19" style="border-right: 1px solid #e4e1e1;">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
2025-02-14 07:57:04 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="6">
<el-form-item :label="$t('批次号')" prop="batchNo">
2025-02-14 07:57:04 +00:00
<el-input v-model="form.batchNo" placeholder="自动生成" disabled />
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item :label="$t('批次名称')" prop="batchName" label-width="110px">
<span slot="label">
<el-tooltip placement="top">
<div slot="content" class="tips-content text-tips-content">
<span>批次名称规则:</span><br>
<div class="rule-box">
1)快递(E):<br>
快递(E)-南京分拨中心(NJ)-供应商-昆明(KM)-250113-提单号<br>
ENJDHKM250113+提单号<br>
2)空运(A):<br>
空运(A)-南京分拨中心(NJ)-供应商-昆明(KM)-250113-提单号<br>
ANJNHKM250113+提单号<br>
3)陆运(L):<br>
陆运(L)-南京分拨中心(NJ)-供应商-昆明(KM)-250113-车牌<br>
LNJJTKM250113+车牌<br>
4)海运(S):<br>
海运(S)-上海-供应商-西港-250113-提单号<br>
SSHXG250113+提单号<br>
5)铁路(R):<br>
铁路(R)-上海-供应商-南宁-250113-集装箱号<br>
RSHNN250113+集装箱号<br>
6)国内进仓(D):<br>
2025-02-14 07:57:04 +00:00
同行(D)-上海-供应商-南京分拨中心-250113-运单号/订单号 (顺丰、跨越、百世、安能、中通、申通、货拉拉、运满满等)<br>
2025-08-07 09:45:56 +00:00
DSHNN250113+运单号/订单号<br>
2025-02-14 07:57:04 +00:00
</div>
2025-08-07 09:45:56 +00:00
</div>
<i class="el-icon-question" />
</el-tooltip>
2025-02-14 07:57:04 +00:00
<span >批次名称:</span>
2025-08-07 09:45:56 +00:00
</span>
2025-02-17 14:48:08 +00:00
<el-input v-model="form.batchName" clearable="" placeholder="" disabled ></el-input>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="8">
2024-11-16 00:39:39 +00:00
<el-form-item :label="$t('批次类型')" prop="batchType">
2025-02-19 04:08:51 +00:00
<el-select v-model="form.batchType" placeholder="批次类型" clearable filterable style="width:100%" >
<el-option
v-for="dict in dict.type.emis_big_batch_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
2025-08-07 09:45:56 +00:00
</el-select>
</el-form-item>
</el-col>
2024-11-19 11:39:21 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="8">
<el-form-item :label="$t('起始网点')" prop="startSiteCode">
2025-02-14 07:57:04 +00:00
<EmisSiteSimplePicker :placeholder="$t('请选择')" @onChange="onSiteSelect" v-model="form.startSiteCode" ></EmisSiteSimplePicker>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('下一网点')" prop="nextSiteCode">
2025-06-25 02:42:24 +00:00
<EmisTmsSiteBatchNextSitePicker :placeholder="$t('请选择')" :startSiteCode="form.startSiteCode" @onChange="onNextSiteSelect" v-model="form.nextSiteCode" ></EmisTmsSiteBatchNextSitePicker>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('目的国')" prop="destCountry">
2025-02-14 07:57:04 +00:00
<CountryPicker :placeholder="$t('选择国')" v-model="form.destCountry" ></CountryPicker>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
2025-02-14 07:57:04 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="8">
<el-form-item label="运输方式" prop="transType">
2025-02-14 07:57:04 +00:00
<el-select v-model="form.transType" placeholder="运输方式" clearable filterable style="width:100%" @change="calcBatchName" >
2024-11-16 00:39:39 +00:00
<el-option
2024-11-19 07:40:01 +00:00
v-for="dict in dict.type.emis_biz_shipping_method"
2024-11-16 00:39:39 +00:00
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
2025-08-07 09:45:56 +00:00
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('供应商')" prop="supplierCode">
2025-06-24 21:12:11 +00:00
<EmisTmsSiteBatchSupplierPicker :placeholder="$t('请选择')" :startSiteCode="form.startSiteCode" :nextSiteCode="form.nextSiteCode" @onChange="onSupplierSelect" v-model="form.supplierCode" ></EmisTmsSiteBatchSupplierPicker>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="8" >
2025-08-07 09:45:56 +00:00
<el-form-item :label="$t('运输号')" prop="carNo">
2025-12-01 07:12:37 +00:00
<el-input v-model="form.carNo" clearable="" placeholder="同行单号/订单号/车牌号/船次号/提单号" @change="calcBatchName"></el-input>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
2025-02-14 07:57:04 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="8">
<el-form-item :label="$t('包裹数')" prop="packNum">
2025-07-03 09:05:41 +00:00
<el-input v-model="form.packNum" clearable="" placeholder="" ></el-input>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('承运重量')" prop="transWeight">
2025-02-14 07:57:04 +00:00
<el-input v-model="form.transWeight" clearable="" placeholder="" >
2025-08-07 09:45:56 +00:00
<span slot="suffix">(kg)</span>
</el-input>
</el-form-item>
</el-col>
2024-11-19 11:39:21 +00:00
<el-col :span="8" >
2025-02-14 07:57:04 +00:00
<el-form-item label="发出时间" prop="etd" >
2024-11-16 00:39:39 +00:00
<el-date-picker clearable
2025-02-14 07:57:04 +00:00
v-model="form.etd"
2024-11-16 00:39:39 +00:00
type="date"
value-format="yyyy-MM-dd"
2024-11-19 11:39:21 +00:00
placeholder="请选择发出时间"
style="width:100%"
2025-02-14 07:57:04 +00:00
@change="calcBatchName"
2024-11-19 11:39:21 +00:00
>
2025-08-07 09:45:56 +00:00
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('备注')" prop="remark">
2025-02-14 07:57:04 +00:00
<el-input v-model="form.remark" clearable="" type="textarea" placeholder="" ></el-input>
2025-08-07 09:45:56 +00:00
</el-form-item>
</el-col>
2025-02-14 07:57:04 +00:00
2025-08-07 09:45:56 +00:00
</el-row>
</el-col>
2024-11-16 00:39:39 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="5">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item style="font-weight:600;" label-width="0px">
<span>{{$t('总票数') + ': ' + (form.totalWaybillQty || 0)}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="font-weight:600;" label-width="0px">
<span>{{$t('总重量') + ': ' + (form.totalWeight || 0)}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="font-weight:600;" label-width="0px">
<span>{{$t('总件数') + ': ' + (form.totalParcelQty || 0)}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="font-weight:600;" label-width="0px">
<span>{{$t('总体积') + ': ' + (form.totalVolume || 0)}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item style="font-weight:600;" label-width="0px">
<span>{{$t('总结算重量') + ': ' + (form.totalSettlementWeight || 0)}}</span>
</el-form-item>
</el-col>
</el-row>
</el-col>
2024-11-16 00:39:39 +00:00
2025-08-07 09:45:56 +00:00
<el-col :span="24" style="" v-if="['3','4','5'].indexOf(form.transType) > -1">
<div style="margin-top:20px;padding: 3px 5px;font-size: 14px;">
装柜示意图
</div>
2024-11-16 00:39:39 +00:00
<el-table :data="tableData"
border
style="width:100%;border:2px solid #e2e2e2"
>
2025-08-07 09:45:56 +00:00
<!-- 表头1 -->
<el-table-column label="柜头" colspan="2">
<template slot-scope="scope">
<el-row>
<el-col :span="12">
<el-input v-model="scope.row[1]"></el-input>
</el-col>
<el-col :span="12">
<el-input v-model="scope.row[2]"></el-input>
</el-col>
</el-row>
</template>
</el-table-column>
<!-- 表头2 -->
<el-table-column label="柜中" colspan="2">
<template slot-scope="scope">
<el-row>
<el-col :span="12">
<el-input v-model="scope.row[3]"></el-input>
</el-col>
<el-col :span="12">
<el-input v-model="scope.row[4]"></el-input>
</el-col>
</el-row>
</template>
</el-table-column>
<!-- 表头3 -->
<el-table-column label="柜尾" colspan="2">
<template slot-scope="scope">
<el-row>
<el-col :span="12">
<el-input v-model="scope.row[5]"></el-input>
</el-col>
<el-col :span="12">
<el-input v-model="scope.row[6]"></el-input>
</el-col>
</el-row>
</template>
2024-11-15 06:56:01 +00:00
</el-table-column>
2025-08-07 09:45:56 +00:00
</el-table>
</el-col>
</el-row>
</el-form>
2024-11-15 06:56:01 +00:00
2025-08-07 09:45:56 +00:00
<div style="margin-top:20px;padding: 3px 5px;font-size: 14px;">
装柜运单列表
</div>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="!disabled">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddWayBill">加入运单</el-button>
</el-col>
<el-col :span="1.5" v-if="!disabled">
<el-button type="primary" plain size="mini" @click="handleCoPackListDelete"
:disabled="multiple">移除运单</el-button>
</el-col>
<el-col :span="1.5" v-if="this.form.id!=null">
<el-button style="margin-right: 5px;" type="warning" plain icon="el-icon-download" size="mini"
2025-08-12 11:06:34 +00:00
@click="handleExport">导出</el-button>
2025-08-07 09:45:56 +00:00
</el-col>
</el-row>
</div>
<el-table class="cargoList" max-height="400px" v-loading="loading" border size="mini"
storageName="waitBatchDtlList_main_240709" ref="refTable" :data="waitBatchDtlList" :queryParams="queryParams"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="170" />
2024-11-16 05:49:23 +00:00
<el-table-column :label="$t('寄件网点')" align="center" prop="sendSiteName" min-width="80" :show-overflow-tooltip="true"/>
2025-08-07 09:45:56 +00:00
<el-table-column :label="$t('寄件国家')" align="center" prop="sendCountryName" min-width="100">
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.sendCountryName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('目的国家')" align="center" prop="receiveCountryName" min-width="100">
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.receiveCountryName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('线路')" align="center" prop="transLineTypeName" min-width="100" />
<el-table-column :label="$t('产品类型')" align="center" prop="productTypeName" min-width="100" />
2025-07-07 08:17:27 +00:00
<el-table-column :label="$t('寄件日期')" align="center" prop="sendDate" min-width="170" :show-overflow-tooltip="true"/>
2025-08-07 09:45:56 +00:00
<el-table-column :label="$t('预计到达时间')" align="center" prop="estimateDate" min-width="170">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.estimateDate || '') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('总件数')" align="center" prop="parcelQty" min-width="140">
<template slot-scope="scope">
<!--新增、编辑且batchId为空时,显示输入框 -->
<el-input-number v-if="(name === 'batchEdit' && scope.row.batchParcelQty==null)" v-model="scope.row.parcelQty" size="mini"
:controls="false" :max="scope.row.originalParcelQty" @blur="computeTotal"></el-input-number>
<!--新增、编辑且batchId不为空时,显示输入框 -->
<el-input-number v-if="name==='batchEdit' && scope.row.batchParcelQty!=null" v-model="scope.row.batchParcelQty" size="mini"
:controls="false" :max="scope.row.originalParcelQty" @blur="computeTotal"></el-input-number>
<!-- 查看 -->
<span v-if="name == 'batchView'">{{ scope.row.batchParcelQty
? scope.row.batchParcelQty : scope.row.parcelQty }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('实际重量')" align="center" prop="billWeight" min-width="100">
<template slot-scope="scope">
<el-input-number v-if="(name === 'batchEdit' && scope.row.batchWeight==null)" v-model="scope.row.billWeight" size="mini"
:controls="false" :max="scope.row.originalBillWeight" @blur="computeTotal"></el-input-number>
<el-input-number v-if="name==='batchEdit' && scope.row.batchWeight!=null" v-model="scope.row.batchWeight" size="mini"
:controls="false" :max="scope.row.originalBillWeight" @blur="computeTotal"></el-input-number>
<span v-if="name == 'batchView'">{{ scope.row.batchWeight ? scope.row.batchWeight : scope.row.billWeight }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('总体积')" align="center" prop="totalVolume" min-width="100">
<template slot-scope="scope">
<el-input-number v-if="(name === 'batchEdit' && scope.row.batchVolume==null)" v-model="scope.row.totalVolume" size="mini"
:controls="false" :disabled="scope.row.originalTotalVolume===''" :max="scope.row.originalTotalVolume" @blur="computeTotal"></el-input-number>
<el-input-number v-if="name==='batchEdit' && scope.row.batchVolume!=null" v-model="scope.row.batchVolume" size="mini"
:controls="false" :disabled="scope.row.originalTotalVolume===0" :max="scope.row.originalTotalVolume" @blur="computeTotal"></el-input-number>
<!-- 查看 -->
<span v-if="name == 'batchView'">{{ scope.row.batchVolume
? scope.row.batchVolume : scope.row.totalVolume }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('体积重量')" align="center" prop="volumeWeight" min-width="100" />
<el-table-column :label="$t('结算重量')" align="center" prop="settlementWeight" min-width="100" />
<el-table-column :label="$t('收件人')" align="center" prop="receiveName" min-width="150" />
<el-table-column :label="$t('收件公司')" align="center" prop="receiveCompany" min-width="100">
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.receiveCompany }}</span>
</template>
</el-table-column>
2024-12-13 09:38:35 +00:00
<el-table-column :label="$t('报关方式')" align="center" prop="customsEclaration" min-width="80" >
2025-08-07 09:45:56 +00:00
<template slot-scope="scope">
2024-12-13 09:38:35 +00:00
<dict-tag :options="dict.type.emis_declare_mode" :value="scope.row.customsEclaration"/>
2025-08-07 09:45:56 +00:00
</template>
</el-table-column>
2024-12-13 09:38:35 +00:00
<el-table-column :label="$t('清关方式')" align="center" prop="customsClear" min-width="80" >
2025-08-07 09:45:56 +00:00
<template slot-scope="scope">
2024-12-13 09:38:35 +00:00
<dict-tag :options="dict.type.emis_customs_clear" :value="scope.row.customsClear"/>
2025-08-07 09:45:56 +00:00
</template>
</el-table-column>
<!-- <el-table-column :label="$t('取件员')" align="center" prop="takePieceEmployeeName" min-width="80" /> -->
<el-table-column :label="$t('取件方式')" align="center" prop="pickupMethod" min-width="80">
<template slot-scope="scope">
2024-11-15 06:56:01 +00:00
<dict-tag :options="dict.type.emis_qujian_fangshi" :value="scope.row.pickupMethod"/>
2025-08-07 09:45:56 +00:00
</template>
</el-table-column>
<el-table-column :label="$t('付款方式')" align="center" prop="paymentType" min-width="80">
<template slot-scope="scope">
2024-11-15 06:56:01 +00:00
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.paymentType"/>
2025-08-07 09:45:56 +00:00
</template>
</el-table-column>
<el-table-column :label="$t('运费')" align="center" prop="freight" min-width="80" />
2024-11-16 00:39:39 +00:00
<el-table-column :label="$t('寄件人')" align="center" prop="sendName" min-width="150" :show-overflow-tooltip="true" />
2025-07-01 07:00:41 +00:00
<el-table-column :label="$t('寄件公司')" align="center" prop="sendeCompany" min-width="100" :show-overflow-tooltip="true" >
2025-08-07 09:45:56 +00:00
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.sendCompany }}</span>
</template>
</el-table-column>
2024-11-16 00:39:39 +00:00
<el-table-column :label="$t('录单备注')" align="center" prop="remark" min-width="100" :show-overflow-tooltip="true" >
2025-08-07 09:45:56 +00:00
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.remark }}</span>
</template>
</el-table-column>
</el-table>
2024-11-16 00:39:39 +00:00
<div style="text-align: center;margin-bottom: 10px;" v-if="!disabled">
2025-08-07 09:45:56 +00:00
<el-button type="primary" :loading="isDoing" @click="submitSaveBatchForm">保存批次</el-button>
<el-button @click="handleCancelCo">取 消</el-button>
2024-11-16 00:39:39 +00:00
</div>
2024-11-22 23:52:01 +00:00
<el-dialog :title="titleBatch" :visible.sync="openBatch" width="50%" v-dialogDrag :close-on-click-modal="false" append-to-body>
<el-form ref="formBatch" size="mini" label-width="60px">
2025-08-07 09:45:56 +00:00
<el-row>
2024-11-22 23:52:01 +00:00
<el-col :span="24">
2025-07-01 07:00:41 +00:00
<el-form-item :label="$t('运单号')" prop="inputBatchBillCode">
<el-input v-model="inputBatchBillCode" type="textarea" :rows="8" placeholder="运单号" />
2024-11-22 23:52:01 +00:00
</el-form-item>
</el-col>
2025-08-07 09:45:56 +00:00
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align:center">
2025-06-25 06:05:44 +00:00
<el-button type="primary" @click="addBillToBatch">确定</el-button>
2025-08-07 09:45:56 +00:00
<el-button @click="cancelAddBillToBatch">取 消</el-button>
</div>
2024-11-22 23:52:01 +00:00
</el-dialog>
2024-11-15 06:56:01 +00:00
</div>
</template>
<script>
2025-07-01 07:00:41 +00:00
import {
getTmsGroupBatchNo, getEmisTmsSiteBatch,
scanSiteBatch, addAllEmisTmsSiteBatch,editAllEmisTmsSiteBatch,scanSiteBatchV2
2025-06-17 00:55:39 +00:00
} from "@/api/emis/emisTmsSiteBatch";
2025-07-01 07:00:41 +00:00
import { listEmisTmsSiteBatchDtl } from "@/api/emis/emisTmsSiteBatchDtl";
import { listEmisTmsSiteBatchLoading } from "@/api/emis/emisTmsSiteBatchLoading";
2025-08-07 09:45:56 +00:00
import { getEmisWaybillByBillCode, getBatchDtl} from "@/api/emis/emisWaybill";
2025-02-18 07:09:56 +00:00
2024-11-15 06:56:01 +00:00
import emisTmsPackForm from '@/views/emis/emisTmsPack/emisTmsPackForm';
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
import CountryPicker from '@/views/emis/EmisBaseTools/CountryPicker.vue';
import EmisSiteSimplePicker from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker2.vue';
2024-11-15 06:56:01 +00:00
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
import { parseTime, dateToStr } from "@/utils/custom";
import { formatSearchStr } from '@/utils/index'
2025-02-14 07:57:04 +00:00
import moment from 'moment'
2024-11-15 06:56:01 +00:00
import PackListView from '@/views/emis/emisTmsSiteBatch/packListView';
2025-02-14 07:57:04 +00:00
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
2025-06-24 21:12:11 +00:00
import EmisTmsSiteBatchSupplierPicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchSupplierPicker';
2025-06-25 02:42:24 +00:00
import EmisTmsSiteBatchNextSitePicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchNextSitePicker.vue';
2024-11-15 06:56:01 +00:00
export default {
2024-11-16 00:39:39 +00:00
name: "BigBatchEditForm",
2024-11-15 06:56:01 +00:00
props: {
batchId: {
type:[Number,Array],
required: false
2024-11-16 00:39:39 +00:00
},
2025-02-20 19:59:27 +00:00
isCopy:{
type:Boolean
},
2024-11-16 00:39:39 +00:00
disabled: {
type:[Boolean],
required: false
},
2025-08-07 09:45:56 +00:00
name:{
type:String,
default:''
}
2024-11-15 06:56:01 +00:00
},
2025-06-25 02:42:24 +00:00
components: { EmisGetNextSitePicker, CountryPicker, EmisSiteSimplePicker, elDateAdvPicker, emisTmsPackForm, TransLinePicker, TransProductPicker, PackListView,EmisSupplierPicker,EmisTmsSiteBatchSupplierPicker,EmisTmsSiteBatchNextSitePicker},
2025-02-19 04:08:51 +00:00
dicts: ['emis_waybill_status', 'emis_payment_type', 'emis_biz_shipping_method', 'emis_qujian_fangshi', 'cebp_return_status','emis_declare_mode','emis_customs_clear','emis_big_batch_type'],
2024-11-15 06:56:01 +00:00
data() {
2025-12-31 01:20:29 +00:00
//自定义校验方法 校验运输号
var checkCarNo = (rule, value, callback) => {
if (value.trim() !== value) {
callback(new Error('运输号前后不能有空格'));// 关联主单和运单线路不一致
} else {
callback();
}
}
2024-11-15 06:56:01 +00:00
return {
// 遮罩层
loading: false,
2025-02-19 02:16:19 +00:00
isDoing:false,
2024-11-15 06:56:01 +00:00
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
addWayBillDisabled: true,
// packDisabled: true,
activeName:'third',
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// TMS组批次表格数据
emisTmsPackList: [],
// 待组批次列表
emisTmsWaitPackList:[],
waitTotal:0,
// 已组批次列表
emisTmsDonePackList:[],
doneTotal:0,
waitPackList:[],//选择未组包的运单先保存起来,在后续新增组批次的弹框中使用
// 新增/修改弹窗数据
2025-02-14 07:57:04 +00:00
form: {},
2024-11-16 00:39:39 +00:00
2025-02-14 07:57:04 +00:00
rules: {
2024-11-16 00:39:39 +00:00
batchType: [
{ required: true, message: "批次类型不能为空", trigger: ["blur","change"] },
],
batchName: [
{ required: true, message: "批次名称不能为空", trigger: ["blur","change"] },
],
2025-02-17 14:48:08 +00:00
supplierCode: [
{ required: true, message: "供应商不能为空", trigger: ["blur","change"] },
],
2024-11-19 11:39:21 +00:00
// destCountry: [
// { required: true, message: "目的国不能为空", trigger: ["blur","change"] },
// ],
2024-11-16 00:39:39 +00:00
startSiteCode: [
{ required: true, message: "起始网点不能为空", trigger: ["blur","change"] },
],
nextSiteCode: [
{ required: true, message: "下一网点不能为空", trigger: ["blur","change"] },
],
transType: [
{ required: true, message: "运输方式不能为空", trigger: ["blur","change"] },
],
airBilllNo: [
{ required: true, message: "航空单号不能为空", trigger: ["blur","change"] },
],
2025-02-17 07:35:10 +00:00
etd: [
{ required: true, message: "发出日期不能为空", trigger: ["blur","change"] },
2024-11-16 00:39:39 +00:00
],
2025-02-17 07:35:10 +00:00
// shipNo: [
// { required: true, message: "船次号不能为空", trigger: ["blur","change"] },
// ],
// shipTime: [
// { required: true, message: "开船时间不能为空", trigger: ["blur","change"] },
// ],
2024-11-16 00:39:39 +00:00
carNo: [
{ required: true, message: "车牌号不能为空", trigger: ["blur","change"] },
2025-12-31 01:20:29 +00:00
//运输号首位不能有空格
{ validator: checkCarNo, trigger: ["blur","change"] },
2024-11-16 00:39:39 +00:00
],
carTime: [
{ required: true, message: "发车时间不能为空", trigger: ["blur","change"] },
],
2024-11-19 08:21:51 +00:00
transWeight: [
{ required: true, message: "承运重量不能为空", trigger: ["blur","change"] },
],
packNum: [
{ required: true, message: "包裹数量不能为空", trigger: ["blur","change"] },
],
2024-11-16 00:39:39 +00:00
2024-11-15 06:56:01 +00:00
},
openBatch: false,
titleBatch: "",
2025-07-01 07:00:41 +00:00
inputBatchBillCode:"",
waitBatchDtlList:[],
2024-11-15 06:56:01 +00:00
blUnpack:"1",
// 追加的运单数据
emisWayBillList:[],
wayBillotal:0,
currentId:null,
openForm: false,
titleForm: "",
titleWayBill:null,
openWayBillForm:false,
2025-07-01 07:00:41 +00:00
// 临时存储
2024-11-15 06:56:01 +00:00
tempCoPackInfo:{},
// 弹出展示层
id:null,
titleView:"",
openView: false,
2025-07-01 07:00:41 +00:00
2024-11-15 06:56:01 +00:00
tableData:[
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' }
],
tableDataId:[
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' }
],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
billCode:null,
orderSN:null,
batchNo:null,
// packNo: null,
// packName: null,
// packDate: null,
destCountry: null,
destCountryName: null,
// blUnpack: null,
// sendSiteCode: null,
// totalParcelQty: null,
// totalWaybillQty: null,
// totalVolume: null,
// totalWeight: null,
// packStatus: null,
// opMan: null,
// remark: null,
// delFlag: null,
params:{
queryOrderType: '0',
queryOrderDateType: '1'
},
},
queryCoParams: {
params:{}
},
// 查询参数
queryWaitParams: {
pageNum: 1,
pageSize: 20,
packNo: null,
beginCreateTime: null,
endCreateTime: null,
params:{}
},
// 查询参数
queryDoneParams: {
pageNum: 1,
pageSize: 20,
packNo: null,
params:{}
},
};
},
created() {
this.initData();
},
methods: {
2025-02-14 07:57:04 +00:00
// 批次名称计算
calcBatchName(){
/*
1、批次名称规则:
1)快递(E):
快递(E)-南京分拨中心(NJ)-东航(DH)-昆明(KM)-250113-提单号
ENJDHKM250113+提单号
2)空运(A):
空运(A)-南京分拨中心(NJ)-南航(NH)-昆明(KM)-250113-提单号
ANJNHKM250113+提单号
3)陆运(L):
陆运(L)-南京分拨中心(NJ)-九通(JT)-昆明(KM)-250113-车牌
LNJJTKM250113+车牌
4)海运(S):
海运(S)-上海-西港-250113-提单号
SSHXG250113+提单号
5)铁路(R):
铁路(R)-上海-南宁-250113-集装箱号
RSHNN250113+集装箱号
6)国内进仓(D):
上海-顺丰-南京分拨中心-250113-运单号/订单号 (顺丰、跨越、百世、安能、中通、申通、货拉拉、运满满等)
DSHNN250113+运单号/订单号
*/
if(this.form.transType==1){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 快递(E)-南京分拨中心(NJ)-东航(DH)-昆明(KM)-250113-提单号
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "E"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
else if(this.form.transType==2){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 空运(A)-南京分拨中心(NJ)-南航(NH)-昆明(KM)-250113-提单号
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "A"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
else if(this.form.transType==3){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 陆运(L)-南京分拨中心(NJ)-九通(JT)-昆明(KM)-250113-车牌
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "L"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
else if(this.form.transType==4){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 海运(S)-上海-供应商-西港-250113-提单号
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "S"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
else if(this.form.transType==5){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 铁路(R)-上海-南宁-250113-集装箱号
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "R"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
else if(this.form.transType==6){
if(this.form.etd&&this.form.transType&&this.form.supplierNameEn&&this.form.startSiteSizeCode3&&this.form.nextSiteSizeCode3&&this.form.carNo){
// 国内进仓(D)-上海-供应商-南宁-250113-集装箱号
let yymmdd = moment(this.form.etd).format('YYMMDD');
2025-02-14 08:06:31 +00:00
this.form.batchName = "D"+this.form.startSiteSizeCode3+""+this.form.supplierNameEn+""+this.form.nextSiteSizeCode3+yymmdd+this.form.carNo;
2025-02-14 07:57:04 +00:00
}
}
},
2025-05-13 09:50:31 +00:00
2025-07-01 07:00:41 +00:00
initData() {
2024-11-15 06:56:01 +00:00
if(this.batchId !=null) {
2025-07-01 07:00:41 +00:00
this.loading = true;
getEmisTmsSiteBatch(this.batchId).then(response => {
this.form = response.data;
// 获取装载信息
this.initLoadingInfo(this.form.batchNo);
// 获取关联运单信息
this.initBatchBillRel(this.form.batchNo);
2025-07-02 07:06:03 +00:00
if(this.isCopy){
2025-08-12 09:56:36 +00:00
this.form.batchNo = null;
2025-07-02 07:06:03 +00:00
getTmsGroupBatchNo().then(resPack=>{
this.form.batchNo = resPack.data;
});
}
2025-07-01 07:00:41 +00:00
this.loading = false;
});
2024-11-15 06:56:01 +00:00
}else{
this.reset();
2025-07-01 07:00:41 +00:00
2025-02-18 07:09:56 +00:00
this.form.startSiteCode=this.$store.getters.ownerSiteCode;
2025-02-14 07:57:04 +00:00
this.form.batchType='1';
2025-07-01 07:00:41 +00:00
this.form.batchNo = null;
getTmsGroupBatchNo().then(resPack=>{
this.form.batchNo = resPack.data;
});
2025-02-14 07:57:04 +00:00
this.form.batchDate=parseTime(new Date());
2024-11-15 06:56:01 +00:00
}
},
2025-07-01 07:00:41 +00:00
initLoadingInfo(batchNo){
listEmisTmsSiteBatchLoading({batchNo: batchNo}).then(response => {
this.tempCoPackInfo.tableData = [
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' }
];
this.tempCoPackInfo.tableDataId=[
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' },
{ 1: '', 2: '', 3: '', 4: '', 5: '', 6: '' }
];
let rows=response.rows;
for(let i = 0; i < rows.length;i++){
let rowItem=rows[i];
this.tempCoPackInfo.tableDataId[rowItem.row][rowItem.col] = rowItem.id;
this.tempCoPackInfo.tableData[rowItem.row][rowItem.col] = rowItem.posDesc;
this.tableData[rowItem.row][rowItem.col] = rowItem.posDesc;
}
});
},
initBatchBillRel(batchNo){
2025-10-23 05:02:57 +00:00
if(!batchNo){
return;
}
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList=[];
listEmisTmsSiteBatchDtl({batchNo: batchNo}).then(response => {
let rows=response.rows;
let cvtBillList=rows.map(item=>{
2025-08-07 09:45:56 +00:00
let batchVolume = item.batchVolume;
let batchParcelQty = item.batchParcelQty;
let batchWeight = item.batchWeight;
return { ... item.waybillDetail,batchVolume,batchParcelQty,batchWeight,batchId:item.id};
// return item.waybillDetail
2025-07-01 07:00:41 +00:00
});
this.waitBatchDtlList=cvtBillList;
2025-08-07 09:45:56 +00:00
this.computeTotal();
2025-07-01 07:00:41 +00:00
});
},
2024-11-16 00:39:39 +00:00
// 表单重置
reset() {
2025-02-14 07:57:04 +00:00
this.form = {
2024-11-16 00:39:39 +00:00
id: null,
batchNo: null,
batchName: null,
batchDate: null,
2025-02-14 07:57:04 +00:00
supplierCode: null,
supplierName: null,
supplierNameEn: null,
2024-11-19 08:21:51 +00:00
transLineType: null,
productType: null,
2024-11-16 00:39:39 +00:00
batchType: null,
transType: null,
startSiteCode: null,
2025-02-14 07:57:04 +00:00
startSiteSizeCode3:null,
2024-11-19 08:21:51 +00:00
sendCountry: null,
2024-11-16 00:39:39 +00:00
nextSiteCode: null,
2025-02-14 07:57:04 +00:00
nextSiteSizeCode3:null,
2024-11-16 00:39:39 +00:00
airBilllNo: null,
etd: null,
eta: null,
carNo: null,
shipNo: null,
clearanceResStatus: null,
declareResStatus: null,
destCountry: null,
destCountryName: null,
2024-11-19 08:21:51 +00:00
transWeight: null,
packNum: null,
2024-11-16 00:39:39 +00:00
totalParcelQty: null,
totalWaybillQty: null,
totalVolume: null,
totalWeight: null,
opMan: null,
remark: null,
tenantId: null,
2025-07-01 07:00:41 +00:00
loadingList:[],
batchDtlList:[],
2024-11-16 00:39:39 +00:00
};
2025-02-14 07:57:04 +00:00
this.resetForm("form");
2024-11-16 00:39:39 +00:00
},
2024-11-15 06:56:01 +00:00
2025-02-14 07:57:04 +00:00
onSupplierSelect(item){
console.log("==onSupplierSelect===>",item);
2025-02-14 08:40:07 +00:00
if(!item){
this.form.supplierCode=null;
this.form.supplierName=null;
this.form.supplierNameEn=null;
return;
}
2025-02-14 07:57:04 +00:00
this.form.supplierCode=item.code;
this.form.supplierName=item.name;
this.form.supplierNameEn=item.nameEn;
// 计算批次名称
this.calcBatchName();
},
2024-11-15 06:56:01 +00:00
onSiteSelect(item){
2025-02-14 07:57:04 +00:00
console.log("==onSiteSelect===>",item);
2024-11-15 06:56:01 +00:00
if(!item){
2025-02-18 07:09:56 +00:00
// this.form.startSiteCode = null;
2025-02-14 07:57:04 +00:00
this.form.startSiteName = null;
this.form.startSiteSizeCode3 = null;
2024-11-15 06:56:01 +00:00
return;
}
2025-02-18 07:09:56 +00:00
// this.form.startSiteCode=item && item.siteCode;
2025-02-14 07:57:04 +00:00
this.form.startSiteName=item && item.siteName;
this.form.startSiteSizeCode3 = item && item.sizeCode3;
// 计算批次名称
this.calcBatchName();
2024-11-15 06:56:01 +00:00
},
onNextSiteSelect(item){
if(!item){
2025-02-18 07:09:56 +00:00
// this.form.nextSiteCode = null;
2025-02-14 07:57:04 +00:00
this.form.nextSiteName = null;
this.form.nextSiteSizeCode3 = null;
2024-11-15 06:56:01 +00:00
return;
}
2025-02-18 07:09:56 +00:00
// this.form.nextSiteCode=item && item.siteCode;
2025-02-14 07:57:04 +00:00
this.form.nextSiteName=item && item.siteName;
this.form.nextSiteSizeCode3 = item && item.sizeCode3;
// 计算批次名称
this.calcBatchName();
2024-11-15 06:56:01 +00:00
},
2024-11-22 23:52:01 +00:00
2025-07-01 07:00:41 +00:00
submitSaveBatchForm() {
if(this.waitBatchDtlList.length == 0){
this.$modal.msgError("请加入批次运单列表")
2024-11-15 06:56:01 +00:00
return;
}
2025-07-01 07:00:41 +00:00
this.$refs["form"].validate(async valid => {
if (valid) {
if(this.isCopy){
this.form.id=null;
2024-11-15 06:56:01 +00:00
}
2025-07-01 07:00:41 +00:00
this.form.batchDtlList=[];
for(let i = 0; i< this.waitBatchDtlList.length;i++){
let item=this.waitBatchDtlList[i];
2025-02-19 02:30:37 +00:00
2025-07-01 07:00:41 +00:00
let packDetail = {
batchNo:this.form.batchNo,
billCode: item.billCode,
2025-08-07 09:45:56 +00:00
batchParcelQty: item.parcelQty,
batchWeight: item.billWeight,
batchVolume: item.totalVolume,
2025-07-01 07:00:41 +00:00
scanDate: null,
scanStatus: "0",
groupStatus: "1",//已组批次
scanMan: null,
scanSite: null,
};
2025-08-07 09:45:56 +00:00
if(this.form.id != null){ // 编辑
// packDetail.id = item.id;
packDetail.id = item.batchId;
}
if(item.batchVolume) {
packDetail.batchVolume = item.batchVolume;
}
if(item.batchParcelQty) {
packDetail.batchParcelQty = item.batchParcelQty;
}
if(item.batchWeight){
packDetail.batchWeight = item.batchWeight;
}
2025-07-01 07:00:41 +00:00
this.form.batchDtlList.push(packDetail);
}
2024-11-19 12:21:57 +00:00
2025-07-01 07:00:41 +00:00
// 新增配载数据 tableData
this.form.loadingList=[];
for(let lr = 0; lr < 3; lr++){
for(let ll = 0; ll < 6; ll++){
2024-11-15 06:56:01 +00:00
let batchLoadingData = {
2025-07-01 07:00:41 +00:00
batchNo: this.form.batchNo,
posNo:lr+":"+ll+":1",
row: lr,
col: ll,
layer: 1,
2024-11-15 06:56:01 +00:00
posDesc:this.tableData[lr][ll],
2025-07-01 07:00:41 +00:00
remark:"",
tenantId:"",
2024-11-15 06:56:01 +00:00
}
2025-07-01 07:00:41 +00:00
this.form.loadingList.push(batchLoadingData);
2024-11-15 06:56:01 +00:00
}
}
2025-06-17 00:55:39 +00:00
2025-07-01 07:00:41 +00:00
if (this.form.id != null) {
this.isDoing=true;
try{
const ret=await editAllEmisTmsSiteBatch(this.form);
this.isDoing=false;
this.$modal.msgSuccess("修改成功");
this.$emit("on-changed");
}catch(e){
this.isDoing=false;
// this.$modal.msgError(e);
}
2024-11-15 06:56:01 +00:00
2025-12-05 03:10:28 +00:00
// scanSiteBatch(this.form.batchNo).then(res=>{});
scanSiteBatchV2(this.form.batchNo).then(res=>{});
2025-07-01 07:00:41 +00:00
} else {
this.isDoing=true;
try{
if(this.isCopy){
this.form.updateTime = null;
this.form.updateBy = null;
this.form.updateByName = null;
this.form.updateSite = null;
this.form.updateSiteName = null;
2025-12-08 09:05:07 +00:00
//从form中去掉blEntering属性
delete this.form.blEntering;
}
2025-07-01 07:00:41 +00:00
let res=await addAllEmisTmsSiteBatch(this.form);
this.isDoing=false;
this.$modal.msgSuccess("新增成功");
this.$emit("on-changed");
}catch(e){
this.isDoing=false;
// this.$modal.msgError(e);
}
2025-12-05 03:10:28 +00:00
// scanSiteBatch(this.form.batchNo).then(res=>{ });
scanSiteBatchV2(this.form.batchNo).then(res=>{ });
2025-07-01 07:00:41 +00:00
}
}
});
2024-11-15 06:56:01 +00:00
},
handleCancelCo(){
2025-02-14 07:57:04 +00:00
this.form={};
2024-11-15 06:56:01 +00:00
this.blUnpack="1";
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList=[];
2024-11-15 06:56:01 +00:00
this.$emit("on-cancel");
},
2025-07-01 07:00:41 +00:00
2025-06-25 06:05:44 +00:00
async addBillToBatch(){
2025-07-01 07:00:41 +00:00
if(this.inputBatchBillCode==null || this.inputBatchBillCode==''){
2024-11-15 06:56:01 +00:00
this.$modal.msgError("请输入单号");
return;
}
2025-08-07 09:45:56 +00:00
2025-07-03 09:01:04 +00:00
// 剔除重复值,并剔除已存在列表中的数据
let addBillCodeArr=this.inputBatchBillCode.trim().split(/[;\;\,\,\n]/)||[];
let oldBillCodeArr=this.waitBatchDtlList.map(item=>{return item.billCode});
// 唯一值处理
const uniqueSet = new Set([...addBillCodeArr, ...oldBillCodeArr]);
const uniqueArr = [...uniqueSet];
// 剔除已存在的值
const billCodeArr = uniqueArr.filter(
item => !oldBillCodeArr.some(oldItem => item === oldItem)
);
2025-07-01 07:00:41 +00:00
for(let i = 0; i < billCodeArr.length; i++){
let billcode = billCodeArr[i].trim();
2025-08-07 09:45:56 +00:00
let queryParams = {
billCode: billcode,
2025-08-12 03:30:12 +00:00
batchNo: this.form.batchNo,
2025-08-07 09:45:56 +00:00
params:{
startSiteCode: this.form.startSiteCode,
nextSiteCode: this.form.nextSiteCode,
supplierCode: this.form.supplierCode,
carNo: this.form.carNo,
2025-08-07 09:45:56 +00:00
}
}
getBatchDtl(queryParams).then(res=>{
const billData = res.data;
const originalParcelQty = billData.batchParcelQty!==null?billData.batchParcelQty:billData.waybillDetail.parcelQty;
const originalBillWeight = billData.batchWeight!==null?billData.batchWeight:billData.waybillDetail.billWeight;
const originalTotalVolume = billData.batchVolume!==null?billData.batchVolume:billData.waybillDetail.totalVolume;
let item = {...billData.waybillDetail,"batchParcelQty":billData.batchParcelQty,"batchWeight":billData.batchWeight,"batchVolume":billData.batchVolume, "originalParcelQty": originalParcelQty, "originalBillWeight": originalBillWeight, "originalTotalVolume": originalTotalVolume}; //新增字段存 剩余件数
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList.push(item);
this.computeTotal();
2025-08-07 09:45:56 +00:00
})
2024-11-15 06:56:01 +00:00
}
this.titleBatch="";
this.openBatch=false;
2025-07-01 07:00:41 +00:00
this.inputBatchBillCode = "";
2024-11-15 06:56:01 +00:00
},
handleCoPackListDelete(){
2025-07-01 07:00:41 +00:00
this.$confirm('确认删除?', '确认信息')
.then( (isPass) => {
if (isPass) {
2024-11-15 06:56:01 +00:00
let newList =[];
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList.forEach(item=>{
2024-11-15 06:56:01 +00:00
if(this.coSelection.filter(cs => cs.billCode == item.billCode) == 0){
newList.push(item);
}
});
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList = newList;
2024-11-15 06:56:01 +00:00
this.computeTotal();
}
2025-07-01 07:00:41 +00:00
});
2024-11-15 06:56:01 +00:00
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
// this.queryParams.pageSize = 20;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.selection = selection;
this.single = selection.length!==1
this.multiple = !selection.length
2025-07-01 07:00:41 +00:00
2024-11-15 06:56:01 +00:00
this.coSelection = selection;
2025-07-01 07:00:41 +00:00
2024-11-15 06:56:01 +00:00
},
computeTotal(){
let totalParcelQty=0;
let totalWeight=0;
let totalVolume=0;
2025-07-10 23:43:14 +00:00
let totalSettlementWeight=0;
2025-07-01 07:00:41 +00:00
this.waitBatchDtlList.forEach(item =>{
2025-08-07 09:45:56 +00:00
totalParcelQty +=(item.batchParcelQty!==null?item.batchParcelQty:item.parcelQty);
totalWeight +=(item.batchWeight!==null?item.batchWeight:item.billWeight);
totalVolume +=(item.batchVolume!==null?item.batchVolume:item.totalVolume);
2025-07-10 23:43:14 +00:00
totalSettlementWeight +=item.settlementWeight;
2025-02-14 07:57:04 +00:00
item.destCountry = this.form.destCountry;
// item.sendSiteCode = this.form.sendSiteCode;
item.startSiteCode = this.form.startSiteCode;
item.startSiteName = this.form.startSiteName;
// item.nextSiteCode = this.form.nextSiteCode;
item.nextSiteCode = this.form.nextSiteCode;
item.nextSiteName = this.form.nextSiteName;
2024-11-15 06:56:01 +00:00
item.blUnpack = this.blUnpack;
})
2025-07-01 07:00:41 +00:00
this.form.totalWaybillQty=this.waitBatchDtlList.length;
2025-02-14 07:57:04 +00:00
this.form.totalParcelQty=totalParcelQty;
this.form.totalWeight=totalWeight.toFixed(2);
this.form.totalVolume=totalVolume.toFixed(4);
2025-07-10 23:43:14 +00:00
this.form.totalSettlementWeight=totalSettlementWeight.toFixed(2);
2024-11-15 06:56:01 +00:00
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
handleAddWayBill(){
2025-08-07 09:45:56 +00:00
if(this.form.startSiteCode == null || this.form.startSiteCode == ''){
this.$modal.msgError("请选择起始网点");
return;
}
if(this.form.nextSiteCode == null || this.form.nextSiteCode == ''){
this.$modal.msgError("请选择下一网点");
return;
}
if(this.form.supplierCode == null || this.form.supplierCode == ''){
this.$modal.msgError("请选择供应商");
return;
}
2024-11-15 06:56:01 +00:00
this.openBatch = true;
this.titleBatch = "批量输入运单号";
},
2025-06-25 06:05:44 +00:00
cancelAddBillToBatch(){
2024-11-15 06:56:01 +00:00
this.openBatch=false;
this.titleBatch = "";
2025-07-01 07:00:41 +00:00
this.inputBatchBillCode = "";
2024-11-15 06:56:01 +00:00
},
2024-11-19 11:39:21 +00:00
2024-11-15 06:56:01 +00:00
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisTmsPack/viewDetail', query: { id: row.id }})
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 导出按钮操作 */
2024-12-14 09:26:48 +00:00
handleDownBatchDtl() {
const loadingInstance = this.$loading({
2024-11-15 06:56:01 +00:00
text: '正在导出...'
2024-12-14 09:26:48 +00:00
})
2025-07-01 07:00:41 +00:00
this.exportData(this.waitBatchDtlList,loadingInstance);
2024-12-14 09:26:48 +00:00
2025-07-01 07:00:41 +00:00
// let qExportParam={
// pageNum:1,
// pageSize:20000,
// batchNo: this.form.batchNo
// };
// listEmisTmsSiteBatchDtl(qExportParam).then(response => {
// if (response.code === 200) {
// this.exportData(response.rows,loadingInstance);
// }
// });
2024-12-14 09:26:48 +00:00
},
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
2024-11-15 06:56:01 +00:00
})
2024-12-14 09:26:48 +00:00
loadingInstance.close()
})
2024-11-15 06:56:01 +00:00
},
formatJson(filterVal, jsonData, resData) {
let index = 0
return jsonData.map(v => filterVal.map(j => {
2024-12-14 09:26:48 +00:00
// console.log("===>1111===>",v);
2024-11-15 06:56:01 +00:00
if (j === 'index') {
return ++index
}
2024-12-14 09:26:48 +00:00
if (j === 'kjlx') {
2025-07-01 07:31:20 +00:00
return v['sendSiteName']+'--'+v['dispatchUnderlingSiteName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'fjr') {
return v['sendName']+'--'+v['receiveName'];
}
if (j === 'receiveCountryName') {
2025-07-01 07:31:20 +00:00
return v['receiveCountryName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendCountryName') {
2025-07-01 07:31:20 +00:00
return v['sendCountryName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'estimateDate') {
2025-07-01 07:31:20 +00:00
return v['estimateDate'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendSiteName') {
2025-07-01 07:31:20 +00:00
return v['sendSiteName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendName') {
2025-07-01 07:31:20 +00:00
return v['sendName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'receiveName') {
2025-07-01 07:31:20 +00:00
return v['receiveName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendDate') {
2025-07-01 07:31:20 +00:00
return v['sendDate'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendCompany') {
2025-07-01 07:31:20 +00:00
return v['sendCompany'];
2024-12-14 09:26:48 +00:00
}
if (j === 'receiveCompany') {
2025-07-01 07:31:20 +00:00
return v['receiveCompany'];
2024-12-14 09:26:48 +00:00
}
if (j === 'transLineTypeName') {
2025-07-01 07:31:20 +00:00
return v['transLineTypeName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'productTypeName') {
2025-07-01 07:31:20 +00:00
return v['productTypeName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendName') {
2025-07-01 07:31:20 +00:00
return v['sendName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'parcelQty') {
2025-07-01 07:31:20 +00:00
return v['parcelQty'];
2024-12-14 09:26:48 +00:00
}
if (j === 'billWeight') {
2025-07-01 07:31:20 +00:00
return v['billWeight'];
2024-12-14 09:26:48 +00:00
}
if (j === 'volumeWeight') {
2025-07-01 07:31:20 +00:00
return v['volumeWeight'];
2024-12-14 09:26:48 +00:00
}
if (j === 'totalVolume') {
2025-07-01 07:31:20 +00:00
return v['totalVolume'];
2024-12-14 09:26:48 +00:00
}
if (j === 'settlementWeight') {
2025-07-01 07:31:20 +00:00
return v['settlementWeight'];
2024-12-14 09:26:48 +00:00
}
if (j === 'freight') {
2025-07-01 07:31:20 +00:00
return v['freight'];
2024-12-14 09:26:48 +00:00
}
if (j === 'realFee') {
2025-07-01 07:31:20 +00:00
return v['realFee'];
2024-12-14 09:26:48 +00:00
}
if (j === 'remark') {
2025-07-01 07:31:20 +00:00
return v['remark'];
2024-12-14 09:26:48 +00:00
}
if (j === 'feeRemark') {
2025-07-01 07:31:20 +00:00
return v['feeRemark'];
2024-12-14 09:26:48 +00:00
}
if (j === 'salesmen') {
2025-07-01 07:31:20 +00:00
return v['salesmen'];
2024-12-14 09:26:48 +00:00
}
if (j === 'payee') {
2025-07-01 07:31:20 +00:00
return v['payee'];
2024-12-14 09:26:48 +00:00
}
if (j === 'payee') {
2025-07-01 07:31:20 +00:00
return v['payee'];
2024-12-14 09:26:48 +00:00
}
if (j === 'problemTypeName') {
2025-07-01 07:31:20 +00:00
return v['problemTypeName'];
2024-12-14 09:26:48 +00:00
}
if (j === 'problemCause') {
2025-07-01 07:31:20 +00:00
return v['problemCause'];
2024-12-14 09:26:48 +00:00
}
if (j === 'sendMobile') {
return "";
}
if (j === 'calcFeeType') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['calcFeeType']);
2024-12-14 09:26:48 +00:00
}
if (j === 'waybillDetail.paymentStatus') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_payment_status,v['paymentStatus']);
2024-12-14 09:26:48 +00:00
}
if (j === 'pickupMethod') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['pickupMethod']);
2024-12-14 09:26:48 +00:00
}
if (j === 'customsEclaration') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_declare_mode,v['customsEclaration']);
2024-12-14 09:26:48 +00:00
}
if (j === 'customsClear') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_customs_clear,v['customsClear']);
2024-12-14 09:26:48 +00:00
}
if (j === 'packType') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['packType']);
2024-12-14 09:26:48 +00:00
}
if (j === 'dispatchMethod') {
2025-07-01 07:31:20 +00:00
if(v['dispatchMethod'] == 1){
2024-12-14 09:26:48 +00:00
return '派送';
}else{
return '自提';
2024-11-15 06:56:01 +00:00
}
2024-12-14 09:26:48 +00:00
}
if (j === 'blMessage') {
2025-07-01 07:31:20 +00:00
if(v['blMessage'] == 1){
2024-12-14 09:26:48 +00:00
return '发送';
}else{
return '不发送';
}
}
if (j === 'blAcceptMessage') {
2025-07-01 07:31:20 +00:00
if(v['blAcceptMessage'] == 1){
2024-12-14 09:26:48 +00:00
return '发送';
}else{
return '不发送';
}
}
if (j === 'blSign') {
2025-07-01 07:31:20 +00:00
if(v['blSign'] == 1){
2024-12-14 09:26:48 +00:00
return '已签收';
}else{
return '未签收';
}
}
if (j === 'paymentType') {
2025-07-01 07:31:20 +00:00
return this.selectDictLabel(this.dict.type.emis_payment_type,v['paymentType']);
2024-11-15 06:56:01 +00:00
}
return v[j]
}))
},
2024-12-14 09:26:48 +00:00
2024-11-15 06:56:01 +00:00
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
2025-08-12 11:06:34 +00:00
/** 导出按钮操作 */
handleExport() {
2025-10-23 05:02:57 +00:00
if (!this.form.batchNo) {
return;
}
2025-08-12 11:06:34 +00:00
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisTmsSiteBatchDtl({batchNo: this.form.batchNo}).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows.map(item=>{
return {
"billCode":item.billCode,
...item.waybillDetail,
}
})
console.log(curList)
setTimeout(()=>{
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['运单号','寄件网点','寄件国家','目的国家','线路','产品类型','寄件日期','预计到达时间','总件数','实际重量','总体积','体积重量','结算重量','收件人','收件公司','报关方式','清关方式','取件方式','付款方式','运费','寄件人','寄件公司','录单备注'];
const filterVal = ['billCode','sendSiteName','sendCountryName','receiveCountryName','transLineTypeName','productTypeName','sendDate','estimateDate','parcelQty','billWeight','totalVolume','volumeWeight','settlementWeight','receiveName','receiveCompany','customsEclaration','customsClear','pickupMethod','paymentType','freight','sendName','sendCompany','remark'];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '批次明细导出',
autoWidth: true
})
loadingInstance.close()
})
},500 )
}
});
},
2024-11-15 06:56:01 +00:00
}
};
</script>
2024-11-16 00:39:39 +00:00
<style lang="scss">
2024-11-15 06:56:01 +00:00
.el-divider{
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
.query-label {
.el-radio{
display: block;
line-height: 23px;
white-space: normal;
margin-right: 0;
}
}
.overflowhidden{
overflow: hidden;
}
.ellipsis {
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
}
2024-11-16 00:39:39 +00:00
.cargoList{
.el-input__inner {
height: 28px;
line-height: 28px;
border: none;
background: #ffffcd;
font-size: 10px;
padding: 0px;
text-align: center;
}
.el-input-number {
width: 100%!important;
}
.el-input-number.is-without-controls .el-input__inner {
height: 28px;
line-height: 28px;
border: none;
background: #ffffcd;
font-size: 10px;
padding: 0px;
text-align: center;
}
}
2024-11-15 06:56:01 +00:00
</style>