|
<template>
|
<div class="page-list-container">
|
<!--数据Table-->
|
<yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes" :tab-nav-list="tabNavList" :is-init-load="false" @on-load-dropdown-after="onLoadDropdownAfter">
|
<!-- 字段插槽 -->
|
<template slot="common-column-slot" slot-scope="{ row, col }">
|
<template v-if="col.prop == 'orderStatus'">
|
|
<state-flow :load-options="stateLoadOptions" :where="{wayBillCode: row.wayBillCode}">
|
<template slot="content">
|
<el-tag :color="setStatusBgColor(row[col.prop])" :style="setStatusColor(row[col.prop])">
|
{{ row[col.prop] }}
|
</el-tag>
|
</template>
|
</state-flow>
|
</template>
|
<!--审核字段-->
|
<template v-else-if="col.prop=='auditing'">
|
<template>
|
<el-tag v-if="row[col.prop]==0" color="#ffff33" style="color:black;border:0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag>
|
<el-tag v-else-if="row[col.prop]==1" color="#ff0033" style="color:white;border:0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag>
|
<el-tag v-else-if="row[col.prop]==2" color="#33cc33" style="color:black;border:0;color:#fff;">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</el-tag>
|
<span v-else>
|
{{ row[col.prop] }}
|
</span>
|
</template>
|
</template>
|
<!-- 单据类型 -->
|
<template v-else-if="col.prop=='wayBillType'">
|
<template>
|
<el-tag v-if="row[col.prop]=='仓配单'" color="#ffff33" style="color:black;border:0">
|
{{ row[col.prop] }}
|
</el-tag>
|
</template>
|
</template>
|
<!--图片列处理-->
|
<template v-else-if="['returnImageUrl'].indexOf(col.prop)>=0">
|
<template v-for="(pic, index) in getReturnPicList(row[col.prop])">
|
<img :key="index" :src="BASE_API + pic" class="pic" @click="showReturnPic(pic)">
|
</template>
|
</template>
|
<!-- 连接字段 -->
|
<template v-else-if="col.prop==dataOptions.linkColumn">
|
<el-link type="primary" @click.native="()=>{linkEditor(row[dataOptions.idField]);}">{{ row[col.prop] }}</el-link>
|
</template>
|
<!--托盘号-->
|
<template v-else-if="col.prop == 'plateCode'">
|
{{ row[col.prop] }}
|
<el-button v-if="row['orderStatus']==='已组板'" type="text" @click="()=>{modifyPlateCode([row])}">改</el-button>
|
</template>
|
<template v-else-if="col.dropdown_Id>0">
|
{{ $refs[dataListRef].translateText(col.prop, row[col.prop], col.dropdown_Id) }}
|
</template>
|
<template v-else>
|
<template v-if="['date', 'datetime'].indexOf(col.dataType)>=0 && col.formatter">
|
{{ common.formatDate(row[col.prop], col.formatter) }}
|
</template>
|
<template v-else-if="['byte', 'int32', 'int64', 'decimal', 'double'].indexOf(col.dataType)>=0 && col.formatter">
|
{{ common.formatNumber(row[col.prop], col.formatter) }}
|
</template>
|
<template v-else>
|
{{ row[col.prop] }}
|
</template>
|
</template>
|
</template>
|
<template slot="button-tool2-slot">
|
<el-checkbox v-model="dataOptions.isLoadHisotry" @change="$refs[dataListRef].reload()">查询历史</el-checkbox>
|
</template>
|
</yrt-data-list>
|
<!--数据编辑器Editor-->
|
<yrt-editor :ref="editorRef" :edit-button-click="editButtonClick" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :top.sync="editorOptions.top" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes" :btn-read-only="btnReadOnly" :audit-disabled="auditDisabled" :on-save-before="onSaveBefore" @on-change="onChange" @on-add-load-after="onEditLoadAfter" @on-edit-load-after="onEditLoadAfter" @on-detail-change="onDetailChange" @on-save-after="onSaveAfter">
|
<!--自定义按钮插槽-->
|
<template slot="footer-button-region" slot-scope="{ formData, details }">
|
<!--打印条码按钮-->
|
<el-button :disabled="btnReadOnly.viewPicture" type="success" icon="el-icon-view" @click.native="viewPicture(formData, details)">查看图片</el-button>
|
<el-button v-show="(formData.expressCorpType==11&&formData.expressCode)?true:false" type="success" icon="el-icon-yrt-weibiaoti7" @click.native="getSortingCode(formData, details)">获取大头笔</el-button>
|
</template>
|
</yrt-editor>
|
|
<!-- 批量审核对话框 -->
|
<el-dialog :visible.sync="showBatchAuditingDialog" title="批量审核" width="500px">
|
<el-form :label-width="formLabelWidth" :model="formDataAudit">
|
<el-form-item label="口岸名称">
|
<el-select v-model="formDataAudit.port_Id" filterable clearable placeholder="请选择口岸名称" @change="getExpressCorp(formDataAudit.port_Id)">
|
<el-option v-for="(item, index) in portOptions" :key="index" :label="item.portName" :value="item.port_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递类别">
|
<el-select v-model="formDataAudit.expressCorpType" filterable clearable placeholder="请选择快递类别" @change="changeExpressCorpType(formDataAudit.expressCorpType)">
|
<el-option v-for="(item, index) in expressCorpTypeList" :key="index" :label="item.expressCorpName" :value="item.expressCorpType">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递名称">
|
<el-select v-model="formDataAudit.expressCorp_Id" filterable clearable placeholder="请选择快递名称">
|
<el-option v-for="(item, index) in expressCorpNameList" :key="index" :label="item.expressCorpName" :value="item.expressCorp_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="showBatchAuditingDialog=false">取 消</el-button>
|
<el-button type="primary" @click="saveBatchAuditing">确 定</el-button>
|
</div>
|
</el-dialog>
|
|
<!-- 修改口岸对话框 -->
|
<el-dialog :visible.sync="portDialogVisible" width="500px" title="修改口岸">
|
<el-form :model="formData">
|
<el-form-item label="口岸名称">
|
<el-select v-model="formData.port_Id" placeholder="请选择口岸名称" @change="getExpressCorp(formData.port_Id)">
|
<el-option v-for="item in portOptions" :key="item.port_Id" :label="item.portName" :value="item.port_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递类别">
|
<el-select v-model="formData.expressCorpType" filterable clearable placeholder="请选择快递类别" @change="changeExpressCorpType(formData.expressCorpType)">
|
<el-option v-for="(item, index) in expressCorpTypeList" :key="index" :label="item.expressCorpName" :value="item.expressCorpType">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递名称">
|
<el-select v-model="formData.expressCorp_Id" filterable clearable placeholder="请选择快递名称">
|
<el-option v-for="(item, index) in expressCorpNameList" :key="index" :label="item.expressCorpName" :value="item.expressCorp_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="portDialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="saveUpdatePort">确 定</el-button>
|
</div>
|
</el-dialog>
|
|
<!-- 溢装处理对话框 -->
|
<el-dialog :visible.sync="overloading" width="500px" title="溢装处理">
|
<el-form :model="formDataOverload">
|
<el-form-item label="口岸名称">
|
<el-select v-model="formDataOverload.port_Id" placeholder="请选择口岸名称" @change="getExpressCorp(formDataOverload.port_Id)">
|
<el-option v-for="item in portOptions" :key="item.port_Id" :label="item.portName" :value="item.port_Id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递类别">
|
<el-select v-model="formDataOverload.expressCorpType" filterable clearable placeholder="请选择快递类别" @change="changeExpressCorpType(formDataOverload.expressCorpType)">
|
<el-option v-for="(item, index) in expressCorpTypeList" :key="index" :label="item.expressCorpName" :value="item.expressCorpType">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="快递名称">
|
<el-select v-model="formDataOverload.expressCorp_Id" filterable clearable placeholder="请选择快递名称">
|
<el-option v-for="(item, index) in expressCorpNameList" :key="index" :label="item.expressCorpName" :value="item.expressCorp_Id">
|
</el-option>
|
</el-select>
|
<el-checkbox v-model="formDataOverload.getExpressCode">从接口重新获取快递单号</el-checkbox>
|
</el-form-item>
|
<el-form-item label="航空主单号">
|
<el-input v-model="formDataOverload.voyageCode">
|
</el-input>
|
</el-form-item>
|
<el-form-item label="托盘号">
|
<el-input v-model="formDataOverload.plateCode">
|
</el-input>
|
</el-form-item>
|
<el-form-item label="运单状态">
|
<el-select :disabled="!formDataOverload.isValidateProductCode" v-model="formDataOverload.orderStatusName" filterable clearable placeholder="请选择运单状态">
|
<el-option v-for="(item, index) in orderStatusNameList" :key="index" :label="item.orderStatusName" :value="item.orderStatusName">
|
</el-option>
|
</el-select>
|
<span class="sub-item">
|
<span class="sub-label">更改状态:</span>
|
<el-switch v-model="formDataOverload.isValidateProductCode"></el-switch>
|
</span>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="overloading = false">取 消</el-button>
|
<el-button type="primary" @click="saveOverloading">确 定</el-button>
|
</div>
|
</el-dialog>
|
|
<el-dialog :visible.sync="dialogLandingTime">
|
<el-form>
|
<el-upload ref="upload" :on-preview="handlePreview" :on-remove="handleRemove" :on-success="handleSuccess" :file-list="fileList" :auto-upload="true" :action="upLoadUrl()" :limit="1" class="upload-bill">
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitImport()">开始导入</el-button>
|
<el-button style="margin-left: 10px;" size="small" type="primary" plain>
|
<a :href="common.ossDomain+'/node-wms/template/运单信息批量修改模板.xlsx'" style="color:while;font-size:12px;">下载模板</a>
|
</el-button>
|
<div slot="tip" class="el-upload__tip">只能上传扩展名为.xlsx的excel文件</div>
|
</el-upload>
|
<el-scrollbar :noresize="false" :native="false" wrap-class="scrollbar-wrap">
|
<ul class="msg-container">
|
<li v-for="(item, index) in msgList" :key="index" class="msg-item" v-html="item">
|
{{ index + 1 }}、{{ item }}
|
</li>
|
</ul>
|
</el-scrollbar>
|
</el-form>
|
<!-- <div class="margin-10" v-html="importMsg">{{ importMsg }}</div> -->
|
<div slot="footer" class="dialog-footer">
|
<!-- <el-button type="primary" @click="EditlogLandingTimesave">确 定</el-button> -->
|
</div>
|
</el-dialog>
|
|
<!--预览图片-->
|
<el-dialog v-dialogDrag :visible.sync="dialogPicVisible" :modal="false" :append-to-body="true" class="pic-dialog">
|
<img :src="dialogImageUrl" style="max-width:100%;">
|
</el-dialog>
|
|
<!--明细选择器-->
|
<yrt-selector ref="selector-dialog" :config="selectorConfig" :visible.sync="selectorConfig.visible" @on-selected="onSelected"></yrt-selector>
|
|
<!--退货预览图片-->
|
<el-dialog :visible.sync="dialogReturnPicVisible" :append-to-body="true">
|
<img :src="dialogReturnImageUrl" style="max-width:100%;">
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
import stateFlow from "./components/stateflow.vue";
|
import yrtSelector from "@/components/common/yrtSelector.vue";
|
import * as moment from "moment";
|
|
export default {
|
name: "tms-way-bill",
|
components: {
|
yrtSelector,
|
stateFlow
|
},
|
mixins: [baseLayout],
|
data() {
|
return {
|
// 弹出导入框
|
dialogLandingTime: false,
|
fileList: [],
|
// 导入消息
|
importMsg: null,
|
fileUrl: null,
|
// 消息内容
|
msgList: [],
|
// 导入获得消息interval handle
|
intervalHandler: null,
|
// 导入key
|
uploadKey: null,
|
// 选择器配置参数
|
selectorConfig: {
|
title: "物料选择器",
|
width: "1000px",
|
visible: false,
|
// 配置路由
|
router: "/selector/s-product-selector"
|
},
|
// 修改口岸对话框数据集合
|
formData: {
|
port_Id: null,
|
expressCorp_Id: null,
|
expressCorpType: null
|
},
|
// 审核对话框数据集合
|
formDataAudit: {
|
port_Id: null,
|
expressCorp_Id: null,
|
expressCorpType: null
|
},
|
// 溢装处理对话框数据集合
|
formDataOverload: {
|
isValidateProductCode: true,
|
orderStatusName: null,
|
code: null,
|
port_Id: null,
|
expressCorp_Id: null,
|
expressCorpType: null,
|
voyageCode: null,
|
plateCode: null,
|
getExpressCode: false
|
},
|
expressCorpoptions: null,
|
// 列表固定条件
|
// fixedWhere: {orderStatus: {operator: "!=", value: '新建'}}",
|
// 分配快递公司对话框
|
showBatchAuditingDialog: false,
|
// 显示口岸对话框
|
portDialogVisible: false,
|
formLabelWidth: "120px",
|
//
|
overloading: false,
|
// 快递类别下拉框数据列表
|
expressCorpTypeList: [],
|
// 快递名称下拉框数据列表
|
expressCorpNameList: [],
|
// 运单状态列表
|
orderStatusNameList: [
|
{
|
status_Id: "0",
|
orderStatusName: "航空已发运"
|
},
|
{
|
status_Id: "1",
|
orderStatusName: "航班到达"
|
},
|
{
|
status_Id: "2",
|
orderStatusName: "清关中"
|
}
|
],
|
expressCorpType: "",
|
expressCorpName: "",
|
expressCorp_Id: "",
|
dialogPortName: false,
|
// 域名地址
|
BASE_API: process.env.BASE_API,
|
ALI_API: this.common.ossDomain,
|
// 口岸名称下拉框数据列表
|
portOptions: [],
|
wayBill_Ids: [], // 运单ID
|
portName: "",
|
form: {
|
voyageCode: "",
|
region: "",
|
date1: "",
|
date2: "",
|
delivery: false,
|
type: [],
|
resource: "",
|
desc: ""
|
},
|
// 状态流加载参数
|
stateLoadOptions: {
|
folder: "express/tms",
|
projectName: "Interface.Express",
|
tableView: "TMS_WayBillTracking",
|
idField: "wayBillTracking_Id",
|
sortName: "wayBillTracking_Id DESC",
|
pageIndex: 1,
|
pageSize: 100,
|
menu_Id: -1
|
},
|
// 状态值
|
statusValueList: [
|
{
|
status: "审核成功",
|
bgColor: "#00ff99",
|
color: "black"
|
},
|
{
|
status: "新建",
|
bgColor: "#ffff66",
|
color: "#000"
|
},
|
{
|
status: "已提交",
|
bgColor: "#cc99ff",
|
color: "#fff"
|
},
|
{
|
status: "已组板",
|
bgColor: "#ffcc66",
|
color: "#fff"
|
},
|
{
|
status: "录入异常",
|
bgColor: "#ff6600",
|
color: "#fff"
|
},
|
{
|
status: "组板异常",
|
bgColor: "#ff6600",
|
color: "#fff"
|
},
|
{
|
status: "已退货",
|
bgColor: "#ff9966",
|
color: "#fff"
|
},
|
{
|
status: "航空已发运",
|
bgColor: "#00cccc",
|
color: "#fff"
|
},
|
{
|
status: "取消组板",
|
bgColor: "#cc6633",
|
color: "#fff"
|
},
|
{
|
status: "已签收",
|
bgColor: "#009900",
|
color: "#fff"
|
},
|
{
|
status: "航班到达",
|
bgColor: "#6699cc",
|
color: "#fff"
|
},
|
{
|
status: "终止",
|
bgColor: "#ff6600",
|
color: "#fff"
|
},
|
{
|
status: "待中转",
|
bgColor: "#ffff33",
|
color: "#000"
|
},
|
{
|
status: "未揽收",
|
bgColor: "#ffff33",
|
color: "#000"
|
},
|
{
|
status: "已入库",
|
bgColor: "#00cc00",
|
color: "#fff"
|
},
|
{
|
status: "已卸车",
|
bgColor: "#11C2EE",
|
color: "#fff"
|
},
|
{
|
status: "待配送",
|
bgColor: "#806B1A",
|
color: "#fff"
|
},
|
{
|
status: "提货中",
|
bgColor: "#00cc00",
|
color: "#fff"
|
},
|
{
|
status: "配送中",
|
bgColor: "#00cc00",
|
color: "#fff"
|
}
|
],
|
// 导航筛选条件
|
tabNavList: [],
|
dialogPicVisible: false, // 图片弹框
|
dialogImageUrl: null, // 图片URL
|
dialogReturnPicVisible: false, // 退货图片弹框
|
dialogReturnImageUrl: null, // 退货图片URL
|
editStartDate: null // 编辑开始时时间,不允许超过10分钟
|
};
|
},
|
mounted() {
|
this.uploadKey = this.common.getGUID();
|
var addListString = localStorage.getItem("addList");
|
if (addListString) {
|
var the = this;
|
var addList = JSON.parse(addListString);
|
window.setTimeout(function() {
|
the.dataList.addSearchFields(addList);
|
the.dataList.loadData();
|
}, 1000);
|
localStorage.removeItem("addList");
|
}
|
this.getPortList();
|
this.getExpressCorpList();
|
// this.multiDistributionExpress(); // 获取快递下拉框值
|
},
|
methods: {
|
// 编辑器保存时事件
|
editButtonClick(authNode) {
|
switch (authNode) {
|
case "save":
|
// 审核
|
alert(123);
|
return false;
|
}
|
},
|
// 点击文件时的钩子
|
handlePreview(file) {},
|
handleRemove(file, fileList) {
|
this.fileUrl = null;
|
},
|
// 上传附件Url
|
upLoadUrl: function() {
|
var domain = this.common.domain;
|
return domain + "/api/common/uploadSingleFile";
|
},
|
// 上传成功后
|
handleSuccess(res, file) {
|
this.common.showMsg("上传成功!");
|
this.fileUrl = res.data.url;
|
},
|
// 状态背景颜色
|
setStatusBgColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var bgColor = "#ffffff";
|
if (colorItem) bgColor = colorItem.bgColor;
|
|
return bgColor;
|
},
|
// 状态字体颜色
|
setStatusColor(status) {
|
var colorItem = this.statusValueList.find(item => {
|
return item.status === status;
|
});
|
var color = "#888";
|
if (colorItem) color = colorItem.color;
|
|
return {
|
border: 0,
|
color: color,
|
cursor: "pointer"
|
};
|
},
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "batchAuditing":
|
// 批量审核
|
return this.showMultiAuditingDialog();
|
case "returngoods":
|
// 批量退货
|
this.multiReturngoods();
|
return false;
|
case "cancelReturn":
|
// 批量取消退货
|
this.multiCancelReturn();
|
return false;
|
case "distributionExpress":
|
// 批量分配快递
|
this.multiDistributionExpress();
|
return false;
|
case "upPort":
|
// 修改口岸
|
this.showUpdatePortDialog();
|
return false;
|
case "cancelpanel":
|
// 取消组板
|
this.cancelpanel();
|
return false;
|
case "xiAnExport":
|
// 西安口岸导出
|
this.exportxian();
|
return false;
|
case "beijingExport":
|
// 北京口岸导出
|
this.exportbeijing();
|
return false;
|
case "fuzhouExport":
|
// 福州口岸导出
|
this.exportfuzhou();
|
return false;
|
case "jinjiangExport":
|
// 晋江口岸导出
|
this.exportjinjiang();
|
return false;
|
case "guangzhouExport":
|
// 广州口岸导出
|
this.exportguangzhou();
|
return false;
|
case "xiamenExport":
|
// 厦门口岸导出
|
this.exportxiamen();
|
return false;
|
case "modifyPlateCode":
|
// 批量修改托盘号
|
this.modifyPlateCode(this.dataListSelections);
|
return false;
|
case "overloading":
|
// 溢装处理
|
this.showOverloading();
|
return false;
|
case "billCodeContExport":
|
// 运单快递统计导出
|
this.exportBillCodeCont();
|
return false;
|
case "batchOpen":
|
// 批量开启
|
this.multiBatchOpen();
|
return true;
|
case "batchStop":
|
// 批量终止
|
this.multiBatchStop();
|
return true;
|
case "importUpdate":
|
// 导入修改
|
this.allImport();
|
return false;
|
case "synchroSfAddress":
|
this.synchroSfAddress();
|
return true;
|
}
|
},
|
// 保存事件
|
onSaveAfter() {},
|
// 明细字段改变
|
onDetailChange(ref, val, row, field) {
|
// 合计数量求和
|
let totalQuantityOrder = 0;
|
let grandTotal = 0.0;
|
// 物料数量合计
|
var totalQuantityProducts = 0;
|
|
var formData = this.editor.formData;
|
var detailRows = formData["TMS_WayBillList"].rows;
|
detailRows.forEach(item => {
|
if (item.quantityOrder !== null || item.salePrice !== null) {
|
// 行金额
|
item.rowTotal = Math.Round(item.quantityOrder * item.salePrice, 2);
|
}
|
if (field) {
|
if (field.prop === "quantityOrder" || field.prop === "weight") {
|
item.grossWeight = item.quantityOrder * item.weight;
|
}
|
}
|
totalQuantityProducts += item.quantityOrder;
|
// totalQuantityOrder += item.Quantity;
|
totalQuantityOrder += item.quantityOrder;
|
grandTotal += item.rowTotal;
|
});
|
|
this.editor.changeValue("totalQuantityProducts", totalQuantityProducts);
|
this.editor.changeValue("totalQuantityOrder", parseInt(totalQuantityOrder));
|
this.editor.changeValue("grandTotal", Math.Round(grandTotal, 2));
|
},
|
// 将选择器选择中的数据填充到明细表中
|
onSelected(rows) {
|
this.editor.addDetailDataRow(rows);
|
this.selectorConfig.visible = false;
|
},
|
// 明细添加
|
detailAdd() {
|
this.selectorConfig.visible = true;
|
this.$refs["selector-dialog"].setSearchValue("provider_Id", []);
|
this.$refs["selector-dialog"].loadData();
|
},
|
// 取消组板
|
cancelpanel() {
|
var isOrderStatus = true; // 运单状态
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
if (item.orderStatus !== "已组板") {
|
isOrderStatus = false;
|
} else {
|
isOrderStatus = true;
|
}
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return false;
|
}
|
this.wayBill_Ids = selectIDs;
|
if (isOrderStatus === false) {
|
this.$message({
|
message: "已组板后才能取消!",
|
type: "warning"
|
});
|
return false;
|
}
|
this.$prompt("确定要批量取消组板操作吗", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消"
|
})
|
.then(({ value }) => {
|
// 获得已选中的ID
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
return item.wayBill_Id;
|
});
|
const url = "/api/tms/wayBill/cancelpanel";
|
const params = {
|
ids: selectIDs,
|
value: value
|
};
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res);
|
const ref = this.dataList;
|
if (res.result) {
|
ref.loadData();
|
}
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "取消输入"
|
});
|
});
|
},
|
// 显示批量审核对话框
|
showMultiAuditingDialog() {
|
this.formDataAudit = {};
|
// 获得已选中的ID
|
var isOrderStatus = true; // 运单状态
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
if (
|
item.orderStatus === "已提交" ||
|
// item.orderStatus === "组板异常" ||
|
item.orderStatus === "处理中" ||
|
item.orderStatus === "处理完成"
|
) {
|
isOrderStatus = true;
|
} else {
|
isOrderStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return false;
|
}
|
this.wayBill_Ids = selectIDs;
|
if (isOrderStatus === false) {
|
this.$message({
|
message: "只有运单状态为已提交、处理中、处理完成的运单才允许操作审核!",
|
type: "warning"
|
});
|
return false;
|
}
|
this.showBatchAuditingDialog = true;
|
|
return true;
|
},
|
// 批量审核
|
saveBatchAuditing() {
|
const expressCorp_Id = this.formDataAudit.expressCorp_Id;
|
if (!expressCorp_Id) {
|
this.$message({
|
message: "请先选择快递名称!",
|
type: "warning"
|
});
|
return;
|
}
|
const url = "/api/tms/wayBill/batchAuditingTms";
|
const params = {
|
wayBill_Ids: this.wayBill_Ids,
|
expressCorp_Id: this.formDataAudit.expressCorp_Id,
|
expressCorpType: this.formDataAudit.expressCorpType,
|
port_Id: this.formDataAudit.port_Id
|
};
|
const ref = this.dataList;
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
// 关闭弹出框
|
this.showBatchAuditingDialog = false;
|
this.wayBill_Ids = "";
|
ref.loadData();
|
|
// 重置选中项
|
this.expressCorp_Id = null;
|
this.expressCorpType = null;
|
this.expressCorpName = null;
|
this.portName = null;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 级联改变数据
|
onChange(ref, val, field, formData) {
|
// 所有状态都可以编辑
|
// this.editorOptions.config.disabled = false;
|
|
var editor = this.editor;
|
if (field.options.prop === "portName") {
|
var url = "/api/tms/wayBill/getGoodsRegion";
|
var parsms = {
|
portName: formData.portName
|
};
|
this.common.ajax(url, parsms, res => {
|
if (res.result) {
|
editor.formData.planDropOffPort = res.data.RegionName; // 落口名称
|
}
|
});
|
}
|
|
// 省市区联动
|
if (field.options.prop === "provinceName") {
|
formData.city_Id = null;
|
formData.cityName = null;
|
// 设置表单数据
|
const item = ref.getOption(val);
|
// 改变市级下拉框
|
this.loadChildrenNode(item.value, 614, field.options.prop);
|
} else if (field.options.prop === "cityName") {
|
formData.region_Id = null;
|
formData.regionName = null;
|
// 设置表单数据
|
const item = ref.getOption(val);
|
// 改变区级下拉框
|
this.loadChildrenNode(item.value, 615, field.options.prop);
|
} else if (field.options.prop === "regionName") {
|
const item = ref.getOption(val);
|
this.loadChildrenNode(item.value, 615, field.options.prop);
|
}
|
},
|
// 根据省ID获得市
|
loadChildrenNode(id, dropdown_Id, prop) {
|
var editorRef = this.$refs[this.editorRef];
|
|
var where = { parentId: id };
|
var url = "/api/common/loadTreeNode";
|
var params = {
|
openNodeApi: true,
|
folder: "basicInfo/base",
|
DBServer: "Sys",
|
tableName: "Base_City",
|
tableView: "Base_City",
|
keyName: "city_Id",
|
nodeName: "cityName",
|
fixHasChild: false,
|
isBreakWay: false,
|
displayBreakWay: false,
|
parentName: "parentId",
|
orderBy: "orderNo desc, city_Id",
|
where: where,
|
extendColumns: ""
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
if (res.result) {
|
var data = res.data.map(item => {
|
if (prop === "provinceName") {
|
const newItem = {
|
city_Id: item.value,
|
cityName: item.label,
|
value: item.value,
|
label: item.label
|
};
|
return newItem;
|
} else if (prop === "cityName") {
|
const newItem = {
|
region_Id: item.value,
|
regionName: item.label,
|
value: item.value,
|
label: item.label
|
};
|
return newItem;
|
}
|
});
|
editorRef.setDropdownData(dropdown_Id, data);
|
} else {
|
this.$message.error(res.msg);
|
}
|
},
|
true
|
);
|
},
|
// 批量退货操作
|
multiReturngoods() {
|
this.$prompt("确定要批量进行退货操作吗? 请输入退货原因:", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消"
|
})
|
.then(({ value }) => {
|
// 获得已选中的ID
|
// var IsOrderType = ""; // 运单类型=仓配,=直邮
|
var isOrderStatus = ""; // 可操作状态
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
// IsOrderType = item.OrderType;
|
isOrderStatus = item.orderStatus;
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
const statusList = ["新建", "已提交", "面单已录入", "审核成功", "录入异常", "组板异常", "取消组板"];
|
if (statusList.indexOf(isOrderStatus) >= 0) {
|
this.updateOrderStatus(selectIDs, value);
|
} else {
|
this.$message({
|
message: "提交的数据订单状态不符合直邮退货条件!",
|
type: "warning"
|
});
|
return;
|
}
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
},
|
// 修改满足条件数据的退货状态
|
updateOrderStatus(selectIDs, value) {
|
const url = "/api/tms/wayBill/billReturnGoods";
|
const params = {
|
ids: selectIDs,
|
abnormalReason: value
|
};
|
const ref = this.dataList;
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
this.common.ajax(url, params, callback, ref);
|
},
|
// 批量取消退货
|
multiCancelReturn() {
|
this.$confirm("确定要批量取消退货操作吗?", "批量取消退货", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
// 获得已选中的ID
|
var isOrderStatus = true; // 运单状态
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
if (item.orderStatus !== "已退货") {
|
isOrderStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (selectIDs === "") {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isOrderStatus) {
|
this.$message({
|
message: "运单状态为已退货才能取消退货!",
|
type: "warning"
|
});
|
return;
|
}
|
const url = "/api/tms/wayBill/billmultiCancelReturn";
|
const params = {
|
ids: selectIDs
|
};
|
const ref = this.dataList;
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
this.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
},
|
// 选择口岸之后获取关联的快递类别
|
getExpressCorp(port_Id) {
|
// this.expressCorpTypeList = [];
|
const url = "/api/basicInfo/base/expressCorp/getWayBillExpressCorpType";
|
const params = {
|
port_Id: port_Id
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
// 批量审核
|
this.formDataAudit.expressCorpType = null;
|
this.formDataAudit.expressCorp_Id = null;
|
// 修改口岸
|
this.formData.expressCorpType = null;
|
this.formData.expressCorp_Id = null;
|
// 溢装处理
|
this.formDataOverload.expressCorpType = null;
|
this.formDataOverload.expressCorp_Id = null;
|
this.expressCorpTypeList = res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 获取快递类别下拉框值
|
multiDistributionExpress() {
|
const url = "/api/basicInfo/base/expressCorp/getExpressCorpType";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
this.expressCorpTypeList = res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 选择快递单号后加载快递名称
|
changeExpressCorpType(value) {
|
const expressCorpType = value;
|
const url = "/api/basicInfo/base/expressCorp/getList";
|
const params = {
|
expressCorpType: expressCorpType
|
};
|
this.expressCorpName = "";
|
this.formData.expressCorp_Id = "";
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.expressCorpNameList = res.data;
|
|
this.formData.expressCorpName = this.expressCorpNameList[0].expressCorpName;
|
this.formData.expressCorp_Id = this.expressCorpNameList[0].expressCorp_Id;
|
|
this.formDataAudit.expressCorpName = this.expressCorpNameList[0].expressCorpName;
|
this.formDataAudit.expressCorp_Id = this.expressCorpNameList[0].expressCorp_Id;
|
|
this.formDataOverload.expressCorpName = this.expressCorpNameList[0].expressCorpName;
|
this.formDataOverload.expressCorp_Id = this.expressCorpNameList[0].expressCorp_Id;
|
} else {
|
this.expressCorpNameList = [];
|
}
|
});
|
},
|
// 选择弹框的快递名称后赋值
|
currentCorpName(value) {
|
this.expressCorp_Id = value;
|
this.expressCorpNameList.forEach(item => {
|
if (item.expressCorp_Id === value) {
|
this.expressCorpName = item.expressCorpName;
|
}
|
});
|
},
|
// 下拉框加载后事件
|
onLoadDropdownAfter(dropdownData) {
|
// 将前三个值移到后面
|
// var removeItems = dropdownData["dropdown934"].splice(0, 3);
|
// var dropdown934 = dropdownData["dropdown934"].concat(removeItems);
|
|
// // 处理tabsNav - 状态
|
// this.tabNavList.push({
|
// type: "radio", // checkbox=多选, radio=单选
|
// field: "orderStatus",
|
// items: dropdown934,
|
// showCount: 8, // 显示平铺项个数
|
// value: null // 选中值:当type=radio时value为数组,当type=checkbox时value为字符串
|
// });
|
// // 处理tabsNav - 货主
|
// this.tabNavList.push({
|
// type: "radio", // checkbox=多选, radio=单选
|
// field: "ConsignorName",
|
// items: dropdownData["dropdown797"],
|
// showCount: 6, // 显示平铺项个数
|
// value: null // 选中值:当type=radio时value为数组,当type=checkbox时value为字符串
|
// });
|
// 弹出框
|
this.dialogPortName = true;
|
},
|
// 修改口岸弹出对话框
|
showUpdatePortDialog() {
|
this.formData = {};
|
let isok = true;
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
return item.wayBill_Id;
|
});
|
const orderStatus = this.dataListSelections.map((item, index, Array) => {
|
return item.orderStatus;
|
});
|
if (!selectIDs.length) {
|
this.$message.error("请至少选择一行数据!");
|
return false;
|
}
|
this.wayBill_Ids = selectIDs;
|
orderStatus.forEach(rowData => {
|
if (rowData !== "审核成功" && rowData !== "处理中" && rowData !== "组板异常" && rowData !== "取消组板") {
|
isok = false;
|
}
|
});
|
if (isok === false) {
|
this.$message.error("只有审核成功,取消组板,处理中或者组板异常才可以修改口岸!");
|
return false;
|
} else {
|
this.portDialogVisible = true;
|
this.formData = {
|
port_Id: null,
|
expressCorp_Id: null,
|
expressCorpType: null
|
};
|
}
|
},
|
// 修改口岸
|
saveUpdatePort() {
|
if (!this.formData.port_Id) {
|
this.$message.error("请选择口岸!");
|
return;
|
}
|
|
if (!this.formData.expressCorpType) {
|
this.$message.error("请选择快递类型!");
|
return;
|
}
|
|
if (!this.formData.expressCorp_Id) {
|
this.$message.error("请选择快递!");
|
return;
|
}
|
|
const params = {
|
wayBill_Ids: this.wayBill_Ids,
|
port_Id: this.formData.port_Id, // 口岸
|
expressCorp_Id: this.formData.expressCorp_Id, // 快递
|
expressCorpType: this.formData.expressCorpType // 快递类型
|
};
|
const url = "/api/tms/wayBill/updatePort";
|
const ref = this.dataList;
|
const callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.portDialogVisible = false;
|
ref.loadData();
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 获取口岸下拉框
|
getPortList() {
|
const url = "/api/basicInfo/base/port/getList";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
this.portOptions = res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 获快递下拉框
|
getExpressCorpList() {
|
const url = "/api/basicInfo/base/expressCorp/getList";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
this.expressCorpoptions = res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 溢装处理弹出对话框
|
showOverloading() {
|
this.formDataOverload = {};
|
var isok = true;
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
return item.wayBill_Id;
|
});
|
const orderStatus = this.dataListSelections.map((item, index, Array) => {
|
return item.orderStatus;
|
});
|
if (!selectIDs.length) {
|
this.$message.error("请至少选择一行数据!");
|
return false;
|
}
|
this.wayBill_Ids = selectIDs;
|
orderStatus.forEach(rowData => {
|
if (rowData !== "已组板" && rowData !== "航空已发运" && rowData !== "航班到达" && rowData !== "清关中") {
|
isok = false;
|
}
|
});
|
if (isok === false) {
|
this.$message.error("只有已组板,航空已发运,航班到达或者清关中才可以操作溢装处理!");
|
return false;
|
} else {
|
this.overloading = true;
|
this.formDataOverload = {
|
port_Id: null,
|
expressCorp_Id: null,
|
expressCorpType: null,
|
getExpressCode: false
|
};
|
}
|
},
|
// 修改溢装
|
saveOverloading() {
|
if (!this.formDataOverload.port_Id) {
|
this.$message.error("请选择口岸!");
|
return;
|
}
|
|
if (!this.formDataOverload.expressCorpType) {
|
this.$message.error("请选择快递类型!");
|
return;
|
}
|
|
if (!this.formDataOverload.expressCorp_Id) {
|
this.$message.error("请选择快递!");
|
return;
|
}
|
if (this.formDataOverload.isValidateProductCode === false) {
|
this.formDataOverload.orderStatusName = null;
|
}
|
if (this.formDataOverload.getExpressCode === true) {
|
var IsGouxuan = 1;
|
} else {
|
IsGouxuan = 0;
|
}
|
// var formData = this.editor.formDataOverload;
|
const params = {
|
wayBill_Ids: this.wayBill_Ids,
|
port_Id: this.formDataOverload.port_Id, // 口岸
|
expressCorp_Id: this.formDataOverload.expressCorp_Id, // 快递
|
expressCorpType: this.formDataOverload.expressCorpType, // 快递类型
|
voyageCode: this.formDataOverload.voyageCode, // 航空主单号
|
plateCode: this.formDataOverload.plateCode, // 托盘号
|
IsGouxuan: IsGouxuan,
|
// 运单状态
|
orderStatus: this.formDataOverload.orderStatusName
|
};
|
const url = "/api/tms/wayBill/saveOverloading";
|
const ref = this.dataList;
|
const callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.overloading = false;
|
ref.loadData();
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 导出身份证
|
exportIdCard() {
|
if (!this.dataListSelections.length) {
|
this.$message.error("至少选中一行!");
|
return;
|
}
|
var isOrderStatus = true; // 运单状态
|
const selectIDs = this.dataListSelections.map((item, index, Array) => {
|
if (item.orderStatus === "终止") {
|
isOrderStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (isOrderStatus === false) {
|
this.$message({
|
message: "已终止的运单不允许进行操作!",
|
type: "warning"
|
});
|
return false;
|
}
|
var formData = this.editor.formData;
|
const url = "/api/TMS_WayBill/ExportIdCard";
|
const params = {
|
ids: selectIDs,
|
port_Id: formData.port_Id,
|
wayBillCode: formData.wayBillCode
|
};
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + res.data.url);
|
}
|
},
|
this.dataList
|
);
|
},
|
// 西安导出
|
exportxian() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
// where.push({
|
// prop: "wayBill_Id",
|
// value: ids
|
// });
|
var url = "/api/tms/wayBill/exportXianDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
const url = this.common.domain + "/api/common/download?url=" + res.data.url;
|
window.open(url);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 北京导出
|
exportbeijing() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// where.push({
|
// prop: "wayBill_Id",
|
// value: ids
|
// });
|
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
var url = "/api/tms/wayBill/exportBeijinDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
// const url =
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url);
|
// const url =
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url2);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 福州导出
|
exportfuzhou() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
// where.push({
|
// prop: "wayBill_Id",
|
// value: ids
|
// });
|
var url = "/api/tms/wayBill/exportFuzhouDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url);
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url2);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 晋江导出
|
exportjinjiang() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
// where.push({
|
// prop: "wayBill_Id",
|
// value: ids
|
// });
|
var url = "/api/tms/wayBill/exportjinjiangDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url);
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url2);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 广州导出
|
exportguangzhou() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
var url = "/api/tms/wayBill/exportguangzhouDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 厦门导出
|
exportxiamen() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
var url = "/api/tms/wayBill/exportxiamenDeclaration";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url2);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 运单快递统计导出
|
exportBillCodeCont() {
|
var where = this.dataList.getAllWhere();
|
const ids = this.dataListSelections.map(item => item.wayBill_Id);
|
// 如果勾选了,将勾选的条件覆盖筛选条件
|
if (ids.length) {
|
where = [
|
{
|
prop: "wayBill_Id",
|
value: ids
|
}
|
];
|
}
|
var url = "/api/tms/wayBill/exportBillCodeCont";
|
const params = {
|
idField: "wayBill_Id",
|
operator: "=",
|
where: where
|
};
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
window.open(this.common.domain + "/api/common/download?url=" + res.data.url);
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
viewPicture(formData, details) {
|
var url = "/api/tms/wayBill/getWayBillPruture";
|
var params = { wayBillCode: formData.wayBillCode };
|
this.common.ajax(url, params, res => {
|
if (res.result) {
|
if (!res.data) {
|
this.$message.error("图片不存在");
|
return;
|
}
|
this.dialogPicVisible = true; // 图片弹框
|
this.dialogImageUrl = this.ALI_API + res.data.filePath + "?x-oss-process=style/big";
|
}
|
});
|
},
|
// 获取大头笔
|
getSortingCode(formData, details) {
|
var url = "/api/tms/wayBill/getSortingCode";
|
var parsms = { wayBill_Id: formData.wayBill_Id };
|
this.common.ajax(url, parsms, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.editor.reload();
|
this.dataList.reload();
|
}
|
});
|
},
|
// 测试自动获取快递单号 AutoGetExpressCode
|
AutoGetExpressCode() {
|
var url = "/api/Base_ExpressSpareCode/AutoGetExpressCode";
|
const params = {};
|
var callback = res => {
|
this.common.showMsg(res);
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 数据加载后事件
|
onEditLoadAfter(formData) {
|
if (formData.orderStatus === "终止") {
|
// 不可以编辑
|
this.editorOptions.config.disabled = true; // 整个对话框不可编辑
|
} else {
|
this.editorOptions.config.disabled = false; // 整个对话框可编辑
|
}
|
// 记录编辑开始时间
|
this.editStartDate = new Date();
|
},
|
// 保存前事件
|
onSaveBefore() {
|
var formData = this.editor.formData;
|
const dataList = formData["TMS_WayBillList"].rows;
|
|
var totalQuantityProducts = 0;
|
dataList.forEach(item => {
|
totalQuantityProducts += item.quantityOrder;
|
});
|
this.editor.changeValue("totalQuantityProducts", totalQuantityProducts);
|
|
const miniutes = moment(new Date()).diff(moment(this.editStartDate), "minutes");
|
if (miniutes > 10) {
|
this.$message.error("编辑打开窗口超时,请关闭编辑窗口重新打开修改");
|
return false;
|
}
|
|
return;
|
},
|
// 批量/单个修改组板信息
|
modifyPlateCode(rows) {
|
// 获得已选中的ID
|
var isOrderStatus = true; // 运单状态
|
const selectIDs = rows.map((item, index, Array) => {
|
if (item.orderStatus !== "已组板") {
|
isOrderStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (selectIDs === "") {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isOrderStatus) {
|
this.$message.error("只有已组板的才能修改托盘号!");
|
return;
|
}
|
|
this.$prompt("请输入新托盘号", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
inputPattern: /\S{2,}/,
|
inputErrorMessage: "托盘号至少2位以上"
|
})
|
.then(({ value }) => {
|
const url = "/api/tms/waybill/modifyPlateCode";
|
const params = {
|
ids: selectIDs,
|
code: value
|
};
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.dataList.reload();
|
}
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "取消输入"
|
});
|
});
|
},
|
// 审核后是否可以编辑处理方法
|
auditDisabled(formData, config) {},
|
// 显示退货大图
|
showReturnPic(pic) {
|
this.dialogReturnPicVisible = true;
|
this.dialogReturnImageUrl = this.BASE_API + pic;
|
},
|
// 将图片字符串转为数组
|
getReturnPicList(pics) {
|
var picList = pics ? pics.split(",") : [];
|
return picList;
|
},
|
// 批量开启操作
|
multiBatchOpen() {
|
const the = this;
|
var isOrderStatus = true;
|
const selectIDs = the.dataListSelections.map((item, index, Array) => {
|
if (item.orderStatus !== "终止") {
|
isOrderStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
this.$confirm("确定要批量进行开启操作吗?", "批量开启", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
// 获得已选中的ID
|
if (isOrderStatus !== true) {
|
this.$message({
|
message: "只有终止的运单才可以开启!",
|
type: "warning"
|
});
|
return;
|
}
|
const url = "/api/tms/wayBill/multiBatchOpen";
|
const params = {
|
ids: selectIDs
|
};
|
const ref = the.dataList;
|
var callback = res => {
|
the.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
the.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
the.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
}, // 批量修改导入
|
allImport() {
|
this.dialogLandingTime = true;
|
},
|
// 导入
|
submitImport() {
|
// this.importMsg = null;
|
if (!this.fileUrl) {
|
this.$message.error("请上传文件!");
|
return;
|
}
|
const url = "/api/tms/wayBill/importExel";
|
const params = {
|
url: this.fileUrl,
|
key: this.uploadKey
|
// StorageName: StorageName
|
};
|
var callback = res => {
|
if (res.result) {
|
window.clearTimeout(this.intervalHandler);
|
this.intervalHandler = false;
|
this.getMsg();
|
this.fileList = [];
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 获得导入消息
|
getMsg() {
|
// 获得同步消息
|
const url = "/api/common/getUploadMsg";
|
const params = {
|
openNodeApi: true,
|
key: this.uploadKey
|
};
|
// const ref = this.dataList;
|
var callBack = res => {
|
if (!res.result) {
|
window.clearTimeout(this.intervalHandler);
|
this.intervalHandler = false;
|
if (Array.isArray(res.data)) {
|
this.msgList = this.msgList.concat(res.data);
|
}
|
return;
|
}
|
if (Array.isArray(res.data)) {
|
this.msgList = this.msgList.concat(res.data.filter(item => item !== "-1"));
|
}
|
if (res.data.indexOf("-1") >= 0) {
|
window.clearTimeout(this.intervalHandler);
|
this.intervalHandler = null;
|
return;
|
}
|
this.intervalHandler = window.setTimeout(this.getMsg, 1000);
|
};
|
this.common.ajax(url, params, callBack, true, this.$refs.uploadRef);
|
},
|
// 批量终止操作
|
multiBatchStop() {
|
const the = this;
|
var isOrderStatus = true;
|
var isCollectStatus = true;
|
const selectIDs = the.dataListSelections.map((item, index, Array) => {
|
if (item.orderStatus !== "新建" && item.orderStatus !== "已提交") {
|
isOrderStatus = false;
|
}
|
if (item.CollectStatus === "已揽收") {
|
isCollectStatus = false;
|
}
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
this.$confirm("确定要批量进行终止操作吗?", "批量终止", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
// 获得已选中的ID
|
if (isOrderStatus !== true) {
|
this.$message({
|
message: "只有新建或已提交的运单才可以终止!",
|
type: "warning"
|
});
|
return;
|
}
|
if (isCollectStatus === false) {
|
this.$message({
|
message: "已揽收的运单不允许操作终止!",
|
type: "warning"
|
});
|
return;
|
}
|
const url = "/api/tms/wayBill/multiBatchStop";
|
const params = {
|
ids: selectIDs
|
};
|
const ref = the.dataList;
|
var callback = res => {
|
the.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
the.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
the.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
},
|
// 同步泉州顺丰陆地港信息
|
synchroSfAddress() {
|
const the = this;
|
let msg = "";
|
const selectIDs = the.dataListSelections.map((item, index, Array) => {
|
if (!item.expressCode) {
|
msg += item.wayBillCode + "运单的快递单号不能为空";
|
}
|
if (item.expressCorpName !== "泉州顺丰") {
|
msg += item.wayBillCode + "运单必须是泉州顺丰单";
|
}
|
return item.wayBill_Id;
|
});
|
if (!selectIDs.length) {
|
this.$message({
|
message: "至少选中一行!",
|
type: "warning"
|
});
|
return;
|
}
|
if (msg) {
|
this.$message({
|
message: msg,
|
type: "warning"
|
});
|
return;
|
}
|
this.$confirm("确定要同步选中单据的泉州顺丰陆地港信息吗?", "同步泉州顺丰陆地港", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
const url = "/api/tms/wayBill/synchroSfAddress";
|
const params = {
|
ids: selectIDs
|
};
|
const ref = the.dataList;
|
var callback = res => {
|
the.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
the.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
the.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.page-list-container {
|
min-height: calc(100vh - 110px);
|
overflow: hidden;
|
position: relative;
|
}
|
|
@media screen and (max-height: 900px) {
|
.page-list-container {
|
min-height: 600px;
|
}
|
}
|
</style>
|
|
<style lang="scss">
|
.pic-dialog {
|
position: static !important;
|
top: 0;
|
left: 0;
|
bottom: 800px;
|
.el-dialog {
|
z-index: 1000000;
|
top: 0;
|
left: 0;
|
position: absolute;
|
}
|
}
|
</style>
|