Commit 324dc4f6 authored by liwenhong's avatar liwenhong

Merge branch 'master' of https://git.yidian-inc.com:8021/bp/op-web-service...

Merge branch 'master' of https://git.yidian-inc.com:8021/bp/op-web-service into lwh/head-distribution
parents 2eaf3bcd 5885f7ff
...@@ -10,10 +10,10 @@ const PANDORA_URI = { ...@@ -10,10 +10,10 @@ const PANDORA_URI = {
}; };
const API_INTERNAL_URI = { const API_INTERNAL_URI = {
'development': "http://bp-dev.ini.yidian-inc.com", development: "http://bp-dev.ini.yidian-inc.com",
'test': "http://bp-test.ini.yidian-inc.com", test: "http://bp-test.ini.yidian-inc.com",
'production': "http://bp.int.yidian-inc.com" production: "http://bp.int.yidian-inc.com"
} };
module.exports = { module.exports = {
env: env, env: env,
......
...@@ -41,6 +41,26 @@ exports.getSaveDeliverer = async ctx => { ...@@ -41,6 +41,26 @@ exports.getSaveDeliverer = async ctx => {
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 下载配送路线 -lh
exports.getDeliveryRoutes = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/build_plan`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 查看下载配送路线记录 -lh
exports.getEmailRecords = async ctx => {
const opts = {
url: `${GROUPMEAL_URI}/order/deliverer/plan_down_log`,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 老订单管理 // 老订单管理
......
...@@ -103,6 +103,8 @@ router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrin ...@@ -103,6 +103,8 @@ router.get(`${API_VERSION}/order/oldbackground/order_print`, groupmeal.orderPrin
router.get(`${API_VERSION}/order/oldbackground/order_item_list`, groupmeal.orderItemList); router.get(`${API_VERSION}/order/oldbackground/order_item_list`, groupmeal.orderItemList);
router.get(`${API_VERSION}/order/oldbackground/order_refund_reject`, groupmeal.orderRefundReject); router.get(`${API_VERSION}/order/oldbackground/order_refund_reject`, groupmeal.orderRefundReject);
router.post(`${API_VERSION}/order/oldbackground/order_refund`, groupmeal.orderRefund); router.post(`${API_VERSION}/order/oldbackground/order_refund`, groupmeal.orderRefund);
router.post(`${API_VERSION}/order/deliverer/build_plan`, groupmeal.getDeliveryRoutes); //下载配送路线 -lh
router.post(`${API_VERSION}/order/deliverer/plan_down_log`, groupmeal.getEmailRecords); // 查看邮件记录 -lh
// 新订单管理 // 新订单管理
router.get(`${API_VERSION}/order/background/order_list`, groupmeal.newGetOrderList); router.get(`${API_VERSION}/order/background/order_list`, groupmeal.newGetOrderList);
......
<template>
<div class="YDDialog">
<el-dialog
:title="dialogTitle"
v-model="dialogVisible"
:width="dialogWidth"
:show-close="showDialogClose"
:top="dialogMarginTop"
:modal="dialogModel"
:close-on-click-modal="dialogCloseOnClickModal"
:close-on-press-escape="dialogCloseOnPressEscape"
:center="dialogCenter"
>
<slot></slot>
<template #footer>
<span class="dialog-footer">
<el-button v-show="isShowCancelButton" @click="cancel">{{
cancelButtonText
}}</el-button>
<el-button
v-show="isShowConfirmButton"
type="primary"
@click="cofirm"
>{{ confirmButtonText }}</el-button
>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
// 标题
dialogTitle: {
type: String,
default: "标题"
},
// dialog 显示控制
myDialogVisible: {
type: Boolean,
default: false
},
// 确认button文案
confirmButtonText: {
type: String,
default: "确 定"
},
// 取消button文案
cancelButtonText: {
type: String,
default: "取 消"
},
// 宽度
dialogWidth: {
type: String,
default: "50%"
},
// 距离顶部的margin
dialogMarginTop: {
type: String,
default: "15vh"
},
// 是否需要遮罩层
dialogModel: {
type: Boolean,
default: true
},
// 点击遮罩层是否关闭dialog
dialogCloseOnClickModal: {
type: Boolean,
default: false
},
// 是否显示关闭(右上角X)
showDialogClose: {
type: Boolean,
default: false
},
// 是否展示确定按钮
isShowConfirmButton: {
type: Boolean,
default: true
},
// 是否展示取消按钮
isShowCancelButton: {
type: Boolean,
default: true
},
// 点击esc是否关闭
dialogCloseOnPressEscape: {
type: Boolean,
default: false
},
// 底部按钮是否居中显示
dialogCenter: {
type: Boolean,
default: false
},
// cancelDialog 方法名称
cancelDialogMethodName: {
type: String,
default: "dialogCancel"
},
// confirmDialog 方法名称
confirmDialogMethodName: {
type: String,
default: "dialogConfirm"
}
},
data() {
return {
dialogVisible: this.myDialogVisible
};
},
watch: {
myDialogVisible(newVal) {
this.dialogVisible = newVal;
}
},
methods: {
cancel() {
this.$emit(this.cancelDialogMethodName);
},
cofirm() {
this.$emit(this.confirmDialogMethodName);
}
}
};
</script>
<style lang="less" scoped></style>
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
<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>
<!-- 查看参与字段待确认 -->
<p>
<span>{{ detailInfo.lookUserCount }}人查看</span><span
>{{ detailInfo.haveBuyGoodsUserCount }}人参与</span
>
</p>
<p class="endTime">{{ showTimer }}</p> <p class="endTime">{{ showTimer }}</p>
</div> </div>
<p class="title">拼单商品</p> <p class="title">拼单商品</p>
...@@ -94,6 +100,9 @@ ...@@ -94,6 +100,9 @@
<span class="originPrice">{{ <span class="originPrice">{{
`¥${goodsItem.original_price} ` `¥${goodsItem.original_price} `
}}</span> }}</span>
<span class="sold" v-if="goodsItem.inventory_rest==0">抢光了</span>
<span class="sold" v-else>已售{{ goodsItem.all_have_buy_goods_count }}</span
>
</p> </p>
</div> </div>
</div> </div>
...@@ -126,7 +135,7 @@ export default { ...@@ -126,7 +135,7 @@ export default {
marketingInfo: {}, marketingInfo: {},
endTime: "", endTime: "",
showTimer: "", showTimer: "",
detailInfo: {} detailInfo: {},
}; };
}, },
watch: {}, watch: {},
...@@ -138,13 +147,12 @@ export default { ...@@ -138,13 +147,12 @@ export default {
let dataArr = await Promise.all([ let dataArr = await Promise.all([
ActivityService.checkActivityDetail({ ActivityService.checkActivityDetail({
marketing_id: this.$route.query.marketing_id, marketing_id: this.$route.query.marketing_id,
marketing_type: this.$route.query.marketing_type marketing_type: this.$route.query.marketing_type,
}), }),
ActivityService.checkActivityDetailInfo({ ActivityService.checkActivityDetailInfo({
marketing_id: this.$route.query.marketing_id marketing_id: this.$route.query.marketing_id,
}) }),
]); ]);
this.pageLoading = false; this.pageLoading = false;
this.goodsList = dataArr[0].result.goods_list; this.goodsList = dataArr[0].result.goods_list;
this.marketingInfo = dataArr[0].result.marketing_info; this.marketingInfo = dataArr[0].result.marketing_info;
...@@ -195,7 +203,7 @@ export default { ...@@ -195,7 +203,7 @@ export default {
closePage() { closePage() {
this.$router.go(-1); this.$router.go(-1);
} },
}, },
async created() { async created() {
await this.checkActivityDetail(); await this.checkActivityDetail();
...@@ -203,7 +211,7 @@ export default { ...@@ -203,7 +211,7 @@ export default {
}, },
beforeUnmount() { beforeUnmount() {
clearInterval(this.timer); clearInterval(this.timer);
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -278,7 +286,9 @@ export default { ...@@ -278,7 +286,9 @@ export default {
display: flex; display: flex;
margin: 15px 0; margin: 15px 0;
.itemIntroduce { .itemIntroduce {
position: relative;
display: flex; display: flex;
width: 100%;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
margin-left: 10px; margin-left: 10px;
...@@ -295,6 +305,12 @@ export default { ...@@ -295,6 +305,12 @@ export default {
} }
} }
} }
.sold {
position:absolute;
right: 20px;;
color:#d44549;
font-weight: 500;
}
} }
} }
} }
......
...@@ -29,11 +29,13 @@ ...@@ -29,11 +29,13 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getActivityList">搜索</el-button>
<el-form-item style="margin-left: 50px"> <el-form-item style="margin-left: 50px">
<el-button type="primary" @click="getActivityList">搜索</el-button> <el-button @click="reset()">重置</el-button>
<!-- <el-button type="primary" @click="getActivityList">搜索</el-button> -->
</el-form-item> </el-form-item>
<el-form-item> <el-button type="primary" size="small" @click="goReleaseProduc"
<el-button type="primary" @click="goReleaseProduc"
>发布拼单</el-button >发布拼单</el-button
> >
</el-form-item> </el-form-item>
...@@ -88,13 +90,13 @@ ...@@ -88,13 +90,13 @@
align="center" align="center"
prop="scope" prop="scope"
label="操作" label="操作"
width="250" fixed="right"
> >
<template #default="scope"> <template #default="scope">
<div class="button-one"> <div class="button-one">
<el-button <el-button
type="primary" type="primary"
size="small" size="mini"
@click="handleModify(scope.row)" @click="handleModify(scope.row)"
>修改</el-button >修改</el-button
> >
...@@ -106,7 +108,7 @@ ...@@ -106,7 +108,7 @@
<el-button <el-button
v-show="scope.row.status === 1" v-show="scope.row.status === 1"
type="primary" type="primary"
size="small" size="mini"
@click="handleEnd(scope.row)" @click="handleEnd(scope.row)"
>结束</el-button >结束</el-button
> >
...@@ -122,7 +124,7 @@ ...@@ -122,7 +124,7 @@
scope.row.status === 2 || scope.row.status === 3 scope.row.status === 2 || scope.row.status === 3
" "
type="primary" type="primary"
size="small" size="mini"
@click="handleStart(scope.row)" @click="handleStart(scope.row)"
>开始</el-button >开始</el-button
> >
...@@ -133,7 +135,7 @@ ...@@ -133,7 +135,7 @@
<el-button <el-button
class="checkButton" class="checkButton"
type="primary" type="primary"
size="small" size="mini"
@click="handleLook(scope.row)" @click="handleLook(scope.row)"
>查看订单</el-button >查看订单</el-button
> >
...@@ -189,6 +191,13 @@ export default { ...@@ -189,6 +191,13 @@ export default {
}; };
}, },
methods: { methods: {
// 重置
reset() {
this.activity.activityName = "";
this.activity.online_status = "";
this.getActivityList();
},
/* API */ /* API */
// 获取商品列表 // 获取商品列表
async getActivityList() { async getActivityList() {
...@@ -331,6 +340,7 @@ export default { ...@@ -331,6 +340,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.manage-wrapper { .manage-wrapper {
height: 100%; height: 100%;
padding: 30px;
} }
.header { .header {
height: 100%; height: 100%;
......
...@@ -5,21 +5,36 @@ ...@@ -5,21 +5,36 @@
<el-button class="addCommodityBtn" @click="commodity('add', '')" <el-button class="addCommodityBtn" @click="commodity('add', '')"
>添加商品</el-button >添加商品</el-button
> >
<el-button class="commodLibraryAdd" @click="commodLibraryAdd" <!-- <el-button class="commodLibraryAdd" @click="commodLibraryAdd"
>从商品库添加</el-button >从商品库添加</el-button
> > -->
</div> </div>
<!-- Tab --> <!-- Tab -->
<el-table :data="comTableData" border style="width: 100%"> <el-table
<el-table-column label="显示顺序" align="center" width="140"> :data="comTableData"
border
style="width: 100%;margin-bottom:80px;"
:header-cell-style="cellClass"
>
<el-table-column label="显示顺序" align="center" width="50px">
<el-table-column label="" align="center" width="50px">
<template #default="scope">
<i
class="el-icon-top"
@click="upMove(scope.$index, scope.row)"
style="margin-right:15px;"
></i>
</template>
</el-table-column>
<el-table-column label="" align="center" width="50px">
<template #default="scope"> <template #default="scope">
<i class="el-icon-top" @click="upMove(scope.$index, scope.row)"></i>
<i <i
class="el-icon-bottom" class="el-icon-bottom"
@click="upDown(scope.$index, scope.row)" @click="upDown(scope.$index, scope.row)"
></i> ></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column>
<el-table-column <el-table-column
prop="goods_sku_id" prop="goods_sku_id"
label="商品ID" label="商品ID"
...@@ -36,8 +51,9 @@ ...@@ -36,8 +51,9 @@
<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="操作" width="120"> <el-table-column label="操作" width="120" fixed="right">
<template #default="scope"> <template #default="scope">
<div class="buttons_actions">
<el-button <el-button
type="text" type="text"
size="small" size="small"
...@@ -47,6 +63,7 @@ ...@@ -47,6 +63,7 @@
<el-button type="text" size="small" @click="removeCom(scope.row)" <el-button type="text" size="small" @click="removeCom(scope.row)"
>移除</el-button >移除</el-button
> >
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -54,7 +71,8 @@ ...@@ -54,7 +71,8 @@
<el-dialog <el-dialog
:title="addCommodityTitle" :title="addCommodityTitle"
v-model="addCommodityPopup" v-model="addCommodityPopup"
width="40%" width="50%"
custom-class="add_goods_dialog"
> >
<el-form <el-form
:inline="true" :inline="true"
...@@ -87,6 +105,7 @@ ...@@ -87,6 +105,7 @@
<el-form-item <el-form-item
label="商品标题:" label="商品标题:"
prop="goods_name" prop="goods_name"
style="width:90%;"
:rules="[{ required: true, message: '请输入商品标题' }]" :rules="[{ required: true, message: '请输入商品标题' }]"
> >
<el-input <el-input
...@@ -108,10 +127,10 @@ ...@@ -108,10 +127,10 @@
placeholder="" placeholder=""
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="划线价:"> <el-form-item label="划线价:" prop="original_price">
<el-input-number <el-input-number
class="price"
v-model="commodityForm.original_price" v-model="commodityForm.original_price"
class="price"
:min="0" :min="0"
:controls="false" :controls="false"
:precision="2" :precision="2"
...@@ -119,7 +138,11 @@ ...@@ -119,7 +138,11 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item label="新增库存:"> <el-form-item
label="库存:"
prop="inventory_total"
:rules="[{ required: true, message: '请输入库存' }]"
>
<el-input <el-input
v-model="commodityForm.inventory_total" v-model="commodityForm.inventory_total"
placeholder="" placeholder=""
...@@ -131,11 +154,55 @@ ...@@ -131,11 +154,55 @@
已售:<span style="margin-right: 10px">{{ 已售:<span style="margin-right: 10px">{{
commodityForm.total_amount_sold commodityForm.total_amount_sold
}}</span> }}</span>
剩余库存:<span>{{ inventoryRest }}</span> <!-- 剩余库存:<span>{{ commodityForm.inventory_total }}</span> -->
</div> </div>
<br />
<el-form-item <el-form-item
label="商家" prop="checkedRadio"
:rules="[
{
required: true,
message: '请选择购买限制',
trigger: 'change'
}
]"
class="limit_radio"
label="购买限制"
>
<el-radio-group v-model="commodityForm.checkedRadio">
<el-radio label="不限制"></el-radio>
<el-radio label="每人最多买"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
prop="num_limit"
:show-message="
commodityForm.checkedRadio === '每人最多买' ? true : false
"
:rules="[
{
validator:
commodityForm.checkedRadio === '每人最多买'
? checkPurseLimit
: checkPurseLimitNull,
trigger: 'blur'
}
]"
>
<el-input
v-model="commodityForm.num_limit"
:disabled="
commodityForm.checkedRadio === '' ||
commodityForm.checkedRadio === '不限制' ||
commodityForm.checkedRadio === undefined
? true
: false
"
:min="0"
:controls="false"
></el-input>
</el-form-item>
<el-form-item
label="商家:"
prop="business1" prop="business1"
:rules="[{ required: true, message: '请选择商家' }]" :rules="[{ required: true, message: '请选择商家' }]"
> >
...@@ -166,7 +233,7 @@ ...@@ -166,7 +233,7 @@
<el-dialog <el-dialog
title="选择商品" title="选择商品"
v-model="selCommodityPopup" v-model="selCommodityPopup"
width="60%" width="80%"
top="2%" top="2%"
> >
<div> <div>
...@@ -212,7 +279,7 @@ ...@@ -212,7 +279,7 @@
prop="inventory_rest" prop="inventory_rest"
label="剩余库存" label="剩余库存"
></el-table-column> ></el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@click="commodity('update', scope.row)" @click="commodity('update', scope.row)"
...@@ -243,44 +310,59 @@ import { ...@@ -243,44 +310,59 @@ import {
getBusinessList, getBusinessList,
pindanGoods, pindanGoods,
markGoodsInfo, markGoodsInfo,
editGoods, editGoods
} from "../../../../service/Activity/index"; } from "../../../../service/Activity/index";
// 当选择(每人最多买时 添加验证(非空))
let checkPurseLimit = (rule, value, callback) => {
let str = /^[1-9]\d*$/;
if (value === "" || value === undefined || value === 0) {
return callback(new Error("请添加限制购买数量"));
} else if (!str.test(value)) {
return callback(new Error("请输入正确的购买数量"));
} else {
callback();
}
};
let checkPurseLimitNull = (rule, value, callback) => {
callback();
};
export default { var addProduct = {
props: { props: {
editInfo: { editInfo: {
type: Object, type: Object,
required: () => {}, required: () => {}
}, },
addProduc: { addProduc: {
type: Array, type: Array,
required: () => {}, required: () => {}
}, },
stepTwoTitle: { stepTwoTitle: {
type: String, type: String,
default: "", default: ""
}, }
}, },
data() { data() {
return { return {
// 校验规则函数
checkPurseLimit: checkPurseLimit,
checkPurseLimitNull: checkPurseLimitNull,
// 商品列表 // 商品列表
comTableData: [], comTableData: [],
// 商品库列表 // 商品库列表
comLibTableData: [], comLibTableData: [],
businessOpt: [], // 商家数据 businessOpt: [], // 商家数据
// 添加商品
addCommodityPopup: false, // 添加商品弹窗状态 addCommodityPopup: false, // 添加商品弹窗状态
addCommodityTitle: "", // 标题 addCommodityTitle: "", // 标题
commodityForm: { commodityForm: {
goods_name: "", goods_name: "",
price: "", price: 0,
original_price: "", original_price: 0,
inventory_total: null, inventory_total: "",
total_amount_order: null, total_amount_order: "",
business1: "", business1: "",
num_limit: "", // 购买限制数量
checkedRadio: "" // 购买限制radio
}, },
picStr: "", picStr: "",
picUrlList: [], picUrlList: [],
...@@ -299,22 +381,16 @@ export default { ...@@ -299,22 +381,16 @@ export default {
inventoryTotal: 0, // 总库存 inventoryTotal: 0, // 总库存
inventoryRest: 0, // 剩余库存 inventoryRest: 0, // 剩余库存
inventory: 0, // 添加库存
}; };
}, },
// computed: {
// // 计算剩余库存
// inventoryRest() {
// if (this.commodityForm.inventory_total == null) {
// return 0;
// } else {
// return Number(
// this.commodityForm.inventory_total -
// this.commodityForm.total_amount_order
// );
// }
// },
// },
methods: { methods: {
cellClass() {
if (arguments.rowIndex === 1) {
return { display: "none" };
}
},
// 上移 // 上移
upMove(index) { upMove(index) {
if (index <= 0) { if (index <= 0) {
...@@ -339,6 +415,7 @@ export default { ...@@ -339,6 +415,7 @@ export default {
// 库存计算 // 库存计算
inventoryIpt(val) { inventoryIpt(val) {
if(val < 0) return this.commodityForm.inventory_total = 0;
var pattern = /^-?[1-9]\d*$|^0$/g; var pattern = /^-?[1-9]\d*$|^0$/g;
if (!pattern.test(this.commodityForm.inventory_total)) { if (!pattern.test(this.commodityForm.inventory_total)) {
this.commodityForm.inventory_total = ""; this.commodityForm.inventory_total = "";
...@@ -383,7 +460,7 @@ export default { ...@@ -383,7 +460,7 @@ export default {
const res = await getBusinessList(params); const res = await getBusinessList(params);
this.businessOpt = [ this.businessOpt = [
{ ota_id: "", ota_name: "全部" }, { ota_id: "", ota_name: "全部" },
...res.result.list, ...res.result.list
]; ];
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
...@@ -391,18 +468,28 @@ export default { ...@@ -391,18 +468,28 @@ export default {
} }
}, },
// 查看商品详情 // 查看商品详情(api)
async markGoodsInfoMet(goodSkuID) { async markGoodsInfoMet(goodSkuID) {
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.inventoryRest = res.result.goods_info.inventory_rest;
this.inventoryTotal = res.result.goods_info.inventory_total; this.inventoryTotal = res.result.goods_info.inventory_total;
this.inventory = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info; this.commodityForm = res.result.goods_info;
this.commodityForm.num_limit =
res.result.goods_info.rule_limit === 0
? ""
: res.result.goods_info.rule_limit; // 购买限制的数量
this.commodityForm.checkedRadio =
res.result.goods_info.rule_limit === 0 ||
res.result.goods_info.rule_limit === undefined
? "不限制"
: "每人最多买"; // 购买限制按钮选择
this.commodityForm.business1 = res.result.goods_info.ota_id; this.commodityForm.business1 = res.result.goods_info.ota_id;
this.picUrlList = []; 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( this.picStr = this.getUrlParms(
...@@ -417,26 +504,32 @@ export default { ...@@ -417,26 +504,32 @@ export default {
return ""; return "";
}, },
// 编辑商品详情 // 修改商品详情(api)
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.picStr, desc_pic_url: this.picStr,
desc: "", desc: "",
inventory_add: this.commodityForm.inventory_total, inventory_add: this.commodityForm.inventory_total - this.inventory,
original_price: this.commodityForm.original_price, original_price: this.commodityForm.original_price,
price: this.commodityForm.price, price: this.commodityForm.price,
marketing_name: this.editInfo.marketing_name, 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: getCookie('username'), op_cur_user: getCookie("username"),
// op_cur_user: store.state.userInfo.email, // op_cur_user: store.state.userInfo.email,
goods_sku_id: goodsSkuID, goods_sku_id: goodsSkuID,
rule_limit:
this.commodityForm.checkedRadio === "不限制" ||
this.commodityForm.checkedRadio === "" ||
this.commodityForm.checkedRadio === undefined
? 0
: this.commodityForm.num_limit
}); });
if (res.code == 0) { if (res.code == 0) {
ElMessage.success({ ElMessage.success({
message: "修改成功", message: "修改成功",
type: "success", type: "success"
}); });
await this.pindanGoodsMet(); await this.pindanGoodsMet();
let result = null; let result = null;
...@@ -464,48 +557,60 @@ export default { ...@@ -464,48 +557,60 @@ export default {
this.comLibTableData = res.result.list; this.comLibTableData = res.result.list;
}, },
// 添加修改商品 // 添加+修改商品
async commodity(type, val) { commodity(type, val) {
this.$refs.picUpload && this.$refs.picUpload.clearFiles && this.$refs.picUpload.clearFiles(); // 清楚图片
this.$refs.picUpload &&
this.$refs.picUpload.clearFiles &&
this.$refs.picUpload.clearFiles();
this.picUrlList = []; this.picUrlList = [];
this.picStr = '' this.picStr = "";
this.addCommodityPopup = true; this.addCommodityPopup = true;
this.commodityForm = {}; // this.commodityForm = {};
this.$nextTick(() => {
this.$refs.infoForm.resetFields(); // 清空表单数据
});
if (type == "add") { if (type == "add") {
this.hideUpload = false; this.hideUpload = false;
this.inventoryRest = 0; 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;
this.markGoodsInfoMet(this.goodsSkuID); this.markGoodsInfoMet(this.goodsSkuID); // 查看商品详情(api)
} }
}, },
// 添加商品 // 添加商品(api)
async addGoodsMet() { async addGoodsMet() {
const res = await addGoods({ const res = await addGoods({
marketing_name: this.stepTwoTitle, marketing_name: this.stepTwoTitle,
goods_name: this.commodityForm.goods_name, goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picStr, desc_pic_url: this.picStr,
desc: "", desc: "",
inventory: this.commodityForm.inventory_total, inventory: this.commodityForm.inventory_total - this.inventory,
original_price: this.commodityForm.original_price, original_price: this.commodityForm.original_price,
marketing_type: "4", marketing_type: "4",
price: this.commodityForm.price, price: this.commodityForm.price,
ota_id: this.commodityForm.business1, ota_id: this.commodityForm.business1,
op_cur_user: getCookie('username'), op_cur_user: getCookie("username"),
// op_cur_user: store.state.userInfo.email,
rule_limit:
this.commodityForm.checkedRadio === "不限制" ||
this.commodityForm.checkedRadio === "" ||
this.commodityForm.checkedRadio === undefined
? 0
: this.commodityForm.num_limit
}); });
if (res.code == 0) { if (res.code == 0) {
ElMessage.success({ ElMessage.success({
message: "添加商品成功", message: "添加商品成功",
type: "success", type: "success"
}); });
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);
...@@ -518,9 +623,9 @@ export default { ...@@ -518,9 +623,9 @@ export default {
this.$refs.infoForm.clearValidate(); this.$refs.infoForm.clearValidate();
}, },
// 添加商品保存 // 添加商品保存(操作)
commoditySave(infoForm) { commoditySave(infoForm) {
this.$refs[infoForm].validate((valid) => { this.$refs[infoForm].validate(valid => {
if (valid) { if (valid) {
if (this.addCommodityTitle == "商品添加") { if (this.addCommodityTitle == "商品添加") {
this.addGoodsMet(); this.addGoodsMet();
...@@ -533,6 +638,25 @@ export default { ...@@ -533,6 +638,25 @@ export default {
}); });
}, },
// commoditySave(infoForm) {
// console.log("baocun");
// this.$refs[infoForm].validate(valid => {
// console.log("00");
// if (valid) {
// console.log("add");
// if (this.addCommodityTitle == "商品添加") {
// this.addGoodsMet();
// } else {
// console.log("xiugai");
// this.editGoodsMet(this.goodsSkuID);
// }
// } else {
// console.log("validate");
// return false;
// }
// });
// },
// 从商品库添加 // 从商品库添加
async commodLibraryAdd() { async commodLibraryAdd() {
this.selCommodityPopup = true; this.selCommodityPopup = true;
...@@ -559,9 +683,9 @@ export default { ...@@ -559,9 +683,9 @@ export default {
if (this.comTableData.length == 0) { if (this.comTableData.length == 0) {
this.comTableData.push(...this.multipleSelection); this.comTableData.push(...this.multipleSelection);
} else { } else {
this.multipleSelection.forEach((item) => { this.multipleSelection.forEach(item => {
let num = 0; let num = 0;
this.comTableData.some((val) => { this.comTableData.some(val => {
num++; num++;
if (val.goods_sku_id === item.goods_sku_id) { if (val.goods_sku_id === item.goods_sku_id) {
val.goods_sku_id = item.goods_sku_id; val.goods_sku_id = item.goods_sku_id;
...@@ -584,36 +708,41 @@ export default { ...@@ -584,36 +708,41 @@ export default {
this.comTableData.splice(i, 1); this.comTableData.splice(i, 1);
} }
} }
}, }
}, },
watch: { watch: {
addProduc: function (newVal) { addProduc: function(newVal) {
let marketingId = this.$route.query.marketing_id; let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) { if (marketingId == undefined) {
return; return;
} }
this.comTableData = newVal; this.comTableData = newVal;
}, },
picUrlList: function () { picUrlList: function() {
if(this.picUrlList.length >= this.limitCount) { if (this.picUrlList.length >= this.limitCount) {
this.hideUpload = true this.hideUpload = true;
}else { } else {
this.hideUpload = false this.hideUpload = false;
}
} }
}, },
},
created() { created() {
this.getBusinessListMet(); this.getBusinessListMet();
}, }
}; };
export default addProduct;
</script> </script>
<style scoped> <style scoped lang="less">
.addProduc { .addProduc {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
} }
.buttons_actions {
display: flex;
justify-content: space-around;
align-items: center;
}
.btnGroup { .btnGroup {
margin-bottom: 15px; margin-bottom: 15px;
} }
...@@ -644,4 +773,9 @@ export default { ...@@ -644,4 +773,9 @@ export default {
.hide /deep/ .el-upload--picture-card { .hide /deep/ .el-upload--picture-card {
display: none; display: none;
} }
// 商品添加修改dialog-form表单
/deep/ .add_goods_dialog {
min-width: 370px;
}
</style> </style>
<template> <template>
<div class="infoEditing"> <div class="infoEditing">
<el-form ref="infoEditForm" :model="infoEditForm" label-width="80px"> <el-form
ref="infoEditForm"
:model="infoEditForm"
label-width="80px"
@submit.prevent
>
<el-form-item label="标题:"> <el-form-item label="标题:">
<el-input v-model="infoEditForm.title" maxlength="30"></el-input> <el-input v-model="infoEditForm.title" maxlength="30"></el-input>
</el-form-item> </el-form-item>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div id="map" class="mapContainer"> <div id="map" class="mapContainer">
<div class="mapWrapper"> <div class="mapWrapper">
<div class="search"> <div class="search">
<el-form ref="form" label-width="80px"> <el-form ref="form" label-width="80px" @submit.prevent>
<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
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
}); });
} }
}, },
async created() { async mounted() {
// 已载入高德地图API,则直接初始化地图 // 已载入高德地图API,则直接初始化地图
if (window.AMap && window.AMapUI) { if (window.AMap && window.AMapUI) {
this.initMap(); this.initMap();
...@@ -193,24 +193,24 @@ export default { ...@@ -193,24 +193,24 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mapDialog { // .mapDialog {
margin-top: 11vh !important; // margin-top: 11vh !important;
display: flex !important; // display: flex !important;
flex-direction: column !important; // flex-direction: column !important;
background: red !important; // background: red !important;
/deep/ .el-dialog__body { // /deep/ .el-dialog__body {
height: 90%; // height: 90%;
} // }
} // }
.mapContainer { .mapContainer {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; // display: flex;
flex-direction: row; // flex-direction: column;
.mapWrapper { .mapWrapper {
position: relative; position: relative;
width: 80%; width: 80%;
height: 100%; height: 30vh;
.search { .search {
position: absolute; position: absolute;
top: 10px; top: 10px;
......
<template> <template>
<div class="spellOrderSet"> <div class="spell_order_set_wrapper">
<!-- 时间选择器 --> <!-- 时间选择器 -->
<div class="datepickerWrapper"> <div class="datepickerWrapper">
<span class="demonstration">拼单起止时间: </span> <p class="demonstration">拼单起止时间:</p>
<el-date-picker <el-date-picker
class="startTimePicker" class="start_time_picker"
v-model="startDate" v-model="startDate"
type="datetime" type="datetime"
popper-class="date_picker" popper-class="date_picker"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
> >
</el-date-picker> </el-date-picker>
<el-date-picker <el-date-picker
class="endTimePicker" class="end_time_picker"
v-model="endDate" v-model="endDate"
:clearable="false" :clearable="false"
type="datetime" type="datetime"
...@@ -32,26 +32,32 @@ ...@@ -32,26 +32,32 @@
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)"
> >
<el-card class="card-block"> <!-- 自提点表单 -->
<p>自提点设置</p> <div class="search_form_wrapper">
<el-form ref="form" label-width="80px"> <p class="title">自提点设置</p>
<el-form ref="form" label-width="80px" inline @submit.prevent>
<el-form-item> <el-form-item>
<el-input <el-input
style="width:250px"
class="set" class="set"
v-model="selfLiftingPoint" v-model="selfLiftingPoint"
placeholder="自提点名称/自提点联系人" placeholder="自提点名称/自提点联系人"
></el-input> ></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getPlaceList">搜索</el-button> <el-button type="primary" @click="getPlaceList">搜索</el-button>
<el-button type="primary" @click="dialogFormVisible = true" <el-button type="primary" @click="dialogFormVisible = true"
>添加自提点</el-button >添加自提点</el-button
> >
</el-form-item> </el-form-item>
</el-form>
</div>
<!-- 自提点列表 -->
<div class="tabla-wrapper"> <div class="tabla-wrapper">
<p class="checked">{{ `已选 ${checkedNum}` }}</p> <p class="checked">{{ `已选 ${checkedNum}` }}</p>
<!-- 自提点列表 -->
<el-table <el-table
class="tableList" class="tableList"
max-height="350" max-height="450"
ref="multipleTable" ref="multipleTable"
:data="takePlacelist" :data="takePlacelist"
border border
...@@ -94,6 +100,7 @@ ...@@ -94,6 +100,7 @@
align="center" align="center"
label="操作" label="操作"
width="width" width="width"
fixed="right"
> >
<template #default="scope"> <template #default="scope">
<el-popconfirm <el-popconfirm
...@@ -102,6 +109,7 @@ ...@@ -102,6 +109,7 @@
> >
<template #reference> <template #reference>
<el-button <el-button
class="delete_button"
type="primary" type="primary"
size="small" size="small"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
...@@ -124,28 +132,25 @@ ...@@ -124,28 +132,25 @@
> >
</el-pagination> </el-pagination>
</div> </div>
</el-form>
</el-card>
</div> </div>
<!-- 添加自提点dialog -->
<!-- 添加自提点 -->
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
:center="true"
title="添加自提点" title="添加自提点"
v-model="dialogFormVisible" v-model="dialogFormVisible"
:show-close="false" :show-close="false"
custom-class="add_takePlace_dialog"
> >
<el-form <el-form
style="margin-left: 70px"
:model="form" :model="form"
:rules="rules" :rules="rules"
ref="ruleForm" ref="ruleForm"
:inline="true"
label-position="left"
label-width="120px"
> >
<el-form-item <el-form-item label="自提点名称" prop="name">
label="自提点名称"
prop="name"
:label-width="formLabelWidth"
>
<el-input <el-input
class="dialog-input" class="dialog-input"
v-model="form.name" v-model="form.name"
...@@ -154,34 +159,34 @@ ...@@ -154,34 +159,34 @@
autocomplete="off" autocomplete="off"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<br />
<el-form-item <el-form-item
label="位置" label="位置"
prop="location" prop="location"
:label-width="formLabelWidth" class="location_wrapper"
style="width:100%"
> >
<div class="location_input_wrapper">
<el-input <el-input
class="dialog-input" class="dialog-input"
v-model="form.location" v-model="form.location"
placeholder="" placeholder=""
:disabled="true" :disabled="true"
></el-input> ></el-input>
</div>
<div class="location_text_wrapper">
<el-button type="primary" @click="mapDialogVisible = true" <el-button type="primary" @click="mapDialogVisible = true"
>从高德获取坐标</el-button >从高德获取坐标</el-button
> >
</div>
</el-form-item> </el-form-item>
<br />
<p class="location">{{ form.location }}</p> <p class="location">{{ form.location }}</p>
<el-form-item <el-form-item prop="address" label="详细地址">
prop="address"
label="详细地址"
:label-width="formLabelWidth"
>
<el-input class="dialog-input" v-model="form.address"></el-input> <el-input class="dialog-input" v-model="form.address"></el-input>
</el-form-item> </el-form-item>
<el-form-item <br />
label="自提点联系人" <el-form-item label="自提点联系人" prop="contactor">
prop="contactor"
:label-width="formLabelWidth"
>
<el-input <el-input
class="dialog-input" class="dialog-input"
v-model="form.contactor" v-model="form.contactor"
...@@ -189,14 +194,11 @@ ...@@ -189,14 +194,11 @@
show-word-limit show-word-limit
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <br />
prop="phone" <el-form-item prop="phone" type="tel" label="联系电话">
type="tel"
label="联系电话"
:label-width="formLabelWidth"
>
<el-input class="dialog-input" v-model="form.phone"></el-input> <el-input class="dialog-input" v-model="form.phone"></el-input>
</el-form-item> </el-form-item>
<br />
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
...@@ -205,7 +207,6 @@ ...@@ -205,7 +207,6 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<!-- 地图 dialog --> <!-- 地图 dialog -->
<el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%"> <el-dialog custom-class="mapDialog" v-model="mapDialogVisible" width="100%">
<my-map <my-map
...@@ -242,6 +243,7 @@ export default { ...@@ -242,6 +243,7 @@ export default {
.add(7, "day") .add(7, "day")
.format("YYYY-MM-DD HH:mm:ss"), // 结束时间 .format("YYYY-MM-DD HH:mm:ss"), // 结束时间
pickerOptions: { pickerOptions: {
// 规则
disabledDateStart(time) { disabledDateStart(time) {
let _now = Date.now(); let _now = Date.now();
let threeDays = _now + 3 * 24 * 60 * 60 * 1000; let threeDays = _now + 3 * 24 * 60 * 60 * 1000;
...@@ -276,7 +278,8 @@ export default { ...@@ -276,7 +278,8 @@ export default {
pageCount: 0, // 总条数 pageCount: 0, // 总条数
takePlacelist: [], // 自提点列表 takePlacelist: [], // 自提点列表
signal: false, signal: false,
checkedTakePlacelist: [], // 已选择自提点列表 活动详情中添加的自提点列表 checkedTakePlacelist: [], // 已选择自提点列表 活动详情中添加的自提点列表(api)
currentCheckedTakePlacelist: [], // 已选择自提点列表 用户本地操作勾选的+api
hasCheckedList: false, // 表示是否有选中的自提点列表 是编辑还是添加的区别 hasCheckedList: false, // 表示是否有选中的自提点列表 是编辑还是添加的区别
multipleSelection: [], multipleSelection: [],
dialogFormVisible: false, dialogFormVisible: false,
...@@ -290,7 +293,8 @@ export default { ...@@ -290,7 +293,8 @@ export default {
province: "", province: "",
city: "", city: "",
area: "" area: ""
} // 添加自提点 详细信息 }, // 添加自提点 详细信息
isPc: document.documentElement.clientWidth > 600,
}; };
}, },
computed: { computed: {
...@@ -328,11 +332,11 @@ export default { ...@@ -328,11 +332,11 @@ export default {
}, },
watch: { watch: {
spellOrderSetArr: { spellOrderSetArr: {
// 监听props属性 展示自提点列表 // 监听props属性 展示自提点列表(APi默认勾选的)
handler: async function() { handler: async function(newList) {
this.checkedTakePlacelist = this.setTableListData( this.checkedTakePlacelist = this.setTableListData(
// 选中的自提点列表 // 选中的自提点列表
this.spellOrderSetArr newList
); );
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
await this.getPlaceList(); await this.getPlaceList();
...@@ -341,14 +345,9 @@ export default { ...@@ -341,14 +345,9 @@ export default {
this.endDate = this.endTime; this.endDate = this.endTime;
this.checkedTakePlacelist = this.setTableListData( this.checkedTakePlacelist = this.setTableListData(
this.spellOrderSetArr this.spellOrderSetArr
); // 选中的自提点列表 );
this.currentList = this.checkedTakePlacelist.map(item => { // 选中的自提点列表
return item.id; this.mergeCheckedList(this.checkedTakePlacelist);
});
let list = this.takePlacelist.filter(item => {
return this.currentList.includes(item.id);
});
this.toggleSelection(list);
this.signal = true; this.signal = true;
} }
}, },
...@@ -372,15 +371,8 @@ export default { ...@@ -372,15 +371,8 @@ export default {
this.pageLoading = false; this.pageLoading = false;
this.takePlacelist = this.setTableListData(data.result.list); this.takePlacelist = this.setTableListData(data.result.list);
this.pageCount = data.result.total; this.pageCount = data.result.total;
if (this.signal === true) { if (this.signal === true) {
this.currentList = this.checkedTakePlacelist.map(item => { this.mergeCheckedList(this.currentCheckedTakePlacelist);
return item.id;
});
let list = this.takePlacelist.filter(item => {
return this.currentList.includes(item.id);
});
this.toggleSelection(list);
} }
} catch { } catch {
this.pageLoading = false; this.pageLoading = false;
...@@ -408,7 +400,7 @@ export default { ...@@ -408,7 +400,7 @@ 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 contact_name: this.form.contactor
}); });
try { try {
this.pageLoading = true; this.pageLoading = true;
...@@ -435,6 +427,19 @@ export default { ...@@ -435,6 +427,19 @@ export default {
return result; return result;
}, },
/* 自提点勾选的合并
@current 当前勾选
*/
mergeCheckedList(current) {
let currentIdList = current.map(item => {
return item.id;
});
let list = this.takePlacelist.filter(item => {
return currentIdList.includes(item.id);
});
this.toggleSelection(list);
},
// 删除自提点操作 // 删除自提点操作
handleDelete(val) { handleDelete(val) {
this.id = val.id; this.id = val.id;
...@@ -470,8 +475,10 @@ export default { ...@@ -470,8 +475,10 @@ export default {
this.page = val; this.page = val;
this.getPlaceList(); this.getPlaceList();
}, },
// 复选框
// 复选框(提供给父组件)
handleSelectionChange(val) { handleSelectionChange(val) {
this.currentCheckedTakePlacelist = val; // 当前勾选的列表
this.checkedNum = val.length; this.checkedNum = val.length;
this.multipleSelection = val; this.multipleSelection = val;
let takePlaceIds = ""; let takePlaceIds = "";
...@@ -484,6 +491,7 @@ export default { ...@@ -484,6 +491,7 @@ export default {
}); });
this.$emit("getTakeTakePlaceListFromChild", takePlaceIds); this.$emit("getTakeTakePlaceListFromChild", takePlaceIds);
}, },
// 勾选某些列表的操作 // 勾选某些列表的操作
toggleSelection(rows) { toggleSelection(rows) {
if (rows) { if (rows) {
...@@ -516,12 +524,13 @@ export default { ...@@ -516,12 +524,13 @@ export default {
created() { created() {
if (!this.$route.query.marketing_id) { if (!this.$route.query.marketing_id) {
this.getPlaceList(); this.getPlaceList();
this.signal = true;
} }
} }
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scoped>
.el-picker-panel { .el-picker-panel {
.el-picker-panel__footer { .el-picker-panel__footer {
.el-button--text { .el-button--text {
...@@ -531,52 +540,84 @@ export default { ...@@ -531,52 +540,84 @@ export default {
} }
</style> </style>
<style lang="less"> <style lang="less" scoped>
.spell_order_set_wrapper {
//text-align: center;
// 时间选择
.datepickerWrapper {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
.demonstration {
margin: 20px;
}
/deep/ .start_time_picker {
margin: 20px;
}
/deep/ .end_time_picker {
margin: 20px;
}
}
.add_takePlace_dialog {
.location_wrapper {
/deep/ .el-form-item__content {
width: calc(100% - 120px);
display: inline-flex;
flex-wrap: wrap;
}
.location_input_wrapper {
width: 60%;
min-width: 178px;
}
.location_text_wrapper {
width: 40%;
}
}
}
//添加自提点dialog
@media screen and (max-width: 800px) {
/deep/ .add_takePlace_dialog {
width: 100% !important;
}
}
}
.card-wrapper { .card-wrapper {
width: 100%; width: 100%;
//height: 500px; .search_form_wrapper {
.card-block { text-align: center;
width: 100%; .title {
height: 50px;
line-height: 30px;
}
}
// table 自提点表格
.tabla-wrapper { .tabla-wrapper {
> p { > p {
margin-left: 10px; margin-left: 10px;
text-align: left; text-align: left;
} }
.tableList { .tableList {
height: 500px; height: 600px;
.delete_button {
margin: 0;
} }
} }
} }
.pagination-wrapper { }
.pagination-wrapper {
height: 60px; height: 60px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
}
.spellOrderSet {
text-align: center;
margin: 50px 0;
.datepickerWrapper {
margin: 1px 0 30px;
}
.startTimePicker {
margin-right: 50px;
}
}
.set {
width: 50%;
margin-top: 40px;
}
.el-button {
margin-left: 30px;
} }
.tabList { .tabList {
margin-top: 10px; margin-top: 10px;
} }
.dialog-input {
width: 50%;
}
.location { .location {
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 14%; margin-left: 14%;
...@@ -589,11 +630,12 @@ export default { ...@@ -589,11 +630,12 @@ export default {
.mapDialog { .mapDialog {
height: 80%; height: 80%;
margin-top: 10vh !important; margin-top: 10vh !important;
.el-dialog__body {
height: 85% !important;
}
.my-map { .my-map {
height: 100%; height: 100%;
} }
} }
/deep/ .el-dialog__body {
height: 85% !important;
}
</style> </style>
<template> <template>
<div class="releaseProducBox">
<div class="releaseProduc"> <div class="releaseProduc">
<h4 class="headTitle">发布活动</h4> <h4 class="headTitle">发布活动</h4>
<el-steps <el-steps
...@@ -8,9 +9,9 @@ ...@@ -8,9 +9,9 @@
space="30%" space="30%"
:align-center="true" :align-center="true"
> >
<el-step title="信息编辑"></el-step> <el-step title="信息编辑" @click="step1"></el-step>
<el-step title="添加商品"></el-step> <el-step title="添加商品" @click="step2"></el-step>
<el-step title="拼单设置"></el-step> <el-step title="拼单设置" @click="step3"></el-step>
</el-steps> </el-steps>
<div class="content"> <div class="content">
<infoEditing <infoEditing
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
@getTakeTakePlaceListFromChild="getTakeTakePlaceListFromChild" @getTakeTakePlaceListFromChild="getTakeTakePlaceListFromChild"
/> />
</div> </div>
</div>
<div class="stepsBtn"> <div class="stepsBtn">
<el-button @click="prev" v-show="active >= 2" style="margin-right: 20px" <el-button @click="prev" v-show="active >= 2" style="margin-right: 20px"
>上一步</el-button >上一步</el-button
...@@ -85,6 +87,35 @@ export default { ...@@ -85,6 +87,35 @@ export default {
}, },
methods: { methods: {
// 步骤条点击事件
step1() {
if (this.$route.query.marketing_id != undefined) {
this.active = 1;
}
},
step2() {
if (this.$route.query.marketing_id != undefined) {
if (this.$refs.infoEdit.infoEditForm.title == "") {
ElMessage.error("请填写商品标题");
return;
}
this.active = 2;
}
},
step3() {
if (this.$route.query.marketing_id != undefined) {
if (this.$refs.infoEdit.infoEditForm.title == "") {
ElMessage.error("请填写商品标题");
return;
} else if (this.$refs.addProduc.comTableData.length == 0) {
ElMessage.error("请至少选择一个商品");
return;
} else {
this.active = 3;
}
}
},
// 上一步 // 上一步
prev() { prev() {
this.active--; this.active--;
...@@ -199,20 +230,37 @@ export default { ...@@ -199,20 +230,37 @@ export default {
}; };
</script> </script>
<style scope> <style lang="less" scope>
.releaseProduc { .releaseProduc {
height: 100%;
padding: 30px; padding: 30px;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
}
@media screen and (max-width: 800px) {
// form表单
.releaseProduc {
padding: 0;
}
} }
.headTitle { .headTitle {
height: 30px;
width: 75%; width: 75%;
font-size: 18px; font-size: 18px;
margin: 0 auto 40px auto; margin: 0 auto 40px auto;
} }
.steps {
height: 60px;
}
/* 内容cotent */
.content {
flex-grow: 1;
}
.steps { .steps {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-bottom: 50px; margin-bottom: 35px;
} }
.steps /deep/ .el-step__icon { .steps /deep/ .el-step__icon {
width: 50px; width: 50px;
...@@ -221,13 +269,14 @@ export default { ...@@ -221,13 +269,14 @@ export default {
.steps /deep/ .el-step.is-horizontal .el-step__line { .steps /deep/ .el-step.is-horizontal .el-step__line {
top: 25px; top: 25px;
} }
.stepsBtn {
margin: 20px auto;
}
.stepsBtn { .stepsBtn {
width: 64%; width: 100%;
height: 80px;
line-height: 80px;
background: white;
/* position: fixed;
bottom: 0px; */
text-align: center; text-align: center;
margin-top: 50px; z-index: 999;
} }
</style> </style>
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
label="金额计算方式:" label="金额计算方式:"
prop="commission_mode" prop="commission_mode"
:disable="disabled" :disable="disabled"
@change="changeCommissionMode"
> >
<el-radio-group <el-radio-group
v-model="ruleForm.commission_mode" v-model="ruleForm.commission_mode"
...@@ -567,6 +568,10 @@ export default { ...@@ -567,6 +568,10 @@ export default {
this.timeSelect = []; this.timeSelect = [];
} }
}, },
changeCommissionMode() {
this.ruleForm.first_commission_value = ''
this.ruleForm.second_commission_value = ''
},
// 获取时间格式 // 获取时间格式
formatTime(date) { formatTime(date) {
// 封装函数判断是否要在目标前边加 ’0‘ // 封装函数判断是否要在目标前边加 ’0‘
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
height: 100%; height: 100%;
padding: 0 30px; padding: 0 30px;
.header { .header {
text-align: right; display: flex;
justify-content: flex-end;
margin-bottom: 30px; margin-bottom: 30px;
} }
.dioFor { .dioFor {
......
<template> <template>
<Layout> <Layout>
<el-card class="goods"> <el-card class="goods" v-loading="pageLoading">
<div class="header"> <div class="header">
<el-button type="primary" @click="assignDeliverer" <el-button type="primary" @click="assignDeliverer"
>分配配送员</el-button >分配配送员</el-button
...@@ -9,47 +9,42 @@ ...@@ -9,47 +9,42 @@
>添加配送员</el-button >添加配送员</el-button
> >
</div> </div>
<el-table :data="distribList" border stripe style="width: 100%"> <el-table :data="distribList" border stripe fit style="width: 100%">
<el-table-column <el-table-column align="center" prop="activeName" label="活动名称">
align="center"
prop="activeName"
label="活动名称"
width="width"
>
</el-table-column> </el-table-column>
<el-table-column align="center" label="配送员数量" width="width"> <el-table-column align="center" label="配送员数量">
<template #default="scope"> <template #default="scope">
{{ scope.row.list.length }} {{ scope.row.list.length }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" prop="deliverer_name" label="配送人员">
align="center"
prop="deliverer_name"
label="配送人员"
width="width"
>
<template #default="scope"> <template #default="scope">
{{ scope.row.list.map((item) => item.deliverer_name).join("、") }} {{ scope.row.list.map(item => item.deliverer_name).join("、") }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="prop" label="操作" width="width" align="center"> <el-table-column
prop="prop"
label="操作"
align="center"
min-width="100"
>
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="handleModify(scope.row)" <el-button type="primary" @click="handleModify(scope.row)"
>修改</el-button >修改</el-button
> >
<el-button <el-button type="primary" @click="downloadDeliveryRoute(scope.row)"
type="primary"
v-show="scope.row.url"
@click="handleDownload(scope.row.url)"
>下载配送路线</el-button >下载配送路线</el-button
> >
<el-button type="primary" @click="getEmailRecord(scope.row)"
>发送记录</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 页码区 --> <!-- 页码区 -->
<Pagination <Pagination
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
v-model:current-page="page" :current-page="page"
:page-size="pageSize" :page-size="pageSize"
:total="total" :total="total"
></Pagination> ></Pagination>
...@@ -137,6 +132,7 @@ ...@@ -137,6 +132,7 @@
:disabled="isEdit" :disabled="isEdit"
clearable clearable
filterable filterable
@change="getSelectActivityInfo"
> >
<el-option <el-option
:label="item.label" :label="item.label"
...@@ -198,17 +194,77 @@ ...@@ -198,17 +194,77 @@
</template> </template>
</el-dialog> </el-dialog>
</el-card> </el-card>
<!-- 发送邮件的dialog -->
<YDDialog
dialogTitle="下载配送路线"
cancelButtonText="关闭"
:dialogCenter="true"
:myDialogVisible="sendEmailDialogVisible"
cancelDialogMethodName="sendEmailDialogCancel"
confirmDialogMethodName="sendEmailDialogConfirm"
@sendEmailDialogCancel="sendEmailDialogCancel"
@sendEmailDialogConfirm="sendEmailDialogConfirm"
>
<div class="emailContent">
<p>
生成配送路线大概需要两分钟,生成完毕后会发送到您的邮箱,请填写接受邮箱(一点邮箱)
</p>
<div class="emialInputWrapper">
<el-input
class="myInput"
v-model="myEmialInput"
placeholder="请输入邮箱地址"
:class="{
myInputRequire: isEmailRequire,
myInputError: emialHasError
}"
></el-input>
<span>@yidian-inc.com</span>
</div>
</div>
</YDDialog>
<!-- 显示email发送情况的列表 -->
<YDDialog
dialogTitle="发送记录"
cancelButtonText="关闭"
:dialogCenter="true"
:isShowConfirmButton="false"
:myDialogVisible="showEmailTableDialogVisible"
cancelDialogMethodName="showEmailDialogCancel"
@showEmailDialogCancel="showEmailDialogCancel"
>
<div
class="emailListContent"
v-loading="emailRecordsLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
>
<el-table :data="emailListTableData" style="width: 100%">
<el-table-column prop="email" label="接收邮箱" width="180">
</el-table-column>
<el-table-column prop="sendTime" label="发送时间" width="180">
</el-table-column>
<el-table-column prop="status" label="状态"> </el-table-column>
</el-table>
</div>
</YDDialog>
</Layout> </Layout>
</template> </template>
<script> <script>
import { checkEmailName } from "../../../utils/tools.js";
import YDDialog from "@/components/Dialog/YDDialoag.vue";
import Layout from "../layout/index.vue"; import Layout from "../layout/index.vue";
import Pagination from "../components/Pagination/index.vue"; import Pagination from "../components/Pagination/index.vue";
//import Pagination from "../components/Pagination/index.vue";
import { import {
getDelivererList, getDelivererList,
getList, getList,
getSaveDeliverer, getSaveDeliverer,
getAddDeliverer, getAddDeliverer,
newGetMarketingList, newGetMarketingList,
getEmailRecords,
getDeliveryRoutes
} from "../../../service/Groupmeal/groupmeal"; } from "../../../service/Groupmeal/groupmeal";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
export default { export default {
...@@ -216,18 +272,28 @@ export default { ...@@ -216,18 +272,28 @@ export default {
components: { components: {
Layout, Layout,
Pagination, Pagination,
YDDialog
}, },
data() { data() {
return { return {
sendEmailDialogVisible: false, // 发送email弹窗
myEmialInput: "", // email地址
deliverer_xlsx_id: "", // 下载配送路线API参数
isEmailRequire: false, // 验证emial非空
emialHasError: false, // 验证email格式
showEmailTableDialogVisible: false, // 展示email发送情况的dialog
emailRecordsLoading: false, // table-loading
pageLoading: false,
emailListTableData: [],
rules: { rules: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }], name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
max_capacity: [ max_capacity: [
{ required: true, message: "请填写配送上限", trigger: "blur" }, { required: true, message: "请填写配送上限", trigger: "blur" }
// { type: "number", message: "请填写数值哦", trigger: "change" }, // { type: "number", message: "请填写数值哦", trigger: "change" },
], ],
min_capacity: [ min_capacity: [
{ type: "number", message: "请填写数值哦", trigger: "change" }, { type: "number", message: "请填写数值哦", trigger: "change" }
], ]
}, },
dialogFormAdd: false, dialogFormAdd: false,
// 列表 // 列表
...@@ -237,18 +303,19 @@ export default { ...@@ -237,18 +303,19 @@ export default {
name: "", name: "",
max_capacity: "", //配送上限 max_capacity: "", //配送上限
min_capacity: "", //最小配送量 min_capacity: "", //最小配送量
tool_type: [], //配送工具 tool_type: [] //配送工具
}, },
//分配配送员弹框 //分配配送员弹框
dialogFormAssign: false, dialogFormAssign: false,
deliverer: [], deliverer: [],
multipleSelection: [], multipleSelection: [],
selectActivity: "", //活动下拉框 selectActivity: "", //活动下拉框
codeForModify: "", // 存储修改的code
total: 0, total: 0,
page: 1, page: 1,
pageSize: 20, pageSize: 20,
isEdit: false, isEdit: false,
marketingList: [], marketingList: []
}; };
}, },
created() { created() {
...@@ -272,7 +339,7 @@ export default { ...@@ -272,7 +339,7 @@ export default {
name: "", name: "",
max_capacity: "", //配送上限 max_capacity: "", //配送上限
min_capacity: "", //最小配送量 min_capacity: "", //最小配送量
tool_type: [], //配送工具 tool_type: [] //配送工具
}), }),
(this.deliverer = []), (this.deliverer = []),
(this.multipleSelection = []); (this.multipleSelection = []);
...@@ -283,7 +350,7 @@ export default { ...@@ -283,7 +350,7 @@ export default {
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);
...@@ -306,7 +373,7 @@ export default { ...@@ -306,7 +373,7 @@ export default {
name, name,
max_capacity: +max_capacity, max_capacity: +max_capacity,
min_capacity: +min_capacity, min_capacity: +min_capacity,
tool_type: +tool_type, tool_type: +tool_type
}; };
try { try {
const { code, reason } = await getAddDeliverer(params); const { code, reason } = await getAddDeliverer(params);
...@@ -318,7 +385,7 @@ export default { ...@@ -318,7 +385,7 @@ export default {
name: "", name: "",
max_capacity: "", //配送上限 max_capacity: "", //配送上限
min_capacity: "", //最小配送量 min_capacity: "", //最小配送量
tool_type: [], //配送工具 tool_type: [] //配送工具
}; };
} catch (error) { } catch (error) {
ElMessage("请求添加配送员失败"); ElMessage("请求添加配送员失败");
...@@ -329,6 +396,10 @@ export default { ...@@ -329,6 +396,10 @@ export default {
this.dialogFormAdd = false; this.dialogFormAdd = false;
this.resetDate(); this.resetDate();
}, },
// 分配配送员活动select改变
getSelectActivityInfo(val) {
this.codeForModify = val;
},
// 分配配送员 // 分配配送员
assignDeliverer() { assignDeliverer() {
this.dialogFormAssign = true; this.dialogFormAssign = true;
...@@ -341,8 +412,8 @@ export default { ...@@ -341,8 +412,8 @@ export default {
async handleModify(row) { async handleModify(row) {
this.dialogFormAssign = true; this.dialogFormAssign = true;
const { code } = row; const { code } = row;
this.selectActivity = code; this.codeForModify = row.code;
console.log(code); this.selectActivity = row.activeName;
try { try {
const res = await getDelivererList({ code }); const res = await getDelivererList({ code });
this.deliverer = res.response; this.deliverer = res.response;
...@@ -350,7 +421,7 @@ export default { ...@@ -350,7 +421,7 @@ export default {
this.getList(); this.getList();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
this.deliverer.forEach((row) => { this.deliverer.forEach(row => {
if (row.checked) { if (row.checked) {
this.$refs.multipleTable.toggleRowSelection(row, true); this.$refs.multipleTable.toggleRowSelection(row, true);
} }
...@@ -361,27 +432,30 @@ export default { ...@@ -361,27 +432,30 @@ export default {
} }
}, },
// 下载路线 // 下载路线
handleDownload(url) { downloadDeliveryRoute(rowInfo) {
this.deliverer_xlsx_id = rowInfo.deliverer_xlsx_id;
this.sendEmailDialogVisible = true;
// url && window.open("http://bp-dev.ini.yidian-inc.com" + url); // url && window.open("http://bp-dev.ini.yidian-inc.com" + url);
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") { // } else if (process.env.NODE_ENV == "test") {
ENV = "http://bp-test.ini.yidian-inc.com/"; // ENV = "http://bp-test.ini.yidian-inc.com/";
} else { // } else {
ENV = "http://bp.int.yidian-inc.com/"; // ENV = "http://bp.ini.yidian-inc.com/";
} // }
url && window.open(ENV + url); // url && window.open(ENV + url);
}, },
// 分配保存 // 分配保存
async save() { async save() {
const { selectActivity, multipleSelection } = this; const { selectActivity, multipleSelection } = this;
const uids = multipleSelection.map((item) => item.deliverer_id); const uids = multipleSelection.map(item => item.deliverer_id);
if (!selectActivity) return ElMessage("请选择活动姓名"); if (!selectActivity) return ElMessage("请选择活动姓名");
const codeForModify = this.codeForModify;
try { try {
const { code, reason } = await getSaveDeliverer({ const { code, reason } = await getSaveDeliverer({
code: selectActivity, code: codeForModify,
uids: uids.join(","), uids: uids.join(",")
}); });
if (code !== 0) if (code !== 0)
return this.$message.error( return this.$message.error(
...@@ -406,10 +480,10 @@ export default { ...@@ -406,10 +480,10 @@ export default {
async newGetMarketingList() { async newGetMarketingList() {
try { try {
const res = await newGetMarketingList(); 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) {
...@@ -422,13 +496,138 @@ export default { ...@@ -422,13 +496,138 @@ export default {
const res = await getDelivererList(); const res = await getDelivererList();
// this.deliverer.code = res.response.code; // this.deliverer.code = res.response.code;
this.deliverer = res.response; this.deliverer = res.response;
console.log(this.deliverer);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
}, },
/* 邮箱弹窗相关操作 */
// 下载路线(API)
async downloadDeliveryRoutesAPI() {
await getDeliveryRoutes({
deliverer_xlsx_id: this.deliverer_xlsx_id,
email: this.myEmialInput + "@yidian-inc.com"
});
},
// 取消下载路线操作
sendEmailDialogCancel() {
this.myEmialInput = ""; // 清空输入
this.isEmailRequire = false;
this.emialHasError = false;
this.sendEmailDialogVisible = false;
},
// 确认下载路线操作
async sendEmailDialogConfirm() {
if (this.myEmialInput.trim() === "") {
this.isEmailRequire = true;
return;
}
if (!checkEmailName(this.myEmialInput)) {
this.emialHasError = true;
return;
}
try {
this.pageLoading = true;
await this.downloadDeliveryRoutesAPI();
this.pageLoading = false;
this.sendEmailDialogCancel();
ElMessage.success("操作成功");
} catch (err) {
this.pageLoading = false;
if (err) {
ElMessage.error(err);
} else {
ElMessage.error("请求错误");
}
}
// this.myEmialInput = ""; // 清空输入
// this.isEmailRequire = false;
// this.emialHasError = false;
// this.sendEmailDialogVisible = false;
},
// 查看邮箱记录(API)
async getEmailRecordsAPI() {
let data = await getEmailRecords({
deliverer_xlsx_id: this.deliverer_xlsx_id
});
this.emailListTableData = this.formatEmailRecord(data.result);
},
// 查看发送记录
async getEmailRecord(rowInfo) {
this.deliverer_xlsx_id = rowInfo.deliverer_xlsx_id; // 赋值 取参数
this.showEmailTableDialogVisible = true;
try {
this.emailRecordsLoading = true;
await this.getEmailRecordsAPI();
this.emailRecordsLoading = false;
} catch (err) {
this.emailRecordsLoading = false;
if (err) {
ElMessage.error(err);
} else {
ElMessage.error("请求错误");
}
}
},
//带emailtable的dialog
showEmailDialogCancel() {
this.showEmailTableDialogVisible = false;
}, },
// 数据转换(api-table展示)
// create_time: "2021-08-19 17:38:05"
// deliverer_xlsx_id: 49
// deliverer_xlsx_log_id: 4
// email: "asdasdasdf"
// send_status: 1
// send_time: ""
// update_time: "2021-08-19 17:38:13"
formatEmailRecord(initialData) {
let matchRelation = {
"0": "待生成",
"1": "生成中",
"2": "已发送",
"3": "发送失败"
};
let result = initialData.map(item => {
let res = {
email: item.email,
sendTime: item.send_time,
status: matchRelation[item.send_status.toString()]
};
return res;
});
return result;
}
}
}; };
</script> </script>
<style lang="less" src="./index.less" scope> <style lang="less" src="./index.less" scope></style>
<style lang="less" scoped>
// 邮箱dialog
.emailContent {
.emialInputWrapper {
display: flex;
align-items: center;
margin: 15px 0;
.myInput {
width: 50%;
}
.myInputRequire::after {
content: "输入不能为空";
position: absolute;
left: 2px;
top: 35px;
color: red;
}
// 验证emial非空
.myInputError::after {
content: "输入邮箱不合法";
position: absolute;
left: 2px;
top: 35px;
color: red;
}
}
}
</style> </style>
<template> <template>
<div class="block"> <div class="block">
<el-pagination <el-pagination
class="pagination" class="pagination"
layout="prev, pager, next, jumper, ->,page , total" layout="prev, pager, next, jumper, ->,page , total"
v-bind="$attrs" v-bind="$attrs"
v-on="$listener"
> >
</el-pagination> </el-pagination>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Pagination' name: "Pagination"
}; };
</script> </script>
<style lang="less"> <style lang="less">
.block { .block {
margin-top: 50px; margin-top: 50px;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<el-form <el-form
:inline="true" :inline="true"
:model="orderQueryObj" :model="orderQueryObj"
label-width="90px"
ref="ruleForm" ref="ruleForm"
class="demo-form-inline" class="demo-form-inline"
> >
...@@ -54,6 +55,7 @@ ...@@ -54,6 +55,7 @@
placeholder="请输入收货人姓名或手机号" placeholder="请输入收货人姓名或手机号"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="orderQueryObj.cust_user" v-model="orderQueryObj.cust_user"
style="width: 220px"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="订单编号:" prop="order_id"> <el-form-item label="订单编号:" prop="order_id">
...@@ -68,6 +70,7 @@ ...@@ -68,6 +70,7 @@
v-model="orderQueryObj.sub_shop_id" v-model="orderQueryObj.sub_shop_id"
placeholder="请选择" placeholder="请选择"
filterable filterable
@change="subShopSel"
> >
<el-option <el-option
v-for="item in selLiftPoinArr" v-for="item in selLiftPoinArr"
...@@ -77,6 +80,40 @@ ...@@ -77,6 +80,40 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="详细地址:" prop="take_place_address">
<el-select
v-model="orderQueryObj.take_place_address"
placeholder="请选择"
filterable
@change="takePlaceAddressSel"
>
<el-option
v-for="item in detailedAddressArr"
:key="item"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="下单时间:" prop="order_time">
<el-date-picker
v-model="order_time"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button size="small" @click="today">今天</el-button>
<el-button size="small" @click="yesterday">昨天</el-button>
</el-form-item>
<el-form-item> <el-form-item>
<el-button @click="resetOrder('ruleForm')">重置</el-button> <el-button @click="resetOrder('ruleForm')">重置</el-button>
<el-button type="primary" @click="searchOrder">搜索</el-button> <el-button type="primary" @click="searchOrder">搜索</el-button>
...@@ -353,15 +390,15 @@ import { ...@@ -353,15 +390,15 @@ import {
newOrderItemList, newOrderItemList,
newOrderRefundReject, newOrderRefundReject,
newRefundOrder, newRefundOrder,
newGetOrderExportURL newGetOrderExportURL,
} from "@/service/Groupmeal/groupmeal"; } from "@/service/Groupmeal/groupmeal";
import page from "../components/Pagination/index.vue"; import page from "../components/Pagination/index.vue";
import dayJs from "dayjs";
export default { export default {
name: "orderManagement", name: "orderManagement",
components: { components: {
Layout, Layout,
page page,
}, },
data() { data() {
return { return {
...@@ -369,13 +406,17 @@ export default { ...@@ -369,13 +406,17 @@ export default {
orderQueryObj: { orderQueryObj: {
page: 1, page: 1,
page_size: 10, page_size: 10,
marketing_id: "", // 活动名称 marketing_id: "0", // 活动名称
order_status: "0", // 订单状态 order_status: "0", // 订单状态
goods_id: "", // 商品名称 goods_id: "", // 商品名称
cust_user: "", // 收货人 cust_user: "", // 收货人
order_id: "", // 订单编号 order_id: "", // 订单编号
sub_shop_id: "" // 自提点 sub_shop_id: "", // 自提点
take_place_address: "", //详细地址
create_time_start: "", // 开始时间
create_time_end: "", // 结束时间
}, },
order_time: [], // 下单时间
// 下拉框数据 // 下拉框数据
// 活动名称 // 活动名称
activityNameArr: [], activityNameArr: [],
...@@ -383,41 +424,43 @@ export default { ...@@ -383,41 +424,43 @@ export default {
orderStatusArr: [ orderStatusArr: [
{ {
value: "0", value: "0",
label: "全部" label: "全部",
}, },
{ {
value: "1", value: "1",
label: "未支付" label: "未支付",
}, },
{ {
value: "2", value: "2",
label: "已支付" label: "已支付",
}, },
{ {
value: "3", value: "3",
label: "待退款" label: "待退款",
}, },
{ {
value: "4", value: "4",
label: "已退款" label: "已退款",
}, },
{ {
value: "5", value: "5",
label: "退款中" label: "退款中",
}, },
{ {
value: "6", value: "6",
label: "已拒绝" label: "已拒绝",
}, },
{ {
value: "7", value: "7",
label: "售后" label: "售后",
} },
], ],
// 商品名称 // 商品名称
tradeNameArr: [], tradeNameArr: [],
// 自提点 // 自提点
selLiftPoinArr: [], selLiftPoinArr: [],
// 详细地址
detailedAddressArr: [],
activeName: "all", // Tabs标签页 activeName: "all", // Tabs标签页
goodsNum: "", // 商品总计 goodsNum: "", // 商品总计
...@@ -439,9 +482,10 @@ export default { ...@@ -439,9 +482,10 @@ export default {
refundedGoodsSel: false, refundedGoodsSel: false,
payment: "", payment: "",
// restoreInventory: false, // restoreInventory: false,
goods_name: "" goods_name: "",
} },
] ],
flag: []
}; };
}, },
...@@ -454,7 +498,7 @@ export default { ...@@ -454,7 +498,7 @@ export default {
}, },
exportURL3() { exportURL3() {
return newGetOrderExportURL(this.orderQueryObj.marketing_id, "3"); return newGetOrderExportURL(this.orderQueryObj.marketing_id, "3");
} },
}, },
methods: { methods: {
...@@ -466,7 +510,9 @@ export default { ...@@ -466,7 +510,9 @@ export default {
async getMarketingListMet() { async getMarketingListMet() {
try { try {
const res = await newGetMarketingList(); const res = await newGetMarketingList();
this.activityNameArr = res.result; let allArr = [{ marketing_id: "0", marketing_name: "全部活动" }];
let arr = allArr.concat(res.result);
this.activityNameArr = arr;
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error); console.error(error);
...@@ -477,8 +523,9 @@ export default { ...@@ -477,8 +523,9 @@ export default {
async activityNameSel(val) { async activityNameSel(val) {
this.orderQueryObj.goods_id = ""; this.orderQueryObj.goods_id = "";
this.orderQueryObj.sub_shop_id = ""; this.orderQueryObj.sub_shop_id = "";
this.orderQueryObj.take_place_address = "";
const params = { const params = {
marketing_id: val marketing_id: val,
}; };
const res = await newGetGoodsList(params); // 商品名称 const res = await newGetGoodsList(params); // 商品名称
this.getSubShopListMet(val); //自提点 this.getSubShopListMet(val); //自提点
...@@ -495,24 +542,101 @@ export default { ...@@ -495,24 +542,101 @@ export default {
marketing_id = params; marketing_id = params;
} }
const res = await newGetSubShopList({ marketing_id: marketing_id }); const res = await newGetSubShopList({ marketing_id: marketing_id });
this.selLiftPoinArr = res.result; this.selLiftPoinArr = res.result.take_place_list;
this.flag = res.result.take_place_list;
this.detailedAddressArr = res.result.address_list;
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error); console.error(error);
} }
}, },
// 自提点获取详细地址
subShopSel(val) {
let addressVal,
arr = [];
this.orderQueryObj.take_place_address = "";
this.orderQueryObj.sub_shop_list = "";
for (var i in this.selLiftPoinArr) {
if (this.selLiftPoinArr[i].take_place_id == val) {
addressVal = this.selLiftPoinArr[i].address;
}
}
for (var n in this.detailedAddressArr) {
if (this.detailedAddressArr[n] == addressVal) {
arr.push(this.detailedAddressArr[n]);
}
}
this.orderQueryObj.take_place_address = arr[0];
this.detailedAddressArr = arr;
},
// 详细地址获取自提点
takePlaceAddressSel(val) {
let arr = [],
arrID = [];
this.orderQueryObj.sub_shop_id = "";
this.orderQueryObj.sub_shop_list = "";
this.selLiftPoinArr = this.flag;
for (var i in this.selLiftPoinArr) {
if (val == this.selLiftPoinArr[i].address) {
arr.push(this.selLiftPoinArr[i]);
arrID.push(this.selLiftPoinArr[i].take_place_id);
}
}
this.selLiftPoinArr = arr;
if (this.orderQueryObj.sub_shop_id == "") {
this.orderQueryObj.sub_shop_list = arrID.join(",");
}
},
// 获取今天日期
today() {
this.order_time = [];
this.order_time[0] = dayJs(
new Date(new Date(new Date().toLocaleDateString()).getTime())
).format("YYYY-MM-DD HH:mm:ss");
this.order_time[1] = dayJs(
new Date(
new Date(new Date().toLocaleDateString()).getTime() +
24 * 60 * 60 * 1000
)
).format("YYYY-MM-DD HH:mm:ss");
},
// 获取昨天日期
yesterday() {
this.order_time = [];
this.order_time[0] = dayJs(
new Date(
new Date(new Date().toLocaleDateString()).getTime() -
24 * 60 * 60 * 1000
)
).format("YYYY-MM-DD HH:mm:ss");
this.order_time[1] = dayJs(
new Date(new Date(new Date().toLocaleDateString()).getTime())
).format("YYYY-MM-DD HH:mm:ss");
},
// 重置 // 重置
resetOrder(formName) { resetOrder(formName) {
if (this.$route.query.marketing_type == "4") { if (this.$route.query.marketing_type == "4") {
this.$router.push({ this.$router.push({
path: "/op/groupmeal/newOrderManagement" path: "/op/groupmeal/newOrderManagement",
}); });
this.$route.query.marketing_type = ""; this.$route.query.marketing_type = "";
} }
this.$refs[formName].resetFields(); this.activeName = "all";
this.order_time = [];
this.orderQueryObj.create_time_start = "";
this.orderQueryObj.create_time_end = "";
this.orderQueryObj.sub_shop_list = "";
this.orderQueryObj.page = 1; this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10; this.orderQueryObj.page_size = 10;
this.$refs[formName].resetFields();
this.getOrderListMet(this.orderQueryObj); this.getOrderListMet(this.orderQueryObj);
this.getSubShopListMet(); this.getSubShopListMet();
}, },
...@@ -521,12 +645,14 @@ export default { ...@@ -521,12 +645,14 @@ export default {
searchOrder() { searchOrder() {
if (this.$route.query.marketing_type == "4") { if (this.$route.query.marketing_type == "4") {
this.$router.push({ this.$router.push({
path: "/op/groupmeal/newOrderManagement" path: "/op/groupmeal/newOrderManagement",
}); });
this.$route.query.marketing_type = ""; this.$route.query.marketing_type = "";
} }
this.orderQueryObj.page = 1; this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10; this.orderQueryObj.page_size = 10;
this.orderQueryObj.create_time_start = this.order_time[0];
this.orderQueryObj.create_time_end = this.order_time[1];
if (this.orderQueryObj.order_status === "0") { if (this.orderQueryObj.order_status === "0") {
this.activeName = "all"; this.activeName = "all";
this.orderStatusArr[1].disabled = false; this.orderStatusArr[1].disabled = false;
...@@ -555,7 +681,10 @@ export default { ...@@ -555,7 +681,10 @@ export default {
// 导出 // 导出
exportOrder() { exportOrder() {
if (this.orderQueryObj.marketing_id === "") { if (
this.orderQueryObj.marketing_id === "" ||
this.orderQueryObj.marketing_id === "0"
) {
this.$message.error("请选择活动名称"); this.$message.error("请选择活动名称");
return; return;
} }
...@@ -566,7 +695,7 @@ export default { ...@@ -566,7 +695,7 @@ export default {
async printOrderMet(forcePrint) { async printOrderMet(forcePrint) {
const params = { const params = {
marketing_id: this.orderQueryObj.marketing_id, marketing_id: this.orderQueryObj.marketing_id,
force_print: forcePrint ? "1" : "" force_print: forcePrint ? "1" : "",
}; };
const res = await newOrderPrint(params); const res = await newOrderPrint(params);
return res; return res;
...@@ -574,7 +703,10 @@ export default { ...@@ -574,7 +703,10 @@ export default {
// 打印 // 打印
async printOrder() { async printOrder() {
if (this.orderQueryObj.marketing_id === "") { if (
this.orderQueryObj.marketing_id === "" ||
this.orderQueryObj.marketing_id === "0"
) {
this.$message.error("请选择活动名称"); this.$message.error("请选择活动名称");
return; return;
} }
...@@ -583,7 +715,7 @@ export default { ...@@ -583,7 +715,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
type: "success", type: "success",
message: "打印成功" message: "打印成功",
}); });
return; return;
} }
...@@ -601,7 +733,7 @@ export default { ...@@ -601,7 +733,7 @@ export default {
try { try {
await this.$confirm(res.reason, "打印", { await this.$confirm(res.reason, "打印", {
cancelButtonText: "取消", cancelButtonText: "取消",
confirmButtonText: "确定" confirmButtonText: "确定",
}); });
} catch (e) { } catch (e) {
// 取消 // 取消
...@@ -627,7 +759,7 @@ export default { ...@@ -627,7 +759,7 @@ export default {
goods_id: "", goods_id: "",
cust_user: "", cust_user: "",
order_id: "", order_id: "",
sub_shop_id: "" sub_shop_id: "",
}); });
} else { } else {
res = await newGetOrderList(this.orderQueryObj); res = await newGetOrderList(this.orderQueryObj);
...@@ -652,21 +784,21 @@ export default { ...@@ -652,21 +784,21 @@ export default {
try { try {
await this.$confirm("确定要拒绝退款么?", "拒绝", { await this.$confirm("确定要拒绝退款么?", "拒绝", {
cancelButtonText: "取消", cancelButtonText: "取消",
confirmButtonText: "确定" confirmButtonText: "确定",
}); });
} catch (e) { } catch (e) {
// 取消 // 取消
return; return;
} }
const params = { const params = {
order_id: val.order_id order_id: val.order_id,
}; };
const res = await newOrderRefundReject(params); const res = await newOrderRefundReject(params);
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
type: "success", type: "success",
message: "订单已驳回" message: "订单已驳回",
}); });
} else { } else {
this.$message.error(res.reason); this.$message.error(res.reason);
...@@ -692,7 +824,7 @@ export default { ...@@ -692,7 +824,7 @@ export default {
this.checkAll = false; this.checkAll = false;
this.refundGoods = []; this.refundGoods = [];
const params = { const params = {
order_id: val.order_id order_id: val.order_id,
}; };
const res = await newOrderItemList(params); const res = await newOrderItemList(params);
this.refundGoods = res.result; this.refundGoods = res.result;
...@@ -721,11 +853,11 @@ export default { ...@@ -721,11 +853,11 @@ export default {
// } // }
// } // }
const convertToNumber = str => { const convertToNumber = (str) => {
return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0; return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0;
}; };
const processRefundItem = item => { const processRefundItem = (item) => {
return { return {
order_item_id: item.order_item_id, order_item_id: item.order_item_id,
refund_num: item.refundableQuantity || 0, refund_num: item.refundableQuantity || 0,
...@@ -752,13 +884,13 @@ export default { ...@@ -752,13 +884,13 @@ export default {
return; return;
} }
this.$message.error(res.reason); this.$message.error(res.reason);
} },
}, },
created() { created() {
this.getMarketingListMet(); // 活动名称 this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点 this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表 this.getOrderListMet(); // table列表
} },
}; };
</script> </script>
......
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
<el-form <el-form
:inline="true" :inline="true"
:model="orderQueryObj" :model="orderQueryObj"
label-width="90px"
ref="ruleForm" ref="ruleForm"
class="demo-form-inline" class="demo-form-inline"
> >
<div>
<el-form-item label="活动名称:" prop="marketing_id"> <el-form-item label="活动名称:" prop="marketing_id">
<el-select <el-select
v-model="orderQueryObj.marketing_id" v-model="orderQueryObj.marketing_id"
...@@ -25,7 +27,10 @@ ...@@ -25,7 +27,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="订单状态:" prop="order_status"> <el-form-item label="订单状态:" prop="order_status">
<el-select v-model="orderQueryObj.order_status" placeholder="请选择"> <el-select
v-model="orderQueryObj.order_status"
placeholder="请选择"
>
<el-option <el-option
v-for="item in orderStatusArr" v-for="item in orderStatusArr"
:key="item.value" :key="item.value"
...@@ -49,11 +54,14 @@ ...@@ -49,11 +54,14 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div>
<div>
<el-form-item label="收货人:" prop="cust_user"> <el-form-item label="收货人:" prop="cust_user">
<el-input <el-input
placeholder="请输入收货人姓名或手机号" placeholder="请输入收货人姓名或手机号"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="orderQueryObj.cust_user" v-model="orderQueryObj.cust_user"
style="width:220px"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="订单编号:" prop="order_id"> <el-form-item label="订单编号:" prop="order_id">
...@@ -77,6 +85,40 @@ ...@@ -77,6 +85,40 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div>
<!-- <el-form-item label="详细地址:" prop="detailed_address">
<el-select
v-model="orderQueryObj.detailed_address"
placeholder="请选择"
filterable
>
<el-option
v-for="item in selLiftPoinArr"
:key="item.sub_shop_id"
:label="item.sub_shop_name"
:value="item.sub_shop_id"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="下单时间:" prop="order_time">
<el-date-picker
v-model="order_time"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button size="small" @click="today">今天</el-button>
<el-button size="small" @click="yesterday">昨天</el-button>
</el-form-item>
<el-form-item> <el-form-item>
<el-button @click="resetOrder('ruleForm')">重置</el-button> <el-button @click="resetOrder('ruleForm')">重置</el-button>
<el-button type="primary" @click="searchOrder">搜索</el-button> <el-button type="primary" @click="searchOrder">搜索</el-button>
...@@ -291,19 +333,7 @@ ...@@ -291,19 +333,7 @@
>配送表</el-button >配送表</el-button
></a ></a
> >
<!-- <el-checkbox-group v-model="exportSel">
<el-checkbox
v-for="i in exportSelOpt"
:label="i.type"
:key="i.type"
>{{ i.name }}</el-checkbox
>
</el-checkbox-group> -->
</el-form-item> </el-form-item>
<!-- <el-form-item class="exportBtn">
<el-button @click="exportShow = false">取消</el-button>
<a :href="exportURL" style="margin-left: 20px"><el-button type="primary" @click="exportShow = false">确定导出</el-button></a>
</el-form-item> -->
</el-dialog> </el-dialog>
<!-- 退款弹窗 --> <!-- 退款弹窗 -->
<el-dialog title="退款" width="30%" top="10%" v-model="refundShow"> <el-dialog title="退款" width="30%" top="10%" v-model="refundShow">
...@@ -374,16 +404,15 @@ import { ...@@ -374,16 +404,15 @@ import {
orderItemList, orderItemList,
orderRefundReject, orderRefundReject,
refundOrder, refundOrder,
getOrderExportURL, getOrderExportURL
} from "@/service/Groupmeal/groupmeal"; } from "@/service/Groupmeal/groupmeal";
// import page from "../../components/Pagination.vue";
import page from "../components/Pagination/index.vue"; import page from "../components/Pagination/index.vue";
import dayJs from "dayjs";
export default { export default {
name: "orderManagement", name: "orderManagement",
components: { components: {
Layout, Layout,
page, page
}, },
data() { data() {
return { return {
...@@ -391,13 +420,17 @@ export default { ...@@ -391,13 +420,17 @@ export default {
orderQueryObj: { orderQueryObj: {
page: 1, page: 1,
page_size: 10, page_size: 10,
marketing_id: "", // 活动名称 marketing_id: "0", // 活动名称
order_status: "0", // 订单状态 order_status: "0", // 订单状态
goods_id: "", // 商品名称 goods_id: "", // 商品名称
cust_user: "", // 收货人 cust_user: "", // 收货人
order_id: "", // 订单编号 order_id: "", // 订单编号
sub_shop_id: "", // 自提点 sub_shop_id: "", // 自提点
// detailed_address: "", // 详细地址
create_time_start: "", // 开始时间
create_time_end: "" // 结束时间
}, },
order_time: [], // 下单时间
// 下拉框数据 // 下拉框数据
// 活动名称 // 活动名称
activityNameArr: [], activityNameArr: [],
...@@ -405,36 +438,36 @@ export default { ...@@ -405,36 +438,36 @@ export default {
orderStatusArr: [ orderStatusArr: [
{ {
value: "0", value: "0",
label: "全部", label: "全部"
}, },
{ {
value: "1", value: "1",
label: "未支付", label: "未支付"
}, },
{ {
value: "2", value: "2",
label: "已支付", label: "已支付"
}, },
{ {
value: "3", value: "3",
label: "待退款", label: "待退款"
}, },
{ {
value: "4", value: "4",
label: "已退款", label: "已退款"
}, },
{ {
value: "5", value: "5",
label: "退款中", label: "退款中"
}, },
{ {
value: "6", value: "6",
label: "已拒绝", label: "已拒绝"
}, },
{ {
value: "7", value: "7",
label: "售后", label: "售后"
}, }
], ],
// 商品名称 // 商品名称
tradeNameArr: [], tradeNameArr: [],
...@@ -448,13 +481,6 @@ export default { ...@@ -448,13 +481,6 @@ export default {
exportShow: false, exportShow: false,
exportType: "", exportType: "",
// exportSel: [],
// exportSelOpt: [
// { type: "1", name: "总表" },
// { type: "2", name: "商品表" },
// { type: "3", name: "配送表" },
// ],
// 表格数据 // 表格数据
orderTableData: [], orderTableData: [],
totalNum: null, //总条数 totalNum: null, //总条数
...@@ -472,9 +498,9 @@ export default { ...@@ -472,9 +498,9 @@ export default {
payment: "", // 实付 payment: "", // 实付
refundableQuantity: "", refundableQuantity: "",
refundAmount: "", refundAmount: "",
amountToRefund: "", amountToRefund: ""
}, }
], ]
}; };
}, },
...@@ -487,7 +513,7 @@ export default { ...@@ -487,7 +513,7 @@ export default {
}, },
exportURL3() { exportURL3() {
return getOrderExportURL(this.orderQueryObj.marketing_id, "3"); return getOrderExportURL(this.orderQueryObj.marketing_id, "3");
}, }
}, },
methods: { methods: {
...@@ -499,7 +525,9 @@ export default { ...@@ -499,7 +525,9 @@ export default {
async getMarketingListMet() { async getMarketingListMet() {
try { try {
const res = await getMarketingList(); const res = await getMarketingList();
this.activityNameArr = res.result; let allArr = [{ marketing_id: "0", marketing_name: "全部活动" }];
let arr = allArr.concat(res.result);
this.activityNameArr = arr;
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error); console.error(error);
...@@ -510,7 +538,7 @@ export default { ...@@ -510,7 +538,7 @@ export default {
async activityNameSel(val) { async activityNameSel(val) {
this.orderQueryObj.goods_id = ""; this.orderQueryObj.goods_id = "";
const params = { const params = {
marketing_id: val, marketing_id: val
}; };
const res = await getGoodsList(params); // 商品名称 const res = await getGoodsList(params); // 商品名称
this.getSubShopListMet(val); //自提点 this.getSubShopListMet(val); //自提点
...@@ -534,11 +562,43 @@ export default { ...@@ -534,11 +562,43 @@ export default {
} }
}, },
// 获取今天日期
today() {
this.order_time = []; // -lh
this.order_time[0] = dayJs(
new Date(new Date(new Date().toLocaleDateString()).getTime())
).format("YYYY-MM-DD HH:mm:ss");
this.order_time[1] = dayJs(
new Date(
new Date(new Date().toLocaleDateString()).getTime() +
24 * 60 * 60 * 1000
)
).format("YYYY-MM-DD HH:mm:ss");
},
// 获取昨天日期
yesterday() {
this.order_time = []; // -lh
this.order_time[0] = dayJs(
new Date(
new Date(new Date().toLocaleDateString()).getTime() -
24 * 60 * 60 * 1000
)
).format("YYYY-MM-DD HH:mm:ss");
this.order_time[1] = dayJs(
new Date(new Date(new Date().toLocaleDateString()).getTime())
).format("YYYY-MM-DD HH:mm:ss");
},
// 重置 // 重置
resetOrder(formName) { resetOrder(formName) {
this.$refs[formName].resetFields(); this.activeName = "all";
this.order_time = [];
this.orderQueryObj.page = 1; this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10; this.orderQueryObj.page_size = 10;
this.orderQueryObj.create_time_start = "";
this.orderQueryObj.create_time_end = "";
this.$refs[formName].resetFields();
this.getOrderListMet(this.orderQueryObj); this.getOrderListMet(this.orderQueryObj);
}, },
...@@ -546,6 +606,8 @@ export default { ...@@ -546,6 +606,8 @@ export default {
searchOrder() { searchOrder() {
this.orderQueryObj.page = 1; this.orderQueryObj.page = 1;
this.orderQueryObj.page_size = 10; this.orderQueryObj.page_size = 10;
this.orderQueryObj.create_time_start = this.order_time[0];
this.orderQueryObj.create_time_end = this.order_time[1];
this.getOrderListMet(this.orderQueryObj); this.getOrderListMet(this.orderQueryObj);
}, },
...@@ -562,10 +624,14 @@ export default { ...@@ -562,10 +624,14 @@ export default {
} }
this.getOrderListMet(this.orderQueryObj); this.getOrderListMet(this.orderQueryObj);
}, },
// 导出 // 导出
exportOrder() { exportOrder() {
if (this.orderQueryObj.marketing_id === "") { if (
this.$message.error("请选择活动名称"); this.orderQueryObj.marketing_id === "" ||
this.orderQueryObj.marketing_id === "0"
) {
this.$message.error("请选择活动后再进行操作");
return; return;
} }
this.exportShow = true; this.exportShow = true;
...@@ -576,7 +642,7 @@ export default { ...@@ -576,7 +642,7 @@ export default {
const params = { const params = {
marketing_id: this.orderQueryObj.marketing_id, marketing_id: this.orderQueryObj.marketing_id,
// marketing_id: "1NJETU", // marketing_id: "1NJETU",
force_print: forcePrint ? "1" : "", force_print: forcePrint ? "1" : ""
}; };
const res = await orderPrint(params); const res = await orderPrint(params);
return res; return res;
...@@ -584,8 +650,11 @@ export default { ...@@ -584,8 +650,11 @@ export default {
// 打印 // 打印
async printOrder() { async printOrder() {
if (this.orderQueryObj.marketing_id === "") { if (
this.$message.error("请选择活动名称"); this.orderQueryObj.marketing_id === "" ||
this.orderQueryObj.marketing_id === "0"
) {
this.$message.error("请选择活动后再进行操作");
return; return;
} }
...@@ -593,7 +662,7 @@ export default { ...@@ -593,7 +662,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
type: "success", type: "success",
message: "打印成功", message: "打印成功"
}); });
return; return;
} }
...@@ -611,7 +680,7 @@ export default { ...@@ -611,7 +680,7 @@ export default {
try { try {
await this.$confirm(res.reason, "打印", { await this.$confirm(res.reason, "打印", {
cancelButtonText: "取消", cancelButtonText: "取消",
confirmButtonText: "确定", confirmButtonText: "确定"
}); });
} catch (e) { } catch (e) {
// 取消 // 取消
...@@ -652,21 +721,21 @@ export default { ...@@ -652,21 +721,21 @@ export default {
try { try {
await this.$confirm("确定要拒绝退款么?", "拒绝", { await this.$confirm("确定要拒绝退款么?", "拒绝", {
cancelButtonText: "取消", cancelButtonText: "取消",
confirmButtonText: "确定", confirmButtonText: "确定"
}); });
} catch (e) { } catch (e) {
// 取消 // 取消
return; return;
} }
const params = { const params = {
order_id: val.order_id, order_id: val.order_id
}; };
const res = await orderRefundReject(params); const res = await orderRefundReject(params);
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
type: "success", type: "success",
message: "订单已驳回", message: "订单已驳回"
}); });
} else { } else {
this.$message.error(res.reason); this.$message.error(res.reason);
...@@ -693,7 +762,7 @@ export default { ...@@ -693,7 +762,7 @@ export default {
this.checkAll = false; this.checkAll = false;
this.refundGoods = []; this.refundGoods = [];
const params = { const params = {
order_id: val.order_id, order_id: val.order_id
}; };
const res = await orderItemList(params); const res = await orderItemList(params);
this.refundGoods = res.result; this.refundGoods = res.result;
...@@ -720,15 +789,15 @@ export default { ...@@ -720,15 +789,15 @@ export default {
return this.refundGoods.filter(isSelected); return this.refundGoods.filter(isSelected);
}; };
const convertToNumber = (str) => { const convertToNumber = str => {
return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0; return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0;
}; };
const processRefundItem = (item) => { const processRefundItem = item => {
return { return {
order_item_id: item.order_item_id, order_item_id: item.order_item_id,
refund_num: item.refundableQuantity || 0, refund_num: item.refundableQuantity || 0,
refund_amount: convertToNumber(item.amountToRefund), refund_amount: convertToNumber(item.amountToRefund)
}; };
}; };
...@@ -754,13 +823,13 @@ export default { ...@@ -754,13 +823,13 @@ export default {
} }
// this.refundShow = false; // this.refundShow = false;
this.$message.error(res.reason); this.$message.error(res.reason);
}, }
}, },
created() { created() {
this.getMarketingListMet(); // 活动名称 this.getMarketingListMet(); // 活动名称
this.getSubShopListMet(); // 自提点 this.getSubShopListMet(); // 自提点
this.getOrderListMet(); // table列表 this.getOrderListMet(); // table列表
}, }
}; };
</script> </script>
...@@ -772,7 +841,7 @@ export default { ...@@ -772,7 +841,7 @@ export default {
word-break: break-all; word-break: break-all;
} }
} }
.refundCon /deep/ .el-row{ .refundCon /deep/ .el-row {
margin-bottom: 15px; margin-bottom: 15px;
display: flex; display: flex;
align-items: center; align-items: center;
......
<template> <template>
<layout> <layout>
<div class="life-no"> <div class="life-no">
<el-form <el-form :inline="true" :model="formInline" class="demo-form-inline">
:inline="true"
:model="formInline"
class="demo-form-inline"
>
<el-form-item label="生活号名称"> <el-form-item label="生活号名称">
<el-input <el-input
class="search_life" class="search_life"
...@@ -17,81 +12,47 @@ ...@@ -17,81 +12,47 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类型"> <el-form-item label="类型">
<el-select <el-select v-model="life_account.type" placeholder="类型">
v-model="life_account.type" <el-option value="0" label="全部"></el-option>
placeholder="类型" <el-option value="1" label="个人"></el-option>
> <el-option value="2" label="企业"></el-option>
<el-option
value="0"
label="全部"
></el-option>
<el-option
value="1"
label="个人"
></el-option>
<el-option
value="2"
label="企业"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" @click="onSearchSubmit">查询</el-button>
type="primary"
@click="onSearchSubmit"
>查询</el-button>
<el-button @click="onReset">重置</el-button> <el-button @click="onReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="LifeNoList" border style="width: 100%">
:data="LifeNoList" <el-table-column prop="life_account_id" label="ID"> </el-table-column>
border <el-table-column prop="life_account_name" label="生活号名称">
style="width: 100%"
>
<el-table-column
prop="life_account_id"
label="ID"
> </el-table-column>
<el-table-column
prop="life_account_name"
label="生活号名称"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :formatter="hasTypeFormat" label="类型">
:formatter="hasTypeFormat"
label="类型"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :formatter="hasStatusFormat" label="状态">
:formatter="hasStatusFormat"
label="状态"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="create_time" label="创建时间"> </el-table-column>
prop="create_time"
label="创建时间"
> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template #default="scope"> <template #default="scope">
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click.stop="toLifeDetail(scope.row)" @click.stop="toLifeDetail(scope.row)"
>查看详情</el-button> >查看详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<page <page :totalNum="totalNum" @update="update" />
:totalNum="totalNum"
@update="update"
/>
</div> </div>
</layout> </layout>
</template> </template>
<script> <script>
import Layout from '@/layouts' import Layout from "@/layouts";
import page from "../components/Pagination" // import page from "../components/Pagination";
import page from "../components/Pagination.vue";
import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no"; import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
export default { export default {
name: "LifeNo", name: "LifeNo",
...@@ -99,7 +60,7 @@ export default { ...@@ -99,7 +60,7 @@ export default {
Layout, Layout,
page page
}, },
data () { data() {
return { return {
params: { params: {
page: 1, page: 1,
...@@ -107,25 +68,25 @@ export default { ...@@ -107,25 +68,25 @@ export default {
}, },
life_account: { life_account: {
name: "", name: "",
type: "", type: ""
}, },
totalNum: null, totalNum: null,
lifeList: [], lifeList: [],
LifeNoList: [], LifeNoList: [],
formInline: { formInline: {
user: '', user: "",
region: '' region: ""
}
} }
};
}, },
created () { created() {
this.getLifeNoListFn() this.getLifeNoListFn();
}, },
methods: { methods: {
hasTypeFormat (row) { hasTypeFormat(row) {
return row.life_account_type == 1 ? '个人' : '企业' return row.life_account_type == 1 ? "个人" : "企业";
}, },
hasStatusFormat (row) { hasStatusFormat(row) {
if (row.life_account_status == 1) { if (row.life_account_status == 1) {
return "正常"; return "正常";
} else if (row.life_account_status == 3) { } else if (row.life_account_status == 3) {
...@@ -135,39 +96,41 @@ export default { ...@@ -135,39 +96,41 @@ export default {
} }
}, },
//获取列表数据 //获取列表数据
getLifeNoListFn () { getLifeNoListFn() {
let { name, type } = this.life_account let { name, type } = this.life_account;
let { page, page_size } = this.params let { page, page_size } = this.params;
let params = { let params = {
page, page,
page_size, page_size,
life_account_name: name, life_account_name: name,
life_account_type: type life_account_type: type
} };
reqGetLifeNoList(params).then(res => { reqGetLifeNoList(params).then(res => {
this.totalNum = res.count this.totalNum = res.count;
this.LifeNoList = res.data this.LifeNoList = res.data;
}) });
}, },
//查询 //查询
onSearchSubmit () { onSearchSubmit() {
this.getLifeNoListFn() this.getLifeNoListFn();
}, },
//重置 //重置
onReset () { onReset() {
this.life_account.name = "", (this.life_account.name = ""), (this.life_account.type = "");
this.life_account.type = "" this.getLifeNoListFn();
this.getLifeNoListFn()
},
update (obj) {
Object.assign(this.params, obj)
this.getLifeNoListFn(this.params)
}, },
toLifeDetail (row) { update(obj) {
this.$router.push({ name: 'LifeNoDetail', query: { lifeId: row.life_account_id } }); Object.assign(this.params, obj);
this.getLifeNoListFn(this.params);
}, },
toLifeDetail(row) {
this.$router.push({
name: "LifeNoDetail",
query: { lifeId: row.life_account_id }
});
} }
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.life-no { .life-no {
......
...@@ -14,24 +14,24 @@ ...@@ -14,24 +14,24 @@
</template> </template>
<script> <script>
export default { export default {
props: ['totalNum'], props: ["totalNum"],
data () { data() {
return { return {
currentPage: 1, currentPage: 1,
page_size: 20 page_size: 20
} };
}, },
methods: { methods: {
handleSizeChange (size) { handleSizeChange(size) {
console.log(`每页 ${size} 条`); console.log(`每页 ${size} 条`);
this.$emit('update', { page_size: size }) this.$emit("update", { page_size: size });
}, },
handleCurrentChange (pageIndex) { handleCurrentChange(pageIndex) {
console.log(`当前页: ${pageIndex}`); console.log(`当前页: ${pageIndex}`);
this.$emit('update', { page: pageIndex }) this.$emit("update", { page: pageIndex });
} }
}, }
} };
</script> </script>
<style lang="less"> <style lang="less">
.block { .block {
......
import axios from "@/utils/request"; import axios from "@/utils/request";
import { handlerSuccessResponse } from "@/utils/handlerResponse";
// 获取主页配送员列表 // 获取主页配送员列表
export async function getList (params) { export async function getList(params) {
const res = await axios.post("/api/v1/order/deliverer/list_day_deliverer_conf",params); const res = await axios.post(
"/api/v1/order/deliverer/list_day_deliverer_conf",
params
);
return res; return res;
} }
// 获取分配配送员列表 // 获取分配配送员列表
export async function getDelivererList(params) { export async function getDelivererList(params) {
const res = await axios.post( const res = await axios.post(
...@@ -26,6 +30,17 @@ export async function getSaveDeliverer(params) { ...@@ -26,6 +30,17 @@ export async function getSaveDeliverer(params) {
); );
return res; return res;
} }
// 下载配送路线 -lh
export async function getDeliveryRoutes(params) {
const res = await axios.post("/api/v1/order/deliverer/build_plan", params);
return handlerSuccessResponse(res);
}
// 查看邮件记录 -lh
export async function getEmailRecords(params) {
const res = await axios.post("/api/v1/order/deliverer/plan_down_log", params);
//return Promise.reject(res);
return handlerSuccessResponse(res);
}
// 老订单管理 // 老订单管理
...@@ -53,7 +68,7 @@ export async function getGoodsList(params) { ...@@ -53,7 +68,7 @@ export async function getGoodsList(params) {
// 获取自提点 // 获取自提点
export async function getSubShopList(params) { export async function getSubShopList(params) {
const res = await axios.get("/api/v1/order/oldbackground/sub_shop_list",{ const res = await axios.get("/api/v1/order/oldbackground/sub_shop_list", {
params params
}); });
return res; return res;
...@@ -98,9 +113,12 @@ export async function refundOrder(orderId, itemsToRefund) { ...@@ -98,9 +113,12 @@ export async function refundOrder(orderId, itemsToRefund) {
// 订单驳回 // 订单驳回
export async function orderRefundReject(params) { export async function orderRefundReject(params) {
const res = await axios.get("/api/v1/order/oldbackground/order_refund_reject", { const res = await axios.get(
"/api/v1/order/oldbackground/order_refund_reject",
{
params params
}); }
);
return res; return res;
} }
...@@ -129,23 +147,31 @@ export async function newGetOrderList(params) { ...@@ -129,23 +147,31 @@ export async function newGetOrderList(params) {
// 获取活动名称 // 获取活动名称
export async function newGetMarketingList() { export async function newGetMarketingList() {
const res = await axios.get("/api/v1/order/background/order_condition_marketing_list"); const res = await axios.get(
"/api/v1/order/background/order_condition_marketing_list"
);
return res; return res;
} }
// 获取商品名称 // 获取商品名称
export async function newGetGoodsList(params) { export async function newGetGoodsList(params) {
const res = await axios.get("/api/v1/order/background/order_condition_goods_list", { const res = await axios.get(
"/api/v1/order/background/order_condition_goods_list",
{
params params
}); }
);
return res; return res;
} }
// 获取自提点 // 获取自提点
export async function newGetSubShopList(params) { export async function newGetSubShopList(params) {
const res = await axios.get("/api/v1/order/background/order_condition_take_place_list",{ const res = await axios.get(
"/api/v1/order/background/order_condition_take_place_list",
{
params params
}); }
);
return res; return res;
} }
......
export const handlerSuccessResponse = async response => {
if (!response || response.code !== 0) {
return Promise.reject(response.reason);
}
return Promise.resolve(response);
};
//验证邮箱合法性 (验证头部信息)
export const checkEmailName = emailName => {
let str = /[a-zA-Z0-9_-]+/;
if (!str.test(emailName)) {
return false;
} else {
return true;
}
};
...@@ -66,7 +66,7 @@ module.exports = { ...@@ -66,7 +66,7 @@ module.exports = {
plugins, plugins,
}, },
chainWebpack: config => { chainWebpack: config => {
// 默认不开启 c // 默认不开启 prefetch
config.plugins.delete("prefetch"); config.plugins.delete("prefetch");
// 默认不开启 preload // 默认不开启 preload
......
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