From 68890e6ef41cefe97f4678228eda874c81ecac5d Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sun, 7 Feb 2021 16:23:02 +0800 Subject: [PATCH] staff self --- .../myQuestionAnswerManage.html | 8 +- .../myQuestionAnswerManage.js | 19 ++- .../userQuestionAnswerManage.html | 56 +++++++++ .../userQuestionAnswerManage.js | 114 ++++++++++++++++++ 4 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.html create mode 100644 public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.js diff --git a/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.html b/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.html index 147f23e04..47eff716d 100644 --- a/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.html +++ b/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.html @@ -61,6 +61,8 @@ 问卷名称 开始时间 结束时间 + 状态 + 得分 操作 @@ -71,9 +73,13 @@ {{questionAnswer.qaName}} {{questionAnswer.startTime}} {{questionAnswer.endTime}} + {{_getStateName(questionAnswer.state)}} + {{questionAnswer.score}}
- +
diff --git a/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.js b/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.js index a3e437991..c3beea9f7 100644 --- a/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.js +++ b/public/pages/property/myQuestionAnswerManage/myQuestionAnswerManage.js @@ -16,7 +16,8 @@ qaType: '', qaName: '', qaId: '', - communityId:vc.getCurrentCommunity().communityId + communityId:vc.getCurrentCommunity().communityId, + roleCd:'staff' } } }, @@ -42,7 +43,7 @@ }; //发送get请求 - vc.http.apiGet('/questionAnswer/queryQuestionAnswer', + vc.http.apiGet('/userQuestionAnswer/queryUserQuestionAnswer', param, function (json, res) { var _myQuestionAnswerManageInfo = JSON.parse(json); @@ -59,7 +60,10 @@ ); }, _toQuestionAnswerTitle:function(_questionAnswer){ - vc.jumpToPage('/admin.html#/pages/property/questionAnswerTitleManage?qaId='+_questionAnswer.qaId+"&objType="+_questionAnswer.objType+"&objId="+_questionAnswer.objId) + vc.jumpToPage('/admin.html#/pages/property/userQuestionAnswerManage?qaId='+_questionAnswer.qaId+"&objType="+_questionAnswer.objType+"&objId="+_questionAnswer.objId) + }, + _queryQuestionAnswerMethod: function () { + vc.component._listQuestionAnswers(DEFAULT_PAGE, DEFAULT_ROWS); }, _moreCondition: function () { if (vc.component.myQuestionAnswerManageInfo.moreCondition) { @@ -67,6 +71,15 @@ } else { vc.component.myQuestionAnswerManageInfo.moreCondition = true; } + }, + _getStateName:function(_state){ + if(_state == '1201'){ + return '待领导评价'; + }else if(_state == '1202'){ + return '完成'; + } + + return '待答题' } diff --git a/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.html b/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.html new file mode 100644 index 000000000..444ab1672 --- /dev/null +++ b/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.html @@ -0,0 +1,56 @@ +
+
+
+
+
+
我的问卷
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + +
+
\ No newline at end of file diff --git a/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.js b/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.js new file mode 100644 index 000000000..11f5e8273 --- /dev/null +++ b/public/pages/property/userQuestionAnswerManage/userQuestionAnswerManage.js @@ -0,0 +1,114 @@ +/** + 入驻小区 +**/ +(function (vc) { + var DEFAULT_PAGE = 1; + var DEFAULT_ROWS = 10; + vc.extends({ + data: { + userQuestionAnswerManageInfo: { + questionAnswerTitles: [], + total: 0, + records: 1, + moreCondition: false, + qaId: '', + objType: '', + objId: '', + answerType: '1002' + } + }, + _initMethod: function () { + let _that = $that.userQuestionAnswerManageInfo; + let _qaId = vc.getParam('qaId'); + _that.qaId = _qaId; + _that.objType = vc.getParam('objType'); + _that.objId = vc.getParam('objId'); + vc.component._listQuestionAnswerTitles(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _initEvent: function () { + }, + methods: { + _listQuestionAnswerTitles: function (_page, _rows) { + let _that = $that.userQuestionAnswerManageInfo; + + var param = { + params: { + page: 1, + row: 100, + qaId: _that.qaId, + objType: _that.objType, + objId: _that.objId + } + }; + + //发送get请求 + vc.http.apiGet('/questionAnswer/queryQuestionAnswerTitle', + param, + function (json, res) { + let _userQuestionAnswerManageInfo = JSON.parse(json); + _that.questionAnswerTitles = _userQuestionAnswerManageInfo.data; + _that.questionAnswerTitles.forEach(item => { + + if (item.titleType == '3003') { + item.valueContent = ''; + } else { + item.valueContent = []; + } + + }); + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _toQuestionAnswerTitle: function (_questionAnswer) { + vc.jumpToPage('/admin.html#/pages/property/questionAnswerTitleManage?qaId=' + _questionAnswer.qaId + "&objType=" + _questionAnswer.objType + "&objId=" + _questionAnswer.objId) + }, + _queryQuestionAnswerMethod: function () { + vc.component._listQuestionAnswers(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _moreCondition: function () { + if (vc.component.userQuestionAnswerManageInfo.moreCondition) { + vc.component.userQuestionAnswerManageInfo.moreCondition = false; + } else { + vc.component.userQuestionAnswerManageInfo.moreCondition = true; + } + }, + _getStateName: function (_state) { + if (_state == '1201') { + return '待领导评价'; + } else if (_state == '1202') { + return '完成'; + } + + return '待答题' + }, + _goBack: function () { + vc.goBack(); + }, + _saveUserQuestionAnswer: function () { + vc.http.apiPost( + '/userQuestionAnswer/saveUserQuestionAnswerValue', + JSON.stringify(vc.component.userQuestionAnswerManageInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let data = JSON.parse(json); + if (data.code != 0) { + vc.toast(data.msg); + return; + } + $that._goBack(); + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo); + }); + } + + + } + }); +})(window.vc);