Ver a proveniência

网上家园投票优化

wulanhaote
yujk há 3 anos
ascendente
cometimento
d06d64c3ad
7 ficheiros alterados com 129 adições e 50 eliminações
  1. +9
    -0
      src/api/onlineHome/threeAffairs.js
  2. +28
    -18
      src/views/onlineHome/done.vue
  3. +2
    -2
      src/views/onlineHome/homePoll.vue
  4. +35
    -19
      src/views/onlineHome/homePollDetail.vue
  5. +20
    -3
      src/views/onlineHome/threeAffairsDetail.vue
  6. +21
    -5
      src/views/onlineHome/villageAffairsDetail.vue
  7. +14
    -3
      src/views/onlineHome/workbench.vue

+ 9
- 0
src/api/onlineHome/threeAffairs.js Ver ficheiro

@@ -59,3 +59,12 @@ export function getVillageAffairs(id) {
method: 'get'
})
}

//查询已上传附件
export const attachmentList = (data) => {
return request({
url: '/system/attachment/query',
method: 'get',
params: data
})
}

+ 28
- 18
src/views/onlineHome/done.vue Ver ficheiro

@@ -14,7 +14,7 @@
<van-cell-group v-for="(item,index) in taskList" :key="index" style="width: 96%;margin:2%;border-radius: 6px;overflow: hidden;padding-top: 10px;padding-bottom: 10px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);">
<van-cell>
<template #title>
<van-row style="margin-bottom:10px ">
<van-row style="">
<van-col span="23" :offset="1">

<h3 style="display: inline-block;line-height: 30px;margin-left: 6px;width: 100%;overflow: hidden;">
@@ -26,16 +26,6 @@
</van-col>
</van-row>
</template>
<template #label>
<van-row style="margin: 5px 0">
<van-col span="15" :offset="1">
<p style="font-size: 14px;">申请:</p>
</van-col>
<van-col span="6" :offset="2">
<p style="font-size: 14px;font-weight:bold;text-align: right;color: #1D6FE9">{{activeName=='1'?'待审批':'已审批'}}</p>
</van-col>
</van-row>
</template>
</van-cell>
<van-cell>
<template #title>
@@ -43,8 +33,11 @@
<van-col span="6" :offset="1">
<p style="color: #878787">{{item.createTime?item.createTime.substring(0,10):item.startTime.substring(0,10)}}</p>
</van-col>
<van-col span="16" :offset="1">
<p style="color: #878787">{{item.tableName}}</p>
<van-col span="10" :offset="1">
<p style="color: #878787">{{item.formData.activityBusinessType}}</p>
</van-col>
<van-col span="5" :offset="1">
<p style="font-size: 14px;font-weight:bold;text-align: right;color: #1D6FE9">{{activeName=='1'?'待审批':'已审批'}}</p>
</van-col>
</van-row>
</template>
@@ -71,10 +64,15 @@
pageNum: 1,
pageSize: 100,
},
activityBusinessTypeOptions:[],
}
},
created() {
this.getList();
this.getDicts("activity_business_type").then((response) => {
this.activityBusinessTypeOptions = response.data;
this.getList();
});

},
methods: {
getList() {
@@ -82,7 +80,6 @@
this.$set(this.queryParams, "systemType", '');
if(this.activeName=='1'){
ListTodo(this.queryParams).then((response) => {
console.log(response)
response.rows.map(res => {
if(res.tableName?res.tableName.indexOf('house')>0:""){
res.tableName = '来自农村宅基地管理系统'
@@ -91,12 +88,18 @@
}else if(res.tableName?res.tableName.indexOf('yinnong')>0:""){
res.tableName = '来自银农直联审批管理系统'
}
this.taskList.push(res)
if(this.activityBusinessTypeOptions){
this.activityBusinessTypeOptions.map(t => {
if(t.dictValue == res.formData.activityBusinessType){
res.formData.activityBusinessType = t.dictLabel
this.taskList.push(res)
}
});
}
})
})
}else{
ListDone(this.queryParams).then((response) => {
console.log(response)
response.rows.map(res => {
if(res.tableName?res.tableName.indexOf('house')>0:""){
res.tableName = '来自农村宅基地管理系统'
@@ -105,7 +108,14 @@
}else if(res.tableName?res.tableName.indexOf('yinnong')>0:""){
res.tableName = '来自银农直联审批管理系统'
}
this.taskList.push(res)
if(this.activityBusinessTypeOptions){
this.activityBusinessTypeOptions.map(t => {
if(t.dictValue == res.formData.activityBusinessType){
res.formData.activityBusinessType = t.dictLabel
this.taskList.push(res)
}
});
}
})
})
}


+ 2
- 2
src/views/onlineHome/homePoll.vue Ver ficheiro

@@ -40,8 +40,8 @@
</van-col>
<van-col span="4">
<h3 v-if="new Date(item.startTime) > new Date()" style="line-height: 50px;color: #1D6FE9" >未开始</h3>
<h3 v-if="new Date(item.endTime) < new Date()" style="line-height: 50px;color: #1D6FE9" @click="go(item.id)">查看</h3>
<h3 v-if="new Date(item.startTime) <= new Date() && new Date(item.endTime) >= new Date()" style="line-height: 50px;color: #1D6FE9" @click="go(item.id)">投票</h3>
<h3 v-if="new Date(item.endTime) < new Date()" style="line-height: 50px;color: #1D6FE9" @click="go(item.id)">已结束</h3>
<h3 v-if="new Date(item.startTime) <= new Date() && new Date(item.endTime) >= new Date()" style="line-height: 50px;color: #1D6FE9" @click="go(item.id)">投票</h3>
</van-col>
</van-row>
</van-list>


+ 35
- 19
src/views/onlineHome/homePollDetail.vue Ver ficheiro

@@ -5,9 +5,9 @@
left-arrow
@click-left="$router.back(-1)"
>
<template #right>
<!--<template #right>
<van-image src=""></van-image>
</template>
</template>-->
</van-nav-bar>
<van-row style="margin-top: 20px">
<van-col span="20" offset="2">
@@ -23,13 +23,13 @@
<van-row style="margin-top: 10px">
<van-col span="9" offset="2">
<van-image
v-if="form.anonymous==1"
v-if="form.anonymous!=1"
width="12"
height="12"
style="display: inline-block;"
src="../../../static/images/onlineHome/vote1.png"
/>
<p style="display: inline-block;color:#1D6FE9 ">实名</p>
<p style="display: inline-block;color:#1D6FE9" v-if="form.anonymous!=1">实名</p>
<van-image
v-if="form.type==1"
width="12"
@@ -68,7 +68,7 @@
src="../../../static/images/onlineHome/home3.png"
/>
</template>
<van-checkbox :name="item.id" style="float: right"/>
<van-checkbox :name="item.id" style="float: right" :disabled="!isPoll"/>
</van-cell>
<van-row>
<van-col span="15" :offset="2" style="margin-top: 7px;">
@@ -95,31 +95,39 @@
src="../../../static/images/onlineHome/home3.png"
/>
</template>
<van-radio :name="item.id" style="float: right" />
<van-radio :name="item.id" style="float: right" :disabled="!isPoll"/>
</van-cell>
<van-row>
<van-col span="15" :offset="2" style="margin-top: 7px;">
<van-progress v-if="result1!=item" :percentage="voteNum>0?((item.num/voteNum)*100).toFixed(2):0" :show-pivot="false"/>
<van-progress v-if="result1==item" :percentage="voteNum>0?(((item.num+1)/(voteNum+1))*100).toFixed(2):0" :show-pivot="false"/>
<van-progress v-if="result1!=item.id" :percentage="voteNum>0?((item.num/voteNum)*100).toFixed(2):0" :show-pivot="false"/>
<van-progress v-if="result1==item.id&&voteNum>0" :percentage="voteNum>0?(((item.num+1)/(voteNum+1))*100).toFixed(2):0" :show-pivot="false"/>
<van-progress v-if="result1==item.id&&voteNum==0" :percentage="voteNum==0?(((item.num+1)/(voteNum+1))*100).toFixed(2):0" :show-pivot="false"/>
</van-col>
<van-col span="5" :offset="2" v-if="result1!=item.id">
{{item.num}}票 {{voteNum>0?((item.num/voteNum)*100).toFixed(2):0}}%
</van-col>
<van-col span="5" :offset="2" v-if="result1==item.id">
<van-col span="5" :offset="2" v-if="result1==item.id&&voteNum>0">
{{item.num+1}}票 {{voteNum>0?(((item.num+1)/(voteNum+1))*100).toFixed(2):0}}%
</van-col>
<van-col span="5" :offset="2" v-if="result1==item.id&&voteNum==0">
{{item.num+1}}票 {{voteNum==0?(((item.num+1)/(voteNum+1))*100).toFixed(2):0}}%
</van-col>
</van-row>
</van-cell-group>
</van-radio-group>
<van-row style="text-align: center;margin-top: 40px" v-if="isPoll">
<van-button color="#1D6FE9" style="border-radius: 6px;width: 90%;margin: 0 auto" @click="submit">提交</van-button>
</van-row>
<van-row style="text-align: center;margin-top: 40px" v-if="!isPoll">
<van-button color="#1D6FE9" style="border-radius: 6px;width: 90%;margin: 0 auto" @click="submit" :disabled="true">已投票</van-button>
</van-row>
</div>
</template>

<script>
import onlineHomeIndex from "../onlineHomeIndex";
import {getPoll, listPollVote, votePoll} from "../../api/onlineHome/poll";
import {getInfo} from "../../api/login";

export default {
components: {
@@ -139,15 +147,23 @@
};
},
created() {
this.form={}
this.getInfo(this.id);
listPollVote().then(res => {
if(res.rows.length>0){
res.rows.map(r => {
if(r.pollId==this.id){
this.isPoll=false
}
})
}
console.log(this.$store)
getInfo().then(response => {
console.log(response)
if(res.rows.length>0){
res.rows.map(r => {
if(r.pollId==this.id){
if(r.userId == response.user.userId){
this.isPoll = false
}
}
})
}
});

})
},
methods:{
@@ -171,7 +187,7 @@
let _this = this
if (this.form.type == 1) {
if (this.result1 != "") {
list.push(this.pollRadioValue)
list.push(this.result1)
} else {
this.$toast({
icon: 'error', // 找到自己需要的图标
@@ -185,7 +201,7 @@
}
} else {
if (this.result.length > 0) {
list = this.result
list.push(this.result)
} else {
this.$toast({
icon: 'error', // 找到自己需要的图标
@@ -203,7 +219,7 @@
message: '保存成功',
duration:"1000",
onClose:function(){
_this.getInfo(this.id);
_this.$router.go(-1)
}
})
});


+ 20
- 3
src/views/onlineHome/threeAffairsDetail.vue Ver ficheiro

@@ -25,13 +25,17 @@
</van-col>
</van-row>
<div id="content"></div>
<p style="margin-top:20px;">附件下载</p>
<van-cell v-for="(item,index) in fileList" :key="index">
<a :href="item.fileUrl">{{index+1}}.{{item.fileName}}</a>
</van-cell>
</div>
</template>

<script>
import onlineHomeIndex from "../onlineHomeIndex";
import {getAffairs, listAffairs} from "../../api/onlineHome/threeAffairs";
import {attachmentList, getAffairs, listAffairs} from "../../api/onlineHome/threeAffairs";
import request from '@/utils/request'
export default {
components: {

@@ -53,7 +57,9 @@
isWechat: null,
status: null,
},
form:{}
form:{},
fileList: [], //上传附件图片列表
fileListData: [], //上传附件图片列表参数
};
},
created() {
@@ -73,6 +79,17 @@
getAffairs(this.id).then(response => {
this.form = response.data
document.getElementById('content').innerHTML = response.data.content;
let params = {
"fileType" : "0",
"tableName":"t_village_affairs",
"tableId":this.id,
}
attachmentList(params).then((res) => {
res.rows.map(r => {
r.fileUrl = location.protocol+"//"+location.host+request.defaults.baseURL+r.fileUrl
this.fileList.push(r)
})
});
})
},
},


+ 21
- 5
src/views/onlineHome/villageAffairsDetail.vue Ver ficheiro

@@ -25,13 +25,17 @@
</van-col>
</van-row>
<div id="content"></div>
<p style="margin-top:20px;">附件下载</p>
<van-cell v-for="(item,index) in fileList" :key="index">
<a :href="item.fileUrl">{{index+1}}.{{item.fileName}}</a>
</van-cell>
</div>
</template>

<script>
import onlineHomeIndex from "../onlineHomeIndex";
import {getAffairs, getVillageAffairs, listAffairs} from "../../api/onlineHome/threeAffairs";
import {attachmentList, getAffairs, getVillageAffairs, listAffairs} from "../../api/onlineHome/threeAffairs";
import request from '@/utils/request'
export default {
components: {

@@ -39,8 +43,6 @@
name: "villageAffairsDetail",
data() {
return {
loading: false,
finished: false,
id:null,
type:"",
// 查询参数
@@ -53,7 +55,9 @@
isWechat: null,
status: null,
},
form:{}
form:{},
fileList: [], //上传附件图片列表
fileListData: [], //上传附件图片列表参数
};
},
created() {
@@ -75,6 +79,18 @@
getVillageAffairs(this.id).then(response => {
this.form = response.data
document.getElementById('content').innerHTML = response.data.content;
let params = {
"fileType" : "0",
"tableName":"t_village_affairs",
"tableId":this.id,
}
attachmentList(params).then((res) => {
console.log(res)
res.rows.map(r => {
r.fileUrl = location.protocol+"//"+location.host+request.defaults.baseURL+r.fileUrl
this.fileList.push(r)
})
});
})
},
},


+ 14
- 3
src/views/onlineHome/workbench.vue Ver ficheiro

@@ -19,13 +19,15 @@
</van-swipe-item>
</van-swipe>
<van-row style="margin:2%;width:96%;padding:20px 0;border-radius: 6px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16); min-height: 100px;background: #fff;">
<van-cell style="border-radius: 6px;">
<van-cell style="border-radius: 6px;" is-link to="done">
<template #title>
<p style="display:inline-block;background: #EC4B2C;height:20px;width: 20px;border-radius: 2px;margin-right: 10px;float: left"></p>
<p style="font-weight: bold;font-size: 18px;display: inline-block">待办</p>
<p style="font-weight: bold;font-size: 18px;display: inline-block;">待办</p>
</template>
<template #label>
<p>暂无代办</p>
<p style="padding-left: 10px;">
{{taskList&&taskList.length>0?taskList[0].projectName+'等,共'+taskList.length+'条':'暂无待办事项'}}
</p>
</template>
</van-cell>
</van-row>
@@ -410,6 +412,7 @@
<script>
import onlineHomeIndex from "../onlineHomeIndex";
import {getInfo} from "../../api/login";
import {ListTodo} from "../../api/onlineHome/done";
export default {
components: {
onlineHomeIndex
@@ -420,6 +423,11 @@
list1: [],
images:['../../../static/images/onlineHome/tab.jpg'],
deptName:"",
queryParams: {
pageNum: 1,
pageSize: 100,
},
taskList:[],
};
},
created() {
@@ -427,6 +435,9 @@
console.log(response)
this.deptName = response.user.deptName
});
ListTodo(this.queryParams).then((response) => {
this.taskList = response.rows
})
},

}


Carregando…
Cancelar
Guardar