unknown
5 days ago
7 changed files with 763 additions and 9 deletions
-
BINdist.zip
-
30src/api/business/vote.js
-
14src/views/business/apartment/index.vue
-
367src/views/business/apartment/votingRecords/votingRecords copy.vue
-
347src/views/business/apartment/votingRecords/votingRecords.vue
-
14src/views/business/vote/index.vue
@ -0,0 +1,367 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
|
|||
<!-- 搜索工作栏 --> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
|||
label-width="100px"> |
|||
<el-form-item label="投票名称:" prop="voteName"> |
|||
<el-input v-model="queryParams.voteName" placeholder="请输入投票名称" clearable |
|||
@keyup.enter.native="handleQuery" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="创建时间" prop="createTimes"> |
|||
<el-date-picker v-model="queryParams.createTimes" style="width: 240px" |
|||
value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" |
|||
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 列表 --> |
|||
<el-table v-loading="loading" :data="list" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column label="投票名称" align="center" prop="voteName" min-width="140" show-overflow-tooltip /> |
|||
<el-table-column label="类型" align="center" show-overflow-tooltip min-width="160" prop="voteType"> |
|||
<template v-slot="scope"> |
|||
<dict-tag :type="DICT_TYPE.VOTE_TYPE" :value="scope.row.voteType"></dict-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="选项数量" align="center" prop="itemTotal" show-overflow-tooltip min-width="80"> |
|||
</el-table-column> |
|||
<el-table-column label="状态" align="center" prop="voteStatus" show-overflow-tooltip min-width="120"> |
|||
<template v-slot="scope"> |
|||
<dict-tag :type="DICT_TYPE.VOTE_STATUS" :value="scope.row.voteStatus"></dict-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="投票时间" align="center" prop="mainBody" show-overflow-tooltip min-width="160"> |
|||
<template v-slot="scope"> |
|||
<span>{{ parseTime(scope.row.startTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="220"> |
|||
<template v-slot="scope"> |
|||
<el-button size="mini" @click="handleResult(scope.row)" type="primary" |
|||
v-hasPermi="['business:vote:result']" plain>详情</el-button> |
|||
<el-button size="mini" type="danger" @click="handleExport(scope.row)" |
|||
v-hasPermi="['business:vote:delete']" plain>导出</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 分页组件 --> |
|||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
|||
@pagination="getList" /> |
|||
|
|||
|
|||
|
|||
<!-- 查看投票结果--> |
|||
<el-dialog :title="title" :visible.sync="resultVoteOpend" width="800px" append-to-body> |
|||
<div class="btndaocho"> <el-button type="primary" @click="handleExport" size="mini">导出</el-button></div> |
|||
<el-form ref="form" :model="form" label-width="90px"> |
|||
<el-divider content-position="left">投票说明</el-divider> |
|||
<div style="background-color: #e5e9f2;height: 300px; overflow-y: auto;"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<h2><span>{{ form.voteName }}</span></h2> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div>发起人:{{ form.makerName }}</div> |
|||
<div>创建时间:{{ form.startTime }}</div> |
|||
<div>截止时间:{{ form.endTime }}</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<div v-html="form.detail"> |
|||
</div> |
|||
</el-row> |
|||
</div> |
|||
|
|||
<el-divider content-position="left">投票结果</el-divider> |
|||
|
|||
<div class="type3" v-if="form.voteType == 3"> |
|||
<div class="ul2"> |
|||
<div class="li2" v-for="(item, index) in form.voteMultipleItemInfoRespList" :key="index"> |
|||
<div class="name" style="font-size: 18px;color: #333;font-weight: 600;margin-left: 30px;"> |
|||
{{ |
|||
item.voteName }} |
|||
</div> |
|||
<div class="flex row" v-for="(item2, index2) in item.voteMultipleResultList" :key="index2"> |
|||
<div class="lab" style="width: 300px; text-align: right;"> {{ item2.itemName }}</div> |
|||
<el-progress :percentage="item2.itemRate * 1" style="width: 300px; margin: 0 20px;" |
|||
:text-inside="false" /> |
|||
<!-- <el-progress :text-inside="true" :stroke-width="24" :percentage="item2.itemRate * 100" text-color="white"></el-progress> --> |
|||
<div style="line-height: 26px;">{{ item2.itemCount }}人</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-row :gutter="20" v-for="(item, index) in form.voteResultVO" :key="index" v-else> |
|||
<el-form-item :label="index + 1 + ''" prop="itemName"> |
|||
<el-col :span="16"> |
|||
{{ item.itemName }} <span v-if="item.itemCount * 1 > 0">(已投)</span> |
|||
<el-progress :text-inside="true" :stroke-width="24" :percentage="item.itemRate * 100" |
|||
text-color="white"></el-progress> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<br /> |
|||
<h3>{{ item.itemCount }}人</h3> |
|||
</el-col> |
|||
</el-form-item> |
|||
</el-row> |
|||
<el-divider content-position="left">投票详情</el-divider> |
|||
|
|||
<div v-if="form.voteType == 3"> |
|||
<!-- <el-table v-loading="loading" :data="voteType3List" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column :label="`议题名称`" align="center" prop="voteName" min-width="140" |
|||
show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<div style="padding-bottom: 14px;font-weight: 700;">{{ scope.row.voteName }}</div> |
|||
<el-table :data="scope.row.tableList"> |
|||
<el-table-column label="选项名称" align="center" prop="itemName" min-width="140" |
|||
show-overflow-tooltip></el-table-column> |
|||
<el-table-column label="投票数量" align="center" prop="voteCount" min-width="140" |
|||
show-overflow-tooltip></el-table-column> |
|||
</el-table> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> --> |
|||
|
|||
<el-table v-loading="loading" :data="voteType3List" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column :label="`议题名称`" align="center" prop="voteName" min-width="140" |
|||
show-overflow-tooltip> |
|||
<el-table-column> |
|||
<template slot-scope="scope"> |
|||
<!-- <div style="padding-bottom: 14px;font-weight: 700;">{{ scope.row.voteName }}</div> --> |
|||
<div v-for="(item,index) in scope.row.tableList" :key="index"> |
|||
<el-table-column label="选项名称" align="center" prop="itemName" min-width="140" > |
|||
<template> |
|||
<div>{{item.itemName }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="投票数量" align="center" prop="voteCount" min-width="140" > |
|||
<template> |
|||
<div>{{item.voteCount }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
</div> |
|||
<div v-else> |
|||
<el-table :data="tableData" style="width: 100%" border> |
|||
<el-table-column prop="date" label="投票选项" width="150" /> |
|||
<el-table-column prop="name" :label="item.name" min-width="180" |
|||
v-for="(item, index1) in tableData2" :key="index1"> |
|||
<template #default="scope"> |
|||
<div class="a" v-for="(item2, index) in item.arr" :key="index">{{ item2.userName + ' | '+parseTime(item2.createTime)}}</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
|
|||
</el-form> |
|||
|
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="cancel">关 闭</el-button> |
|||
</div> |
|||
|
|||
</el-dialog> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { getInfoListVilla } from "@/api/business/roominfo"; |
|||
import { createVoteItem, updateVoteItem, deleteVoteItem, getVoteItem, getVoteItemPage, updateVoteStatus, exportVoteResults } from '@/api/business/vote'; |
|||
|
|||
|
|||
|
|||
export default { |
|||
name: "Vote", |
|||
components: { |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
testArr: [ |
|||
{ |
|||
name: '测试标题', subOption: [ |
|||
{ name: '选项一', isCheck: 1 }, |
|||
{ name: '选项一', isCheck: 0 }, |
|||
{ name: '选项一', isCheck: 0 }, |
|||
] |
|||
}, |
|||
{ |
|||
name: '测试标题二', subOption: [ |
|||
{ name: '选项二', isCheck: 1 }, |
|||
{ name: '选项二', isCheck: 0 }, |
|||
{ name: '选项二', isCheck: 0 }, |
|||
] |
|||
} |
|||
], |
|||
voteType3List: [], |
|||
tableData: [{ |
|||
date: '投票人员', |
|||
name: 'Tom', |
|||
address: 'No. 189, Grove St, Los Angeles', |
|||
},], |
|||
tableData2: [], |
|||
// 遮罩层 |
|||
loading: true, |
|||
loadingTextVote: false, |
|||
// 弹出层标题 |
|||
// 导出遮罩层 |
|||
exportLoading: false, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 投票管理列表 |
|||
list: [], |
|||
//弹窗 |
|||
addVoteOpend: false, |
|||
resultVoteOpend: false, |
|||
// 表单标题 |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
voteName: undefined, |
|||
}, |
|||
// 表单参数 |
|||
form: { attachmentList: [], voteMultipleInfoList: [] }, |
|||
//标题 |
|||
title: null, |
|||
// 表单校验 |
|||
|
|||
//选项数组 |
|||
options: [{ id: 1, value: undefined }], |
|||
//树状图 |
|||
data: [], |
|||
defaultProps: { |
|||
children: 'children', |
|||
label: 'label' |
|||
}, |
|||
|
|||
//是否有投票选项 |
|||
textVote: true, |
|||
pickerOptions: { |
|||
disabledDate(time) { |
|||
return time.getTime() < Date.now(); |
|||
}, |
|||
}, |
|||
|
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
handleQuery() { |
|||
this.getList(); |
|||
}, |
|||
resetQuery() { |
|||
this.queryParams = {} |
|||
this.getList(); |
|||
}, |
|||
/** |
|||
* 获取业主信息集合 |
|||
*/ |
|||
getList() { |
|||
this.loading = true; |
|||
if (this.queryParams.createTimes != null) { |
|||
this.queryParams.createStartTime = this.queryParams.createTimes[0]; |
|||
this.queryParams.createEndTime = this.queryParams.createTimes[1]; |
|||
} |
|||
getVoteItemPage(this.queryParams).then(response => { |
|||
this.list = response.data.list; |
|||
this.total = response.data.total; |
|||
this.loading = false; |
|||
}) |
|||
|
|||
}, |
|||
handleExport() { |
|||
// 处理查询参数 |
|||
this.$modal.confirm('是否确认导出投票结果数据项?').then(() => { |
|||
this.exportLoading = true; |
|||
return exportVoteResults({ id: this.form.id }); |
|||
}).then(response => { |
|||
this.$download.excel(response, this.form.voteName + '投票结果.pdf'); |
|||
this.exportLoading = false; |
|||
}).catch(() => { }); |
|||
}, |
|||
|
|||
/** |
|||
* 获取结果 |
|||
*/ |
|||
handleResult(row) { |
|||
this.tableData2 = [], |
|||
getVoteItem(row.id).then(res => { |
|||
this.form = res.data; |
|||
|
|||
if (row.voteType == 3) { |
|||
this.voteType3List = res.data.voteResultTableList |
|||
console.log(this.voteType3List, '数据') |
|||
} else { |
|||
res.data.voteItemResultVOS.forEach(item => { |
|||
this.tableData2.push({ name: item.itemName, arr: item.voteUserVO }) |
|||
}) |
|||
} |
|||
this.resultVoteOpend = true; |
|||
this.title = "投票结果" |
|||
}) |
|||
|
|||
}, |
|||
|
|||
// 树权限(父子联动) |
|||
cancel() { |
|||
this.resultVoteOpend = false; |
|||
}, |
|||
|
|||
|
|||
|
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
margin-left: 20px; |
|||
|
|||
&:last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
} |
|||
|
|||
.flex { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.subOptions { |
|||
padding: 5px 0; |
|||
} |
|||
|
|||
.btndaocho { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
margin-top: -20px; |
|||
width: 100%; |
|||
} |
|||
</style> |
@ -0,0 +1,347 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
|
|||
<!-- 搜索工作栏 --> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
|||
label-width="100px"> |
|||
<el-form-item label="投票名称:" prop="voteName"> |
|||
<el-input v-model="queryParams.voteName" placeholder="请输入投票名称" clearable |
|||
@keyup.enter.native="handleQuery" /> |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="创建时间" prop="createTimes"> |
|||
<el-date-picker v-model="queryParams.createTimes" style="width: 240px" |
|||
value-format="yyyy-MM-dd HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" |
|||
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 列表 --> |
|||
<el-table v-loading="loading" :data="list" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column label="投票名称" align="center" prop="voteName" min-width="140" show-overflow-tooltip /> |
|||
<el-table-column label="类型" align="center" show-overflow-tooltip min-width="160" prop="voteType"> |
|||
<template v-slot="scope"> |
|||
<dict-tag :type="DICT_TYPE.VOTE_TYPE" :value="scope.row.voteType"></dict-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="选项数量" align="center" prop="voteItemCount" show-overflow-tooltip min-width="80"> |
|||
</el-table-column> |
|||
<el-table-column label="状态" align="center" prop="voteStatus" show-overflow-tooltip min-width="120"> |
|||
<template v-slot="scope"> |
|||
<dict-tag :type="DICT_TYPE.VOTE_STATUS" :value="scope.row.voteStatus"></dict-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="投票时间" align="center" prop="mainBody" show-overflow-tooltip min-width="160"> |
|||
<template v-slot="scope"> |
|||
<span>{{ scope.row.voteTimeStr }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" width="220"> |
|||
<template v-slot="scope"> |
|||
<el-button size="mini" @click="handleResult(scope.row)" type="primary" |
|||
v-hasPermi="['business:vote:result']" plain>详情</el-button> |
|||
<el-button size="mini" type="danger" @click="handleExport(scope.row.id)" |
|||
v-hasPermi="['business:vote:delete']" plain>导出</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 分页组件 --> |
|||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
|||
@pagination="getList" /> |
|||
|
|||
|
|||
|
|||
<!-- 查看投票结果--> |
|||
<el-dialog :title="title" :visible.sync="resultVoteOpend" width="800px" append-to-body> |
|||
<div class="btndaocho"> <el-button type="primary" @click="handleExport(form.id)" size="mini">导出</el-button></div> |
|||
<el-form ref="form" :model="form" label-width="90px"> |
|||
<el-divider content-position="left">投票说明</el-divider> |
|||
<div style="background-color: #e5e9f2;height: 300px; overflow-y: auto;"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<h2><span>{{ form.voteName }}</span></h2> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<div>发起人:{{ form.makerName }}</div> |
|||
<div>创建时间:{{ form.startTime }}</div> |
|||
<div>截止时间:{{ form.endTime }}</div> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<div v-html="form.detail"> |
|||
</div> |
|||
</el-row> |
|||
</div> |
|||
|
|||
<!-- <el-divider content-position="left">投票结果</el-divider> --> |
|||
|
|||
<!-- <div class="type3" v-if="form.voteType == 3"> |
|||
<div class="ul2"> |
|||
<div class="li2" v-for="(item, index) in form.voteMultipleItemInfoRespList" :key="index"> |
|||
<div class="name" style="font-size: 18px;color: #333;font-weight: 600;margin-left: 30px;"> |
|||
{{ |
|||
item.voteName }} |
|||
</div> |
|||
<div class="flex row" v-for="(item2, index2) in item.voteMultipleResultList" :key="index2"> |
|||
<div class="lab" style="width: 300px; text-align: right;"> {{ item2.itemName }}</div> |
|||
<el-progress :percentage="item2.itemRate * 1" style="width: 300px; margin: 0 20px;" |
|||
:text-inside="false" /> |
|||
<div style="line-height: 26px;">{{ item2.itemCount }}人</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<el-row :gutter="20" v-for="(item, index) in form.voteResultVO" :key="index" v-else> |
|||
<el-form-item :label="index + 1 + ''" prop="itemName"> |
|||
<el-col :span="16"> |
|||
{{ item.itemName }} <span v-if="item.itemCount * 1 > 0">(已投)</span> |
|||
<el-progress :text-inside="true" :stroke-width="24" :percentage="item.itemRate * 100" |
|||
text-color="white"></el-progress> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<br /> |
|||
<h3>{{ item.itemCount }}人</h3> |
|||
</el-col> |
|||
</el-form-item> |
|||
</el-row> --> |
|||
<el-divider content-position="left">投票详情</el-divider> |
|||
|
|||
<div v-if="form.voteType == 3"> |
|||
<!-- <el-table v-loading="loading" :data="voteType3List" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column :label="`议题名称`" align="center" prop="voteName" min-width="140" |
|||
show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<div style="padding-bottom: 14px;font-weight: 700;">{{ scope.row.voteName }}</div> |
|||
<el-table :data="scope.row.tableList"> |
|||
<el-table-column label="选项名称" align="center" prop="itemName" min-width="140" |
|||
show-overflow-tooltip></el-table-column> |
|||
<el-table-column label="投票数量" align="center" prop="voteCount" min-width="140" |
|||
show-overflow-tooltip></el-table-column> |
|||
</el-table> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> --> |
|||
|
|||
<el-table v-loading="loading" :data="voteType3List" border> |
|||
<el-table-column label="编号" type="index" width="50" align="center" fixed="left" /> |
|||
<el-table-column :label="`议题名称`" align="center" prop="voteName" min-width="100" show-overflow-tooltip></el-table-column> |
|||
<el-table-column :label="`议题选择`" align="center" prop="optionName" min-width="100" show-overflow-tooltip></el-table-column> |
|||
</el-table> |
|||
|
|||
</div> |
|||
<div v-else> |
|||
<!-- <el-table :data="tableData" style="width: 100%" border> |
|||
<el-table-column prop="date" label="投票选项" width="150" /> |
|||
<el-table-column prop="name" :label="item.name" min-width="180" |
|||
v-for="(item, index1) in tableData2" :key="index1"> |
|||
<template #default="scope"> |
|||
<div class="a" v-for="(item2, index) in item.arr" :key="index">{{ item2.userName + ' | '+parseTime(item2.createTime)}}</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> --> |
|||
<div class="voteName">投票名称: {{ form.mineMultipleVoteTable?.voteName }}</div> |
|||
<div class="voteName">投票选择: {{ form.mineMultipleVoteTable?.optionName }}</div> |
|||
</div> |
|||
|
|||
</el-form> |
|||
|
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button @click="cancel">关 闭</el-button> |
|||
</div> |
|||
|
|||
</el-dialog> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { getInfoListVilla } from "@/api/business/roominfo"; |
|||
import { vote_log, updateVoteItem, deleteVoteItem, getMineVoteDetail, getVoteItemPage, updateVoteStatus, exportMineVoteInfo } from '@/api/business/vote'; |
|||
|
|||
|
|||
|
|||
export default { |
|||
name: "Vote", |
|||
components: { |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
testArr: [ |
|||
{ |
|||
name: '测试标题', subOption: [ |
|||
{ name: '选项一', isCheck: 1 }, |
|||
{ name: '选项一', isCheck: 0 }, |
|||
{ name: '选项一', isCheck: 0 }, |
|||
] |
|||
}, |
|||
{ |
|||
name: '测试标题二', subOption: [ |
|||
{ name: '选项二', isCheck: 1 }, |
|||
{ name: '选项二', isCheck: 0 }, |
|||
{ name: '选项二', isCheck: 0 }, |
|||
] |
|||
} |
|||
], |
|||
voteType3List: [], |
|||
tableData: [{ |
|||
date: '投票人员', |
|||
name: 'Tom', |
|||
address: 'No. 189, Grove St, Los Angeles', |
|||
},], |
|||
tableData2: [], |
|||
// 遮罩层 |
|||
loading: true, |
|||
loadingTextVote: false, |
|||
// 弹出层标题 |
|||
// 导出遮罩层 |
|||
exportLoading: false, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 投票管理列表 |
|||
list: [], |
|||
//弹窗 |
|||
addVoteOpend: false, |
|||
resultVoteOpend: false, |
|||
// 表单标题 |
|||
|
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
voteName: undefined, |
|||
}, |
|||
// 表单参数 |
|||
form: { attachmentList: [], voteMultipleInfoList: [] }, |
|||
//标题 |
|||
title: null, |
|||
// 表单校验 |
|||
|
|||
//选项数组 |
|||
options: [{ id: 1, value: undefined }], |
|||
//树状图 |
|||
data: [], |
|||
defaultProps: { |
|||
children: 'children', |
|||
label: 'label' |
|||
}, |
|||
|
|||
//是否有投票选项 |
|||
textVote: true, |
|||
pickerOptions: { |
|||
disabledDate(time) { |
|||
return time.getTime() < Date.now(); |
|||
}, |
|||
}, |
|||
|
|||
}; |
|||
}, |
|||
created() { |
|||
this.queryParams.userId = this.$route.query.userId |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
handleQuery() { |
|||
this.getList(); |
|||
}, |
|||
resetQuery() { |
|||
this.queryParams = {} |
|||
this.getList(); |
|||
}, |
|||
/** |
|||
* 获取业主信息集合 |
|||
*/ |
|||
getList() { |
|||
this.loading = true; |
|||
if (this.queryParams.createTimes != null) { |
|||
this.queryParams.startTime = this.queryParams.createTimes[0]; |
|||
this.queryParams.endTime = this.queryParams.createTimes[1]; |
|||
// delete this.queryParams.createTimes |
|||
} |
|||
vote_log(this.queryParams).then(response => { |
|||
this.list = response.data.list; |
|||
this.total = response.data.total; |
|||
this.loading = false; |
|||
}) |
|||
|
|||
}, |
|||
handleExport(id) { |
|||
// 处理查询参数 |
|||
this.$modal.confirm('是否确认导出投票结果数据项?').then(() => { |
|||
this.exportLoading = true; |
|||
return exportMineVoteInfo({ id: id }); |
|||
}).then(response => { |
|||
this.$download.excel(response, '投票结果.pdf'); |
|||
this.exportLoading = false; |
|||
}).catch(() => { }); |
|||
}, |
|||
|
|||
/** |
|||
* 获取结果 |
|||
*/ |
|||
handleResult(row) { |
|||
this.tableData2 = [], |
|||
getMineVoteDetail({id: row.id}).then(res => { |
|||
this.form = res.data; |
|||
this.form.id = row.id |
|||
if (row.voteType == 3) { |
|||
this.voteType3List = res.data.mineMultipleVoteTable.itemList |
|||
console.log(this.voteType3List, '数据') |
|||
} |
|||
this.resultVoteOpend = true; |
|||
this.title = "投票结果" |
|||
}) |
|||
|
|||
}, |
|||
|
|||
// 树权限(父子联动) |
|||
cancel() { |
|||
this.resultVoteOpend = false; |
|||
}, |
|||
|
|||
|
|||
|
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
margin-left: 20px; |
|||
|
|||
&:last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
} |
|||
|
|||
.flex { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.subOptions { |
|||
padding: 5px 0; |
|||
} |
|||
|
|||
.btndaocho { |
|||
display: flex; |
|||
justify-content: flex-end; |
|||
margin-top: -20px; |
|||
width: 100%; |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue