Commit f9d1e6fa authored by 黄媛媛's avatar 黄媛媛
parents dc0325a3 4171bcac
<style>
.ActiveImg{
background-size: cover;
background-position: center center;
width: 50px!important;
height: 50px;
border-radius: 0%;
}
</style>
<template>
<div class="ActiveData">
<div class="head-title">
<span @click="CommonJump('pintuanList')" class="blue point">拼团活动</span> / 活动数据
</div>
<div class="content">
<div>
<el-tabs v-model="msg.status" @tab-click="handleClick">
<el-tab-pane label="全部" name="-1"></el-tab-pane>
<el-tab-pane label="进行中" name="1"></el-tab-pane>
<el-tab-pane label="拼团成功" name="2"></el-tab-pane>
<el-tab-pane label="拼团失败" name="3"></el-tab-pane>
</el-tabs>
</div>
<div>
<el-form size="small" :inline="true">
<el-form-item label="开团时间">
<el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<div class="input-item">
<el-input @keyup.enter.native="getList" size="small" class="input-with-select" placeholder="请输入搜索内容"
v-model="msg.keyword" clearable @clear='getList'>
<el-select v-model="msg.keyword_name" slot="prepend" placeholder="请选择">
<el-option :label="item.label" v-for="(item,index) in search_list" :key="index" :value="item.value">
</el-option>
</el-select>
<el-button slot="append" icon="el-icon-search" @click="getList"></el-button>
</el-input>
</div>
</el-form-item>
</el-form>
</div>
<div flex="dir:left cross: center" style="margin-bottom: 15px;">
<span style="line-height: 76px;margin-right: 16px">商品信息:</span>
<div flex="box:first" style="width:420px;border: 1px solid #ebeef5;height: 76px;padding:12px;line-height:14px">
<div class="ActiveImg" :style="{backgroundImage:'url(' + imgUrl + ')'}"></div>
<div style="font-size: 14px;color:#606266;margin-left:16px" flex="dir:top main:justify">
<div style="margin-top: 4px;-webkit-line-clamp: 2;word-break: break-all;" class="vue-line-clamp">
日本POLA宝丽黑BA限定小礼盒(黑ba水20ml +黑ba乳液15ml +黑ba面霜5g +黑ba唇颊膏2g)
</div>
</div>
</div>
</div>
<el-table :data="tableData" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column label="开团时间" width="380">
</el-table-column>
<el-table-column label="拼团信息" width="150">
</el-table-column>
<el-table-column label="团长信息">
</el-table-column>
<el-table-column label="活动状态" width="100">
</el-table-column>
<el-table-column label="操作">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/edit.png" alt="">
</el-tooltip>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
layout="prev, pager, next" :current-page.sync="msg.pageIndex" :total="total">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: "ActiveData",
data() {
return {
//日期数组
dateList: [],
msg: {
pageIndex: 1,
pageSize: 15,
status: '-1', //状态
date_start: '', //开始日期
date_end: '', //结束日期
keyword_name: '', //商品名称
keyword: '' //关键字
},
search_list: [], //商品名称下拉
tableData: [], //列表数据
total: 0,
loading: false,
imgUrl:'https://cdnimg.iotweixin.com/uploads/mall1285/20200506/904171cab7db2201f6f35c0ca5bb0a93.png'
}
},
created() {
this.getList();
},
methods: {
//获取数据
getList() {
if (this.dateList && this.dateList.length > 0) {
this.msg.date_start = this.dateList[0];
this.msg.date_end = this.dateList[1];
} else {
this.msg.date_start = '';
this.msg.date_end = '';
}
// this.loading = true;
// this.apipost("/api/GroupBuy/GetGroupbuyActivityPageList", this.msg, res => {
// this.loading = false;
// if (res.data.resultCode == 1) {
// this.total = res.data.data.count;
// let pageData = res.data.data.pageData;
// this.tableData = pageData;
// }
// })
},
//切换活动状态
handleClick(val) {
this.msg.pageIndex = 1
this.getList();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
},
};
</script>
<style>
.ActiveData .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
</style>
......@@ -58,13 +58,13 @@
</div>
<el-row>
<el-col :span="24">
<el-form-item label="开始时间">
<el-form-item label="开始时间" prop="StartTime">
<el-date-picker v-model="addMsg.StartTime" size="small" type="datetime" placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="结束时间">
<el-form-item label="结束时间" prop="EndTime">
<el-date-picker v-model="addMsg.EndTime" size="small" type="datetime" placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
......@@ -84,10 +84,10 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-button type="text" v-if="addMsg.name==''" @click="isShowGoods=true">选择商品</el-button>
<el-button type="text" v-else>{{addMsg.name}}</el-button>
<el-button type="text">{{addMsg.name}}</el-button>
<el-button type="text" v-if="addMsg.ActivityId==0" @click="isShowGoods=true">选择商品</el-button>
</el-form-item>
<el-form-item label="商品名称" prop="Name">
<el-form-item label="商品名称" prop="name">
<el-input size="small" v-model="addMsg.name" placeholder="请输入内容" maxlength="500" :disabled="true">
</el-input>
</el-form-item>
......@@ -396,7 +396,7 @@
:SpecPriceList="TempSpecPriceList"></groupStep>
</el-tab-pane>
<el-tab-pane label="分销价设置">
<distributePrice :shareGroup_list="shareGroup_list"></distributePrice>
<distributePrice :shareGroup_list="TempGroupPriceList"></distributePrice>
</el-tab-pane>
<el-tab-pane label="会员价设置">
<memberPrice :SpecificationPriceList="TempSpecPriceList" :SpecificationList="TempSpecList"></memberPrice>
......@@ -405,7 +405,7 @@
</el-row>
</el-form>
<div class="bottom-div" flex="cross:center" style="margin-top:20px">
<el-button size="small" class="button-item" type="primary" @click="SaveActivity()">保存</el-button>
<el-button size="small" class="button-item" type="primary" @click="SaveInfo('addMsg')">保存</el-button>
<el-button size="small" class="button-item" style="margin-left:10px;">预览</el-button>
</div>
</div>
......@@ -546,8 +546,24 @@
checkedForm: '',
formName: '',
imgDialog: false,
rules: {},
shareGroup_list: []
rules: {
StartTime:[{
required: true,
message: "请选择开始时间",
trigger: "change"
}],
EndTime:[{
required:true,
message: "请选择结束时间",
trigger: "change"
}],
name:[{
required:true,
message: "请选择商品",
trigger: "blur"
}]
},
};
},
created() {},
......@@ -631,6 +647,16 @@
itemOrderChecked(type) {
this.addMsg.Confine_Order_Count = type ? -1 : 0;
},
//保存
SaveInfo(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.SaveActivity();
} else {
return false;
}
});
},
//保存拼团活动
SaveActivity() {
// 是否自定义规格 1是 2否
......@@ -751,11 +777,11 @@
},
//设置阶梯价格
setNewVal(val){
console.log("setNewVal",val);
var tempObj=JSON.parse(JSON.stringify(val));
this.TempGroupPriceList =tempObj ;
this.addMsg.GroupList = tempObj;
this.shareGroup_list = tempObj;
},
//获取子组件规格
getSpecList(val) {
......
......@@ -88,7 +88,7 @@
<img style="width:32px;height:32px;margin:0 10px" @click="CommonJump('pintuanActive',{Id:scope.row.ActivityId})" src="../../assets/img/userman/edit.png" alt="">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="活动数据" placement="top">
<img style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/order.png" alt="">
<img style="width:32px;height:32px;margin:0 10px" @click="CommonJump('ActiveDataDetail',{Id:scope.row.ActivityId})" src="../../assets/img/userman/order.png" alt="">
</el-tooltip>
</template>
</el-table-column>
......
......@@ -354,57 +354,51 @@
testyunx(skuArr, i, list)
this.calcList(this.skuList, this.SpecificationList);
},
calcList(list, calist) {
calcList(tempSkuList, calist) {
let oldArr = JSON.parse(JSON.stringify(this.SpecificationPriceList))
this.SpecificationPriceList = [];
let arrList = [];
list.forEach(item => {
item.AttrList = [];
item.SpecificationSort = "";
var tempArray = [];
tempSkuList.forEach(item => {
var tempObj = {
AttrList: [],
SpecificationSort: "",
GoodsNumbers: "",
GoodsWeight: 0,
InventoryNum: 0,
SellingPrice: 0,
CostMoney: 0,
Commission: 0,
isNoExite: true,
}
var specificationSortStr = ""
item.forEach((item2, index2) => {
let obj = {
SName: item2.SName,
SVName: item2.SVName,
SVId: item2.SVId
};
let str = ":" + index2;
item.SpecificationSort = item2.SVId + str;
item.GoodsNumbers = "";
item.GoodsWeight = 0;
item.InventoryNum = 0;
item.SellingPrice = 0;
item.CostMoney = 0;
item.Commission = 0;
item.AttrList.push(obj);
if (index2 == 0) {
specificationSortStr += item2.SVId
} else {
specificationSortStr += ":" + item2.SVId
}
tempObj.AttrList.push(obj);
});
tempObj.SpecificationSort = specificationSortStr;
tempArray.push(tempObj)
});
list.forEach((item, i) => {
let obj = {};
obj = {
isNoExite: true,
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GoodsNumbers: item.GoodsNumbers,
GoodsWeight: item.GoodsWeight,
InventoryNum: item.InventoryNum,
SellingPrice: item.SellingPrice,
CostMoney: item.CostMoney,
Commission: item.Commission
};
var isExists = false;
var isExistsIndex = -1;
tempArray.forEach((item, i) => {
oldArr.forEach((val, index) => {
if (val.SpecificationSort == item.SpecificationSort) {
obj.GoodsNumbers = val.GoodsNumbers;
obj.GoodsWeight = val.GoodsWeight;
obj.InventoryNum = val.InventoryNum;
obj.SellingPrice = val.SellingPrice;
obj.CostMoney = val.CostMoney;
obj.Commission = val.Commission;
item.GoodsNumbers = val.GoodsNumbers;
item.GoodsWeight = val.GoodsWeight;
item.InventoryNum = val.InventoryNum;
item.SellingPrice = val.SellingPrice;
item.CostMoney = val.CostMoney;
item.Commission = val.Commission;
}
})
this.SpecificationPriceList.push(obj);
this.SpecificationPriceList.push(item);
});
this.$forceUpdate();
},
......@@ -412,7 +406,9 @@
DeleteggModule(item, index) {
let that = this;
that.Confirm("是否确认删除?", function () {
that.getDeleteSpec(item.Id);
if (item.Id > 0) {
that.getDeleteSpec(item.Id);
}
that.ComTreeList = [];
that.memberList2 = [];
that.SpecificationList.splice(index, 1);
......@@ -428,7 +424,9 @@
Deleteggz(item, index, index2) {
let that = this;
that.Confirm("是否确认删除?", function () {
that.getDeleteSpecValue(item.Id);
if (item.Id > 0) {
that.getDeleteSpecValue(item.Id);
}
that.SpecificationList[index].SpecificationValueList.splice(index2, 1);
that.$forceUpdate();
if (that.SpecificationList[index].SpecificationValueList.length == 0) {
......@@ -613,29 +611,29 @@
});
},
//删除规格后调用
getDeleteSpec(Id){
let msg={
Id:Id
getDeleteSpec(Id) {
let msg = {
Id: Id
}
this.apipost("/api/GroupBuy/DeleteSpec", msg, res => {
console.log(res,'删除了')
if(res.data.resultCode==1){
console.log(res, '删除了')
if (res.data.resultCode == 1) {
}else{
} else {
this.Error(res.data.message);
}
})
},
//删除规格值过后调用
getDeleteSpecValue(Id){
let msg={
Id:Id
getDeleteSpecValue(Id) {
let msg = {
Id: Id
}
this.apipost("/api/GroupBuy/DeleteSpecValue", msg, res => {
console.log(res,'删除了')
if(res.data.resultCode==1){
console.log(res, '删除了')
if (res.data.resultCode == 1) {
}else{
} else {
this.Error(res.data.message);
}
})
......
......@@ -140,9 +140,8 @@
};
},
created() {
console.log("attrGroups",this.attrGroups);
},
methods: {
//点击全选
selectClick() {
......
......@@ -147,12 +147,13 @@
}
var attr = [];
if (this.new_SpecPriceList && this.new_SpecPriceList.length > 0) {
this.new_SpecPriceList.forEach(item => {
this.new_SpecPriceList.forEach((item,index) => {
var obj = {
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
PinTuanPrice: 0,
PinTuanStock: 0
PinTuanStock: 0,
SortNum:index+1
}
attr.push(obj);
})
......@@ -165,7 +166,6 @@
Group_Num:0,
StepPriceList: attr
});
},
//删除拼团
destroyPintuan(index) {
......
......@@ -842,6 +842,12 @@ export default new Router({
path: '/ActiveData',
name: 'ActiveData',
component: resolve => require(['@/components/pintuan/ActiveData'], resolve),
},
//拼团 活动数据 列表跳过去
{
path: '/ActiveDataDetail',
name: 'ActiveDataDetail',
component: resolve => require(['@/components/pintuan/ActiveDataDetail'], resolve),
}
]
}
......
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