1095 lines
43 KiB
Vue
1095 lines
43 KiB
Vue
<template>
|
||
<div class="app-container">
|
||
<!-- <SearchForm :model="queryParams" ref="queryForm" size="small" :maxShow="3" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery"> -->
|
||
<el-form ref="form" size="mini" :model="queryParams" label-width="100px">
|
||
<el-row :gutter="20">
|
||
<el-col :span="8">
|
||
<el-form-item label="" prop="queryType">
|
||
<div slot="label">
|
||
<el-radio-group class="query-label" v-model="queryParams.queryType">
|
||
<el-radio label="1">合包号</el-radio>
|
||
</el-radio-group>
|
||
</div>
|
||
<el-input
|
||
v-model="queryParams.packNo"
|
||
:placeholder="$t('多个合包号逗号可换行隔开')"
|
||
clearable
|
||
type="textarea"
|
||
rows="2"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="签收时间" prop="dateTimeRange">
|
||
<elDateAdvPicker clearable v-model="dateTimeRange" @dateTimeChange="onDateSelect" ></elDateAdvPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<!-- </SearchForm> -->
|
||
</el-form>
|
||
|
||
|
||
<XdTable v-loading="loading"
|
||
border stripe
|
||
size="small"
|
||
:data="emisTmsPackList"
|
||
:showSearch.sync="showSearch"
|
||
:queryParams="queryParams"
|
||
:total="total"
|
||
@queryTable="handleQuery"
|
||
@selection-change="handleSelectionChange"
|
||
@sort-change="handleSortChange"
|
||
>
|
||
|
||
<div slot="toolbar">
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
v-hasPermi="['emis:emisTmsPack:query']"
|
||
@click="handleQuery"
|
||
>查询</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
@click="handleAdd"
|
||
v-hasPermi="['emis:emisTmsPack:add']"
|
||
>新增合包</el-button>
|
||
</el-col>
|
||
<!-- <el-col :span="1.5">
|
||
<el-button
|
||
type="success"
|
||
plain
|
||
icon="el-icon-edit"
|
||
size="mini"
|
||
:disabled="single"
|
||
@click="handleAdd"
|
||
v-hasPermi="['emis:emisTmsPack:edit']"
|
||
>修改</el-button>
|
||
</el-col> -->
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="danger"
|
||
plain
|
||
icon="el-icon-delete"
|
||
size="mini"
|
||
:disabled="multiple"
|
||
@click="handleDeleteCoPack"
|
||
v-hasPermi="['emis:emisTmsPack:remove']"
|
||
>删除</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="warning"
|
||
plain
|
||
icon="el-icon-download"
|
||
size="mini"
|
||
@click="handleAdd"
|
||
v-hasPermi="['emis:emisTmsPack:export']"
|
||
>打印合包</el-button>
|
||
</el-col>
|
||
</el-row>
|
||
</div>
|
||
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<!--
|
||
<el-table-column label="序号" align="center" min-width="60">
|
||
<template slot-scope="scope">
|
||
<span v-text="getIndex(scope.$index)"> </span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column label="xxx" align="left" prop="xxx" min-width="180">
|
||
<template slot-scope="scope">
|
||
<div class="link-type" @click="handleView(scope.row)">{{scope.row.orderSn}}</div>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column label="结算状态" align="center" prop="settleStatus" :sort-orders="['descending','ascending']" sortable="custom" min-width="80">
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.settleStatus == 0" style="color:red;">
|
||
<span class="el-tag el-tag--info">未结算</span>
|
||
</div>
|
||
<div v-if="scope.row.settleStatus == 10" style="color:red;">
|
||
<span class="el-tag">待确认</span>
|
||
</div>
|
||
<div v-if="scope.row.settleStatus == 11" style="color:green;">
|
||
<span class="el-tag el-tag--success el-tag--light">已确认</span>
|
||
</div>
|
||
<div v-if="scope.row.settleStatus == 20" >
|
||
<span class="el-tag el-tag--warning el-tag--light">待打款</span>
|
||
</div>
|
||
<div v-if="scope.row.settleStatus == 21" style="color:green;">
|
||
<span class="el-tag el-tag--success el-tag--light">已打款</span>
|
||
</div>
|
||
<div v-if="scope.row.settleStatus == 40" style="color:red;">
|
||
<span class="el-tag el-tag--danger">已拒绝</span>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
-->
|
||
|
||
<el-table-column :label="$t('合包号')" align="center" prop="packNo" min-width="100" />
|
||
<el-table-column :label="$t('合包状态')" align="center" prop="packStatus" min-width="100">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_pack_status" :value="scope.row.packStatus"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('操作网点')" align="center" prop="createSiteName" min-width="100" />
|
||
<el-table-column :label="$t('是否可拆')" align="center" prop="blUnpack" min-width="100">
|
||
<template slot-scope="scope">
|
||
<span>{{ scope.row.blUnpack == "1" ? "是" : "否" }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('操作员')" align="center" prop="createByName" min-width="100" />
|
||
<el-table-column :label="$t('票数')" align="center" prop="totalWaybillQty" min-width="100" />
|
||
<el-table-column :label="$t('件数')" align="center" prop="totalParcelQty" min-width="100" />
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="totalWeight" min-width="100" />
|
||
<el-table-column :label="$t('体积')" align="center" prop="totalVolume" min-width="100" />
|
||
<el-table-column :label="$t('创建时间')" align="center" prop="packDate" min-width="100" />
|
||
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
size="mini"
|
||
type="text"
|
||
@click="handleUpdate(scope.row)"
|
||
v-hasPermi="['emis:emisTmsPack:query']"
|
||
>查看</el-button>
|
||
<!-- <el-button
|
||
size="mini"
|
||
type="text"
|
||
icon="el-icon-edit"
|
||
@click="handleUpdate(scope.row)"
|
||
v-hasPermi="['emis:emisTmsPack:edit']"
|
||
>修改</el-button> -->
|
||
<!--
|
||
<el-button
|
||
size="mini"
|
||
type="text"
|
||
icon="el-icon-delete"
|
||
@click="CoPack(scope.row)"
|
||
v-hasPermi="['emis:emisTmsPack:remove']"
|
||
>删除</el-button> -->
|
||
</template>
|
||
</el-table-column>
|
||
</XdTable>
|
||
|
||
<el-dialog :title="titleForm" :visible.sync="openForm" width="80%" :destroy-on-close="true" @close="handleCancelCo" v-dialogDrag append-to-body>
|
||
<el-form ref="formCo" size="mini" :model="coData" label-width="100px" class="overflowhidden" >
|
||
<el-row :gutter="20">
|
||
<el-col :span="16">
|
||
<el-col :span="12">
|
||
<el-form-item :label="$t('合包号')" prop="packNo">
|
||
<el-input v-model="coData.packNo" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item :label="$t('组包时间')" prop="createTime">
|
||
<el-input v-model="coData.createTime" disabled />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item :label="$t('国家')" prop="destCountry">
|
||
<span slot="label">
|
||
<span style="color: red">{{ $t('国家') }}</span>
|
||
</span>
|
||
<CountryPicker :placeholder="$t('选择国家')" v-model="coData.destCountry" ></CountryPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item :label="$t('生成网点')" prop="sendStiteCode">
|
||
<span slot="label">
|
||
<span style="color: red">{{ $t('生成网点') }}</span>
|
||
</span>
|
||
<EmisSiteSimplePicker :placeholder="$t('请选择')" v-model="coData.sendStiteCode" ></EmisSiteSimplePicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item :label="$t('下一网点')" prop="nextSiteCode">
|
||
<span slot="label">
|
||
<span style="color: red">{{ $t('下一网点') }}</span>
|
||
</span>
|
||
<!-- <EmisSiteSimplePicker :placeholder="$t('请选择')" v-model="coData.nextSiteCode" ></EmisSiteSimplePicker> -->
|
||
<EmisGetNextSitePicker :placeholder="$t('请选择')" v-model="coData.nextSiteCode" ></EmisGetNextSitePicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item :label="$t('是否可拆')" prop="blUnpack">
|
||
<span slot="label">
|
||
<span style="color: red">{{ $t('是否可拆') }}</span>
|
||
</span>
|
||
<!-- <el-radio-group v-model="coData.blUnpack" value="1"> -->
|
||
<el-radio v-model="blUnpack" label="1">是</el-radio>
|
||
<el-radio v-model="blUnpack" label="0">否</el-radio>
|
||
<!-- </el-radio-group> -->
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-col :span="24">
|
||
<el-form-item style="font-weight:600;">
|
||
<span>{{$t('总票数') + ': ' + (coData.totalWaybillQty || 0)}}</span>
|
||
</el-form-item>
|
||
<!-- <el-form-item>
|
||
<span slot="label">
|
||
<span style="font-weight:600">{{$t('总票数') + ': '}}</span>
|
||
<span style="font-weight:600">{{coData.totalWaybillQty || 0}}</span>
|
||
</span>
|
||
</el-form-item> -->
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item style="font-weight:600;">
|
||
<span>{{$t('总件数') + ': ' + (coData.totalParcelQty || 0)}}</span>
|
||
</el-form-item>
|
||
<!-- <el-form-item>
|
||
<span slot="label">
|
||
<span style="font-weight:600">{{$t('总件数') + ': '}}</span>
|
||
<span style="font-weight:600">{{coData.totalParcelQty || 0}}</span>
|
||
</span>
|
||
</el-form-item> -->
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item style="font-weight:600;">
|
||
<span>{{$t('总重量') + ': ' + (coData.totalWeight || 0)}}</span>
|
||
</el-form-item>
|
||
<!-- <el-form-item>
|
||
<span slot="label">
|
||
<span style="font-weight:600">{{$t('总重量') + ': '}}</span>
|
||
<span style="font-weight:600">{{coData.totalWeight || 0}}</span>
|
||
</span>
|
||
</el-form-item> -->
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item style="font-weight:600;">
|
||
<span>{{$t('总体积') + ': ' + (coData.totalVolume || 0)}}</span>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
|
||
<XdTable v-loading="loading"
|
||
border stripe
|
||
size="small"
|
||
id="emisCoPackDetail"
|
||
:data="emisCoPackDetail"
|
||
:showSearch.sync="showSearch"
|
||
:queryParams="queryParams"
|
||
:total="emisCoPackDetail.length"
|
||
@queryTable="handleQuery"
|
||
@selection-change="handleCoPackSelectionChange"
|
||
@sort-change="handleSortChange"
|
||
max-height="400px"
|
||
>
|
||
|
||
<div slot="toolbar">
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
@click="handleCoPackListDelete"
|
||
:disabled="coSingle"
|
||
>删除</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
@click="handleAddWayBill"
|
||
>追加</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
@click="handleAddCoPack"
|
||
>确定</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
@click="handleCancelCo"
|
||
>取消</el-button>
|
||
</el-col>
|
||
</el-row>
|
||
</div>
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="100" />
|
||
<el-table-column :label="$t('订单号')" align="center" prop="orderSn" min-width="100" />
|
||
<el-table-column :label="$t('进仓单号')" align="center" prop="warehouseInNo" min-width="100" />
|
||
<el-table-column :label="$t('扫描状态')" align="center" prop="waybillStatus" min-width="100">
|
||
<template slot-scope="scope">
|
||
<span>{{ scope.row.waybillStatus == "1" ? "是" : "否" }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('扫描时间')" align="center" prop="xxx" min-width="100">
|
||
<template slot-scope="scope">
|
||
<span>{{ parseTime(coData.scanDate) }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('状态')" align="center" prop="emis_pack_status" min-width="100">
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_pack_status" :value="coData.packStatus"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('当前网点')" align="center" prop="currentSiteName" min-width="100" />
|
||
<el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" />
|
||
<el-table-column :label="$t('国家')" align="center" prop="destinationCounty" min-width="100">
|
||
<template slot-scope="scope">
|
||
<span>{{ coData.destCountryName }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :label="$t('线路')" align="center" prop="transLineType" min-width="100" />
|
||
<el-table-column :label="$t('产品类型')" align="center" prop="productType" min-width="100" />
|
||
<el-table-column :label="$t('预计到达时间')" align="center" prop="estimateDate" min-width="100" />
|
||
<el-table-column :label="$t('件数')" align="center" prop="parcelQty" min-width="100" />
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="billWeight" min-width="100" />
|
||
<el-table-column :label="$t('总重量')" align="center" prop="totalWeight" min-width="100" />
|
||
<el-table-column :label="$t('总体积')" align="center" prop="totalVolume" min-width="100" />
|
||
<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="100" />
|
||
<el-table-column :label="$t('收件公司')" align="center" prop="receiveCompany" min-width="100" />
|
||
<el-table-column :label="$t('取件员')" align="center" prop="takePieceEmployeeCode" min-width="100" />
|
||
<el-table-column :label="$t('取件方式')" align="center" prop="pickupMethod" min-width="100" />
|
||
<el-table-column :label="$t('付款方式')" align="center" prop="paymentType" min-width="100" />
|
||
<el-table-column :label="$t('运费')" align="center" prop="freight" min-width="100" />
|
||
<el-table-column :label="$t('寄件人')" align="center" prop="sendName" min-width="100" />
|
||
<el-table-column :label="$t('寄件公司')" align="center" prop="sendCompany" min-width="100" />
|
||
</XdTable>
|
||
</el-dialog>
|
||
|
||
|
||
<el-dialog :title="titleWayBill" :visible.sync="openWayBillForm" width="70%" @close="handleCloseWayBill" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||
<el-form ref="formCo" size="mini" :model="wayBillData" label-width="100px" class="overflowhidden" >
|
||
<el-row :gutter="20">
|
||
<el-col :span="8">
|
||
<el-form-item label="" prop="billCode">
|
||
<div slot="label">
|
||
<el-radio-group class="query-label" v-model="wayBillData.params.queryOrderType">
|
||
<el-radio label="1">运单号</el-radio>
|
||
<el-radio label="0">订单号</el-radio>
|
||
</el-radio-group>
|
||
</div>
|
||
<el-input
|
||
v-model="wayBillData.billCode"
|
||
:placeholder="$t('多个流水号逗号或换行隔开')"
|
||
clearable
|
||
type="textarea"
|
||
rows="2"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item :label="$t('目的国家')" prop="destCountry">
|
||
<CountryPicker :placeholder="$t('选择国家')" v-model="wayBillData.destCountry" ></CountryPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="线路" prop="lineCode">
|
||
<TransLinePicker v-model="wayBillData.lineCode" :countryCode="wayBillData.destCountry"></TransLinePicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="产品" prop="productType">
|
||
<TransProductPicker placeholder="全部" v-model="wayBillData.productType" :transLineCode="wayBillData.lineCode" ></TransProductPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="" prop="billCode">
|
||
<div slot="label">
|
||
<el-radio-group class="query-label" v-model="wayBillData.params.dataTimeType">
|
||
<el-radio label="1">下单时间</el-radio>
|
||
<el-radio label="0">录单时间</el-radio>
|
||
</el-radio-group>
|
||
</div>
|
||
<elDateAdvPicker clearable v-model="wayBillData.dateTimeRange" @dateTimeChange="onWayBillDateSelect" ></elDateAdvPicker>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
|
||
<XdTable v-loading="loading2"
|
||
border stripe
|
||
size="small"
|
||
id="emisWayBillList"
|
||
:data="emisWayBillList"
|
||
:showSearch.sync="showSearch"
|
||
:queryParams="queryParams"
|
||
:total="wayBillotal"
|
||
:pageSizes="20"
|
||
:page="1"
|
||
@queryTable="handleQueryWayBill"
|
||
@sort-change="handleSortChange"
|
||
@selection-change="handleWayBillSelectionChange"
|
||
max-height="300px"
|
||
>
|
||
|
||
<div slot="toolbar">
|
||
<el-row :gutter="10" class="mb8">
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
size="mini"
|
||
@click="handleQueryWayBill"
|
||
>查询</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="primary"
|
||
plain
|
||
icon="el-icon-plus"
|
||
size="mini"
|
||
@click="handleCoAdd"
|
||
:disabled="addWayBillDisabled"
|
||
>追加</el-button>
|
||
</el-col>
|
||
</el-row>
|
||
</div>
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="100" />
|
||
<el-table-column :label="$t('订单号')" align="center" prop="orderSn" min-width="100" />
|
||
<el-table-column :label="$t('进仓单号')" align="center" prop="intoWarehouseCode" min-width="100" />
|
||
<el-table-column :label="$t('运单状态')" align="center" prop="waybillStatus" min-width="100" />
|
||
<el-table-column :label="$t('物流信息')" align="center" prop="xxx" min-width="100" />
|
||
<el-table-column :label="$t('当前网点')" align="center" prop="currentSiteName" min-width="100" />
|
||
<el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" />
|
||
<el-table-column :label="$t('国家')" align="center" prop="destinationCounty" min-width="100" />
|
||
<el-table-column :label="$t('线路')" align="center" prop="transLineType" min-width="100" />
|
||
<el-table-column :label="$t('产品类型')" align="center" prop="productType" min-width="100" />
|
||
<el-table-column :label="$t('预计到达时间')" align="center" prop="estimateDate" min-width="100" />
|
||
<el-table-column :label="$t('件数')" align="center" prop="parcelQty" min-width="100" />
|
||
<el-table-column :label="$t('实际重量')" align="center" prop="billWeight" min-width="100" />
|
||
<el-table-column :label="$t('总重量')" align="center" prop="totalWeight" min-width="100" />
|
||
<el-table-column :label="$t('总体积')" align="center" prop="totalVolume" min-width="100" />
|
||
<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="100" />
|
||
<el-table-column :label="$t('收件公司')" align="center" prop="receiveCompany" min-width="100" />
|
||
<el-table-column :label="$t('取件员')" align="center" prop="takePieceEmployeeCode" min-width="100" />
|
||
<el-table-column :label="$t('取件方式')" align="center" prop="pickupMethod" min-width="100" />
|
||
<el-table-column :label="$t('付款方式')" align="center" prop="paymentType" min-width="100" />
|
||
<el-table-column :label="$t('运费')" align="center" prop="freight" min-width="100" />
|
||
<el-table-column :label="$t('寄件人')" align="center" prop="sendName" min-width="100" />
|
||
<el-table-column :label="$t('寄件公司')" align="center" prop="sendCompany" min-width="100" />
|
||
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" />
|
||
</XdTable>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import { listEmisTmsPack, getPackNo, getEmisTmsPack, delEmisTmsPack, addEmisTmsPack, updateEmisTmsPack } from "@/api/emis/emisTmsPack";
|
||
import { listEmisWaybill, getWaybillDetail } from "@/api/emis/emisWaybill";
|
||
import { listEmisTmsPackDtl, delEmisTmsPackDtl, addEmisTmsPackDtl } from "@/api/emis/emisTmsPackDtl";
|
||
// import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||
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/EmisSiteSimplePicker.vue';
|
||
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 } from "@/utils/custom";
|
||
|
||
export default {
|
||
name: "PackageManagement",
|
||
components: { EmisGetNextSitePicker, CountryPicker, EmisSiteSimplePicker, elDateAdvPicker, emisTmsPackForm, TransLinePicker, TransProductPicker},
|
||
dicts: ['emis_pack_status'],
|
||
data() {
|
||
return {
|
||
// 遮罩层
|
||
loading: true,
|
||
loading2: false,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
|
||
coSingle: true,
|
||
coMultiple: true,
|
||
|
||
addWayBillDisabled: true,
|
||
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 创建时间搜索
|
||
dateTimeRange:[],
|
||
// 总条数
|
||
total: 0,
|
||
// TMS合包表格数据
|
||
emisTmsPackList: [],
|
||
|
||
// 新增/修改弹窗数据
|
||
coData: {
|
||
blUnpack:"1"
|
||
},
|
||
// 新增/修改包详情数据
|
||
emisCoPackDetail:[],
|
||
blUnpack:"1",
|
||
// 追加的运单查询数据
|
||
wayBillData: {
|
||
params:{}
|
||
},
|
||
// 追加的运单数据
|
||
emisWayBillList:[],
|
||
wayBillotal:0,
|
||
|
||
currentId:null,
|
||
openForm: false,
|
||
titleForm: "",
|
||
|
||
titleWayBill:null,
|
||
openWayBillForm:false,
|
||
|
||
tempCoPackList:[],
|
||
coSelection:[],
|
||
//区分当前是新增还是修改
|
||
coPackType:'',
|
||
|
||
// 临时存储已有合包的运单号
|
||
tempExistCoPackWayBillList:[],
|
||
tempCoPackInfo:{},
|
||
|
||
// 弹出展示层
|
||
id:null,
|
||
titleView:"",
|
||
openView: false,
|
||
// 更新网点时间范围
|
||
daterangeCreateTime: [],
|
||
// 更新网点时间范围
|
||
daterangeUpdateTime: [],
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 20,
|
||
packNo: null,
|
||
packName: null,
|
||
packDate: null,
|
||
destCountry: null,
|
||
destCountryName: null,
|
||
blUnpack: null,
|
||
sendStiteCode: null,
|
||
totalParcelQty: null,
|
||
totalWaybillQty: null,
|
||
totalVolume: null,
|
||
totalWeight: null,
|
||
packStatus: null,
|
||
opMan: null,
|
||
remark: null,
|
||
delFlag: null,
|
||
},
|
||
queryCoParams: {
|
||
|
||
},
|
||
};
|
||
},
|
||
created() {
|
||
},
|
||
|
||
mounted() {
|
||
const end = new Date()
|
||
const start = new Date()
|
||
start.setHours(0,0,0,0)
|
||
end.setHours(23,59,59,0)
|
||
this.dateTimeRange=[start,end];
|
||
this.getList();
|
||
},
|
||
methods: {
|
||
/** 查询TMS合包列表 */
|
||
getList() {
|
||
this.loading = true;
|
||
// this.queryParams.params = {};
|
||
this.emisTmsPackList = [];
|
||
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
|
||
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
|
||
}
|
||
listEmisTmsPack(this.queryParams).then(response => {
|
||
this.emisTmsPackList = response.rows;
|
||
this.total = response.total;
|
||
this.loading = false;
|
||
});
|
||
},
|
||
handleQueryWayBill(){
|
||
this.loading2 = true;
|
||
if (null != this.wayBillData.dateTimeRange && '' != this.wayBillData.dateTimeRange) {
|
||
if(this.wayBillData.dataTimeType == '1'){
|
||
// 下单时间
|
||
this.wayBillData.params.beginOrderDate = this.wayBillData.dateTimeRange[0];
|
||
this.wayBillData.params.endOrderDate = this.wayBillData.dateTimeRange[1];
|
||
}else if(this.wayBillData.dataTimeType == '0'){
|
||
// 录单时间
|
||
this.wayBillData.params.beginCreateTime = this.wayBillData.dateTimeRange[0];
|
||
this.wayBillData.params.endCreateTime = this.wayBillData.dateTimeRange[1];
|
||
}
|
||
}
|
||
this.wayBillData.params.isNeedPack = 1;
|
||
listEmisWaybill(this.wayBillData).then(response => {
|
||
this.loading2 = false;
|
||
if(response.code != 200){
|
||
this.$message.error(response.msg);
|
||
return;
|
||
}
|
||
this.emisWayBillList = response.rows;
|
||
// this.emisCoPackDetail = response.rows;
|
||
console.log(this)
|
||
this.wayBillotal = response.total;
|
||
})
|
||
},
|
||
onDateSelect(value){
|
||
console.log("date picker---->", value)
|
||
this.dateTimeRange=value;
|
||
},
|
||
onWayBillDateSelect(value){
|
||
console.log("date picker---->", value)
|
||
this.wayBillData.dateTimeRange=value;
|
||
},
|
||
async handleAddCoPack(){
|
||
if(!this.coData.destCountry || !this.coData.sendStiteCode || !this.coData.nextSiteCode || !this.blUnpack){
|
||
this.$modal.msgError("请先选择必填项")
|
||
return;
|
||
}
|
||
if(this.emisCoPackDetail.length == 0){
|
||
this.$modal.msgError("请先选择至少一条运单信息")
|
||
return;
|
||
}
|
||
let coPackItem={
|
||
packNo: this.coData.packNo,
|
||
packName: this.coData.packName || '',
|
||
packDate: this.coData.createTime,
|
||
destCountry: this.coData.destCountry,
|
||
nextSiteCode: this.coData.nextSiteCode,
|
||
// destCountryName: this.coData.,
|
||
blUnpack: this.coData.blUnpack,
|
||
sendStiteCode: this.coData.sendStiteCode,
|
||
totalParcelQty: this.coData.totalParcelQty,
|
||
totalWaybillQty: this.coData.totalWaybillQty,
|
||
totalVolume: this.coData.totalVolume,
|
||
totalWeight: this.coData.totalWeight,
|
||
// packStatus: this.coData.,
|
||
opMan: this.$store.getters.empCode
|
||
}
|
||
if(this.coPackType == "add"){// 新增
|
||
let response = await addEmisTmsPack(coPackItem);
|
||
// addEmisTmsPack(coPackItem).then(response => {
|
||
if(!response || response.code != 200){
|
||
this.$modal.msgError(response && response.msg || '新增合包失败')
|
||
return;
|
||
}
|
||
// })
|
||
for(let i = 0; i< this.emisCoPackDetail.length;i++){
|
||
let packDetail = {
|
||
packNo:this.coData.packNo,
|
||
billCode: this.emisCoPackDetail[i].billCode,
|
||
scanDate: this.emisCoPackDetail[i].scanDate,
|
||
scanStatus: this.emisCoPackDetail[i].scanStatus,
|
||
packStatus: null,
|
||
scanMan: this.emisCoPackDetail[i].scanMan,
|
||
createBy: this.$store.getters.empCode,
|
||
createTime: parseTime(new Date())
|
||
};
|
||
let response = await addEmisTmsPackDtl(packDetail);
|
||
// addEmisTmsPackDtl(packDetail).then(response => {
|
||
if(!response || response.code != 200){
|
||
this.$modal.msgError(response && response.msg || '合包明细新增失败')
|
||
return;
|
||
}
|
||
// })
|
||
}
|
||
}else if(this.coPackType == "edit"){// 修改
|
||
//第一步:处理合包信息的更新;
|
||
if(this.tempCoPackInfo.destCountry != this.coData.destCountry
|
||
|| this.tempCoPackInfo.sendStiteCode != this.coData.sendStiteCode
|
||
|| this.tempCoPackInfo.nextSiteCode != this.coData.nextSiteCode
|
||
|| this.tempCoPackInfo.blUnpack != this.blUnpack
|
||
|| this.tempCoPackInfo.totalWaybillQty != this.coData.totalWaybillQty
|
||
|| this.tempCoPackInfo.totalParcelQty != this.coData.totalParcelQty
|
||
|| this.tempCoPackInfo.totalWeight != this.coData.totalWeight
|
||
|| this.tempCoPackInfo.totalVolume != this.coData.totalVolume
|
||
){
|
||
this.tempCoPackInfo.destCountry = this.coData.destCountry;
|
||
this.tempCoPackInfo.sendStiteCode = this.coData.sendStiteCode;
|
||
this.tempCoPackInfo.nextSiteCode = this.coData.nextSiteCode;
|
||
this.tempCoPackInfo.blUnpack = this.blUnpack;
|
||
this.tempCoPackInfo.totalWaybillQty = this.coData.totalWaybillQty;
|
||
this.tempCoPackInfo.totalParcelQty = this.coData.totalParcelQty;
|
||
this.tempCoPackInfo.totalWeight = this.coData.totalWeight;
|
||
this.tempCoPackInfo.totalVolume = this.coData.totalVolume;
|
||
let res = await updateEmisTmsPack(this.tempCoPackInfo);
|
||
// updateEmisTmsPack(this.tempCoPackInfo).then(res => {
|
||
if(!res || res.code != 200){
|
||
this.$modal.msgError(res && res.msg || '未知错误')
|
||
return;
|
||
}
|
||
// });
|
||
}
|
||
//第二步:处理运单列表的数据
|
||
let tempDelList = [];
|
||
let tempAddList=[];
|
||
//2.1:计算要删除的运单
|
||
tempDelList = this.tempExistCoPackWayBillList.filter(item => {
|
||
let ls = this.emisCoPackDetail.filter(cd => {
|
||
return cd.billCode == item.billCode
|
||
})
|
||
if(ls.length > 0){
|
||
return false;
|
||
}else{
|
||
return true;
|
||
}
|
||
})
|
||
// tempDelList.forEach(item =>{
|
||
for(let tdl = 0; tdl < tempDelList.length; tdl++){
|
||
let item = tempDelList[tdl];
|
||
let res = await delEmisTmsPackDtl(item.id);
|
||
// delEmisTmsPackDtl(item.id).then(res => {
|
||
if(!res || res.code != 200){
|
||
this.$modal.msgError(res && res.msg || '未知错误')
|
||
return;
|
||
}
|
||
// })
|
||
}
|
||
// })
|
||
//2.2:计算要新增的运单
|
||
tempAddList = this.emisCoPackDetail.filter(item => {
|
||
let ls = this.tempExistCoPackWayBillList.filter(cd => {
|
||
return cd.billCode == item.billCode
|
||
})
|
||
if(ls.length > 0){
|
||
return false;
|
||
}else{
|
||
return true;
|
||
}
|
||
})
|
||
// tempAddList.forEach(item =>{
|
||
for(let tal = 0; tal < tempAddList.length; tal++){
|
||
let item = tempAddList[tal];
|
||
let packDetail = {
|
||
packNo:this.coData.packNo,
|
||
billCode: item.billCode,
|
||
scanDate: item.scanDate,
|
||
scanStatus: item.scanStatus,
|
||
packStatus: null,
|
||
scanMan: item.scanMan,
|
||
createBy: this.$store.getters.empCode,
|
||
createTime: parseTime(new Date())
|
||
};
|
||
let response = await addEmisTmsPackDtl(packDetail);
|
||
// addEmisTmsPackDtl(packDetail).then(response => {
|
||
if(!response || response.code != 200){
|
||
this.$modal.msgError(response && response.msg || '合包明细新增失败')
|
||
return;
|
||
}
|
||
// })
|
||
}
|
||
// })
|
||
}
|
||
this.openForm= false;
|
||
this.titleForm = "";
|
||
this.$modal.msgSuccess('操作成功!');
|
||
this.getList();
|
||
},
|
||
async handleDeleteCoPack(){
|
||
let that =this;
|
||
for(let i = 0; i< this.ids.length;i++){
|
||
let res = await delEmisTmsPack(this.ids[i]);
|
||
if(!res || res.code != 200){
|
||
that.$modal.msgError(res && res.msg || '合包删除失败')
|
||
that.getList();
|
||
return;
|
||
}
|
||
}
|
||
this.$modal.msgSuccess('操作成功');
|
||
this.getList();
|
||
},
|
||
handleCancelCo(){
|
||
this.titleForm='';
|
||
this.openForm=false;
|
||
this.coData={};
|
||
this.blUnpack="1";
|
||
this.emisCoPackDetail=[];
|
||
},
|
||
handleWayBillSelectionChange(selection){
|
||
this.tempCoPackList = selection;
|
||
this.tempCoPackList.length > 0 ? this.addWayBillDisabled = false : this.addWayBillDisabled = true;
|
||
},
|
||
handleCoAdd(){
|
||
this.tempCoPackList.forEach(item => {
|
||
if(this.emisCoPackDetail.filter(wb => wb.billCode == item.billCode).length == 0){
|
||
this.emisCoPackDetail.push(item);
|
||
}
|
||
})
|
||
this.titleWayBill="";
|
||
this.openWayBillForm=false;
|
||
this.wayBillData = {
|
||
params:{}
|
||
};
|
||
this.emisWayBillList=[];
|
||
this.tempCoPackList=[];
|
||
this.addWayBillDisabled = true;
|
||
this.wayBillotal=0;
|
||
this.computeTotal();
|
||
},
|
||
handleCloseWayBill(){
|
||
this.titleWayBill="";
|
||
this.openWayBillForm=false;
|
||
this.wayBillData = {
|
||
params:{}
|
||
};
|
||
this.emisWayBillList=[];
|
||
this.tempCoPackList=[];
|
||
this.addWayBillDisabled = true;
|
||
this.wayBillotal=0;
|
||
},
|
||
handleCoPackListDelete(){
|
||
let newList =[];
|
||
this.emisCoPackDetail.forEach(item=>{
|
||
if(this.coSelection.filter(cs => cs.billCode == item.billCode) == 0){
|
||
newList.push(item);
|
||
}
|
||
});
|
||
this.emisCoPackDetail = newList;
|
||
this.computeTotal();
|
||
},
|
||
/** 搜索按钮操作 */
|
||
handleQuery() {
|
||
this.queryParams.pageNum = 1;
|
||
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
|
||
},
|
||
handleCoPackSelectionChange(selection){
|
||
// this.coSelection = selection.map(item => item.id)
|
||
this.coSelection = selection;
|
||
this.coSingle = selection.length!==1
|
||
this.coMultiple = !selection.length
|
||
},
|
||
computeTotal(){
|
||
let totalParcelQty=0;
|
||
let totalWeight=0;
|
||
let totalVolume=0;
|
||
this.emisCoPackDetail.forEach(item =>{
|
||
totalParcelQty +=item.parcelQty;
|
||
totalWeight +=item.billWeight;
|
||
totalVolume +=item.totalVolume;
|
||
item.destCountry = this.coData.destCountry;
|
||
item.sendStiteCode = this.coData.sendStiteCode;
|
||
item.nextSiteCode = this.coData.nextSiteCode;
|
||
item.blUnpack = this.blUnpack;
|
||
})
|
||
this.coData.totalWaybillQty=this.emisCoPackDetail.length;
|
||
this.coData.totalParcelQty=totalParcelQty;
|
||
this.coData.totalWeight=totalWeight;
|
||
this.coData.totalVolume=parseFloat(totalVolume.toFixed(5));
|
||
},
|
||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||
handleSortChange(column) {
|
||
this.queryParams.orderByColumn = column.prop;
|
||
this.queryParams.isAsc = column.order;
|
||
this.getList();
|
||
},
|
||
/** 新增按钮操作 */
|
||
async handleAdd() {
|
||
this.coPackType="add";
|
||
this.coData = {};
|
||
this.tempExistCoPackWayBillList = [];//情况临时保存的已有运单号
|
||
this.tempCoPackInfo={};
|
||
let response = await getPackNo();
|
||
if(!response || response.code != 200){
|
||
this.$message.error(response && response.msg || "未知错误");
|
||
return;
|
||
}
|
||
this.coData.packNo = response.data;
|
||
this.coData.createTime = parseTime(new Date());
|
||
this.coData.destCountry = null;
|
||
this.coData.destCountryName = null;
|
||
this.coData.sendStiteCode = null;
|
||
this.coData.nextSiteCode = null;
|
||
this.coData.nextStation = null;
|
||
this.blUnpack = "1";
|
||
|
||
this.currentId=null;
|
||
this.openForm= true;
|
||
this.titleForm = "新增合包";
|
||
},
|
||
handleAddWayBill(){
|
||
this.openWayBillForm= true;
|
||
this.titleWayBill = "运单列表";
|
||
},
|
||
handleShowMoreInput(){
|
||
this.moreInputVisible = !this.moreInputVisible;
|
||
},
|
||
/** 修改按钮操作 */
|
||
async handleUpdate(row) {
|
||
this.coPackType="edit";
|
||
let response = await getEmisTmsPack(row.id);
|
||
if(!response || response.code != 200){
|
||
this.$message.error(response && response.msg || "未知错误");
|
||
return;
|
||
}
|
||
let resData = response.data;
|
||
this.coData.packNo = resData.packNo;
|
||
this.coData.createTime = resData.createTime;
|
||
this.coData.destCountry = resData.destCountry;
|
||
// this.coData.destCountryName = null;
|
||
this.coData.sendStiteCode = resData.sendStiteCode;
|
||
this.coData.nextSiteCode = resData.nextSiteCode;
|
||
// this.coData.nextStation = null;
|
||
this.blUnpack = resData.blUnpack;
|
||
|
||
this.emisCoPackDetail=[];
|
||
let resList = await listEmisTmsPackDtl({packNo: resData.packNo});
|
||
if(!resList || resList.code != 200){
|
||
this.$message.error(resList && resList.msg || "未知错误");
|
||
return;
|
||
}
|
||
this.tempExistCoPackWayBillList = resList.rows;//临时存储,用于运单号校验
|
||
this.tempCoPackInfo = resData;
|
||
for(let p = 0; p < resList.rows.length;p++){
|
||
// let resd = await getWaybillDetail(resList.rows[p].billCode);
|
||
// if(!resd || resd.code != 200){
|
||
// this.$message.error(resd && resd.msg || "未知错误");
|
||
// return;
|
||
// }
|
||
// this.emisCoPackDetail.push(resd.data);
|
||
;
|
||
this.emisCoPackDetail.push(resList.rows[p].waybillDetail);
|
||
}
|
||
this.coData.packStatus = this.tempCoPackInfo.packStatus;
|
||
this.coData.scanDate = this.tempCoPackInfo.scanDate;
|
||
this.computeTotal();
|
||
this.currentId=null;
|
||
this.openForm= true;
|
||
this.titleForm = "修改合包";
|
||
},
|
||
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;
|
||
},
|
||
/** 删除按钮操作 */
|
||
CoPack(row) {
|
||
const ids = row.id || this.ids;
|
||
this.$modal.confirm('是否确认删除').then(function() {
|
||
return delEmisTmsPack(ids);
|
||
}).then(() => {
|
||
this.getList();
|
||
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;
|
||
|
||
listEmisTmsPack(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','sendStiteCode','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()
|
||
})
|
||
}
|
||
});
|
||
},
|
||
formatJson(filterVal, jsonData, resData) {
|
||
let index = 0
|
||
return jsonData.map(v => filterVal.map(j => {
|
||
if (j === 'index') {
|
||
return ++index
|
||
}
|
||
if (j === 'status') {
|
||
var statusStr='xxx'
|
||
if(v[j] == 10){
|
||
statusStr='xxx'
|
||
}
|
||
return statusStr;
|
||
}
|
||
return v[j]
|
||
}))
|
||
},
|
||
/** 列索引函数 */
|
||
getIndex($index) {
|
||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||
},
|
||
/** 时间搜索响应函数 */
|
||
dateTimeChange(value){
|
||
this.dateTimeRange=value;
|
||
},
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped>
|
||
.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;
|
||
}
|
||
</style>
|