Commit e8631179 authored by pengyunqian's avatar pengyunqian

update:转换配送工具

parents 5c778d43 bde824ed
......@@ -3,131 +3,132 @@ const req = require("../utils/request").httpReq;
// 获取订单管理列表
exports.getOrderList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取主页配送列表
exports.getList = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer_conf`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer_conf`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 获取配送列表
exports.getDelivererList = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/list_day_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 添加骑手
exports.getAddDeliverer = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/add_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/add_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 分配骑手
exports.getSaveDeliverer = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/save_day_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/save_day_deliverer`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 获取活动名称
exports.getMarketingList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/marketing_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/marketing_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取商品名称
exports.getGoodsList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/goods_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/goods_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取自提点
exports.getSubShopList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/sub_shop_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/sub_shop_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 导出订单
exports.orderExport = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_export`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_export`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 打印订单
exports.orderPrint = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/print`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_print`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 订单退款列表
exports.orderItemList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_item_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_item_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 订单退款列表
exports.orderRefund = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refundt`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_refund`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 订单驳回
exports.orderRefundReject = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refund_reject`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
const url = `${GROUPMEAL_URI}/order/background/order_refund_reject`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
......@@ -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/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_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;
......@@ -6,60 +6,66 @@ export async function getList (params) {
return res;
}
// 获取分配配送员列表
export async function getDelivererList (params) {
const res = await axios.post("/api/v1/order/deliverer/list_day_deliverer",params);
return res;
}
export async function getDelivererList(params) {
const res = await axios.post(
"/api/v1/order/deliverer/list_day_deliverer",
params
);
return res;
}
// 添加配送员
export async function getAddDeliverer (params) {
const res = await axios.post("/api/v1/order/deliverer/add_deliverer",params);
return res;
export async function getAddDeliverer(params) {
const res = await axios.post("/api/v1/order/deliverer/add_deliverer", params);
return res;
}
// 分配配送员
export async function getSaveDeliverer (params) {
const res = await axios.post("/api/v1/order/deliverer/save_day_deliverer",params);
return res;
export async function getSaveDeliverer(params) {
const res = await axios.post(
"/api/v1/order/deliverer/save_day_deliverer",
params
);
return res;
}
// 获取订单列表
export async function getOrderList (params) {
const res = await axios.get("/api/v1/order/background/order_list",{
// 获取订单列表
export async function getOrderList(params) {
const res = await axios.get("/api/v1/order/background/order_list", {
params
});
return res;
}
// 获取活动名称
export async function getMarketingList () {
// 获取活动名称
export async function getMarketingList() {
const res = await axios.get("/api/v1/order/background/marketing_list");
return res;
}
// 获取商品名称
// 获取商品名称
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
});
return res;
}
// 获取自提点
// 获取自提点
export async function getSubShopList() {
const res = await axios.get("/api/v1/order/background/sub_shop_list");
return res;
}
// 导出订单
// 导出订单
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
});
return res;
}
// 打印订单
// 打印订单
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
});
return res;
......@@ -67,24 +73,34 @@ export async function orderPrint(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
});
return res;
}
// 订单退款
export async function orderRefund(params) {
const res = await axios.get("/api/v1/order/background/order_refund",{
params
export async function refundOrder(orderId, itemsToRefund) {
// const 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;
}
// 订单驳回
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
});
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