diff --git a/app.js b/app.js index 830e341..d24175a 100644 --- a/app.js +++ b/app.js @@ -97,7 +97,7 @@ App({ perms:[], openid:null }, - serverUrl: 'https://safeyun.ctcshe.com/', + serverUrl: 'https://safeyun.ctcshe.com/', //serverUrl: 'http://127.0.0.1:8000/', //serverUrl: 'http://10.21.28.148:8000/', //serverUrl: 'http://192.168.0.103:8000/', diff --git a/app.json b/app.json index e12fc27..7ec4d0f 100644 --- a/app.json +++ b/app.json @@ -77,7 +77,13 @@ "pages/data/detail", "pages/totalrate/index", "pages/checkjob/yanshou", - "pages/checkjob/job" + "pages/checkjob/job", + "pages/checkjob/detail", + "pages/checkjob/index", + "pages/operins/index", + "pages/inspect/index2", + "pages/inspect/detail2", + "pages/inspect/handle" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/bind/binduser.js b/pages/bind/binduser.js index a0275c1..dae467c 100644 --- a/pages/bind/binduser.js +++ b/pages/bind/binduser.js @@ -142,6 +142,16 @@ Page({ */ onShareAppMessage: function () { + }, + showPw(){ + wx.showModal({ + title: '', + content: '默认密码是0000,如果您修改过或者账号错误,请联系贵公司管理员(一般是安全管理部门),请及时登陆pc端修改密码!', + showCancel:false, + confirmText:'知道了', + success (res) { + } + }) }, intro:function(){ let fileurl = getApp().globalData.serverUrl + 'media/安全生产管理系统-国检集团.docx' diff --git a/pages/bind/binduser.wxml b/pages/bind/binduser.wxml index 3bec4b6..fb1decb 100644 --- a/pages/bind/binduser.wxml +++ b/pages/bind/binduser.wxml @@ -29,6 +29,7 @@ + 账号错误或忘记密码? 点击下载系统/小程序文档介绍 Copyright © 2018-2020 国检集团 - 中存大数据提供技术支持 \ No newline at end of file diff --git a/pages/checkjob/detail.js b/pages/checkjob/detail.js index 0ff4bf6..a496aea 100644 --- a/pages/checkjob/detail.js +++ b/pages/checkjob/detail.js @@ -90,13 +90,18 @@ Page({ if (res.statusCode === 200) { var yhdata = res.data //格式化隐患信息 + if(yhdata.yhtp!=null) + { for (var i = 0; i < yhdata.yhtp.length; i++) { yhdata.yhtp[i] = this.data.serverUrl + yhdata.yhtp[i]; } + } + if(yhdata.yhtp!=null) + { for (var i = 0; i < yhdata.zghtp.length; i++) { yhdata.zghtp[i] = this.data.serverUrl + yhdata.zghtp[i]; } - + } this.setData(yhdata) } } diff --git a/pages/checkjob/index.json b/pages/checkjob/index.json index 7bdce1d..b11b844 100644 --- a/pages/checkjob/index.json +++ b/pages/checkjob/index.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "排查任务", + "navigationBarTitleText": "检查任务", "enablePullDownRefresh": true, "onReachBottomDistance": 20 } \ No newline at end of file diff --git a/pages/checkjob/index.wxml b/pages/checkjob/index.wxml index 5a1f158..3663804 100644 --- a/pages/checkjob/index.wxml +++ b/pages/checkjob/index.wxml @@ -31,6 +31,7 @@ 正在检查 检查完毕 任务关闭 + 未执行 diff --git a/pages/checkjob/job.js b/pages/checkjob/job.js index 9bf0124..6820ba9 100644 --- a/pages/checkjob/job.js +++ b/pages/checkjob/job.js @@ -17,6 +17,8 @@ Page({ cjry:"", yhtp1: [], zghtp1: [], + jcwt:"", + zgqk:"", }, bindjcwtInput: function (e) { this.data.jcwt = e.detail.value @@ -85,17 +87,22 @@ Page({ filePath: that.data.yhtp1[x], name: 'upfile', success(res) { - + var obj = JSON.parse(res.data); that.data.yhtp1[x] = obj['filepath'] x = x + 1 if(x - + - - - - 任务名称 - - - {{checktask__checktaskname}} - - - - - 检查人 - - - {{checkname__username}} - - - - - 检查时间 - - - {{checktask__checktime}} - - - - - 检查内容 - - - {{checktask__checktype__checkcontent}} - - - - - - 检查地点 - - - {{checktask__checkplace}} - - - - 检查问题 - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/pages/inspect/add.wxss b/pages/inspect/add.wxss index 43d11a3..6d6b608 100644 --- a/pages/inspect/add.wxss +++ b/pages/inspect/add.wxss @@ -1,3 +1,10 @@ .btn-area{ margin:5px -} \ No newline at end of file +} +page{background-color:#edf0f3;} +.nav{width:100%;height:auto;display:flex;flex-direction:row;} +.default{text-align:center;flex:1;border-right:1px solid gainsboro;color:#000;font-weight:bold;font-size:28rpx;} +.red{text-align:center;color:#fc5558;flex:1;border-right:1px solid gainsboro;font-weight:bold;font-size:28rpx;} +.show{display:block;text-align:left;} +.hidden{display:none;text-align:left;} + diff --git a/pages/inspect/detail.js b/pages/inspect/detail.js index f5b0374..f7dc699 100644 --- a/pages/inspect/detail.js +++ b/pages/inspect/detail.js @@ -25,6 +25,21 @@ Page({ } } }) + wx.request({ + url: getApp().globalData.serverUrl + 'api/inspectitem?a=listall&pageoff=1&inspect=' + options.id, + header: { + 'content-type': 'application/json', // + 'Cookie': getApp().globalData.sessionId, + }, + method: 'GET', + success: res => { + if (res.statusCode === 200) { + this.setData({ + checkitems:res.data.rows + }) + } + } + }) }, /** diff --git a/pages/inspect/detail.wxml b/pages/inspect/detail.wxml index 7168852..82a551a 100644 --- a/pages/inspect/detail.wxml +++ b/pages/inspect/detail.wxml @@ -1,10 +1,10 @@ -巡检内容 +基本信息 巡检人 {{user__name}} - + 提交时间 {{creattime}} @@ -29,8 +29,21 @@ 巡检记录 {{content}} - - 关联隐患 - {{trouble__yhnum}} - +检查记录 + + + + + + {{item.state}} + {{item.state}} + {{item.checkitem__name}} + + + {{item.checkitem__content}} + + + + + \ No newline at end of file diff --git a/pages/inspect/detail2.js b/pages/inspect/detail2.js new file mode 100644 index 0000000..8654564 --- /dev/null +++ b/pages/inspect/detail2.js @@ -0,0 +1,90 @@ +// pages/inspect/detail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.request({ + url: getApp().globalData.serverUrl + 'api/inspectitem?a=detail&id=' + options.id, + header: { + 'content-type': 'application/json', // + 'Cookie': getApp().globalData.sessionId, + }, + method: 'GET', + success: res => { + if (res.statusCode === 200) { + if(res.data.img){ + res.data.img = getApp().globalData.serverUrl + res.data.img + } + if (res.data.img2) { + res.data.img2 = getApp().globalData.serverUrl + res.data.img2 + } + this.setData(res.data) + } + } + }) + }, + previewImage: function (e) { + var current = e.target.dataset.src + wx.previewImage({ + current: current, + urls: [current] + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/inspect/detail2.json b/pages/inspect/detail2.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/inspect/detail2.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/inspect/detail2.wxml b/pages/inspect/detail2.wxml new file mode 100644 index 0000000..e4d5cbf --- /dev/null +++ b/pages/inspect/detail2.wxml @@ -0,0 +1,88 @@ +异常信息 + + + + + 巡检信息 + + {{inspect__user__name}} + {{inspect__type__dickeyname}}巡检-{{inspect__creattime}} + + + + 设备编号 + {{inspect__equipment__num}} + + + 设备名称 + {{inspect__equipment__name}} + + + 状态 + {{state}} + + + + 检查项目 + + {{checkitem__name}} + {{checkitem__content}} + + + + + + 异常描述 + + {{desc}} + + + 无 + + + + + + 异常图片 + + + + + + + + + +处理信息 + + + 处理人 + {{todouser__name}} + + + + 处理描述 + + {{desc2}} + + + + + + 处理图片 + + + + + + + + + diff --git a/pages/inspect/detail2.wxss b/pages/inspect/detail2.wxss new file mode 100644 index 0000000..56a040a --- /dev/null +++ b/pages/inspect/detail2.wxss @@ -0,0 +1 @@ +/* pages/inspect/detail2.wxss */ \ No newline at end of file diff --git a/pages/inspect/handle.js b/pages/inspect/handle.js new file mode 100644 index 0000000..8f8f8b9 --- /dev/null +++ b/pages/inspect/handle.js @@ -0,0 +1,180 @@ +// pages/inspect/detail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + desc2:'', + img2:'' + }, + binddesc2Input: function (e) { + this.data.desc2 = e.detail.value + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.request({ + url: getApp().globalData.serverUrl + 'api/inspectitem?a=detail&id=' + options.id, + header: { + 'content-type': 'application/json', // + 'Cookie': getApp().globalData.sessionId, + }, + method: 'GET', + success: res => { + if (res.statusCode === 200) { + if (res.data.img) { + res.data.img = getApp().globalData.serverUrl + res.data.img + } + this.setData(res.data) + } + } + }) + }, + previewImage: function (e) { + var current = e.target.dataset.src + wx.previewImage({ + current: current, + urls: [current] + }) + }, + deleteImage: function (e) { + var that = this; + //var index = e.currentTarget.dataset.index; //获取当前长按图片下标 + wx.showModal({ + title: '系统提醒', + content: '确定要删除此图片吗?', + success: function (res) { + if (res.confirm) { + that.data.img2 = null + } else if (res.cancel) { + return false + } + that.setData({ + img2: that.data.img2 + }); + } + }) + }, + chooseImage: function (e) { + var that = this + wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success: function (res) { + wx.showLoading({ + title: '上传图片..', + mask: true + }) + wx.uploadFile({ + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': getApp().globalData.sessionId, + }, + url: getApp().globalData.serverUrl + 'upfile', + filePath: res.tempFilePaths[0], + name: 'upfile', + success(res) { + wx.hideLoading() + var obj = JSON.parse(res.data); + that.data.img2 = getApp().globalData.serverUrl + obj['filepath'] + that.setData({ + img2: that.data.img2 + }) + + }, + complete: function (res) { + wx.hideLoading() + } + }) + } + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + submit: function () { + var that = this + if(that.data.desc2 || that.data.img2){ + let data = { + id:that.data.id, + desc2: that.data.desc2, + img2: that.data.img2 + } + if (that.data.img2 && that.data.img2.indexOf(getApp().globalData.serverUrl) != -1) { + data.img2 = data.img2.replace(getApp().globalData.serverUrl, '') + } + wx.showLoading({ + title: '提交中', + }) + wx.request({ + url: getApp().globalData.serverUrl + 'api/inspectitem?a=handle', + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': getApp().globalData.sessionId, + }, + method: 'POST', + data: data, + success: res => { + wx.navigateBack({ + + }) + wx.hideLoading(); + } + }); + }else{ + wx.showToast({ + title: '未填写处理描述或图片', + icon:'none' + }) + } + + }, +}) \ No newline at end of file diff --git a/pages/inspect/handle.json b/pages/inspect/handle.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/inspect/handle.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/inspect/handle.wxml b/pages/inspect/handle.wxml new file mode 100644 index 0000000..8b5cffe --- /dev/null +++ b/pages/inspect/handle.wxml @@ -0,0 +1,80 @@ +异常信息 + + + + + 巡检信息 + + {{inspect__user__name}} + {{inspect__type__dickeyname}}巡检-{{inspect__creattime}} + + + + 设备编号 + {{inspect__equipment__num}} + + + 设备名称 + {{inspect__equipment__name}} + + + 状态 + {{state}} + + + + 异常项目 + + {{checkitem__name}} + {{checkitem__content}} + + + + + + 异常描述 + + {{desc}} + + + + + + 异常图片 + + + + + + + + +处理描述 + + + +