From 41d0523c17a9b9351ec6d3fe94e334ead4654f93 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 6 Mar 2023 14:56:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/patrolManage/patrolRecord.js | 21 ++++++++++++++----- .../inspectionInput/inspectionInput.js | 3 --- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js index e0bcca3..b192a93 100644 --- a/api/app/lib/controllers/patrolManage/patrolRecord.js +++ b/api/app/lib/controllers/patrolManage/patrolRecord.js @@ -176,19 +176,30 @@ async function addPatrolRecord (ctx, next) { attributes: ['inspectionTime'], }); const lastInspectionTime = pointRecord.length ? pointRecord[0].dataValues.inspectionTime : null; - let record = { patrolPlanId, lastInspectionTime, inspectionTime, points, alarm, pointId } - const recordRes = await models.PatrolRecord.create(record, transaction); + const recordRes = await models.PatrolRecord.create( + // record + { + patrolPlanId: patrolPlanId, + lastInspectionTime, + inspectionTime, + points, + alarm, + pointId: pointId + } + , { + transaction + }); if (alarm) { - await models.PatrolRecord.create({ + await models.PatrolRecordIssueHandle.create({ patrolRecordId: recordRes.id, state: 1, - }, transaction); + }, { transaction }); } // 更新巡检次数统计 const curPlanRecord = await models.PatrolRecord.findAndCountAll({ - where: { patrolPlanId } + where: { patrolPlanId: patrolPlanId } }); const patrolCount = curPlanRecord.count; diff --git a/weapp/package/inspectionInput/inspectionInput.js b/weapp/package/inspectionInput/inspectionInput.js index a226ef2..cdde9f2 100644 --- a/weapp/package/inspectionInput/inspectionInput.js +++ b/weapp/package/inspectionInput/inspectionInput.js @@ -83,7 +83,6 @@ Page({ onPickerChange (e) { const { key } = e.currentTarget.dataset; const { value } = e.detail; - this.setData({ [`${key}Visible`]: false, [`${key}Value`]: value, @@ -131,7 +130,6 @@ Page({ }) }, fail: (res) => { - console.log(res) wx.hideLoading(); wx.showToast({ title: res.errMsg, @@ -233,7 +231,6 @@ Page({ success++; let str = JSON.parse(resp.data) // 返回的结果,可能不同项目结果不一样 str = str.uploaded - console.log(str); if (imgs.length >= 20) { const inspectContent = that.data.inspectContent; inspectContent[itemName].imgs = imgs;