Commit 317d5159 authored by liwenhong's avatar liwenhong

Merge branch 'master' into feature/add-commissionMode

# Conflicts:
#	server/config.js
#	server/router.js
#	src/pages/Goods/Detail/index.vue
#	src/pages/Goods/Retail/index.vue
#	src/router/index.js
parents d958a0c0 bf445651
...@@ -115,7 +115,7 @@ exports.marketingInfo = async ctx => { ...@@ -115,7 +115,7 @@ exports.marketingInfo = async ctx => {
// 关闭/开启 活动 // 关闭/开启 活动
exports.updateActivity = async ctx => { exports.updateActivity = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/update_marketing`; const url = `${ACTIVITY_URI}/marketing/background/update_marketing_online_status`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
......
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,22 @@ exports.getSaveDeliverer = async ctx => { ...@@ -51,9 +41,22 @@ 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 +66,7 @@ exports.getMarketingList = async ctx => { ...@@ -63,7 +66,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 +76,7 @@ exports.getGoodsList = async ctx => { ...@@ -73,7 +76,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 +86,7 @@ exports.getSubShopList = async ctx => { ...@@ -83,7 +86,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 +96,7 @@ exports.orderExport = async ctx => { ...@@ -93,7 +96,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 +106,7 @@ exports.orderPrint = async ctx => { ...@@ -103,7 +106,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 +116,7 @@ exports.orderItemList = async ctx => { ...@@ -113,7 +116,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,6 +128,100 @@ exports.orderRefund = async ctx => { ...@@ -125,6 +128,100 @@ exports.orderRefund = async ctx => {
// 订单驳回 // 订单驳回
exports.orderRefundReject = async ctx => { exports.orderRefundReject = async ctx => {
const url = `${GROUPMEAL_URI}/order/oldbackground/order_refund_reject`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 新订单管理
// 获取订单管理列表
exports.newGetOrderList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取活动名称
exports.newGetMarketingList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_condition_marketing_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取商品名称
exports.newGetGoodsList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_condition_goods_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 获取自提点
exports.newGetSubShopList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_condition_take_place_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 导出订单
exports.newOrderExport = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_export`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 打印订单
exports.newOrderPrint = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_print`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 订单退款列表
exports.newOrderItemList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/order_item_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
// 订单退款列表
exports.newOrderRefund = async ctx => {
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.newOrderRefundReject = 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,
......
...@@ -71,6 +71,50 @@ exports.getApplyDetail = async ctx => { ...@@ -71,6 +71,50 @@ exports.getApplyDetail = async ctx => {
ctx.body = await req(ctx, opts) ctx.body = await req(ctx, opts)
} }
// 提现审核迭代
// 获取钱包账户列表
exports.getAccountList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/account_list`;
const opts = {
url,
method: "GET",
qs: ctx.request.query
}
ctx.body = await req(ctx, opts)
}
// 获取钱包账户流水列表
exports.getRecordList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/record_list`;
const opts = {
url,
method: "GET",
qs: ctx.request.query
}
ctx.body = await req(ctx, opts)
}
// 钱包账户黑名单
exports.getAccountBlackList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/blacklist`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
// 钱包账户释放
exports.getReblackList = async ctx => {
const url = `${WITHDRAWAL_URI}/wallet/background/reblacklist`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
}
ctx.body = await req(ctx, opts)
}
const getUserPermission = async (ctx) => { const getUserPermission = async (ctx) => {
const url = `${WITHDRAWAL_URI}/merchant/authority/get_role_list`; const url = `${WITHDRAWAL_URI}/merchant/authority/get_role_list`;
const { email, op_cur_user } = ctx.request.query; const { email, op_cur_user } = ctx.request.query;
......
...@@ -63,36 +63,11 @@ router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info) ...@@ -63,36 +63,11 @@ router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list) router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
//用户 //用户
router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail) router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail)
// 团餐运营--配送
router.post(`${API_VERSION}/order/deliverer/list_day_deliverer_conf`, groupmeal.getList)
router.post(`${API_VERSION}/order/deliverer/list_day_deliverer`, groupmeal.getDelivererList)
router.post(`${API_VERSION}/order/deliverer/add_deliverer`, groupmeal.getAddDeliverer)
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/background/marketing_list`, groupmeal.getMarketingList);
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/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.post(`${API_VERSION}/order/background/order_refund`, groupmeal.orderRefund);
// 钱包提现审核 wallet/background/apply_detail
router.get(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
router.post(`${API_VERSION}/get_withdrawal_black_list`, withdrawal.getBlackList)
router.post(`${API_VERSION}/get_withdraw_audit`, withdrawal.getWithdrawAudit)
router.post(`${API_VERSION}/get_freezing_fund`, withdrawal.getFreezingFund)
router.get(`${API_VERSION}/get_apply_detail`, withdrawal.getApplyDetail)
// 后台运营管理 // 后台运营管理
router.get(`${API_VERSION}/marketing/background/marketing_list`, activity.getActivityList) router.get(`${API_VERSION}/marketing/background/marketing_list`, activity.getActivityList)
router.get(`${API_VERSION}/order/background/pindan_marketing_info_data_statistics`, activity.checkActivityDetailInfo) router.get(`${API_VERSION}/order/background/pindan_marketing_info_data_statistics`, activity.checkActivityDetailInfo)
router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoodsDetail) router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoodsDetail)
router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateActivity) router.post(`${API_VERSION}/marketing/background/update_marketing_online_status`, activity.updateActivity)
router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.checkActivityDetail) router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.checkActivityDetail)
// //
router.get(`${API_VERSION}/marketing/background/take_place_list`, activity.getPlaceList) router.get(`${API_VERSION}/marketing/background/take_place_list`, activity.getPlaceList)
...@@ -102,11 +77,50 @@ router.get(`${API_VERSION}/goods/background/ota_list`, activity.getBusinessList) ...@@ -102,11 +77,50 @@ router.get(`${API_VERSION}/goods/background/ota_list`, activity.getBusinessList)
router.post(`${API_VERSION}/goods/background/add_goods`, activity.addGoods); router.post(`${API_VERSION}/goods/background/add_goods`, activity.addGoods);
router.get(`${API_VERSION}/goods/background/pindan_goods`, activity.pindanGoods); router.get(`${API_VERSION}/goods/background/pindan_goods`, activity.pindanGoods);
router.get(`${API_VERSION}/goods/background/marketing_goods_info`, activity.markGoodsInfo); router.get(`${API_VERSION}/goods/background/marketing_goods_info`, activity.markGoodsInfo);
router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoods); router.post(`${API_VERSION}/goods/background/edit_activity_goods`, activity.editGoods);
router.post(`${API_VERSION}/marketing/background/add_marketing`, activity.addMarketing); router.post(`${API_VERSION}/marketing/background/add_marketing`, activity.addMarketing);
router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.marketingInfo); router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.marketingInfo);
router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateMarketing); router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateMarketing);
// 团餐运营--配送
router.post(`${API_VERSION}/order/deliverer/list_day_deliverer_conf`, groupmeal.getList)
router.post(`${API_VERSION}/order/deliverer/list_day_deliverer`, groupmeal.getDelivererList)
router.post(`${API_VERSION}/order/deliverer/add_deliverer`, groupmeal.getAddDeliverer)
router.post(`${API_VERSION}/order/deliverer/save_day_deliverer`, groupmeal.getSaveDeliverer)
// 老订单管理
router.get(`${API_VERSION}/order/oldbackground/order_list`, groupmeal.getOrderList);
router.get(`${API_VERSION}/order/oldbackground/marketing_list`, groupmeal.getMarketingList);
router.get(`${API_VERSION}/order/oldbackground/goods_list`, groupmeal.getGoodsList);
router.get(`${API_VERSION}/order/oldbackground/sub_shop_list`, groupmeal.getSubShopList);
router.get(`${API_VERSION}/order/oldbackground/order_export`, groupmeal.orderExport);
router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrint);
router.get(`${API_VERSION}/order/oldbackground/order_item_list`, groupmeal.orderItemList);
router.get(`${API_VERSION}/order/oldbackground/order_refund_reject`, groupmeal.orderRefundReject);
router.post(`${API_VERSION}/order/oldbackground/order_refund`, groupmeal.orderRefund);
// 新订单管理
router.get(`${API_VERSION}/order/background/order_list`, groupmeal.newGetOrderList);
router.get(`${API_VERSION}/order/background/order_condition_marketing_list`, groupmeal.newGetMarketingList);
router.get(`${API_VERSION}/order/background/order_condition_goods_list`, groupmeal.newGetGoodsList);
router.get(`${API_VERSION}/order/background/order_condition_take_place_list`, groupmeal.newGetSubShopList);
router.get(`${API_VERSION}/order/background/order_export`, groupmeal.newOrderExport);
router.get(`${API_VERSION}/order/background/order_print`, groupmeal.newOrderPrint);
router.get(`${API_VERSION}/order/background/order_item_list`, groupmeal.newOrderItemList);
router.get(`${API_VERSION}/order/background/order_refund_reject`, groupmeal.newOrderRefundReject);
router.post(`${API_VERSION}/order/background/order_refund`, groupmeal.newOrderRefund);
// 钱包提现审核
router.get(`${API_VERSION}/get_withdrawal_apply_list`, withdrawal.getApplyList)
router.post(`${API_VERSION}/get_withdrawal_black_list`, withdrawal.getBlackList)
router.post(`${API_VERSION}/get_withdraw_audit`, withdrawal.getWithdrawAudit)
router.post(`${API_VERSION}/get_freezing_fund`, withdrawal.getFreezingFund)
router.get(`${API_VERSION}/get_apply_detail`, withdrawal.getApplyDetail)
// 钱包账户
router.get(`${API_VERSION}/get_account_list`, withdrawal.getAccountList)
router.get(`${API_VERSION}/get_record_list`, withdrawal.getRecordList)
router.post(`${API_VERSION}/get_account_black_list`, withdrawal.getAccountBlackList)
router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList)
module.exports = router; module.exports = router;
\ No newline at end of file
<template>
<el-dialog
title="提示"
v-model="dialogVisible"
width="30%"
:before-close="handleClose"
>
<span>这是一段信息</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span>
</template>
</el-dialog>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
dialogVisible: true
};
},
watch: {},
computed: {},
methods: {},
created() {},
mounted() {}
};
</script>
<style lang="less" scoped></style>
...@@ -6,36 +6,39 @@ ...@@ -6,36 +6,39 @@
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)" element-loading-background="rgba(0, 0, 0, 0.8)"
> >
<!-- 商品详情信息 -->
<div class="activityInfo-wrapper"> <div class="activityInfo-wrapper">
<el-card class="activityInfo"> <el-card class="activityInfo">
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.order_count }}</p> <p class="infoItemText">{{ detailInfo.sumOrder }}</p>
<p>订单数量</p> <p>订单数量</p>
</div> </div>
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.sold_goods_count }}</p> <p class="infoItemText">{{ detailInfo.sumGoods }}</p>
<p>已售商品数量</p> <p>已售商品数量</p>
</div> </div>
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.pay_amount_count }}</p> <p class="infoItemText">{{ detailInfo.payAmount }}</p>
<p>支付金额</p> <p>支付金额</p>
</div> </div>
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.discount_amount_count }}</p> <p class="infoItemText">{{ detailInfo.sumCouponAmount }}</p>
<p>优惠金额</p> <p>优惠金额</p>
</div> </div>
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.refund_count }}</p> <p class="infoItemText">{{ detailInfo.refundAmount }}</p>
<p>退款</p> <p>退款</p>
</div> </div>
<div class="infoItem"> <div class="infoItem">
<p class="infoItemText">{{ detailInfo.real_income_count }}</p> <p class="infoItemText">{{ detailInfo.income }}</p>
<p>实际收入</p> <p>实际收入</p>
</div> </div>
</el-card> </el-card>
</div> </div>
<!-- 商品详情 -->
<div class="activityDetail"> <div class="activityDetail">
<section class="content"> <section class="content">
<!-- 商品列表 -->
<el-card class="activityGoods box-card"> <el-card class="activityGoods box-card">
<div class="my-header"> <div class="my-header">
<h3>{{ marketingInfo.marketing_name }}</h3> <h3>{{ marketingInfo.marketing_name }}</h3>
...@@ -58,6 +61,7 @@ ...@@ -58,6 +61,7 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 商品描述 -->
<el-card class="activityIntroduce box-card"> <el-card class="activityIntroduce box-card">
<p class="introduceText"> <p class="introduceText">
{{ marketingInfo.pindan_desc }} {{ marketingInfo.pindan_desc }}
...@@ -84,7 +88,7 @@ ...@@ -84,7 +88,7 @@
fit="fit" fit="fit"
></el-image> ></el-image>
<div class="itemIntroduce"> <div class="itemIntroduce">
<p>{{ goodsItem.desc }}</p> <p>{{ goodsItem.goods_name }}</p>
<p class="price"> <p class="price">
<span class="nowPrice">{{ `¥${goodsItem.price}` }}</span> <span class="nowPrice">{{ `¥${goodsItem.price}` }}</span>
<span class="originPrice">{{ <span class="originPrice">{{
...@@ -96,6 +100,15 @@ ...@@ -96,6 +100,15 @@
</el-card> </el-card>
</section> </section>
</div> </div>
<div class="button-close">
<el-button
class="button-block"
size="medium"
type="primary"
@click="closePage"
> </el-button
>
</div>
</div> </div>
</template> </template>
...@@ -105,7 +118,6 @@ import { ElMessage } from "element-plus"; ...@@ -105,7 +118,6 @@ import { ElMessage } from "element-plus";
import dayJs from "dayjs"; import dayJs from "dayjs";
export default { export default {
components: {},
props: {}, props: {},
data() { data() {
return { return {
...@@ -132,10 +144,6 @@ export default { ...@@ -132,10 +144,6 @@ export default {
marketing_id: this.$route.query.marketing_id marketing_id: this.$route.query.marketing_id
}) })
]); ]);
// let data = await ActivityService.checkActivityDetail({
// marketing_id: this.$route.query.marketing_id,
// marketing_type: this.$route.query.marketing_type
// });
this.pageLoading = false; this.pageLoading = false;
this.goodsList = dataArr[0].result.goods_list; this.goodsList = dataArr[0].result.goods_list;
...@@ -171,6 +179,8 @@ export default { ...@@ -171,6 +179,8 @@ export default {
this.showTimer = "已结束"; this.showTimer = "已结束";
} }
}, },
// 定时器
myTimer() { myTimer() {
let dateNow = dayJs(); let dateNow = dayJs();
this.timer = setInterval(() => { this.timer = setInterval(() => {
...@@ -181,6 +191,10 @@ export default { ...@@ -181,6 +191,10 @@ export default {
clearInterval(this.timer); clearInterval(this.timer);
} }
}, 1000); }, 1000);
},
closePage() {
this.$router.go(-1);
} }
}, },
async created() { async created() {
...@@ -196,6 +210,7 @@ export default { ...@@ -196,6 +210,7 @@ export default {
.wrapper { .wrapper {
height: 100%; height: 100%;
display: flex; display: flex;
overflow-y: scroll;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
...@@ -214,9 +229,6 @@ export default { ...@@ -214,9 +229,6 @@ export default {
.infoItemText { .infoItemText {
font-weight: bolder; font-weight: bolder;
} }
// display: flex;
// align-items: center;
// justify-content: center;
} }
} }
.activityDetail { .activityDetail {
...@@ -287,5 +299,11 @@ export default { ...@@ -287,5 +299,11 @@ export default {
} }
} }
} }
.button-close {
margin: 10px 0 30px;
.button-block {
width: 200px;
}
}
} }
</style> </style>
<template> <template>
<layout>
<div <div
class="manage-wrapper" class="manage-wrapper"
v-loading="tableLoading" v-loading="tableLoading"
...@@ -83,7 +84,12 @@ ...@@ -83,7 +84,12 @@
width="width" width="width"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" prop="scope" label="操作" width="250"> <el-table-column
align="center"
prop="scope"
label="操作"
width="250"
>
<template #default="scope"> <template #default="scope">
<div class="button-one"> <div class="button-one">
<el-button <el-button
...@@ -112,7 +118,9 @@ ...@@ -112,7 +118,9 @@
> >
<template #reference> <template #reference>
<el-button <el-button
v-show="scope.row.status === 2 || scope.row.status === 3" v-show="
scope.row.status === 2 || scope.row.status === 3
"
type="primary" type="primary"
size="small" size="small"
@click="handleStart(scope.row)" @click="handleStart(scope.row)"
...@@ -147,13 +155,19 @@ ...@@ -147,13 +155,19 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<YDDialog />
</layout>
</template> </template>
<script> <script>
import layout from "../../Groupmeal/layout/index.vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import ActivityService from "@/service/Activity/index"; import ActivityService from "@/service/Activity/index";
import dayJs from "dayjs"; import dayJs from "dayjs";
export default { export default {
name: "Manage", name: "Manage",
components: {
layout
},
data() { data() {
return { return {
activity: { activity: {
...@@ -228,7 +242,10 @@ export default { ...@@ -228,7 +242,10 @@ export default {
if (dateNow.diff(dayJs(item.start_time)) < 0) { if (dateNow.diff(dayJs(item.start_time)) < 0) {
// 开始时间大于当前时间 return 未开始 // 开始时间大于当前时间 return 未开始
activityStatusText = "未开始"; activityStatusText = "未开始";
} else if (dayJs(item.end_time).diff(dayJs(item.start_time)) > 0) { } else if (
dateNow.diff(dayJs(item.start_time)) > 0 &&
dateNow.diff(dayJs(item.end_time)) < 0
) {
// 结束时间大于开始时间 return 进行中 // 结束时间大于开始时间 return 进行中
activityStatusText = "进行中"; activityStatusText = "进行中";
} else if (dateNow.diff(dayJs(item.end_time)) > 0) { } else if (dateNow.diff(dayJs(item.end_time)) > 0) {
...@@ -255,7 +272,6 @@ export default { ...@@ -255,7 +272,6 @@ export default {
// 点击活动标题 // 点击活动标题
async handleHeadline(val) { async handleHeadline(val) {
console.log(val);
this.$router.push({ this.$router.push({
name: "ActivityDetail", name: "ActivityDetail",
query: { query: {
...@@ -282,20 +298,23 @@ export default { ...@@ -282,20 +298,23 @@ export default {
handleEnd(val) { handleEnd(val) {
this.storeQuery = { this.storeQuery = {
marketing_id: val.activiteId, marketing_id: val.activiteId,
online_status: 2 // 1 启用 2 关闭 online_status: 2, // 1 启用 2 关闭
marketing_type: 4
// end_time: dayJs().format("YYYY-MM-DD HH:mm:ss")
}; };
}, },
// 开始 // 开始
handleStart(val) { handleStart(val) {
this.storeQuery = { this.storeQuery = {
marketing_id: val.activiteId, marketing_id: val.activiteId,
online_status: 1 // 1 启用 2 关闭 online_status: 1, // 1 启用 2 关闭
marketing_type: 4
}; };
}, },
// 查看详情 // 查看详情
handleLook(row) { handleLook(row) {
this.$router.push({ this.$router.push({
path: "/op/groupmeal/orderManagement", path: "/op/groupmeal/newOrderManagement",
query: { query: {
marketing_id: row.activiteId, marketing_id: row.activiteId,
marketing_type: row.marketing_type marketing_type: row.marketing_type
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<el-table-column prop="total_amount_sold" label="已售数量"> <el-table-column prop="total_amount_sold" label="已售数量">
</el-table-column> </el-table-column>
<el-table-column prop="inventory_rest" label="剩余库存"></el-table-column> <el-table-column prop="inventory_rest" label="剩余库存"></el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="120">
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
...@@ -65,15 +65,17 @@ ...@@ -65,15 +65,17 @@
> >
<el-form-item label="图片:"> <el-form-item label="图片:">
<el-upload <el-upload
:class="{ hide: hideUpload }"
:data="{ type: 1 }" :data="{ type: 1 }"
:action="uploadUrl" :action="uploadUrl"
:on-preview="previewImage" :on-preview="previewImage"
:on-success="handleDetailSuccess" :on-success="handleDetailSuccess"
:on-change="handleDetailChange"
:before-remove="removeDetailFiles" :before-remove="removeDetailFiles"
:file-list="picUrlList" :file-list="picUrlList"
auto-upload auto-upload
ref="picUpload" ref="picUpload"
:limit="1" :limit="limitCount"
list-type="picture-card" list-type="picture-card"
multiple multiple
> >
...@@ -117,21 +119,25 @@ ...@@ -117,21 +119,25 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item label="库存:"> <el-form-item label="新增库存:">
<el-input <el-input
v-model="commodityForm.inventory_total" v-model="commodityForm.inventory_total"
placeholder="" placeholder=""
oninput="this.value = this.value.replace(/[^0-9]/g, '');" @input="inventoryIpt"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<div style="display: inline-block; height: 42px; margin-left: 33px"> <div style="display: inline-block; height: 42px; margin-left: 33px">
已售:<span style="margin-right: 10px">{{ 已售:<span style="margin-right: 10px">{{
commodityForm.total_amount_order commodityForm.total_amount_sold
}}</span> }}</span>
剩余库存:<span>{{ inventoryRest }}</span> 剩余库存:<span>{{ inventoryRest }}</span>
</div> </div>
<br /> <br />
<el-form-item label="商家"> <el-form-item
label="商家"
prop="business1"
:rules="[{ required: true, message: '请选择商家' }]"
>
<el-select v-model="commodityForm.business1" placeholder="请选择"> <el-select v-model="commodityForm.business1" placeholder="请选择">
<el-option <el-option
v-for="item in businessOpt" v-for="item in businessOpt"
...@@ -177,7 +183,7 @@ ...@@ -177,7 +183,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<span class="dioFor">已选:{{ multipleSelection.length }}</span> <span class="dioFor">已选:{{ multipleSelection.length }}</span>
<el-table <el-table
:data="comLibTableData" :data="comLibTableData"
class="comLibTableData" class="comLibTableData"
...@@ -205,7 +211,7 @@ ...@@ -205,7 +211,7 @@
prop="inventory_rest" prop="inventory_rest"
label="剩余库存" label="剩余库存"
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="100"> <el-table-column label="操作" width="100">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@click="commodity('update', scope.row)" @click="commodity('update', scope.row)"
...@@ -248,6 +254,10 @@ export default { ...@@ -248,6 +254,10 @@ export default {
type: Array, type: Array,
required: () => {}, required: () => {},
}, },
stepTwoTitle: {
type: String,
default: "",
},
}, },
data() { data() {
return { return {
...@@ -270,11 +280,13 @@ export default { ...@@ -270,11 +280,13 @@ export default {
total_amount_order: null, total_amount_order: null,
business1: "", business1: "",
}, },
picStr: "",
picUrlList: [], picUrlList: [],
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址 uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
hideUpload: false,
limitCount: 1,
// 商品库添加 // 商品库添加
selCommodityPopup: false, // 商品库添加弹窗状态 selCommodityPopup: false, // 商品库添加弹窗状态
...@@ -282,21 +294,24 @@ export default { ...@@ -282,21 +294,24 @@ export default {
multipleSelection: [], // 勾选的数据 multipleSelection: [], // 勾选的数据
goodsSkuID: "", goodsSkuID: "",
inventoryTotal: 0, // 总库存
inventoryRest: 0, // 剩余库存
}; };
}, },
computed: { // computed: {
// 计算剩余库存 // // 计算剩余库存
inventoryRest() { // inventoryRest() {
if (this.commodityForm.inventory_total == null) { // if (this.commodityForm.inventory_total == null) {
return 0; // return 0;
} else { // } else {
return Number( // return Number(
this.commodityForm.inventory_total - // this.commodityForm.inventory_total -
this.commodityForm.total_amount_order // this.commodityForm.total_amount_order
); // );
} // }
}, // },
}, // },
methods: { methods: {
// 上移 // 上移
upMove(index) { upMove(index) {
...@@ -320,24 +335,43 @@ export default { ...@@ -320,24 +335,43 @@ export default {
} }
}, },
// 库存计算
inventoryIpt(val) {
var pattern = /^-?[1-9]\d*$|^0$/g;
if (!pattern.test(this.commodityForm.inventory_total)) {
this.commodityForm.inventory_total = "";
this.inventoryRest =
this.inventoryTotal - this.commodityForm.total_amount_order;
} else {
this.inventoryRest =
Number(val) +
this.inventoryTotal -
this.commodityForm.total_amount_order;
}
},
// 展示商品大图 // 展示商品大图
previewImage(file) { previewImage(file) {
this.popoverImage = file.url; this.popoverImage = file.url;
this.isShowPopver = true; this.isShowPopver = true;
}, },
handleDetailChange() {
this.hideUpload = this.picUploadList.length >= this.limitCount;
},
// 图片上传成功时 // 图片上传成功时
handleDetailSuccess(res) { handleDetailSuccess(res) {
this.picStr = res.result.image_id;
this.picUploadList.push(res.result.image_id); this.picUploadList.push(res.result.image_id);
}, },
// 图片删除后 // 图片删除后
removeDetailFiles(file, fileList) { removeDetailFiles() {
for (let i = 0; i < fileList.length; i++) { this.picStr = "";
if (fileList[i].uid == file.uid) { this.picUrlList = [];
this.picUploadList.splice(i, 1); this.picUploadList = [];
} // this.hideUpload = this.picUploadList.length >= this.limitCount;
}
}, },
// 获取商家 // 获取商家
...@@ -357,28 +391,40 @@ export default { ...@@ -357,28 +391,40 @@ export default {
// 查看商品详情 // 查看商品详情
async markGoodsInfoMet(goodSkuID) { async markGoodsInfoMet(goodSkuID) {
this.picUrlList = [];
let params = { goods_sku_id: goodSkuID, marketing_type: "4" }; let params = { goods_sku_id: goodSkuID, marketing_type: "4" };
const res = await markGoodsInfo(params); const res = await markGoodsInfo(params);
this.inventoryRest = res.result.goods_info.inventory_rest;
this.inventoryTotal = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info; this.commodityForm = res.result.goods_info;
this.commodityForm.business1 = res.result.goods_info.ota_id; this.commodityForm.business1 = res.result.goods_info.ota_id;
this.picUrlList = [];
for (var i in res.result.goods_info.desc_pic_url_list) { for (var i in res.result.goods_info.desc_pic_url_list) {
this.picUrlList.push({ this.picUrlList.push({
url: res.result.goods_info.desc_pic_url_list[i], url: res.result.goods_info.desc_pic_url_list[i],
}); });
} }
this.picStr = this.getUrlParms(
res.result.goods_info.desc_pic_url_list[0],
"url"
);
},
getUrlParms(path, name) {
var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
if (reg.test(path)) return unescape(RegExp.$2.replace(/\+/g, " "));
return "";
}, },
// 编辑商品详情 // 编辑商品详情
async editGoodsMet(goodsSkuID) { async editGoodsMet(goodsSkuID) {
const res = await editGoods({ const res = await editGoods({
goods_name: this.commodityForm.goods_name, goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picUploadList.join(","), desc_pic_url: this.picStr,
desc: "", desc: "",
inventory_add: this.commodityForm.inventory_total, inventory_add: this.commodityForm.inventory_total,
original_price: this.commodityForm.original_price, original_price: this.commodityForm.original_price,
price: this.commodityForm.price, price: this.commodityForm.price,
marketing_name: this.editInfo.title, marketing_name: this.editInfo.marketing_name,
marketing_type: "4", marketing_type: "4",
ota_id: this.commodityForm.business1, ota_id: this.commodityForm.business1,
op_cur_user: store.state.userInfo.email, op_cur_user: store.state.userInfo.email,
...@@ -389,7 +435,19 @@ export default { ...@@ -389,7 +435,19 @@ export default {
message: "修改成功", message: "修改成功",
type: "success", type: "success",
}); });
this.pindanGoodsMet(); await this.pindanGoodsMet();
let result = null;
for (var j in this.comLibTableData) {
if (this.comLibTableData[j].goods_sku_id == goodsSkuID) {
result = this.comLibTableData[j];
}
}
for (var i in this.comTableData) {
if (this.comTableData[i].goods_sku_id == result.goods_sku_id) {
this.comTableData.splice(i, 1, result);
}
}
this.addCommodityPopup = false; this.addCommodityPopup = false;
} else { } else {
ElMessage.error(res.reason); ElMessage.error(res.reason);
...@@ -405,11 +463,18 @@ export default { ...@@ -405,11 +463,18 @@ export default {
// 添加修改商品 // 添加修改商品
async commodity(type, val) { async commodity(type, val) {
this.$refs.picUpload && this.$refs.picUpload.clearFiles && this.$refs.picUpload.clearFiles();
this.picUrlList = [];
this.picStr = ''
this.addCommodityPopup = true; this.addCommodityPopup = true;
this.commodityForm = {}; this.commodityForm = {};
if (type == "add") { if (type == "add") {
this.hideUpload = false;
this.inventoryRest = 0;
this.commodityForm.total_amount_order = 0; this.commodityForm.total_amount_order = 0;
this.addCommodityTitle = "商品添加"; this.addCommodityTitle = "商品添加";
this.$refs.infoForm.resetFields();
} else { } else {
this.addCommodityTitle = "商品编辑"; this.addCommodityTitle = "商品编辑";
this.goodsSkuID = val.goods_sku_id; this.goodsSkuID = val.goods_sku_id;
...@@ -420,9 +485,9 @@ export default { ...@@ -420,9 +485,9 @@ export default {
// 添加商品 // 添加商品
async addGoodsMet() { async addGoodsMet() {
const res = await addGoods({ const res = await addGoods({
marketing_name: this.editInfo.title, marketing_name: this.stepTwoTitle,
goods_name: this.commodityForm.goods_name, goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picUploadList.join(","), desc_pic_url: this.picStr,
desc: "", desc: "",
inventory: this.commodityForm.inventory_total, inventory: this.commodityForm.inventory_total,
original_price: this.commodityForm.original_price, original_price: this.commodityForm.original_price,
...@@ -436,8 +501,8 @@ export default { ...@@ -436,8 +501,8 @@ export default {
message: "添加商品成功", message: "添加商品成功",
type: "success", type: "success",
}); });
// [res.result.goods_info, ...this.multipleSelection];
this.comTableData.push(res.result.goods_info); this.comTableData.push(res.result.goods_info);
// this.$refs.picUpload.clearFiles();
this.addCommodityPopup = false; this.addCommodityPopup = false;
} else { } else {
ElMessage.error(res.reason); ElMessage.error(res.reason);
...@@ -491,17 +556,21 @@ export default { ...@@ -491,17 +556,21 @@ export default {
if (this.comTableData.length == 0) { if (this.comTableData.length == 0) {
this.comTableData.push(...this.multipleSelection); this.comTableData.push(...this.multipleSelection);
} else { } else {
for (var i in this.comTableData) { this.multipleSelection.forEach((item) => {
for(var j in this.multipleSelection) let num = 0;
if ( this.comTableData.some((val) => {
this.comTableData[i].goods_sku_id != num++;
this.multipleSelection[j].goods_sku_id if (val.goods_sku_id === item.goods_sku_id) {
) { val.goods_sku_id = item.goods_sku_id;
continue; if (num == 1) {
} else { ElMessage.error("商品添加重复,已过滤掉重复选项");
this.comTableData.push(this.multipleSelection[j]);
} }
return true;
} else if (num === this.comTableData.length) {
this.comTableData.push(Object.assign({}, item));
} }
});
});
} }
}, },
...@@ -523,6 +592,13 @@ export default { ...@@ -523,6 +592,13 @@ export default {
} }
this.comTableData = newVal; this.comTableData = newVal;
}, },
picUrlList: function () {
if(this.picUrlList.length >= this.limitCount) {
this.hideUpload = true
}else {
this.hideUpload = false
}
}
}, },
created() { created() {
this.getBusinessListMet(); this.getBusinessListMet();
...@@ -531,7 +607,7 @@ export default { ...@@ -531,7 +607,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.addProduc { .addProduc {
width: 64%; width: 90%;
margin: 0 auto; margin: 0 auto;
} }
...@@ -561,4 +637,8 @@ export default { ...@@ -561,4 +637,8 @@ export default {
.price /deep/ .el-input__inner { .price /deep/ .el-input__inner {
text-align: left; text-align: left;
} }
.hide /deep/ .el-upload--picture-card {
display: none;
}
</style> </style>
...@@ -14,15 +14,17 @@ ...@@ -14,15 +14,17 @@
</el-form-item> </el-form-item>
<el-form-item label="图片:"> <el-form-item label="图片:">
<el-upload <el-upload
:class="{ hide: hideUpload }"
:data="{ type: 1 }" :data="{ type: 1 }"
:action="uploadUrl" :action="uploadUrl"
:on-preview="previewImage" :on-preview="previewImage"
:on-success="handleDetailSuccess" :on-success="handleDetailSuccess"
:on-change="handleDetailChange"
:before-remove="removeDetailFiles" :before-remove="removeDetailFiles"
:file-list="infoEditForm.picUrlList" :file-list="infoEditForm.picUrlList"
auto-upload auto-upload
ref="picUpload" ref="picUpload"
:limit="9" :limit="limitCount"
list-type="picture-card" list-type="picture-card"
multiple multiple
> >
...@@ -43,9 +45,14 @@ ...@@ -43,9 +45,14 @@
import { GOODS_URI } from "../../../../../server/config"; import { GOODS_URI } from "../../../../../server/config";
export default { export default {
props: { props: {
editInfo: { infoEditArr: {
type: Object, type: Object,
required: () => {} default: () => {
return {
pindan_pic_url: []
};
},
require: true
} }
}, },
data() { data() {
...@@ -56,13 +63,37 @@ export default { ...@@ -56,13 +63,37 @@ export default {
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表 picUrlList: [] // 图片回显列表
}, },
picSubmitList: [], // 发布功能需要的图片列表
propData: {}, propData: {},
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址 uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
hideUpload: false,
limitCount: 9
}; };
}, },
watch: {
infoEditArr: {
// 监听props属性 展示自提点列表
handler: function(newVal) {
if (this.$route.query.marketing_id) {
this.propData = newVal;
this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
});
this.picSubmitList.push({
url: this.propData.pindan_pic_url[i]
});
}
this.hideUpload = this.picSubmitList.length >= this.limitCount; // 大于9 隐藏
}
},
deep: true,
immediate: true
}
},
methods: { methods: {
// 展示商品大图 // 展示商品大图
previewImage(file) { previewImage(file) {
...@@ -70,18 +101,28 @@ export default { ...@@ -70,18 +101,28 @@ export default {
this.isShowPopver = true; this.isShowPopver = true;
}, },
handleDetailChange() {
this.hideUpload = this.picSubmitList.length >= this.limitCount;
},
// 图片上传成功时 // 图片上传成功时
handleDetailSuccess(res) { handleDetailSuccess(res) {
this.infoEditForm.picUploadList.push(res.result.image_id); this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id
this.picSubmitList.push({
// 发布功能需要的图片列表
url: res.result.url
});
this.hideUpload = this.picSubmitList.length >= this.limitCount;
}, },
// 图片删除后 // 图片删除后
removeDetailFiles(file, fileList) { removeDetailFiles(file, fileList) {
for (let i = 0; i < fileList.length; i++) { for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid == file.uid) { if (fileList[i].uid == file.uid) {
this.infoEditForm.picUploadList.splice(i, 1); this.picSubmitList.splice(i, 1);
} }
} }
this.hideUpload = this.picSubmitList.length >= this.limitCount;
}, },
// 获取营销活动详情 // 获取营销活动详情
...@@ -101,7 +142,7 @@ export default { ...@@ -101,7 +142,7 @@ export default {
} }
}, },
created() { created() {
this.marketingInfoMet(); // this.marketingInfoMet();
} }
}; };
</script> </script>
...@@ -111,4 +152,7 @@ export default { ...@@ -111,4 +152,7 @@ export default {
width: 64%; width: 64%;
margin: 0 auto; margin: 0 auto;
} }
.hide /deep/ .el-upload--picture-card {
display: none;
}
</style> </style>
<template> <template>
<div id="map" class="mapContainer"> <div id="map" class="mapContainer">
<!-- map -->
<div class="mapWrapper"> <div class="mapWrapper">
<div class="search"> <div class="search">
<el-form ref="form" label-width="80px">
<el-form-item label-position="left"> <el-form-item label-position="left">
<el-button @click="handleSearch">搜索</el-button> <el-button @click="handleSearch">搜索</el-button>
<el-input <el-input
class="dialog-input" class="dialog-input"
v-model="searchKey" v-model="searchKey"
placeholder="请输入关键字" placeholder="请输入关键字"
autocomplete="off" autocomplete="on"
></el-input> >
<template #suffix>
<i
@click="searchKey = ''"
class="el-input__icon el-icon-close"
></i>
</template>
</el-input>
</el-form-item> </el-form-item>
</el-form>
<div id="js-result" v-show="searchKey" class="result"></div> <div id="js-result" v-show="searchKey" class="result"></div>
</div> </div>
<div id="js-container" class="myMap"> <div id="js-container" class="myMap">
正在加载数据 ... 正在加载数据 ...
</div> </div>
</div> </div>
<!-- info -->
<div class="mapInfo"> <div class="mapInfo">
<!-- <div class="search" v-if="placeSearch">
<input type="text" placeholder="请输入关键字" v-model="searchKey" />
<button type="button" @click="handleSearch">搜索</button>
<div id="js-result" v-show="searchKey" class="result"></div>
</div> -->
<h3 class="title">拖拽选址</h3> <h3 class="title">拖拽选址</h3>
<ul class="info"> <ul class="info">
<li><span>经度:</span>{{ dragData.lng }}</li> <li><span>经度:</span>{{ dragData.lng }}</li>
...@@ -34,6 +35,10 @@ ...@@ -34,6 +35,10 @@
<li><span>地址:</span>{{ dragData.address }}</li> <li><span>地址:</span>{{ dragData.address }}</li>
</ul> </ul>
</div> </div>
<div class="confirmButton">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
</div> </div>
</template> </template>
...@@ -43,6 +48,7 @@ export default { ...@@ -43,6 +48,7 @@ export default {
name: "app", name: "app",
data() { data() {
return { return {
dialogVisible: true,
MapCityName: "北京", MapCityName: "北京",
searchKey: "", searchKey: "",
dragData: { dragData: {
...@@ -56,6 +62,15 @@ export default { ...@@ -56,6 +62,15 @@ export default {
}; };
}, },
methods: { methods: {
// 取消
cancel() {
this.$emit("hideMapDialog", false);
},
// 确认
confirm() {
this.$emit("getMapInfo", this.dragData);
this.$emit("hideMapDialog", false);
},
// 搜索 // 搜索
handleSearch() { handleSearch() {
if (this.searchKey) { if (this.searchKey) {
...@@ -75,7 +90,6 @@ export default { ...@@ -75,7 +90,6 @@ export default {
// 初始化地图 // 初始化地图
initMap() { initMap() {
let that = this;
// 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分 // 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
let AMapUI = (this.AMapUI = window.AMapUI); let AMapUI = (this.AMapUI = window.AMapUI);
let AMap = (this.AMap = window.AMap); let AMap = (this.AMap = window.AMap);
...@@ -144,18 +158,18 @@ export default { ...@@ -144,18 +158,18 @@ export default {
// 创建地图拖拽 // 创建地图拖拽
let positionPicker = new PositionPicker({ let positionPicker = new PositionPicker({
mode: "dragMap", // 设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMap' mode: "dragMap", // 设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMap'
map: map // 依赖地图对象 map: map, // 依赖地图对象
iconStyle: {
//自定义外观
url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址
size: [50, 50], //要显示的点大小,将缩放图片
ancher: [24, 40] //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
}
}); });
// 拖拽完成发送自定义 drag 事件 // 拖拽完成发送自定义 drag 事件
positionPicker.on("success", positionResult => { positionPicker.on("success", positionResult => {
// 过滤掉初始化地图后的第一次默认拖放
if (!this.dragStatus) {
this.dragStatus = true;
} else {
this.dragMap(positionResult); this.dragMap(positionResult);
that.$emit("getMapInfo", this.dragData);
}
}); });
// 启动拖放 // 启动拖放
positionPicker.start(); positionPicker.start();
...@@ -179,6 +193,15 @@ export default { ...@@ -179,6 +193,15 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mapDialog {
margin-top: 11vh !important;
display: flex !important;
flex-direction: column !important;
background: red !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
.mapContainer { .mapContainer {
height: 100%; height: 100%;
width: 100%; width: 100%;
...@@ -199,7 +222,7 @@ export default { ...@@ -199,7 +222,7 @@ export default {
} }
.myMap { .myMap {
height: 100%; height: 100%;
height: 500px; height: 100%;
} }
} }
.mapInfo { .mapInfo {
...@@ -213,6 +236,11 @@ export default { ...@@ -213,6 +236,11 @@ export default {
text-align: left; text-align: left;
} }
} }
.confirmButton {
position: absolute;
bottom: 100px;
right: 100px;
}
} }
.m-map .search { .m-map .search {
position: absolute; position: absolute;
...@@ -228,66 +256,4 @@ export default { ...@@ -228,66 +256,4 @@ export default {
padding: 5px; padding: 5px;
outline: none; outline: none;
} }
// .g-wraper {
// width: 1000px;
// margin: 0 auto;
// color: #666;
// font-size: 16px;
// line-height: 30px;
// }
// .m-part {
// margin-bottom: 30px;
// }
// .m-part::after {
// content: "";
// display: block;
// clear: both;
// }
// .m-part .title {
// font-size: 30px;
// line-height: 60px;
// margin-bottom: 10px;
// color: #333;
// }
// .m-part .mapbox {
// width: 600px;
// height: 400px;
// margin-bottom: 20px;
// float: left;
// }
// .m-part .info {
// margin: 0;
// padding: 0;
// list-style: none;
// line-height: 30px;
// margin-left: 620px;
// }
// .m-part .info span {
// display: block;
// color: #999;
// }
// .m-part ol {
// line-height: 40px;
// margin-left: 0;
// padding-left: 0;
// }
// .m-part pre {
// padding: 10px 20px;
// line-height: 30px;
// border-radius: 3px;
// box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
// }
// .m-footer {
// background: #eee;
// line-height: 60px;
// text-align: center;
// color: #999;
// font-size: 12px;
// }
// .m-footer a {
// margin: 0 5px;
// color: #999;
// text-decoration: none;
// }
</style> </style>
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
class="startTimePicker" class="startTimePicker"
v-model="startDate" v-model="startDate"
type="datetime" type="datetime"
popper-class="date_picker"
:disabledDate="pickerOptions.disabledDateStart" :disabledDate="pickerOptions.disabledDateStart"
:default-value="new Date()"
placeholder="拼单开始时间" placeholder="拼单开始时间"
@change="changeStartTime" @change="changeStartTime"
> >
...@@ -16,15 +16,14 @@ ...@@ -16,15 +16,14 @@
<el-date-picker <el-date-picker
class="endTimePicker" class="endTimePicker"
v-model="endDate" v-model="endDate"
:clearable="false"
type="datetime" type="datetime"
:default-value="new Date()"
placeholder="拼单结束时间" placeholder="拼单结束时间"
:disabledDate="pickerOptions.disabledDateEnd" :disabledDate="option1"
@change="changeEndTime" @change="changeEndTime"
> >
</el-date-picker> </el-date-picker>
</div> </div>
<!-- 自提点列表 --> <!-- 自提点列表 -->
<div <div
class="card-wrapper" class="card-wrapper"
...@@ -35,7 +34,7 @@ ...@@ -35,7 +34,7 @@
> >
<el-card class="card-block"> <el-card class="card-block">
<p>自提点设置</p> <p>自提点设置</p>
<el-form ref="form" :model="selfLiftingPoint" label-width="80px"> <el-form ref="form" label-width="80px">
<el-form-item> <el-form-item>
<el-input <el-input
class="set" class="set"
...@@ -166,11 +165,8 @@ ...@@ -166,11 +165,8 @@
placeholder="" placeholder=""
:disabled="true" :disabled="true"
></el-input> ></el-input>
<a <el-button type="primary" @click="mapDialogVisible = true"
href="javascript:;" >从高德获取坐标</el-button
style="margin-left: 30px"
@click="mapDialogVisible = true"
>从高德获取坐标</a
> >
</el-form-item> </el-form-item>
<p class="location">{{ form.location }}</p> <p class="location">{{ form.location }}</p>
...@@ -212,13 +208,11 @@ ...@@ -212,13 +208,11 @@
<!-- 地图 dialog --> <!-- 地图 dialog -->
<el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%"> <el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%">
<my-map class="my-map" @getMapInfo="getMapInfo" /> <my-map
<div class="confirmButton"> class="my-map"
<el-button @click="mapDialogVisible = false"> </el-button> @getMapInfo="getMapInfo"
<el-button type="primary" @click="mapDialogVisible = false" @hideMapDialog="mapDialogVisible = false"
> </el-button />
>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -239,28 +233,19 @@ let checkphone = (rule, value, callback) => { ...@@ -239,28 +233,19 @@ let checkphone = (rule, value, callback) => {
callback(); callback();
} }
}; };
export default { export default {
data() { data() {
return { return {
startDate: dayJs(), //开始时间 startDate: dayJs().format("YYYY-MM-DD HH:mm:ss"), //开始时间
endDate: dayJs().add(7, "day"), // 结束时间 endDate: dayJs()
.add(7, "day")
.format("YYYY-MM-DD HH:mm:ss"), // 结束时间
pickerOptions: { pickerOptions: {
disabledDateStart(time) { disabledDateStart(time) {
let _now = Date.now(); let _now = Date.now();
// let three = 3 * 24 * 60 * 60 * 1000;
let threeDays = _now + 3 * 24 * 60 * 60 * 1000; let threeDays = _now + 3 * 24 * 60 * 60 * 1000;
return time.getTime() < _now || time.getTime() > threeDays; //大于当前的禁止,小于3天前的禁止 return time.getTime() < _now - 8.64e7 || time.getTime() > threeDays; //大于当前的禁止,小于3天前的禁止
},
disabledDateEnd(time) {
let _now = null;
if (this.startDate) {
_now = this.startDate;
} else {
_now = Date.now();
}
let ninety = 90 * 24 * 60 * 60 * 1000;
let ninetyDays = _now + ninety;
return time.getTime() < _now || time.getTime() > ninetyDays; //大于当前的禁止,小于90天前的禁止
} }
}, },
mapDialogVisible: false, mapDialogVisible: false,
...@@ -270,7 +255,9 @@ export default { ...@@ -270,7 +255,9 @@ export default {
{ required: true, message: "请输入自提点名称", trigger: "blur" }, { required: true, message: "请输入自提点名称", trigger: "blur" },
{ min: 0, max: 30, message: "长度在 0 到 30 个字符", trigger: "blur" } { min: 0, max: 30, message: "长度在 0 到 30 个字符", trigger: "blur" }
], ],
location: [{ required: true, message: "请输入位置", trigger: "blur" }], location: [
{ required: true, message: "请输入位置", trigger: "change" }
],
address: [ address: [
{ required: true, message: "请输入详细地址", trigger: "blur" } { required: true, message: "请输入详细地址", trigger: "blur" }
], ],
...@@ -306,16 +293,32 @@ export default { ...@@ -306,16 +293,32 @@ export default {
} // 添加自提点 详细信息 } // 添加自提点 详细信息
}; };
}, },
computed: {
option1() {
let _this = this;
return function(time) {
let _now = Date.now();
let ninety = 90 * 24 * 60 * 60 * 1000;
let ninetyDays = _now + ninety;
return (
time.getTime() < _this.startDate - 8.64e7 ||
time.getTime() < _now - 8.64e7 ||
time.getTime() > ninetyDays
); //大于当前的禁止,小于90天前的禁止
};
}
},
props: { props: {
spellOrderSetArr: { spellOrderSetArr: {
type: Array, type: Array,
default: () => [] default: () => []
}, },
startTime1: { startTime: {
type: String, type: String,
default: "" default: ""
}, },
endTime1: { endTime: {
type: String, type: String,
default: "" default: ""
} }
...@@ -334,8 +337,8 @@ export default { ...@@ -334,8 +337,8 @@ export default {
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
await this.getPlaceList(); await this.getPlaceList();
// 时间赋值 // 时间赋值
this.startDate = this.startTime1; this.startDate = this.startTime;
this.endDate = this.endTime1; this.endDate = this.endTime;
this.checkedTakePlacelist = this.setTableListData( this.checkedTakePlacelist = this.setTableListData(
this.spellOrderSetArr this.spellOrderSetArr
); // 选中的自提点列表 ); // 选中的自提点列表
...@@ -404,11 +407,13 @@ export default { ...@@ -404,11 +407,13 @@ export default {
// 添加自提点 // 添加自提点
async addPlace() { async addPlace() {
let params = Object.assign(this.form, { let params = Object.assign(this.form, {
take_place_id: this.id //搜索关键词 take_place_id: this.id, //搜索关键词
contact_name:this.form.contactor
}); });
try { try {
this.pageLoading = true; this.pageLoading = true;
await ActivityService.addPlace(params); await ActivityService.addPlace(params);
await this.getPlaceList();
this.pageLoading = false; this.pageLoading = false;
} catch { } catch {
this.pageLoading = false; this.pageLoading = false;
...@@ -421,7 +426,7 @@ export default { ...@@ -421,7 +426,7 @@ export default {
let result = data.map(item => { let result = data.map(item => {
return { return {
name: item.take_place_name, name: item.take_place_name,
location: item.province + item.city + item.area, // p + c + a location: item.location, // p + c + a
address: item.address, address: item.address,
contactor: item.contact_name, contactor: item.contact_name,
id: item.take_place_id id: item.take_place_id
...@@ -504,8 +509,8 @@ export default { ...@@ -504,8 +509,8 @@ export default {
this.form.province = mapInfo.province; this.form.province = mapInfo.province;
this.form.city = mapInfo.city; this.form.city = mapInfo.city;
this.form.area = mapInfo.area; this.form.area = mapInfo.area;
this.form.longitude = mapInfo.lat; // longitude latitude contactor this.form.longitude = mapInfo.lng; // longitude latitude contactor
this.form.latitude = mapInfo.lng; this.form.latitude = mapInfo.lat;
} }
}, },
created() { created() {
...@@ -517,6 +522,16 @@ export default { ...@@ -517,6 +522,16 @@ export default {
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.el-picker-panel {
.el-picker-panel__footer {
.el-button--text {
display: none;
}
}
}
</style>
<style lang="less">
.card-wrapper { .card-wrapper {
width: 100%; width: 100%;
//height: 500px; //height: 500px;
...@@ -571,17 +586,14 @@ export default { ...@@ -571,17 +586,14 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
// mapDialog
.mapDialog { .mapDialog {
height: 80%; height: 80%;
margin-top: 10vh !important; margin-top: 10vh !important;
.my-map { .el-dialog__body {
height: 10%; height: 85% !important;
} }
.confirmButton { .my-map {
position: absolute; height: 100%;
bottom: 100px;
right: 100px;
} }
} }
</style> </style>
...@@ -16,20 +16,21 @@ ...@@ -16,20 +16,21 @@
<infoEditing <infoEditing
ref="infoEdit" ref="infoEdit"
v-show="active === 1" v-show="active === 1"
:editInfo="infoEditArr" :infoEditArr="infoEditArr"
/> />
<addProduc <addProduc
ref="addProduc" ref="addProduc"
v-show="active === 2" v-show="active === 2"
:editInfo="infoEditArr"
:addProduc="addProducArr" :addProduc="addProducArr"
:editInfo="infoEditArr"
:stepTwoTitle="stepTwoTitle"
/> />
<spellOrderSet <spellOrderSet
ref="spellOrderSet" ref="spellOrderSet"
v-show="active === 3" v-show="active === 3"
:spellOrderSetArr="spellOrderSetArr" :spellOrderSetArr="spellOrderSetArr"
:startTime1="startTime" :startTime="startTime"
:endTime1="endTime" :endTime="endTime"
@getTakeTakePlaceListFromChild="getTakeTakePlaceListFromChild" @getTakeTakePlaceListFromChild="getTakeTakePlaceListFromChild"
/> />
</div> </div>
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
</template> </template>
<script> <script>
import store from "../../../store/index"; import dayJs from "dayjs";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import infoEditing from "./components/infoEditing.vue"; import infoEditing from "./components/infoEditing.vue";
import addProduc from "./components/addProduc.vue"; import addProduc from "./components/addProduc.vue";
...@@ -74,7 +75,10 @@ export default { ...@@ -74,7 +75,10 @@ export default {
spellOrderSetArr: [], spellOrderSetArr: [],
startDate: "", // 开始时间 startDate: "", // 开始时间
endDate: "", // 结束时间 endDate: "", // 结束时间
takePlaceIDArr: [] takePlaceIDArr: [],
startTime: "",
endTime: "",
stepTwoTitle: "" // 传给addProduct的title
}; };
}, },
...@@ -91,7 +95,7 @@ export default { ...@@ -91,7 +95,7 @@ export default {
ElMessage.error("请填写商品标题"); ElMessage.error("请填写商品标题");
return; return;
} }
this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title; this.stepTwoTitle = this.$refs.infoEdit.infoEditForm.title;
this.active = 2; this.active = 2;
} else if (this.active === 2) { } else if (this.active === 2) {
if (this.$refs.addProduc.comTableData.length == 0) { if (this.$refs.addProduc.comTableData.length == 0) {
...@@ -100,10 +104,7 @@ export default { ...@@ -100,10 +104,7 @@ export default {
} }
this.addProducArr = this.$refs.addProduc.comTableData; this.addProducArr = this.$refs.addProduc.comTableData;
this.active = 3; this.active = 3;
} else {
console.log();
} }
// this.active++;
}, },
// 获取营销活动详情 // 获取营销活动详情
...@@ -132,6 +133,16 @@ export default { ...@@ -132,6 +133,16 @@ export default {
// 确认发布 // 确认发布
async confirmRelease() { async confirmRelease() {
function getUrlParms(path, name) {
var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
if (reg.test(path)) return unescape(RegExp.$2.replace(/\+/g, " "));
return "";
}
let list = this.$refs.infoEdit.picSubmitList.map(item => {
let rs = getUrlParms(item.url, "url");
return rs;
});
let picList = list.join(",");
for (var i in this.addProducArr) { for (var i in this.addProducArr) {
this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id); this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id);
} }
...@@ -145,10 +156,10 @@ export default { ...@@ -145,10 +156,10 @@ export default {
goods_sku_id: this.goodsSkuIDArr.join(","), goods_sku_id: this.goodsSkuIDArr.join(","),
marketing_name: this.$refs.infoEdit.infoEditForm.title, marketing_name: this.$refs.infoEdit.infoEditForm.title,
marketing_type: "4", marketing_type: "4",
op_cur_user: store.state.userInfo.email, op_cur_user: this.$store.state.userInfo.email,
start_time: this.startDate, start_time: dayJs(this.startDate).format("YYYY-MM-DD HH:mm:ss"),
end_time: this.endDate, end_time: dayJs(this.endDate).format("YYYY-MM-DD HH:mm:ss"),
pindan_pic: this.$refs.infoEdit.infoEditForm.picUploadList.join(","), pindan_pic: picList,
pindan_desc: this.$refs.infoEdit.infoEditForm.desc, pindan_desc: this.$refs.infoEdit.infoEditForm.desc,
take_place_ids: this.takePlaceIDArr take_place_ids: this.takePlaceIDArr
}; };
......
...@@ -1198,6 +1198,17 @@ export default { ...@@ -1198,6 +1198,17 @@ export default {
val = 0; val = 0;
return this.$message.error("原价价格必为数字"); return this.$message.error("原价价格必为数字");
} }
const parseOriginalPrice = Number(this.goodsObj.original_price).toFixed(
2
);
this.goodsObj.original_price = Number(parseOriginalPrice);
// if (
// typeof this.goodsObj.original_price === "number" &&
// isNaN(this.goodsObj.original_price)
// ) {
// this.goodsObj.original_price = "";
// return this.$message.error("原价价格必为数字");
// }
}, },
// 审核通过 // 审核通过
...@@ -1315,10 +1326,6 @@ export default { ...@@ -1315,10 +1326,6 @@ export default {
} }
console.log(query); console.log(query);
// 是否该商品关联的分销活动满足售价-分销总金额>=结算价
// if (query.price - d >= query.clear_price) {
// return this.$message.error("请至少选择一个门店");
// }
const res = await editGoods(query); const res = await editGoods(query);
if (res.code !== 0) { if (res.code !== 0) {
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<layout> <layout>
<el-card class="goods"> <el-card class="goods">
<!-- 筛选区 --> <!-- 筛选区 -->
<el-form <el-form inline class="search_condition">
inline
class="search_condition"
>
<!-- 商品id --> <!-- 商品id -->
<el-form-item label="商品id"> <el-form-item label="商品id">
<el-input v-model="searchProps.goods_spu_id"></el-input> <el-input v-model="searchProps.goods_spu_id"></el-input>
...@@ -66,21 +63,13 @@ ...@@ -66,21 +63,13 @@
</el-form-item> </el-form-item>
<!-- 按钮操作 --> <!-- 按钮操作 -->
<el-form-item style="justify-self: flex-end;"> <el-form-item style="justify-self: flex-end;">
<el-button <el-button @click="searchList" type="primary">搜索</el-button>
@click="searchList"
type="primary"
>搜索</el-button>
<el-button @click="resetList">重置</el-button> <el-button @click="resetList">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 列表区 --> <!-- 列表区 -->
<el-table <el-table class="goods_list" :data="goodsList" border stripe>
class="goods_list"
:data="goodsList"
border
stripe
>
<el-table-column <el-table-column
label="商品id" label="商品id"
prop="goods_spu_id" prop="goods_spu_id"
...@@ -116,36 +105,33 @@ ...@@ -116,36 +105,33 @@
prop="publish_user_id" prop="publish_user_id"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column label="状态" align="center">
label="状态"
align="center"
>
<template #default="scope"> <template #default="scope">
<span <span v-if="scope.row.audit_status == 0" style="color:#FF982C;"
v-if="scope.row.audit_status == 0" >待审核</span
style="color:#FF982C;" >
>待审核</span> <span v-if="scope.row.audit_status == 1" style="color:#5CC247;"
<span >审核通过</span
v-if="scope.row.audit_status == 1" >
style="color:#5CC247;" <span v-if="scope.row.audit_status == 2" style="color:#FD6B6F;"
>审核通过</span> >审核驳回</span
<span >
v-if="scope.row.audit_status == 2"
style="color:#FD6B6F;"
>审核驳回</span>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<span <span
v-if="scope.row.online_status == 0 && scope.row.audit_status != 2" v-if="scope.row.online_status == 0 && scope.row.audit_status != 2"
style="color:#FF982C;" style="color:#FF982C;"
>未上架</span> >未上架</span
>
<span <span
v-if="scope.row.online_status == 1 && scope.row.audit_status != 2" v-if="scope.row.online_status == 1 && scope.row.audit_status != 2"
style="color:#5CC247;" style="color:#5CC247;"
>已上架</span> >已上架</span
>
<span <span
v-if="scope.row.online_status == 2 && scope.row.audit_status != 2" v-if="scope.row.online_status == 2 && scope.row.audit_status != 2"
style="color:#FD6B6F;" style="color:#FD6B6F;"
>已下架</span> >已下架</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -159,26 +145,23 @@ ...@@ -159,26 +145,23 @@
align="center" align="center"
></el-table-column> ></el-table-column>
<!-- 操作快捷键 --> <!-- 操作快捷键 -->
<el-table-column <el-table-column label="操作" align="center" fixed="right" width="200">
label="操作"
align="center"
fixed="right"
width="200"
>
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
@click="goDetail(`EDIT`, scope.row.goods_spu_id)" @click="goDetail(`EDIT`, scope.row.goods_spu_id)"
>编辑</el-button> >编辑</el-button
>
<el-button <el-button
v-if="scope.row.audit_status == 0" v-if="scope.row.audit_status == 0"
type="text" type="text"
@click="goDetail(`AUDIT`, scope.row.goods_spu_id)" @click="goDetail(`AUDIT`, scope.row.goods_spu_id)"
>审核</el-button> >审核</el-button
>
<el-popconfirm <el-popconfirm
v-if="scope.row.online_status == 2 " v-if="scope.row.online_status == 2"
title="您确定要上架该商品吗?" title="您确定要上架该商品吗?"
cancelButtonType="default" cancelButtonType="default"
@confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)" @confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
...@@ -189,7 +172,10 @@ ...@@ -189,7 +172,10 @@
</el-popconfirm> </el-popconfirm>
<el-popconfirm <el-popconfirm
v-if=" scope.row.online_status != 2 && (scope.row.audit_status == 1 || scope.row.online_status == 1) " v-if="
scope.row.online_status != 2 &&
(scope.row.audit_status == 1 || scope.row.online_status == 1)
"
title="您确定要下架该商品吗?" title="您确定要下架该商品吗?"
cancelButtonType="default" cancelButtonType="default"
@confirm=" @confirm="
...@@ -202,9 +188,10 @@ ...@@ -202,9 +188,10 @@
</el-popconfirm> </el-popconfirm>
<el-button <el-button
@click="goDetail(`DETAIL`,scope.row.goods_spu_id)" @click="goDetail(`DETAIL`, scope.row.goods_spu_id)"
type="text" type="text"
>详情</el-button> >详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -240,14 +227,14 @@ export default { ...@@ -240,14 +227,14 @@ export default {
Layout Layout
}, },
created () { created() {
// 获取级联选择 // 获取级联选择
this.getOptionList(); this.getOptionList();
// 获取商品列表 // 获取商品列表
this.getCommodityList(); this.getCommodityList();
}, },
data () { data() {
return { return {
// 级联选择器参数 // 级联选择器参数
cascaderProps: { cascaderProps: {
...@@ -300,7 +287,7 @@ export default { ...@@ -300,7 +287,7 @@ export default {
methods: { methods: {
// 获取级联选择 // 获取级联选择
async getOptionList () { async getOptionList() {
try { try {
const res = await getGoodsList(); const res = await getGoodsList();
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
...@@ -310,20 +297,20 @@ export default { ...@@ -310,20 +297,20 @@ export default {
} }
}, },
// 获取数组返回值并转换为字符串 // 获取数组返回值并转换为字符串
getVal (value, index = 0) { getVal(value, index = 0) {
const valueArray = value.map(item => { const valueArray = value.map(item => {
return item[index]; return item[index];
}); });
return valueArray.join(); return valueArray.join();
}, },
getValue (value) { getValue(value) {
const values = value.map(item => { const values = value.map(item => {
return item; return item;
}); });
return values.join(); return values.join();
}, },
// 获取列表 // 获取列表
async getCommodityList () { async getCommodityList() {
try { try {
const res = await getList(this.searchProps); const res = await getList(this.searchProps);
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
...@@ -335,25 +322,25 @@ export default { ...@@ -335,25 +322,25 @@ export default {
} }
}, },
// 所属分类赋值 // 所属分类赋值
handleTypeChange (val) { handleTypeChange(val) {
this.searchProps.category_1_id = this.getVal(val, 0); this.searchProps.category_1_id = this.getVal(val, 0);
this.searchProps.category_2_id = this.getVal(val, 1); this.searchProps.category_2_id = this.getVal(val, 1);
}, },
// 审核状态赋值 // 审核状态赋值
handleStatusChange (val) { handleStatusChange(val) {
this.searchProps.audit_status = this.getValue(val); this.searchProps.audit_status = this.getValue(val);
}, },
// 上架状态赋值 // 上架状态赋值
handleOnlineStatusChange (val) { handleOnlineStatusChange(val) {
this.searchProps.online_status = this.getValue(val); this.searchProps.online_status = this.getValue(val);
}, },
// 按条件搜索 // 按条件搜索
searchList () { searchList() {
console.log(this.searchProps); console.log(this.searchProps);
this.getCommodityList(); this.getCommodityList();
}, },
// 重置表单 // 重置表单
resetList () { resetList() {
this.searchProps = { this.searchProps = {
page: 1, // 页码 page: 1, // 页码
page_size: 20, // 页数大小 page_size: 20, // 页数大小
...@@ -372,7 +359,7 @@ export default { ...@@ -372,7 +359,7 @@ export default {
this.getCommodityList(); this.getCommodityList();
}, },
// 上架/下架操作 // 上架/下架操作
async changeGoodsState (state, spuId) { async changeGoodsState(state, spuId) {
// 上架操作 // 上架操作
if (state === "GROUNDING") { if (state === "GROUNDING") {
const res = await putOnline(spuId); const res = await putOnline(spuId);
...@@ -389,14 +376,14 @@ export default { ...@@ -389,14 +376,14 @@ export default {
}, },
// 页码变化 // 页码变化
handleCurrentChange (e) { handleCurrentChange(e) {
this.searchProps.page = e; this.searchProps.page = e;
// 获取信息 // 获取信息
this.getCommodityList(); this.getCommodityList();
}, },
// 去往详情页 // 去往详情页
goDetail (operation, spuId) { goDetail(operation, spuId) {
console.log(spuId); console.log(spuId);
this.$router.push({ name: "GoodsDetail", params: { operation, spuId } }); this.$router.push({ name: "GoodsDetail", params: { operation, spuId } });
} }
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
? (scope.row.first_commission_value + (scope.row.commission_mode==1 ? "%" : '元')) ? (scope.row.first_commission_value + (scope.row.commission_mode==1 ? "%" : '元'))
: "0%" : "0%"
}} }}
{{ scope.row.first_commission_value + (scope.row.commission_mode==1 && "%" || '元') }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -208,6 +207,7 @@ ...@@ -208,6 +207,7 @@
<el-form-item <el-form-item
label="金额计算方式:" label="金额计算方式:"
prop="commission_mode" prop="commission_mode"
:disable="disabled"
> >
<el-radio-group <el-radio-group
v-model="ruleForm.commission_mode" v-model="ruleForm.commission_mode"
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
@input="changeValue($event, 'first_commission_value')" @input="changeValue($event, 'first_commission_value')"
:disabled="shopStart !== 0" :disabled="shopStart !== 0"
> >
<template #append>{{ruleForm.commission_mode == 1? '%' : '¥'}}</template> <template #append>%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="分享者佣金: " prop="second_commission_value"> <el-form-item label="分享者佣金: " prop="second_commission_value">
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
@input="changeValue($event, 'second_commission_value')" @input="changeValue($event, 'second_commission_value')"
:disabled="shopStart !== 0" :disabled="shopStart !== 0"
> >
<template #append>{{ruleForm.commission_mode == 1? '%' : '¥'}}</template> <template #append>%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="活动生效时间:"> <el-form-item label="活动生效时间:">
...@@ -391,11 +391,10 @@ export default { ...@@ -391,11 +391,10 @@ export default {
}; };
var commissionSec = async (rule, value, callback) => { var commissionSec = async (rule, value, callback) => {
if ( if (
this.ruleForm.commission_mode == 1 && this.ruleForm.first_commission_value +
(this.ruleForm.first_commission_value +
this.ruleForm.second_commission_value > this.ruleForm.second_commission_value >
50 || 50 ||
value > 50 ) value > 50
) { ) {
callback(new Error("上线佣金与分享者佣金之和不可大于50%")); callback(new Error("上线佣金与分享者佣金之和不可大于50%"));
} else if ( } else if (
...@@ -437,7 +436,6 @@ export default { ...@@ -437,7 +436,6 @@ export default {
ruleForm: { ruleForm: {
marketing_name: "", marketing_name: "",
commission_mode: 1,
first_commission_value: "", first_commission_value: "",
second_commission_value: "", second_commission_value: "",
start_time: "", start_time: "",
...@@ -647,7 +645,6 @@ export default { ...@@ -647,7 +645,6 @@ export default {
let { let {
marketing_name, marketing_name,
first_commission_value, first_commission_value,
commission_mode,
second_commission_value, second_commission_value,
} = this.ruleForm; } = this.ruleForm;
let [start_time, end_time] = this.timeSelect || []; let [start_time, end_time] = this.timeSelect || [];
...@@ -662,7 +659,6 @@ export default { ...@@ -662,7 +659,6 @@ export default {
} }
let addParams = { let addParams = {
goods_sku_id, goods_sku_id,
commission_mode,
marketing_name, marketing_name,
first_commission_value: first_commission_value + "", first_commission_value: first_commission_value + "",
second_commission_value: second_commission_value + "", second_commission_value: second_commission_value + "",
......
...@@ -7,14 +7,13 @@ ...@@ -7,14 +7,13 @@
<div class="main"> <div class="main">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import PageHeader from '../components/PageHeader'; import PageHeader from "../components/PageHeader";
export default { export default {
components: { PageHeader }, components: { PageHeader }
}; };
</script> </script>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
> >
<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
> >
...@@ -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"
...@@ -184,7 +185,7 @@ ...@@ -184,7 +185,7 @@
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>
...@@ -207,14 +208,14 @@ import { ...@@ -207,14 +208,14 @@ import {
getList, getList,
getSaveDeliverer, getSaveDeliverer,
getAddDeliverer, getAddDeliverer,
getMarketingList newGetMarketingList,
} 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.newGetMarketingList();
}, },
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) {
...@@ -360,8 +362,16 @@ export default { ...@@ -360,8 +362,16 @@ 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 if (process.env.NODE_ENV == "test") {
ENV = "http://bp-test.ini.yidian-inc.com/";
} else {
ENV = "http://bp.ini.yidian-inc.com/";
}
url && window.open(ENV + url);
}, },
// 分配保存 // 分配保存
async save() { async save() {
...@@ -369,8 +379,15 @@ export default { ...@@ -369,8 +379,15 @@ export default {
const uids = multipleSelection.map((item) => item.deliverer_id); const uids = multipleSelection.map((item) => item.deliverer_id);
if (!selectActivity) return ElMessage("请选择活动姓名"); if (!selectActivity) return ElMessage("请选择活动姓名");
try { try {
await getSaveDeliverer({ code: selectActivity, uids: uids.join(",") }); const { code, reason } = await getSaveDeliverer({
ElMessage("分配配送员成功"); code: selectActivity,
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();
...@@ -380,23 +397,23 @@ export default { ...@@ -380,23 +397,23 @@ export default {
} }
}, },
// 分配取消 // 分配取消
assignCancel(){ assignCancel() {
this.dialogFormAssign = false this.dialogFormAssign = false;
this.getDelivererList() this.getDelivererList();
this.resetDate() this.resetDate();
}, },
// 活动名称列表 // 活动名称列表
async getMarketingList() { async newGetMarketingList() {
try { try {
const res = await getMarketingList(); const res = await newGetMarketingList();
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);
} }
}, },
// 分配配送员列表 // 分配配送员列表
......
const headerConfig = [ const headerConfig = [
{
name: "活动管理",
path: "/op/activity/manage"
},
{ {
name: "订单管理", name: "订单管理",
path: "/op/groupmeal/orderManagement" path: "/op/groupmeal/orderManagement"
}, },
{ {
path: '/op/groupmeal/distrib', name: "新订单管理",
name: '配送员管理' path: "/op/groupmeal/newOrderManagement"
}, },
{
path: "/op/groupmeal/distrib",
name: "配送员管理"
}
]; ];
export default headerConfig; export default headerConfig;
...@@ -7,14 +7,13 @@ ...@@ -7,14 +7,13 @@
<div class="main"> <div class="main">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import PageHeader from '../components/PageHeader'; import PageHeader from "../components/PageHeader";
export default { export default {
components: { PageHeader }, components: { PageHeader }
}; };
</script> </script>
......
<template>
<Layout>
<div class="orderManage">
<!-- 查询栏 -->
<el-form
:inline="true"
:model="orderQueryObj"
ref="ruleForm"
class="demo-form-inline"
>
<el-form-item label="活动名称:" prop="marketing_id">
<el-select
v-model="orderQueryObj.marketing_id"
placeholder="请选择"
@change="activityNameSel"
@focus="activityNameFocus"
filterable
>
<el-option
v-for="item in activityNameArr"
:key="item.marketing_id"
:label="item.marketing_name"
:value="item.marketing_id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="订单状态:" prop="order_status">
<el-select v-model="orderQueryObj.order_status" placeholder="请选择">
<el-option
v-for="item in orderStatusArr"
:key="item.value"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="商品名称:" prop="goods_id">
<el-select
v-model="orderQueryObj.goods_id"
placeholder="请选择"
filterable
>
<el-option
v-for="item in tradeNameArr"
:key="item.goods_id"
:label="item.goods_name"
:value="item.goods_id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="收货人:" prop="cust_user">
<el-input
placeholder="请输入收货人姓名或手机号"
prefix-icon="el-icon-search"
v-model="orderQueryObj.cust_user"
></el-input>
</el-form-item>
<el-form-item label="订单编号:" prop="order_id">
<el-input
placeholder="请输入订单号"
prefix-icon="el-icon-search"
v-model="orderQueryObj.order_id"
></el-input>
</el-form-item>
<el-form-item label="自提点:" prop="sub_shop_id">
<el-select
v-model="orderQueryObj.sub_shop_id"
placeholder="请选择"
filterable
>
<el-option
v-for="item in selLiftPoinArr"
:key="item.take_place_id"
:label="item.take_place_name"
:value="item.take_place_id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="resetOrder('ruleForm')">重置</el-button>
<el-button type="primary" @click="searchOrder">搜索</el-button>
</el-form-item>
</el-form>
<!-- Tabs标签页 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-row class="tabHead">
<el-col :span="12">
<div>商品共计:{{ goodsNum }}</div>
</el-col>
<el-col :span="12" style="text-align: right">
<el-button @click="exportOrder">导出</el-button>
<el-button @click="printOrder">打印</el-button>
</el-col>
</el-row>
<el-tab-pane label="全部" name="all">
<el-table :data="orderTableData" border stripe style="width: 100%">
<el-table-column prop="marketing_name" label="活动名称">
<template #default="scope">
<div>
{{ scope.row.marketing_name }}({{ scope.row.marketing_id }})
</div>
</template>
</el-table-column>
<el-table-column
prop="order_id"
label="订单号"
width
></el-table-column>
<el-table-column
prop="order_status_text"
label="订单状态"
></el-table-column>
<el-table-column prop="order_item" label="商品信息">
<template #default="scope">
<div v-for="(item, index) in scope.row.order_item" :key="index">
{{ item.goods_name
}}<span style="color: red"> * {{ item.goods_num }} </span>
</div>
</template>
</el-table-column>
<el-table-column prop="user_name" label="收货人">
<template #default="scope">
<div>
<span
>{{ scope.row.user_name }}({{ scope.row.user_nick }})</span
>
<p>{{ scope.row.user_mobile }}</p>
</div>
</template>
</el-table-column>
<el-table-column
prop="sub_shop_name"
label="自提点"
></el-table-column>
<el-table-column prop="comment" label="备注"></el-table-column>
<el-table-column prop="pay_time" label="支付时间"></el-table-column>
<el-table-column prop="payment" label="支付金额">
<template #default="scope">
<div>
{{ scope.row.payment }}
<span v-show="scope.row.refund_amount"
>(已退¥{{ scope.row.refund_amount }})</span
>
</div>
</template>
</el-table-column>
<el-table-column
prop="discount_fee"
label="优惠金额"
></el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template #default="scope">
<el-button
type="text"
size="small"
@click="refund(scope.row)"
v-show="
(scope.row.order_status == '2' ||
scope.row.order_status == '6' ||
scope.row.order_status == '8') &&
scope.row.payment !== 0
"
>退款</el-button
>
<el-button-group v-show="scope.row.order_status == '3'">
<el-button type="text" size="small" @click="agree(scope.row)"
>同意</el-button
>
<el-button type="text" size="small" @click="refuse(scope.row)"
>拒绝</el-button
>
</el-button-group>
<!-- {{scope.row.payment}} -->
</template>
</el-table-column>
</el-table>
<page
@current-change="handleCurrentChange"
:current-page="orderQueryObj.page"
:page-size="orderQueryObj.page_size"
:total="totalNum"
/>
</el-tab-pane>
<el-tab-pane label="售后" name="afterSale">
<el-table :data="orderTableData" border stripe style="width: 100%">
<el-table-column prop="marketing_name" label="活动名称">
<template #default="scope">
<div>
{{ scope.row.marketing_name }}({{ scope.row.marketing_id }})
</div>
</template>
</el-table-column>
<el-table-column
prop="order_id"
label="订单号"
width
></el-table-column>
<el-table-column
prop="order_status_text"
label="订单状态"
></el-table-column>
<el-table-column prop="order_item" label="商品信息">
<template #default="scope">
<div v-for="(item, index) in scope.row.order_item" :key="index">
{{ item.goods_name
}}<span style="color: red"> * {{ item.goods_num }} </span>
</div>
</template>
</el-table-column>
<el-table-column prop="user_name" label="收货人">
<template #default="scope">
<div>
<span
>{{ scope.row.user_name }}({{ scope.row.user_nick }})</span
>
<p>{{ scope.row.user_mobile }}</p>
</div>
</template>
</el-table-column>
<el-table-column
prop="sub_shop_name"
label="自提点"
></el-table-column>
<el-table-column prop="comment" label="备注"></el-table-column>
<el-table-column prop="pay_time" label="支付时间"></el-table-column>
<el-table-column prop="payment" label="支付金额">
<template #default="scope">
<div>
{{ scope.row.payment }}
<span v-show="scope.row.refund_amount">{{
scope.row.refund_amount === 0
? ""
: `已退¥${scope.row.refund_amount} `
}}</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="discount_fee"
label="优惠金额"
></el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template #default="scope">
<el-button
type="text"
size="small"
@click="refund(scope.row)"
v-show="
(scope.row.order_status == '2' ||
scope.row.order_status == '6' ||
scope.row.order_status == '8') &&
scope.row.payment !== 0
"
>退款</el-button
>
<el-button-group v-show="scope.row.order_status == '3'">
<el-button type="text" size="small" @click="agree(scope.row)"
>同意</el-button
>
<el-button type="text" size="small" @click="refuse(scope.row)"
>拒绝</el-button
>
</el-button-group>
</template>
</el-table-column>
</el-table>
<page
@current-change="handleCurrentChange"
:current-page="orderQueryObj.page"
:page-size="orderQueryObj.page_size"
:total="totalNum"
/>
</el-tab-pane>
</el-tabs>
<!-- 导出弹窗 -->
<el-dialog title="导出订单" width="45%" top="10%" v-model="exportShow">
<el-form-item class="exportForm" label>
<div style="margin-bottom: 15px">
请选择导出活动{{ exportType }}的表格类型
</div>
<a :href="exportURL1" style="margin-right: 10px"
><el-button type="primary" @click="exportShow = false"
>总表</el-button
></a
>
<a :href="exportURL2" style="margin-right: 10px"
><el-button type="primary" @click="exportShow = false"
>商品表</el-button
></a
>
<a :href="exportURL3"
><el-button type="primary" @click="exportShow = false"
>配送表</el-button
></a
>
</el-form-item>
</el-dialog>
<!-- 退款弹窗 -->
<el-dialog title="退款" width="30%" top="10%" v-model="refundShow">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
style="margin-bottom: 15px"
>
全选
</el-checkbox>
<div
class="refundCon"
v-for="(item, index) in refundGoods"
:key="index"
>
<el-row>
<el-checkbox
class="check-wrap"
v-model="item.refundedGoodsSel"
:label="item.goods_name"
name="type"
></el-checkbox>
</el-row>
<el-row>
<el-col :span="6">实付:{{ item.payment }}</el-col>
<!-- <el-checkbox
class="check-wrap"
v-model="item.restoreInventory"
label="恢复库存"
name="type"
></el-checkbox> -->
</el-row>
</div>
<template #footer>
<span class="dialog-footer refundBtnGroup">
<el-button @click="refundShow = false"> </el-button>
<el-button type="primary" @click="handleConfirmRefund"
>退款</el-button
>
</span>
</template>
</el-dialog>
</div>
</Layout>
</template>
<script>
import Layout from "../layout/index.vue";
import {
newGetOrderList,
newGetMarketingList,
newGetGoodsList,
newGetSubShopList,
newOrderPrint,
newOrderItemList,
newOrderRefundReject,
newRefundOrder,
newGetOrderExportURL
} from "@/service/Groupmeal/groupmeal";
import page from "../components/Pagination/index.vue";
export default {
name: "orderManagement",
components: {
Layout,
page
},
data() {
return {
// 查询
orderQueryObj: {
page: 1,
page_size: 10,
marketing_id: "", // 活动名称
order_status: "0", // 订单状态
goods_id: "", // 商品名称
cust_user: "", // 收货人
order_id: "", // 订单编号
sub_shop_id: "" // 自提点
},
// 下拉框数据
// 活动名称
activityNameArr: [],
// 订单状态
orderStatusArr: [
{
value: "0",
label: "全部"
},
{
value: "1",
label: "未支付"
},
{
value: "2",
label: "已支付"
},
{
value: "3",
label: "待退款"
},
{
value: "4",
label: "已退款"
},
{
value: "5",
label: "退款中"
},
{
value: "6",
label: "已拒绝"
},
{
value: "7",
label: "售后"
}
],
// 商品名称
tradeNameArr: [],
// 自提点
selLiftPoinArr: [],
activeName: "all", // Tabs标签页
goodsNum: "", // 商品总计
// 导出
exportShow: false,
exportType: "",
// 表格数据
orderTableData: [],
totalNum: null, //总条数
// 退款
refundShow: false, // 退款状态
checkAll: false, // 全选
isIndeterminate: false,
refundGoods: [
{
refundedGoodsSel: false,
payment: "",
// restoreInventory: false,
goods_name: ""
}
]
};
},
computed: {
exportURL1() {
return newGetOrderExportURL(this.orderQueryObj.marketing_id, "1");
},
exportURL2() {
return newGetOrderExportURL(this.orderQueryObj.marketing_id, "2");
},
exportURL3() {
return newGetOrderExportURL(this.orderQueryObj.marketing_id, "3");
}
},
methods: {
activityNameFocus() {
this.getMarketingListMet();
},
// 获取活动名称
async getMarketingListMet() {
try {
const res = await newGetMarketingList();
this.activityNameArr = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error);
}
},
// 活动名称的change事件 获取商品名称+获取自提点
async activityNameSel(val) {
this.orderQueryObj.goods_id = "";
this.orderQueryObj.sub_shop_id = "";
const params = {
marketing_id: val
};
const res = await newGetGoodsList(params); // 商品名称
this.getSubShopListMet(val); //自提点
// const res = await getSubShopList(params);
this.tradeNameArr = res.result;
// this.selLiftPoinArr = res.result;
},
// 获取自提点
async getSubShopListMet(params) {
try {
let marketing_id = "";
if (params) {
marketing_id = params;
}
const res = await newGetSubShopList({ marketing_id: marketing_id });
this.selLiftPoinArr = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error);
}
},
// 重置
resetOrder(formName) {
if (this.$route.query.marketing_type == "4") {
this.$router.push({
path: "/op/groupmeal/newOrderManagement"
});
this.$route.query.marketing_type = "";
}
this.$refs[formName].resetFields();
this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10;
this.getOrderListMet(this.orderQueryObj);
this.getSubShopListMet();
},
// 搜索
searchOrder() {
if (this.$route.query.marketing_type == "4") {
this.$router.push({
path: "/op/groupmeal/newOrderManagement"
});
this.$route.query.marketing_type = "";
}
this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10;
if (this.orderQueryObj.order_status === "0") {
this.activeName = "all";
this.orderStatusArr[1].disabled = false;
this.orderStatusArr[2].disabled = false;
}
// this.orderQueryObj.order_status = "0";
// this.orderStatusArr[1].disabled = false;
// this.orderStatusArr[2].disabled = false;
this.getOrderListMet(this.orderQueryObj);
},
// 标签页切换
handleClick(targetName) {
if (targetName.props.name == "all") {
this.orderQueryObj.order_status = "0";
this.orderStatusArr[1].disabled = false;
this.orderStatusArr[2].disabled = false;
} else {
this.orderQueryObj.order_status = "7";
this.orderStatusArr[1].disabled = true;
this.orderStatusArr[2].disabled = true;
}
this.getOrderListMet(this.orderQueryObj);
},
// 导出
exportOrder() {
if (this.orderQueryObj.marketing_id === "") {
this.$message.error("请选择活动名称");
return;
}
this.exportShow = true;
this.exportType = this.orderQueryObj.marketing_id;
},
async printOrderMet(forcePrint) {
const params = {
marketing_id: this.orderQueryObj.marketing_id,
force_print: forcePrint ? "1" : ""
};
const res = await newOrderPrint(params);
return res;
},
// 打印
async printOrder() {
if (this.orderQueryObj.marketing_id === "") {
this.$message.error("请选择活动名称");
return;
}
let res = await this.printOrderMet(false);
if (res.code === 0) {
this.$message({
type: "success",
message: "打印成功"
});
return;
}
if (res.code !== 5111040) {
if (res.reason) {
this.$message.error(res.reason);
} else {
this.$message.error("打印失败");
}
return;
}
if (res.reason) {
try {
await this.$confirm(res.reason, "打印", {
cancelButtonText: "取消",
confirmButtonText: "确定"
});
} catch (e) {
// 取消
return;
}
} else {
this.$message.error("打印失败");
}
res = await this.printOrderMet(true);
},
// 获取订单列表
async getOrderListMet() {
try {
let res = null;
if (this.$route.query.marketing_type == "4") {
res = await newGetOrderList({
page: 1,
page_size: 10,
marketing_id: this.$route.query.marketing_id,
order_status: "0",
goods_id: "",
cust_user: "",
order_id: "",
sub_shop_id: ""
});
} else {
res = await newGetOrderList(this.orderQueryObj);
}
this.goodsNum = res.goods_num; // 商品共计
this.totalNum = res.count; // 商品总数
this.orderTableData = res.result;
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error);
}
},
// 列表分页 页码变化
handleCurrentChange(e) {
this.orderQueryObj.page = e;
this.getOrderListMet();
},
// 拒绝
async refuse(val) {
try {
await this.$confirm("确定要拒绝退款么?", "拒绝", {
cancelButtonText: "取消",
confirmButtonText: "确定"
});
} catch (e) {
// 取消
return;
}
const params = {
order_id: val.order_id
};
const res = await newOrderRefundReject(params);
if (res.code === 0) {
this.$message({
type: "success",
message: "订单已驳回"
});
} else {
this.$message.error(res.reason);
}
this.getOrderListMet();
},
// 同意
agree(val) {
this.refund(val);
},
// 全选
handleCheckAllChange(val) {
for (var i in this.refundGoods) {
this.refundGoods[i].refundedGoodsSel = val;
}
},
// 退款
async refund(val) {
this.refundShow = true;
this.checkAll = false;
this.refundGoods = [];
const params = {
order_id: val.order_id
};
const res = await newOrderItemList(params);
this.refundGoods = res.result;
for (var i in res.result) {
this.refundGoods[i].payment = Number(res.result[i].payment);
}
},
// 退款确认
async handleConfirmRefund() {
const isCheckAllSelected = () => this.refundGoods.refundedGoodsSel;
const getAllItems = () => this.refundGoods;
const getSelectedItems = () => {
const isSelected = ({ refundedGoodsSel }) => refundedGoodsSel;
return this.refundGoods.filter(isSelected);
};
// for (var i in this.refundGoods) {
// if (
// this.refundGoods[i].refundedGoodsSel == true &&
// this.refundGoods[i].restoreInventory == true
// ) {
// this.refundGoods[i].refund_type = "1";
// } else {
// this.refundGoods[i].refund_type = "2";
// }
// }
const convertToNumber = str => {
return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0;
};
const processRefundItem = item => {
return {
order_item_id: item.order_item_id,
refund_num: item.refundableQuantity || 0,
refund_amount: convertToNumber(item.amountToRefund),
// refund_type: item.refund_type
};
};
const orderId = this.refundGoods[0].order_id;
let itemsToRefund = null;
if (isCheckAllSelected()) {
itemsToRefund = getAllItems();
} else {
itemsToRefund = getSelectedItems();
}
itemsToRefund = itemsToRefund.map(processRefundItem);
const res = await newRefundOrder(orderId, itemsToRefund);
if (res.code === 0) {
this.$message.success("退款成功");
this.getOrderListMet();
this.refundShow = false;
return;
}
this.$message.error(res.reason);
}
},
created() {
this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表
}
};
</script>
<style lang="less" src="../orderManagement/index.less" scoped></style>
<style lang="less" scoped>
.check-wrap {
/deep/ .el-checkbox__label {
white-space: normal;
word-break: break-all;
}
}
.refundCon /deep/ .el-row {
margin-bottom: 15px;
display: flex;
align-items: center;
}
</style>
...@@ -15,9 +15,3 @@ ...@@ -15,9 +15,3 @@
display: block; display: block;
text-align: center; text-align: center;
} }
.refundCon /deep/ .el-row {
margin-bottom: 15px;
display: flex;
align-items: center;
}
\ No newline at end of file
...@@ -513,7 +513,7 @@ export default { ...@@ -513,7 +513,7 @@ export default {
marketing_id: val, marketing_id: val,
}; };
const res = await getGoodsList(params); // 商品名称 const res = await getGoodsList(params); // 商品名称
this.getSubShopListMet(val) //自提点 this.getSubShopListMet(val); //自提点
// const res = await getSubShopList(params); // const res = await getSubShopList(params);
this.tradeNameArr = res.result; this.tradeNameArr = res.result;
// this.selLiftPoinArr = res.result; // this.selLiftPoinArr = res.result;
...@@ -522,11 +522,11 @@ export default { ...@@ -522,11 +522,11 @@ export default {
// 获取自提点 // 获取自提点
async getSubShopListMet(params) { async getSubShopListMet(params) {
try { try {
let marketing_id = '' let marketing_id = "";
if(params){ if (params) {
marketing_id = params marketing_id = params;
} }
const res = await getSubShopList({'marketing_id':marketing_id}); const res = await getSubShopList({ marketing_id: marketing_id });
this.selLiftPoinArr = res.result; this.selLiftPoinArr = res.result;
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
...@@ -766,11 +766,15 @@ export default { ...@@ -766,11 +766,15 @@ export default {
<style lang="less" src="./index.less" scope></style> <style lang="less" src="./index.less" scope></style>
<style lang="less" scoped> <style lang="less" scoped>
.check-wrap{ .check-wrap {
/deep/ .el-checkbox__label { /deep/ .el-checkbox__label {
white-space: normal; white-space: normal;
word-break: break-all; word-break: break-all;
}
} }
.refundCon /deep/ .el-row{
margin-bottom: 15px;
display: flex;
align-items: center;
} }
</style> </style>
<template> <template>
<layout> <layout>
<RoleList appId="merchant-op" detailPath="/op/roleRoleDetail"></RoleList> <RoleList detailPath="/op/roleRoleDetail"></RoleList>
</layout> </layout>
</template> </template>
<script> <script>
......
<template> <template>
<layout> <layout>
<UserList appId="merchant-op" /> <UserList />
</layout> </layout>
</template> </template>
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<!-- <auditTab v-if="status_text == 'fourth'"></auditTab> --> <!-- <auditTab v-if="status_text == 'fourth'"></auditTab> -->
<!-- <el-card class="goods-h5"> --> <!-- <el-card class="goods-h5"> -->
<div class="goods-h5"> <div class="goods-h5">
<el-table :data="goodsList" border> <el-table :data="goodsList" border max-height="700">
<el-table-column
label="登录地点"
prop="withdraw_address"
align="center"
></el-table-column>
<el-table-column <el-table-column
label="申请用户" label="申请用户"
prop="user_id" prop="user_id"
...@@ -33,7 +38,7 @@ ...@@ -33,7 +38,7 @@
</el-table> </el-table>
<!-- 页码区 --> <!-- 页码区 -->
<!-- <el-pagination <el-pagination
class="pagination" class="pagination"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
v-model:currentPage="searchProps.page" v-model:currentPage="searchProps.page"
...@@ -41,7 +46,7 @@ ...@@ -41,7 +46,7 @@
layout="total,prev, pager, next, jumper" layout="total,prev, pager, next, jumper"
:total="searchProps.count" :total="searchProps.count"
> >
</el-pagination> --> </el-pagination>
</div> </div>
<!-- </el-card> --> <!-- </el-card> -->
</template> </template>
......
.tab-show { .tab-show {
width: 100%; width: 100%;
height: 100%; // height: 100%;
padding: 0px 55px; padding: 0px 55px;
background-color: white; background-color: white;
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
...@@ -105,6 +105,6 @@ ...@@ -105,6 +105,6 @@
} }
.el-message-box { .el-message-box {
width: 80vw; width: 20vw;
margin: 0 auto; margin: 0 auto;
} }
\ No newline at end of file
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
prop="city_name" prop="city_name"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
label="登录地点"
prop="withdraw_address"
align="center"
></el-table-column>
<el-table-column <el-table-column
label="提现金额" label="提现金额"
prop="amount" prop="amount"
...@@ -190,6 +195,10 @@ ...@@ -190,6 +195,10 @@
>白名单</el-button >白名单</el-button
> --> > -->
<ul class="listShow"> <ul class="listShow">
<li>
<span class="list-left">登录地点 :</span>
<span class="list-right">{{ dialogData.showData.withdraw_address }}</span>
</li>
<li> <li>
<span class="list-left">提现金额 :</span> <span class="list-left">提现金额 :</span>
<span class="list-right">{{ dialogData.showData.amount }}</span> <span class="list-right">{{ dialogData.showData.amount }}</span>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="goods-h5"> <div class="goods-h5">
<el-form> <el-form>
<ul class="apply-list"> <ul class="apply-list">
<li><span>登录地点:</span><span>{{ dialogData.showData.withdraw_address }}</span></li>
<li> 提现用户:<span>{{ dialogData.showData.user_id }}</span></li> <li> 提现用户:<span>{{ dialogData.showData.user_id }}</span></li>
<li> 提现金额:<span>{{ dialogData.showData.amount }}</span></li> <li> 提现金额:<span>{{ dialogData.showData.amount }}</span></li>
<li> 最近24小时收入:<span>{{ dialogData.showData.lately_amount }}</span></li> <li> 最近24小时收入:<span>{{ dialogData.showData.lately_amount }}</span></li>
......
...@@ -3,6 +3,10 @@ const headerConfig = [ ...@@ -3,6 +3,10 @@ const headerConfig = [
name: "提现审核", name: "提现审核",
path: "/op/withdrawal/examine" path: "/op/withdrawal/examine"
}, },
{
name: "钱包账户",
path: "/op/withdrawal/walletaccount"
},
{ {
path: "/op/withdrawal/roleManageRole", path: "/op/withdrawal/roleManageRole",
name: "角色管理", name: "角色管理",
......
<template>
<div
class="manage-wrapper"
v-loading="tableLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
>
<el-card class="role_management">
<!-- 检索区域 -->
<div class="creatRole">
<el-form>
<el-form-item label="用户Id">
<span>{{ user_id }}</span>
</el-form-item>
<el-form-item label="交易类型">
<el-select v-model="type" clearable @change="getRecordList">
<el-option label="充值" :value="1"></el-option>
<el-option label="提现" :value="2"></el-option>
<el-option label="转账" :value="3"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<!-- 用户搜索列表 -->
<el-table border :data="recordList">
<el-table-column
label="流水号"
width="200px"
prop="wallet_record_id"
align="center"
></el-table-column>
<el-table-column
label="更新时间"
prop="create_time"
align="center"
></el-table-column>
<el-table-column
label="金额"
prop="amount"
align="center"
></el-table-column>
<el-table-column label="可用余额" prop="balance" align="center">
<template #default="scope">
{{ "¥ " + scope.row.balance }}
</template>
</el-table-column>
<el-table-column label="交易类型" prop="trade_type" align="center">
<template #default="scope">
{{ getTradeType(scope.row.trade_type) }}
</template>
</el-table-column>
<el-table-column
label="状态"
width="200px"
prop="status"
align="center"
>
<template #default="scope">
<span
:style="{ color: scope.row.status === '失败' ? 'red' : 'black' }"
>
{{ scope.row.status }}
</span>
</template>
</el-table-column>
<el-table-column label="说明" align="center" prop="third_order_desc">
</el-table-column>
</el-table>
<el-button
type="primary"
@click="handleBack"
style="margin-top: 50px; margin-left: 45%"
>返回</el-button
>
<!-- <page :totalNum="totalNum" @update="update" /> -->
<el-pagination
:class="totalNum/params.page_size>=7? 'page': ''"
@current-change="handleCurrentChange"
v-model:currentPage="params.page"
:page-size="params.page_size"
layout="total, prev, pager, next"
:total="totalNum"
>
</el-pagination>
</el-card>
</div>
</template>
<script>
// import page from "../../../components/Pagination";
import { getRecordList } from "@/service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus";
const tradeType = { 1: "充值", 2: "提现", 3: "转账" };
export default {
name: "flowRecord",
// components: { page },
data() {
return {
user_id: "",
wallet_id: "",
type: "",
recordList: [
{
wallet_record_id: "243435676",
create_time: "2021-3-3",
amount: 4,
balance: 555,
trade_type: "提现",
status: "失败"
}
],
tableLoading: false,
params: {
page: 1,
currentPage: 1,
page_size: 20
},
totalNum: null
};
},
created() {
this.user_id = this.$route.query.user_id;
this.wallet_id = this.$route.query.wallet_id;
this.tableLoading = true;
this.getRecordList();
},
methods: {
// update(obj) {
// Object.assign(this.params, obj);
// this.getRecordList();
// },
// 分页
handleCurrentChange(e) {
this.params.page = e;
this.getRecordList();
this.tableLoading = true;
},
//获取账户流水列表
getRecordList() {
this.recordList = [];
let { page, page_size } = this.params;
let { wallet_id, type } = this;
let params_list = {
wallet_id,
page,
page_size,
type
};
getRecordList(params_list)
.then((res) => {
this.tableLoading = true;
this.recordList = res.result.list;
this.totalNum = res.result.count;
this.tableLoading = false;
})
.catch((err) => {
this.tableLoading = false;
ElMessage.error("加载失败" + err);
});
},
// 获取交易类型
getTradeType(code) {
return tradeType[code];
},
// 返回
handleBack() {
this.$router.back();
},
},
};
</script>
<style lang="less" scoped>
.creatRole {
display: flex;
justify-content: space-between;
}
.role_management {
padding: 20px;
}
.page {
/deep/ .el-pager>li:last-of-type {
display: none;
}
}
</style>
\ No newline at end of file
<template>
<Layout>
<div
class="manage-wrapper"
v-loading="tableLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
>
<el-card class="role_management">
<!-- 检索区域 -->
<div class="creatRole">
<el-form inline :model="searchProps">
<el-form-item label="用户Id">
<el-input
clearable
v-model="searchProps.user_id"
@input="
searchProps.user_id = $event.replace(
/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g,
''
)
"
></el-input>
</el-form-item>
<el-form-item label="账户状态">
<el-select v-model="searchProps.type" clearable>
<el-option label="黑名单" :value="2"></el-option>
<el-option label="正常用户" :value="1"></el-option>
</el-select>
</el-form-item>
<el-button
type="primary"
style="margin-left: 30px; margin-bottom: 22px"
@click="findProducts"
>查询</el-button
>
</el-form>
</div>
<!-- 用户搜索列表 -->
<el-table border :data="accountList">
<el-table-column
label="用户id"
prop="user_id"
align="center"
></el-table-column>
<el-table-column
label="账户可用金额"
prop="available_fund"
align="center"
>
<template #default="scope">
{{ "¥ " + scope.row.available_fund }}
</template>
</el-table-column>
<el-table-column
label="账户冻结金额"
prop="freezing_fund"
align="center"
>
<template #default="scope">
{{ "¥ " + scope.row.freezing_fund }}
</template>
</el-table-column>
<el-table-column
label="历史提现金额"
prop="history_fund"
align="center"
>
<template #default="scope">
{{ "¥ " + scope.row.history_fund }}
</template>
</el-table-column>
<el-table-column
label="账户状态"
width="200px"
prop="status"
align="center"
>
</el-table-column>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
v-show="scope.row.is_black == 0"
@click.stop="
openBounced(
scope.row.is_black,
scope.row.user_id,
scope.row.wallet_id
)
"
type="text"
size="mini"
>黑名单</el-button
>
<el-button
v-show="scope.row.is_black == 1"
@click.stop="
openBounced(
scope.row.is_black,
scope.row.user_id,
scope.row.wallet_id
)
"
size="mini"
type="text"
>释放</el-button
>
<el-button
@click.stop="handelRecord(scope.row)"
size="mini"
type="text"
>流水记录</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<!-- <page :totalNum="totalNum" @update="update" ref="params" /> -->
<el-pagination
:class="totalNum/params.page_size>=7? 'page': ''"
@current-change="handleCurrentChange"
v-model:currentPage="params.page"
:page-size="params.page_size"
layout="total, prev, pager, next"
:total="totalNum"
>
</el-pagination>
</el-card>
</div>
</Layout>
</template>
<script>
// import page from "../../../components/Pagination";
import Layout from "../layout/index.vue";
import {
getAccountList,
getAccountBlackList,
getReblackList,
} from "@/service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus";
export default {
name: "walletAccount",
props: ["flowRecord"],
components: {
// page,
Layout,
},
data() {
return {
searchProps: {
user_id: "",
wallet_id: "",
type: "",
},
params: {
page: 1,
page_size: 20,
currentPage: 1,
},
totalNum: null,
dialogText: "",
accountList: [],
tableLoading: false,
};
},
created() {
this.tableLoading = true;
this.getAccountList();
// this.getPermissionsAll();
},
methods: {
//获取账户列表
getAccountList() {
this.accountList = [];
let { page, page_size } = this.params;
let { user_id, type } = this.searchProps;
let params_list = {
page,
page_size,
type,
user_id: user_id || undefined,
};
getAccountList(params_list)
.then((res) => {
this.tableLoading = true;
this.accountList = res.result.list;
this.totalNum = res.result.count;
this.tableLoading = false;
})
.catch((err) => {
this.tableLoading = false;
ElMessage.error("加载失败" + err);
});
},
//查询
findProducts() {
this.tableLoading = true;
this.params.page = 1;
// this.$refs.params.currentPage = 1;
this.getAccountList();
},
//列表分页
// update(obj) {
// Object.assign(this.params, obj);
// let { page, page_size } = this.params;
// this.getAccountList(page, page_size);
// this.params.page = 1;
// this.tableLoading = true;
// console.log(obj);
// },
// 分页
handleCurrentChange(e) {
this.params.page = e;
this.getAccountList();
this.tableLoading = true;
},
//弹框提示
openBounced(type, user_id, wallet_id) {
this.$confirm(
`${
type === 1 ? "确认后则将用户释放出黑名单" : "确认后则将用户拉入黑名单"
}是否继续?`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
}
)
.then(() => {
if (+type === 0) {
this.handleBlackList(user_id, wallet_id);
} else {
this.release(user_id, wallet_id);
}
})
.catch(() => {
this.$message({
type: "info",
message: "已取消",
});
});
},
//释放
async release(user_id, wallet_id) {
this.dialogText = "确认后则将用户释放出黑名单";
this.tableLoading = true;
let params = {
user_id,
wallet_id,
};
try {
await getReblackList(params);
ElMessage("释放成功");
this.getAccountList();
} catch (error) {
ElMessage("释放请求失败");
}
},
//流水记录
handelRecord(row) {
this.$router.push({
path: "/op/withdrawal/flowrecord",
query: { user_id: row.user_id, wallet_id: row.wallet_id },
});
},
//黑名单
async handleBlackList(user_id, wallet_id) {
this.tableLoading = true;
let params = {
user_id,
wallet_id,
};
try {
await getAccountBlackList(params);
ElMessage("添加黑名单成功");
this.getAccountList();
} catch (error) {
ElMessage("添加黑名单失败");
}
},
},
};
</script>
<style lang="less" scoped>
.manage-wrapper {
height: 100vh;
}
.creatRole {
display: flex;
justify-content: space-between;
}
.role_management {
padding: 20px;
}
.role_management .el-button {
margin: 0 2px;
}
.page {
/deep/ .el-pager>li:last-of-type {
display: none;
}
}
</style>
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
// redirect: "/op/groupmeal/orderManagement", // redirect: "/op/groupmeal/orderManagement",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Groupmeal/orderManagement") component: () => import(/* webpackChunkName: "goods" */ "@/pages/Groupmeal/orderManagement")
}, },
{
path: "/op/groupmeal/newOrderManagement",
name: "newOrderManagement",
// redirect: "/op/groupmeal/orderManagement",
component: () => import(/* webpackChunkName: "goods" */ "@/pages/Groupmeal/newOrderManagement")
},
{ {
path: "/op/groupmeal/distrib", path: "/op/groupmeal/distrib",
name: "Distrib", name: "Distrib",
......
...@@ -10,6 +10,19 @@ const withdrawalRoutes = [ ...@@ -10,6 +10,19 @@ const withdrawalRoutes = [
component: () => component: () =>
import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Examine") import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/Examine")
}, },
// 钱包账户
{
path: "/op/withdrawal/walletaccount",
name: "walletAccount",
component: () =>
import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/walletAccount")
},
{
path: "/op/withdrawal/flowrecord",
name: "flowRecord",
component: () =>
import(/* webpackChunkName: "Withdrawal" */ "@/pages/Withdrawal/walletAccount/flowRecord")
},
//用户管理 //用户管理
{ {
path: "/op/withdrawal/user", path: "/op/withdrawal/user",
......
...@@ -105,7 +105,6 @@ const routes = [ ...@@ -105,7 +105,6 @@ const routes = [
// 团餐运营 // 团餐运营
...groupmealRouters ...groupmealRouters
]; ];
console.log(routes);
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
......
...@@ -32,7 +32,7 @@ export async function markGoodsInfo(params) { ...@@ -32,7 +32,7 @@ export async function markGoodsInfo(params) {
// 编辑商品详情 // 编辑商品详情
export async function editGoods(params) { export async function editGoods(params) {
const res = await axios.post("/api/v1/goods/background/edit_goods", params); const res = await axios.post("/api/v1/goods/background/edit_activity_goods", params);
return res; return res;
} }
...@@ -82,7 +82,7 @@ class ActivityService { ...@@ -82,7 +82,7 @@ class ActivityService {
// 关闭/开启 活动 // 关闭/开启 活动
static async updateActivity(query) { static async updateActivity(query) {
const res = await axios.post( const res = await axios.post(
"/api/v1/marketing/background/update_marketing", "/api/v1/marketing/background/update_marketing_online_status",
{ {
...query ...query
} }
......
...@@ -27,9 +27,11 @@ export async function getSaveDeliverer(params) { ...@@ -27,9 +27,11 @@ export async function getSaveDeliverer(params) {
return res; 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/oldbackground/order_list", {
params params
}); });
return res; return res;
...@@ -37,13 +39,13 @@ export async function getOrderList(params) { ...@@ -37,13 +39,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,7 +53,7 @@ export async function getGoodsList(params) { ...@@ -51,7 +53,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 params
}); });
return res; return res;
...@@ -59,7 +61,7 @@ export async function getSubShopList(params) { ...@@ -59,7 +61,7 @@ export async function getSubShopList(params) {
// 导出订单 // 导出订单
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/oldbackground/order_export", {
params params
}); });
return res; return res;
...@@ -67,7 +69,7 @@ export async function orderExport(params) { ...@@ -67,7 +69,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 +77,7 @@ export async function orderPrint(params) { ...@@ -75,7 +77,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 +89,7 @@ export async function refundOrder(orderId, itemsToRefund) { ...@@ -87,7 +89,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 +98,7 @@ export async function refundOrder(orderId, itemsToRefund) { ...@@ -96,7 +98,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;
...@@ -107,8 +109,88 @@ export function getOrderExportURL(eventId, type) { ...@@ -107,8 +109,88 @@ export function getOrderExportURL(eventId, type) {
var ENV; var ENV;
if(process.env.NODE_ENV == "development"){ if(process.env.NODE_ENV == "development"){
ENV = "http://bp-dev.ini.yidian-inc.com/" ENV = "http://bp-dev.ini.yidian-inc.com/"
}else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/"
}else{ }else{
ENV = "http://bp.ini.yidian-inc.com/"
}
return `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
}
// 新订单管理
// 获取订单列表
export async function newGetOrderList(params) {
const res = await axios.get("/api/v1/order/background/order_list", {
params
});
return res;
}
// 获取活动名称
export async function newGetMarketingList() {
const res = await axios.get("/api/v1/order/background/order_condition_marketing_list");
return res;
}
// 获取商品名称
export async function newGetGoodsList(params) {
const res = await axios.get("/api/v1/order/background/order_condition_goods_list", {
params
});
return res;
}
// 获取自提点
export async function newGetSubShopList(params) {
const res = await axios.get("/api/v1/order/background/order_condition_take_place_list",{
params
});
return res;
}
// 打印订单
export async function newOrderPrint(params) {
const res = await axios.get("/api/v1/order/background/order_print", {
params
});
return res;
}
// 订单退款列表
export async function newOrderItemList(params) {
const res = await axios.get("/api/v1/order/background/order_item_list", {
params
});
return res;
}
// 订单退款
export async function newRefundOrder(orderId, itemsToRefund) {
const res = await axios.post("/api/v1/order/background/order_refund", {
order_id: orderId,
refund_list: itemsToRefund
});
return res;
}
// 订单驳回
export async function newOrderRefundReject(params) {
const res = await axios.get("/api/v1/order/background/order_refund_reject", {
params
});
return res;
}
// 导出订单
export function newGetOrderExportURL(eventId, type) {
var ENV;
if(process.env.NODE_ENV == "development"){
ENV = "http://bp-dev.ini.yidian-inc.com/"
}else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/" ENV = "http://bp-test.ini.yidian-inc.com/"
}else{
ENV = "http://bp.ini.yidian-inc.com/"
} }
return `${ENV}order/background/order_export?marketing_id=${eventId}&type=${type}`; return `${ENV}order/background/order_export?marketing_id=${eventId}&type=${type}`;
} }
...@@ -47,3 +47,24 @@ export async function getRolesForUser(user_email) { ...@@ -47,3 +47,24 @@ export async function getRolesForUser(user_email) {
); );
return res.permissions; return res.permissions;
} }
// 迭代---钱包账户
// 获取账户列表
export async function getAccountList(params) {
const res = await axios.get("/api/v1/get_account_list", {params});
return res;
}
// 获取账户流水列表
export async function getRecordList(params) {
const res = await axios.get("/api/v1/get_record_list",{params});
return res;
}
// 钱包账户-黑名单
export async function getAccountBlackList(params) {
const res = await axios.post("/api/v1/get_account_black_list", params)
return res;
}
// 钱包账户-释放
export async function getReblackList(params) {
const res = await axios.post("/api/v1/get_reblack_list",params)
return res;
}
\ No newline at end of file
...@@ -25,8 +25,6 @@ export default createStore({ ...@@ -25,8 +25,6 @@ export default createStore({
actions: { actions: {
async updateUserPermission({ commit }, payload) { async updateUserPermission({ commit }, payload) {
const { permissions = [] } = await getPermissions(payload.email); const { permissions = [] } = await getPermissions(payload.email);
console.log("VUEX action updateUserPermission::", permissions);
commit("updateUserPermission", permissions); commit("updateUserPermission", permissions);
}, },
async fetchPermission({ commit }, { email, appId }) { async fetchPermission({ commit }, { email, appId }) {
......
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