Commit d8959c7f authored by zhengke's avatar zhengke

修改

parent 75d09d96
......@@ -9,12 +9,9 @@
</div>
<div class="content">
<div>
<span>素材类型</span>
<div style="display:inline-block;">
<el-input type="text" size="small" v-model="msg.CateId">
<el-button slot="append" @click="CateDialog=true,isSearch=1">选择分类</el-button>
</el-input>
</div>
<el-button @click="CateDialog=true,isSearch=1" style="margin-right:10px;" size="small">分类筛选</el-button>
<el-button v-show="msg.CateId>0" @click="msg.CateId=0,msg.pageIndex=1,getList()" type="danger"
style="margin-right:10px;" size="small">清除分类</el-button>
<span style="margin-left:10px;">添加时间</span>
<el-date-picker size="small" class="indataPicker" type="daterange" v-model="dateStr" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd">
......@@ -35,20 +32,22 @@
</el-table-column>
<el-table-column label="分类名称" width="150">
<template slot-scope="scope">
<el-tag v-for="tag in scope.row.CateList" size="small" :key="tag.Id">
<el-tag v-for="tag in scope.row.CateList" style="margin-bottom:3px;" size="small" :key="tag.Id">
{{tag.Name}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="发圈文案" width="300">
<template slot-scope="scope">
{{scope.row.MaterialInfo}}<img @click="getMaterInfo(scope.row)" style="margin-left:3px;" src="../../assets/img/userman/edit1.png" alt="">
{{scope.row.MaterialInfo}}<img @click="getMaterInfo(scope.row)" style="margin-left:3px;"
src="../../assets/img/userman/edit1.png" alt="">
</template>
</el-table-column>
<el-table-column prop="MaterialImg" label="图片视频" width="300">
<template slot-scope="scope">
<div flex="dir:left" style="flex-wrap: wrap;">
<div style="width:80px;height:80px;margin-right:5px;" v-for="(item,index) in scope.row.ImgList" :key="index">
<div style="width:80px;height:80px;margin-right:5px;" v-for="(item,index) in scope.row.ImgList"
:key="index">
<img style="width:100%;height:100%;" :src="item" />
</div>
</div>
......@@ -100,6 +99,10 @@
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:page-size="msg.pageSize" layout="prev, pager, next" :current-page.sync="msg.pageIndex" :total="msg.total">
</el-pagination>
</div>
</template>
<template v-else>
......@@ -110,8 +113,19 @@
<div class="content">
<div class="conten_indder">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px">
<el-form-item label="一级分类" v-if="LevelOne">
<span>{{LevelOne}}</span>
</el-form-item>
<el-form-item label="二级分类" v-if="LevelTwo">
<span>{{LevelTwo}}</span>
</el-form-item>
<el-form-item label="分类编号">
<el-input type="text" size="small" :disabled="true" v-model="addMsg.CateId">
<el-button slot="append" @click="CateDialog=true,isSearch=-1">选择分类</el-button>
</el-input>
</el-form-item>
<el-form-item label="选择商品">
<el-button type="text">({{addMsg.GoodsId}}){{addMsg.GoodsName}}</el-button>
<el-button type="text" v-if="addMsg.GoodsId>0">({{addMsg.GoodsId}}){{addMsg.GoodsName}}</el-button>
<el-button type="text" @click="isShowGoods=true">选择商品</el-button>
</el-form-item>
<el-form-item label="动态文案" prop="MaterialInfo">
......@@ -167,17 +181,6 @@
<el-input type="text" size="small" v-model="addMsg.SortNum"
@keyup.native="checkInteger(addMsg,'SortNum')"></el-input>
</el-form-item>
<el-form-item label="一级分类" v-if="LevelOne">
<span>{{LevelOne}}</span>
</el-form-item>
<el-form-item label="二级分类" v-if="LevelTwo">
<span>{{LevelTwo}}</span>
</el-form-item>
<el-form-item label="分类编号">
<el-input type="text" size="small" v-model="addMsg.CateId">
<el-button slot="append" @click="CateDialog=true,isSearch=-1">选择分类</el-button>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
......@@ -251,7 +254,7 @@
CateId: 0, //分类编号
GoodsId: 0, //商品编号
CoverImg: "", //封面图
GoodsName:'',
GoodsName: '',
MaterialInfo: "", //素材文案
LinkUrl: "", //链接地址
IsTop: 0, //是否置顶
......@@ -266,16 +269,16 @@
trigger: "change"
}]
},
CateDialog:false, //选择分类弹窗
LevelOne:'', //一级分类
LevelTwo:'', //二级分类
isSearch:-1, //判断选择查询还是新增的
CateDialog: false, //选择分类弹窗
LevelOne: '', //一级分类
LevelTwo: '', //二级分类
isSearch: -1, //判断选择查询还是新增的
isShowGoods:false, //选择商品弹窗
isShowText:false , //发圈文案弹窗
updateTextInfo:{
Id:0,
MaterialInfo:''
isShowGoods: false, //选择商品弹窗
isShowText: false, //发圈文案弹窗
updateTextInfo: {
Id: 0,
MaterialInfo: ''
}
};
},
......@@ -296,11 +299,18 @@
if (res.data.resultCode === 1) {
this.dataList = res.data.data.pageData;
this.msg.total = res.data.data.count;
} else {
this.Error(res.data.message);
}
},
null
);
},
//翻页
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
//新增修改分类
submitForm(formName) {
this.$refs[formName].validate((valid) => {
......@@ -435,14 +445,14 @@
null
);
},
getMaterInfo(item){
this.isShowText=true;
getMaterInfo(item) {
this.isShowText = true;
this.updateTextInfo.Id = item.Id;
this.updateTextInfo.MaterialInfo = item.MaterialInfo;
},
//更新文案
updateMaterialInfo() {
if(this.updateTextInfo.MaterialInfo==''){
if (this.updateTextInfo.MaterialInfo == '') {
this.Error('请输入文案内容');
}
this.apipost("/api/Share/SetShareFriendMaterialInfo", this.updateTextInfo,
......@@ -450,7 +460,7 @@
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.getList();
this.isShowText=false;
this.isShowText = false;
} else {
this.Error(res.data.message);
}
......@@ -477,34 +487,39 @@
this.addMsg.ImgList.splice(index, 1);
},
//选择分类
getCkedMater(){
getCkedMater() {
var obj = this.$refs.choiceMater.getMaterial();
if(this.isSearch==1){
this.msg.CateId = obj.Id
}else{
this.LevelOne='';
this.LevelTwo='';
if(obj.Level==1){
this.LevelOne=obj.Name;
if (JSON.stringify(obj) != "{}") {
//列表查询页选择
if (this.isSearch == 1) {
this.msg.CateId = obj.Id;
this.getList();
} else {
this.LevelOne = '';
this.LevelTwo = '';
if (obj.Level == 1) {
this.LevelOne = obj.Name;
}
if(obj.Level==2){
this.LevelOne=obj.LevelOne;
this.LevelTwo=obj.Name;
if (obj.Level == 2) {
this.LevelOne = obj.LevelOne;
this.LevelTwo = obj.Name;
}
if(obj.Level==3){
this.LevelOne=obj.LevelOne;
this.LevelTwo=obj.LevelTwo;
if (obj.Level == 3) {
this.LevelOne = obj.LevelOne;
this.LevelTwo = obj.LevelTwo;
}
this.addMsg.CateId = obj.Id;
}
this.CateDialog=false;
}
this.CateDialog = false;
this.$refs.choiceMater.toggleSelection();
},
//选择商品
getGoodsChoice() {
this.addMsg.ImgList=[];
this.addMsg.ImgList = [];
var chooseGoods = this.$refs.choiceGood.getChoicedGoods();
if(chooseGoods&&chooseGoods[0].CarouselImageList.length>0){
chooseGoods[0].CarouselImageList.forEach(x=>{
if (chooseGoods && chooseGoods[0].CarouselImageList.length > 0) {
chooseGoods[0].CarouselImageList.forEach(x => {
this.addMsg.ImgList.push(x.Path);
})
}
......
......@@ -48,7 +48,6 @@
if (res.data.resultCode == 1) {
var dataArray = res.data.data;
this.dataList = dataArray;
console.log(this.dataList,'dataList');
} else {
this.Error(res.data.message);
}
......@@ -97,7 +96,10 @@
}
return this.checkedObj;
},
//清空多选方法
toggleSelection(rows) {
this.$refs.tree.setCheckedKeys([])
},
},
mounted() {
this.getList();
......
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