From b8b5fd373f7153644cfc2bcb1254581093e49c62 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 29 Apr 2020 22:24:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A1=E6=A3=80=E6=89=93?= =?UTF-8?q?=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constant/UrlConstant.js | 6 ++- pages/inspection/inspection.vue | 87 +++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 4 deletions(-) diff --git a/constant/UrlConstant.js b/constant/UrlConstant.js index 8bb933b..04cde1c 100644 --- a/constant/UrlConstant.js +++ b/constant/UrlConstant.js @@ -58,6 +58,9 @@ const listActivitiess = baseUrl + "app/activities.listActivitiess"; //查询小 const listAdvertPhoto = baseUrl + "app/advert.listAdvertPhoto"; +//查询巡检任务 +const listInspectionTasks = baseUrl + "app/inspectionTask.listInspectionTasks"; + module.exports = { baseUrl: baseUrl, @@ -88,5 +91,6 @@ module.exports = { listActivitiess: listActivitiess, filePath: filePath, listAdvertPhoto: listAdvertPhoto, - saveOwnerRepair:saveOwnerRepair + saveOwnerRepair:saveOwnerRepair, + listInspectionTasks:listInspectionTasks }; \ No newline at end of file diff --git a/pages/inspection/inspection.vue b/pages/inspection/inspection.vue index 8183fd0..98fe7f9 100644 --- a/pages/inspection/inspection.vue +++ b/pages/inspection/inspection.vue @@ -1,6 +1,35 @@ @@ -8,15 +37,67 @@ export default { data() { return { - + tasks: [], + communityId: '', + userId: '', + userName: '' } }, + onLoad: function() { + this.communityId = this.java110Context.getCurrentCommunity().communityId; + let _userInfo = this.java110Context.getUserInfo(); + console.log("_userInfo", _userInfo); + this.userName = _userInfo.userName; + this.userId = _userInfo.userId; + this._queryInstpectionTasks(); + }, methods: { - + _startInspection:function(_item){ + console.log('开始巡检',_item); + }, + _queryInstpectionTasks: function() { + let _that = this; + + _that.java110Context.request({ + header: _that.java110Context.getHeaders(), + url: _that.java110Constant.url.listInspectionTasks, + method: "GET", + data: { + communityId: _that.communityId, + page: 1, + row: 10, + planUserId: _that.userId, + state: '20200405' + }, + success: function(res) { + // TODO 判断 + console.log(res); + res.data.inspectionTasks.forEach(function(item, index) { + item.timeStr = item.planInsTime.replace(/:\d{1,2}$/, ' '); + }); + _that.tasks = res.data.inspectionTasks; + } + }); + } + } }