Commit 021a2365 authored by pengyunqian's avatar pengyunqian

Merge branch 'feature/distribution'

parents 1d7cb5b9 ba86c82f
const GROUPMEAL_URI = require("../config.js").GROUPMEAL_URI; const GROUPMEAL_URI = require("../config.js").GROUPMEAL_URI;
const req = require("../utils/request").httpReq; 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);
};
// 获取主页配送列表 // 获取主页配送列表
exports.getList = async ctx => { exports.getList = async ctx => {
const opts = { const opts = {
...@@ -51,9 +41,20 @@ exports.getSaveDeliverer = async ctx => { ...@@ -51,9 +41,20 @@ exports.getSaveDeliverer = async ctx => {
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 获取订单管理列表
exports.getOrderList = async ctx => {
const url = `${GROUPMEAL_URI}/order/oldbackground/order_list`;
const opts = {
url,
method: "GET"
};
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/oldbackground/marketing_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -63,7 +64,7 @@ exports.getMarketingList = async ctx => { ...@@ -63,7 +64,7 @@ exports.getMarketingList = async ctx => {
// 获取商品名称 // 获取商品名称
exports.getGoodsList = async ctx => { exports.getGoodsList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/goods_list`; const url = `${GROUPMEAL_URI}/order/oldbackground/goods_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -73,7 +74,7 @@ exports.getGoodsList = async ctx => { ...@@ -73,7 +74,7 @@ exports.getGoodsList = async ctx => {
// 获取自提点 // 获取自提点
exports.getSubShopList = async ctx => { exports.getSubShopList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/sub_shop_list`; const url = `${GROUPMEAL_URI}/order/oldbackground/sub_shop_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -83,7 +84,7 @@ exports.getSubShopList = async ctx => { ...@@ -83,7 +84,7 @@ exports.getSubShopList = async ctx => {
// 导出订单 // 导出订单
exports.orderExport = async ctx => { exports.orderExport = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_export`; const url = `${GROUPMEAL_URI}/order/oldbackground/order_export`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -93,7 +94,7 @@ exports.orderExport = async ctx => { ...@@ -93,7 +94,7 @@ exports.orderExport = async ctx => {
// 打印订单 // 打印订单
exports.orderPrint = async ctx => { exports.orderPrint = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_print`; const url = `${GROUPMEAL_URI}/order/oldbackground/order_print`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -103,7 +104,7 @@ exports.orderPrint = async ctx => { ...@@ -103,7 +104,7 @@ exports.orderPrint = async ctx => {
// 订单退款列表 // 订单退款列表
exports.orderItemList = async ctx => { exports.orderItemList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_item_list`; const url = `${GROUPMEAL_URI}/order/oldbackground/order_item_list`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
...@@ -113,7 +114,7 @@ exports.orderItemList = async ctx => { ...@@ -113,7 +114,7 @@ exports.orderItemList = async ctx => {
// 订单退款列表 // 订单退款列表
exports.orderRefund = async ctx => { exports.orderRefund = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refund`; const url = `${GROUPMEAL_URI}/order/oldbackground/order_refund`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
...@@ -125,7 +126,7 @@ exports.orderRefund = async ctx => { ...@@ -125,7 +126,7 @@ exports.orderRefund = async ctx => {
// 订单驳回 // 订单驳回
exports.orderRefundReject = async ctx => { exports.orderRefundReject = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_refund_reject`; const url = `${GROUPMEAL_URI}/order/oldbackground/order_refund_reject`;
const opts = { const opts = {
url, url,
method: "GET" method: "GET"
......
...@@ -70,16 +70,15 @@ router.post(`${API_VERSION}/order/deliverer/add_deliverer`, groupmeal.getAddDeli ...@@ -70,16 +70,15 @@ router.post(`${API_VERSION}/order/deliverer/add_deliverer`, groupmeal.getAddDeli
router.post(`${API_VERSION}/order/deliverer/save_day_deliverer`, groupmeal.getSaveDeliverer) router.post(`${API_VERSION}/order/deliverer/save_day_deliverer`, groupmeal.getSaveDeliverer)
// 订单管理 // 订单管理
router.get(`${API_VERSION}/order/background/order_list`, groupmeal.getOrderList); router.get(`${API_VERSION}/order/oldbackground/order_list`, groupmeal.getOrderList);
router.get(`${API_VERSION}/order/background/marketing_list`, groupmeal.getMarketingList); router.get(`${API_VERSION}/order/oldbackground/marketing_list`, groupmeal.getMarketingList);
router.get(`${API_VERSION}/order/background/goods_list`, groupmeal.getGoodsList); router.get(`${API_VERSION}/order/oldbackground/goods_list`, groupmeal.getGoodsList);
router.get(`${API_VERSION}/order/background/sub_shop_list`, groupmeal.getSubShopList); router.get(`${API_VERSION}/order/oldbackground/sub_shop_list`, groupmeal.getSubShopList);
router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport); router.get(`${API_VERSION}/order/oldbackground/order_export`, groupmeal.orderExport);
router.get(`${API_VERSION}/order/background/order_export`, groupmeal.orderExport); router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrint);
router.get(`${API_VERSION}/order/background/order_print`, groupmeal.orderPrint); router.get(`${API_VERSION}/order/oldbackground/order_item_list`, groupmeal.orderItemList);
router.get(`${API_VERSION}/order/background/order_item_list`, groupmeal.orderItemList); router.get(`${API_VERSION}/order/oldbackground/order_refund_reject`, groupmeal.orderRefundReject);
router.get(`${API_VERSION}/order/background/order_refund_reject`, groupmeal.orderRefundReject); router.post(`${API_VERSION}/order/oldbackground/order_refund`, groupmeal.orderRefund);
router.post(`${API_VERSION}/order/background/order_refund`, groupmeal.orderRefund);
// 钱包提现审核 wallet/background/apply_detail // 钱包提现审核 wallet/background/apply_detail
router.get(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList) router.get(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
......
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作" width="width" align="center"> <el-table-column prop="prop" label="操作" width="width" align="center">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="handleModify(scope.row)" <el-button type="primary" @click="handleModify(scope.row)"
>修改</el-button >修改</el-button
> >
<el-button <el-button
type="primary" type="primary"
v-show=scope.row.url v-show="scope.row.url"
@click="handleDownload(scope.row.url)" @click="handleDownload(scope.row.url)"
>下载配送路线</el-button >下载配送路线</el-button
> >
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
</el-table> </el-table>
<!-- 页码区 --> <!-- 页码区 -->
<Pagination <Pagination
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
v-model:current-page="page" v-model:current-page="page"
:page-size="pageSize" :page-size="pageSize"
:total="total" :total="total"
></Pagination> ></Pagination>
<!-- 添加配送员弹框 --> <!-- 添加配送员弹框 -->
<el-dialog <el-dialog
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<el-dialog <el-dialog
title="分配配送员" title="分配配送员"
v-model="dialogFormAssign" v-model="dialogFormAssign"
width="70%" width="70%"
:show-close="false" :show-close="false"
> >
<el-form class="dioFor"> <el-form class="dioFor">
...@@ -138,7 +138,12 @@ ...@@ -138,7 +138,12 @@
clearable clearable
filterable filterable
> >
<el-option :label="item.label" :value="item.value" v-for="item in marketingList" :key="item.value"></el-option> <el-option
:label="item.label"
:value="item.value"
v-for="item in marketingList"
:key="item.value"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<span class="dioFor">已选:{{ multipleSelection.length }}人</span> <span class="dioFor">已选:{{ multipleSelection.length }}人</span>
...@@ -153,11 +158,7 @@ ...@@ -153,11 +158,7 @@
style="width: 100%" style="width: 100%"
@selection-change="selectGoodsChange" @selection-change="selectGoodsChange"
> >
<el-table-column <el-table-column width="60" align="center" type="selection">
width="60"
align="center"
type="selection"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -183,9 +184,9 @@ ...@@ -183,9 +184,9 @@
prop="deliverer_tool_type" prop="deliverer_tool_type"
label="配送工具" label="配送工具"
> >
<template #default="scope"> <template #default="scope">
{{scope.row.deliverer_tool_type==0 ? "电动车" : "摩托车"}} {{ scope.row.deliverer_tool_type == 0 ? "电动车" : "摩托车" }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form> </el-form>
...@@ -207,14 +208,14 @@ import { ...@@ -207,14 +208,14 @@ import {
getList, getList,
getSaveDeliverer, getSaveDeliverer,
getAddDeliverer, getAddDeliverer,
getMarketingList getMarketingList,
} from "../../../service/Groupmeal/groupmeal"; } from "../../../service/Groupmeal/groupmeal";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
export default { export default {
name: "Distrib", name: "Distrib",
components: { components: {
Layout, Layout,
Pagination Pagination,
}, },
data() { data() {
return { return {
...@@ -247,13 +248,13 @@ export default { ...@@ -247,13 +248,13 @@ export default {
page: 1, page: 1,
pageSize: 20, pageSize: 20,
isEdit: false, isEdit: false,
marketingList:[] marketingList: [],
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDelivererList(); this.getDelivererList();
this.getMarketingList() this.getMarketingList();
}, },
methods: { methods: {
selectGoodsChange(val) { selectGoodsChange(val) {
...@@ -273,17 +274,17 @@ export default { ...@@ -273,17 +274,17 @@ export default {
min_capacity: "", //最小配送量 min_capacity: "", //最小配送量
tool_type: [], //配送工具 tool_type: [], //配送工具
}), }),
this.deliverer= [], (this.deliverer = []),
this.multipleSelection = []; (this.multipleSelection = []);
this.selectActivity = ""; //活动下拉框 this.selectActivity = ""; //活动下拉框
}, },
// 获取主页列表 // 获取主页列表
async getList() { async getList() {
const {page, pageSize} = this const { page, pageSize } = this;
const params={ const params = {
page, page,
pageSize pageSize,
} };
try { try {
const res = await getList(params); const res = await getList(params);
this.distribList = res.response.list; this.distribList = res.response.list;
...@@ -297,7 +298,8 @@ export default { ...@@ -297,7 +298,8 @@ export default {
const { name, max_capacity, min_capacity, tool_type } = this.addDeliverer; const { name, max_capacity, min_capacity, tool_type } = this.addDeliverer;
if (!name) return ElMessage("请填写配送员姓名"); if (!name) return ElMessage("请填写配送员姓名");
if (!max_capacity) return ElMessage("请填写配送上限"); if (!max_capacity) return ElMessage("请填写配送上限");
if (min_capacity !== '' && min_capacity <= 0) return ElMessage("最小配送量不能为0或小于0"); if (min_capacity !== "" && min_capacity <= 0)
return ElMessage("最小配送量不能为0或小于0");
if (!min_capacity) return ElMessage("请填写最小配送量"); if (!min_capacity) return ElMessage("请填写最小配送量");
if (!tool_type) return ElMessage("请选择配送工具"); if (!tool_type) return ElMessage("请选择配送工具");
const params = { const params = {
...@@ -307,8 +309,8 @@ export default { ...@@ -307,8 +309,8 @@ export default {
tool_type: +tool_type, tool_type: +tool_type,
}; };
try { try {
const {code, reason} = await getAddDeliverer(params); const { code, reason } = await getAddDeliverer(params);
if(code !== 0) return this.$message.error(reason || "添加配送员失败") if (code !== 0) return this.$message.error(reason || "添加配送员失败");
ElMessage("添加配送员成功"); ElMessage("添加配送员成功");
this.getDelivererList(); this.getDelivererList();
this.dialogFormAdd = false; this.dialogFormAdd = false;
...@@ -323,17 +325,17 @@ export default { ...@@ -323,17 +325,17 @@ export default {
} }
}, },
// 添加的取消 // 添加的取消
addCancel(){ addCancel() {
this.dialogFormAdd = false this.dialogFormAdd = false;
this.resetDate() this.resetDate();
}, },
// 分配配送员 // 分配配送员
assignDeliverer() { assignDeliverer() {
this.dialogFormAssign = true; this.dialogFormAssign = true;
this.getDelivererList(); this.getDelivererList();
this.multipleSelection = []; this.multipleSelection = [];
this.deliverer = [] this.deliverer = [];
this.isEdit = false this.isEdit = false;
}, },
// 修改 // 修改
async handleModify(row) { async handleModify(row) {
...@@ -342,7 +344,7 @@ export default { ...@@ -342,7 +344,7 @@ export default {
this.selectActivity = code; this.selectActivity = code;
console.log(code); console.log(code);
try { try {
const res = await getDelivererList({ code}); const res = await getDelivererList({ code });
this.deliverer = res.response; this.deliverer = res.response;
this.isEdit = true; this.isEdit = true;
this.getList(); this.getList();
...@@ -360,8 +362,14 @@ export default { ...@@ -360,8 +362,14 @@ export default {
}, },
// 下载路线 // 下载路线
handleDownload(url) { handleDownload(url) {
url && window.open("http://bp-dev.ini.yidian-inc.com" + url) // url && window.open("http://bp-dev.ini.yidian-inc.com" + url);
console.log(url) var ENV;
if (process.env.NODE_ENV == "development") {
ENV = "http://bp-dev.ini.yidian-inc.com/";
} else {
ENV = "http://bp-test.ini.yidian-inc.com/";
}
url && window.open(ENV + url);
}, },
// 分配保存 // 分配保存
async save() { async save() {
...@@ -370,9 +378,15 @@ export default { ...@@ -370,9 +378,15 @@ export default {
if (!selectActivity) return ElMessage("请选择活动姓名"); if (!selectActivity) return ElMessage("请选择活动姓名");
// if (!uids.length) return this.$message.info("请至少选择一名骑手"); // if (!uids.length) return this.$message.info("请至少选择一名骑手");
try { try {
const {code, reason} = await getSaveDeliverer({ code: selectActivity, uids: uids.join(",") }); const { code, reason } = await getSaveDeliverer({
if(code !== 0) return this.$message.error(reason || (this.isEdit ? "修改配送员失败":"分配配送员失败")) code: selectActivity,
ElMessage(this.isEdit ? "修改配送员成功":"分配配送员成功"); uids: uids.join(","),
});
if (code !== 0)
return this.$message.error(
reason || (this.isEdit ? "修改配送员失败" : "分配配送员失败")
);
ElMessage(this.isEdit ? "修改配送员成功" : "分配配送员成功");
this.dialogFormAssign = false; this.dialogFormAssign = false;
this.isEdit = false; this.isEdit = false;
this.getList(); this.getList();
...@@ -382,23 +396,23 @@ export default { ...@@ -382,23 +396,23 @@ export default {
} }
}, },
// 分配取消 // 分配取消
assignCancel(){ assignCancel() {
this.dialogFormAssign = false this.dialogFormAssign = false;
this.getDelivererList() this.getDelivererList();
this.resetDate() this.resetDate();
}, },
// 活动名称列表 // 活动名称列表
async getMarketingList() { async getMarketingList() {
try { try {
const res = await getMarketingList(); const res = await getMarketingList();
this.marketingList = res.result.map(item => { this.marketingList = res.result.map((item) => {
return { return {
value: item.marketing_id, value: item.marketing_id,
label: item.marketing_name label: item.marketing_name,
} };
}) });
} catch (error) { } catch (error) {
console.log(error) console.log(error);
} }
}, },
// 分配配送员列表 // 分配配送员列表
......
...@@ -29,7 +29,7 @@ export async function getSaveDeliverer(params) { ...@@ -29,7 +29,7 @@ export async function getSaveDeliverer(params) {
// 获取订单列表 // 获取订单列表
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/oldbackground/order_list", {
params params
}); });
return res; return res;
...@@ -37,13 +37,13 @@ export async function getOrderList(params) { ...@@ -37,13 +37,13 @@ export async function getOrderList(params) {
// 获取活动名称 // 获取活动名称
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/oldbackground/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/oldbackground/goods_list", {
params params
}); });
return res; return res;
...@@ -51,15 +51,7 @@ export async function getGoodsList(params) { ...@@ -51,15 +51,7 @@ export async function getGoodsList(params) {
// 获取自提点 // 获取自提点
export async function getSubShopList(params) { export async function getSubShopList(params) {
const res = await axios.get("/api/v1/order/background/sub_shop_list",{ const res = await axios.get("/api/v1/order/oldbackground/sub_shop_list",{
params
});
return res;
}
// 导出订单
export async function orderExport(params) {
const res = await axios.get("/api/v1/order/background/order_export", {
params params
}); });
return res; return res;
...@@ -67,7 +59,7 @@ export async function orderExport(params) { ...@@ -67,7 +59,7 @@ export async function orderExport(params) {
// 打印订单 // 打印订单
export async function orderPrint(params) { export async function orderPrint(params) {
const res = await axios.get("/api/v1/order/background/order_print", { const res = await axios.get("/api/v1/order/oldbackground/order_print", {
params params
}); });
return res; return res;
...@@ -75,7 +67,7 @@ export async function orderPrint(params) { ...@@ -75,7 +67,7 @@ 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/oldbackground/order_item_list", {
params params
}); });
return res; return res;
...@@ -87,7 +79,7 @@ export async function refundOrder(orderId, itemsToRefund) { ...@@ -87,7 +79,7 @@ export async function refundOrder(orderId, itemsToRefund) {
// order_id: orderId, // order_id: orderId,
// refund_list: itemsToRefund // refund_list: itemsToRefund
// }; // };
const res = await axios.post("/api/v1/order/background/order_refund", { const res = await axios.post("/api/v1/order/oldbackground/order_refund", {
order_id: orderId, order_id: orderId,
refund_list: itemsToRefund refund_list: itemsToRefund
}); });
...@@ -96,7 +88,7 @@ export async function refundOrder(orderId, itemsToRefund) { ...@@ -96,7 +88,7 @@ export async function refundOrder(orderId, itemsToRefund) {
// 订单驳回 // 订单驳回
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/oldbackground/order_refund_reject", {
params params
}); });
return res; return res;
...@@ -110,5 +102,5 @@ export function getOrderExportURL(eventId, type) { ...@@ -110,5 +102,5 @@ export function getOrderExportURL(eventId, type) {
}else{ }else{
ENV = "http://bp-test.ini.yidian-inc.com/" ENV = "http://bp-test.ini.yidian-inc.com/"
} }
return `${ENV}order/background/order_export?marketing_id=${eventId}&type=${type}`; return `${ENV}order/oldbackground/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