Commit e8631179 authored by pengyunqian's avatar pengyunqian

update:转换配送工具

parents 5c778d43 bde824ed
...@@ -3,131 +3,132 @@ const req = require("../utils/request").httpReq; ...@@ -3,131 +3,132 @@ const req = require("../utils/request").httpReq;
// 获取订单管理列表 // 获取订单管理列表
exports.getOrderList = async ctx => { exports.getOrderList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_list`; const url = `${GROUPMEAL_URI}/order/background/order_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取主页配送列表 // 获取主页配送列表
exports.getList = async ctx => { exports.getList = async ctx => {
const opts = { const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer_conf`, url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer_conf`,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取配送列表 // 获取配送列表
exports.getDelivererList = async ctx => { exports.getDelivererList = async ctx => {
const opts = { const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer`, url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer`,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 添加骑手 // 添加骑手
exports.getAddDeliverer = async ctx => { exports.getAddDeliverer = async ctx => {
const opts = { const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/add_deliverer`, url: `${GROUPMEAL_URI}/order/deliverer/add_deliverer`,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 分配骑手 // 分配骑手
exports.getSaveDeliverer = async ctx => { exports.getSaveDeliverer = async ctx => {
const opts = { const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/save_day_deliverer`, url: `${GROUPMEAL_URI}/order/deliverer/save_day_deliverer`,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取活动名称 // 获取活动名称
exports.getMarketingList = async ctx => { exports.getMarketingList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/marketing_list`; const url = `${GROUPMEAL_URI}/order/background/marketing_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取商品名称 // 获取商品名称
exports.getGoodsList = async ctx => { exports.getGoodsList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/goods_list`; const url = `${GROUPMEAL_URI}/order/background/goods_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取自提点 // 获取自提点
exports.getSubShopList = async ctx => { exports.getSubShopList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/sub_shop_list`; const url = `${GROUPMEAL_URI}/order/background/sub_shop_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 导出订单 // 导出订单
exports.orderExport = async ctx => { exports.orderExport = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_export`; const url = `${GROUPMEAL_URI}/order/background/order_export`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 打印订单 // 打印订单
exports.orderPrint = async ctx => { exports.orderPrint = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/print`; const url = `${GROUPMEAL_URI}/order/background/order_print`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 订单退款列表 // 订单退款列表
exports.orderItemList = async ctx => { exports.orderItemList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_item_list`; const url = `${GROUPMEAL_URI}/order/background/order_item_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 订单退款列表 // 订单退款列表
exports.orderRefund = async ctx => { exports.orderRefund = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refundt`; const url = `${GROUPMEAL_URI}/order/background/order_refund`;
const opts = { const opts = {
url, url,
method: "GET" method: "POST",
}; json: true,
ctx.body = await req(ctx, opts); body: ctx.request.body
};
ctx.body = await req(ctx, opts);
}; };
// 订单驳回 // 订单驳回
exports.orderRefundReject = async ctx => { exports.orderRefundReject = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refund_reject`; const url = `${GROUPMEAL_URI}/order/background/order_refund_reject`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
...@@ -75,9 +75,9 @@ router.get(`${API_VERSION}/order/background/goods_list`, groupmeal.getGoodsList) ...@@ -75,9 +75,9 @@ router.get(`${API_VERSION}/order/background/goods_list`, groupmeal.getGoodsList)
router.get(`${API_VERSION}/order/background/sub_shop_list`, groupmeal.getSubShopList); router.get(`${API_VERSION}/order/background/sub_shop_list`, groupmeal.getSubShopList);
router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport); router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport);
router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport); router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport);
router.get(`${API_VERSION}/order/background/print`, groupmeal.orderPrint); router.get(`${API_VERSION}/order/background/order_print`, groupmeal.orderPrint);
router.get(`${API_VERSION}/order/background/order_item_list`, groupmeal.orderItemList); router.get(`${API_VERSION}/order/background/order_item_list`, groupmeal.orderItemList);
router.get(`${API_VERSION}/order/background/order_refund_reject`, groupmeal.orderRefundReject); router.get(`${API_VERSION}/order/background/order_refund_reject`, groupmeal.orderRefundReject);
router.get(`${API_VERSION}/order/background/order_refundt`, groupmeal.orderRefund); router.post(`${API_VERSION}/order/background/order_refund`, groupmeal.orderRefund);
module.exports = router; module.exports = router;
...@@ -6,60 +6,66 @@ export async function getList (params) { ...@@ -6,60 +6,66 @@ export async function getList (params) {
return res; return res;
} }
// 获取分配配送员列表 // 获取分配配送员列表
export async function getDelivererList (params) { export async function getDelivererList(params) {
const res = await axios.post("/api/v1/order/deliverer/list_day_deliverer",params); const res = await axios.post(
return res; "/api/v1/order/deliverer/list_day_deliverer",
} params
);
return res;
}
// 添加配送员 // 添加配送员
export async function getAddDeliverer (params) { export async function getAddDeliverer(params) {
const res = await axios.post("/api/v1/order/deliverer/add_deliverer",params); const res = await axios.post("/api/v1/order/deliverer/add_deliverer", params);
return res; return res;
} }
// 分配配送员 // 分配配送员
export async function getSaveDeliverer (params) { export async function getSaveDeliverer(params) {
const res = await axios.post("/api/v1/order/deliverer/save_day_deliverer",params); const res = await axios.post(
return res; "/api/v1/order/deliverer/save_day_deliverer",
params
);
return res;
} }
// 获取订单列表 // 获取订单列表
export async function getOrderList (params) { export async function getOrderList(params) {
const res = await axios.get("/api/v1/order/background/order_list",{ const res = await axios.get("/api/v1/order/background/order_list", {
params params
}); });
return res; return res;
} }
// 获取活动名称 // 获取活动名称
export async function getMarketingList () { export async function getMarketingList() {
const res = await axios.get("/api/v1/order/background/marketing_list"); const res = await axios.get("/api/v1/order/background/marketing_list");
return res; return res;
} }
// 获取商品名称 // 获取商品名称
export async function getGoodsList(params) { export async function getGoodsList(params) {
const res = await axios.get("/api/v1/order/background/goods_list",{ const res = await axios.get("/api/v1/order/background/goods_list", {
params params
}); });
return res; return res;
} }
// 获取自提点 // 获取自提点
export async function getSubShopList() { export async function getSubShopList() {
const res = await axios.get("/api/v1/order/background/sub_shop_list"); const res = await axios.get("/api/v1/order/background/sub_shop_list");
return res; return res;
} }
// 导出订单 // 导出订单
export async function orderExport(params) { export async function orderExport(params) {
const res = await axios.get("/api/v1/order/background/order_export",{ const res = await axios.get("/api/v1/order/background/order_export", {
params params
}); });
return res; return res;
} }
// 打印订单 // 打印订单
export async function orderPrint(params) { export async function orderPrint(params) {
const res = await axios.get("/api/v1/order/background/print",{ const res = await axios.get("/api/v1/order/background/order_print", {
params params
}); });
return res; return res;
...@@ -67,24 +73,34 @@ export async function orderPrint(params) { ...@@ -67,24 +73,34 @@ export async function orderPrint(params) {
// 订单退款列表 // 订单退款列表
export async function orderItemList(params) { export async function orderItemList(params) {
const res = await axios.get("/api/v1/order/background/order_item_list",{ const res = await axios.get("/api/v1/order/background/order_item_list", {
params params
}); });
return res; return res;
} }
// 订单退款 // 订单退款
export async function orderRefund(params) { export async function refundOrder(orderId, itemsToRefund) {
const res = await axios.get("/api/v1/order/background/order_refund",{ // const params = {
params // order_id: orderId,
// refund_list: itemsToRefund
// };
const res = await axios.post("/api/v1/order/background/order_refund", {
order_id: orderId,
refund_list: itemsToRefund
}); });
return res; return res;
} }
// 订单驳回 // 订单驳回
export async function orderRefundReject(params) { export async function orderRefundReject(params) {
const res = await axios.get("/api/v1/order/background/order_refund_reject",{ const res = await axios.get("/api/v1/order/background/order_refund_reject", {
params params
}); });
return res; return res;
} }
// 导出订单
export function getOrderExportURL(eventId, type) {
return `http://bp-dev.ini.yidian-inc.com/order/background/order_export?marketing_id=${eventId}&type=${type}`;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment