From 7b3c60a5ffad56dec1b5b2d995dcb81becbe961a Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 1 Mar 2023 16:15:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BE=85=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/routes/patrolManage/patrolRecord.js | 5 +++- weapp/package/troubleshooting/index.js | 26 ++++++++++++++----- weapp/utils/getApiUrl.js | 18 ++++++++----- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/api/app/lib/routes/patrolManage/patrolRecord.js b/api/app/lib/routes/patrolManage/patrolRecord.js index 376cad3..8fd68ba 100644 --- a/api/app/lib/routes/patrolManage/patrolRecord.js +++ b/api/app/lib/routes/patrolManage/patrolRecord.js @@ -10,10 +10,13 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['POST/patrolRecord/add'] = { content: '新增巡检记录', visible: true } router.post('/patrolRecord/add', patrolRecord.addPatrolRecord); + app.fs.api.logAttr['GET/patrolRecord/issue/handle'] = { content: '获取维修处理计划', visible: true }; + router.get('/patrolRecord/issue/handle', patrolRecord.getPatrolRecordIssueHandle) + app.fs.api.logAttr['POST/patrolRecord/issue/handle'] = { content: '增加维修处理计划', visible: true }; router.post('/patrolRecord/issue/handle', patrolRecord.addPatrolRecordIssueHandle(opts)) - + // 修改维修处理计划 app.fs.api.logAttr['PUT/patrolRecord/issue/handle/:id'] = { content: '修改维修处理计划', visible: true }; router.put('/patrolRecord/issue/handle/:id', patrolRecord.editPatrolRecordIssueHandle(opts)) diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index ffa2bbb..dd2f714 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -1,4 +1,7 @@ // package/bindTroubleshooting/index.js +import { getPatrolRecordIssueHandle } from "../../utils/getApiUrl"; +import { Request } from "../../common"; + Page({ /** @@ -23,15 +26,24 @@ Page({ currentTab: e.currentTarget.dataset.current }) if (e.currentTarget.dataset.current == '0') { - this.setData({ - page: 0, - dataList: [] - }, () => { - // this.getPatrolPlan(); - }) + } else if (e.currentTarget.dataset.current == '1') { - // this.getPatrolRecord(); + } + this.setData({ + page: 0, + dataList: [] + }, () => { + this.getData({ + type: e.currentTarget.dataset.current == '0' ? 'backlog' : 'haveDone' + }); + }) + }, + + getData (params) { + Request.get(getPatrolRecordIssueHandle, {}).then(res => { + console.log(res); + }) }, // 筛选选择 diff --git a/weapp/utils/getApiUrl.js b/weapp/utils/getApiUrl.js index f26d9cd..cc03847 100644 --- a/weapp/utils/getApiUrl.js +++ b/weapp/utils/getApiUrl.js @@ -1,34 +1,38 @@ // 登录 exports.loginUrl = () => { - return `/login` + return `/login` } // 登出 exports.logoutUrl = () => { - return `/logout` + return `/logout` } // 获取巡检总览 exports.getProjectList = () => { - return `/projectList` + return `/projectList` } // 获取巡检计划 exports.getPatrolPlan = () => { - return `/patrolPlan` + return `/patrolPlan` } // 开始巡检录入 exports.addPatrolRecord = () => { - return `/patrolRecord/add` + return `/patrolRecord/add` } // 获取巡检记录 exports.getPatrolRecord = (patrolPlanId, startTime, endTime, alarm, pointId) => { - return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}/${pointId}` + return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}/${pointId}` } // 获取巡检模板 exports.getPatrolTemplate = (id) => { - return `/patrolTemplate?id=${id}` + return `/patrolTemplate?id=${id}` +} + +exports.getPatrolRecordIssueHandle = (id) => { + return `/patrolRecord/issue/handle` } \ No newline at end of file