Commit dc24f027 authored by liwenhong's avatar liwenhong

fix: 配置商品回显

parent 9c37bb18
......@@ -443,6 +443,347 @@
</style>
<style lang="less" scoped>
.spell_order_set_wrapper {
.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 {
width: 100%;
.search_form_wrapper {
text-align: center;
.title {
height: 50px;
line-height: 30px;
}
}
// table 自提点表格
.tabla-wrapper {
> p {
margin-left: 10px;
text-align: left;
}
.tableList {
height: 600px;
.delete_button {
margin: 0;
}
}
}
}
.pagination-wrapper {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
.tabList {
margin-top: 10px;
}
.location {
margin-bottom: 10px;
margin-left: 14%;
}
.dialog-footer {
display: flex;
justify-content: center;
align-items: center;
}
/deep/ .el-dialog__body {
height: 85% !important;
}
/deep/ .mapDialog {
margin-top: 10vh !important;
height: 80%;
display: flex !important;
flex-direction: column !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
.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 {
width: 100%;
.search_form_wrapper {
text-align: center;
.title {
height: 50px;
line-height: 30px;
}
}
// table 自提点表格
.tabla-wrapper {
> p {
margin-left: 10px;
text-align: left;
}
.tableList {
height: 600px;
.delete_button {
margin: 0;
}
}
}
}
.pagination-wrapper {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
.tabList {
margin-top: 10px;
}
.location {
margin-bottom: 10px;
margin-left: 14%;
}
.dialog-footer {
display: flex;
justify-content: center;
align-items: center;
}
/deep/ .el-dialog__body {
height: 85% !important;
}
/deep/ .mapDialog {
margin-top: 10vh !important;
height: 80%;
display: flex !important;
flex-direction: column !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
.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%;
}
}
}
.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 {
width: 100%;
.search_form_wrapper {
text-align: center;
.title {
height: 50px;
line-height: 30px;
}
}
// table 自提点表格
.tabla-wrapper {
> p {
margin-left: 10px;
text-align: left;
}
.tableList {
height: 600px;
.delete_button {
margin: 0;
}
}
}
}
.pagination-wrapper {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
.tabList {
margin-top: 10px;
}
.location {
margin-bottom: 10px;
margin-left: 14%;
}
.dialog-footer {
display: flex;
justify-content: center;
align-items: center;
}
/deep/ .el-dialog__body {
height: 85% !important;
}
/deep/ .mapDialog {
margin-top: 10vh !important;
height: 80%;
display: flex !important;
flex-direction: column !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
@media screen and (max-width: 800px) {
/deep/ .add_takePlace_dialog {
width: 100% !important;
}
}
}
.card-wrapper {
width: 100%;
.search_form_wrapper {
text-align: center;
.title {
height: 50px;
line-height: 30px;
}
}
.spell_order_set_wrapper {
//text-align: center;
// 时间选择
......@@ -541,4 +882,47 @@
height: 90%;
}
}
.tabla-wrapper {
> p {
margin-left: 10px;
text-align: left;
}
.tableList {
height: 600px;
.delete_button {
margin: 0;
}
}
}
}
.pagination-wrapper {
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
.tabList {
margin-top: 10px;
}
.location {
margin-bottom: 10px;
margin-left: 14%;
}
.dialog-footer {
display: flex;
justify-content: center;
align-items: center;
}
/deep/ .el-dialog__body {
height: 85% !important;
}
/deep/ .mapDialog {
margin-top: 10vh !important;
height: 80%;
display: flex !important;
flex-direction: column !important;
/deep/ .el-dialog__body {
height: 90%;
}
}
</style>
<template>
<layout>
<div class="marketing">
......@@ -8,18 +7,9 @@
</div>
<!-- 列表区 -->
<el-table class="goods_list" :data="anlysis" border stripe>
<el-table-column
prop="title"
align="center"
></el-table-column>
<el-table-column
prop="total"
align="center"
></el-table-column>
<el-table-column
prop="explain"
align="center"
></el-table-column>
<el-table-column prop="title" align="center"></el-table-column>
<el-table-column prop="total" align="center"></el-table-column>
<el-table-column prop="explain" align="center"></el-table-column>
</el-table>
</div>
<div class="marketing">
......@@ -29,70 +19,48 @@
</div>
<!-- 列表区 -->
<el-table class="goods_list" :data="activityList" border stripe>
<el-table-column
label="活动名称"
prop="marketing_name"
align="center"
></el-table-column>
<el-table-column
label="预算"
prop="capital_pool.capital_pool_total"
align="center"
></el-table-column>
<el-table-column
label="已消耗"
prop="capital_pool.capital_pool_used"
align="center"
></el-table-column>
<el-table-column
label="已占用"
prop="capital_pool.capital_pool_lock"
align="center"
></el-table-column>
<el-table-column
label="状态"
prop="online_status_desc"
align="center"
></el-table-column>
<el-table-column label="活动名称" prop="marketing_name" align="center"></el-table-column>
<el-table-column label="预算" prop="capital_pool.capital_pool_total" align="center"></el-table-column>
<el-table-column label="已消耗" prop="capital_pool.capital_pool_used" align="center"></el-table-column>
<el-table-column label="已占用" prop="capital_pool.capital_pool_lock" align="center"></el-table-column>
<el-table-column label="状态" prop="online_status_desc" align="center"></el-table-column>
<!-- 操作快捷键 -->
<el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope">
<el-button @click.stop="handleAddAmount(scope.row)" type="text">充值</el-button>
<!-- <el-button>预算分配</el-button> -->
<el-button type="text" @click="handleActivityOnline(scope.row)">{{scope.row.online_status==1?'活动下线':'活动上线'}}</el-button>
<el-button type="text" @click="handleActivityOnline(scope.row)">
{{ scope.row.online_status == 1 ? "活动下线" : "活动上线" }}
</el-button>
<el-button type="text" @click="handleConfig(scope.row)">活动配置</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
title="活动配置-团长分销"
v-model="showConfigDialog"
width="50%"
top="2%"
center
>
<el-dialog title="活动配置-团长分销" v-model="showConfigDialog" width="50%" top="2%" center>
<el-form :model="configForm" :rules="rules">
<el-form-item label="设置时间:">
<el-date-picker
v-model="configForm.date"
type="datetime"
@change="expirDateChange"
placeholder="请设置时间"
>
</el-date-picker>
<el-date-picker v-model="configForm.date" type="datetime" @change="timeChange" placeholder="请设置时间"></el-date-picker>
</el-form-item>
<el-form-item
class="config"
v-for="(config, index) in configForm.result"
:key="config.key"
:rules="{
required: true, message: '不能为空', trigger: 'blur'
required: true,
message: '不能为空',
trigger: 'blur',
}"
>
<h4>档位{{index + 1}}</h4>
<div class="form-item"><span>设置考核单量: </span><el-input size="mini" v-model="config.assess_order_num"></el-input></div>
<div class="form-item"><span>设置奖励金额: </span><el-input size="mini" v-model="config.reward_amount"></el-input><el-icon class="el-icon-delete" @click.prevent="removeDomain(config)"><delete /></el-icon></div>
<h4>档位{{ index + 1 }}</h4>
<div class="form-item">
<span>设置考核单量:</span>
<el-input size="mini" v-model="config.assess_order_num"></el-input>
</div>
<div class="form-item">
<span>设置奖励金额:</span>
<el-input size="mini" v-model="config.reward_amount"></el-input>
<el-icon class="el-icon-delete" @click.prevent="removeDomain(config)"><delete /></el-icon>
</div>
</el-form-item>
<el-form-item>
<el-button @click="addDomain">新增档位</el-button>
......@@ -110,53 +78,61 @@
</template>
<script>
import Layout from "../../Groupmeal/layout/index.vue";
import page from "@/components/Pagination"
import {
yingxiaoList,
addAmount,
toogleYingxiaoOnlineStatus,
yingxiaoConfig,
yingxiaoSaveConfig
} from "@/service/Goods/goods";
// import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
export default {
import Layout from "../../Groupmeal/layout/index.vue";
// import page from "@/components/Pagination";
import { yingxiaoList, addAmount, toogleYingxiaoOnlineStatus, yingxiaoConfig, yingxiaoSaveConfig } from "@/service/Goods/goods";
import moment from "moment";
// import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
export default {
name: "MarketingCenter",
components: {
Layout,
page
// page,
},
data () {
data() {
return {
rules: {
date: [
{ required: true, message: "时间不能为空", trigger: "blur" },
{ min: 0, max: 30, message: "长度在 0 到 30 个字符", trigger: "blur" }
{
required: true,
message: "时间不能为空",
trigger: "blur",
},
{
min: 0,
max: 30,
message: "长度在 0 到 30 个字符",
trigger: "blur",
},
],
},
activityList: [],
configForm: {
date: '',
result: []
date: "",
result: [],
},
anlysis: [
{
title: "营销账户预算",
explain: "运营申请的用户业务增长的营销总预算",
total: "",
},
{
title: "已消耗(T+1更新)",
explain: "目前已经确认消耗的营销预算",
total: "",
},
{
title: "已占用(每10分钟更新)",
explain: "分享裂变活动中派发出的有效优惠券的总额",
total: "",
},
{
title: "可用余额",
explain: "目前平台可使用的余额",
total: "",
},
anlysis: [{
title: '营销账户预算',
explain: '运营申请的用户业务增长的营销总预算',
total: ''
},{
title: '已消耗(T+1更新)',
explain: '目前已经确认消耗的营销预算',
total: ''
},{
title: '已占用(每10分钟更新)',
explain: '分享裂变活动中派发出的有效优惠券的总额',
total: ''
},{
title: '可用余额',
explain: '目前平台可使用的余额',
total: ''
}],
],
anlysisObj: {},
params: {
page: 1,
......@@ -164,14 +140,14 @@ export default {
},
showConfigDialog: false,
listParams: {
marketing_id: '',
date: '',
config: []
}
}
marketing_id: "",
date: "",
config: [],
},
created () {
this.getMarketingActivityList()
};
},
created() {
this.getMarketingActivityList();
},
methods: {
async getMarketingActivityList() {
......@@ -180,68 +156,89 @@ export default {
this.activityList = res.result.list;
this.anlysisObj = res.result.anlysis;
let list = [];
for(let k in this.anlysisObj) {
list.push(this.anlysisObj[k])
for (let k in this.anlysisObj) {
list.push(this.anlysisObj[k]);
}
this.anlysis.map((item, index) => item.total = list[index])
this.anlysis.map((item, index) => (item.total = list[index]));
},
handleActivityOnline(item) {
this.$confirm(`您确定要${item.online_status == 1?'下线':'上线'}${item.marketing_name}吗`, `活动${item.online_status == 1?'下线':'上线'}`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(async () => {
let res = await toogleYingxiaoOnlineStatus({marketing_id: item.marketing_id, online_status: item.online_status == 1?2:1}) //1上线 2下线
this.getMarketingActivityList()
this.$confirm(
`您确定要${item.online_status == 1 ? "下线" : "上线"}${item.marketing_name}吗`,
`活动${item.online_status == 1 ? "下线" : "上线"}`,
{
confirmButtonText: "确定",
cancelButtonText: "取消",
center: true,
},
).then(async () => {
let res = await toogleYingxiaoOnlineStatus({
marketing_id: item.marketing_id,
online_status: item.online_status == 1 ? 2 : 1,
}); //1上线 2下线
this.getMarketingActivityList();
if (res.code !== 0) return this.$message.error(res.reason);
else this.$message.success('操作成功');
})
else this.$message.success("操作成功");
});
},
async handleAddAmount(item) {
this.$prompt(`当前账户预算:${this.anlysisObj.total} \n 当前账户可用余额:${this.anlysisObj.balance}`, '充值', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputLabel: '输入调整后的账户总预算',
this.$prompt(`当前账户预算:${this.anlysisObj.total} \n 当前账户可用余额:${this.anlysisObj.balance}`, "充值", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputLabel: "输入调整后的账户总预算",
inputPattern: /\d{1,5}/,
inputErrorMessage: '格式不正确'
inputErrorMessage: "格式不正确",
}).then(async ({ value }) => {
let res = await addAmount({capital_pool_id: item.capital_pool_id, amount: value})
let res = await addAmount({
capital_pool_id: item.capital_pool_id,
amount: value,
});
if (res.code !== 0) return this.$message.error(res.reason);
else this.$message.success('充值成功');
})
else this.$message.success("充值成功");
});
},
async handleConfig(item) {
this.listParams.marketing_id = item.marketing_id;
let res = await yingxiaoConfig({date: new Date()})
let res = await yingxiaoConfig({ date: moment(new Date()).format("YYYY-MM-DD HH:mm:ss") });
if (res.code !== 0) return this.$message.error(res.reason);
else this.$message.success("操作成功");
this.configForm = {
result: res.result.list,
date: res.result.date,
};
console.log("this.configForm", this.configForm);
this.showConfigDialog = true;
},
async timeChange(val) {
let res = await yingxiaoConfig({ date: moment(val).format("YYYY-MM-DD HH:mm:ss") });
if (res.code !== 0) return this.$message.error(res.reason);
else this.$message.success('操作成功');
this.configForm = {result: res.result.list, date: res.result.date};
console.log('this.configForm',this.configForm)
this.showConfigDialog = true
this.configForm = {
result: res.result.list,
date: res.result.date,
};
},
removeDomain(item) {
var index = this.configForm.result.indexOf(item)
var index = this.configForm.result.indexOf(item);
if (index !== -1) {
this.configForm.result.splice(index, 1)
this.configForm.result.splice(index, 1);
}
},
addDomain() {
this.configForm.result.push({});
},
async handleSaveConfig() {
this.configForm.result.map((item, index) => item.level = index+1)
this.configForm.result.map((item, index) => (item.level = index + 1));
this.listParams.config = JSON.stringify(this.configForm.result);
this.listParams.date = this.configForm.date;
let res = await yingxiaoSaveConfig(this.listParams)
let res = await yingxiaoSaveConfig(this.listParams);
if (res.code !== 0) return this.$message.error(res.reason);
else this.$message.success('设置成功');
this.showConfigDialog = false
}
}
}
else this.$message.success("设置成功");
this.showConfigDialog = false;
},
},
};
</script>
<style lang="less" scoped>
.marketing {
.marketing {
padding: 30px;
.header {
display: flex;
......@@ -271,5 +268,5 @@ export default {
}
}
}
}
}
</style>
......@@ -40,8 +40,8 @@
</span>
</template>
</el-dialog>
<el-dialog title="添加自提点" v-model="showAddPointDialog" width="50%" top="2%">
<el-form :model="pointObj">
<el-dialog title="添加自提点" v-model="showAddPointDialog" width="50%" top="2%" inline>
<el-form :model="pointObj" :rules="rules">
<el-form-item label="联系人姓名">
<el-input maxlength="15" v-model="pointObj.contact_name" placeholder="请输入联系人姓名"></el-input>
</el-form-item>
......@@ -51,8 +51,9 @@
<el-form-item label="自提点名称">
<el-input v-model="pointObj.take_place_name" placeholder="请输入自提点名称"></el-input>
</el-form-item>
<div id="js-container" class="myMap">正在加载数据 ...</div>
<el-form-item label="自提点地址">
<!-- <div id="js-container" class="myMap">正在加载数据 ...</div> -->
<my-map class="my-map" @getMapInfo="getMapInfo" />
<el-form-item label="详细地址">
<el-input v-model="pointObj.location" placeholder="请输入自提点地址"></el-input>
</el-form-item>
<el-form-item label="自提点图片">
......@@ -112,6 +113,7 @@
</template>
<script>
import myMap from "@/pages/Activity/releaseProduc/components/myMap.vue";
import Layout from "../../Groupmeal/layout/index.vue";
// import page from "@/components/Pagination";
import { ColoneList, ColoneApplyList, colonelAudit, colonelApplyPoint, colonelAddApplyPoint } from "@/service/Goods/goods";
......@@ -121,6 +123,7 @@
name: "MarketingCenter",
components: {
Layout,
myMap,
// page,
},
data() {
......@@ -139,6 +142,9 @@
pickStation: {},
dialogFormVisible: false,
applyItem: {},
rules: {
take_place_name: [{ required: true, message: "请输入详细地址", trigger: "change" }],
},
};
},
async created() {
......@@ -160,7 +166,10 @@
else return this.$message.success("添加成功");
},
async apply(item, type) {
let res = await colonelAudit({ colonel_apply_id: item.colonel_apply_id, audit_status: type });
let res = await colonelAudit({
colonel_apply_id: item.colonel_apply_id,
audit_status: type,
});
await this.getColoneApplyList();
this.dialogFormVisible = false;
if (res.code !== 0) return this.$message.error(res.reason);
......@@ -171,7 +180,6 @@
if (res.code !== 0) return this.$message.error(res.reason);
this.pointObj = res.result;
this.pickStation = `${this.pointObj.province}-${this.pointObj.city}-${this.pointObj.area}`;
this.initMap();
this.pointObj.take_place_pic && (this.fileList[0] = this.pointObj.take_place_pic);
this.showAddPointDialog = true;
},
......@@ -193,109 +201,15 @@
console.error(error);
}
},
// getMapInfo(mapInfo) {
// this.form.location = mapInfo.address;
// this.form.province = mapInfo.province;
// this.form.city = mapInfo.city;
// this.form.area = mapInfo.area;
// this.form.longitude = mapInfo.lng; // longitude latitude contactor
// this.form.latitude = mapInfo.lat;
// },
dragMap(data) {
console.log(data);
this.pointObj.location = data.address;
this.pointObj.longitude = data.position.lng;
this.pointObj.latitude = data.position.lat;
this.pointObj.province = data.regeocode.addressComponent.province;
this.pointObj.city = data.regeocode.addressComponent.city;
this.pointObj.province = data.regeocode.addressComponent.district;
},
initMap() {
// 加载PositionPicker,loadUI的路径参数为模块名中 'ui/' 之后的部分
let AMapUI = (this.AMapUI = window.AMapUI);
let AMap = (this.AMap = window.AMap);
AMapUI.loadUI(["misc/PositionPicker"], (PositionPicker) => {
let mapConfig = {
zoom: 16,
// cityName: this.MapCityName
};
if (this.coloneApplyList.latitude && this.coloneApplyList.longitude) {
mapConfig.center = [this.coloneApplyList.longitude, this.coloneApplyList.latitude];
}
let map = new AMap.Map("js-container", mapConfig);
// 加载地图搜索插件
AMap.service("AMap.PlaceSearch", () => {
this.placeSearch = new AMap.PlaceSearch({
pageSize: 5,
pageIndex: 1,
citylimit: true,
// city: this.MapCityName,
map: map,
panel: "js-result",
});
});
// 启用工具条
AMap.plugin(["AMap.ToolBar"], function () {
map.addControl(
new AMap.ToolBar({
position: "RB",
}),
);
});
// 地图地图定位
AMap.plugin("AMap.Geolocation", function () {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: "RB",
});
map.addControl(geolocation);
geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, "complete", onComplete);
AMap.event.addListener(geolocation, "error", onError);
function onComplete(data) {
console.log(data);
// data是具体的定位信息
}
function onError(data) {
console.log(data);
// 定位出错
}
});
// 创建地图拖拽
let positionPicker = new PositionPicker({
mode: "dragMap", // 设定为拖拽地图模式,可选'dragMap'、'dragMarker',默认为'dragMap'
map: map, // 依赖地图对象
iconStyle: {
//自定义外观
url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址
size: [50, 50], //要显示的点大小,将缩放图片
ancher: [24, 40], //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
},
});
// 拖拽完成发送自定义 drag 事件
positionPicker.on("success", (positionResult) => {
this.dragMap(positionResult);
console.log("positionResult", positionResult);
});
// 启动拖放
// positionPicker.start();
});
getMapInfo(mapInfo) {
console.log("mapInfo", mapInfo);
this.pointObj.address = mapInfo.address;
this.pointObj.location = mapInfo.location;
this.pointObj.province = mapInfo.province;
this.pointObj.city = mapInfo.city;
this.pointObj.area = mapInfo.area;
this.pointObj.longitude = mapInfo.lng; // longitude latitude contactor
this.pointObj.latitude = mapInfo.lat;
},
},
};
......
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