投票功能开发完成

This commit is contained in:
java110 2021-05-24 12:02:47 +08:00
parent 6d65fa9333
commit 32071978e0
9 changed files with 238 additions and 21 deletions

8
app.js
View File

@ -36,8 +36,8 @@ let opts = {
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
// app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
// app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
//app.use('/callComponent',proxy('http://proxy.homecommunity.cn:9011',opts));
//app.use('/app',proxy('http://proxy.homecommunity.cn:9011',opts));
@ -48,8 +48,8 @@ let opts = {
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
//app.use('/app',proxy('http://192.168.1.16:8012',opts));
app.use('/callComponent',proxy('http://127.0.0.1:8012',opts));
app.use('/app',proxy('http://127.0.1.1:8012',opts));
//app.use('/callComponent',proxy('http://127.0.0.1:8012',opts));
//app.use('/app',proxy('http://127.0.1.1:8012',opts));
//app.listen(3000);
app.use(express.json());

View File

@ -13,7 +13,7 @@
<select class="custom-select" v-model="addQuestionAnswerInfo.qaType">
<option selected disabled value="">必填,请选择问卷类型</option>
<option value="1001">业主问卷</option>
<option value="2002">员工自评</option>
<!-- <option value="2002">员工自评</option> -->
<option value="3003">业主投票</option>
<option value="4004">员工投票</option>
</select>

View File

@ -13,7 +13,7 @@
<select class="custom-select" v-model="editQuestionAnswerInfo.qaType">
<option selected disabled value="">必填,请选择问卷类型</option>
<option value="1001">业主问卷</option>
<option value="2002">员工自评</option>
<!-- <option value="2002">员工自评</option> -->
<option value="3003">业主投票</option>
<option value="4004">员工投票</option>
</select>

View File

@ -23,10 +23,10 @@
<tbody>
<tr v-for="value in questionValueInfo.values">
<td>
{{value.roomId}}
{{value.qaValue}}
</td>
<td>
{{value.floorNum}}号楼
{{value.userCount}}
</td>
</tr>
</tbody>

View File

@ -20,27 +20,27 @@
vc.component._loadAllValueInfo(1,10);
});
vc.on('questionValue','paginationPlus', 'page_event', function (_currentPage) {
vc.component._loadAllValueInfo(_currentPage, 15,vc.component.questionValueInfo._currentRoomNum);
vc.component._loadAllValueInfo(_currentPage, 15);
});
},
methods:{
_loadAllValueInfo:function(_page,_row,_roomNum){
_loadAllValueInfo:function(_page,_row){
var param = {
params:{
page:_page,
row:_row,
titleId:$that.questionValueInfo.titleId,
objType:$that.questionValueInfo.objType,
objId:$that.questionValueInfo.objId
}
};
//发送get请求
vc.http.get('questionValue',
'listRoom',
vc.http.apiGet('/questionAnswer/queryTitleValueResult',
param,
function(json){
var _roomInfo = JSON.parse(json);
vc.component.questionValueInfo.values = _roomInfo.rooms;
vc.component.questionValueInfo.values = _roomInfo.data;
vc.emit('questionValue','paginationPlus', 'init', {
total: _roomInfo.records,
currentPage: _page
@ -51,7 +51,7 @@
);
},
questionValues:function(){
vc.component._loadAllRoomInfo(1,15,vc.component.questionValueInfo._currentRoomNum);
vc.component._loadAllRoomInfo(1,15);
},
}

View File

@ -13,7 +13,7 @@
<div class="col-sm-4">
<select class="custom-select" v-model="myQuestionAnswerManageInfo.conditions.qaType">
<option selected value="">请选择问卷类型</option>
<option value="2002">员工自评</option>
<!-- <option value="2002">员工自评</option> -->
<option value="4004">员工投票</option>
</select>
</div>
@ -62,7 +62,7 @@
<th class="text-center">开始时间</th>
<th class="text-center">结束时间</th>
<th class="text-center">状态</th>
<th class="text-center">得分</th>
<!-- <th class="text-center">得分</th> -->
<th class="text-center">操作</th>
</tr>
</thead>
@ -74,10 +74,10 @@
<td class="text-center">{{questionAnswer.startTime}}</td>
<td class="text-center">{{questionAnswer.endTime}}</td>
<td class="text-center">{{_getStateName(questionAnswer.state)}}</td>
<td class="text-center">{{questionAnswer.score}}</td>
<!-- <td class="text-center">{{questionAnswer.score}}</td> -->
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs" v-if="questionAnswer.state == '1201'"
<button class="btn-white btn btn-xs" v-if="questionAnswer.state == '1202'"
>已答题</button>
<button class="btn-white btn btn-xs" v-else
v-on:click="_toQuestionAnswerTitle(questionAnswer)">答题</button>

View File

@ -14,7 +14,7 @@
<select class="custom-select" v-model="questionAnswerManageInfo.conditions.qaType">
<option selected value="">请选择问卷类型</option>
<option value="1001">业主问卷</option>
<option value="2002">员工自评</option>
<!-- <option value="2002">员工自评</option> -->
<option value="3003">业主投票</option>
<option value="4004">员工投票</option>
</select>

View File

@ -0,0 +1,105 @@
<div class=" animated fadeInRight ecommerce">
<div class="row">
<div class="col-lg-12">
<div class="ibox ">
<div class="ibox-title">
<h5>查询条件</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
v-on:click="_moreCondition()">{{reportQuestionAnswerDetailInfo.moreCondition ==
true?'隐藏':'更多'}}
</button>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<select class="custom-select" v-model="reportQuestionAnswerDetailInfo.conditions.qaType">
<option selected value="">请选择问卷类型</option>
<option value="1001">业主问卷</option>
<!-- <option value="2002">员工自评</option> -->
<option value="3003">业主投票</option>
<option value="4004">员工投票</option>
</select>
</div>
</div>
<div class="col-sm-4">
<div class="form-group input-group">
<input type="text" placeholder="请选择缴费开始时间"
v-model="reportQuestionAnswerDetailInfo.conditions.startTime"
class="form-control reportFeeDetailStartTime startTime">
</div>
</div>
<div class="col-sm-3">
<div class="form-group input-group">
<input type="text" placeholder="请选择缴费结束时间"
v-model="reportQuestionAnswerDetailInfo.conditions.endTime"
class="form-control reportFeeDetailEndTime endTime">
</div>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-md" v-on:click="_queryMethod()">
<i class="fa fa-search"></i> 查询
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>问卷明细表</h5>
<div class="ibox-tools" style="top:10px;">
<!-- <button type="button" class="btn btn-primary btn-sm" v-on:click="_exportFee()">
<i class="fa fa-plus"></i>导出
</button> -->
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">序号</th>
<th class="text-center">问卷人</th>
<th class="text-center">问卷类型</th>
<th class="text-center">问卷名称</th>
<th class="text-center">问卷题目</th>
<th class="text-center">答案</th>
<th class="text-center">时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(question,index) in reportQuestionAnswerDetailInfo.questions">
<td class="text-center">{{index+1}}</td>
<td class="text-center">{{question.userName}}</td>
<td class="text-center">{{question.qaTypeName}}</td>
<td class="text-center">{{question.qaName}}</td>
<td class="text-center">{{question.qaTitle}}</td>
<td class="text-center">{{question.qaValue}}</td>
<td class="text-center">{{question.createTime}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
<!-- 分页 -->
<div class="row">
<div class="col-md-12 text-right">
<vc:create path="frame/pagination"></vc:create>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,112 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
reportQuestionAnswerDetailInfo: {
questions: [],
total: 0,
records: 1,
moreCondition: false,
conditions: {
qaType: '',
floorName: '',
configId: '',
questionName: '',
roomNum: '',
unitId: '',
startTime: '',
endTime: ''
}
}
},
_initMethod: function () {
vc.component._initDate();
vc.component._listQuestionAnswers(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('pagination', 'page_event', function (_currentPage) {
vc.component._listQuestionAnswers(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_initDate: function () {
$(".startTime").datetimepicker({
minView: "month",
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd',
initTime: true,
initialDate: new Date(),
autoClose: 1,
todayBtn: true
});
$(".endTime").datetimepicker({
minView: "month",
language: 'zh-CN',
fontAwesome: 'fa',
format: 'yyyy-mm-dd',
initTime: true,
initialDate: new Date(),
autoClose: 1,
todayBtn: true
});
$('.startTime').datetimepicker()
.on('changeDate', function (ev) {
var value = $(".startTime").val();
vc.component.reportQuestionAnswerDetailInfo.conditions.startTime = value;
});
$('.endTime').datetimepicker()
.on('changeDate', function (ev) {
var value = $(".endTime").val();
vc.component.reportQuestionAnswerDetailInfo.conditions.endTime = value;
let start = Date.parse(new Date($that.reportQuestionAnswerDetailInfo.conditions.startTime))
let end = Date.parse(new Date($that.reportQuestionAnswerDetailInfo.conditions.endTime))
if (start - end >= 0) {
vc.toast("结束时间必须大于开始时间")
$that.reportQuestionAnswerDetailInfo.conditions.endTime = '';
}
});
},
_queryMethod:function(){
vc.component._listQuestionAnswers(DEFAULT_PAGE, DEFAULT_ROWS);
},
//查询方法
_listQuestionAnswers: function (_page, _rows) {
vc.component.reportQuestionAnswerDetailInfo.conditions.page = _page;
vc.component.reportQuestionAnswerDetailInfo.conditions.row = _rows;
vc.component.reportQuestionAnswerDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
var param = {
params: vc.component.reportQuestionAnswerDetailInfo.conditions
};
//发送get请求
vc.http.apiGet('/reportQuestionAnswer/queryUserQuestionAnswerValue',
param,
function (json, res) {
var _reportQuestionAnswerDetailInfo = JSON.parse(json);
vc.component.reportQuestionAnswerDetailInfo.total = _reportQuestionAnswerDetailInfo.total;
vc.component.reportQuestionAnswerDetailInfo.records = _reportQuestionAnswerDetailInfo.records;
vc.component.reportQuestionAnswerDetailInfo.questions = _reportQuestionAnswerDetailInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.reportQuestionAnswerDetailInfo.records,
dataCount: vc.component.reportQuestionAnswerDetailInfo.total,
currentPage: _page
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_moreCondition: function () {
if (vc.component.reportQuestionAnswerDetailInfo.moreCondition) {
vc.component.reportQuestionAnswerDetailInfo.moreCondition = false;
} else {
vc.component.reportQuestionAnswerDetailInfo.moreCondition = true;
}
}
}
});
})(window.vc);