emis-frontend/src/views/emis/emisWaybill/UserOrderList.vue

1143 lines
47 KiB
Vue

<template>
<XdPageContainer class="app-container">
<div slot="pageHeader" class="tab-container">
<SearchForm :model="queryParams" ref="queryForm" size="mini" :maxShow="10" label-width="100px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="9">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item label="" prop="queryKey">
<div slot="label">
<el-radio-group class="query-label" v-model="queryParams.queryOrderType">
<el-radio :key="1" label="1">运单号</el-radio>
<el-radio :key="2" label="2">订单号</el-radio>
<el-radio :key="3" label="3">进仓单</el-radio>
</el-radio-group>
</div>
<XdTextareaInput
v-model="queryParams.queryKey"
:placeholder="$t('多个流水号逗号或换行隔开')"
clearable
:rows="4"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="下单时间" prop="createTime" label-width="100px" >
<div slot="label" style="text-align: left;">
<el-radio-group class="query-label" v-model="queryParams.params.queryDateType">
<el-radio :key="1" label="1">下单时间</el-radio>
<el-radio :key="2" label="2">预计入仓时间</el-radio>
</el-radio-group>
</div>
<elDateAdvPicker clearable v-model="dateTimeRange" @dateTimeChange="onDateSelect" ></elDateAdvPicker>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="15">
<el-form-item label="寄件网点" prop="productType">
<EmisSiteSimplePicker1 v-model="queryParams.sendSiteCode" :disabled="$store.getters.ownerSiteCode!='88888'" ></EmisSiteSimplePicker1>
</el-form-item>
<el-form-item label="取件方式" prop="pickupMethod">
<el-select v-model="queryParams.pickupMethod" clearable placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_qujian_fangshi"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" clearable placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_order_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('取件员')" prop="takePieceEmployeeCode">
<EmisUserSimplePicker1 :placeholder="$t('取件员')" v-model="queryParams.takePieceEmployeeCode" postCode="RSD"></EmisUserSimplePicker1>
</el-form-item>
<el-form-item label="寄件人" prop="sendName">
<el-input
v-model="queryParams.sendName"
:placeholder="$t('寄件人')"
clearable
/>
</el-form-item>
<el-form-item label="寄件人电话" prop="sendMobile">
<el-input
v-model="queryParams.sendMobile"
:placeholder="$t('寄件人电话')"
clearable
/>
</el-form-item>
<el-form-item label="寄件公司" prop="sendCompany">
<el-input
v-model="queryParams.sendCompany"
:placeholder="$t('寄件公司')"
clearable
/>
</el-form-item>
<el-form-item :label="$t('销售联系人')" prop="salesmen">
<EmpNamePicker1 :placeholder="$t('销售联系人')" v-model="queryParams.salesmen" ></EmpNamePicker1>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<el-col :span="24">
<el-form-item label="收件人" prop="receiveName">
<el-input
v-model="queryParams.receiveName"
:placeholder="$t('收件人')"
clearable
/>
</el-form-item>
<el-form-item label="收件电话" prop="receiveMobile">
<el-input
v-model="queryParams.receiveMobile"
:placeholder="$t('收件电话')"
clearable
/>
</el-form-item>
<el-form-item label="收件公司" prop="receiveCompany">
<el-input
v-model="queryParams.receiveCompany"
:placeholder="$t('收件公司')"
clearable
/>
</el-form-item>
<el-form-item label="目的国" prop="receiveCountry">
<CountryPicker0 v-model="queryParams.receiveCountry" :placeholder="$t('目的国')" @onChange="handleQuery"></CountryPicker0>
</el-form-item>
<el-form-item label="寄件国" prop="sendCountry">
<CountryPicker1 v-model="queryParams.sendCountry" :placeholder="$t('目的国')" ></CountryPicker1>
</el-form-item>
<el-form-item label="报关方式" prop="customsEclaration">
<el-select v-model="queryParams.customsEclaration" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_declare_mode"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="清关方式" prop="customsClear">
<el-select v-model="queryParams.customsClear" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_customs_clear"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="付款方式" prop="paymentType" label-width="70px">
<el-select v-model="queryParams.paymentType" placeholder="请选择">
<el-option
v-for="dict in dict.type.emis_payment_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('数据来源')" prop="dataFrom">
<el-select clearable v-model="queryParams.dataFrom" placeholder="">
<el-option key="sapp" label="sapp" value="sapp"></el-option>
<el-option key="oms" label="oms" value="oms"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</SearchForm>
</div>
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
v-loading="loading"
border
size="mini"
storageName="orderList_main"
ref="refTable"
:data="emisWaybillList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
@row-dblclick="handleShowTraceInfo"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<!-- icon="el-icon-plus" -->
<!-- v-hasPermi="['emis:emisWaybill:add']" -->
<el-col :span="1.5" v-if="activeTab=='waitConfirm'">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleAccept"
>接单</el-button>
</el-col>
<el-col :span="1.5" v-if="activeTab=='waitConfirm'">
<el-button
type="danger"
plain
size="mini"
:disabled="single"
@click="handleCancelOrder"
>取消订单</el-button>
</el-col>
<el-col :span="1.5" v-if="activeTab=='waitConfirm'" >
<el-popover
trigger="click"
ref="popoverRef1"
placement="bottom"
:width="400"
:popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
>
<div style="text-align: center;">
<div style="font-weight: 600;color: black;margin-bottom: 10px;">选择指派网点</div>
<EmisSiteSimplePicker1 v-model="dispSendSiteCode" ></EmisSiteSimplePicker1>
<el-button
style="margin-top: 10px;margin-bottom: 10px;"
type="primary"
size="mini"
@click="handleSetSite"
>确定</el-button>
</div>
<el-button
slot="reference"
type="primary"
size="mini"
:disabled="multiple"
>指派网点</el-button>
</el-popover>
</el-col>
<el-col :span="1.5" v-if="activeTab=='waitConfirm'" >
<el-popover
trigger="click"
ref="popoverRef2"
placement="bottom"
:width="400"
:popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
>
<div style="text-align: center;">
<div style="font-weight: 600;color: black;margin-bottom: 10px;">选择取件员</div>
<EmisUserSimplePicker1 :placeholder="$t('取件员')" v-model="dispTakeManCode" postCode="RSD"></EmisUserSimplePicker1>
<el-button
style="margin-top: 10px;margin-bottom: 10px;"
type="primary"
size="mini"
@click="handleSetTakeMan"
>确定</el-button>
</div>
<el-button
slot="reference"
type="primary"
plain
size="mini"
:disabled="multiple"
>指派取件员</el-button>
</el-popover>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleDownWarehouseInPDF"
>下载进仓单(PDF)</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleDownWarehouseInWORD"
>下载进仓单(WORD)</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['emis:emisWaybill: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="$t('下单日期')" align="center" prop="orderDate" min-width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('运单号')" align="center" prop="billCode" min-width="150" :show-overflow-tooltip="true"/>
<!-- <el-table-column :label="$t('订单号')" align="center" prop="orderSn" min-width="150" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('订单状态')" align="center" prop="orderStatus" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column :label="$t('下单方式')" align="center" prop="orderType" min-width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-tag v-if="scope.row.orderType==0" type="danger">客户下单</el-tag>
<el-tag v-if="scope.row.orderType==1" type="success">业务开单</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('进仓单')" align="center" prop="intoWarehouseBillCode" min-width="150" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收款状态')" align="center" prop="paymentStatus" width="100" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_payment_status" :value="scope.row.paymentStatus"/>
</template>
</el-table-column>
<el-table-column :label="$t('取件方式')" align="center" prop="pickupMethod" width="100" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_qujian_fangshi" :value="scope.row.pickupMethod"/>
</template>
</el-table-column>
<el-table-column :label="$t('发件人')" align="center" prop="fjr" width="180" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.sendName }}--{{ scope.row.receiveName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('快件类型')" align="center" prop="kjlx" width="180" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.sendSiteName }}--{{ scope.row.dispatchUnderlingSiteName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('预计送达')" align="center" prop="estimateDate" min-width="100" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.estimateDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('发货日期')" align="center" prop="sendDate" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('取件员')" align="center" prop="takePieceEmployeeName" min-width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.pickupMethod==2">{{scope.row.takePieceEmployeeName}}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column :label="$t('合同号')" align="center" prop="custOrderId" width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('线路')" align="center" prop="transLineTypeName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('操作员')" align="center" prop="operateEmployeeName" min-width="100" >
<template slot-scope="scope">
<span v-if="scope.row.pickupMethod==1">{{scope.row.operateEmployeeName}}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column :label="$t('产品类型')" align="center" prop="productTypeName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('时效')" align="center" prop="timeType" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('报关方式')" align="center" prop="customsEclaration" min-width="80" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_declare_mode" :value="scope.row.customsEclaration"/>
</template>
</el-table-column>
<el-table-column :label="$t('清关方式')" align="center" prop="customsClear" min-width="80" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_customs_clear" :value="scope.row.customsClear"/>
</template>
</el-table-column>
<el-table-column :label="$t('录入人')" align="center" prop="registerManName" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('客户名称')" align="center" prop="custName" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.paymentType==2 || scope.row.paymentType==4 || scope.row.paymentType==5">{{scope.row.custName}}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column :label="$t('回款联系人')" align="center" prop="payee" min-width="100" />
<el-table-column :label="$t('销售联系人')" align="center" prop="salesmen" min-width="100" />
<el-table-column :label="$t('是否问题件')" align="center" prop="blIsQuestion" min-width="80" >
<template slot-scope="scope">
<el-tag v-if="scope.row.blIsQuestion==1" type="danger">是</el-tag>
<el-tag v-else type="info">否</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('问题件类型')" align="center" prop="problemTypeName" width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('问题件原因')" align="center" prop="problemCause" width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件网点')" align="center" prop="sendSiteName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件财务中心')" align="center" prop="sendSiteFincailName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件人')" align="center" prop="sendName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件手机')" align="center" prop="sendMobile" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件公司')" align="center" prop="sendCompany" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件国家')" align="center" prop="sendCountryName" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('寄件省')" align="center" prop="sendProvinceName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件市')" align="center" prop="sendCityName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件区')" align="center" prop="sendCountyName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件地址')" align="center" prop="sendAddress" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('寄件/签收短信')" align="center" prop="blMessage" min-width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.blMessage==1" >发送</div>
<div v-else>不发送</div>
</template>
</el-table-column>
<!-- <el-table-column :label="$t('寄件日期')" align="center" prop="sendDate" min-width="100" :show-overflow-tooltip="true"/> -->
<!--
<el-table-column :label="$t('起始国')" align="center" prop="sendCountryName" width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('目的国')" align="center" prop="receiveCountryName" width="80" :show-overflow-tooltip="true"/> -->
<el-table-column :label="$t('收货人')" align="center" prop="receiveName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货电话')" align="center" prop="receiveMobile" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货公司')" align="center" prop="receiveCompany" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货国家')" align="center" prop="receiveCountryName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货省')" align="center" prop="receiveProvinceName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货市')" align="center" prop="receiveCityName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货区')" align="center" prop="receiveCountyName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('收货地址')" align="center" prop="receiveAddress" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('派货短信')" align="center" prop="blAcceptMessage" min-width="80" :show-overflow-tooltip="true">
<template slot-scope="scope">
<div v-if="scope.row.blAcceptMessage==1" >发送</div>
<div v-else>不发送</div>
</template>
</el-table-column>
<el-table-column :label="$t('仓库名称')" align="center" prop="intoWarehouseName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('仓库联系人')" align="center" prop="intoWarehouseContact" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('仓库联系电话')" align="center" prop="intoWarehousePhone" min-width="150" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('仓库地址')" align="center" prop="intoWarehouseAddress" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('预计入仓时间')" align="center" prop="pickStartDate" min-width="150" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('目的地')" align="center" prop="destinationName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('目的网点')" align="center" prop="dispatchUnderlingSiteName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('货物名称')" align="center" prop="goodsInfo" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('包装类型')" align="center" prop="packType" min-width="80" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_tab_packing_type" :value="scope.row.packType"/>
</template>
</el-table-column>
<el-table-column :label="$t('件数')" align="center" prop="parcelQty" min-width="80" />
<el-table-column :label="$t('实际重量')" align="center" prop="billWeight" min-width="80" />
<el-table-column :label="$t('体积')" align="center" prop="totalVolume" min-width="80" />
<el-table-column :label="$t('体积重量')" align="center" prop="volumeWeight" min-width="80" />
<el-table-column :label="$t('结算重量')" align="center" prop="settlementWeight" min-width="80" />
<el-table-column :label="$t('派件方式')" align="center" prop="dispatchMethod" min-width="80" >
<template slot-scope="scope">
<div v-if="scope.row.dispatchMethod==1" >派送</div>
<div v-else>自提</div>
</template>
</el-table-column>
<el-table-column :label="$t('支付类型')" align="center" prop="paymentType" min-width="80" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.paymentType"/>
</template>
</el-table-column>
<el-table-column :label="$t('运费')" align="center" prop="freight" min-width="80" />
<el-table-column :label="$t('费用备注')" align="center" prop="feeRemark" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('订单备注')" align="center" prop="orderRemark" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('签收状态')" align="center" prop="blSign" width="80" >
<template slot-scope="scope">
<el-tag v-if="scope.row.blSign=='1'" type="success">已签收</el-tag>
<el-tag v-else type="danger">未签收</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('签收时间')" align="center" prop="signDate" min-width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('签收人')" align="center" prop="signMan" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('派件人')" align="center" prop="dispatchManName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('派件网点')" align="center" prop="dispatchSiteName" min-width="80" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('录单网点')" align="center" prop="registerSiteName" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('录单备注')" align="center" prop="remark" min-width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('数据来源')" align="center" prop="dataFrom" min-width="80" />
<el-table-column :label="$t('下单人电话')" align="center" prop="customerPhone" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('下单人昵称')" align="center" prop="customerNickName" min-width="100" :show-overflow-tooltip="true" />
<el-table-column :label="$t('下单人头像')" align="center" prop="customerAvatar" min-width="100">
<template slot-scope="scope">
<ImagePreview height="20px" :src="scope.row.customerAvatar||''" ></ImagePreview>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
</XdTable>
<el-dialog title="订单详情" :visible.sync="openTraceInfo" width="70%" :close-on-click-modal="false" v-dialogDrag append-to-body>
<OrderDetailReadOnly :key="currentTraceBillCode" :billCode="currentTraceBillCode"></OrderDetailReadOnly>
</el-dialog>
</XdPageContainer>
</template>
<script>
import { listEmisOrder,cancelOrder,assignTakeMan,assignSendSite, getEmisWaybill, delEmisWaybill, addEmisWaybill, updateEmisWaybill } from "@/api/emis/emisWaybill";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
// import emisWaybillView from '@/views/emis/emisWaybill/emisWaybillView';
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
import elDateAdvPicker1 from "@/components/DatePickerAdv/elDateAdvPicker.vue";
import CountryPicker0 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
import CountryPicker1 from '@/views/emis/EmisBaseTools/CountryPicker.vue';
import waybillDetailReadOnly from '@/views/emis/emisWaybill/waybillDetailReadOnly.vue';
import TraceWaybillDetailView from '@/views/emis/customerService/traceWaybillDetailView.vue';
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
import EmisUserSimplePicker0 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import EmisUserSimplePicker1 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import EmisUserSimplePicker2 from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import EmisSiteSimplePicker1 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
import EmisSiteSimplePicker2 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
import OrderDetailReadOnly from '@/views/emis/emisWaybill/OrderDetailReadOnly.vue';
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
import {timeDiffTime,timeFormat} from '@/utils/dateUtils'
export default {
name: "UserOrderList",
components: { elDateAdvPicker,CountryPicker0,CountryPicker1 ,
EmisSiteSimplePicker1,waybillDetailReadOnly,OrderDetailReadOnly,
EmisSiteSimplePicker2,
EmisUserSimplePicker0,
EmisUserSimplePicker1,
EmisUserSimplePicker2,
EmpNamePicker1,
TransLinePicker,
TransProductPicker,
TraceWaybillDetailView,
elDateAdvPicker1
},
dicts: ['emis_order_status','emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type',
'emis_calc_fee_type','emis_print_type','emis_payment_status','emis_waybill_status','emis_tab_dispatch_mode'
],
data() {
return {
activeTab:"waitConfirm",
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
beginPickRange:[],
// 总条数
total: 0,
// 运单列表表格数据
emisWaybillList: [],
selectionList:[],
billTabs:[],
currentSelectOrder:null,
// 指派网点
dispSendSiteCode:null,
// 指派业务员
dispTakeManCode:null,
sendSiteCode:null,
currentId:null,
openForm: false,
titleForm: "",
openTraceInfo:false,
currentTraceBillItem:null,
currentTraceBillCode:null,
// 弹出展示层
id:null,
titleView:"",
openView: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
queryOrderType:'1',
queryKey:null,
orderSn: null,
billCode: null,
billCodeSub: null,
orderStatus: null,
waybillStatus: null,
orderType: null,
orderDate: null,
customerCode: null,
customerName: null,
receiveCustomerCode: null,
receiveCustomerName: null,
thirdCustomerCode: null,
thirdCustomerName: null,
receiveName: null,
receiveCompany: null,
receiveMobile: null,
receiveTel: null,
receiveCountry: null,
receiveProvince: null,
receiveCity: null,
receiveCounty: null,
receiveTown: null,
receiveAddress: null,
receivePostcode: null,
receivePcd: null,
sendName: null,
sendCompany: null,
sendMobile: null,
sendTel: null,
sendCountry: null,
sendProvince: null,
sendCity: null,
sendCounty: null,
sendTown: null,
sendAddress: null,
sendPostcode: null,
sendPcd: null,
paymentType: null,
calcFeeType: null,
custNo: null,
transLineType: null,
productType: null,
timeType: null,
meterType: null,
customsClear: null,
customsEclaration: null,
estimateDate: null,
packType: null,
dispatchMethod: null,
pickupMethod: null,
pickStartDate: null,
pickFinishDate: null,
pickFailReason: null,
intoWarehouseCode: null,
intoWarehouseName: null,
intoWarehouseAddress: null,
intoWarehouseContact: null,
intoWarehousePhone: null,
intoWarehouseBillCode: null,
warehouseInNo: null,
customerDeliveryBeginTime: null,
customerDeliveryEndTime: null,
goodsType: null,
goodsInfo: null,
goodsPics: null,
blPrepareInFreight: null,
prepareInEstFee: null,
prepareInRealFee: null,
prepareInExpress: null,
prepareInBillCode: null,
prepareInRemark: null,
prepareInSupplier: null,
totalWeight: null,
totalVolume: null,
parcelQty: null,
billWeight: null,
volumeWeight: null,
currency: null,
settlementWeight: null,
feeWeight: null,
freight: null,
blOverLong: null,
blBill: null,
blOverWeight: null,
overWeightNumber: null,
feeRemark: null,
thirdCode: null,
realValue: null,
blInsure: null,
insureValue: null,
insureValueCurrency: null,
insureFeeCurrency: null,
insureFee: null,
insureRemark: null,
insureSiteCode: null,
insureDate: null,
blPrint: null,
printManCode: null,
printSite: null,
printDate: null,
printCount: null,
blDispFd: null,
transferCode: null,
transferBillcode: null,
dispFdDate: null,
dispFdReason: null,
currentSiteCode: null,
lastSiteCode: null,
registerSiteCode: null,
registerDate: null,
registerManCode: null,
takePieceEmployeeCode: null,
sendSiteCode: null,
sendDate: null,
dispatchManCode: null,
dispatchDate: null,
dispatchSiteCode: null,
produceBillDate: null,
produceBillSiteCode: null,
produceBillManCode: null,
destinationCode: null,
destinationProvince: null,
destinationCity: null,
destinationCounty: null,
dispatchUnderlingSiteCode: null,
destinationCenterCode: null,
marketManCode: null,
payee: null,
salesmen: null,
operateEmployeeCode: null,
blIsQuestion: null,
problemType: null,
problemCause: null,
problemDelayDays: null,
blMessage: null,
blAcceptMessage: null,
blGenSubbill: null,
signMan: null,
signManCode: null,
signSiteCode: null,
signDate: null,
billPicSendRmk: null,
billPicDispatchRmk: null,
timezoneOffset: null,
delFlag: null,
remark: null,
dataFrom:null,
params:{
queryOrderType:1,
queryOrderDateType:1,
queryDateType:'1',
}
},
};
},
created() {
if(this.$store.getters.ownerSiteCode!='88888'){
this.queryParams.sendSiteCode=this.$store.getters.ownerSiteCode;
}
const end = new Date()
const start = new Date()
start.setHours(0,0,0,0)
end.setHours(23,59,59,0)
// this.dateTimeRange=[timeFormat(start), timeFormat(end)]
this.queryParams.orderStatus='0';
this.getList();
},
methods: {
handleShowTraceInfo(row){
this.currentTraceBillCode=row.billCode;
this.currentTraceBillItem=row;
this.openTraceInfo=true;
},
handleTabsClick(tab, event) {
if (tab.name == 'waitConfirm') {
this.queryParams.orderStatus='0';
}
else if (tab.name == 'hasConfirm') {
this.queryParams.orderStatus='1';
}
else if (tab.name == 'hasCancel') {
this.queryParams.orderStatus='2';
}
else if (tab.name == 'allOrder') {
this.queryParams.orderStatus=null;
}
this.getList();
},
/** 查询运单列表列表 */
getList() {
this.loading = true;
if(this.queryParams.queryOrderType==1){
this.queryParams.billCode= this.queryParams.queryKey;
this.queryParams.orderSn= null;
this.queryParams.intoWarehouseBillCode= null;
}
else if(this.queryParams.queryOrderType==2){
this.queryParams.billCode= null;
this.queryParams.orderSn= this.queryParams.queryKey;
this.queryParams.intoWarehouseBillCode= null;
}
else if(this.queryParams.queryOrderType==3){
this.queryParams.billCode= null;
this.queryParams.orderSn= null;
this.queryParams.intoWarehouseBillCode=this.queryParams.queryKey;
}
let qParam ={...this.queryParams};
if(this.queryParams.params.queryDateType=='1'){
qParam = this.addDateRange(this.queryParams, this.dateTimeRange,"orderDate");
qParam = this.addDateRange(this.queryParams,[],'PickStartDate')
}else{
qParam = this.addDateRange(qParam, this.dateTimeRange,"PickStartDate");
qParam = this.addDateRange(qParam, [],"orderDate");
}
listEmisOrder(qParam).then(response => {
this.emisWaybillList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleDownWarehouseInPDF() {
if(this.selectionList&&this.selectionList.length>0){
this.selectionList.forEach(item=>{
this.download('emis/emisWaybill/exportWarehouseInTpl', {
orderSn:item.orderSn,
fileType:'pdf'
}, `${item.intoWarehouseBillCode}.pdf`)
});
}
},
handleDownWarehouseInWORD() {
if(this.selectionList&&this.selectionList.length>0){
this.selectionList.forEach(item=>{
this.download('emis/emisWaybill/exportWarehouseInTpl', {
orderSn:item.orderSn,
fileType:'docx'
}, `${item.intoWarehouseBillCode}.docx`)
});
}
},
removeTab(targetName) {
var self=this;
let tabs = self.billTabs;
self.billTabs = tabs.filter(tab => tab.billCode !== targetName);
if(self.billTabs.length>0){
this.activeTab=self.billTabs[self.billTabs.length-1].billCode;
}else{
this.activeTab="waitConfirm";
}
},
onDateSelect(value){
console.log("date picker---->", value)
this.dateTimeRange=value;
// scanDate
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
this.selectionList=selection;
if(this.selectionList&&this.selectionList.length>0){
this.currentSelectOrder=this.selectionList[0];
}
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
handleAccept(){
// 跳转到开单界面
if(this.selectionList&&this.selectionList.length>0){
let item0=this.selectionList[0];
if(item0.orderStatus==1){
this.$modal.msgError("已接单,不允许操作");
return;
}
let billCode=item0.billCode;
this.$router.push({ path: '/d24/waybillManagement/WaybillGot', query: {name:"接单", action: "got",billCode: billCode,timestamp:(new Date()).getTime() }})
// this.$router.push({ path: '/d24/waybillManagement/WaybillRecord', query: {name:"接单", action: "add",billCode: billCode,addFrom:"userOrder"}})
}
},
handleCancelOrder(){
this.$prompt('请输入取消原因', "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{1,30}$/,
inputErrorMessage: "原因长度必须介于 1 和 30 之间"
}).then(({ value }) => {
let orderSn=this.selectionList[0].orderSn;
console.log("====>handleCancelOrder=orderSn=>",orderSn,value);
cancelOrder({orderSn:orderSn,orderRemark:value}).then(response => {
this.$modal.msgSuccess("操作成功" );
this.getList();
});
}).catch(() => {});
},
handleSetSite(){
this.$refs.popoverRef1.doClose();
this.selectionList.forEach(item=>{
if(item.orderStatus==1){
this.$modal.msgError("已接单,不允许操作");
return;
}
if(item.orderStatus==2){
this.$modal.msgError("已取消,不允许操作");
return;
}
// let orderSn=this.selectionList[0].orderSn;
let orderSn=item.orderSn;
console.log("====>handleSetSite=orderSn=>",orderSn);
assignSendSite({orderSn:orderSn,sendSiteCode:this.dispSendSiteCode}).then(response => {
this.$modal.msgSuccess("操作成功" );
this.getList();
});
});
},
handleSetTakeMan(){
this.$refs.popoverRef2.doClose();
this.selectionList.forEach(item=>{
if(item.orderStatus==1){
this.$modal.msgError("已接单,不允许操作");
return;
}
if(item.orderStatus==2){
this.$modal.msgError("已取消,不允许操作");
return;
}
let orderSn=item.orderSn;
console.log("====>handleSetTakeMan=orderSn=>",orderSn);
assignTakeMan({orderSn:orderSn,takePieceEmployeeCode:this.dispTakeManCode}).then(response => {
this.$modal.msgSuccess("操作成功" );
this.getList();
});
});
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 导出按钮操作 */
handleExport() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
if(this.selectionList&&this.selectionList.length>0){
this.exportData(this.selectionList,loadingInstance);
}
else{
// this.initQueryParams();
qParam.pageNum=1;
qParam.pageSize=20000;
listEmisOrder(qParam).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;
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 => {
if (j === 'index') {
return ++index
}
if (j === 'kjlx') {
return v['sendSiteName']+'--'+v['dispatchUnderlingSiteName'];
}
if (j === 'fjr') {
return v['sendName']+'--'+v['receiveName'];
}
if (j === 'sendMobile') {
return "";
}
if (j === 'paymentStatus') {
return this.selectDictLabel(this.dict.type.emis_payment_status,v[j]);
}
if (j === 'pickupMethod') {
return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v[j]);
}
if (j === 'customsEclaration') {
return this.selectDictLabel(this.dict.type.emis_declare_mode,v[j]);
}
if (j === 'customsClear') {
return this.selectDictLabel(this.dict.type.emis_customs_clear,v[j]);
}
if (j === 'packType') {
return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v[j]);
}
if (j === 'dispatchMethod') {
if(v[j] == 1){
return '派送';
}else{
return '自提';
}
}
if (j === 'blMessage') {
if(v[j] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blAcceptMessage') {
if(v[j] == 1){
return '发送';
}else{
return '不发送';
}
}
if (j === 'blSign') {
if(v[j] == 1){
return '已签收';
}else{
return '未签收';
}
}
if (j === 'paymentType') {
return this.selectDictLabel(this.dict.type.emis_payment_type,v[j]);
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
}
};
</script>
<style lang="scss" scoped>
.query-label {
.el-radio{
display: block;
line-height: 23px;
white-space: normal;
margin-right: 0;
}
}
</style>