<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">
|
</yrt-data-list>
|
|
<!--数据编辑器Editor-->
|
<yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes"></yrt-editor>
|
</div>
|
</template>
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
|
export default {
|
name: "/api/internal/zt-order",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {};
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "btnGetRoute":
|
// 获取国际路由
|
this.getRoute_GuoJi();
|
break;
|
case "btnGetRouteCN":
|
// 获取路由
|
this.getRoute();
|
break;
|
case "btnPushOrderCN":
|
// 推送订单
|
this.pushOrder();
|
break;
|
case "btnPushOrder":
|
// 推送国际订单
|
this.pushOrder_GuoJi();
|
break;
|
}
|
},
|
// 获取国际路由
|
pushOrder_GuoJi() {
|
const the = this;
|
// var isOK = true;
|
// var orderCode = "";
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, array) => {
|
// if (item.interfaceStatusText !== "待推送") {
|
// orderCode = item.orderCode;
|
// isOK = false;
|
// }
|
return item.zTOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
// if (!isOK) {
|
// this.$message({
|
// message: "选择订单只允许订单状态为“待推送”," + orderCode + "单号不允许选择推送。",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
|
this.$confirm("确定要推送选中的订单信息到中通速递平台吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressZTOrder/getRoute_GuoJi";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(url, parsms, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
});
|
})
|
.catch(action => {});
|
},
|
// 获取路由
|
getRoute() {
|
const the = this;
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, array) => {
|
// return item.TrackingNumber;
|
return item.zTOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
var url = "/api/api/expressZTOrder/getRoute";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(url, parsms, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
});
|
},
|
// 推送订单
|
pushOrder() {
|
const the = this;
|
// var isOK = true;
|
// var orderCode = "";
|
var orderIdList = [];
|
the.dataListSelections.map((item, index, array) => {
|
// if (item.interfaceStatusText !== "待推送") {
|
// orderCode = item.orderCode;
|
// isOK = false;
|
// }
|
orderIdList.push(item.zTOrder_Id);
|
});
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
// if (!isOK) {
|
// this.$message({
|
// message: "选择订单只允许订单状态为“待推送”," + orderCode + "单号不允许选择推送。",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
|
this.$confirm("确定要推送选中的订单信息到中通速递平台吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressZTOrder/pushOrder";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(url, parsms, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
});
|
})
|
.catch(action => {});
|
},
|
// 推送国际订单
|
getRoute_GuoJi() {
|
const the = this;
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, array) => {
|
// return item.TrackingNumber;
|
return item.zTOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
var url = "/api/api/expressZTOrder/pushOrder_GuoJi";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(url, parsms, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
});
|
}
|
}
|
};
|
</script>
|