Browse Source

获取待维修信息

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

5
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 } app.fs.api.logAttr['POST/patrolRecord/add'] = { content: '新增巡检记录', visible: true }
router.post('/patrolRecord/add', patrolRecord.addPatrolRecord); 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 }; app.fs.api.logAttr['POST/patrolRecord/issue/handle'] = { content: '增加维修处理计划', visible: true };
router.post('/patrolRecord/issue/handle', patrolRecord.addPatrolRecordIssueHandle(opts)) router.post('/patrolRecord/issue/handle', patrolRecord.addPatrolRecordIssueHandle(opts))
// 修改维修处理计划 // 修改维修处理计划
app.fs.api.logAttr['PUT/patrolRecord/issue/handle/:id'] = { content: '修改维修处理计划', visible: true }; app.fs.api.logAttr['PUT/patrolRecord/issue/handle/:id'] = { content: '修改维修处理计划', visible: true };
router.put('/patrolRecord/issue/handle/:id', patrolRecord.editPatrolRecordIssueHandle(opts)) router.put('/patrolRecord/issue/handle/:id', patrolRecord.editPatrolRecordIssueHandle(opts))

26
weapp/package/troubleshooting/index.js

@ -1,4 +1,7 @@
// package/bindTroubleshooting/index.js // package/bindTroubleshooting/index.js
import { getPatrolRecordIssueHandle } from "../../utils/getApiUrl";
import { Request } from "../../common";
Page({ Page({
/** /**
@ -23,15 +26,24 @@ Page({
currentTab: e.currentTarget.dataset.current currentTab: e.currentTarget.dataset.current
}) })
if (e.currentTarget.dataset.current == '0') { if (e.currentTarget.dataset.current == '0') {
this.setData({
page: 0,
dataList: []
}, () => {
// this.getPatrolPlan();
})
} else if (e.currentTarget.dataset.current == '1') { } 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 = () => { exports.loginUrl = () => {
return `/login` return `/login`
} }
// 登出 // 登出
exports.logoutUrl = () => { exports.logoutUrl = () => {
return `/logout` return `/logout`
} }
// 获取巡检总览 // 获取巡检总览
exports.getProjectList = () => { exports.getProjectList = () => {
return `/projectList` return `/projectList`
} }
// 获取巡检计划 // 获取巡检计划
exports.getPatrolPlan = () => { exports.getPatrolPlan = () => {
return `/patrolPlan` return `/patrolPlan`
} }
// 开始巡检录入 // 开始巡检录入
exports.addPatrolRecord = () => { exports.addPatrolRecord = () => {
return `/patrolRecord/add` return `/patrolRecord/add`
} }
// 获取巡检记录 // 获取巡检记录
exports.getPatrolRecord = (patrolPlanId, startTime, endTime, alarm, pointId) => { exports.getPatrolRecord = (patrolPlanId, startTime, endTime, alarm, pointId) => {
return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}/${pointId}` return `/patrolRecord/${patrolPlanId}/${startTime}/${endTime}/${alarm}/${pointId}`
} }
// 获取巡检模板 // 获取巡检模板
exports.getPatrolTemplate = (id) => { exports.getPatrolTemplate = (id) => {
return `/patrolTemplate?id=${id}` return `/patrolTemplate?id=${id}`
}
exports.getPatrolRecordIssueHandle = (id) => {
return `/patrolRecord/issue/handle`
} }
Loading…
Cancel
Save