master
lion 3 years ago
parent e6e0326a19
commit d5d2d2dc2f

@ -17,6 +17,7 @@
"axios": "0.18.1",
"core-js": "3.6.5",
"echarts": "^4.2.1",
"element-china-area-data": "^5.0.2",
"element-ui": "2.13.2",
"js-cookie": "2.2.0",
"less-loader": "^5.0.0",

@ -7,7 +7,28 @@
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<Input class="inputwrap" style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<el-select class="vm10" v-model="searchFields.status" placeholder="请选择审核状态">
<el-option v-for="item in selects.statuss" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.isUp" placeholder="请选择发布状态">
<el-option v-for="item in selects.isUp" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.area_id" placeholder="请选择街道">
<el-option v-for="item in selects.streetType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<DatePicker class="inputwrap" type="datetimerange" v-model="searchFields.dateRange"
format="yyyy-MM-dd HH:mm" placeholder="活动发布时间范围" style="width: 300px"></DatePicker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
@ -24,6 +45,11 @@
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='status'">
<div v-if="scope.row[column.field]==0"></div>
<div v-if="scope.row[column.field]==1"></div>
<div v-if="scope.row[column.field]==2"></div>
</div>
<div v-else>{{scope.row[column.field]}}</div>
@ -49,6 +75,27 @@
<el-input v-model="form.title" placeholder="请填写活动名称" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动区域" prop="area">
<el-cascader
style="width:19%;margin-right:1%"
size="large"
placeholder="请选择区域"
:options="options"
v-model="selectedOptions"
@change="handleChange">
</el-cascader>
<el-select style="width:19%;margin-right:1%" @change="getStreet" v-model="form.area_id" placeholder="请选择街道">
<el-option
v-for="item in selects.streetType"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-input style="width:60%" type="text" v-model="form.address" placeholder="请填写具体地址"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="10">
<el-form-item label="发布者" prop="date">
<el-select v-model="form.autor" placeholder="请选择发布者">
@ -66,8 +113,8 @@
</el-col> -->
<el-col :span="10">
<el-form-item label="发布主体" prop="from_id">
<el-select v-model="form.from_id" placeholder="请选择发布主体">
<el-option v-for="item in selects.from_id" :key="item.id" :label="item.value"
<el-select class="width100" v-model="form.from_id" placeholder="请选择发布主体">
<el-option v-for="item in selects.activityMain" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
@ -75,20 +122,23 @@
</el-col>
<el-col :span="10" :offset="4">
<el-form-item label="活动分类" prop="type_id">
<el-select v-model="form.type_id" placeholder="请选择活动分类">
<el-option v-for="item in selects.type_id" :key="item.id" :label="item.value"
<el-select class="width100" v-model="form.type_id" placeholder="请选择活动分类">
<el-option v-for="item in selects.activityType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="活动时间" prop="daterange">
<el-date-picker
v-model="form.daterange"
class="width100"
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd HH:mm:ss"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
@ -96,74 +146,61 @@
<el-col :span="10" :offset="4">
<el-form-item label="报名截止时间" prop="sign_end_time">
<el-date-picker
class="width100"
v-model="form.sign_end_time"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择报名截止时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="10">
<el-form-item label="活动人数上限" prop="total">
<el-input type="text" v-model="form.total"></el-input>
<el-input placeholder="请填写活动人数上限" type="text" v-model="form.total"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报名费用" prop="price">
<el-input type="text" v-model="form.price"></el-input>
<el-col :span="10" :offset="4">
<el-form-item label="报名费用(元)" prop="price">
<el-input type="text" placeholder="请填写报名费用(元)" v-model="form.price"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="10">
<el-form-item label="活动参与积分" prop="score">
<el-input type="text" v-model="form.score"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动区域" prop="area">
<el-select v-model="form.province" placeholder="省级地区">
<el-option
v-for="item in citys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.city" placeholder="市级地区">
<el-option
v-for="item in citys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.area" placeholder="区级地区">
<el-option
v-for="item in areas"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.street" placeholder="街道">
<el-option
v-for="item in streets"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input type="text" v-model="form.address" placeholder="请填写具体地址"></el-input>
<el-input type="text" placeholder="请填写活动参与积分" v-model="form.score"></el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="活动概述" prop="small">
<el-input type="textarea" rows="3" v-model="form.small" placeholder="请填写活动概述"></el-input>
</el-form-item>
</el-col>
<el-col span="24">
<el-form-item label="活动封面" prop="cover">
<el-upload action="/api/admin/upload-file" list-type="picture-card" :file-list="coverlist" ref="pictureUpload"
:limit="1" :auto-upload="true" :data="uploadOther"
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,1)}">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in"></i>
</span>
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容" prop="content">
<div style="width: 99.9%;">
<tinymce ref="tinymce" v-model="form.content" :height="300" />
<tinymce ref="tiny" v-model="form.content" :height="300" />
</div>
</el-form-item>
</el-col>
@ -186,7 +223,8 @@
getToken
} from '@/utils/auth'
import LxHeader from "@/components/LxHeader/index.vue";
import Tinymce from '@/components/Tinymce'
import Tinymce from '@/components/Tinymce'
import { regionData, CodeToText } from "element-china-area-data";
import {
listActivity,
store,
@ -195,9 +233,9 @@
get
} from "../../api/activity/index.js";
// import {
// listdept
// } from "../../api/system/department.js"
import {
getparameteritem
} from "../../api/system/dictionary.js"
export default {
components: {
LxHeader,
@ -205,12 +243,10 @@
},
data() {
return {
city:"北京市",
area:"大兴区",
street:"",
citys:[],
areas:[],
streets:[],
options: regionData,
selectedOptions: [],
coverlist:[],
disabled: false,
paginations: {
page: 1,
page_size: 15,
@ -220,7 +256,9 @@
dialogFormVisible: false,
formLabelWidth: "120px",
clientHeight: 0,
form: {
form: {
title:"",
content:"",
cover:"",
type_id:"",
area_id:"",
@ -236,10 +274,38 @@
end_time:"",
sign_end_time:"",
score:"",
title:"",
content:""
status:1
},
area_id_id:"",
daterange:"",
selects:{
activityMain:[],
activityType:[],
streetType:[],
statuss:[{
id:0,
value:"暂存"
},{
id:1,
value:"提交"
},{
id:0,
value:"已审核"
}],
isUp:[
{
id:0,
value:"上架"
},{
id:1,
value:"下架"
}
]
},
selects:[],
uploadOther: {
token: ""
},
tableData: [],
rules: {
},
@ -249,8 +315,14 @@
},
columns: [{
field: "title",
title: "政策名称",
title: "活动名称",
type: "string",
},
{
field: "rate_name",
title: "活动状态",
type: "string",
width:200
},
{
field: "autor",
@ -265,6 +337,13 @@
type: "string",
width: 200,
align: "center"
},
{
field: "status",
title: "状态",
type: "status",
width: 200,
align: "status"
},
{
field: "操作",
@ -275,7 +354,8 @@
]
}
},
created() {
created() {
this.uploadOther.token = getToken();
this.initLoad();
this.load();
@ -289,7 +369,29 @@
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
that.tableHeight = tableHeight;
this.selectedOptions=["110000","110100","110115"];
that.form.province = "北京市";
that.form.city = "市辖区";
that.form.area = "大兴区";
getparameteritem("activity-type").then(res => {
this.selects.activityType = res.detail;
});
getparameteritem("notice-main").then(res => {
this.selects.activityMain = res.detail;
});
getparameteritem("streetList").then(res => {
this.selects.streetType = res.detail;
this.selects.streetType[0].id="";
});
this.form.street = "全部";
},
load() {
listActivity({
@ -307,13 +409,15 @@
},
info(obj) {
var that = this;
// getdaily(obj.id).then(res => {
// let result = Object.assign(that.form, res);
// that.form = result;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
that.form = result;
that.daterange = [result.start_time, result.end_time];
this.$refs.tiny.setContent(result.content);
// }).catch(error => {
// //reject(error)
// })
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form;
@ -321,15 +425,23 @@
if (obj) {
var that = this;
that.info(obj);
} else {}
} else {
this.daterange=[];
this.$refs.tiny.setContent("");
}
this.dialogFormVisible = true;
},
submitForm(formName) {
var that = this;
var that = this;
// console.log("aaaaaa");
// console.log(that.daterange);
// console.log(that.form);
// return;
that.form.start_time = this.daterange[0]
that.form.end_time = this.daterange[1]
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
that.form.safety_task_id = that.form.id;
save(that.form).then(response => {
//console.log(response)
this.$Message.success('操作成功');
@ -358,7 +470,8 @@
});
},
resetForm(formName) {
var that = this;
var that = this;
this.$refs.tiny.setContent("");
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
},
@ -382,16 +495,72 @@
});
}
},
getStreet(obj){
var that = this;
console.log(obj);
// that.selects
that.form.area_id = obj;
for(var m of that.selects.streetType){
if(obj==m.id){
that.form.street = m.value;
}
}
},
handleChange() {
var loc = "";
var that = this;
for (let i = 0; i < this.selectedOptions.length; i++) {
loc += CodeToText[this.selectedOptions[i]]+"/";
}
var areaList = loc.split("/");
that.form.province = areaList[0];
that.form.city = areaList[1];
that.form.area = areaList[2];
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
handleRemove(file) {
this.coverlist = [];
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handlesuccess(response, file, fileList, index) {
let listid = "";
for (var m of fileList) {
if (m.response)
listid = m.response.id;
else
listid = m.id;
}
this.coverlist = fileList;
this.form.cover = listid;
}
},
}
}
</script>
<style>
.dialogConcent {
overflow-y: auto;
}
.width100 {
width: 100% !important
}
.inputwrap input{
height:40px
}
.inputwrap .ivu-input-suffix{
line-height: 40px!important;
}
.vm10{
vertical-align: middle;margin-right: 10px;
}
</style>

@ -7,9 +7,35 @@
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
<el-select class="vm10" v-model="searchFields.from_id" placeholder="请选择发布主体">
<el-option v-for="item in selects.noticeMain" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.type_id" placeholder="请选择公告分类">
<el-option v-for="item in selects.noticeType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.area_id" placeholder="请选择街道">
<el-option v-for="item in selects.streetType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.status" placeholder="请选择状态">
<el-option v-for="item in selects.statuss" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<DatePicker class="inputwrap" type="datetimerange" v-model="searchFields.dateRange"
format="yyyy-MM-dd HH:mm" placeholder="公告发布时间范围" style="width: 300px"></DatePicker>
<div style="margin-top:20px">
<Input class="inputwrap" style="width: 416px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</div>
</slot>
</LxHeader>
@ -158,7 +184,17 @@
selects:{
noticeType:[],
noticeMain:[],
streetType:[]
streetType:[],
statuss:[{
id:0,
value:"待审核"
},{
id:1,
value:"通过"
},{
id:0,
value:"不通过"
}]
},
uploadOther: {
token: ""
@ -190,19 +226,17 @@
},
tableHeight: 900,
searchFields: {
KeyWord: ""
KeyWord: "",
from_id:"",
type_id:"",
area_id:"",
status:"",
dateRange:""
},
columns: [{
field: "title",
title: "公告名称",
type: "string",
},
{
field: "status",
title: "状态",
type: "status",
width: 200,
align: "status"
},
{
field: "author",
@ -217,6 +251,13 @@
type: "string",
width: 200,
align: "center"
},
{
field: "status",
title: "状态",
type: "status",
width: 200,
align: "status"
},
{
field: "操作",
@ -253,7 +294,7 @@
getparameteritem("streetList").then(res => {
this.selects.streetType = res.detail;
this.form.area_id = res.detail[0].id;
this.selects.streetType[0].id="";
});
},
load() {
@ -417,5 +458,15 @@
.width100 {
width: 100% !important
}
.inputwrap input{
height:40px
}
.inputwrap .ivu-input-suffix{
line-height: 40px!important;
}
.vm10{
vertical-align: middle;margin-right: 10px;
}
</style>

@ -7,7 +7,25 @@
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<Input class="inputwrap" style="width: 200px; margin-right: 10px;" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<el-select class="vm10" v-model="searchFields.level_id" placeholder="请选择政策级别">
<el-option v-for="item in selects.regulationLevel" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.focus_id" placeholder="请选择政策重点">
<el-option v-for="item in selects.regulationImpor" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.type_id" placeholder="请选择政策分类">
<el-option v-for="item in selects.regulationType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<DatePicker class="inputwrap" type="datetimerange" v-model="searchFields.dateRange"
format="yyyy-MM-dd HH:mm" placeholder="政策发布时间范围" style="width: 300px"></DatePicker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
@ -185,7 +203,11 @@
rules: {},
tableHeight: 900,
searchFields: {
KeyWord: ""
KeyWord: "",
level_id: "",
focus_id: "",
type_id:"",
dateRange:""
},
columns: [{
field: "title",
@ -413,5 +435,14 @@
.width100 {
width: 100% !important
}
.inputwrap input{
height:40px
}
.inputwrap .ivu-input-suffix{
line-height: 40px!important;
}
.vm10{
vertical-align: middle;margin-right: 10px;
}
</style>

@ -7,7 +7,24 @@
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<Input class="inputwrap" style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<el-select class="vm10" v-model="searchFields.item_type_id" placeholder="请选择项目类型">
<el-option v-for="item in selects.itemslist" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.status_id" placeholder="请选择状态">
<el-option v-for="item in selects.statuslist" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<el-select class="vm10" v-model="searchFields.area_id" placeholder="请选择街道">
<el-option v-for="item in selects.streetType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
</el-select>
<DatePicker class="inputwrap" type="datetimerange" v-model="searchFields.dateRange"
format="yyyy-MM-dd HH:mm" placeholder="需求发布时间范围" style="width: 300px"></DatePicker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
@ -106,7 +123,7 @@
</el-col>
<el-col :span="10" :offset="4">
<el-form-item label="所属区域" prop="area_id">
<el-select class="width100" v-model="form.area_id" placeholder="全部">
<el-select class="width100" v-model="form.area_id" placeholder="请选择街道">
<el-option v-for="item in selects.streetType" :key="item.id" :label="item.value"
:value="item.id">
</el-option>
@ -225,7 +242,12 @@
},
tableHeight: 900,
searchFields: {
KeyWord: ""
KeyWord: "",
item_type_id:"",
status_id:"",
need_type_id:"",
area_id:"",
dateRange:""
},
columns: [{
field: "title",
@ -292,7 +314,8 @@
getparameteritem("streetList").then(res => {
this.selects.streetType = res.detail;
this.form.area_id = res.detail[0].id;
// this.form.area_id = res.detail[0].id;
this.selects.streetType[0].id="";
});
},
@ -323,7 +346,6 @@
_files.push(m);
}
that.fileList = _files;
}).catch(error => {
//reject(error)
})
@ -352,7 +374,10 @@
"upload_id": m.upload_id
});
}
that.form.files_list = listUrl;
that.form.files_list = listUrl;
console.log(this.fileList);
console.log(that.form);
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
@ -458,5 +483,15 @@
.width100 {
width: 100% !important
}
.inputwrap input{
height:40px
}
.inputwrap .ivu-input-suffix{
line-height: 40px!important;
}
.vm10{
vertical-align: middle;margin-right: 10px;
}
</style>

Loading…
Cancel
Save