<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-sto-order",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {};
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "btnPushOrder":
|
// 推送至申通平台
|
this.PushOrder();
|
break;
|
case "btnGetRoute":
|
// 获取路由轨迹
|
this.GetRoute();
|
break;
|
// case "btnPushToCustoms":
|
// // 订单下发
|
// this.PushToCustoms();
|
// break;
|
}
|
}, // 订单下发
|
PushToCustoms() {
|
var the = this;
|
var StoOrder_Ids = "";
|
var rows = this.dataListSelections;
|
if (!rows.length) {
|
this.$message({
|
message: "至少选择一项!",
|
type: "warning"
|
});
|
return;
|
}
|
StoOrder_Ids = the.dataListSelections
|
.map((item, index, Array) => {
|
return item.StoOrder_Id;
|
})
|
.join(",");
|
|
this.$confirm("确认要推送选中的数据吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/ExpressSTO_Order/PushToCustoms";
|
var parsms = {
|
StoOrder_Ids: StoOrder_Ids
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 推送至申通平台
|
PushOrder() {
|
var the = this;
|
var stoOrder_Ids = "";
|
|
var rows = this.dataListSelections;
|
if (!rows.length) {
|
this.$message({
|
message: "至少选择一项!",
|
type: "warning"
|
});
|
return;
|
}
|
stoOrder_Ids = the.dataListSelections
|
.map((item, index, Array) => {
|
return item.stoOrder_Id;
|
})
|
.join(",");
|
|
this.$confirm("确认要推送选中的数据吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSTOOrder/pushOrderbySTO";
|
var parsms = {
|
orderIdList: stoOrder_Ids
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 推送至申通平台
|
GetRoute() {
|
var the = this;
|
var stoOrder_Ids = "";
|
|
var rows = this.dataListSelections;
|
if (!rows.length) {
|
this.$message({
|
message: "至少选择一项!",
|
type: "warning"
|
});
|
return;
|
}
|
stoOrder_Ids = the.dataListSelections
|
.map((item, index, Array) => {
|
return item.stoOrder_Id;
|
})
|
.join(",");
|
|
this.$confirm("确认要获取选中数据的路由信息吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSTOOrder/getRouteBySTO";
|
var parsms = {
|
orderIdList: stoOrder_Ids
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
}
|
}
|
};
|
</script>
|