wuqun 2 years ago
parent
commit
3d24ba6685
  1. 3
      api/app/lib/controllers/patrolManage/patrolRecord.js
  2. 32
      weapp/package/inspectionInput/inspectionInput.js
  3. 8
      web/client/src/sections/projectRegime/components/projectAddModel.js

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

@ -119,6 +119,7 @@ async function findPatrolRecord (ctx, next) {
}
}
let userInfo = ctx.fs.api.userInfo;
rslt = rslt.filter(f => f)
if (userInfo.username != 'SuperAdmin') {
if (userInfo.structure) {
rslt = rslt.filter(s => userInfo.structure.find(x => x == s.points.project.id))
@ -204,7 +205,7 @@ async function addPatrolRecord (ctx, next) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
"message": '新增巡检计划失败'
"message": '新增巡检记录失败'
}
}
}

32
weapp/package/inspectionInput/inspectionInput.js

@ -61,7 +61,7 @@ Page({
},
// 获取巡检模板
getPatrolTemplate(templateId) {
getPatrolTemplate (templateId) {
Request.get(getPatrolTemplate(templateId)).then(res => {
const checkItems = res.rows[0].checkItems;
const inspectContent = {};
@ -80,7 +80,7 @@ Page({
})
},
onPickerChange(e) {
onPickerChange (e) {
const { key } = e.currentTarget.dataset;
const { value } = e.detail;
@ -98,19 +98,19 @@ Page({
this.getPatrolTemplate(curPlan.templateId);
},
onPickerCancel(e) {
onPickerCancel (e) {
const { key } = e.currentTarget.dataset;
this.setData({
[`${key}Visible`]: false,
});
},
onPlanListPicker() {
onPlanListPicker () {
this.setData({ planListVisible: true });
},
// 获取当前位置
selfLocation() {
selfLocation () {
const that = this
wx.showLoading({
title: '定位中',
@ -142,7 +142,7 @@ Page({
});
},
handleChangeTwo(e) {
handleChangeTwo (e) {
const isNormal = e.detail.value === 'normal';
const inspectContent = this.data.inspectContent;
inspectContent[e.currentTarget.dataset.item].isNormal = isNormal;
@ -156,7 +156,7 @@ Page({
})
},
handleChangeThree(e) {
handleChangeThree (e) {
const inspectContent = this.data.inspectContent;
inspectContent[e.currentTarget.dataset.item].level = e.detail.value;
this.setData({
@ -296,7 +296,7 @@ Page({
})
},
bindCancel() {
bindCancel () {
if (this.data.scenePointId) {
wx.switchTab({ url: '/pages/index/index' })
} else {
@ -379,7 +379,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad (options) {
const that = this;
const scenePointId = options.scene;
if (scenePointId) { // 扫小程序码进入
@ -407,49 +407,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
onReady () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
onShow () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
onHide () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
onUnload () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
onPullDownRefresh () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
onReachBottom () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
onShareAppMessage () {
}
})

8
web/client/src/sections/projectRegime/components/projectAddModel.js

@ -38,15 +38,15 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f
if (e) {
placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name, function (status, result) {
form.setFieldValue('longitude', result.poiList.pois[0].location.lat)
form.setFieldValue('latitude', result.poiList.pois[0].location.lng)
form.setFieldValue('longitude', result.poiList.pois[0].location.lng)
form.setFieldValue('latitude', result.poiList.pois[0].location.lat)
}) //关键字查询查询
}
}
auto.on("select", select);//注册监听,当选中某条记录时会触发
map.on('click', function (e) { //点击地图获取经纬度
form.setFieldValue('longitude', e.lnglat.lat)
form.setFieldValue('latitude', e.lnglat.lng)
form.setFieldValue('longitude', e.lnglat.lng)
form.setFieldValue('latitude', e.lnglat.lat)
});
});

Loading…
Cancel
Save