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}}
-
-
-
- 检查问题
-
-
-
-
-
+
+
+
+ 任务名称
+
+
+ {{checktask__checktaskname}}
+
+
+
+
+ 检查人
+
+
+ {{checkname__name}}
+
+
+
+
+ 检查时间
+
+
+ {{checktask__checktime}}
+
+
+
+
+ 检查内容
+
+
+ {{checktask__checktype__checkcontent}}
+
+
+
+
+
+ 检查地点
+
+
+ {{checktask__checkplace}}
+
+
+
+ 检查问题
+
+
+
+
+
问题图片
@@ -63,9 +63,14 @@
-
+
+
+
+
+
+
@@ -79,7 +84,7 @@
-
+
From 0394028e3451af444ffbc6878f9a08d1f955d8ae Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Mon, 20 Apr 2020 12:41:42 +0800
Subject: [PATCH 3/5] bkjjvsd
---
app.js | 4 ++--
pages/checkjob/detail.js | 7 ++++++-
pages/checkjob/job.js | 21 ++++++++++++++++-----
3 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/app.js b/app.js
index 4a45bb9..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/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/job.js b/pages/checkjob/job.js
index ba9381c..6820ba9 100644
--- a/pages/checkjob/job.js
+++ b/pages/checkjob/job.js
@@ -87,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
Date: Sat, 27 Jun 2020 21:57:33 +0800
Subject: [PATCH 4/5] inspect
---
app.js | 2 +-
app.json | 7 +-
pages/checkjob/yanshou.js | 9 +-
pages/data/index.wxml | 1 -
pages/images/abnormal.png | Bin 0 -> 1010 bytes
pages/images/abnormal.svg | 1 +
pages/index/index.wxml | 34 ++++++-
pages/inspect/add.js | 177 ++++++++++++++++++++++++++++++--
pages/inspect/add.wxml | 104 ++++++++++++++-----
pages/inspect/add.wxss | 11 +-
pages/inspect/detail.js | 15 +++
pages/inspect/detail.wxml | 25 +++--
pages/inspect/detail2.js | 90 ++++++++++++++++
pages/inspect/detail2.json | 3 +
pages/inspect/detail2.wxml | 85 ++++++++++++++++
pages/inspect/detail2.wxss | 1 +
pages/inspect/handle.js | 178 ++++++++++++++++++++++++++++++++
pages/inspect/handle.json | 3 +
pages/inspect/handle.wxml | 80 +++++++++++++++
pages/inspect/handle.wxss | 4 +
pages/inspect/index.js | 101 ++++++++++++++++--
pages/inspect/index.wxml | 55 ++++++++--
pages/inspect/index2.js | 204 +++++++++++++++++++++++++++++++++++++
pages/inspect/index2.json | 5 +
pages/inspect/index2.wxml | 67 ++++++++++++
pages/inspect/index2.wxss | 14 +++
pages/main/main.js | 22 ++++
pages/main/main.wxml | 32 ++++--
pages/operins/index.js | 195 +++++++++++++++++++++++++++++++++++
pages/operins/index.json | 4 +
pages/operins/index.wxml | 39 +++++++
pages/operins/index.wxss | 31 ++++++
32 files changed, 1517 insertions(+), 82 deletions(-)
create mode 100644 pages/images/abnormal.png
create mode 100644 pages/images/abnormal.svg
create mode 100644 pages/inspect/detail2.js
create mode 100644 pages/inspect/detail2.json
create mode 100644 pages/inspect/detail2.wxml
create mode 100644 pages/inspect/detail2.wxss
create mode 100644 pages/inspect/handle.js
create mode 100644 pages/inspect/handle.json
create mode 100644 pages/inspect/handle.wxml
create mode 100644 pages/inspect/handle.wxss
create mode 100644 pages/inspect/index2.js
create mode 100644 pages/inspect/index2.json
create mode 100644 pages/inspect/index2.wxml
create mode 100644 pages/inspect/index2.wxss
create mode 100644 pages/operins/index.js
create mode 100644 pages/operins/index.json
create mode 100644 pages/operins/index.wxml
create mode 100644 pages/operins/index.wxss
diff --git a/app.js b/app.js
index cfbf7c9..d24175a 100644
--- a/app.js
+++ b/app.js
@@ -98,7 +98,7 @@ App({
openid:null
},
serverUrl: 'https://safeyun.ctcshe.com/',
- // serverUrl: 'http://127.0.0.1:8000/',
+ //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 93b8de8..7ec4d0f 100644
--- a/app.json
+++ b/app.json
@@ -78,9 +78,12 @@
"pages/totalrate/index",
"pages/checkjob/yanshou",
"pages/checkjob/job",
-
"pages/checkjob/detail",
- "pages/checkjob/index"
+ "pages/checkjob/index",
+ "pages/operins/index",
+ "pages/inspect/index2",
+ "pages/inspect/detail2",
+ "pages/inspect/handle"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/checkjob/yanshou.js b/pages/checkjob/yanshou.js
index 3187785..fed9169 100644
--- a/pages/checkjob/yanshou.js
+++ b/pages/checkjob/yanshou.js
@@ -112,12 +112,17 @@ Page({
if (res.statusCode === 200) {
var yhdata = res.data
//格式化隐患信息
+ if(yhdata.yhtp){
for (var i = 0; i < yhdata.yhtp.length; i++) {
yhdata.yhtp[i] = this.data.serverUrl + yhdata.yhtp[i];
}
- for (var i = 0; i < yhdata.zghtp.length; i++) {
- yhdata.zghtp[i] = this.data.serverUrl + yhdata.zghtp[i];
}
+ if(yhdata.zghtp){
+ 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/data/index.wxml b/pages/data/index.wxml
index 25ad143..4f05dc0 100644
--- a/pages/data/index.wxml
+++ b/pages/data/index.wxml
@@ -35,7 +35,6 @@
{{item.title}}
{{item.user__ubelongpart__partname}} {{item.user__name}}分享
类别:{{item.cate__name}}
- 最新编辑:{{item.modifytime}}
diff --git a/pages/images/abnormal.png b/pages/images/abnormal.png
new file mode 100644
index 0000000000000000000000000000000000000000..4b6eb70011e69c7f1dbb52bcd013e374b1ffd46e
GIT binary patch
literal 1010
zcmV%KY4Z+`Rpe&+X^dBgrB$nimP
zTt5N;K?VS*z0+QuI7D%-!HCC3V?s&vQonCi!3c3a;GMG#<+U3ZQrQ*SQApEw4BLASMGkJAtVwV0G17MO9P)O-;ba
zh&MmU*7po*rOj#a-}~mB8R2P+ksgGyom{*zu%dk6V`kI(14qpPY1ZU$sokz_JWsXCcd=vwEg5H
z^W}2z1u!(k>Q!%SZLxBgpEnP^u8yUBNr}E4Jy*KBUCIae0-#};LD=4AyEiwdFQC4j
z?R-%Y7xC07e*jhxc6Jzq+1cYF8ycAS!a{E1#R0H_u)E93VP=MjZER#|Ur@kRyjTEM
z5cc;|hZ)`Z{Cw`>#RIT{kVr7mk|acYW&l`0FgnjYp7us=#T
z5d=4%w?+q}$FqPh06hq9#2aOTNAcp`0$L_`5q}bb58}lE&@#cVM-2t)lP~@y!08p|
zm)ih9@awR}&*N?zBuJKY+-;IPMWc51U*7QmsnbxoT{p?;<3?}*_6UgW0gbg
zAwo!0n|G`P0suhFxa?Y$&55e2
z#()bSQr
g1oIhQB
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index be2d3f9..7ead072 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -58,15 +58,41 @@
+
+
+
+
+
+
+
+ 操作规程
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/inspect/add.js b/pages/inspect/add.js
index 7f14aa7..4a74a80 100644
--- a/pages/inspect/add.js
+++ b/pages/inspect/add.js
@@ -5,10 +5,14 @@ Page({
* 页面的初始数据
*/
data: {
+ items: [
+ { name: '正常', value: '正常' },
+ { name: '异常', value: '异常' },
+ ],
serverUrl: getApp().globalData.serverUrl,
state:1,
- selected:true,
- selected1:false
+ selected:false,
+ selected1:true
},
selected:function(e){
this.setData({
@@ -32,6 +36,25 @@ Page({
state: e.detail.value,
});
},
+ bindjclxChange: function (e) {
+ this.setData({
+ jclxIndex: e.detail.value,
+ })
+ this.data.jclx = this.data.jclxArray[e.detail.value].value
+ },
+ radioChange2: function (e) {
+ var that = this
+ that.data.itemscheck[e.currentTarget.dataset.index].checked = true
+ if (e.detail.value=='正常'){
+ that.data.itemscheck[e.currentTarget.dataset.index].state = '正常'
+ }
+ else if (e.detail.value == '异常'){
+ that.data.itemscheck[e.currentTarget.dataset.index].state = '异常待处理'
+ }
+ that.setData({
+ itemscheck:that.data.itemscheck
+ })
+ },
bindcontentInput: function (e) {
this.data.content = e.detail.value
},
@@ -50,18 +73,16 @@ Page({
equipment:res.data
})
wx.request({
- url: this.data.serverUrl + 'api/equipmentcheckform/'+id,
+ url: this.data.serverUrl + 'api/equipmentcheckform/'+res.data.checkform,
header: {
'content-type': 'application/json', // 默认值
'Cookie': getApp().globalData.sessionId,
},
success: res => {
if (res.statusCode === 200) {
-
this.setData({
- itemscheck:res.items
+ itemscheck:res.data.items
})
-
}
wx.hideLoading();
}
@@ -88,6 +109,25 @@ Page({
}
}
});
+ //获取巡检类型
+ wx.request({
+ url: this.data.serverUrl + 'getdickey?dicclass=57&a=combobox',
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ data: {},
+ success: res => {
+ if (res.statusCode === 200) {
+ this.data.jclxArray = res.data;
+ this.setData({
+ jclxArray: res.data,
+ jclxIndex: 0,
+ jclx: res.data[0].value//默认检查类型
+ })
+ }
+ }
+ });
},
submit:function(){
let data={
@@ -122,6 +162,8 @@ submit:function(){
url: '/pages/trouble/addtrouble?type=inspect',
})
},
+
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
@@ -169,5 +211,126 @@ submit:function(){
*/
onShareAppMessage: function () {
- }
+ },
+ 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.itemscheck[e.currentTarget.dataset.index].img = getApp().globalData.serverUrl + obj['filepath']
+ that.setData({
+ itemscheck:that.data.itemscheck
+ })
+
+ },
+ complete: function (res) {
+ wx.hideLoading()
+ }
+ })
+ }
+ })
+ },
+ previewImage: function (e) {
+ console.log(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.itemscheck[index].img = null
+ } else if (res.cancel) {
+ return false
+ }
+ that.setData({
+ itemscheck: that.data.itemscheck
+ });
+ }
+ })
+ },
+ descChange: function(e){
+ var that = this
+ that.data.itemscheck[e.currentTarget.dataset.index].desc=e.detail.value
+ },
+ submit3: function () {
+ var that = this
+ let data1 = {
+ equipment: this.data.equipment.id,
+ state: 1,
+ type: this.data.jclx
+ }
+ let data2 = that.data.itemscheck
+ for(var i=0;i {
+ if (res.statusCode === 200) {
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/inspectitem?a=adds',
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ method: 'POST',
+ data: {
+ 'inspect':res.data.inspect,
+ 'items':data2
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ wx.redirectTo({
+ url: '/pages/inspect/index',
+ })
+ }
+ wx.hideLoading();
+ }
+ });
+ }
+ wx.hideLoading();
+ }
+ });
+ },
})
\ No newline at end of file
diff --git a/pages/inspect/add.wxml b/pages/inspect/add.wxml
index a7236e5..e97e16c 100644
--- a/pages/inspect/add.wxml
+++ b/pages/inspect/add.wxml
@@ -14,38 +14,88 @@
-
- 风险点项目
- 检查表项目
-
-
-
-
-
- {{item.step}}-{{item.result}}
- {{item.hazard}}
-
-
-
-
- for activity
-巡检记录
+
+ 检查表
-
+ 安全风险
+
+
+
+
+
+ {{item.step}}-
+ {{item.result}}
+
+ {{item.hazard}}
+
+
+
+
+
+
+
+
+
+ 巡检类型
+
+
+
+ {{jclxArray[jclxIndex].text}}
+
+
+
+
+
+
+ {{item.name}}
+
+ {{item.content}}
+
+
+
+
+
+ {{item.value}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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}}
+
+
+
+
+
+ 异常图片
+
+
+
+
+
+
+
+
+处理描述
+
+
+
+
+
+
+
+ 处理图片
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/inspect/handle.wxss b/pages/inspect/handle.wxss
new file mode 100644
index 0000000..bd57101
--- /dev/null
+++ b/pages/inspect/handle.wxss
@@ -0,0 +1,4 @@
+/* pages/inspect/handle.wxss */
+.btn-area{
+ margin:5px
+}
\ No newline at end of file
diff --git a/pages/inspect/index.js b/pages/inspect/index.js
index bf588cd..5e27873 100644
--- a/pages/inspect/index.js
+++ b/pages/inspect/index.js
@@ -1,4 +1,5 @@
// pages/observe/observe.js
+var sliderWidth = 96;
Page({
/**
@@ -7,14 +8,40 @@ Page({
data: {
page: 1,
serverUrl: getApp().globalData.serverUrl,
- xjlist: []
+ xjlist: [],
+ tabs: ["我的巡检", "异常记录"],
+ activeIndex: 0,
+ sliderOffset: 0,
+ sliderLeft: 0
+ },
+ tabClick: function (e) {
+ var that = this
+ that.setData({
+ sliderOffset: e.currentTarget.offsetLeft,
+ activeIndex: e.currentTarget.id
+ });
+ if (that.data.activeIndex == 0) {
+ that.getXjlist(1)
+ that.data.page = 1
+ }
+ else if (that.data.activeIndex == 1) {
+ that.getYclist(1)
+ that.data.page2 = 1
+ }
},
-
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
-
+ var that = this
+ wx.getSystemInfo({
+ success: function (res) {
+ that.setData({
+ sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
+ sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
+ });
+ }
+ });
},
/**
@@ -81,15 +108,28 @@ Page({
},
onPullDownRefresh: function () {
- var that = this;
- that.getXjlist(1);
+ var that = this
+ if (that.data.activeIndex == 0) {
+ that.getXjlist(1)
+ that.data.page = 1
+ }else{
+ that.getYclist(1)
+ that.data.page2 =1
+ }
wx.stopPullDownRefresh();
- this.data.page = 1;
+
},
onReachBottom: function () {
//上拉分页,将页码加1,然后调用分页函数
- this.data.page = this.data.page + 1;
- this.getXjlist();
+ var that = this
+ if (that.data.activeIndex == 0) {
+ that.data.page = that.data.page + 1
+ that.getXjlist()
+ }else{
+ that.data.page2 = that.data.page2 + 1
+ that.getYclist()
+ }
+
},
getXjlist: function (page) {
@@ -137,4 +177,49 @@ Page({
}
});
},
+ getYclist: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.page2 }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/inspectitem?a=listmyyc&rows=10&page=' + page,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ if (res.data.rows.length == 0) {
+ if (page == 1) {
+ this.setData({
+ total: 0,
+ ycList: []
+ })
+ }
+ else {
+ wx.showModal({
+ content: "已经到底啦!",
+ showCancel: false,
+ confirmText: "确定",
+ })
+ }
+ } else {
+ let list
+ if (page == 1) {
+ list = res.data.rows
+ } else {
+ list = this.data.ycList.concat(res.data.rows)
+ }
+ this.setData({
+ total: res.data.total,
+ ycList: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
})
\ No newline at end of file
diff --git a/pages/inspect/index.wxml b/pages/inspect/index.wxml
index 2a60e89..8425311 100644
--- a/pages/inspect/index.wxml
+++ b/pages/inspect/index.wxml
@@ -1,5 +1,14 @@
-
-
+
+
+
+
+ {{item}}
+
+
+
+
+
+
共{{total}}条巡检记录
@@ -7,9 +16,11 @@
{{item.equipment__name}} {{item.equipment__area__name}}
- 正常
- 异常
-
+ {{item.type__dickeyname}}巡检
+
+ 正常
+ 异常
+
{{item.creattime}}
-
-
+
+
+共{{total}}条异常记录
+
+
+
+
+
+ {{item.state}}
+ {{item.state}}
+ {{item.checkitem__name}}
+
+
+ 设备:
+ {{item.inspect__equipment__name}}
+ 编号:
+ {{item.inspect__equipment__num}}
+
+
+ {{item.inspect__type__dickeyname}}巡检
+ {{item.inspect__user__name}}-{{item.inspect__creattime}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/inspect/index2.js b/pages/inspect/index2.js
new file mode 100644
index 0000000..9504ab0
--- /dev/null
+++ b/pages/inspect/index2.js
@@ -0,0 +1,204 @@
+// pages/observe/observe.js
+var sliderWidth = 96;
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page: 1,
+ serverUrl: getApp().globalData.serverUrl,
+ todoList: [],
+ tabs: ["待处理", "已处理"],
+ activeIndex: 0,
+ sliderOffset: 0,
+ sliderLeft: 0
+ },
+ tabClick: function (e) {
+ var that = this
+ that.setData({
+ sliderOffset: e.currentTarget.offsetLeft,
+ activeIndex: e.currentTarget.id
+ });
+ if (that.data.activeIndex == 0) {
+ that.gettodoList(1)
+ that.data.page = 1
+ }
+ else if (that.data.activeIndex == 1) {
+ that.getdoneList(1)
+ that.data.page2 = 1
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this
+ wx.getSystemInfo({
+ success: function (res) {
+ that.setData({
+ sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
+ sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
+ });
+ }
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var that = this;
+ that.onPullDownRefresh();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ onPullDownRefresh: function () {
+ var that = this
+ if (that.data.activeIndex == 0) {
+ that.gettodoList(1)
+ that.data.page = 1
+ } else {
+ that.getdoneList(1)
+ that.data.page2 = 1
+ }
+ wx.stopPullDownRefresh();
+
+ },
+ onReachBottom: function () {
+ //上拉分页,将页码加1,然后调用分页函数
+ var that = this
+ if (that.data.activeIndex == 0) {
+ that.data.page = that.data.page + 1
+ that.gettodoList()
+ } else {
+ that.data.page2 = that.data.page2 + 1
+ that.getdoneList()
+ }
+
+
+ },
+ gettodoList: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.page }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/inspectitem?a=listtodo&rows=10&page=' + page,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ if (res.data.rows.length == 0) {
+ if (page == 1) {
+ this.setData({
+ total: 0,
+ todoList: []
+ })
+ }
+ else {
+ wx.showModal({
+ content: "已经到底啦!",
+ showCancel: false,
+ confirmText: "确定",
+ })
+ }
+ } else {
+ let list
+ if (page == 1) {
+ list = res.data.rows
+ } else {
+ list = this.data.todoList.concat(res.data.rows)
+ }
+ this.setData({
+ total: res.data.total,
+ todoList: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+ getdoneList: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.page2 }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/inspectitem?a=listdone&rows=10&page=' + page,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ if (res.data.rows.length == 0) {
+ if (page == 1) {
+ this.setData({
+ total: 0,
+ doneList: []
+ })
+ }
+ else {
+ wx.showModal({
+ content: "已经到底啦!",
+ showCancel: false,
+ confirmText: "确定",
+ })
+ }
+ } else {
+ let list
+ if (page == 1) {
+ list = res.data.rows
+ } else {
+ list = this.data.doneList.concat(res.data.rows)
+ }
+ this.setData({
+ total: res.data.total,
+ doneList: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+})
\ No newline at end of file
diff --git a/pages/inspect/index2.json b/pages/inspect/index2.json
new file mode 100644
index 0000000..bfa5c12
--- /dev/null
+++ b/pages/inspect/index2.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarTitleText": "异常处理",
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
+}
\ No newline at end of file
diff --git a/pages/inspect/index2.wxml b/pages/inspect/index2.wxml
new file mode 100644
index 0000000..e7a55fe
--- /dev/null
+++ b/pages/inspect/index2.wxml
@@ -0,0 +1,67 @@
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+ 共{{total}}条异常记录
+
+
+
+
+
+ {{item.state}}
+ {{item.checkitem__name}}
+
+
+ 设备:
+ {{item.inspect__equipment__name}}
+ 编号:
+ {{item.inspect__equipment__num}}
+
+
+ {{item.inspect__type__dickeyname}}
+ 巡检
+ {{item.inspect__user__name}}-{{item.inspect__creattime}}
+
+
+
+
+
+
+
+已处理{{total}}条异常
+
+
+
+
+
+ {{item.state}}
+ {{item.checkitem__name}}
+
+
+ 设备:
+ {{item.inspect__equipment__name}}
+ 编号:
+ {{item.inspect__equipment__num}}
+
+
+ {{item.inspect__type__dickeyname}}巡检
+ {{item.inspect__user__name}}-{{item.inspect__creattime}}
+
+
+ 处理人
+ {{item.todouser__name}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/inspect/index2.wxss b/pages/inspect/index2.wxss
new file mode 100644
index 0000000..ef15154
--- /dev/null
+++ b/pages/inspect/index2.wxss
@@ -0,0 +1,14 @@
+.weui-btn{
+ width:auto;
+ margin: 5px;
+}
+.container {
+ background-color: #fff;
+ color: #939393;
+}
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+
\ No newline at end of file
diff --git a/pages/main/main.js b/pages/main/main.js
index 9d59e69..ddb441b 100644
--- a/pages/main/main.js
+++ b/pages/main/main.js
@@ -15,6 +15,7 @@ Page({
jytodonum: 0,
tasknum: 0,
checknum:0,
+ sbtodonum:0,
serverUrl: getApp().globalData.serverUrl,
isGjjt:false,
// Banner数据
@@ -125,6 +126,7 @@ Page({
this.getjytodonum()
this.gettasknum()
this.getchecknum()//检查任务
+ this.getsbycnum()
},
/**
* 生命周期函数--监听页面隐藏
@@ -358,6 +360,26 @@ Page({
}
});
},
+ getsbycnum: function () {
+ var that = this
+ //获取待办异常
+ wx.request({
+ url: this.data.serverUrl + 'api/inspectitem?a=listtodo',
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ data: {},
+ success: res => {
+ if (res.statusCode === 200) {
+ //console.log(res.data)
+ this.setData({
+ sbtodonum: res.data.total,
+ })
+ }
+ }
+ });
+ },
taptest: function () {
if (getApp().globalData.userInfo.perms != undefined) {
if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能
diff --git a/pages/main/main.wxml b/pages/main/main.wxml
index ea2258e..554c0c5 100644
--- a/pages/main/main.wxml
+++ b/pages/main/main.wxml
@@ -17,7 +17,8 @@
- 数据采集
+
+
@@ -50,29 +51,38 @@
作业许可
{{zytodonum}}
-
-
- 风险管控
-
-
+
风险任务
{{tasknum}}
-
+
+
+ 风险管控
+
+
+
+
+
+
设备巡检
-
-
-
+
+
+ 设备异常处理
+ {{sbtodonum}}
+
+
+
+
diff --git a/pages/operins/index.js b/pages/operins/index.js
new file mode 100644
index 0000000..35f5783
--- /dev/null
+++ b/pages/operins/index.js
@@ -0,0 +1,195 @@
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page: 1,
+ serverUrl: getApp().globalData.serverUrl,
+ datalist: []
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ var that = this;
+ that.onPullDownRefresh();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ var that = this;
+ that.getDatalist(1);
+ wx.stopPullDownRefresh();
+ this.data.page = 1;
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ //上拉分页,将页码加1,然后调用分页函数
+ this.data.page = this.data.page + 1;
+ this.getDatalist();
+ wx.stopPullDownRefresh();
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ getDatalist: function (page, search = '') {
+ var that = this;
+ if (page != 1) { page = that.data.page }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/getprodata?a=listall&rows=10&page=' + page + '&search=' + search,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ if (res.data.rows.length == 0) {
+ if (page == 1) {
+ this.setData({
+ total: 0,
+ datalist: []
+ })
+ }
+ else {
+ wx.showModal({
+ content: "已经到底啦!",
+ showCancel: false,
+ confirmText: "确定",
+ })
+ }
+ } else {
+ let list
+ if (page == 1) {
+ list = res.data.rows
+ } else {
+ list = this.data.datalist.concat(res.data.rows)
+ }
+ this.setData({
+ total: res.data.total,
+ datalist: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+ //搜索框文本内容显示
+ inputBind: function (event) {
+ this.setData({
+ inputValue: event.detail.value
+ })
+ },
+ query: function () {
+ this.page = 1
+ this.getDatalist(this.page, this.data.inputValue)
+ },
+ reset: function () {
+ this.page = 1
+ this.inputValue = ''
+ this.getDatalist(this.page)
+ },
+ openfj: function(e){
+ var that = this
+ let fileurl = getApp().globalData.serverUrl + e.currentTarget.dataset.operprocepath
+ wx.showLoading({
+ title: '正在下载...',
+ })
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/getprodata?a=readnum&id=' + e.currentTarget.dataset.id,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ }
+ });
+ wx.downloadFile({
+ url: fileurl,
+ success(res) {
+ wx.showLoading({
+ title: '成功,正在打开...',
+ })
+ const filePath = res.tempFilePath
+ var filetype
+ if (fileurl.indexOf(".docx") != -1) {
+ filetype = 'docx'
+ }
+ else if (fileurl.indexOf(".doc") != -1) {
+ filetype = 'doc'
+ }
+ else if (fileurl.indexOf(".xlsx") != -1) {
+ filetype = 'xlsx'
+ }
+ else if (fileurl.indexOf(".xls") != -1) {
+ filetype = 'xls'
+ }
+ else if (fileurl.indexOf(".pptx") != -1) {
+ filetype = 'pptx'
+ }
+ else if (fileurl.indexOf(".ppt") != -1) {
+ filetype = 'ppt'
+ }
+ else if (fileurl.indexOf(".pdf") != -1) {
+ filetype = 'pdf'
+ } else {
+ wx.hideLoading()
+ return
+ }
+ wx.openDocument({
+ filePath,
+ fileType: filetype,
+ success(res) {
+ wx.hideLoading()
+ console.log('打开文档成功')
+ }, fail: function (e) {
+ console.log(e)
+ }
+ })
+ }
+ })
+ }
+})
\ No newline at end of file
diff --git a/pages/operins/index.json b/pages/operins/index.json
new file mode 100644
index 0000000..3d181e1
--- /dev/null
+++ b/pages/operins/index.json
@@ -0,0 +1,4 @@
+{
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
+}
\ No newline at end of file
diff --git a/pages/operins/index.wxml b/pages/operins/index.wxml
new file mode 100644
index 0000000..cc4b37c
--- /dev/null
+++ b/pages/operins/index.wxml
@@ -0,0 +1,39 @@
+
+
+ 共{{total}}条规程
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+ {{item.createuser__name}}分享
+ 类别:{{item.jobs__groupname}}
+
+
+
+ 阅读量
+ {{item.reads}}
+
+
+
+
+
+
diff --git a/pages/operins/index.wxss b/pages/operins/index.wxss
new file mode 100644
index 0000000..b5cf000
--- /dev/null
+++ b/pages/operins/index.wxss
@@ -0,0 +1,31 @@
+.weui-btn{
+ width:auto;
+ margin: 5px;
+}
+.container {
+ background-color: #fff;
+ color: #939393;
+}
+.head{
+ color:#fff;
+ background-color: cornflowerblue;
+ text-align: center;
+}
+.search
+{
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ width:100%;
+ height:auto;
+ background-color:white;
+ border:2rpx solid goldenrod;
+ border-radius: 5rpx;
+
+}
+
+/* 搜索框提示文字样式 */
+.search input
+{
+ padding-left:30rpx;
+}
From 012e2e45681ffa3fd0890123dc6a88e0a678feef Mon Sep 17 00:00:00 2001
From: caoqianming
Date: Tue, 11 Aug 2020 22:53:14 +0800
Subject: [PATCH 5/5] some fix
---
pages/bind/binduser.js | 10 ++++++
pages/bind/binduser.wxml | 2 +-
pages/index/index.wxml | 1 -
pages/inspect/add.js | 1 +
pages/inspect/detail.wxml | 2 +-
pages/inspect/detail2.wxml | 11 ++++---
pages/inspect/handle.js | 62 ++++++++++++++++++++------------------
project.config.json | 5 ++-
8 files changed, 56 insertions(+), 38 deletions(-)
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 @@
+ 账号错误或忘记密码?
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index 7ead072..8ded766 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -94,5 +94,4 @@
-->
-
\ No newline at end of file
diff --git a/pages/inspect/add.js b/pages/inspect/add.js
index 4a74a80..fb39298 100644
--- a/pages/inspect/add.js
+++ b/pages/inspect/add.js
@@ -54,6 +54,7 @@ Page({
that.setData({
itemscheck:that.data.itemscheck
})
+ console.log(that.data.itemscheck)
},
bindcontentInput: function (e) {
this.data.content = e.detail.value
diff --git a/pages/inspect/detail.wxml b/pages/inspect/detail.wxml
index 9dc4850..82a551a 100644
--- a/pages/inspect/detail.wxml
+++ b/pages/inspect/detail.wxml
@@ -30,7 +30,7 @@
{{content}}
-检查表
+检查记录
diff --git a/pages/inspect/detail2.wxml b/pages/inspect/detail2.wxml
index 6510d2c..e4d5cbf 100644
--- a/pages/inspect/detail2.wxml
+++ b/pages/inspect/detail2.wxml
@@ -30,7 +30,7 @@
- 异常项目
+ 检查项目
{{checkitem__name}}
{{checkitem__content}}
@@ -40,9 +40,12 @@
异常描述
-
+
{{desc}}
+
+ 无
+
@@ -50,7 +53,7 @@
异常图片
-
+
@@ -76,7 +79,7 @@
处理图片
-
+
diff --git a/pages/inspect/handle.js b/pages/inspect/handle.js
index cd1823a..8f8f8b9 100644
--- a/pages/inspect/handle.js
+++ b/pages/inspect/handle.js
@@ -5,7 +5,8 @@ Page({
* 页面的初始数据
*/
data: {
- desc2:''
+ desc2:'',
+ img2:''
},
binddesc2Input: function (e) {
this.data.desc2 = e.detail.value
@@ -141,38 +142,39 @@ Page({
},
submit: function () {
var that = this
- if(that.data.desc2 == ''){
+ 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: '未填写处理描述',
+ 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/project.config.json b/project.config.json
index 3c6eda7..d6c3f5e 100644
--- a/project.config.json
+++ b/project.config.json
@@ -7,6 +7,7 @@
"minified": true,
"newFeature": true,
"coverView": true,
+ "nodeModules": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
@@ -18,7 +19,9 @@
"disablePlugins": [],
"outputPath": ""
},
- "nodeModules": true
+ "useIsolateContext": true,
+ "useCompilerModule": false,
+ "userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"libVersion": "2.9.4",