From f535c9c0e5d5488f3d4f6309163a4b75b9e88fba Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Tue, 14 Apr 2020 17:50:27 +0800 Subject: [PATCH 1/5] renwuxiugai --- app.js | 4 +- app.json | 5 +- pages/checkjob/index.json | 2 +- pages/inspect/add.js | 18 +++- pages/inspect/add.wxml | 9 +- pages/inspect/add.wxss | 8 +- pages/main/main.wxml | 212 +++++++++++++++++++------------------- 7 files changed, 144 insertions(+), 114 deletions(-) diff --git a/app.js b/app.js index c05cb5f..cfbf7c9 100644 --- a/app.js +++ b/app.js @@ -97,8 +97,8 @@ App({ perms:[], openid:null }, - // serverUrl: 'https://safeyun.ctcshe.com/', - serverUrl: 'http://127.0.0.1:8000/', + 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/', //serverUrl:'http://10.0.11.195:8000/', diff --git a/app.json b/app.json index e12fc27..93b8de8 100644 --- a/app.json +++ b/app.json @@ -77,7 +77,10 @@ "pages/data/detail", "pages/totalrate/index", "pages/checkjob/yanshou", - "pages/checkjob/job" + "pages/checkjob/job", + + "pages/checkjob/detail", + "pages/checkjob/index" ], "window": { "backgroundTextStyle": "light", 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/inspect/add.js b/pages/inspect/add.js index c531657..7f14aa7 100644 --- a/pages/inspect/add.js +++ b/pages/inspect/add.js @@ -7,8 +7,22 @@ Page({ data: { serverUrl: getApp().globalData.serverUrl, state:1, - }, - + selected:true, +         selected1:false +         }, +     selected:function(e){ +         this.setData({ +             selected1:false, +             selected:true +         }) +     }, +     selected1:function(e){ +         this.setData({ +             selected:false, +             selected1:true +         }) +     }, + /** * 生命周期函数--监听页面加载 */ diff --git a/pages/inspect/add.wxml b/pages/inspect/add.wxml index fae5d25..a7236e5 100644 --- a/pages/inspect/add.wxml +++ b/pages/inspect/add.wxml @@ -13,7 +13,12 @@ {{equipment.area__name}} -检查项目 + + +    风险点项目 +    检查表项目 @@ -22,6 +27,8 @@ +for activity 巡检记录 diff --git a/pages/inspect/add.wxss b/pages/inspect/add.wxss index 43d11a3..14b9f71 100644 --- a/pages/inspect/add.wxss +++ b/pages/inspect/add.wxss @@ -1,3 +1,9 @@ .btn-area{ margin:5px -} \ No newline at end of file +} +page{background-color:#edf0f3;} +.nav{width:100%;height:30rpx;display:flex;flex-direction:row;} +.default{line-height:100rpx;text-align:center;flex:1;border-right:1px solid gainsboro;color:#000;font-weight:bold;font-size:28rpx;} +.red{line-height:100rpx;text-align:center;color:#fc5558;flex:1;border-right:1px solid gainsboro;font-weight:bold;font-size:28rpx;} +.show{display:block;text-align:center;line-height:200rpx;} +.hidden{display:none;text-align:center;line-height:200px;} diff --git a/pages/main/main.wxml b/pages/main/main.wxml index 9433bd5..ea2258e 100644 --- a/pages/main/main.wxml +++ b/pages/main/main.wxml @@ -1,112 +1,112 @@ - + - - - - - + + + + + - + - - - - -{{item.title}} - - - - 数据采集 - - - - 检查任务 - {{checknum}} - - - - - 事故隐患 - {{yhtodonum}} - - - - 行为观察 - {{gcnoread}} - - - - 未遂事件 - {{wsnoread}} - - - - {{jytodonum}} - 合理化建议 - - - - 作业许可 - {{zytodonum}} - - - - 风险管控 - - - - 风险任务 - {{tasknum}} - - - - 设备巡检 - - - - - 学习园地 - - {{user__name}} - ,进入在线考试答题吧! - - - - - - - 学习资料 - - - - 在线考试 - {{dknum}} - - - - 实时总排名 - - - - 线下培训 - {{dqdnum}} - - - - 公告 - - - - 通知 - {{noread}} - - - - 模拟练习 - - - - + \ No newline at end of file From d69c974eacaf080073df05ee8c34fcd7e3888350 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Thu, 16 Apr 2020 14:40:10 +0800 Subject: [PATCH 2/5] xaoche --- app.js | 4 +- pages/checkjob/index.wxml | 1 + pages/checkjob/job.js | 29 +++++----- pages/checkjob/job.wxml | 109 ++++++++++++++++++++------------------ 4 files changed, 77 insertions(+), 66 deletions(-) diff --git a/app.js b/app.js index cfbf7c9..4a45bb9 100644 --- a/app.js +++ b/app.js @@ -97,8 +97,8 @@ App({ perms:[], openid:null }, - serverUrl: 'https://safeyun.ctcshe.com/', - // serverUrl: 'http://127.0.0.1:8000/', + //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/', //serverUrl:'http://10.0.11.195:8000/', 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..ba9381c 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 @@ -166,13 +168,7 @@ Page({ }, submit: function () { - if (!this.data.jcwt) { - this.Tap1('请填写检查问题!') - } - else if (!this.data.zgqk) { - this.Tap1('请填写整改情况!') - } - else if (!this.data.jczt) { + if (!this.data.jczt) { this.Tap1('请选择检查状态!') } @@ -243,8 +239,9 @@ Page({ this.getGcdetail(options.id); this.setData({ - jobid: options.id + jobid: options.id, }) + }, /** @@ -335,16 +332,24 @@ Page({ wx.hideLoading(); console.log(res.data); if (res.statusCode === 200) { - var data = res.data - //格式化观察信息 + 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]; + } + } + + - this.setData(data) + this.setData(yhdata) } } }); }, - + }) \ No newline at end of file diff --git a/pages/checkjob/job.wxml b/pages/checkjob/job.wxml index 6bedd7a..5e2c3b6 100644 --- a/pages/checkjob/job.wxml +++ b/pages/checkjob/job.wxml @@ -1,57 +1,57 @@ - + - - - - 任务名称 - - - {{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 14b9f71..6d6b608 100644 --- a/pages/inspect/add.wxss +++ b/pages/inspect/add.wxss @@ -2,8 +2,9 @@ margin:5px } page{background-color:#edf0f3;} -.nav{width:100%;height:30rpx;display:flex;flex-direction:row;} -.default{line-height:100rpx;text-align:center;flex:1;border-right:1px solid gainsboro;color:#000;font-weight:bold;font-size:28rpx;} -.red{line-height:100rpx;text-align:center;color:#fc5558;flex:1;border-right:1px solid gainsboro;font-weight:bold;font-size:28rpx;} -.show{display:block;text-align:center;line-height:200rpx;} -.hidden{display:none;text-align:center;line-height:200px;} +.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..9dc4850 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..6510d2c --- /dev/null +++ b/pages/inspect/detail2.wxml @@ -0,0 +1,85 @@ +异常信息 + + + + + 巡检信息 + + {{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..cd1823a --- /dev/null +++ b/pages/inspect/handle.js @@ -0,0 +1,178 @@ +// pages/inspect/detail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + desc2:'' + }, + 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 == ''){ + wx.showToast({ + title: '未填写处理描述', + icon:'none' + }) + return + } + 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(); + } + }); + }, +}) \ 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}} + + + + + + 异常图片 + + + + + + + + +处理描述 + + + +