|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
<searchForm :keys="['key','optime']" ref="searchForm"
|
|
|
@on-search="handleSearch">
|
|
|
- <el-button type="primary" icon="el-icon-plus" plain size="small" >新增</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" plain size="small" @click="addVoteActivity" >新增</el-button>
|
|
|
</searchForm>
|
|
|
|
|
|
<RxTable
|
|
|
@@ -44,52 +44,53 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" fixed="right" align="left" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" icon="el-icon-search" @click="handleInfo(scope.row)">查看</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-search" @click="handleInfo(scope.row)">详情</el-button>
|
|
|
<el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑 </el-button>
|
|
|
<!-- <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)">绑定微信-->
|
|
|
<!-- </el-button>-->
|
|
|
- <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
|
|
|
- </el-button>
|
|
|
+<!-- <el-button class="btn_text_danger" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除-->
|
|
|
+<!-- </el-button>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</RxTable>
|
|
|
</div>
|
|
|
- <!-- <el-dialog-->
|
|
|
- <!-- title="添加用户"-->
|
|
|
- <!-- :visible.sync="dialogVisible"-->
|
|
|
- <!-- width="600px"-->
|
|
|
- <!-- :lock-scroll="false">-->
|
|
|
- <!-- <userForm ref="userForm"></userForm>-->
|
|
|
- <!-- <span slot="footer" class="dialog-footer">-->
|
|
|
- <!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
|
|
|
- <!-- <el-button type="primary" @click="onSubmit">确 定</el-button>-->
|
|
|
- <!-- </span>-->
|
|
|
- <!-- </el-dialog>-->
|
|
|
- <!-- <el-dialog-->
|
|
|
- <!-- title="编辑角色"-->
|
|
|
- <!-- :visible.sync="dialogVisibleUpdate"-->
|
|
|
- <!-- width="600px"-->
|
|
|
- <!-- :lock-scroll="false">-->
|
|
|
- <!-- <userForm ref="userFormu"></userForm>-->
|
|
|
- <!-- <span slot="footer" class="dialog-footer">-->
|
|
|
- <!-- <el-button @click="dialogVisibleUpdate = false">取 消</el-button>-->
|
|
|
- <!-- <el-button type="primary" @click="onSubmit">确 定</el-button>-->
|
|
|
- <!-- </span>-->
|
|
|
- <!-- </el-dialog>-->
|
|
|
+ <el-dialog
|
|
|
+ title="添加投票活动"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="600px"
|
|
|
+ :lock-scroll="false">
|
|
|
+ <activityForm ref="activityForm"></activityForm>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit('add')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="编辑投票活动"
|
|
|
+ :visible.sync="dialogVisibleUpdate"
|
|
|
+ width="600px"
|
|
|
+ :lock-scroll="false">
|
|
|
+ <activityForm ref="activityForm"></activityForm>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisibleUpdate = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit('edit')">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import searchForm from "@/components/searchForm";
|
|
|
import RxTable from "@/components/RxTable";
|
|
|
+import activityForm from "./module/activityForm";
|
|
|
|
|
|
|
|
|
export default {
|
|
|
name: "index",
|
|
|
components: {
|
|
|
searchForm,
|
|
|
-
|
|
|
RxTable,
|
|
|
+ activityForm
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -133,6 +134,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ addVoteActivity(){
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
handleInfo(row){
|
|
|
console.log(row)
|
|
|
this.$router_({
|
|
|
@@ -143,14 +147,14 @@ export default {
|
|
|
...row
|
|
|
}
|
|
|
})
|
|
|
- // this.$router.push({
|
|
|
- // name:"voteActivityInfo",
|
|
|
- // params:{
|
|
|
- // activityId:row.activityId
|
|
|
- // }
|
|
|
- // })
|
|
|
+
|
|
|
},
|
|
|
handleEdit(row) {
|
|
|
+ console.log(row)
|
|
|
+ this.dialogVisibleUpdate = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.activityForm.form = JSON.parse(JSON.stringify(row));
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
|
|
|
@@ -165,13 +169,26 @@ export default {
|
|
|
|
|
|
},
|
|
|
|
|
|
- onSubmit() {
|
|
|
- // let form = this.$refs.userForm.getParams();
|
|
|
- // this.$api.addUser(form).then(res => {
|
|
|
- // this.$message.success("新增成功!");
|
|
|
- // this.dialogVisible = false;
|
|
|
- // this.handleSearch();
|
|
|
- // })
|
|
|
+ onSubmit(type="add") {
|
|
|
+ let form = this.$refs.activityForm.form;
|
|
|
+
|
|
|
+ console.log(type)
|
|
|
+
|
|
|
+
|
|
|
+ if(type =="add"){
|
|
|
+ this.$api.addVoteActivity(form).then(res => {
|
|
|
+ this.$message.success("新增成功!");
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.handleSearch();
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$api.editVoteActivity(form).then(res => {
|
|
|
+ this.$message.success("编辑成功!");
|
|
|
+ this.dialogVisibleUpdate = false;
|
|
|
+ this.handleSearch();
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
goDeleteSelect() {
|
|
|
@@ -181,31 +198,36 @@ export default {
|
|
|
handleSearch() {
|
|
|
this.pageInfo.pageNum = 1
|
|
|
|
|
|
- let optime = this.$refs.searchForm.time1;
|
|
|
-
|
|
|
- let startTime,
|
|
|
- key,
|
|
|
- endTime;
|
|
|
- key = this.$refs.searchForm.form.key;
|
|
|
-
|
|
|
- if(optime.length){
|
|
|
- startTime = optime[0];
|
|
|
- endTime = optime[1];
|
|
|
- }
|
|
|
|
|
|
- this.searchParams = {
|
|
|
- startTime,
|
|
|
- endTime,
|
|
|
- key,
|
|
|
- ...this.pageInfo
|
|
|
- }
|
|
|
|
|
|
|
|
|
this.voteList()
|
|
|
},
|
|
|
|
|
|
- //国家list
|
|
|
- voteList(params) {
|
|
|
+
|
|
|
+ voteList() {
|
|
|
+ let optime = this.$refs.searchForm.time1;
|
|
|
+
|
|
|
+ let startTime,
|
|
|
+ key,
|
|
|
+ endTime;
|
|
|
+ key = this.$refs.searchForm.form.key;
|
|
|
+
|
|
|
+ if(optime.length){
|
|
|
+ startTime = optime[0];
|
|
|
+ endTime = optime[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ this.searchParams = {
|
|
|
+ startTime,
|
|
|
+ endTime,
|
|
|
+ key,
|
|
|
+ ...this.pageInfo
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.loading = true;
|
|
|
|
|
|
this.$api.voteList(this.searchParams).then(res => {
|