|
|
@ -128,7 +128,7 @@ |
|
|
|
|
|
|
|
<div class="ul" v-if="form.voteType == 3"> |
|
|
|
<div v-for="(item, index) in form.voteMultipleInfoList" :key="index" class="li"> |
|
|
|
<el-form-item label="议题" prop="startTime"> |
|
|
|
<el-form-item :label="`议题${index + 1}`" prop="startTime"> |
|
|
|
<el-input v-model="item.voteName" placeholder="请填议题内容" /> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleItemAddVoteType3(1, item, index)" |
|
|
|
v-if="index == form.voteMultipleInfoList.length - 1">增加议题</el-button> |
|
|
@ -240,12 +240,15 @@ |
|
|
|
<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="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: 100px; text-align: right;"> {{ item2.itemName }}</div> |
|
|
|
<el-progress :percentage="item2.itemRate" style="width: 400px; margin: 0 20px;"/> |
|
|
|
<el-progress :percentage="item2.itemRate*1" style="width: 400px; margin: 0 20px;" |
|
|
|
:text-inside="false" /> |
|
|
|
<!-- <el-progress :text-inside="true" :stroke-width="24" :percentage="item2.itemRate * 100" text-color="white"></el-progress> --> |
|
|
|
<h3>{{ item2.itemCount }}人</h3> |
|
|
|
<div style="line-height: 26px;">{{ item2.itemCount }}人</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -267,15 +270,36 @@ |
|
|
|
<!-- v-if="form.userHiddenType==0" --> |
|
|
|
<el-divider content-position="left" v-if="form.userHiddenType == 0">投票详情</el-divider> |
|
|
|
|
|
|
|
<el-table :data="tableData" style="width: 100%" border v-if="form.userHiddenType == 0"> |
|
|
|
<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> </el-table-column> --> |
|
|
|
<el-table-column :label="`议题名称`" align="center" prop="voteName" min-width="140" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div style="padding-bottom: 20px;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> |
|
|
|
</div> |
|
|
|
<!-- v-if="form.userHiddenType == 0" --> |
|
|
|
<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> |
|
|
|
<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"> |
|
|
@ -344,6 +368,7 @@ export default { |
|
|
|
] |
|
|
|
} |
|
|
|
], |
|
|
|
voteType3List: [], |
|
|
|
tableData: [{ |
|
|
|
date: '投票人员', |
|
|
|
name: 'Tom', |
|
|
@ -413,12 +438,17 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
inputFn(val) { |
|
|
|
this.form.attachmentList = val.split(',') |
|
|
|
console.log(val) |
|
|
|
this.form.attachmentList = val |
|
|
|
}, |
|
|
|
handleQuery() { |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
reaplas(val) { |
|
|
|
if(!val) return 0 |
|
|
|
return val.itemRate.replace('%', '') |
|
|
|
|
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.queryParams = {} |
|
|
|
this.getList(); |
|
|
@ -429,7 +459,7 @@ export default { |
|
|
|
this.exportLoading = true; |
|
|
|
return exportVoteResults({ id: this.form.id }); |
|
|
|
}).then(response => { |
|
|
|
this.$download.excel(response, '投票结果.pdf'); |
|
|
|
this.$download.excel(response, this.form.voteName + '投票结果.pdf'); |
|
|
|
this.exportLoading = false; |
|
|
|
}).catch(() => { }); |
|
|
|
}, |
|
|
@ -521,13 +551,17 @@ export default { |
|
|
|
handleResult(row) { |
|
|
|
this.tableData2 = [], |
|
|
|
getVoteItem(row.id).then(res => { |
|
|
|
|
|
|
|
this.resultVoteOpend = true; |
|
|
|
this.form = res.data; |
|
|
|
res.data.voteItemResultVOS.forEach(item => { |
|
|
|
|
|
|
|
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 = "投票结果" |
|
|
|
}) |
|
|
|
|
|
|
@ -567,9 +601,11 @@ export default { |
|
|
|
this.reset(); |
|
|
|
this.title = "修改投票" |
|
|
|
this.textVote = false; |
|
|
|
this.addVoteOpend = true; |
|
|
|
this.loading = true |
|
|
|
let _this = this |
|
|
|
getVoteItem(row.id).then(res => { |
|
|
|
|
|
|
|
_this.addVoteOpend = true; |
|
|
|
_this.loading = false |
|
|
|
if (!res.data.voteMultipleItemInfoRespList) { |
|
|
|
res.data.voteMultipleInfoList = [ |
|
|
|
{ |
|
|
@ -577,24 +613,26 @@ export default { |
|
|
|
"voteItemList": [''] |
|
|
|
} |
|
|
|
] |
|
|
|
}else { |
|
|
|
res.data.voteMultipleInfoList = res.data.voteMultipleItemInfoRespList.map(item=>{ |
|
|
|
} else { |
|
|
|
res.data.voteMultipleInfoList = res.data.voteMultipleItemInfoRespList.map(item => { |
|
|
|
|
|
|
|
let obj = { |
|
|
|
"voteName": item.voteName, |
|
|
|
voteItemList: item.voteMultipleResultList?item.voteMultipleResultList.map(item2=>item2.itemName):[''] |
|
|
|
voteItemList: item.voteMultipleResultList ? item.voteMultipleResultList.map(item2 => item2.itemName) : [''] |
|
|
|
} |
|
|
|
return obj |
|
|
|
}) |
|
|
|
|
|
|
|
console.log(res.data.voteMultipleInfoList) |
|
|
|
} |
|
|
|
this.form = res.data; |
|
|
|
console.log(this.form) |
|
|
|
_this.form = res.data; |
|
|
|
res.data.voteItemVO?.forEach(item => { |
|
|
|
this.options.push({ id: item.id, value: item.itemName }) |
|
|
|
}) |
|
|
|
_this.options.push({ id: item.id, value: item.itemName }) |
|
|
|
}) |
|
|
|
if (!_this.options.length) { |
|
|
|
_this.options = [{ id: '', value: '' }] |
|
|
|
} |
|
|
|
}).catch(() => { _this.loading = false }) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -622,6 +660,7 @@ export default { |
|
|
|
const values = this.options.map(obj => obj.value); |
|
|
|
this.form.itemIds = values.toString(); |
|
|
|
this.form.voteRoomRangs = this.$refs.roomInfo?.getCheckedKeys(true).join(',') |
|
|
|
|
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
if (!valid) { |
|
|
|
return; |
|
|
|