Browse Source

获取待维修信息

master
巴林闲侠 2 years ago
parent
commit
7b3c60a5ff
  1. 3
      api/app/lib/routes/patrolManage/patrolRecord.js
  2. 26
      weapp/package/troubleshooting/index.js
  3. 18
      weapp/utils/getApiUrl.js

3
api/app/lib/routes/patrolManage/patrolRecord.js

@ -10,6 +10,9 @@ 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))

26
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);
})
},
// 筛选选择

18
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`
}
Loading…
Cancel
Save