diff --git a/app.js b/app.js index 2036e08..a75ea24 100644 --- a/app.js +++ b/app.js @@ -74,8 +74,8 @@ App({ }, globalData: { userInfo: 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://192.168.0.102:8000/', //serverUrl:'http://10.7.100.250:8000/', isaqy: 0, diff --git a/app.json b/app.json index 74b5aad..88cc953 100644 --- a/app.json +++ b/app.json @@ -63,12 +63,13 @@ "pages/risk/myindex", "pages/risk/detail", "pages/risktask/index", - "pages/risktask/check", - "pages/risktask/main", "pages/riskact/index", "pages/riskact/detail", "pages/riskact/check", - "pages/chart/report" + "pages/chart/report", + "pages/risktask/detail", + "pages/riskact/index2", + "pages/area/detail" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/area/detail.js b/pages/area/detail.js new file mode 100644 index 0000000..2bc8654 --- /dev/null +++ b/pages/area/detail.js @@ -0,0 +1,128 @@ +// pages/area/detail.js +var util = require('../../utils/util.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + fromWx: false, + riskact:0, + riskactlist:[], + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var areaid + if (options.id) { + areaid = options.id + } else { + let q = decodeURIComponent(options.q) + if (q) { + // console.log("index 生命周期 onload url=" + q) + // console.log("index 生命周期 onload 参数 trainid=" + util.getQueryString(q, 'trainid')) + areaid = util.getQueryString(q, 'id') + this.setData({ + fromWx: true + }) + } + } + wx.showLoading({ + title: '', + }) + wx.request({ + url: getApp().globalData.serverUrl + 'api/area?a=detail&id=' + areaid, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + this.setData({ + name: res.data.name, + }) + + } + wx.hideLoading(); + } + }); + wx.request({ + url: getApp().globalData.serverUrl + 'api/riskact?a=listall2&area='+areaid, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + this.setData({ + total: res.data.total, + riskactlist: res.data.rows + }) + + } + wx.hideLoading(); + } + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + let riskact = this.data.riskact + let riskactlist = this.data.riskactlist + console.log(riskact,riskactlist) + for(var i=0;i +区域信息 + + + 名称 + {{name}} + + + + 共{{total}}条风险点 + + + + + {{item.name}} + + 区域 + {{item.area__name}} + 岗位 + {{item.group__groupname}} + + + 风险点类别 + {{item.type__dickeyname}} + + + + 低风险 + 一般风险 + 较大风险 + 重大风险 + 已查 + + + + + diff --git a/pages/area/detail.wxss b/pages/area/detail.wxss new file mode 100644 index 0000000..98e918f --- /dev/null +++ b/pages/area/detail.wxss @@ -0,0 +1,10 @@ +/* pages/area/detail.wxss */ +.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/examtest/index.js b/pages/examtest/index.js index 8d8df95..d777d0e 100644 --- a/pages/examtest/index.js +++ b/pages/examtest/index.js @@ -189,5 +189,27 @@ Page({ }) } - } + }, + scan: function () { + wx.scanCode({ + onlyFromCamera: true, + success(res) { + console.log(res) + if (res.result.indexOf("examtest") != -1) { + let id = res.result.split('=')[1] + wx.navigateTo({ + url: 'note?examtestid=' + id, + }) + } else { + wx.showModal({ + title: "系统提示", + content: '请扫考试二维码!', + showCancel: false, + confirmText: "确定" + }) + } + + } + }) + }, }); \ No newline at end of file diff --git a/pages/examtest/index.wxml b/pages/examtest/index.wxml index 29b56ce..7a7131b 100644 --- a/pages/examtest/index.wxml +++ b/pages/examtest/index.wxml @@ -50,4 +50,7 @@ + + \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 293efcf..9a5cc0e 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -47,7 +47,7 @@ - + diff --git a/pages/inspect/index.js b/pages/inspect/index.js index 18a99e7..ffe8b33 100644 --- a/pages/inspect/index.js +++ b/pages/inspect/index.js @@ -51,10 +51,19 @@ Page({ onlyFromCamera: true, success(res) { console.log(res) - let id = res.result.split('=')[1] - wx.navigateTo({ - url: 'add?id=' + id, - }) + if (res.result.indexOf("equipment") != -1) { + let id = res.result.split('=')[1] + wx.navigateTo({ + url: 'add?id=' + id, + }) + } else { + wx.showModal({ + title: "系统提示", + content: '请扫设备二维码!', + showCancel: false, + confirmText: "确定" + }) + } } }) }, diff --git a/pages/main/main.js b/pages/main/main.js index bf266e3..6d9ea99 100644 --- a/pages/main/main.js +++ b/pages/main/main.js @@ -255,7 +255,7 @@ Page({ var that = this //获取待考 wx.request({ - url: getApp().globalData.serverUrl + 'api/risktask?a=todonum', + url: getApp().globalData.serverUrl + 'api/riskacttask?a=todonum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), diff --git a/pages/observe/addobserve.js b/pages/observe/addobserve.js index a1cc8f0..f2b9cb0 100644 --- a/pages/observe/addobserve.js +++ b/pages/observe/addobserve.js @@ -183,15 +183,19 @@ Page({ data: {}, success: res => { if (res.statusCode === 200) { - //console.log(res.data.data) + console.log(res.data.data) + let recdata = res.data.data + for (var j = 0, lenJ = recdata.length; j < lenJ; ++j) { + recdata[j].child.push({'text':'全部安全','value':0}) + } this.setData({ - unsafe24: res.data.data[0], - unsafe25: res.data.data[1], - unsafe26: res.data.data[2], - unsafe27: res.data.data[3], - unsafe28: res.data.data[4], - unsafe29: res.data.data[5], - unsafe30: res.data.data[6], + unsafe24: recdata[0], + unsafe25: recdata[1], + unsafe26: recdata[2], + unsafe27: recdata[3], + unsafe28: recdata[4], + unsafe29: recdata[5], + unsafe30: recdata[6], }) } } @@ -302,7 +306,20 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - + let lst = getApp().globalData.selectPeopleList + let nst = [] + let nst1 = [] + if (lst) { + for (var i = 0; i < lst.length; i++) { + nst.push(lst[i]['name']) + nst1.push(lst[i]['id']) + } + this.setData({ + gcryname: nst.join(','), + lookers: nst1.join(','), + lookersnum: nst1.length + }) + } }, /** diff --git a/pages/observe/addobserve.wxml b/pages/observe/addobserve.wxml index 20469a5..0341543 100644 --- a/pages/observe/addobserve.wxml +++ b/pages/observe/addobserve.wxml @@ -25,6 +25,19 @@ 观察信息 + + + 观察人员 + + + + 请选择 + + + + + {{gcryname}} + 被观察人员 diff --git a/pages/operation/list.wxml b/pages/operation/list.wxml index 53bb163..aea17ed 100644 --- a/pages/operation/list.wxml +++ b/pages/operation/list.wxml @@ -7,7 +7,7 @@ {{item.dickeyname}} {{item.detail}} - 审批流程:{{item.splcdetail}} + 自动审批:{{item.splcdetail}} diff --git a/pages/operation/operationcheck.wxml b/pages/operation/operationcheck.wxml index c8d511b..7a002db 100644 --- a/pages/operation/operationcheck.wxml +++ b/pages/operation/operationcheck.wxml @@ -116,5 +116,7 @@ - - \ No newline at end of file + + + +当前操作:{{action}} \ No newline at end of file diff --git a/pages/riskact/check.js b/pages/riskact/check.js index 9321355..49b90ea 100644 --- a/pages/riskact/check.js +++ b/pages/riskact/check.js @@ -33,33 +33,11 @@ Page({ if (res.statusCode === 200) { wx.hideLoading() console.log(res.data) - 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 + alllist: res.data.rows }) } - } wx.hideLoading(); } }); @@ -121,7 +99,7 @@ Page({ submit: function () { console.log(this.data.alllist) let alllist = this.data.alllist - let data = {'checks':[]} + let data = {'checks':[],'riskact':this.data.riskact} for (var i = 0; i < alllist.length; i++) { if (i.trouble != undefined){ data.checks.push({ 'id': alllist[i].id }) @@ -134,7 +112,7 @@ Page({ title: '提交中', }) wx.request({ - url: getApp().globalData.serverUrl + 'api/riskcheck?a=add', + url: getApp().globalData.serverUrl + 'api/riskcheck2?a=add', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -143,6 +121,14 @@ Page({ 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({ }) } diff --git a/pages/riskact/check.wxml b/pages/riskact/check.wxml index 2359d6f..b663bc7 100644 --- a/pages/riskact/check.wxml +++ b/pages/riskact/check.wxml @@ -47,5 +47,5 @@ + disabled="{{alllist[0].user__userid!=null}}">排查完毕,提交! diff --git a/pages/riskact/index.js b/pages/riskact/index.js index a5a18e2..0d4342d 100644 --- a/pages/riskact/index.js +++ b/pages/riskact/index.js @@ -21,7 +21,7 @@ Page({ activeIndex: e.currentTarget.id }); if (that.data.activeIndex == 0) { - that.getmyriskchecklist(1) + that.getmyriskactchecklist(1) that.data.mypage = 1 } else if (that.data.activeIndex == 1) { @@ -79,7 +79,7 @@ Page({ onPullDownRefresh: function () { var that = this; if (that.data.activeIndex == 0) { - that.getmyriskchecklist(1) + that.getmyriskactchecklist(1) that.data.mypage = 1 } else if (that.data.activeIndex == 1){ that.getriskactlist(1); @@ -94,9 +94,10 @@ Page({ */ onReachBottom: function () { //上拉分页,将页码加1,然后调用分页函数 + var that =this if (that.data.activeIndex == 0) { this.data.mypage = this.data.mypage + 1; - this.getmyriskchecklist(); + this.getmyriskactchecklist(); } else if (that.data.activeIndex == 1){ this.data.page = this.data.page + 1; this.getriskactlist(); @@ -115,10 +116,42 @@ Page({ onlyFromCamera: true, success(res) { console.log(res) - let id = res.result.split('=')[1] - wx.navigateTo({ - url: 'detail?id='+id, - }) + if (res.result.indexOf("riskact") != -1){ + let id = res.result.split('=')[1] + wx.navigateTo({ + url: 'detail?id=' + id, + }) + }else{ + wx.showModal({ + title: "系统提示", + content: '请扫风险点二维码!', + showCancel: false, + confirmText: "确定" + }) + } + + } + }) + }, + scanArea: function () { + wx.scanCode({ + onlyFromCamera: true, + success(res) { + console.log(res) + if (res.result.indexOf("area") != -1) { + let id = res.result.split('=')[1] + wx.navigateTo({ + url: '/pages/area/detail?id=' + id, + }) + } else { + wx.showModal({ + title: "系统提示", + content: '请扫区域二维码!', + showCancel: false, + confirmText: "确定" + }) + } + } }) }, @@ -167,14 +200,14 @@ Page({ } }); }, - getmyriskchecklist: function (page) { + getmyriskactchecklist: function (page) { var that = this; if (page != 1) { page = that.data.mapage } wx.showLoading({ title: '加载中', }), wx.request({ - url: this.data.serverUrl + 'api/riskcheck?a=listself&rows=10&page=' + page, + url: this.data.serverUrl + 'api/riskacttask?a=listself&rows=10&page=' + page, header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -185,7 +218,7 @@ Page({ if (page == 1) { this.setData({ mytotal: 0, - riskchecklist: [] + riskactchecklist: [] }) } else { @@ -200,11 +233,11 @@ Page({ if (page == 1) { list = res.data.rows } else { - list = this.data.riskchecklist.concat(res.data.rows) + list = this.data.riskactchecklist.concat(res.data.rows) } this.setData({ mytotal: res.data.total, - riskchecklist: list + riskactchecklist: list }) } } diff --git a/pages/riskact/index.wxml b/pages/riskact/index.wxml index af5d0c7..dd43578 100644 --- a/pages/riskact/index.wxml +++ b/pages/riskact/index.wxml @@ -12,30 +12,28 @@ 共{{mytotal}}条风险排查记录 - - + + - {{item.risk__step}} + {{item.riskact__name}} - 风险点 - {{item.risk__riskact__name}} 区域 - {{item.risk__riskact__area__name}} + {{item.riskact__area__name}} 排查时间 - {{item.dotime}} + {{item.taskdo}} - 低风险 - 一般风险 - 较大风险 - 重大风险 - 隐患 + 低风险 + 一般风险 + 较大风险 + 重大风险 + 异常 正常 - + @@ -50,6 +48,8 @@ 区域 {{item.area__name}} + 岗位 + {{item.group__groupname}} 风险点类别 @@ -72,7 +72,13 @@ - - - {{item.trouble__yhnum}} - - - diff --git a/pages/risktask/detail.wxss b/pages/risktask/detail.wxss new file mode 100644 index 0000000..ef15154 --- /dev/null +++ b/pages/risktask/detail.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/risktask/index.js b/pages/risktask/index.js index 89ad83c..dc817d5 100644 --- a/pages/risktask/index.js +++ b/pages/risktask/index.js @@ -145,7 +145,7 @@ Page({ title: '加载中', }), wx.request({ - url: this.data.serverUrl + 'api/risktask?a=listalltodo&rows=10&page=' + page, + url: this.data.serverUrl + 'api/riskacttask?a=listalltodo&rows=10&page=' + page, header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -190,7 +190,7 @@ Page({ title: '加载中', }), wx.request({ - url: this.data.serverUrl + 'api/risktask?a=list2done&rows=10&page=' + page, + url: this.data.serverUrl + 'api/riskacttask?a=listself&rows=10&page=' + page, header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -247,7 +247,7 @@ Page({ title: '加载中', }), wx.request({ - url: this.data.serverUrl + 'api/risktask?a=list2todo&rows=10&page=' + page, + url: this.data.serverUrl + 'api/riskacttask?a=listmytodo&rows=10&page=' + page, header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), diff --git a/pages/risktask/index.wxml b/pages/risktask/index.wxml index ea0987d..54513d9 100644 --- a/pages/risktask/index.wxml +++ b/pages/risktask/index.wxml @@ -12,24 +12,24 @@ 共{{donetotal}}条 - + 风险点 - {{item.risk__riskact__area__name}} {{item.risk__riskact__name}} + {{item.riskact__area__name}} {{item.riskact__name}} 排查岗位 - {{item.risk__group__groupname}} + {{item.riskact__group__groupname}} 任务生成时间:{{item.taskadd}} 任务过期时间:{{item.taskexpire}} - 低风险 - 一般风险 - 较大风险 - 重大风险 + 低风险 + 一般风险 + 较大风险 + 重大风险 已执行 作废 未执行 @@ -42,29 +42,25 @@ 共{{todototal}}条任务 - + 风险点 - {{item.risk__riskact__area__name}} {{item.risk__riskact__name}} + {{item.riskact__area__name}} {{item.riskact__name}} 排查岗位 - {{item.risk__group__groupname}} + {{item.riskact__group__groupname}} 任务生成时间:{{item.taskadd}} 任务过期时间:{{item.taskexpire}} - 低风险 - 一般风险 - 较大风险 - 重大风险 + 低风险 + 一般风险 + 较大风险 + 重大风险 已完成 - - 风险数量 - {{item.num}} - @@ -74,24 +70,24 @@ 共{{total}}条任务 - + 风险点 - {{item.risk__riskact__area__name}} {{item.risk__riskact__name}} + {{item.riskact__area__name}} {{item.riskact__name}} 排查岗位 - {{item.risk__group__groupname}} + {{item.group__groupname}} 任务生成时间:{{item.taskadd}} 任务过期时间:{{item.taskexpire}} - 低风险 - 一般风险 - 较大风险 - 重大风险 + 低风险 + 一般风险 + 较大风险 + 重大风险 已完成 diff --git a/pages/risktask/main.js b/pages/risktask/main.js deleted file mode 100644 index 7abd958..0000000 --- a/pages/risktask/main.js +++ /dev/null @@ -1,283 +0,0 @@ -// pages/examtest/main.js -var util = require('../../utils/util.js') -Page({ - - /** - * 页面的初始数据 - */ - data: { - fxIndex: 0, - answerChoices: [], - ydtm: 0 - }, - riskdata: { - - }, - calydtm: function (e) { - var tms = this.riskdata.tms - var ydtm = 0 - for (var i = 0, len = tms.length; i < len; ++i) { - if (tms[i].userchecked && tms[i].userchecked.length != 0) { - ydtm += 1 - } - } - this.setData({ - ydtm: ydtm - }) - }, - radioChange: function (e) { - console.log('radio发生change事件,携带value值为:', e.detail.value); - var answerChoices = this.data.answerChoices; - for (var i = 0, len = answerChoices.length; i < len; ++i) { - answerChoices[i].checked = answerChoices[i].value == e.detail.value; - } - - this.setData({ - answerChoices: answerChoices, - }); - this.riskdata.tms[this.data.fxIndex]['userchecked'] = e.detail.value - this.calydtm() - }, - checkboxChange: function (e) { - console.log('checkbox发生change事件,携带value值为:', e.detail.value); - - var answerChoices = this.data.answerChoices, values = e.detail.value; - for (var i = 0, lenI = answerChoices.length; i < lenI; ++i) { - answerChoices[i].checked = false; - - for (var j = 0, lenJ = values.length; j < lenJ; ++j) { - if (answerChoices[i].value == values[j]) { - answerChoices[i].checked = true; - break; - } - } - } - - this.setData({ - answerChoices: answerChoices, - }); - this.riskdata.tms[this.data.fxIndex]['userchecked'] = e.detail.value - this.calydtm() - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - console.log(options) - this.data.riskact = options.riskact - this.data.group = options.group - wx.showLoading({}) - wx.request({ - url: getApp().globalData.serverUrl + 'api/risktask?a=listtaskall' + '&group=' + this.data.group + '&riskact=' + this.data.riskact, - header: { - 'content-type': 'application/json', // 默认值 - 'Cookie': wx.getStorageSync("sessionid"), - }, - success: res => { - if (res.statusCode === 200) { - let risks = res.data - this.riskdata = risks - this.showRisk(0) - this.setData({ - total: risks.total, - }) - } - wx.hideLoading(); - } - }); - - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - // wx.showModal({ - // title: '系统提示', - // content: '未完成答卷,是否要提交答卷!', - // confirmText: "提交", - // cancelText: "点错了", - // success: function (res) { - // if (res.confirm) { - // } else { - // this.onShow() - // } - // } - // }) - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, - showRisk: function (index) { - var that = this - var currentFx = that.riskdata.rows[index] - console.log(currentFx) - that.setData({ 'currentFx': currentFx }) - }, - showChecked: function (index) { - var tm = this.riskdata.tms[index] - let choices = this.data.answerChoices - if (tm.userchecked) { - if (tm.question__type == 2) { - for (var i = 0, len = choices.length; i < len; i++) { - if (tm.userchecked.indexOf(choices[i].value) != -1) { - choices[i].checked = true - } - } - } else { - for (var i = 0, len = choices.length; i < len; i++) { - if (choices[i].value == tm.userchecked) { - choices[i].checked = true - } - } - } - this.setData({ - answerChoices: choices - }) - } - }, - next: function () { - var that = this - var fxIndex = that.data.fxIndex + 1 - that.showTm(fxIndex) - that.setData({ - fxIndex: fxIndex, - }) - that.showChecked(fxIndex) - }, - previous: function () { - var that = this - var fxIndex = that.data.fxIndex - 1 - that.showTm(fxIndex) - that.setData({ - fxIndex: fxIndex, - }) - that.showChecked(fxIndex) - }, - hand: function () { - var that = this - if (that.data.ydtm < that.riskdata.tms.length) { - wx.showModal({ - title: '警告', - content: '答卷未完成,确定提交?', - confirmText: "确定", - cancelText: "取消", - success: function (res) { - if (res.confirm) { - that.handtest() - } - } - }) - } else { - wx.showModal({ - content: '确定提交?', - confirmText: "确定", - cancelText: "取消", - success: function (res) { - if (res.confirm) { - that.handtest() - } - } - }) - } - }, - handtest: function () { - var data = { - 'testid': this.data.testid, - 'starttime': this.data.starttime, - 'endtime': util.formatTime(new Date()), - 'sheet': this.riskdata.tms - } - wx.showLoading({ - title: '自动判卷中..', - }) - wx.request({ - url: getApp().globalData.serverUrl + 'api/examtestdetail?a=handtest&id=' + this.data.testid, - header: { - 'content-type': 'application/json', // 默认值 - 'Cookie': wx.getStorageSync("sessionid"), - }, - method: 'POST', - data: data, - success: res => { - if (res.statusCode === 200) { - wx.hideLoading() - wx.redirectTo({ - url: 'result?' + parseParams(res.data.data), - }) - clearTimeout(getApp().globalData.timepass) - } - } - }); - } -}) -function formatmil(mil) { - var allSecond = Math.floor(mil / 1000); - var h = Math.floor(allSecond / 3600); - var m = Math.floor((allSecond - h * 3600) / 60); - var s = Math.floor(allSecond - h * 3600 - m * 60); - h = toTow(h); - m = toTow(m); - s = toTow(s); - return h + ":" + m + ":" + s; -} -function toTow(num) { - if (num < 10) { - return "0" + num; - } else { - return num; - } -} -function parseParams(data) { - try { - var tempArr = []; - for (var i in data) { - var key = encodeURIComponent(i); - var value = encodeURIComponent(data[i]); - tempArr.push(key + '=' + value); - } - var urlParamsStr = tempArr.join('&'); - return urlParamsStr; - } catch (err) { - return ''; - } -} \ No newline at end of file diff --git a/pages/risktask/main.json b/pages/risktask/main.json deleted file mode 100644 index 9c848e5..0000000 --- a/pages/risktask/main.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "usingComponents": {}, - "navigationBarTitleText": "考试中" -} \ No newline at end of file diff --git a/pages/risktask/main.wxml b/pages/risktask/main.wxml deleted file mode 100644 index 809eb2d..0000000 --- a/pages/risktask/main.wxml +++ /dev/null @@ -1,50 +0,0 @@ - - - -倒计时 {{countdown}} - -答题卡: {{ydtm}}/{{tmtotal}} - - - - - - {{tmIndex+1}}. - 单选题 - 多选题 - 判断题 - ({{currentTm.score}}分) - - {{currentTm.question__title}} - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pages/risktask/main.wxss b/pages/risktask/main.wxss deleted file mode 100644 index e51debe..0000000 --- a/pages/risktask/main.wxss +++ /dev/null @@ -1,18 +0,0 @@ -.head{ - color:#fff; - background-color: cornflowerblue; -} -.txlabel{ - color:#fff; - background-color: rgb(216, 140, 0); - padding: 2px -} -.weui-btn{ - width:auto; - margin: 5px; -} -.sheet{ - color:#fff; - background-color: red; - float:right -} \ No newline at end of file diff --git a/pages/suggest/update.js b/pages/suggest/update.js index 52a5174..9ade9c6 100644 --- a/pages/suggest/update.js +++ b/pages/suggest/update.js @@ -11,40 +11,8 @@ Page({ shresult:'', apcl:true, zjtr:false, - }, - shChange: function (e) { - if (e.detail.value == false) { this.setData({ - shresult:'reject' - }) } - else { this.setData({ - shresult:'' - }) } - }, - apcl: function (e) { - if (e.detail.value == false) { - this.setData({ - apcl: false, - }) - } - else { - this.setData({ - apcl: true - }) - } - console.log(this.data.apcl) - }, - zjtr: function (e) { - if (e.detail.value == false) { - this.setData({ - zjtr:false - }) - } - else { - this.setData({ - apcl: false, - zjtr:true, - }) - } + accept: 'yes', + action: '安排处理' }, bindjyfkInput: function (e) { this.data.jyfk = e.detail.value @@ -314,4 +282,44 @@ Page({ urls: this.data.jyimg2 }) }, + openaction: function () { + var that = this + wx.showActionSheet({ + itemList: ['安排处理', '转交他人', '不采纳','采纳并归档'], + success: function (res) { + if (!res.cancel) { + if (res.tapIndex == 0) { + that.setData({ + 'apcl': true, + 'zjtr': false, + 'accept': 'yes', + 'action': '安排处理' + }) + } + else if (res.tapIndex == 1) { + that.setData({ + 'apcl': false, + 'zjtr': true, + 'accept': 'yes', + 'action': '转交他人' + }) + } else if (res.tapIndex == 2) { + that.setData({ + 'apcl': false, + 'zjtr': false, + 'accept': 'no', + 'action': '不采纳' + }) + } else if (res.tapIndex == 3) { + that.setData({ + 'apcl': false, + 'zjtr': false, + 'accept': 'yes', + 'action': '采纳并归档' + }) + } + } + } + }); + } }) \ No newline at end of file diff --git a/pages/suggest/update.wxml b/pages/suggest/update.wxml index 10571ff..8d13924 100644 --- a/pages/suggest/update.wxml +++ b/pages/suggest/update.wxml @@ -118,20 +118,9 @@ - - - 安排处理 - - - - - - 转交 - - - - - + +当前操作:{{action}} + diff --git a/pages/train/train.js b/pages/train/train.js index f4ab65a..a0aacac 100644 --- a/pages/train/train.js +++ b/pages/train/train.js @@ -244,10 +244,20 @@ Page({ onlyFromCamera: true, success(res) { console.log(res) - let pxid = util.getQueryString(res.result, 'trainid') - wx.navigateTo({ - url: 'check?pxid='+pxid, - }) + if (res.result.indexOf("trainid") != -1) { + let pxid = util.getQueryString(res.result, 'trainid') + wx.navigateTo({ + url: 'check?pxid=' + pxid, + }) + } else { + wx.showModal({ + title: "系统提示", + content: '请扫培训二维码!', + showCancel: false, + confirmText: "确定" + }) + } + } }) }, diff --git a/pages/trouble/accesstrouble.js b/pages/trouble/accesstrouble.js index f2547cc..caaf3b2 100644 --- a/pages/trouble/accesstrouble.js +++ b/pages/trouble/accesstrouble.js @@ -27,7 +27,8 @@ Page({ yhtp: [], zghtp: [], zppg: 'no', - newr:'' + newr:'', + action:'正常处理' }, yhlbArray:{}, bindfcyjInput: function (e) { @@ -45,37 +46,6 @@ Page({ bindyhddInput: function (e) { this.data.yhdd = e.detail.value }, - shChange: function(e){ - if (e.detail.value == false) { this.data.shresult='reject'} - else { this.data.shresult = ''} - }, - zppg: function (e) { - if (e.detail.value == true) { - this.setData({ - zppg: 'yes', - }) } - else { - this.setData({ - zppg:'no', - }) - } - }, - bhct: function (e) { - if (e.detail.value == false) { - this.setData({ - shresult:'pass', - zppg: 'no', - zppg_d: false, - }) - } - else { - this.setData({ - shresult: 'reject', - zppg_c: false, - zppg_d:true - }) - } - }, bindyhpgChange: function (e) { this.setData({ yhpgIndex: e.detail.value, @@ -608,5 +578,45 @@ Page({ }) } }) + }, + openaction: function () { + var that=this + wx.showActionSheet({ + itemList: ['正常处理', '转交他人', '驳回重填', '不采纳'], + success: function (res) { + if (!res.cancel) { + if(res.tapIndex==0){ + that.setData({ + 'zppg': 'no', + 'shresult': 'pass', + 'accept': 'yes', + 'action':'正常处理' + }) + } + else if(res.tapIndex==1){ + that.setData({ + 'zppg':'yes', + 'shresult':'pass', + 'accept': 'yes', + 'action': '转交他人' + }) + }else if(res.tapIndex==2){ + that.setData({ + 'shresult':'reject', + 'zppg':'no', + 'accept': 'yes', + 'action': '驳回重填' + }) + }else if(res.tapIndex==3){ + that.setData({ + 'shresult': 'reject', + 'zppg': 'no', + 'accept': 'no', + 'action': '不采纳' + }) + } + } + } + }); } }) \ No newline at end of file diff --git a/pages/trouble/accesstrouble.wxml b/pages/trouble/accesstrouble.wxml index f010086..fd058fc 100644 --- a/pages/trouble/accesstrouble.wxml +++ b/pages/trouble/accesstrouble.wxml @@ -97,19 +97,8 @@ - - - 转交他人 - - - - - - 退回重填 - - - - + +当前操作:{{action}} 新评估人