diff --git a/app.json b/app.json
index 41dddcf..ed4cb01 100644
--- a/app.json
+++ b/app.json
@@ -97,7 +97,10 @@
"pages/safefeedback/index",
"pages/safefeedback/add",
"pages/operation/operationedit",
- "pages/mgt/index"
+ "pages/mgt/index",
+ "pages/checkjob/index2",
+ "pages/checkjob/detail2",
+ "pages/checkjob/check2"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/checkjob/check2.js b/pages/checkjob/check2.js
new file mode 100644
index 0000000..acdb878
--- /dev/null
+++ b/pages/checkjob/check2.js
@@ -0,0 +1,166 @@
+// pages/risktask/check.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page: 1,
+ riskact: 0,
+ riskacttask:0,
+ group: 0
+ },
+
+ bindnoteInput: function (e) {
+ this.data.checknote = e.detail.value
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ console.log(options)
+ this.data.riskact = options.riskact
+ if(options.riskacttask){
+ this.data.riskacttask = options.riskacttask
+ this.getTaskDetail()
+ }
+ this.getlist()
+ },
+ getTaskDetail:function() {
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/riskacttask?a=detail&id=' + this.data.riskacttask,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ this.setData({
+ tasknote: res.data.data.tasknote,
+ })
+ }
+ }
+ });
+
+ },
+ getlist: function () {
+ var page = this.data.page
+ wx.showLoading({
+ title: '加载中',
+ })
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/risk?a=listall&table_type=2&riskact=' + this.data.riskact,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ wx.hideLoading()
+ console.log(res.data)
+ this.setData({
+ total: res.data.total,
+ alllist: res.data.rows
+ })
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ open: function (e) {
+ console.log(e)
+ wx.navigateTo({
+ url: '/pages/trouble/addtrouble?type=riskcheck&index=' + e.currentTarget.dataset.index,
+ })
+ },
+ submit: function () {
+ let alllist = this.data.alllist
+ let data = {'checks':[],'riskact':this.data.riskact, 'riskacttask':this.data.riskacttask}
+ for (var i = 0; i < alllist.length; i++) {
+ if (i.trouble != undefined){
+ data.checks.push({ 'id': alllist[i].id })
+ }
+ else{
+ data.checks.push({ 'id': alllist[i].id, 'trouble': alllist[i].trouble })
+ }
+ }
+ wx.showLoading({
+ title: '提交中',
+ })
+ if(this.data.checknote){
+ data.note = this.data.checknote //检查备注
+ }
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/riskcheck2?a=add',
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ method: 'POST',
+ data: data,
+ success: res => {
+ if (res.statusCode === 200) {
+ var pages = getCurrentPages();
+ var currPage = pages[pages.length - 1]; //当前页面
+ var prevPage = pages[pages.length - 2]; //上一个页面
+
+ //直接调用上一个页面对象的setData()方法,把数据存到上一个页面中去
+ prevPage.setData({
+ riskact: this.data.riskact
+ });
+ wx.navigateBack({
+ })
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+})
\ No newline at end of file
diff --git a/pages/checkjob/check2.json b/pages/checkjob/check2.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/checkjob/check2.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/checkjob/check2.wxml b/pages/checkjob/check2.wxml
new file mode 100644
index 0000000..c46629b
--- /dev/null
+++ b/pages/checkjob/check2.wxml
@@ -0,0 +1,33 @@
+共{{total}}条检查条目
+
+
+
+ 检查说明:{{tasknote}}
+
+
+
+
+
+
+
+
+ {{item.content}}
+
+
+ {{item.yhnum}}
+
+
+
+
+ 检查备注
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/checkjob/check2.wxss b/pages/checkjob/check2.wxss
new file mode 100644
index 0000000..ef15154
--- /dev/null
+++ b/pages/checkjob/check2.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/checkjob/detail2.js b/pages/checkjob/detail2.js
new file mode 100644
index 0000000..9d3901e
--- /dev/null
+++ b/pages/checkjob/detail2.js
@@ -0,0 +1,66 @@
+// pages/checkjob/detail2.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
\ No newline at end of file
diff --git a/pages/checkjob/detail2.json b/pages/checkjob/detail2.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/checkjob/detail2.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/checkjob/detail2.wxml b/pages/checkjob/detail2.wxml
new file mode 100644
index 0000000..132a321
--- /dev/null
+++ b/pages/checkjob/detail2.wxml
@@ -0,0 +1,2 @@
+
+pages/checkjob/detail2.wxml
diff --git a/pages/checkjob/detail2.wxss b/pages/checkjob/detail2.wxss
new file mode 100644
index 0000000..346dc8d
--- /dev/null
+++ b/pages/checkjob/detail2.wxss
@@ -0,0 +1 @@
+/* pages/checkjob/detail2.wxss */
\ No newline at end of file
diff --git a/pages/checkjob/index2.js b/pages/checkjob/index2.js
new file mode 100644
index 0000000..c168ee8
--- /dev/null
+++ b/pages/checkjob/index2.js
@@ -0,0 +1,277 @@
+// pages/suggest/suggest.js
+var sliderWidth = 96;
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ page: 1,
+ serverUrl: getApp().globalData.serverUrl,
+ alllist: [],
+ tabs: ["历史任务", "我的待办", "全厂待办"],
+ activeIndex: 1,
+ 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.getmylist(1)
+ that.data.mypage = 1
+ }
+ else if (that.data.activeIndex == 1) {
+ that.gettodolist(1)
+ that.data.todopage = 1
+ }
+ else if (that.data.activeIndex == 2) {
+ that.getalllist(1)
+ that.data.page = 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 () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ var that = this;
+ if (that.data.activeIndex == 0) {
+ that.getmylist(1)
+ wx.stopPullDownRefresh();
+ that.data.mypage = 1
+ }
+ else if (that.data.activeIndex == 1) {
+ that.gettodolist(1)
+ wx.stopPullDownRefresh();
+ that.data.todopage = 1
+ }
+ else if (that.data.activeIndex == 2) {
+ that.getalllist(1)
+ wx.stopPullDownRefresh();
+ that.data.page = 1
+ }
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+ //上拉分页,将页码加1,然后调用分页函数
+ var that = this;
+ if (that.data.activeIndex == 0) {
+ this.data.mypage = this.data.mypage + 1;
+ this.getmylist();
+ }
+ else if (that.data.activeIndex == 1) {
+ this.data.todopage = this.data.todopage + 1;
+ this.gettodolist();
+ }
+ else if (that.data.activeIndex == 2) {
+ this.data.page = this.data.page + 1;
+ this.getalllist();
+ }
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+ getalllist: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.page }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/riskacttask?a=listalltodo&table_type=2&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,
+ alllist: []
+ })
+ }
+ else {
+ wx.showModal({
+ content: "已经到底啦!",
+ showCancel: false,
+ confirmText: "确定",
+ })
+ }
+ } else {
+ let list
+ if (page == 1) {
+ list = res.data.rows
+ } else {
+ list = this.data.alllist.concat(res.data.rows)
+ }
+ this.setData({
+ total: res.data.total,
+ alllist: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+ getmylist: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.mypage }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/riskacttask?a=listself&table_type=2&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({
+ donetotal: 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({
+ donetotal: res.data.total,
+ donelist: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+ scan: function () {
+ wx.scanCode({
+ onlyFromCamera: true,
+ success(res) {
+ console.log(res)
+ let id = res.result.split('=')[1]
+ wx.navigateTo({
+ url: 'check?riskact=' + id,
+ })
+ }
+ })
+ },
+ gettodolist: function (page) {
+ var that = this;
+ if (page != 1) { page = that.data.todopage }
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: this.data.serverUrl + 'api/riskacttask?a=listmytodo2&table_type=2&rows=10&page=' + page,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ success: res => {
+ if (res.statusCode === 200) {
+ console.log(res.data)
+ if (res.data.rows.length == 0) {
+ if (page == 1) {
+ this.setData({
+ todototal: 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({
+ todototal: res.data.total,
+ todolist: list
+ })
+ }
+ }
+ wx.hideLoading();
+ }
+ });
+ },
+})
\ No newline at end of file
diff --git a/pages/checkjob/index2.json b/pages/checkjob/index2.json
new file mode 100644
index 0000000..7bdce1d
--- /dev/null
+++ b/pages/checkjob/index2.json
@@ -0,0 +1,5 @@
+{
+ "navigationBarTitleText": "排查任务",
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 20
+}
\ No newline at end of file
diff --git a/pages/checkjob/index2.wxml b/pages/checkjob/index2.wxml
new file mode 100644
index 0000000..057386b
--- /dev/null
+++ b/pages/checkjob/index2.wxml
@@ -0,0 +1,84 @@
+
+
+
+
+ {{item}}
+
+
+
+
+
+
+ 共{{donetotal}}条
+
+
+
+
+
+ 检查表
+ {{item.riskact__name}}
+
+
+ 任务生成时间:{{item.taskadd}}
+ 任务过期时间:{{item.taskexpire}}
+ 执行人:{{item.user__name}}
+
+
+ 已执行
+ 作废
+ 已过期
+
+
+
+
+
+
+ 共{{todototal}}条任务
+
+
+
+
+
+ 检查表
+ {{item.riskact__name}}
+
+ 任务生成时间:{{item.taskadd}}
+ 任务过期时间:{{item.taskexpire}}
+ 执行人:{{item.user__name}}
+
+
+
+
+
+
+ 共{{total}}条任务
+
+
+
+
+
+ 检查表
+ {{item.riskact__name}}
+
+
+ 任务生成时间:{{item.taskadd}}
+ 任务过期时间:{{item.taskexpire}}
+ 执行人:{{item.user__name}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/checkjob/index2.wxss b/pages/checkjob/index2.wxss
new file mode 100644
index 0000000..ef15154
--- /dev/null
+++ b/pages/checkjob/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.wxml b/pages/main/main.wxml
index 7ac0eb8..4f7bb51 100644
--- a/pages/main/main.wxml
+++ b/pages/main/main.wxml
@@ -24,6 +24,11 @@
检查任务
{{checknum}}
+
+
+ 检查任务新
+ {{checknum}}
+
@@ -42,8 +47,6 @@
违章举报
-
-
行为观察
diff --git a/pages/main/main.wxss b/pages/main/main.wxss
index c6c9a1c..fffd266 100644
--- a/pages/main/main.wxss
+++ b/pages/main/main.wxss
@@ -30,6 +30,6 @@ white-space: nowrap;
}
.weui-grid {
width: 25%;
- /* border-right:none; */
+ border-right:none;
border-bottom:none;
}
\ No newline at end of file
diff --git a/pages/trouble/addtrouble.js b/pages/trouble/addtrouble.js
index 66c5fb7..cd79889 100644
--- a/pages/trouble/addtrouble.js
+++ b/pages/trouble/addtrouble.js
@@ -404,12 +404,21 @@ Page({
this.data.riskcheckdata = riskcheckdata
this.setData({
yhtype: 'riskcheck',
- yhqy: riskcheckdata.riskact__area__id,
+ riskcheckindex:options.index
+ })
+ if(riskcheckdata.step){
+
+ this.setData({
+ yhqy: riskcheckdata.riskact__area__id,
yhqy__name: riskcheckdata.riskact__area__name,
yhdd: riskcheckdata.riskact__place,
riskstep: riskcheckdata.step,
- riskcheckindex:options.index
- })
+ })
+ }else{
+ this.setData({
+ riskcontent:riskcheckdata.content.substr(0,5)+'...',
+ })
+ }
}
},
diff --git a/pages/trouble/addtrouble.wxml b/pages/trouble/addtrouble.wxml
index 528be7b..65f8500 100644
--- a/pages/trouble/addtrouble.wxml
+++ b/pages/trouble/addtrouble.wxml
@@ -2,8 +2,9 @@
错误提示
{{equipmentname}} 设备异常
- 风险 {{riskstep}}
- 风险 {{riskstep}}
+ 风险: {{riskstep}}
+ 风险: {{riskstep}}
+ 检查项: {{riskcontent}}
隐患图片
diff --git a/project.private.config.json b/project.private.config.json
new file mode 100644
index 0000000..065e6a3
--- /dev/null
+++ b/project.private.config.json
@@ -0,0 +1,8 @@
+{
+ "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+ "projectname": "aqyj",
+ "setting": {
+ "compileHotReLoad": true,
+ "urlCheck": false
+ }
+}
\ No newline at end of file