diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js
index f6d5783..35c796a 100644
--- a/api/app/lib/controllers/patrolManage/patrolRecord.js
+++ b/api/app/lib/controllers/patrolManage/patrolRecord.js
@@ -136,6 +136,30 @@ async function findPatrolRecord (ctx, next) {
}
}
+async function findPatrolRecordUnlicensed(ctx, next) {
+ let rslt = [];
+ let error = { name: 'FindError', message: '获取巡检记录失败' };
+ try {
+ const models = ctx.fs.dc.models;
+ const { startTime, endTime } = ctx.query;
+ const options = {
+ where: {}
+ }
+ if (startTime && endTime) {
+ options.where.inspectionTime = { $between: [startTime, endTime] };
+ }
+ rslt = await models.PatrolRecord.findAll(options);
+ ctx.status = 200;
+ ctx.body = rslt;
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = {
+ "message": "获取巡检记录失败"
+ }
+ }
+}
+
async function addPatrolRecord (ctx, next) {
let error = { name: 'addError', message: '新增巡检记录失败' };
const transaction = await ctx.fs.dc.orm.transaction();
@@ -307,10 +331,10 @@ function editPatrolRecordIssueHandle (opts) {
module.exports = {
findPatrolRecord,
+ findPatrolRecordUnlicensed,
addPatrolRecord,
getPatrolRecordIssueHandle,
getPatrolRecordIssueHandleById,
addPatrolRecordIssueHandle,
editPatrolRecordIssueHandle
-
}
\ No newline at end of file
diff --git a/api/app/lib/middlewares/authenticator.js b/api/app/lib/middlewares/authenticator.js
index 447690d..b1c283e 100644
--- a/api/app/lib/middlewares/authenticator.js
+++ b/api/app/lib/middlewares/authenticator.js
@@ -59,6 +59,7 @@ let isPathExcluded = function (opts, path, method) {
let excludeOpts = opts.exclude || [];
excludeOpts.push({ p: '/login', o: 'POST' });
excludeOpts.push({ p: '/logout', o: 'PUT' });
+ excludeOpts.push({ p: '/patrolRecord/unlicensed', o: 'GET' });
excludes = new ExcludesUrls(excludeOpts);
}
let excluded = excludeAll || excludes.isExcluded(path, method);
diff --git a/api/app/lib/routes/patrolManage/patrolRecord.js b/api/app/lib/routes/patrolManage/patrolRecord.js
index 2c21e7a..1535b07 100644
--- a/api/app/lib/routes/patrolManage/patrolRecord.js
+++ b/api/app/lib/routes/patrolManage/patrolRecord.js
@@ -7,6 +7,10 @@ module.exports = function (app, router, opts) {
// 小程序端查点位最新一条数据:startTime、endTime、alarm不传
router.get('/patrolRecord/:patrolPlanId/:startTime/:endTime/:alarm/:pointId', patrolRecord.findPatrolRecord);
+ app.fs.api.logAttr['GET/patrolRecord/unlicensed'] = { content: '获取巡检记录', visible: true };
+ // 获取巡检记录,免token,用与生成巡检报告
+ router.get('/patrolRecord/unlicensed', patrolRecord.findPatrolRecordUnlicensed);
+
app.fs.api.logAttr['POST/patrolRecord/add'] = { content: '新增巡检记录', visible: true }
router.post('/patrolRecord/add', patrolRecord.addPatrolRecord);
diff --git a/weapp/app.json b/weapp/app.json
index 48ca4ea..c143865 100644
--- a/weapp/app.json
+++ b/weapp/app.json
@@ -15,7 +15,8 @@
"startInspection/startInspection",
"inspectionInput/inspectionInput",
"troubleshooting/index",
- "troubleshooting/shootingForm/index"
+ "troubleshooting/shootingForm/index",
+ "inspectionReport/inspectionReport"
]
}
],
diff --git a/weapp/images/inspection-report.svg b/weapp/images/inspection-report.svg
new file mode 100644
index 0000000..49ddb80
--- /dev/null
+++ b/weapp/images/inspection-report.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/weapp/package/inspectionReport/inspectionReport.js b/weapp/package/inspectionReport/inspectionReport.js
new file mode 100644
index 0000000..0fccf18
--- /dev/null
+++ b/weapp/package/inspectionReport/inspectionReport.js
@@ -0,0 +1,66 @@
+// package/inspectionReport/inspectionReport.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/weapp/package/inspectionReport/inspectionReport.json b/weapp/package/inspectionReport/inspectionReport.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/weapp/package/inspectionReport/inspectionReport.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/weapp/package/inspectionReport/inspectionReport.wxml b/weapp/package/inspectionReport/inspectionReport.wxml
new file mode 100644
index 0000000..90de8ed
--- /dev/null
+++ b/weapp/package/inspectionReport/inspectionReport.wxml
@@ -0,0 +1,2 @@
+
+package/inspectionReport/inspectionReport.wxml
diff --git a/weapp/package/inspectionReport/inspectionReport.wxss b/weapp/package/inspectionReport/inspectionReport.wxss
new file mode 100644
index 0000000..b130672
--- /dev/null
+++ b/weapp/package/inspectionReport/inspectionReport.wxss
@@ -0,0 +1 @@
+/* package/inspectionReport/inspectionReport.wxss */
\ No newline at end of file
diff --git a/weapp/pages/overview/overview.js b/weapp/pages/overview/overview.js
index ca01b03..1bbd590 100644
--- a/weapp/pages/overview/overview.js
+++ b/weapp/pages/overview/overview.js
@@ -21,6 +21,12 @@ Page({
})
},
+ bindInspectionReport() {
+ wx.navigateTo({
+ url: '/package/inspectionReport/inspectionReport',
+ })
+ },
+
/**
* 生命周期函数--监听页面加载
*/
diff --git a/weapp/pages/overview/overview.wxml b/weapp/pages/overview/overview.wxml
index f95e500..98ce914 100644
--- a/weapp/pages/overview/overview.wxml
+++ b/weapp/pages/overview/overview.wxml
@@ -10,9 +10,9 @@
问题处理
-
+
\ No newline at end of file
diff --git a/web/client/src/sections/issueHandle/containers/patrolRecord.js b/web/client/src/sections/issueHandle/containers/patrolRecord.js
index ab3ed67..fe33a80 100644
--- a/web/client/src/sections/issueHandle/containers/patrolRecord.js
+++ b/web/client/src/sections/issueHandle/containers/patrolRecord.js
@@ -165,7 +165,7 @@ const PatrolRecord = (props) => {
onFinish={onFinish} />)
}
- if (Func.isAuthorized('XIUGAIJIUHA') && (record?.patrolRecordIssueHandles[0]?.state == 3 || record?.patrolRecordIssueHandles[0]?.state == 2)) {
+ if (Func.isAuthorized('ZHIDINGJIHUA') && (record?.patrolRecordIssueHandles[0]?.state == 3 || record?.patrolRecordIssueHandles[0]?.state == 2)) {
options.push(} key="issueHandle">