<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-sf-order",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {};
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "btnGetRoute":
|
// 泉州顺丰获取路由
|
this.GetRoute_FQ();
|
break;
|
case "btnGetTraceNumber":
|
// 泉州顺丰获取快递单号
|
this.PushOrder_FQ();
|
break;
|
case "btnPushOrder":
|
// 推送国际订单 泉州顺丰取消获取的快递单号
|
this.ClearOrder_FQ();
|
break;
|
case "btnHYPushOrder":
|
// 宏远推送订单
|
this.PushOrder_HY();
|
break;
|
case "btnGetRoute_HY":
|
// 宏远获取路由
|
this.GetRoute_HY();
|
break;
|
}
|
},
|
// 获国际取路由
|
GetRoute_GuoJi() {
|
return;
|
// const the = this;
|
// var orderIdList = "";
|
// orderIdList = the.dataListSelections
|
// .map((item, index, Array) => {
|
// return item.sFOrder_Id;
|
// })
|
// .join(",");
|
// if (!orderIdList) {
|
// this.$message({
|
// message: "至少选择一条记录!",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
// this.$confirm("确定要新获得快递单号吗?", "确认信息", {
|
// distinguishCancelAndClose: true,
|
// confirmButtonText: "确认",
|
// cancelButtonText: "取消"
|
// })
|
// .then(() => {
|
// var url = "/api/ExpressSF_Order/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 => {});
|
},
|
// 重新获取国际运单号
|
GetTraceNumber_GuoJi() {
|
return;
|
// const the = this;
|
// var orderIdList = "";
|
// orderIdList = the.dataListSelections
|
// .map((item, index, Array) => {
|
// return item.sFOrder_Id;
|
// })
|
// .join(",");
|
// if (!orderIdList) {
|
// this.$message({
|
// message: "至少选择一条记录!",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
// this.$confirm("确定要新获得快递单号吗?", "确认信息", {
|
// distinguishCancelAndClose: true,
|
// confirmButtonText: "确认",
|
// cancelButtonText: "取消"
|
// })
|
// .then(() => {
|
// var url = "/api/ExpressSF_Order/GetTraceNumber_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_FQ() {
|
const the = this;
|
var orderIdList = "";
|
var orderCode = "";
|
var isFQ = true;
|
orderIdList = the.dataListSelections
|
.map((item, index, Array) => {
|
if (item.expressCorpName !== "泉州顺丰") {
|
orderCode = item.orderCode;
|
isFQ = false;
|
}
|
return item.sFOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
|
if (!isFQ) {
|
this.$message({
|
message: "选择订单只允许订单状态为泉州顺丰," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
|
this.$confirm("确定要新获得路由信息吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSFOrder/getRouteByFQ";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
if (res.result) {
|
this.$message({
|
message: "获取完成!",
|
type: "success"
|
});
|
ref.loadData();
|
} else {
|
this.common.showMsg(res);
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 推送订单泉州顺丰
|
PushOrder_FQ() {
|
const the = this;
|
var isOK = true;
|
var isFQ = true;
|
var orderCode = "";
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, Array) => {
|
if (item.interfaceStatusText !== "待推送") {
|
orderCode = item.orderCode;
|
isOK = false;
|
}
|
if (item.expressCorpName !== "泉州顺丰") {
|
orderCode = item.orderCode;
|
isFQ = false;
|
}
|
return item.sFOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isOK) {
|
this.$message({
|
message: "选择订单只允许订单状态为“待推送”," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isFQ) {
|
this.$message({
|
message: "选择订单只允许订单状态为泉州顺丰," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
|
this.$confirm("确定要推送选中的订单信息到泉州顺丰平台吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSFOrder/pushOrderbyFQ";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 取消推送订单泉州顺丰
|
ClearOrder_FQ() {
|
this.$message({
|
message: "取消订单已停用!",
|
type: "warning"
|
});
|
return;
|
// const the = this;
|
// var isOK = true;
|
// var isFQ = true;
|
// var orderCode = "";
|
// var orderIdList = "";
|
// orderIdList = the.dataListSelections
|
// .map((item, index, Array) => {
|
// if (item.interfaceStatusText !== "丰桥推送成功") {
|
// orderCode = item.orderCode;
|
// isOK = false;
|
// }
|
// if (item.expressCorpName !== "泉州顺丰") {
|
// orderCode = item.orderCode;
|
// isFQ = false;
|
// }
|
// return item.sFOrder_Id;
|
// })
|
// .join(",");
|
// if (!orderIdList) {
|
// this.$message({
|
// message: "至少选择一条记录!",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
// if (!isOK) {
|
// this.$message({
|
// message:
|
// "选择订单只允许订单状态为“丰桥推送成功”," +
|
// orderCode +
|
// "单号不允许选择取消。",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
// if (!isFQ) {
|
// this.$message({
|
// message:
|
// "选择订单只允许订单状态为泉州顺丰," +
|
// orderCode +
|
// "单号不允许选择取消。",
|
// type: "warning"
|
// });
|
// return;
|
// }
|
|
// this.$confirm("确定要从泉州顺丰平台取消快递单号吗?", "确认信息", {
|
// distinguishCancelAndClose: true,
|
// confirmButtonText: "确认",
|
// cancelButtonText: "取消"
|
// })
|
// .then(() => {
|
// var url = "/api/ExpressSF_Order/ClearOrder_FQ";
|
// var parsms = {
|
// orderIdList: orderIdList
|
// };
|
// const ref = this.dataList;
|
// this.common.ajax(
|
// url,
|
// parsms,
|
// res => {
|
// this.common.showMsg(res);
|
// if (res.result) {
|
// ref.loadData();
|
// }
|
// },
|
// true
|
// );
|
// })
|
// .catch(action => {});
|
},
|
// 推送订单宏远
|
PushOrder_HY() {
|
const the = this;
|
var isOK = true;
|
var isHY = true;
|
var orderCode = "";
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, Array) => {
|
if (item.interfaceStatusText !== "待推送") {
|
orderCode = item.orderCode;
|
isOK = false;
|
}
|
if (item.expressCorpName !== "顺丰快递") {
|
orderCode = item.orderCode;
|
isHY = false;
|
}
|
return item.sFOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isOK) {
|
this.$message({
|
message: "选择订单只允许订单状态为“待推送”," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isHY) {
|
this.$message({
|
message: "选择订单只允许订单状态为顺丰快递," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
|
this.$confirm("确定要推送选中的订单信息到顺丰平台吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSFOrder/pushOrderByHY";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 从宏远取路由
|
GetRoute_HY() {
|
const the = this;
|
var isHY = true;
|
var orderCode = "";
|
var orderIdList = "";
|
orderIdList = the.dataListSelections
|
.map((item, index, Array) => {
|
if (item.expressCorpName !== "顺丰快递") {
|
orderCode = item.orderCode;
|
isHY = false;
|
}
|
return item.sFOrder_Id;
|
})
|
.join(",");
|
if (!orderIdList) {
|
this.$message({
|
message: "至少选择一条记录!",
|
type: "warning"
|
});
|
return;
|
}
|
if (!isHY) {
|
this.$message({
|
message: "选择订单只允许订单状态为顺丰快递," + orderCode + "单号不允许选择推送。",
|
type: "warning"
|
});
|
return;
|
}
|
|
this.$confirm("确定要新获得路由信息吗?", "确认信息", {
|
distinguishCancelAndClose: true,
|
confirmButtonText: "确认",
|
cancelButtonText: "取消"
|
})
|
.then(() => {
|
var url = "/api/api/expressSFOrder/getRouteByHY";
|
var parsms = {
|
orderIdList: orderIdList
|
};
|
const ref = this.dataList;
|
this.common.ajax(
|
url,
|
parsms,
|
res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
},
|
true
|
);
|
})
|
.catch(action => {});
|
},
|
// 推送国际订单
|
PushOrder_GuoJi() {
|
return;
|
// 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.sFOrder_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/ExpressSF_Order/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();
|
// }
|
// });
|
// })
|
// .catch(action => {});
|
}
|
}
|
};
|
</script>
|