Commit 238210fe authored by anxixi's avatar anxixi

pc发布活动及列表查询

parent 9f21210e
......@@ -20,6 +20,7 @@
"es6-promise": "^4.2.8",
"exif-js": "^2.3.0",
"html2canvas": "^1.0.0-rc.3",
"i": "^0.3.6",
"image-conversion": "^1.1.9",
"jquery": "^3.4.1",
"js-base64": "^2.5.1",
......@@ -34,9 +35,11 @@
"vue-cropper": "^0.4.9",
"vue-i18n": "^8.14.0",
"vue-qrcode-component": "^2.1.1",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3",
"vue-select": "^3.1.0",
"vuex": "^3.0.1"
"vuex": "^3.0.1",
"wangeditor": "^3.1.1"
},
"devDependencies": {
"@babel/polyfill": "^7.4.4",
......
......@@ -527,6 +527,21 @@ export default new Router({
component: resolve => require(['./views/innovatecompany/seeservice/servicedetails.vue'], resolve),
meta: {title: '销售服务记录详情'}
},
{
path: '/proactivity',
component: resolve => require(['./views/publishactivity/pubactivities.vue'], resolve),
meta: {title: '活动'}
},
{
path: '/newtemplate',
component: resolve => require(['./views/publishactivity/newtemplate.vue'], resolve),
meta: {title: '活动模板'}
},
{
path: '/addproactivity',
component: resolve => require(['./views/publishactivity/proactivity.vue'], resolve),
meta: {title: '发布活动'}
},
]
},
{
......
<template>
<div style="display: flex;width: 80%;flex-wrap:wrap;">
<div class="contactscss" :class="item.state?'':'iscontactscss'" v-for="item in fielddata" @click="contactsclk(item)">
{{item.fieldName}}
<div class="images" :class="item.state?'':'isimages'">
<div></div>
<i></i>
</div>
</div>
<el-button plain type="primary" style="width: 100px;height: 35px;" @click="addcontacts">新增字段</el-button>
<!--新增字段-->
<el-dialog title="新增字段" :visible.sync="addVisible" :append-to-body="true" :close-on-click-modal="false" @close="closeSensor" class="dialogWrap">
<el-form :inline="true" label-width="210px" :model="contactsform" :rules="rules" ref="contactsform">
<el-form-item label="字段名称:" prop="fieldName">
<el-input style="width:370px;" maxlength="36" v-model.trim="contactsform.fieldName" placeholder="请输入字段名称"></el-input>
<el-checkbox style="margin-left: 15px" v-model="isCheck">必选</el-checkbox>
</el-form-item>
<el-form-item label="字段类型:" prop="fieldType" style="width: 100%;padding-bottom: 30px">
<el-select style="width:370px;" v-model="contactsform.fieldType" @change="fieldTypechange" placeholder="请选择字段类型">
<el-option v-for="item in contactslist" :key="item.key" :label="item.value" :value="item.key">
</el-option>
</el-select>
<div v-for="(items,index) in valuelist" style="width: 500px" v-if="contactsform.fieldType == 0 || contactsform.fieldType == 1">
<el-input placeholder="请输入选项值" v-model="items.value" style="margin-top: 25px;width: 370px">
<template slot="prepend">选项{{index+1}}</template>
</el-input>
<el-button v-if="index != 0 && index != 1" type="text" @click="valuelist.splice(index,1)" style="margin: 25px 0 0 20px">删除</el-button>
</div>
<el-button @click="addvalue" v-if="contactsform.fieldType == 0 || contactsform.fieldType == 1" type="primary" plain style="width: 100px;height: 40px;margin-top: 25px">新增一条</el-button>
</el-form-item>
</el-form>
<el-row style="padding-top: 20px;border-top: 1px solid #E4E6F2;text-align: center">
<el-button type="primary" @click="subcontacts">创建</el-button>
<el-button @click="addVisible=false">{{$t('releasejson.cancel')}}</el-button>
</el-row>
</el-dialog>
</div>
</template>
<script>
import api from './api/api'
export default {
name : "addfield",
data() {
return {
contactslist:[
{key:0,value:'单选'},
{key:1,value:'多选'},
{key:2,value:'单行输入'},
{key:3,value:'多行输入'},
{key:4,value:'日期(含时间)'},
{key:5,value:'日期(不含时间)'},
{key:6,value:'时间段(含时间)'},
{key:7,value:'时间段(不含时间)'},
{key:8,value:'上传图片'},
{key:9,value:'上传附件'},
],
addVisible:false,
rules:{
fieldName: [{required: true,message: '请输入字段名称',trigger: 'blur'}],
fieldType: [{required: true,message: '请选择字段类型',trigger: 'change'}],
},
contactsform:{},
valuelist:[],
isCheck:true,
}
},
props:['fielddata','item'],
methods:{
contactsclk(val){
if(val.isCustom == 1){
this.$message.error('内置字段不可取消!');
}else{
val.state = !val.state;
}
this.$forceUpdate();
},
addvalue(){
for(let i in this.valuelist){
if(this.valuelist[i].value == '' || this.valuelist[i].value == null){
this.$message.error('请填写内容后再添加新选项!');
return
}
}
this.valuelist.push({});
},
addcontacts(){
this.addVisible = true;
},
fieldTypechange(val){
if(val == 0 || val == 1){
this.valuelist = [{},{}];
}else{
this.valuelist = null;
}
},
subcontacts(){
console.log(this.valuelist)
this.$refs.contactsform.validate((valid) => {
if(valid) {
let num = [];
if(this.valuelist){
if(this.valuelist.length !=0){
for(let i in this.valuelist){
num.push(this.valuelist[i].value)
}
}
}
this.contactsform.fieldOptionList = num;
this.contactsform.isCustom = 0;
this.contactsform.isCheck = this.isCheck==true?1:0;
this.contactsform.state = true;
this.$emit('dataEvent',this.contactsform,this.item);
this.addVisible = false;
}
});
},
closeSensor(){
this.contactsform = {};
// this.$refs['contactsform'].resetFields();
},
VisibleIfed(){
},
},
mounted() {
},
watch:{
fielddata(val){
// console.log(val)
}
}
}
</script>
<style scoped lang="scss">
.iscontactscss{
background: #F2F2F2!important;
color: #3F3F53!important;
}
.isimages{
div{
border-color: transparent transparent #DEDEDE!important;
}
}
.contactscss{
height: 35px;
line-height: 35px;
cursor: pointer;
padding: 0px 20px;
border-radius: 3px;
margin: 0 20px 20px 0;
text-align: center;
background: #5D78FF;
color: #FFFFFF;
font-size: 14px;
position: relative;
.images{
div{
position: absolute;
top: -15px;
left: -15px;
transform:rotate(-45deg);
width: 0;
height: 0;
border: 15px solid;
border-color: transparent transparent #FF9E29;
}
i{
position: absolute;
left: 3px;
top: -9px;
font-size: 10px;
color: #ffffff;
}
}
}
</style>
\ No newline at end of file
import api from '../../../api/api';
import Qs from 'qs';
export default {
selectCityList( params ) {
return api.fetchGet( '/business/geo/selectCityList?geoId=' + params );
},
selectProvinceList( params ) {
return api.fetchGet( '/business/geo/selectProvinceList?geoId=' + params );
},
getTemplateFields( params ) {
return api.fetchGet( '/base/activity/getTemplateFields?templateType=' + params );
},
publishActivity (params){
return api.fetchPost('/base/activity/publishActivity',params);
},
publishActivityList (params){
return api.fetchPost('/base/activity/publishActivityList',params);
},
}
\ No newline at end of file
<template>
<div class="soutform loginedWrapper">
<div class="breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/litemlist' }">{{$t("releasejson.wrkbench")}}</el-breadcrumb-item>
<el-breadcrumb-item>活动</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="projectTabadd" style="margin-top: 10px;position: relative;border-radius: 3px;min-height: 700px">
<el-tabs v-model="activeName">
<el-tab-pane label="选择活动模板" name="first">
<el-row :gutter="20">
<el-col :span="6">
<div class="templatecss">
<img src="../../assets/img/slider-1280.jpg" alt="">
<p>项目征集</p>
<el-button type="primary" @click="soutClk(2)" style="width: 90px;">选择</el-button>
</div>
</el-col>
<el-col :span="6">
<div class="templatecss">
<img src="../../assets/img/slider-1280.jpg" alt="">
<p>线下沙龙</p>
<el-button type="primary" @click="soutClk(3)" style="width: 90px;">选择</el-button>
</div>
</el-col>
<el-col :span="6">
<div class="templatecss">
<img src="../../assets/img/slider-1280.jpg" alt="">
<p>尽请期待</p>
<!--<el-button type="primary" @click="soutClk" style="width: 90px;">选择</el-button>-->
</div>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<p @click="$router.push('/proactivity')" style="position: absolute;top: 25px;right: 10px;color: #5D78FF;font-size: 14px;width: 80px;cursor: pointer;">
<i style="color: #5D78FF;font-size: 14px;padding-right: 5px" class="iconfont icon-fanhui1"></i>
返回
</p>
</div>
</div>
</template>
<script>
export default {
name : "newtemplate",
data() {
return {
activeName:'first'
}
},
methods:{
soutClk(val){
this.$router.push({path:"/addproactivity",query:{type:val}});
},
},
mounted() {
}
}
</script>
<style scoped lang="scss">
.templatecss{
text-align: center;
padding: 30px 0 0 25px;
>img{
width: 255px;
height: 150px
}
>p{
font-weight: bold;
margin: 20px 0 ;
}
}
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<div class="soutform loginedWrapper">
<div class="breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item>我的工作台</el-breadcrumb-item>
<el-breadcrumb-item>活动</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="contentPadding">
<el-form :inline="true">
<el-form-item>
<el-button type="primary" @click="soutClk">创建活动</el-button>
</el-form-item>
<el-form-item class="formcontentnk">
<el-input placeholder="请输入活动名称关键字" v-model="search.channelTitle" class="input-with-select" style="width: 290px">
<el-button slot="append" icon="el-icon-search" @click="searchchannel"></el-button>
</el-input>
</el-form-item>
</el-form>
<el-row>
<el-table :data="publishActivitydata" tooltip-effect="dark" class="projectTable2">
<el-table-column label="活动图片" align="center">
<template slot-scope="scope">
<img v-if="scope.row.channelPic" :src="scope.row.channelPic" alt="图片" style="border-radius: 3px; border:1px solid #DCDFF1; width: 120px;height: 72px;">
</template>
</el-table-column>
<el-table-column prop="channelTitle" label="活动名称" align="center">
</el-table-column>
<el-table-column prop="channelType" label="活动类型" align="center">
<template slot-scope="scope">
{{scope.row.channelType == '2' ? '项目收集': scope.row.channelType == '3' ? '' : '线下沙龙'}}
</template>
</el-table-column>
<el-table-column prop="channelState" label="活动状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.channelState == 0" style="color:#FF9E29;">审核中</span>
<span v-if="scope.row.channelState == 1" style="color:#3F3F53;">未开始</span>
<span v-if="scope.row.channelState == 2" style="color:#FF5D5D;">审核驳回</span>
<span v-if="scope.row.channelState == 3" style="color:#0ABB87;">进行中</span>
<span v-if="scope.row.channelState == 4" style="color:#FF5D5D;">已结束</span>
</template>
</el-table-column>
<el-table-column prop="enterCount" label="报名人数" align="center">
</el-table-column>
<el-table-column prop="publishTime" label="发布时间" align="center">
</el-table-column>
<el-table-column :label="$t('listjson.action')" width="100" align='center'>
<template slot-scope="scope">
<el-button type="text" @click="">{{$t('listjson.seeaction')}}</el-button>
</template>
</el-table-column>
<template slot="empty">
<i class="iconfont icon-hezi501 datai"></i>
<p class="datap">{{$t('listjson.notfoundyet')}}</p>
</template>
</el-table>
<div class="pagination">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
background
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="10"
:current-page="cur_page"
layout=" total, prev, pager, next"
:total="totalListResult">
</el-pagination>
</div>
</el-row>
</div>
</div>
</template>
<script>
import api from './api/api';
export default {
name : "pubactivities",
data() {
return {
cur_page: 1, //页数
totalListResult: 0,
numberData: 5, //设置个数
publishActivitydata:[],
search:{}
}
},
methods: {
// 分页导航
handleCurrentChange(val) {
this.cur_page = val;
this.getpublishActivityList();
},
//设置个数
handleSizeChange(val) {
this.numberData = val;
this.getpublishActivityList();
},
soutClk(){
this.$router.push({path:"/newtemplate",query:{}});
},
searchchannel(){
this.getpublishActivityList();
},
getpublishActivityList(){
let params = {
pagination: {
number: this.numberData,
start: 0,
numberOfPages: this.cur_page || 1,
totalItemCount: 0
},
search: this.search,
sort: {}
};
api.publishActivityList(params).then(response => {
if(response.code == 0) {
this.publishActivitydata = response.result.records;
this.totalListResult = response.result.total;
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
},
mounted() {
this.getpublishActivityList();
}
}
</script>
<style scoped>
.formcontentnk {
float: right;
}
</style>
\ No newline at end of file
<template>
<div id="wangeditor">
<div ref="editorElem" style="text-align:left;"></div>
</div>
</template>
<script>
import E from "wangeditor"
export default {
name : "richtext",
data() {
return {
editor: null,
editorContent: ''
};
},
props: ['catchData'],
mounted() {
this.editor = new E( this.$refs.editorElem );
// 编辑器的事件,每次改变会获取其html内容
this.editor.customConfig.onchange = html => {
this.$emit('dataEvent',html);
// 把这个html通过catchData的方法传入父组件
};
// this.editor.customConfig.menus = [
// // 菜单配置
// 'head', // 标题
// 'bold', // 粗体
// 'fontSize', // 字号
// 'fontName', // 字体
// 'italic', // 斜体
// 'underline', // 下划线
// 'strikeThrough', // 删除线
// 'foreColor', // 文字颜色
// 'backColor', // 背景颜色
// 'link', // 插入链接
// 'list', // 列表
// 'justify', // 对齐方式
// 'quote', // 引用
// 'emoticon', // 表情
// 'image', // 插入图片
// 'table', // 表格
// 'code', // 插入代码
// 'undo', // 撤销
// 'redo' // 重复
// ];
this.editor.create();
}
}
</script>
<style lang="scss">
#wangeditor{
>div{
>div:nth-child(2){
z-index: 99!important;
}
}
}
</style>
\ No newline at end of file
......@@ -193,6 +193,7 @@
this.$router.push('/editAuth');
}).catch(() => {
this.cur_page = 1;
this.$store.dispatch('projectPageNum',{path:this.$route.path,pars:this.cur_page});
this.add();
});
}
......@@ -206,6 +207,7 @@
this.$router.push('/editAuth');
}).catch(() => {
this.cur_page = 1;
this.$store.dispatch('projectPageNum',{path:this.$route.path,pars:this.cur_page});
this.add();
});
}
......@@ -219,6 +221,7 @@
this.$router.push('/editAuth');
}).catch(() => {
this.cur_page = 1;
this.$store.dispatch('projectPageNum',{path:this.$route.path,pars:this.cur_page});
this.add();
});
}
......@@ -232,6 +235,7 @@
this.$router.push('/mobileLoginCmpt');
}).catch(() => {
this.cur_page = 1;
this.$store.dispatch('projectPageNum',{path:this.$route.path,pars:this.cur_page});
this.add();
});
}
......
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