Commit 8fab4aa2 authored by 黄媛媛's avatar 黄媛媛
parents 56f508a5 21fe5904
......@@ -962,7 +962,7 @@
</el-checkbox-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="addMsg.ServiceList = keepServiceList" size="small">取消</el-button>
<el-button @click="(addMsg.ServiceList = keepServiceList),(serviceDig = false)" size="small">取消</el-button>
<el-button @click="(addMsg.ServiceList = checkService), (serviceDig = false)" size="small" type="primary">确定
</el-button>
</span>
......
......@@ -6,8 +6,18 @@
</el-input>
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="50px">
</el-table-column>
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.Id }}</template>
</el-table-column>
......@@ -34,7 +44,7 @@
</template>
<script>
export default {
props:['ckGoods'],
props: ['ckGoods', "isSingle", "IsGetSpec"],
data() {
return {
dataList: [],
......@@ -42,32 +52,50 @@
pageIndex: 1,
pageSize: 15,
Name: '',
GoodsStatus:1 //上架中
GoodsStatus: 1, //上架中
IsGetSpec: 0
},
total: 0,
selectRow: [],
};
},
created() {},
created() {
if (this.IsGetSpec) {
this.msg.IsGetSpec = this.IsGetSpec;
}
},
methods: {
//获取所有菜单
getList() {
this.apipost("/api/product/GetProductGoodsDialogList", this.msg, res => {
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
this.dataList = res.data.data.pageData;
var tempArray = res.data.data.pageData;
if (tempArray && tempArray.length > 0) {
tempArray.forEach(item => {
item.IsChecked = false;
});
}
this.dataList = JSON.parse(JSON.stringify(tempArray));
} else {
this.Info(res.data.message);
}
})
},
handleSelectionChange(val) {
// if(val.length>this.ckGoods){
// this.Info('超过了');
// val=val.slice(0,this.ckGoods);
// }
this.selectRow = JSON.parse(JSON.stringify(val));
},
getTemplateRow(index, row) {
this.selectRow = [];
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach(item => {
if (item.Id != row.Id) {
item.IsChecked = false;
}
})
}
this.selectRow.push(JSON.parse(JSON.stringify(row)));
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
......
<style>
.box-grow-0 {
.pintuanActive .box-grow-0 {
flex-grow: 0;
width: 35px;
min-width: 0;
flex-shrink:0;
display:inline-block;
}
.bottom-div {
.pintuanActive .bottom-div {
border-top: 1px solid #E3E3E3;
position: fixed;
bottom: 0;
......@@ -15,10 +17,25 @@
left: 230px;
}
.button-item {
.pintuanActive .button-item {
padding: 9px 25px;
margin: 5px 0;
}
@media (max-width:1920px) and (min-width:1300px) {
.pintuanActive .el-col-12 {
width: 50%;
}
}
@media (max-width:1910px) and (min-width:1200px) {
.pintuanActive .el-col-12 {
width: 66.66667%;
}
}
@media (max-width:1199px) and (min-width:200px) {
.pintuanActive .el-col-12 {
width: 80%;
}
}
</style>
<template>
......@@ -39,13 +56,13 @@
<el-row>
<el-col :span="24">
<el-form-item label="开始时间">
<el-date-picker v-model="addMsg.start_time" size="small" type="datetime" placeholder="选择日期时间">
<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-date-picker v-model="addMsg.end_time" size="small" type="datetime" placeholder="选择日期时间">
<el-date-picker v-model="addMsg.EndTime" size="small" type="datetime" placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
</el-col>
......@@ -64,14 +81,15 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-button type="text">文字按钮</el-button>
<el-button type="text" @click="isShowGoods=true">选择商品</el-button>
</el-form-item>
<el-form-item label="商品名称" prop="Name">
<el-input size="small" v-model="addMsg.name" placeholder="请输入内容" maxlength="100">
<el-input size="small" v-model="addMsg.name" placeholder="请输入内容" maxlength="500" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="上架状态">
<el-switch active-color="#409EFF" v-model="addMsg.status" :active-value="1" :inactive-value="2">
<el-switch active-color="#409EFF" v-model="addMsg.GoodsStatus" :active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
<el-form-item>
......@@ -93,8 +111,8 @@
</div>
<el-row>
<el-col :span="12">
<el-form-item label="售价" prop="price">
<el-input v-model="addMsg.price" type="number" min="1" size="small" placeholder="请输入内容"
<el-form-item label="售价" prop="SellingPrice">
<el-input v-model="addMsg.SellingPrice" type="number" min="1" size="small" placeholder="请输入内容"
class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
......@@ -106,18 +124,19 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-input v-model="addMsg.original_price" type="number" :disabled="true" min="1" size="small"
<el-input v-model="addMsg.Original_Price" type="number" :disabled="true" min="0" size="small"
placeholder="请输入内容" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
<el-form-item label="商品总库存">
<el-input v-model="addMsg.goods_stock" size="small" placeholder="请输入内容" class="input-with-select">
<el-input v-model="addMsg.Goods_Stock" size="small" :disabled="true" placeholder="请输入商品总库存"
class="input-with-select">
</el-input>
</el-form-item>
<el-form-item label="默认规格名">
<el-input v-model="addMsg.attr_default_name" type="text" size="small" placeholder="请输入默认规格名"
class="input-with-select">
<el-input v-model="addMsg.Goods_unit" type="text" :disabled="true" size="small"
placeholder="请输入默认规格名" class="input-with-select">
</el-input>
</el-form-item>
<el-form-item label="商品规格">
......@@ -127,16 +146,17 @@
<i class="elzk el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<goodsSpe></goodsSpe>
<goodsSpe v-show="IsShowSpec" :SpecList="SpecificationList"
:SpecPriceList="SpecificationPriceList"></goodsSpe>
</el-form-item>
<el-form-item label="商品货号">
<el-input v-model="addMsg.goods_no" size="small" placeholder="请输入内容"
<el-input v-model="addMsg.Goods_no" size="small" :disabled="true" placeholder="请输入商品货号"
class="input-with-select">
</el-input>
</el-form-item>
<el-form-item label="商品重量">
<el-input v-model="addMsg.goods_weight" type="number" min="1" size="small" placeholder="请输入内容"
class="input-with-select">
<el-input v-model="addMsg.Goods_weight" type="number" :disabled="true" min="0" size="small"
placeholder="请输入商品重量" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
......@@ -150,7 +170,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="是否开启虚拟成团">
<el-switch active-color="#409EFF" v-model="addMsg.is_auto_add_robot" :active-value="1" :inactive-value="2">
<el-switch active-color="#409EFF" v-model="addMsg.Is_Auto_Add_Robot" :active-value="1"
:inactive-value="2">
</el-switch>
<div style="color:#c6c6c6">开启虚拟成团后,系统将模拟“匿名买家”凑满人数促成成团,商家仅需对真实拼团买家发货</div>
</el-form-item>
......@@ -161,18 +182,26 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="number" :disabled="true" v-model="addMsg.virtual_sales" min="0" size="small" placeholder="请输入内容"
class="input-with-select">
<el-input type="number" :disabled="true" v-model="addMsg.Virtual_Sales" min="0" size="small"
placeholder="请输入内容" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
<el-form-item label="是否允许单独购买">
<el-switch active-color="#409EFF" v-model="addMsg.is_alone_buy" :active-value="1" :inactive-value="2">
<el-switch active-color="#409EFF" v-model="addMsg.Is_Alone_Buy" :active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
<el-form-item label="商品服务">
<el-button size="small">新增服务</el-button>
<el-checkbox>默认服务</el-checkbox>
<template v-if="addMsg.GoodsService && addMsg.GoodsService.length > 0">
<el-tag style="margin-right:10px;" @close="ServiceCheck(item, index)"
v-for="(item, index) in addMsg.GoodsService" :key="index+'7'" closable>{{ item.Name }}
</el-tag>
</template>
<el-button @click="serviceDig = true,checkService=[]" v-if="addMsg.IsDefaultService == 2"
size="mini">新增服务</el-button>
<el-checkbox v-model="addMsg.IsDefaultService" @change="getServeChange(addMsg.IsDefaultService)"
:true-label="1" :false-label="2">默认服务</el-checkbox>
</el-form-item>
<el-form-item>
<template slot="label">
......@@ -182,7 +211,13 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-button size="small">选择运费</el-button>
<template v-if="AreaName && AreaName != ''">
<el-tag style="margin-right:10px;" @close="
(AreaName = ''), (addMsg.FreightId = 0)
" closable>
{{ AreaName }}</el-tag>
</template>
<el-button @click="chooseyfDig = true" size="mini">选择运费</el-button>
</el-form-item>
<el-form-item>
<template slot="label">
......@@ -192,27 +227,34 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-button size="small">选择表单</el-button>
<template v-if="formName && formName != ''">
<el-tag style="margin-right:10px;" @close="(formName = ''),(checkedForm=''), (addMsg.FormsId = 0)"
closable>
{{ formName }}</el-tag>
</template>
<el-button @click="choosebdDig = true" size="mini">选择表单</el-button>
</el-form-item>
<el-form-item label="限购数量" size="small">
<div flex="dir:left">
<span class="box-grow-0" style="color:#606266">商品</span>
<div style="width: 100%;margin:0 10px">
<el-input placeholder="请输入限购数量" v-model="addMsg.confine_count" size="small">
<el-input placeholder="请输入限购数量" v-model="addMsg.Confine_Count" size="small">
<template slot="append"></template>
</el-input>
</div>
<el-checkbox v-model="addMsg.confine_count <= -1" @change="itemChecked" style="margin-left:5px;line-height:32px;">无限制
<el-checkbox v-model="addMsg.Confine_Count <= -1" @change="itemChecked"
style="margin-left:5px;line-height:32px;">无限制
</el-checkbox>
</div>
<div flex="dir:left" style="margin-top: 10px;">
<span class="box-grow-0" style="color:#606266">订单</span>
<div style="width: 100%;margin:0 10px">
<el-input placeholder="请输入限购数量" v-model="addMsg.confine_order_count" size="small">
<el-input placeholder="请输入限购数量" v-model="addMsg.Confine_Order_Count" size="small">
<template slot="append"></template>
</el-input>
</div>
<el-checkbox v-model="addMsg.confine_order_count<=-1" @change="itemOrderChecked" style="margin-left:5px;line-height:32px;">无限制
<el-checkbox v-model="addMsg.Confine_Order_Count<=-1" @change="itemOrderChecked"
style="margin-left:5px;line-height:32px;">无限制
</el-checkbox>
</div>
</el-form-item>
......@@ -223,8 +265,8 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="number" :disabled="true" v-model="addMsg.pieces" min="0" size="small" placeholder="请输入数量"
class="input-with-select">
<el-input type="number" :disabled="true" v-model="addMsg.Pieces" min="0" size="small"
placeholder="请输入数量" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
......@@ -235,13 +277,14 @@
<i class="el-tooltip el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="number" :disabled="true" v-model="addMsg.forehead" min="0" size="small" placeholder="请输入金额"
class="input-with-select">
<el-input type="number" :disabled="true" v-model="addMsg.Forehead" min="0" size="small"
placeholder="请输入金额" class="input-with-select">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
<el-form-item label="区域购买">
<el-switch active-color="#409EFF" v-model="addMsg.is_area_limit" :active-value="1" :inactive-value="2">
<el-switch active-color="#409EFF" v-model="addMsg.Is_Area_Limit" :active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
......@@ -265,12 +308,13 @@
<i class="el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="number" min="0" v-model="addMsg.give_integral" size="small" placeholder="请输入赠送积分数量">
<el-input type="number" min="0" v-model="addMsg.Give_integral" size="small"
placeholder="请输入赠送积分数量">
<template slot="append">
<el-radio :label="1" v-model="addMsg.give_integral_type">固定值
<el-radio :label="1" v-model="addMsg.Give_integral_type">固定值
</el-radio>
<el-radio :label="2" v-model="addMsg.give_integral_type">百分比
<el-radio :label="2" v-model="addMsg.Give_integral_type">百分比
</el-radio>
</template>
</el-input>
......@@ -282,17 +326,18 @@
<i class="el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="number" min="0" size="small" v-model="addMsg.forehead_integral" placeholder="请输最高抵扣金额">
<el-input type="number" min="0" size="small" v-model="addMsg.Is_forehead_integral"
placeholder="请输最高抵扣金额">
<template slot="prepend">最多抵扣</template>
<template slot="append">
<el-radio :label="1" v-model="addMsg.forehead_integral_type">固定值
<el-radio :label="1" v-model="addMsg.Forehead_integral_type">固定值
</el-radio>
<el-radio :label="2" v-model="addMsg.forehead_integral_type">百分比
<el-radio :label="2" v-model="addMsg.Forehead_integral_type">百分比
</el-radio>
</template>
</el-input>
<el-checkbox :true-label="1" v-model="addMsg.accumulative" :false-label="0">
<el-checkbox :true-label="1" v-model="addMsg.Accumulative" :false-label="0">
允许多件累计抵扣
</el-checkbox>
</el-form-item>
......@@ -315,7 +360,8 @@
<i class="el-icon-info"></i>
</el-tooltip>
</template>
<el-input type="text" size="small" v-model="addMsg.app_share_title" placeholder="请输入分享标题"></el-input>
<el-input type="text" size="small" v-model="addMsg.App_share_title" placeholder="请输入分享标题">
</el-input>
<el-button type="text">查看图例</el-button>
</el-form-item>
<el-form-item>
......@@ -329,7 +375,6 @@
<el-button size="mini">选择图片</el-button>
</el-tooltip>
<div class="zk_pic_box" flex="main:center cross:center" style="width:80px;height:80px;">
<!-- app_share_pic -->
<i class="el-icon-picture-outline"></i>
</div>
<el-button type="text">查看图例</el-button>
......@@ -338,102 +383,270 @@
</el-row>
</el-card>
</el-tab-pane>
<el-tab-pane lebel="购买设置">
<el-tab-pane label="阶梯团设置">
<ladderGroup></ladderGroup>
</el-tab-pane>
<el-tab-pane lebel="分销价设置">
<el-tab-pane label="分销价设置">
<distributePrice></distributePrice>
</el-tab-pane>
<el-tab-pane lebel="阶梯团设置">
<el-tab-pane label="会员价设置">
<memberPrice></memberPrice>
</el-tab-pane>
</el-tabs>
</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="Save('addMsg')">保存</el-button>
<el-button size="small" class="button-item" type="primary" @click="SaveActivity()">保存</el-button>
<el-button size="small" class="button-item">预览</el-button>
</div>
</div>
<!-- 选择商品 -->
<el-dialog title="选择商品" :visible.sync="isShowGoods" custom-class="goodsDialog" width="800px">
<choiceGood ref="choiceGood" :ckGoods="ckGoods" :isSingle="true" :IsGetSpec="1"></choiceGood>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowGoods=false">取 消</el-button>
<el-button size="small" type="danger" @click="getGoodsChoice()">确 定</el-button>
</span>
</el-dialog>
<!-- 选择图片 -->
<!-- <el-dialog title="选择文件" :visible.sync="changeState" width="1240px">
<ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg>
</el-dialog> -->
<!-- 选择商品服务 -->
<el-dialog title="选择商品服务" :visible.sync="serviceDig" width="600px">
<div style="border: 1px solid #EBEEF5;padding:20px 0">
<el-checkbox-group v-model="checkService">
<el-checkbox style="margin:5px" v-for="item in serviceList" :label="item" :key="item.Id">{{ item.Name }}
</el-checkbox>
</el-checkbox-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="serviceDig=false" size="small">取消</el-button>
<el-button @click="(addMsg.GoodsService = checkService), (serviceDig = false)" size="small" type="primary">确定
</el-button>
</span>
</el-dialog>
<!-- 选择运费 -->
<el-dialog title="选择运费" top="2%" :visible.sync="chooseyfDig" width="600px">
<div>
<el-radio-group v-model="selectYunFei">
<el-radio @change="YfSelect" style="padding-bottom:10px" class="yfradio"
:label="{ RulesName: '默认运费', ID: 0 }">默认运费
</el-radio>
<el-radio @change="YfSelect" style="padding-bottom:10px" class="yfradio" v-for="(item, index) in ruleList"
:key="index+'23'" :label="item">{{ item.RulesName }}</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="chooseyfDig = false">取 消</el-button>
<el-button size="small" @click="chooseyfDig=false" type="primary">确 定</el-button>
</span>
</el-dialog>
<!-- 选择表单 -->
<el-dialog title="选择表单" top="2%" :visible.sync="choosebdDig" width="30%">
<div>
<el-radio-group v-model="checkedForm">
<el-radio :label="0">
默认表单
</el-radio>
</el-radio-group>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="choosebdDig = false">取 消</el-button>
<el-button size="small" @click="getCkedForm" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
import goodsSpe from "@/components/pintuan/pintuanPlugin/goodsSpecifica.vue"
import choiceGood from "@/components/common/choiceGood.vue";
import ladderGroup from "@/components/pintuan/pintuanPlugin/ladderGroup.vue"
import distributePrice from "@/components/pintuan/pintuanPlugin/distributePrice.vue"
import memberPrice from "@/components/pintuan/pintuanPlugin/memberPrice.vue"
export default {
components: {
ChooseImg,
goodsSpe
goodsSpe,
choiceGood,
ladderGroup,
distributePrice,
memberPrice
},
data() {
return {
ckGoods: 0,
isShowGoods: false, //是否显示商品
activeName: "first",
addMsg: {
start_time: '', //开始时间
end_time: '', //结束时间
ActivityId: 0, //活动Id
StartTime: '', //开始时间
EndTime: '', //结束时间
GoodId: 0, //商品编号
name: '', //商品名称
status:0, //上架状态
GoodsStatus: 1, //上架状态(0-未开始,1-上架,2-下架中,3-删除)
Sort: 100, //排序
price: 0, //售价
original_price: 0, //原价
goods_num:0, //库存
goods_stock: 0, //商品总库存
attr_default_name: '', //默认规格名
// 商品规格字段
goods_no:'', //商品货号
goods_weight:'', //商品重量
is_auto_add_robot:0, //是否开启虚拟团
virtual_sales:0, //已团商品数
is_alone_buy:0, //是否允许单独购买
Service:[], //商品服务字段
freight:'', //运费设置
form:'', //自定义表单
confine_count:-1, //限购数量
confine_order_count:-1, //限购订单
pieces:0, //单品满件包邮
forehead:0, //单品满额包邮
is_area_limit:0, //区域购买
SellingPrice: 0, //售价
Original_Price: 0, //原价
Goods_Stock: 0, //商品总库存
Goods_unit: "", // 商品规格字段
Goods_no: '', //商品货号
Goods_weight: '', //商品重量
Is_Auto_Add_Robot: 0, //是否开启虚拟团
Virtual_Sales: 0, //已团商品数
Is_Alone_Buy: 0, //是否允许单独购买
IsDefaultService: 1, //是否默认商品服务(1是,2否)
GoodsService: [], //商品服务字段
FreightId: 0, //运费设置
FormsId: 0, //自定义表单
Confine_Count: -1, //限购数量
Confine_Order_Count: -1, //限购订单
Pieces: 0, //单品满件包邮
Forehead: 0, //单品满额包邮
Is_Area_Limit: 0, //区域购买
Area_limit: "", //购买区域
Give_integral: 0, //积分赠送
Give_integral_type: 1, //积分赠送=>1固定值 2百分比
Is_forehead_integral: 0, //积分抵扣
Forehead_integral_type: 1, //积分抵扣=>1固定值 2百分比
Accumulative: 0, //允许多件累计抵扣
CardIds: [], //卡券发放
App_share_title: '', //自定义分享标题、
App_share_pic: '', //自定义分享图片
},
IsShowSpec: false, //是否显示规格
SpecificationList: [], //规格列表
SpecificationPriceList: [], //规格价格列表
give_integral:0, //积分赠送
give_integral_type:1, //积分赠送=>1固定值 2百分比
forehead_integral:0, //积分抵扣
forehead_integral_type:1, //积分抵扣=>1固定值 2百分比
accumulative:0, //允许多件累计抵扣
cards:[], //卡券发放
app_share_title:'', //自定义分享标题、
app_share_pic:'', //自定义分享图片
serviceDig: false,
serviceList: [], //新增服务弹出数据
checkService: [],
},
chooseyfDig: false, //运费弹窗
ruleList: [], //运费数组
selectYunFei: {}, //选中运费
AreaName: '',
choosebdDig: false, //选择表单
checkedForm:'',
formName: '',
rules: {
// Name: [{
// required: true,
// message: "请输入商品名称",
// trigger: "blur"
// }]
},
};
},
created() {},
mounted() {
// if (this.$route.query.GoodsId) {
// this.GoodsId = this.$route.query.GoodsId;
// this.getData();
// }
if (this.$route.query.Id) {
this.addMsg.ActivityId = this.$route.query.Id;
this.getData();
}
this.getService();
this.getRule();
},
methods: {
//点击checkbox是否限购商品
itemChecked(type) {
this.addMsg.confine_count = type ? -1 : 0;
this.addMsg.Confine_Count = type ? -1 : 0;
},
//点击checkbox是否限购订单
itemOrderChecked(type) {
this.addMsg.confine_order_count = type ? -1 : 0;
this.addMsg.Confine_Order_Count = type ? -1 : 0;
},
//保存拼团活动
SaveActivity() {
console.log(this.addMsg);
return;
this.apipost("/api/GroupBuy/SetGroupbuyActivity", this.addMsg, res => {
console.log("res", res);
if (res.data.resultCode == 1) {
}
})
},
//选择商品
getGoodsChoice() {
this.isShowGoods = false;
this.IsShowSpec = false;
var chooseGoods = this.$refs.choiceGood.getChoicedGoods();
console.log("chooseGoods", chooseGoods);
if (chooseGoods && chooseGoods.length > 0) {
this.addMsg.GoodId = chooseGoods[0].Id;
this.addMsg.name = chooseGoods[0].Name;
this.addMsg.Sort = chooseGoods[0].Sort;
this.addMsg.SellingPrice = chooseGoods[0].SellingPrice;
this.addMsg.Original_Price = chooseGoods[0].OriginalPrice;
this.addMsg.Goods_Stock = chooseGoods[0].InventoryNum;
this.addMsg.Goods_unit = chooseGoods[0].DefaultSpecificationName;
this.addMsg.Goods_no = chooseGoods[0].GoodsNumbers;
this.addMsg.Goods_weight = chooseGoods[0].GoodsWeight;
this.SpecificationList = chooseGoods[0].SpecificationList;
this.SpecificationPriceList = chooseGoods[0].SpecificationPriceList;
this.IsShowSpec = true;
}
this.$refs.choiceGood.toggleSelection();
},
//删除商品服务
ServiceCheck(item, index) {
this.addMsg.GoodsService.forEach((list, k) => {
if (list.Id == item.Id) {
this.addMsg.GoodsService.splice(k, 1);
}
});
},
//获取服务
getService() {
let msg = {
pageIndex: 1,
pageSize: 200,
Name: "",
IsDefault: 0
};
this.apipost("/api/product/GetProductServicePageList", msg, res => {
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.serviceList = pageData;
}
});
},
//服务改变
getServeChange(type) {
if (type == 1) {
this.addMsg.GoodsService = [];
}
},
//获取运费规则
getRule() {
let msg1 = {
pageIndex: 1,
pageSize: 999,
RulesName: ""
};
this.apipost("/api/MallBase/GetLogisticsRulesPage", msg1, res => {
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
this.ruleList = pageData;
}
});
},
//点击radio
YfSelect(val) {
this.addMsg.FreightId = val.ID;
this.AreaName = val.RulesName;
},
//选择默认表单
getCkedForm(){
if(this.checkedForm===''){
this.addMsg.FormsId=0;
}else{
this.addMsg.FormsId=this.checkedForm;
}
this.formName='默认表单';
this.choosebdDig=false;
}
}
};
......
......@@ -56,7 +56,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="Goods_stock" label="库存">
<el-table-column prop="Goods_Stock" label="库存">
</el-table-column>
<el-table-column label="活动时间">
<template slot-scope="scope">
......@@ -136,7 +136,6 @@
this.loading = true;
this.apipost("/api/GroupBuy/GetGroupbuyActivityPageList", this.msg, res => {
this.loading = false;
console.log("res", res);
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
let pageData = res.data.data.pageData;
......
<style>
.pintuan-share .box {
border-top: 1px solid #E8EAEE;
border-left: 1px solid #E8EAEE;
border-right: 1px solid #E8EAEE;
padding: 16px;
}
</style>
<template>
<div>
<el-form-item label="是否开启分销佣金" prop="individual_share">
<el-switch :active-value="1" :inactive-value="0" v-model="msg.individual_share">
</el-switch>
</el-form-item>
<template v-if="msg.individual_share == 1">
<!-- <el-form-item label="分销类型" prop="attr_setting_type" v-if="cForm.use_attr == 1 && ruleForm.type == 'goods'">
<el-radio v-model="ruleForm.attr_setting_type" :label="0">普通设置</el-radio>
<el-radio v-model="ruleForm.attr_setting_type" :label="1">详细设置</el-radio>
</el-form-item> -->
<el-form-item label="分销佣金类型" prop="share_type">
<el-radio v-model="msg.share_type" :label="0">固定金额</el-radio>
<el-radio v-model="msg.share_type" :label="1">百分比</el-radio>
</el-form-item>
<!-- <template v-if="sign !== 'pintuan'">
<app-goods-share v-model="ruleForm" :is_mch="is_mch" :attr-groups="attrGroups"
:attr_setting_type="cForm.attr_setting_type" :share_type="ruleForm.share_type" :use_attr="ruleForm.use_attr"
:sign="sign" pintuan_sign="单独购买"></app-goods-share>
</template>
<template v-if="sign === 'pintuan' && cForm.is_alone_buy == 1">
<app-goods-share v-model="ruleForm" :is_mch="is_mch" :attr-groups="attrGroups"
:attr_setting_type="ruleForm.attr_setting_type" :share_type="ruleForm.share_type"
:use_attr="ruleForm.use_attr" :sign="sign" pintuan_sign="单独购买"></app-goods-share>
</template> -->
<el-form-item>
<div class="pintuan-share">
<el-card>
<div slot="header" class="clearfix">
<div class="box">
<div style="display:inline-block;">
<el-tag type="danger">3人团</el-tag>
</div>
<label style="margin-bottom:0;padding:18px 10px;">批量设置</label>
<el-select placeholder="请选择层级" v-model="fenxiao" style="width:130px;" size="small">
<el-option label="一级分销" :value="1"></el-option>
<el-option label="二级分销" :value="2"></el-option>
</el-select>
<el-input type="text" size="small" style="width:150px;margin-top:5px;">
<el-button slot="append"></el-button>
</el-input>
<el-button size="small" type="primary">设置</el-button>
</div>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;border:1px solid #E8EAEE"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column label="等级名称" prop="leval" width="100">
</el-table-column>
<el-table-column label="一级分销" width="576">
<template slot-scope="scope">
<el-input type="text" size="small" v-model="scope.row.yiji">
<el-button slot="append"></el-button>
</el-input>
</template>
</el-table-column>
<el-table-column label="二级分销" width="575">
<template slot-scope="scope">
<el-input type="text" size="small" v-model="scope.row.erji">
<el-button slot="append"></el-button>
</el-input>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</div>
</el-form-item>
</template>
</div>
</template>
<script>
export default {
props: {
},
data() {
return {
fenxiao:0,
msg: {
individual_share: 1,
share_type: 0
},
tableData:[
{
leval:'默认等级',
yiji:0,
erji:3
}
]
};
},
created() {
},
methods: {
handleSelectionChange(){
}
},
mounted() {
},
computed: {
},
};
</script>
......@@ -25,10 +25,12 @@
border: 1px solid #ebeef5;
padding: 10px;
}
.speciDig .tpl-box {
width: 300px;
height: 440px;
}
}
.speciDig .tpl-box .tpl-head {
padding: 0 20px;
font-size: 15px;
......@@ -36,11 +38,13 @@
margin-bottom: 10px;
line-height: 44px;
background: #f5f7fa;
}
.speciDig .tpl-scrollbar {
}
.speciDig .tpl-scrollbar {
height: calc(440px - 44px - 10px);
}
.speciDig .tpl-scrollbar .el-checkbox {
}
.speciDig .tpl-scrollbar .el-checkbox {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
......@@ -48,35 +52,39 @@
-ms-flex-align: center;
align-items: center;
padding: 10px 0;
}
.goodsSpecifica .app-attr-group .attr-list {
}
.goodsSpecifica .app-attr-group .attr-list {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
position: relative;
}
.goodsSpecifica .app-attr-group .close {
}
.goodsSpecifica .app-attr-group .close {
position: absolute;
top: -4px;
right: -4px;
font-size: 16px;
cursor: pointer;
}
.goodsSpecifica .box-grow-0 {
}
.goodsSpecifica .box-grow-0 {
min-width: 0;
-webkit-box-flex: 0;
flex-grow: 0;
flex-shrink: 0;
}
.goodsSpecifica .app-attr-group .img-box {
}
.goodsSpecifica .app-attr-group .img-box {
position: relative;
height: 100px;
width: 100px;
margin-top: 8px;
border: 1px solid #ebeef5;
}
}
.goodsSpecifica .app-attr-group .attr-jt {
.goodsSpecifica .app-attr-group .attr-jt {
background: #ffffff;
width: 6px;
height: 6px;
......@@ -89,7 +97,8 @@
-ms-transform: rotate(-45deg);
position: absolute;
top: -5px;
}
}
</style>
<template>
<div>
......@@ -116,9 +125,8 @@
<i @click="Deleteggz(item, index, index2)" class="el-icon-error close"></i>
<div v-if="index == 0 && item.EnabledImage == 1" flex="cross:center main:center" class="img-box">
<div class="attr-jt"></div>
<div v-if="item2.Image == ''" @click="
openggImg(item, index, item2, index2)
" class="app-attachment">
<div v-if="item2.Image == ''" @click=" openggImg(item, index, item2, index2) "
class="app-attachment">
<div style="line-height: normal; display: inline-block;">
<span>+添加图片</span>
</div>
......@@ -126,14 +134,12 @@
<div v-if="item2.Image != ''" class="el-image" style="height: 88px; width: 88px;">
<img :src="item2.Image" style="width:100%;height:100%" />
</div>
<span v-if="item2.Image != ''" @click="
DeleteImageUrl(item, index, item2, index2)
" class="el-icon-error close"></span>
<span v-if="item2.Image != ''" @click=" DeleteImageUrl(item, index, item2, index2) "
class="el-icon-error close"></span>
<div v-if="item2.Image != ''" style="position: absolute;">
<div class="app-attachment">
<el-button @click="
openggImg(item, index, item2, index2)
" type="primary" size="small">替换</el-button>
<el-button @click="openggImg(item, index, item2, index2)" type="primary"
size="small">替换</el-button>
</div>
</div>
</div>
......@@ -254,7 +260,8 @@
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
components:{
props: ['SpecList',"SpecPriceList"],
components: {
ChooseImg
},
data() {
......@@ -278,14 +285,24 @@
speciList: [],
DropdownList: [],
huiyList: [],
SeparateDistributionType: 1, //待传递给父组件
EnjoyMember: 1, //待传父组件
SeparateDistributionType: 1, //待传递给父组件
EnjoyMember: 1, //待传父组件
};
},
created() {
},
watch: {
'SpecList': {
handler: function (val, oldval) {
this.SpecificationList = JSON.parse(JSON.stringify(val));
},
},
'SpecPriceList': {
handler: function (val, oldval) {
this.SpecificationPriceList = JSON.parse(JSON.stringify(val));
},
},
},
methods: {
// 添加规格模板
......@@ -665,12 +682,12 @@
});
},
CheckBox(val) {
console.log(val,'valll');
console.log(val, 'valll');
},
},
mounted() {
this.getSpeciList();
this.getSpeciList();
}
};
......
<style>
.header-require:before {
content: '*';
color: #F56C6C;
margin-right: 2px;
}
</style>
<template>
<div>
<el-form>
<el-form-item label-width="0">
<div>阶梯团设置</div>
<el-table style="margin-bottom: 15px;width: 100%" v-if="group_list.length > 0" :data="group_list" border>
<el-table-column width="200">
<template slot="header">
<div class="header-require">拼团人数</div>
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.people_num" size="small" type="text" maxlength="5"
oninput="this.value = this.value.replace(/[^0-9]/, '')" placeholder="请输入拼团人数"></el-input>
</template>
</el-table-column>
<el-table-column label="团长优惠" width="200">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.preferential_price" size="small" placeholder="请输入团长优惠">
</el-input>
</template>
</el-table-column>
<el-table-column width="400">
<template slot="header">
<div class="header-require">拼团时间</div>
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.pintuan_time" maxlength="4" type="text" size="small"
oninput="this.value = this.value.replace(/[^0-9]/, '')" placeholder="请输入拼团时间">
<template slot="append">小时</template>
</el-input>
</template>
</el-table-column>
<el-table-column label="最多开团数量" :render-header="delegation" width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.group_num" type="text" size="small" maxlength="5"
oninput="this.value = this.value.replace(/[^0-9]/, '')" placeholder="请输入团长数量">
<template slot="append"></template>
</el-input>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="small" @click="destroyPintuan(scope.$index)" circle type="text">
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../../assets/img/userman/del.png" alt="">
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="text" @click="addPintuan">
<i class="el-icon-plus" style="font-weight: bolder;margin-left: 5px;"></i>
<span style="color: #353535;font-size: 14px">新增阶梯团</span>
</el-button>
</el-form-item>
<el-card v-for="(item, index) in group_list" style="margin-top: 24px;" :key="index" shadow="never">
<div slot="header">
<el-tag type="danger">{{item.people_num}}人团</el-tag>
</div>
<el-form-item>
<div>价格与库存</div>
<priceAndGroup :attr-groups="new_attr_groups" v-model="item.attr" :list="{price: '拼团价', stock: '拼团库存'}"></priceAndGroup>
</el-form-item>
</el-card>
</el-form>
</div>
</template>
<script>
import priceAndGroup from "@/components/pintuan/pintuanPlugin/priceAndGroup.vue"
export default {
components: {
priceAndGroup //拼团与库存组件
},
data() {
return {
group_list: [],
//以下为写死-需要传入
newAttr: [],
defaultMemberPrice: [],
goods_stock: 0,
price: 0,
goods_no: '',
goods_weight: '',
new_attr_groups:[]
};
},
created() {
},
methods: {
//表头提示样式
delegation(h, {
column
}) {
return h(
"el-popover", {
props: {
placement: "top",
trigger: "hover",
popperClass: "popperClassResOut"
}
},
[
h(
"div",
[
`可发起拼团的次数(包括正在拼团中、拼团完成),`,
h('br'),
`0代表不限制次数`,
]
),
h(
"span", {
slot: "reference"
},
[
column.label,
h("i", {
class: "el-icon-info",
style: {
marginLeft: "4px",
cursor: "pointer",
}
})
]
),
]
)
},
//新增阶梯团
addPintuan() {
let data = {};
if (this.newAttr.length === 0) {
data = [{
attr_list: [{
attr_group_id: -1,
attr_group_name: '规格',
attr_name: this.attr_default_name ? this.attr_default_name : '默认',
attr_id: -1,
}],
stock: this.goods_stock,
price: this.price,
no: this.goods_no,
weight: this.goods_weight,
pic_url: '',
pintuan_stock: this.goods_stock,
pintuan_price: this.price,
goodsAttr: {
id: undefined
}
}];
} else {
data = JSON.parse(JSON.stringify(this.newAttr));
data.forEach((item) => {
item.pintuan_price = item.price;
item.pintuan_stock = item.stock;
item.goodsAttr = {
id: item.id
}
});
}
this.group_list.push({
people_num: 2,
preferential_price: 1,
pintuan_time: 1,
goods_id: 0,
attr: JSON.parse(JSON.stringify(data)),
member_price: JSON.parse(JSON.stringify(this.defaultMemberPrice)),
shareLevelList: {
share_commission_first: 0,
share_commission_second: 0,
share_commission_third: 0,
},
});
},
//删除拼团
destroyPintuan(index) {
this.group_list.splice(index, 1);
}
},
mounted() {
}
};
</script>
<style>
.app-attr .box {
line-height: 64px;
border-top: 1px solid #E8EAEE;
border-left: 1px solid #E8EAEE;
border-right: 1px solid #E8EAEE;
padding: 0 16px;
}
.app-attr .box .batch {
margin-left: -10px;
margin-right: 20px;
}
.app-attr .el-select .el-input {
width: 130px;
}
.app-attr .input-with-select .el-input-group__prepend {
background-color: #fff;
}
.app-attr .header-require:before {
content: '*';
color: #F56C6C;
margin-right: 2px;
}
</style>
<template>
<div class="app-attr">
<div class="box">
<el-form label-width="180px">
<el-checkbox v-model="attrBatch" @change="selectClick" :disabled="!cData || cData.length == 0"
style="position:absolute">全选
</el-checkbox>
<el-form-item label="批量设置" size="small" style="margin-bottom:0;padding:18px 0;display:inline-block;">
<el-input @keyup.enter.native="batchAttr(selectData)" size="small" :type="selectData == 'no' ? 'text' : 'number'"
v-model="batch">
<el-select v-model="selectData" slot="prepend">
<el-option v-for="(item, index) in cList" :value="index" :key="item" v-if="index!='pic_url'" :label="item">
{{item}}
</el-option>
</el-select>
<template slot="append">
<el-button @click="batchAttr(selectData)">
确定
</el-button>
</template>
</el-input>
</el-form-item>
</el-form>
</div>
<el-table ref="multipleTable" :data="cData" border stripe style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column v-for="(item, index) in attrGroups" :key="item.id" :prop="'attr_list['+index+'].attr_name'"
:label="item.attr_group_name">
</el-table-column>
<el-table-column v-if="cList" v-for="(item, key, index) in cList" :key="item.id" :property="key"
:label="item + (append ? '(' + append + ')' : '')">
<template slot="header" v-if="requiredArray.indexOf(key) !== -1">
<div class="header-require">{{item}}</div>
</template>
<template slot-scope="scope">
<template v-if="!isLevel">
<div flex="box:first" v-if="scope.column.property == 'pic_url'" style="padding: 10px;">
<div flex="cross:center" style="margin-right: 10px;position: relative;">
<app-attachment :multiple="false" :params="scope.row" :max="1"
v-model="scope.row[scope.column.property]">
<app-gallery :url="scope.row[scope.column.property]" width="50px" height="50px"></app-gallery>
</app-attachment>
<el-button v-if="scope.row[scope.column.property]"
style="position: absolute; right: -8px; top: -8px; padding: 4px 4px;" size="mini" type="danger"
icon="el-icon-close" circle @click="scope.row[scope.column.property] = ''"></el-button>
</div>
</div>
<el-input v-else-if="scope.column.property == 'no'" v-model="scope.row[scope.column.property]"></el-input>
<el-input v-else-if="scope.column.property == 'stock'"
oninput="this.value = this.value.replace(/[^0-9]/g, '');" v-model="scope.row[scope.column.property]">
</el-input>
<el-input v-else-if="scope.column.property.indexOf('price') > -1 || scope.column.property.indexOf('level')"
type="number" v-model="scope.row[scope.column.property]"></el-input>
<el-input v-else oninput="this.value = this.value.replace(/[^0-9]/g, '');"
v-model="scope.row[scope.column.property]">
<template v-if="append" slot="append">{{append}}</template>
</el-input>
</template>
<template v-else>
<el-input :data-id="scope.row[scope.column.label]" type="number"
v-model="scope.row[paramKey][scope.column.property]">
</el-input>
</template>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
value: Array, // 商品规格信息
attrGroups: Array, // 商品规格组
extra: Object, // 额外的数据信息
list: Object | Array, // 从排列数据信息
isLevel: Boolean, // 是否是会员
members: Array, // 会员等级列表
share: Array, // 分销等级列表
append: String, // 输入框后缀
requiredExtra: {
type: Array,
default () {
return []
}
},
paramKey: {
type: String,
default () {
return 'member_price';
}
}
},
data() {
return {
requiredArray: [`price`, `stock`].concat(this.requiredExtra),
attrBatch: false,
data: {
price: '价格',
stock: '库存',
weight: '重量(克)',
no: '货号',
//pic_url: '规格图片',
},
selectData: '',
batch: 0,
selectList: [],
};
},
created() {
},
watch: {
'selectList': function () {
const self = this;
let sign = 0;
this.value.forEach(function (item, index) {
self.selectList.map((item1) => {
if (JSON.stringify(item1.attr_list) === JSON.stringify(item.attr_list)) {
sign++;
}
});
});
self.attrBatch = self.value.length === sign;
}
},
methods: {
//全选
selectClick() {
this.$refs.multipleTable.toggleAllSelection();
},
handleSelectionChange(data) {
this.selectList = data;
},
batchAttr(param) {
if (!param) {
this.$message.warning('请选择批量设置');
return;
}
if (!this.selectList || this.selectList.length === 0) {
this.$message.warning('请勾选商品规格');
return;
}
let self = this;
let batch = self.batch;
this.value.forEach((item, index) => {
let sign = false;
self.selectList.map((item1) => {
if (JSON.stringify(item1.attr_list) === JSON.stringify(item.attr_list)) {
sign = true;
}
});
if (sign) {
// 批量设置会员价
// 判断字符串是否出现过,并返回位置
if (param.indexOf('level') !== -1) {
item[this.paramKey][param] = batch;
} else {
item[param] = batch;
}
}
});
}
},
mounted() {
},
computed: {
cList() {
// TODO 分销数据暂时
if (this.share) {
let share = JSON.parse(JSON.stringify(this.share));
let obj = {};
for (let i = 0; i < share.length; i++) {
obj[share[i].value] = share[i].label;
}
return obj;
}
// TODO 会员数据暂时
if (this.isLevel) {
let members = JSON.parse(JSON.stringify(this.members));
let obj = {};
for (let i = 0; i < members.length; i++) {
obj['level' + members[i].level] = members[i].name
}
return obj;
} else {
if (this.extra) {
return Object.assign(this.data, JSON.parse(JSON.stringify(this.extra)));
} else if (this.list) {
return JSON.parse(JSON.stringify(this.list))
} else {
return this.data;
}
}
},
cData() {
if (this.attrGroups && this.attrGroups.length > 0 && this.attrGroups[0].attr_list.length === 0) {
return [];
} else {
return this.value;
}
}
},
};
</script>
......@@ -542,9 +542,9 @@
</el-dialog>
<!-- 选择商品 -->
<el-dialog title="选择商品" :visible.sync="isShowGoods" custom-class="goodsDialog">
<choiceGood ref="choiceGood" :ckGoods="ckGoods"></choiceGood>
<choiceGood ref="choiceGood" ></choiceGood>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="quxiaoGoods()">取 消</el-button>
<el-button size="small" @click="isShowGoods=false">取 消</el-button>
<el-button size="small" type="danger" @click="getGoodsChoice()">确 定</el-button>
</span>
</el-dialog>
......
......@@ -92,10 +92,10 @@
</div>
</div>
</div>
<div flex="cross:center" style="margin-top:20px;display:none">
<div flex="cross:center" style="margin-top:20px ">
<h3 class="plugin_ListTitle">营销工具</h3>
</div>
<div flex="dir:left" style="display:none" class="plugin-list el-row">
<div flex="dir:left" class="plugin-list el-row">
<div class="el-col el-col-24 el-col-xs-24 el-col-sm-12 el-col-md-8 el-col-lg-6 el-col-xl-4" @click="goDiyCenter('pintuanMain')">
<div flex="dir:left box:first" class="plugin-item">
<div style="padding-right: 12px;">
......
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