Commit f24a462a authored by 黄奎's avatar 黄奎

页面修改

parent 84f8d798
...@@ -55,8 +55,7 @@ ...@@ -55,8 +55,7 @@
<div flex="dir:left"> <div flex="dir:left">
<div v-for="(item,index) in addMsg.CarouselImageList" :key="index" <div v-for="(item,index) in addMsg.CarouselImageList" :key="index"
style="margin-right: 20px; position: relative; "> style="margin-right: 20px; position: relative; ">
<div class="colapp-image" <div class="colapp-image" :style="{backgroundImage:'url('+ item.Path + ')'}"></div>
:style="{backgroundImage:'url('+ item.Path + ')'}"></div>
<el-button @click="ClearCarouse(index)" class="delBtn" type="danger" icon="el-icon-close" <el-button @click="ClearCarouse(index)" class="delBtn" type="danger" icon="el-icon-close"
circle></el-button> circle></el-button>
</div> </div>
...@@ -96,8 +95,7 @@ ...@@ -96,8 +95,7 @@
<el-button @click="clearCustom" style="position: absolute;right: 6px;top: -10px;" <el-button @click="clearCustom" style="position: absolute;right: 6px;top: -10px;"
v-if="addMsg.CustomShareImage && addMsg.CustomShareImage!=''" size="mini" type="danger" v-if="addMsg.CustomShareImage && addMsg.CustomShareImage!=''" size="mini" type="danger"
icon="el-icon-close" circle></el-button> icon="el-icon-close" circle></el-button>
<img style="width:80px;height:80px" :src="addMsg.CustomShareImage" <img style="width:80px;height:80px" :src="addMsg.CustomShareImage" alt="">
alt="">
</div> </div>
<p style="margin-top:-15px" class="blue f12"> <p style="margin-top:-15px" class="blue f12">
<span class="point" @click="imgDig=true">查看图例</span> <span class="point" @click="imgDig=true">查看图例</span>
...@@ -147,11 +145,12 @@ ...@@ -147,11 +145,12 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="成本价"> <el-form-item label="成本价">
<el-input @change="getSuggestPrice" v-model="addMsg.CostPrice" type="number" min="1" size="small" placeholder="请输入内容" <el-input @change="getSuggestPrice" v-model="addMsg.CostPrice" type="number" min="1" size="small"
class="input-with-select"> placeholder="请输入内容" class="input-with-select">
<el-button slot="append"></el-button> <el-button slot="append"></el-button>
</el-input> </el-input>
<span v-if="SuggestPriceInfo.Status && SuggestPriceInfo.Status==1" class="cred" style="position: absolute;width: 400px;margin-left: 15px;"> <span v-if="SuggestPriceInfo.Status && SuggestPriceInfo.Status==1" class="cred"
style="position: absolute;width: 400px;margin-left: 15px;">
建议零售价:¥{{SuggestPriceInfo.MPrice}} 建议零售价:¥{{SuggestPriceInfo.MPrice}}
</span> </span>
</el-form-item> </el-form-item>
...@@ -205,13 +204,15 @@ ...@@ -205,13 +204,15 @@
<div flex="dir:left" style="padding: 0px 10px;margin-top: 16px;"> <div flex="dir:left" style="padding: 0px 10px;margin-top: 16px;">
<div class="box-grow-0">规格值:</div> <div class="box-grow-0">规格值:</div>
<div flex="dir:left" style="flex-wrap: wrap;"> <div flex="dir:left" style="flex-wrap: wrap;">
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2" class="attr-list"> <div v-for="(item2,index2) in item.SpecificationValueList" :key="index2"
class="attr-list">
<el-input @input="ggzChange" size="mini" v-model="item2.Name" width="152px"></el-input> <el-input @input="ggzChange" size="mini" v-model="item2.Name" width="152px"></el-input>
<i @click="Deleteggz(item,index,index2)" class="el-icon-error close"></i> <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" <div v-if="index==0 && item.EnabledImage==1" flex="cross:center main:center"
class="img-box"> class="img-box">
<div class="attr-jt"></div> <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;"> <div style="line-height: normal; display: inline-block;">
<span>+添加图片</span> <span>+添加图片</span>
</div> </div>
...@@ -219,10 +220,12 @@ ...@@ -219,10 +220,12 @@
<div v-if="item2.Image!=''" class="el-image" style="height: 88px; width: 88px;"> <div v-if="item2.Image!=''" class="el-image" style="height: 88px; width: 88px;">
<img :src="item2.Image" style="width:100%;height:100%"> <img :src="item2.Image" style="width:100%;height:100%">
</div> </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 v-if="item2.Image!=''" style="position: absolute;">
<div class="app-attachment"> <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> </div>
</div> </div>
...@@ -270,7 +273,6 @@ ...@@ -270,7 +273,6 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column :render-header="renderHeader" label="价格"> <el-table-column :render-header="renderHeader" label="价格">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.SellingPrice" size="small"></el-input> <el-input v-model="scope.row.SellingPrice" size="small"></el-input>
...@@ -407,8 +409,6 @@ ...@@ -407,8 +409,6 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
...@@ -538,7 +538,6 @@ ...@@ -538,7 +538,6 @@
</el-button> </el-button>
</el-input> </el-input>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
...@@ -569,7 +568,6 @@ ...@@ -569,7 +568,6 @@
</div> </div>
<el-table ref="table" :data="disList2" border style="width: 100%" <el-table ref="table" :data="disList2" border style="width: 100%"
@selection-change="TbaleSelectionChange3"> @selection-change="TbaleSelectionChange3">
<template v-for="(item,index) in SpecificationList"> <template v-for="(item,index) in SpecificationList">
<el-table-column :key="index" :label="item.Name" width="100"> <el-table-column :key="index" :label="item.Name" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -603,12 +601,10 @@ ...@@ -603,12 +601,10 @@
</template> </template>
<el-table-column type="selection" :fixed="true" width="55"> <el-table-column type="selection" :fixed="true" width="55">
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="会员价设置" name="third"> <el-tab-pane label="会员价设置" name="third">
<el-form-item label="是否享受会员功能"> <el-form-item label="是否享受会员功能">
...@@ -624,52 +620,52 @@ ...@@ -624,52 +620,52 @@
<el-button @click="CommonJump('setMember')" size="small" type="danger">如需设置请先添加会员</el-button> <el-button @click="CommonJump('setMember')" size="small" type="danger">如需设置请先添加会员</el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="addMsg.SeparateSetMember==1 && SpecificationPriceList.length==0" label="默认规格会员价设置"> <el-form-item v-if="addMsg.SeparateSetMember==1 && SpecificationPriceList.length==0" label="默认规格会员价设置">
<div v-for="(item,index) in memberList1[0].GradePriceList" :key="index"> <div v-for="(item,index) in memberList1[0].GradePriceList" :key="index">
<el-input style="width:700px" placeholder="请输入内容" v-model="item.MemberPrice" size="small" class="input-with-select"> <el-input style="width:700px" placeholder="请输入内容" v-model="item.MemberPrice" size="small"
<el-button slot="prepend">{{item.Name}}</el-button> class="input-with-select">
<el-button slot="append"></el-button> <el-button slot="prepend">{{item.Name}}</el-button>
</el-input> <el-button slot="append"></el-button>
</div> </el-input>
<el-tag type="danger">如需设置多规格会员价,请先添加商品规格</el-tag> </div>
<el-tag type="danger">如需设置多规格会员价,请先添加商品规格</el-tag>
</el-form-item> </el-form-item>
<el-form-item v-if="addMsg.SeparateSetMember==1 && SpecificationPriceList.length>0" label="会员价设置"> <el-form-item v-if="addMsg.SeparateSetMember==1 && SpecificationPriceList.length>0" label="会员价设置">
<div class="app-attr"> <div class="app-attr">
<div class="box"> <div class="box">
<el-form-item style="display:inline-block"> <el-form-item style="display:inline-block">
<el-input style="width:500px;position:relative;top:5px" size="small" v-model="memberinput" <el-input style="width:500px;position:relative;top:5px" size="small" v-model="memberinput"
placeholder="请输入内容"> placeholder="请输入内容">
<el-select slot="prepend" style="width:130px" v-model="memberVal" size="small"> <el-select slot="prepend" style="width:130px" v-model="memberVal" size="small">
<el-option v-for="(item,index) in huiyList" :label="item.Name" :value="item.Grade" <el-option v-for="(item,index) in huiyList" :label="item.Name" :value="item.Grade" :key="index">
:key="index"></el-option> </el-option>
</el-select> </el-select>
<el-button @click="HySet" slot="append">确定</el-button> <el-button @click="HySet" slot="append">确定</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div>
<el-table ref="table" :data="memberList2" border style="width: 100%"
@selection-change="TbaleSelectionChange4">
<el-table-column type="selection" width="55">
</el-table-column>
<template v-for="(item,index) in SpecificationList">
<el-table-column :key="index" :label="item.Name" width="100">
<template slot-scope="scope">
<span v-if="index==index2" v-for="(item2,index2) in scope.row.AttrList" :key="index2">
{{scope.row.AttrList[index2].SVName}}
</span>
</template>
</el-table-column>
</template>
<template v-for="(item,index) in huiyList">
<el-table-column :key="index" :label="item.Name">
<template slot-scope="scope">
<el-input v-model="scope.row.GradePriceList[index].MemberPrice" size="small"></el-input>
</template>
</el-table-column>
</template>
</el-table>
</div> </div>
</el-form-item> <el-table ref="table" :data="memberList2" border style="width: 100%"
@selection-change="TbaleSelectionChange4">
<el-table-column type="selection" width="55">
</el-table-column>
<template v-for="(item,index) in SpecificationList">
<el-table-column :key="index" :label="item.Name" width="100">
<template slot-scope="scope">
<span v-if="index==index2" v-for="(item2,index2) in scope.row.AttrList" :key="index2">
{{scope.row.AttrList[index2].SVName}}
</span>
</template>
</el-table-column>
</template>
<template v-for="(item,index) in huiyList">
<el-table-column :key="index" :label="item.Name">
<template slot-scope="scope">
<el-input v-model="scope.row.GradePriceList[index].MemberPrice" size="small"></el-input>
</template>
</el-table-column>
</template>
</el-table>
</div>
</el-form-item>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-form> </el-form>
...@@ -680,66 +676,64 @@ ...@@ -680,66 +676,64 @@
</div> </div>
<!-- 选择分类 --> <!-- 选择分类 -->
<el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px"> <el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px">
<el-row> <el-row>
<el-col :span="8" style="padding:0 10px;box-sizing:border-box"> <el-col :span="8" style="padding:0 10px;box-sizing:border-box">
<h3 style="padding:15px 0">一级分类</h3> <h3 style="padding:15px 0">一级分类</h3>
<div class="app-goods-cat-list active"> <div class="app-goods-cat-list active">
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
<div v-for="(item,index) in fenleiData" :key="index" flex="dir:left box:first" class="cat-item"> <div v-for="(item,index) in fenleiData" :key="index" flex="dir:left box:first" class="cat-item">
<el-checkbox :label="item.Id"> <el-checkbox :label="item.Id">
<span style="display: none;">{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
</el-checkbox> </el-checkbox>
<div flex="box:last cross:center"> <div flex="box:last cross:center">
<span>{{item.Name}}</span> <span>{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild2(item.ChildList)" class="el-icon-arrow-right"></i> <i v-if="item.ChildList.length>0" @click="getChild2(item.ChildList)" class="el-icon-arrow-right"></i>
</div>
</div>
</el-checkbox-group>
</div> </div>
</el-col> </div>
<el-col v-show="childList2.length>0" :span="8" style="padding:0 10px;box-sizing:border-box"> </el-checkbox-group>
<h3 style="padding:15px 0">二级分类</h3> </div>
<div class="app-goods-cat-list active"> </el-col>
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-col v-show="childList2.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<div v-for="(item,index) in childList2" :key="index" flex="dir:left box:first" class="cat-item"> <h3 style="padding:15px 0">二级分类</h3>
<el-checkbox :label="item.Id"> <div class="app-goods-cat-list active">
<span style="display: none;">{{item.Name}}</span> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
</el-checkbox> <div v-for="(item,index) in childList2" :key="index" flex="dir:left box:first" class="cat-item">
<div flex="box:last cross:center"> <el-checkbox :label="item.Id">
<span>{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild3(item.ChildList)" class="el-icon-arrow-right"></i> </el-checkbox>
</div> <div flex="box:last cross:center">
</div> <span>{{item.Name}}</span>
</el-checkbox-group> <i v-if="item.ChildList.length>0" @click="getChild3(item.ChildList)" class="el-icon-arrow-right"></i>
</div> </div>
</el-col> </div>
<el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box"> </el-checkbox-group>
<h3 style="padding:15px 0">三级分类</h3> </div>
<div class="app-goods-cat-list active"> </el-col>
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<div v-for="(item,index) in childList3" :key="index" flex="dir:left box:first" class="cat-item"> <h3 style="padding:15px 0">三级分类</h3>
<el-checkbox :label="item.Id"> <div class="app-goods-cat-list active">
<span style="display: none;">{{item.Name}}</span> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
</el-checkbox> <div v-for="(item,index) in childList3" :key="index" flex="dir:left box:first" class="cat-item">
<div flex="box:last cross:center"> <el-checkbox :label="item.Id">
<span>{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
<i class="el-icon-arrow-right"></i> </el-checkbox>
</div> <div flex="box:last cross:center">
</div> <span>{{item.Name}}</span>
</el-checkbox-group> <i class="el-icon-arrow-right"></i>
</div> </div>
</el-col> </div>
</el-row> </el-checkbox-group>
<div class="tag-box"> </div>
<el-tag @close="exitCheck(item)" v-for="(item,index) in addMsg.CategoryList" :key="index" type="warning" </el-col>
closable style="margin-right:5px">{{item.Name}}</el-tag> </el-row>
</div> <div class="tag-box">
<span slot="footer" class="dialog-footer"> <el-tag @close="exitCheck(item)" v-for="(item,index) in addMsg.CategoryList" :key="index" type="warning"
<el-button size="small" @click="flDig=false,addMsg.CategoryList=keepCategoryList,ExitCateList()">取 消</el-button> closable style="margin-right:5px">{{item.Name}}</el-tag>
<el-button @click="flDig = false,getSuggestPrice()" size="small" type="primary">确 定</el-button> </div>
</span> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="flDig=false,addMsg.CategoryList=keepCategoryList,ExitCateList()">取 消</el-button>
<el-button @click="flDig = false,getSuggestPrice()" size="small" type="primary">确 定</el-button>
</span>
</el-dialog> </el-dialog>
<!-- 查看图例 --> <!-- 查看图例 -->
<el-dialog title="查看自定义分享图片图例" :visible.sync="imgDig" width="30%"> <el-dialog title="查看自定义分享图片图例" :visible.sync="imgDig" width="30%">
...@@ -793,7 +787,6 @@ ...@@ -793,7 +787,6 @@
<el-radio-group v-model="val1"> <el-radio-group v-model="val1">
<el-radio @change="YfSelect1" style="padding-bottom:10px" class="yfradio" :label="{Name:'默认运费',Id:0}">默认表单 <el-radio @change="YfSelect1" style="padding-bottom:10px" class="yfradio" :label="{Name:'默认运费',Id:0}">默认表单
</el-radio> </el-radio>
<!-- <el-radio @change="YfSelect" style="padding-bottom:10px" class="yfradio" v-for="(item,index) in ruleList" :key="index" :label="item">{{item.RulesName}}</el-radio> -->
</el-radio-group> </el-radio-group>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -816,7 +809,6 @@ ...@@ -816,7 +809,6 @@
<div class="tpl-scrollbar el-scrollbar"> <div class="tpl-scrollbar el-scrollbar">
<el-checkbox @change="speciDigActive=index,changeCheckAll(item,index)" v-for="(item,index) in speciList" <el-checkbox @change="speciDigActive=index,changeCheckAll(item,index)" v-for="(item,index) in speciList"
v-model="item.checkAll" :key="index">{{item.Name}}</el-checkbox> v-model="item.checkAll" :key="index">{{item.Name}}</el-checkbox>
</div> </div>
</div> </div>
<div class="tpl-box" style="margin-left:10px"> <div class="tpl-box" style="margin-left:10px">
...@@ -860,7 +852,6 @@ ...@@ -860,7 +852,6 @@
SpecificationValueList: [], SpecificationValueList: [],
speciDig: false, speciDig: false,
speciList: [], speciList: [],
val2: '', val2: '',
defaultMsg: '', defaultMsg: '',
config: { config: {
...@@ -923,9 +914,8 @@ ...@@ -923,9 +914,8 @@
EnjoyMember: 1, EnjoyMember: 1,
SeparateSetMember: 2, SeparateSetMember: 2,
IsQuickBuy: 1, IsQuickBuy: 1,
FullNumPinkage:0, FullNumPinkage: 0,
FullMoneyPinkage:0, FullMoneyPinkage: 0,
}, },
fenleiData: [], fenleiData: [],
checkList: [], checkList: [],
...@@ -969,7 +959,6 @@ ...@@ -969,7 +959,6 @@
checkService: [], checkService: [],
keepServiceList: [], keepServiceList: [],
keepFreightId: -1, keepFreightId: -1,
ruleList: [], ruleList: [],
val: {}, val: {},
val1: {}, val1: {},
...@@ -998,33 +987,27 @@ ...@@ -998,33 +987,27 @@
gradeVal: '', gradeVal: '',
xxVal: '', xxVal: '',
xxList: [], xxList: [],
huiyList: [],
huiyList:[], memberList1: [{
memberList1:[ Id: 0,
{ SpecificationSort: '',
Id:0, GradePriceList: [],
SpecificationSort:'', }],
GradePriceList:[], memberList2: [],
} memberinput: '',
], memberVal: '',
memberList2:[], memberCheck: [],
imgListIndex1: 0,
memberinput:'', imgListIndex2: 0,
memberVal:'', NewCategoryList: [],
memberCheck:[], hpState: 0,
SuggestPriceInfo: {},
imgListIndex1:0,
imgListIndex2:0,
NewCategoryList:[],
hpState:0,
SuggestPriceInfo:{},
}; };
}, },
created() { created() {
if (this.$route.query.hpState) { if (this.$route.query.hpState) {
this.hpState = this.$route.query.hpState; this.hpState = this.$route.query.hpState;
} }
}, },
mounted() { mounted() {
this.$refs.ue.loadUe(); this.$refs.ue.loadUe();
...@@ -1038,50 +1021,48 @@ ...@@ -1038,50 +1021,48 @@
this.getSpeciList(); this.getSpeciList();
this.getDistributor(); this.getDistributor();
this.gethuiyList(); this.gethuiyList();
}, },
methods: { methods: {
// //
HySet(){ HySet() {
this.memberList2.forEach(item=>{ this.memberList2.forEach(item => {
this.memberCheck.forEach(check=>{ this.memberCheck.forEach(check => {
if(item.Id==check.Id){ if (item.Id == check.Id) {
item.GradePriceList.forEach(list1=>{ item.GradePriceList.forEach(list1 => {
if(list1.MemberGrade==this.memberVal){ if (list1.MemberGrade == this.memberVal) {
list1.MemberPrice=this.memberinput; list1.MemberPrice = this.memberinput;
} }
}) })
} }
}) })
}) })
}, },
TbaleSelectionChange4(val){ TbaleSelectionChange4(val) {
this.memberCheck=val; this.memberCheck = val;
}, },
gethuiyList(){ gethuiyList() {
let msg={ let msg = {
pageIndex:1, pageIndex: 1,
pageSize:999, pageSize: 999,
Grade:0, Grade: 0,
Name:'', Name: '',
Enabled:1, Enabled: 1,
}; };
this.apipost("/api/user/GetMemberGradePageList",msg, res => { this.apipost("/api/user/GetMemberGradePageList", msg, res => {
this.loading=false; this.loading = false;
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
let pageData=res.data.data.pageData; let pageData = res.data.data.pageData;
this.huiyList=pageData; this.huiyList = pageData;
this.huiyList.forEach(item=>{ this.huiyList.forEach(item => {
let obj={ let obj = {
Name:item.Name, Name: item.Name,
MemberGrade:item.Grade, MemberGrade: item.Grade,
MemberPrice:0, MemberPrice: 0,
}
this.memberList1[0].GradePriceList.push(obj);
})
} }
this.memberList1[0].GradePriceList.push(obj);
}) })
}
})
}, },
TbaleSelectionChange3(val) { TbaleSelectionChange3(val) {
this.xxList = val; this.xxList = val;
...@@ -1095,27 +1076,25 @@ ...@@ -1095,27 +1076,25 @@
this.Error("请选择层级!"); this.Error("请选择层级!");
return; return;
} }
this.disList2.forEach(item=>{ this.disList2.forEach(item => {
item.GradeCommissionList.forEach(grade=>{ item.GradeCommissionList.forEach(grade => {
this.xxList.forEach(list=>{ this.xxList.forEach(list => {
if(item.Id==list.Id){ if (item.Id == list.Id) {
if(grade.DistributorGrade==this.gradeVal){ if (grade.DistributorGrade == this.gradeVal) {
if(this.fxVal==1){ if (this.fxVal == 1) {
grade.OneCommission=this.xxVal; grade.OneCommission = this.xxVal;
} }
if(this.fxVal==2){ if (this.fxVal == 2) {
grade.TwoCommission=this.xxVal; grade.TwoCommission = this.xxVal;
} }
if(this.fxVal==3){ if (this.fxVal == 3) {
grade.ThreeCommission=this.xxVal; grade.ThreeCommission = this.xxVal;
} }
} }
}
}
})
}) })
})
}) })
}, },
PuSet() { PuSet() {
...@@ -1161,7 +1140,6 @@ ...@@ -1161,7 +1140,6 @@
} }
}) })
}) })
}, },
TbaleSelectionChange(val) { TbaleSelectionChange(val) {
this.ggplList = val; this.ggplList = val;
...@@ -1181,21 +1159,17 @@ ...@@ -1181,21 +1159,17 @@
); );
}, },
CheckBox(val) { CheckBox(val) {
}, },
butionType(val) { butionType(val) {
// this.skuList = [];
// this.getSkuData([], 0, this.SpecificationList);
}, },
// 删除规格模板 // 删除规格模板
DeleteggModule(item, index) { DeleteggModule(item, index) {
this.SpecificationList.splice(index, 1); this.SpecificationList.splice(index, 1);
if(this.SpecificationList.length==0){ if (this.SpecificationList.length == 0) {
this.addMsg.SeparateDistributionType=1; this.addMsg.SeparateDistributionType = 1;
} }
this.$forceUpdate(); this.$forceUpdate();
this.skuList = []; this.skuList = [];
this.getSkuData([], 0, this.SpecificationList); this.getSkuData([], 0, this.SpecificationList);
}, },
// 删除规格值 // 删除规格值
...@@ -1205,7 +1179,6 @@ ...@@ -1205,7 +1179,6 @@
if (this.SpecificationList[index].SpecificationValueList.length == 0) { if (this.SpecificationList[index].SpecificationValueList.length == 0) {
this.SpecificationList.splice(index, 1) this.SpecificationList.splice(index, 1)
} }
this.skuList = []; this.skuList = [];
this.getSkuData([], 0, this.SpecificationList); this.getSkuData([], 0, this.SpecificationList);
}, },
...@@ -1230,7 +1203,6 @@ ...@@ -1230,7 +1203,6 @@
Sort: that.SpecificationList.length Sort: that.SpecificationList.length
} }
this.SpecificationList.push(obj); this.SpecificationList.push(obj);
}, },
// 添加规格值 // 添加规格值
addGgz(item, index) { addGgz(item, index) {
...@@ -1272,7 +1244,7 @@ ...@@ -1272,7 +1244,7 @@
this.speciDig = false; this.speciDig = false;
}, },
getSkuData(skuArr = [], i, list) { getSkuData(skuArr = [], i, list) {
if(list[i]){ if (list[i]) {
for (let j = 0; j < list[i].SpecificationValueList.length; j++) { for (let j = 0; j < list[i].SpecificationValueList.length; j++) {
skuArr[i] = {}; skuArr[i] = {};
if (i < list.length - 1) { if (i < list.length - 1) {
...@@ -1289,7 +1261,6 @@ ...@@ -1289,7 +1261,6 @@
} }
} }
this.calcList(this.skuList, this.SpecificationList); this.calcList(this.skuList, this.SpecificationList);
}, },
calcList(list, calist) { calcList(list, calist) {
this.SpecificationPriceList = []; this.SpecificationPriceList = [];
...@@ -1332,15 +1303,13 @@ ...@@ -1332,15 +1303,13 @@
}; };
this.SpecificationPriceList.push(obj) this.SpecificationPriceList.push(obj)
arrList.push(obj1) arrList.push(obj1)
}) })
this.calcdis(JSON.parse(JSON.stringify(arrList))); this.calcdis(JSON.parse(JSON.stringify(arrList)));
}, },
calcdis(dislist) { calcdis(dislist) {
let memberList2=JSON.parse(JSON.stringify(dislist)) let memberList2 = JSON.parse(JSON.stringify(dislist))
dislist.forEach(item => { dislist.forEach(item => {
item.GradeCommissionList=[]; item.GradeCommissionList = [];
for (let i = 0; i < this.DropdownList.length; i++) { for (let i = 0; i < this.DropdownList.length; i++) {
let obj = { let obj = {
DistributorGrade: this.DropdownList[i].Id, DistributorGrade: this.DropdownList[i].Id,
...@@ -1353,11 +1322,11 @@ ...@@ -1353,11 +1322,11 @@
} }
}) })
memberList2.forEach(item => { memberList2.forEach(item => {
item.GradePriceList=[]; item.GradePriceList = [];
for (let i = 0; i < this.huiyList.length; i++) { for (let i = 0; i < this.huiyList.length; i++) {
let obj = { let obj = {
MemberGrade: this.huiyList[i].Grade, MemberGrade: this.huiyList[i].Grade,
MemberPrice:'', MemberPrice: '',
} }
item.GradePriceList.push(obj); item.GradePriceList.push(obj);
} }
...@@ -1393,11 +1362,11 @@ ...@@ -1393,11 +1362,11 @@
} else { } else {
this.addMsg.DistributionCommissionList = this.disList2; this.addMsg.DistributionCommissionList = this.disList2;
} }
if(this.addMsg.SeparateSetMember==1 && this.SpecificationList.length==0){ if (this.addMsg.SeparateSetMember == 1 && this.SpecificationList.length == 0) {
this.addMsg.MemberPriceList=this.memberList1; this.addMsg.MemberPriceList = this.memberList1;
} }
if(this.addMsg.SeparateSetMember==1 && this.SpecificationList.length>0){ if (this.addMsg.SeparateSetMember == 1 && this.SpecificationList.length > 0) {
this.addMsg.MemberPriceList=this.memberList2; this.addMsg.MemberPriceList = this.memberList2;
} }
this.addMsg.SpecificationPriceList = this.SpecificationPriceList; this.addMsg.SpecificationPriceList = this.SpecificationPriceList;
this.addMsg.SpecificationList = this.SpecificationList; this.addMsg.SpecificationList = this.SpecificationList;
...@@ -1408,7 +1377,6 @@ ...@@ -1408,7 +1377,6 @@
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}) })
} else { } else {
return false; return false;
...@@ -1476,7 +1444,6 @@ ...@@ -1476,7 +1444,6 @@
YfSelect(val) { YfSelect(val) {
this.addMsg.FreightId = val.ID; this.addMsg.FreightId = val.ID;
this.addMsg.FreightName = val.RulesName; this.addMsg.FreightName = val.RulesName;
}, },
ServiceCheck(item, index) { ServiceCheck(item, index) {
this.addMsg.ServiceList.forEach((list, k) => { this.addMsg.ServiceList.forEach((list, k) => {
...@@ -1496,16 +1463,14 @@ ...@@ -1496,16 +1463,14 @@
ClearCarouse(index) { ClearCarouse(index) {
this.addMsg.CarouselImageList.splice(index, 1); this.addMsg.CarouselImageList.splice(index, 1);
}, },
DeleteImageUrl(item,index,item2,index2){ DeleteImageUrl(item, index, item2, index2) {
this.SpecificationList[index].SpecificationValueList[index2].Image=''; this.SpecificationList[index].SpecificationValueList[index2].Image = '';
}, },
openggImg(item,index,item2,index2){ openggImg(item, index, item2, index2) {
this.changeState = true; this.changeState = true;
this.imgType = 3; this.imgType = 3;
this.imgListIndex1=index; this.imgListIndex1 = index;
this.imgListIndex2=index2; this.imgListIndex2 = index2;
}, },
openChangeDig(val) { openChangeDig(val) {
this.changeState = true; this.changeState = true;
...@@ -1515,20 +1480,18 @@ ...@@ -1515,20 +1480,18 @@
if (this.imgType == 1) { if (this.imgType == 1) {
let obj = { let obj = {
Id: msg.selectId, Id: msg.selectId,
Path: this.domainManager().ImageUrl+msg.url, Path: this.domainManager().ImageUrl + msg.url,
} }
this.addMsg.CarouselImageList.push(obj); this.addMsg.CarouselImageList.push(obj);
} }
if (this.imgType == 2) { if (this.imgType == 2) {
// this.addMsg.CustomShareImage = msg.selectId; this.addMsg.CustomShareImage = this.domainManager().ImageUrl + msg.url;
this.addMsg.CustomShareImage = this.domainManager().ImageUrl+msg.url;
// this.addMsg.CustomShareImagePath = this.domainManager().ImageUrl+msg.url;
} }
if (this.imgType == 3) { if (this.imgType == 3) {
let imgListIndex1=this.imgListIndex1; let imgListIndex1 = this.imgListIndex1;
let imgListIndex2=this.imgListIndex2; let imgListIndex2 = this.imgListIndex2;
this.SpecificationList[imgListIndex1].SpecificationValueList[imgListIndex2].Image=this.domainManager().ImageUrl+msg.url; this.SpecificationList[imgListIndex1].SpecificationValueList[imgListIndex2].Image = this.domainManager()
.ImageUrl + msg.url;
} }
this.changeState = false; this.changeState = false;
}, },
...@@ -1539,38 +1502,35 @@ ...@@ -1539,38 +1502,35 @@
getChild2(ChildList) { getChild2(ChildList) {
this.childList2 = ChildList; this.childList2 = ChildList;
}, },
ExitCateList(){ ExitCateList() {
this.NewCategoryList=[]; this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item=>{ this.addMsg.CategoryList.forEach(item => {
item.Name=item.CategoryName; item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId) this.NewCategoryList.push(item.CategoryId)
}) })
}, },
handleCheckChange() { handleCheckChange() {
this.addMsg.CategoryList=[]; this.addMsg.CategoryList = [];
this.NewCategoryList.forEach(list=>{ this.NewCategoryList.forEach(list => {
this.fenleiData.forEach(item => { this.fenleiData.forEach(item => {
if(list==item.Id){ if (list == item.Id) {
item.CategoryId=item.Id; item.CategoryId = item.Id;
this.addMsg.CategoryList.push(item) this.addMsg.CategoryList.push(item)
} }
item.ChildList.forEach(item2=>{ item.ChildList.forEach(item2 => {
if(list==item2.Id){ if (list == item2.Id) {
item2.CategoryId=item2.Id; item2.CategoryId = item2.Id;
this.addMsg.CategoryList.push(item2) this.addMsg.CategoryList.push(item2)
} }
item2.ChildList.forEach(item3=>{ item2.ChildList.forEach(item3 => {
if(list==item3.Id){ if (list == item3.Id) {
item3.CategoryId=item3.Id; item3.CategoryId = item3.Id;
this.addMsg.CategoryList.push(item3) this.addMsg.CategoryList.push(item3)
} }
})
})
}) })
})
}) })
console.log("this.addMsg.CategoryList",this.addMsg.CategoryList) })
}, },
exitCheck(item, index) { exitCheck(item, index) {
this.addMsg.CategoryList.forEach((list, k) => { this.addMsg.CategoryList.forEach((list, k) => {
...@@ -1596,15 +1556,14 @@ ...@@ -1596,15 +1556,14 @@
this.fenleiData = pageData; this.fenleiData = pageData;
this.fenleiData.forEach(item => { this.fenleiData.forEach(item => {
item.CategoryName = item.Name; item.CategoryName = item.Name;
item.ChildList.forEach(item2=>{ item.ChildList.forEach(item2 => {
item2.CategoryName = item2.Name; item2.CategoryName = item2.Name;
item2.ChildList.forEach(item3=>{ item2.ChildList.forEach(item3 => {
item3.CategoryName = item3.Name; item3.CategoryName = item3.Name;
})
}) })
})
}) })
} }
}) })
}, },
getData() { getData() {
...@@ -1612,12 +1571,11 @@ ...@@ -1612,12 +1571,11 @@
GoodsId: this.GoodsId GoodsId: this.GoodsId
}, res => { }, res => {
this.addMsg = res.data.data; this.addMsg = res.data.data;
console.log("this.addMsg",this.addMsg)
this.SpecificationPriceList = this.addMsg.SpecificationPriceList; this.SpecificationPriceList = this.addMsg.SpecificationPriceList;
this.SpecificationList = this.addMsg.SpecificationList; this.SpecificationList = this.addMsg.SpecificationList;
if (this.addMsg.SeparateDistributionType == 1) { if (this.addMsg.SeparateDistributionType == 1) {
this.disList1 = this.addMsg.DistributionCommissionTreeList; this.disList1 = this.addMsg.DistributionCommissionTreeList;
if(this.addMsg.DistributionCommissionTreeList.length>0){ if (this.addMsg.DistributionCommissionTreeList.length > 0) {
this.GradeCommissionList = this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList this.GradeCommissionList = this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList
} }
} }
...@@ -1630,38 +1588,35 @@ ...@@ -1630,38 +1588,35 @@
GradeCommissionList: this.GradeCommissionList GradeCommissionList: this.GradeCommissionList
}; };
this.disList1.push(objNew); this.disList1.push(objNew);
if(this.addMsg.GoodsDetails && this.addMsg.GoodsDetails!=''){ if (this.addMsg.GoodsDetails && this.addMsg.GoodsDetails != '') {
this.$refs.ue.SetVal(this.addMsg.GoodsDetails); this.$refs.ue.SetVal(this.addMsg.GoodsDetails);
} }
this.NewCategoryList=[]; this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item=>{ this.addMsg.CategoryList.forEach(item => {
item.Name=item.CategoryName; item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId) this.NewCategoryList.push(item.CategoryId)
}) })
this.getSuggestPrice() this.getSuggestPrice()
}) })
}, },
getSuggestPrice(){ getSuggestPrice() {
if(this.hpState==1 && Number(this.addMsg.CostPrice)>0){ if (this.hpState == 1 && Number(this.addMsg.CostPrice) > 0) {
let arr=[]; let arr = [];
this.addMsg.CategoryList.forEach(item=>{ this.addMsg.CategoryList.forEach(item => {
item.Name=item.CategoryName; item.Name = item.CategoryName;
arr.push(item.CategoryId) arr.push(item.CategoryId)
}) })
let CategoryIds=arr.join(','); let CategoryIds = arr.join(',');
let msg={ let msg = {
CategoryIds:CategoryIds, CategoryIds: CategoryIds,
CostPrice:this.addMsg.CostPrice CostPrice: this.addMsg.CostPrice
} }
this.apipost("/api/user/GetHpGoodsSuggestPrice", msg, res => { this.apipost("/api/user/GetHpGoodsSuggestPrice", msg, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.SuggestPriceInfo = res.data.data; this.SuggestPriceInfo = res.data.data;
console.log("this.SuggestPriceInfo",this.SuggestPriceInfo)
} }
}) })
} }
}, },
getRule() { getRule() {
let msg1 = { let msg1 = {
...@@ -1674,7 +1629,6 @@ ...@@ -1674,7 +1629,6 @@
let pageData = res.data.data.pageData; let pageData = res.data.data.pageData;
this.ruleList = pageData; this.ruleList = pageData;
} }
}) })
}, },
getService() { getService() {
...@@ -1690,7 +1644,6 @@ ...@@ -1690,7 +1644,6 @@
let pageData = res.data.data.pageData; let pageData = res.data.data.pageData;
this.serviceList = pageData; this.serviceList = pageData;
} }
}) })
}, },
getDistributor() { getDistributor() {
...@@ -1708,7 +1661,6 @@ ...@@ -1708,7 +1661,6 @@
} }
this.GetDropdownList(); this.GetDropdownList();
} }
}) })
}, },
GetDropdownList() { GetDropdownList() {
...@@ -1728,7 +1680,6 @@ ...@@ -1728,7 +1680,6 @@
Id: 0 Id: 0
} }
this.DropdownList.unshift(msg) this.DropdownList.unshift(msg)
this.disList1.GradeCommissionList = []; this.disList1.GradeCommissionList = [];
this.disList1.SpecificationSort = ""; this.disList1.SpecificationSort = "";
this.DropdownList.forEach(item => { this.DropdownList.forEach(item => {
...@@ -1745,7 +1696,7 @@ ...@@ -1745,7 +1696,7 @@
} }
}) })
this.DropdownList = JSON.parse(JSON.stringify(this.DropdownList)); this.DropdownList = JSON.parse(JSON.stringify(this.DropdownList));
if (!this.$route.query.GoodsId || this.addMsg.DistributionCommissionTreeList.length==0) { if (!this.$route.query.GoodsId || this.addMsg.DistributionCommissionTreeList.length == 0) {
this.GradeCommissionList = []; this.GradeCommissionList = [];
this.DropdownList.forEach(item => { this.DropdownList.forEach(item => {
let obj2 = { let obj2 = {
...@@ -1769,21 +1720,22 @@ ...@@ -1769,21 +1720,22 @@
}, },
}, },
}; };
</script> </script>
<style> <style>
.app-attr-group .close { .app-attr-group .close {
position: absolute; position: absolute;
top: -4px; top: -4px;
right: -4px; right: -4px;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
} }
.goodsListEdit .el-image { .goodsListEdit .el-image {
position: relative; position: relative;
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
} }
.goodsListEdit .pendSelect { .goodsListEdit .pendSelect {
width: 100px; width: 100px;
} }
...@@ -1906,7 +1858,7 @@ ...@@ -1906,7 +1858,7 @@
position: absolute; position: absolute;
right: -8px; right: -8px;
top: -8px; top: -8px;
padding: 4px 4px!important; padding: 4px 4px !important;
} }
.goodsListEdit .add-image-btn { .goodsListEdit .add-image-btn {
......
...@@ -695,17 +695,6 @@ ...@@ -695,17 +695,6 @@
this.Info(res.data.message); this.Info(res.data.message);
} }
}) })
},
//修改版权
TestMall() {
this.apipost("/api/Mall/GetHome",{MiniAppId:"wxacd9f8cc3480d29e"}, res => {
console.log("res",res);
if (res.data.resultCode == 1) {
} else {
this.Info(res.data.message);
}
})
}, },
//跳转至首页 //跳转至首页
goHomePage(){ goHomePage(){
...@@ -718,7 +707,6 @@ ...@@ -718,7 +707,6 @@
} }
}, },
mounted() { mounted() {
this.TestMall();
this.init(); this.init();
this.getMiniPrograme(); this.getMiniPrograme();
this.getRemoveMiniPrograme(); this.getRemoveMiniPrograme();
......
...@@ -5,144 +5,135 @@ ...@@ -5,144 +5,135 @@
</div> </div>
<div class="content"> <div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:60%"> <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:60%">
<el-form-item label="分销名称" prop="Name">
<el-form-item label="分销名称" prop="Name"> <el-input v-model="addMsg.Name" size="small"></el-input>
<el-input v-model="addMsg.Name" size="small"></el-input> </el-form-item>
</el-form-item> <el-form-item label="返佣小数类型" prop="DecimalType">
<el-form-item label="返佣小数类型" prop="DecimalType"> <el-radio v-model="addMsg.DecimalType" :label="1">整数</el-radio>
<el-radio v-model="addMsg.DecimalType" :label="1">整数</el-radio> <el-radio v-model="addMsg.DecimalType" :label="2">保留2位小数</el-radio>
<el-radio v-model="addMsg.DecimalType" :label="2">保留2位小数</el-radio> </el-form-item>
</el-form-item> <el-form-item label="是否启用" prop="Enabled">
<el-form-item label="是否启用" prop="Enabled"> <el-radio v-model="addMsg.Enabled" :label="1"></el-radio>
<el-radio v-model="addMsg.Enabled" :label="1"></el-radio> <el-radio v-model="addMsg.Enabled" :label="2"></el-radio>
<el-radio v-model="addMsg.Enabled" :label="2"></el-radio> </el-form-item>
</el-form-item> <el-form-item label="等级">
<el-form-item label="等级"> <el-button @click="gradeDig=true" size="small" type="primary" style="margin-bottom:10px">选择等级</el-button>
<el-button @click="gradeDig=true" size="small" type="primary" style="margin-bottom:10px">选择等级</el-button> <el-table :data="addMsg.RatioList" border style="width: 100%">
<el-table <el-table-column prop="GradeName" label="名称">
:data="addMsg.RatioList" </el-table-column>
border <el-table-column prop="address" label="比例">
style="width: 100%"> <template slot-scope="scope">
<el-table-column <el-input @input="inputVal(scope.row)" type="number" min="1" v-model="scope.row.CommissionRatio"
prop="GradeName" size="small" placeholder="请输入">
label="名称"> <el-button slot="append">%</el-button>
</el-table-column> </el-input>
<el-table-column </template>
prop="address" </el-table-column>
label="比例"> <el-table-column width="80px" prop="address" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input @input="inputVal(scope.row)" type="number" min="1" v-model="scope.row.CommissionRatio" size="small" placeholder="请输入"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<el-button slot="append">%</el-button> <img @click="Delete(scope.row,scope.$index)" style="width:32px;height:32px;margin:0 10px"
</el-input> src="../../assets/img/userman/del.png" alt="">
</template> </el-tooltip>
</el-table-column> </template>
<el-table-column </el-table-column>
width="80px" </el-table>
prop="address" </el-form-item>
label="操作"> <el-form-item label="分类">
<template slot-scope="scope"> <template v-if="addMsg.CategoryList && addMsg.CategoryList.length>0">
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tag type="warning" style="margin-right:10px;" @close="exitCheck(item,index)"
<img @click="Delete(scope.row,scope.$index)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt=""> v-for="(item,index) in addMsg.CategoryList" :key="index" closable>
</el-tooltip> {{item.CategoryName}}
</template> </el-tag>
</el-table-column> </template>
</el-table> <el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList" style="margin:0 10px;"
</el-form-item> size="small">选择分类</el-button>
<el-form-item label="分类"> </el-form-item>
<template v-if="addMsg.CategoryList && addMsg.CategoryList.length>0"> </el-form>
<el-tag type="warning" style="margin-right:10px;" @close="exitCheck(item,index)"
v-for="(item,index) in addMsg.CategoryList" :key="index" closable>
{{item.CategoryName}}
</el-tag>
</template>
<el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList"
style="margin:0 10px;" size="small">选择分类</el-button>
</el-form-item>
</el-form>
</div> </div>
<div style="margin-top:20px"> <div style="margin-top:20px">
<el-button size="small" type="primary" @click="Save('addMsg')">保存</el-button> <el-button size="small" type="primary" @click="Save('addMsg')">保存</el-button>
</div> </div>
<!-- 选择分类 --> <!-- 选择分类 -->
<el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px"> <el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px">
<el-row> <el-row>
<el-col :span="8" style="padding:0 10px;box-sizing:border-box"> <el-col :span="8" style="padding:0 10px;box-sizing:border-box">
<h3 style="padding:15px 0">一级分类</h3> <h3 style="padding:15px 0">一级分类</h3>
<div class="app-goods-cat-list active"> <div class="app-goods-cat-list active">
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
<div v-for="(item,index) in fenleiData" :key="index" flex="dir:left box:first" class="cat-item"> <div v-for="(item,index) in fenleiData" :key="index" flex="dir:left box:first" class="cat-item">
<el-checkbox :label="item.Id"> <el-checkbox :label="item.Id">
<span style="display: none;">{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
</el-checkbox> </el-checkbox>
<div flex="box:last cross:center"> <div flex="box:last cross:center">
<span>{{item.Name}}</span> <span>{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild2(item.ChildList)" class="el-icon-arrow-right"></i> <i v-if="item.ChildList.length>0" @click="getChild2(item.ChildList)" class="el-icon-arrow-right"></i>
</div>
</div>
</el-checkbox-group>
</div> </div>
</el-col> </div>
<el-col v-show="childList2.length>0" :span="8" style="padding:0 10px;box-sizing:border-box"> </el-checkbox-group>
<h3 style="padding:15px 0">二级分类</h3> </div>
<div class="app-goods-cat-list active"> </el-col>
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-col v-show="childList2.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<div v-for="(item,index) in childList2" :key="index" flex="dir:left box:first" class="cat-item"> <h3 style="padding:15px 0">二级分类</h3>
<el-checkbox :label="item.Id"> <div class="app-goods-cat-list active">
<span style="display: none;">{{item.Name}}</span> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
</el-checkbox> <div v-for="(item,index) in childList2" :key="index" flex="dir:left box:first" class="cat-item">
<div flex="box:last cross:center"> <el-checkbox :label="item.Id">
<span>{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild3(item.ChildList)" class="el-icon-arrow-right"></i> </el-checkbox>
</div> <div flex="box:last cross:center">
</div> <span>{{item.Name}}</span>
</el-checkbox-group> <i v-if="item.ChildList.length>0" @click="getChild3(item.ChildList)" class="el-icon-arrow-right"></i>
</div> </div>
</el-col> </div>
<el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box"> </el-checkbox-group>
<h3 style="padding:15px 0">三级分类</h3> </div>
<div class="app-goods-cat-list active"> </el-col>
<el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange"> <el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<div v-for="(item,index) in childList3" :key="index" flex="dir:left box:first" class="cat-item"> <h3 style="padding:15px 0">三级分类</h3>
<el-checkbox :label="item.Id"> <div class="app-goods-cat-list active">
<span style="display: none;">{{item.Name}}</span> <el-checkbox-group v-model="NewCategoryList" @change="handleCheckChange">
</el-checkbox> <div v-for="(item,index) in childList3" :key="index" flex="dir:left box:first" class="cat-item">
<div flex="box:last cross:center"> <el-checkbox :label="item.Id">
<span>{{item.Name}}</span> <span style="display: none;">{{item.Name}}</span>
<i class="el-icon-arrow-right"></i> </el-checkbox>
</div> <div flex="box:last cross:center">
</div> <span>{{item.Name}}</span>
</el-checkbox-group> <i class="el-icon-arrow-right"></i>
</div> </div>
</el-col> </div>
</el-row> </el-checkbox-group>
<div class="tag-box"> </div>
<el-tag @close="exitCheck(item)" v-for="(item,index) in addMsg.CategoryList" :key="index" type="warning" </el-col>
closable style="margin-right:5px">{{item.Name}}</el-tag> </el-row>
</div> <div class="tag-box">
<span slot="footer" class="dialog-footer"> <el-tag @close="exitCheck(item)" v-for="(item,index) in addMsg.CategoryList" :key="index" type="warning"
<el-button size="small" @click="flDig=false,addMsg.CategoryList=keepCategoryList,ExitCateList()">取 消</el-button> closable style="margin-right:5px">{{item.Name}}</el-tag>
<el-button @click="flDig = false" size="small" type="primary">确 定</el-button> </div>
</span> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="flDig=false,addMsg.CategoryList=keepCategoryList,ExitCateList()">取 消</el-button>
<el-button @click="flDig = false" size="small" type="primary">确 定</el-button>
</span>
</el-dialog> </el-dialog>
<!-- 选择等级 --> <!-- 选择等级 -->
<el-dialog title="选择等级" :visible.sync="gradeDig" width="510px"> <el-dialog title="选择等级" :visible.sync="gradeDig" width="510px">
<div style="box-sizing: border-box;background-color: #F3F5F6;width: 100%;padding-left: 20px;height: 50px;line-height: 50px;"> <div
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选 style="box-sizing: border-box;background-color: #F3F5F6;width: 100%;padding-left: 20px;height: 50px;line-height: 50px;">
</el-checkbox> <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
</div> </el-checkbox>
<div style="margin: 15px 0;"></div> </div>
<div style="padding: 10px 25px 20px;"> <div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange"> <div style="padding: 10px 25px 20px;">
<el-checkbox style="margin-bottom:10px;width:110px" v-for="city in cities" :label="city.Id" :key="city.GradeName"> <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
{{city.GradeName}}</el-checkbox> <el-checkbox style="margin-bottom:10px;width:110px" v-for="city in cities" :label="city.Id"
</el-checkbox-group> :key="city.GradeName">
</div> {{city.GradeName}}</el-checkbox>
<span slot="footer" class="dialog-footer"> </el-checkbox-group>
<el-button size="small" @click="gradeDig = false">取 消</el-button> </div>
<el-button size="small" type="primary" @click="chooseGrade">确 定</el-button> <span slot="footer" class="dialog-footer">
</span> <el-button size="small" @click="gradeDig = false">取 消</el-button>
<el-button size="small" type="primary" @click="chooseGrade">确 定</el-button>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -155,15 +146,15 @@ ...@@ -155,15 +146,15 @@
cities: [], cities: [],
cityOptions: [], cityOptions: [],
isIndeterminate: true, isIndeterminate: true,
gradeDig:false, gradeDig: false,
flDig:false, flDig: false,
addMsg: { addMsg: {
Id: 0, Id: 0,
DecimalType: 2, DecimalType: 2,
Name: '', Name: '',
Enabled:2, Enabled: 2,
RatioList:[], RatioList: [],
CategoryList:[], CategoryList: [],
}, },
rules: { rules: {
Name: [{ Name: [{
...@@ -171,233 +162,226 @@ ...@@ -171,233 +162,226 @@
message: '请输入分销名称', message: '请输入分销名称',
trigger: 'blur' trigger: 'blur'
}], }],
DecimalType: [ DecimalType: [{
{ required: true, message: '请选择类型', trigger: 'change' } required: true,
], message: '请选择类型',
Enabled: [ trigger: 'change'
{ required: true, message: '请选择是否启用', trigger: 'change' } }],
], Enabled: [{
required: true,
message: '请选择是否启用',
trigger: 'change'
}],
}, },
GradeId: '', GradeId: '',
loading: false, loading: false,
gradeList: [], gradeList: [],
fenleiData:[], fenleiData: [],
checkList: [], checkList: [],
childList2: [], childList2: [],
childList3: [], childList3: [],
keepCategoryList: [], keepCategoryList: [],
HpGradeList:[], HpGradeList: [],
NewCategoryList:[], NewCategoryList: [],
}; };
}, },
created() { created() {
this.getTree(); this.getTree();
this.getHpDistributorGrade(); this.getHpDistributorGrade();
}, },
methods: { methods: {
inputVal(row){ inputVal(row) {
if(Number(row.CommissionRatio)<0){ if (Number(row.CommissionRatio) < 0) {
row.CommissionRatio=1; row.CommissionRatio = 1;
} }
if(Number(row.CommissionRatio)>100){ if (Number(row.CommissionRatio) > 100) {
row.CommissionRatio=100; row.CommissionRatio = 100;
} }
}, },
Delete(item,index){ Delete(item, index) {
this.addMsg.RatioList.splice(index, 1); this.addMsg.RatioList.splice(index, 1);
this.checkedCities.forEach((list,k)=>{ this.checkedCities.forEach((list, k) => {
if(list==item.GradeId){ if (list == item.GradeId) {
this.checkedCities.splice(k, 1); this.checkedCities.splice(k, 1);
} }
}) })
}, },
chooseGrade(){ chooseGrade() {
let arr=[]; let arr = [];
this.addMsg.RatioList=[]; this.addMsg.RatioList = [];
this.cities.forEach(item=>{ this.cities.forEach(item => {
this.checkedCities.forEach(list=>{ this.checkedCities.forEach(list => {
if(item.Id==list){ if (item.Id == list) {
let Obj={ let Obj = {
Grade:item.Grade, Grade: item.Grade,
GradeId:item.Id, GradeId: item.Id,
CommissionRatio:'', CommissionRatio: '',
GradeName:item.GradeName, GradeName: item.GradeName,
} }
arr.push(Obj); arr.push(Obj);
}
})
})
let list=arr.sort(this.compareGrade("Grade",true));
this.addMsg.RatioList=list;
this.gradeDig=false;
},
compareGrade(property,desc) {
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
if(desc==true){
// 升序排列
return value1 - value2;
}else{
// 降序排列
return value2 - value1;
}
}
},
handleCheckAllChange(val) {
this.checkedCities = val ? this.cityOptions : [];
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
},
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.RatioList.length==0){
this.Error("请选择返佣等级!");
return;
}
this.apipost("/api/user/SetHpDistributorInfo", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('PeaceDistribution');
} else {
this.Error(res.data.message);
}
})
} else {
return false;
} }
}); })
}, })
ExitCateList(){ let list = arr.sort(this.compareGrade("Grade", true));
this.NewCategoryList=[]; this.addMsg.RatioList = list;
this.addMsg.CategoryList.forEach(item=>{ this.gradeDig = false;
item.Name=item.CategoryName; },
this.NewCategoryList.push(item.CategoryId) compareGrade(property, desc) {
}) return function (a, b) {
}, var value1 = a[property];
handleCheckChange() { var value2 = b[property];
this.addMsg.CategoryList=[]; if (desc == true) {
this.NewCategoryList.forEach(list=>{ // 升序排列
this.fenleiData.forEach(item => { return value1 - value2;
if(list==item.Id){ } else {
item.CategoryId=item.Id; // 降序排列
this.addMsg.CategoryList.push(item) return value2 - value1;
} }
item.ChildList.forEach(item2=>{ }
if(list==item2.Id){ },
item2.CategoryId=item2.Id; handleCheckAllChange(val) {
this.addMsg.CategoryList.push(item2) this.checkedCities = val ? this.cityOptions : [];
} this.isIndeterminate = false;
item2.ChildList.forEach(item3=>{ },
if(list==item3.Id){ handleCheckedCitiesChange(value) {
item3.CategoryId=item3.Id; let checkedCount = value.length;
this.addMsg.CategoryList.push(item3) this.checkAll = checkedCount === this.cities.length;
} this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
},
})
}) Save(formName) {
}) this.$refs[formName].validate((valid) => {
}) if (valid) {
console.log("this.addMsg.CategoryList",this.addMsg.CategoryList) if (this.addMsg.RatioList.length == 0) {
}, this.Error("请选择返佣等级!");
exitCheck(item, index) { return;
this.addMsg.CategoryList.forEach((list, k) => {
if (list.Id == item.Id) {
this.addMsg.CategoryList.splice(k, 1);
} }
this.apipost("/api/user/SetHpDistributorInfo", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('PeaceDistribution');
} else {
this.Error(res.data.message);
}
}) })
this.ExitCateList(); } else {
}, return false;
getChild3(ChildList) { }
this.childList3 = ChildList; });
}, },
getChild2(ChildList) { ExitCateList() {
this.childList2 = ChildList; this.NewCategoryList = [];
}, this.addMsg.CategoryList.forEach(item => {
getTree() { item.Name = item.CategoryName;
let msg1 = { this.NewCategoryList.push(item.CategoryId)
Id: 0, })
Name: '', },
Tier: 0, handleCheckChange() {
ParentId: 0, this.addMsg.CategoryList = [];
Enabled: 1, this.NewCategoryList.forEach(list => {
IsShow: 1, this.fenleiData.forEach(item => {
} if (list == item.Id) {
this.apipost("/api/product/GetProductCategoryTreeList", msg1, res => { item.CategoryId = item.Id;
if (res.data.resultCode == 1) { this.addMsg.CategoryList.push(item)
let pageData = res.data.data;
this.fenleiData = pageData;
this.fenleiData.forEach(item => {
item.CategoryName = item.Name;
item.ChildList.forEach(item2=>{
item2.CategoryName = item2.Name;
item2.ChildList.forEach(item3=>{
item3.CategoryName = item3.Name;
})
})
})
} }
item.ChildList.forEach(item2 => {
}) if (list == item2.Id) {
}, item2.CategoryId = item2.Id;
getHpDistributorGrade() { this.addMsg.CategoryList.push(item2)
this.cityOptions = []; }
this.apipost("/api/user/GetHpDistributorGradeList", {}, res => { item2.ChildList.forEach(item3 => {
this.cities = res.data.data; if (list == item3.Id) {
let data = res.data.data; item3.CategoryId = item3.Id;
data.forEach(item => { this.addMsg.CategoryList.push(item3)
this.cityOptions.push(item.Id)
})
if (this.$route.query.UserId) {
this.GradeId = this.$route.query.UserId;
this.getData()
} }
})
}) })
}, })
getData() { })
this.loading = true; },
this.apipost("/api/user/GetHpdistributorInfo", { exitCheck(item, index) {
CommissionId: this.GradeId this.addMsg.CategoryList.forEach((list, k) => {
}, res => { if (list.Id == item.Id) {
this.loading = false; this.addMsg.CategoryList.splice(k, 1);
this.addMsg = res.data.data; }
this.NewCategoryList=[]; })
this.addMsg.CategoryList.forEach(item=>{ this.ExitCateList();
item.Name=item.CategoryName; },
this.NewCategoryList.push(item.CategoryId) getChild3(ChildList) {
this.childList3 = ChildList;
},
getChild2(ChildList) {
this.childList2 = ChildList;
},
getTree() {
let msg1 = {
Id: 0,
Name: '',
Tier: 0,
ParentId: 0,
Enabled: 1,
IsShow: 1,
}
this.apipost("/api/product/GetProductCategoryTreeList", msg1, res => {
if (res.data.resultCode == 1) {
let pageData = res.data.data;
this.fenleiData = pageData;
this.fenleiData.forEach(item => {
item.CategoryName = item.Name;
item.ChildList.forEach(item2 => {
item2.CategoryName = item2.Name;
item2.ChildList.forEach(item3 => {
item3.CategoryName = item3.Name;
}) })
this.checkedCities=[]; })
this.addMsg.RatioList.forEach(item=>{
this.cities.forEach(list=>{
if(item.GradeId==list.Id){
this.checkedCities.push(list.Id);
}
})
})
//
}) })
}, }
})
},
getHpDistributorGrade() {
this.cityOptions = [];
this.apipost("/api/user/GetHpDistributorGradeList", {}, res => {
this.cities = res.data.data;
let data = res.data.data;
data.forEach(item => {
this.cityOptions.push(item.Id)
})
if (this.$route.query.UserId) {
this.GradeId = this.$route.query.UserId;
this.getData()
}
})
},
getData() {
this.loading = true;
this.apipost("/api/user/GetHpdistributorInfo", {
CommissionId: this.GradeId
}, res => {
this.loading = false;
this.addMsg = res.data.data;
this.NewCategoryList = [];
this.addMsg.CategoryList.forEach(item => {
item.Name = item.CategoryName;
this.NewCategoryList.push(item.CategoryId)
})
this.checkedCities = [];
this.addMsg.RatioList.forEach(item => {
this.cities.forEach(list => {
if (item.GradeId == list.Id) {
this.checkedCities.push(list.Id);
}
})
})
})
},
}, },
mounted() { mounted() {
} }
}; };
</script> </script>
<style> <style>
.app-add-cat .el-checkbox-group { .app-add-cat .el-checkbox-group {
font-size: 14px !important; font-size: 14px !important;
} }
...@@ -434,6 +418,7 @@ ...@@ -434,6 +418,7 @@
overflow: scroll; overflow: scroll;
height: 400px; height: 400px;
} }
.usersListEdit .tip { .usersListEdit .tip {
margin-left: 10px; margin-left: 10px;
display: inline-block; display: inline-block;
......
...@@ -1237,7 +1237,6 @@ ...@@ -1237,7 +1237,6 @@
//点击保存 //点击保存
SaveData() { SaveData() {
this.addMsg.ComponentDataList = this.dataList; this.addMsg.ComponentDataList = this.dataList;
console.log("this.addMsg",this.addMsg);
this.apipost("/api/Template/SetMiniTemplate", this.addMsg, res => { this.apipost("/api/Template/SetMiniTemplate", this.addMsg, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.addMsg.Id = res.data.data; this.addMsg.Id = res.data.data;
......
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