结束投票&bug
This commit is contained in:
		| @@ -1,13 +1,13 @@ | ||||
| <template> | ||||
|   <section class="electionAdd"> | ||||
|     <ai-detail class="add" v-if="id && !isEdit"> | ||||
|     <ai-detail class="add" v-show="id && !isEdit"> | ||||
|       <template slot="title"> | ||||
|         <ai-title title="换届选举详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title> | ||||
|       </template> | ||||
|       <template slot="content"> | ||||
|         <ai-card :title="info.title"> | ||||
|           <template #right> | ||||
|             <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="isEdit==false" @click="isEdit = true">修改</span> | ||||
|             <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="isEdit==false && info.status==0" @click="update">修改</span> | ||||
|           </template> | ||||
|           <template #content v-if="isEdit == false"> | ||||
|             <ai-wrapper> | ||||
| @@ -45,7 +45,7 @@ | ||||
|         </ai-card> | ||||
|       </template> | ||||
|     </ai-detail> | ||||
|     <ai-detail v-if="!id || isEdit"> | ||||
|     <ai-detail v-show="!id || isEdit==true"> | ||||
|       <ai-title slot="title" :title="id? '编辑换届选举':'添加换届选举'" isShowBottomBorder isShowBack @onBackClick="cancel(true)"/> | ||||
|       <template slot="content"> | ||||
|         <ai-card title="基本信息"> | ||||
| @@ -120,7 +120,7 @@ | ||||
|           </template> | ||||
|         </ai-card> | ||||
|       </template> | ||||
|       <template slot="footer"> | ||||
|       <template #footer> | ||||
|         <el-button class="delete-btn footer-btn" @click="cancel(false)">取消</el-button> | ||||
|         <el-button class="footer-btn" type="primary" @click="confirm()">保存</el-button> | ||||
|       </template> | ||||
| @@ -183,12 +183,9 @@ export default { | ||||
|       chooseVoteList: [], | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|   }, | ||||
|   created() { | ||||
|     if(this.params && this.params.id) { | ||||
|       this.id = this.params.id | ||||
|       this.isEdit = this.params.isEdit | ||||
|       this.getDetail() | ||||
|     } | ||||
|   }, | ||||
| @@ -199,6 +196,10 @@ export default { | ||||
|         isRefresh: !!isRefresh | ||||
|       }) | ||||
|     }, | ||||
|     update() { | ||||
|       this.isEdit = true | ||||
|       this.getDetail() | ||||
|     }, | ||||
|     getDetail() { | ||||
|       this.instance.post(`/app/appgeneralelectioninfo/queryDetailById`,null, { | ||||
|         params: {id:this.id} | ||||
|   | ||||
| @@ -17,8 +17,10 @@ | ||||
|         <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict"> | ||||
|           <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|             <template slot-scope="{ row }"> | ||||
|               <el-button type="text" @click.native="toAdd(row.id, true)">编辑</el-button> | ||||
|               <!-- <el-button v-show="row.status==0" type="text" @click.native="toAdd(row.id, true)">编辑</el-button> --> | ||||
|               <el-button type="text" @click.native="toAdd(row.id, false)">详情</el-button> | ||||
|               <el-button type="text" :disabled="row.status==2" @click.native="startEnd(row.id, false)">结束</el-button> | ||||
|               <el-button type="text" @click.native="toStatistics">统计</el-button> | ||||
|               <el-button type="text" @click.native="handleDelete(row.id)">删除</el-button> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
| @@ -106,6 +108,19 @@ export default { | ||||
|       } | ||||
|       this.getList() | ||||
|     }, | ||||
|     // 开始结束 | ||||
|     startEnd(id, status) { | ||||
|       this.$confirm('投票正在进行中,确定要提前结束吗?').then(() => { | ||||
|         this.instance.post(`/app/appgeneralelectioninfo/start-end?id=${id}&start=${status}`).then(res=>{ | ||||
|           if(res.code == 0) { | ||||
|             this.$message.success('结束成功') | ||||
|             this.getList() | ||||
|           } | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     // 统计 | ||||
|     toStatistics() {}, | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user