diff --git a/app.json b/app.json
index 3b1c6da..b092dc2 100644
--- a/app.json
+++ b/app.json
@@ -95,7 +95,8 @@
"pages/user/chose",
"pages/safelist/index",
"pages/safefeedback/index",
- "pages/safefeedback/add"
+ "pages/safefeedback/add",
+ "pages/operation/operationedit"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/pages/operation/operation.js b/pages/operation/operation.js
index b5230da..f63ecda 100644
--- a/pages/operation/operation.js
+++ b/pages/operation/operation.js
@@ -227,4 +227,16 @@ Page({
})
},
+ toDo:function(e){
+ let item=e.currentTarget.dataset.item
+ if(item.zyzt.index==-1){
+ wx.navigateTo({
+ url: 'operationedit?zyid='+item.zyid,
+ })
+ }else{
+ wx.navigateTo({
+ url: 'operationcheck?zyid='+item.zyid,
+ })
+ }
+ }
});
\ No newline at end of file
diff --git a/pages/operation/operation.wxml b/pages/operation/operation.wxml
index d01bdf7..5b5c45c 100644
--- a/pages/operation/operation.wxml
+++ b/pages/operation/operation.wxml
@@ -36,7 +36,7 @@
共{{todototal}}条作业许可
-
+
{{item.zylx__dickeyname}}
@@ -48,7 +48,7 @@
{{item.zyzt.zyzt}}
-
+
diff --git a/pages/operation/operationadd.js b/pages/operation/operationadd.js
index efaa650..070d7b3 100644
--- a/pages/operation/operationadd.js
+++ b/pages/operation/operationadd.js
@@ -136,7 +136,7 @@ Page({
nst1.push(lst[i]['id'])
}
this.setData({
- zyryname: nst.join(','),
+ zyry_names: nst.join(','),
zyry: nst1
})
}
diff --git a/pages/operation/operationadd.wxml b/pages/operation/operationadd.wxml
index e1d042b..8d128e8 100644
--- a/pages/operation/operationadd.wxml
+++ b/pages/operation/operationadd.wxml
@@ -78,7 +78,7 @@
- {{zyryname}}
+ {{zyry_names}}
作业内容
@@ -86,7 +86,6 @@
-
diff --git a/pages/operation/operationcheck.js b/pages/operation/operationcheck.js
index 6e51f9e..48d9023 100644
--- a/pages/operation/operationcheck.js
+++ b/pages/operation/operationcheck.js
@@ -11,6 +11,10 @@ Page({
zjsp:false,
zyspryname: '',
spry: [],
+ suggestion:''
+ },
+ bindspyjInput: function (e) {
+ this.data.suggestion = e.detail.value
},
getZy: function (zyid) {
wx.showLoading({
@@ -281,7 +285,7 @@ Page({
openaction: function () {
var that = this
wx.showActionSheet({
- itemList: ['确认无误,审批通过', '提交上级审批'],
+ itemList: ['确认无误,审批通过', '提交上级审批', '驳回整改'],
success: function (res) {
if (!res.cancel) {
if (res.tapIndex == 0) {
@@ -292,7 +296,15 @@ Page({
'zjsp': true,
'action':'提交上级审批'
})
- } else if (res.tapIndex == 2) {
+ }
+ else if (res.tapIndex == 2){
+ //驳回整改
+ if(that.data.suggestion == ''){
+ wx.showToast({
+ title: '请填写审批意见',
+ icon:'none'
+ })
+ }else{
wx.request({
url: that.data.serverUrl + 'api/operation?a=spzy',
header: {
@@ -300,7 +312,7 @@ Page({
'Cookie': getApp().globalData.sessionId,
},
method: 'POST',
- data: { 'zyid': that.data.zyid ,'zzsp':true},
+ data: { 'zyid': that.data.zyid ,'bhzy':true, 'suggestion':that.data.suggestion},
success: res => {
if (res.statusCode === 200) {
wx.hideLoading();
@@ -310,7 +322,27 @@ Page({
}
}
});
- }
+ }
+ }
+ // else if (res.tapIndex == 2) {
+ // wx.request({
+ // url: that.data.serverUrl + 'api/operation?a=spzy',
+ // header: {
+ // 'content-type': 'application/json', //
+ // 'Cookie': getApp().globalData.sessionId,
+ // },
+ // method: 'POST',
+ // data: { 'zyid': that.data.zyid ,'zzsp':true},
+ // success: res => {
+ // if (res.statusCode === 200) {
+ // wx.hideLoading();
+ // wx.navigateBack({
+ // delta: 1
+ // })
+ // }
+ // }
+ // });
+ // }
}
}
});
diff --git a/pages/operation/operationcheck.wxml b/pages/operation/operationcheck.wxml
index 3cee840..62b1c7c 100644
--- a/pages/operation/operationcheck.wxml
+++ b/pages/operation/operationcheck.wxml
@@ -70,7 +70,7 @@
作业人员
- {{zyry}}
+ {{zyry_names}}
@@ -93,7 +93,7 @@
风险分析和安全措施
-
+
{{item.fxfx}}
{{item.aqcs}}
@@ -102,6 +102,15 @@
+
+审批意见
+
+
+
+
+
+
+
关闭现场图片(如有)
diff --git a/pages/operation/operationdetail.js b/pages/operation/operationdetail.js
index 1986453..f917211 100644
--- a/pages/operation/operationdetail.js
+++ b/pages/operation/operationdetail.js
@@ -58,11 +58,16 @@ Page({
var prepage = pages[pages.length - 2];//上一页面指针
var zydata = prepage.data
//格式化信息
+
for (var i = 0; i < zydata.zyimg.length; i++) {
- zydata.zyimg[i] = this.data.serverUrl + zydata.zyimg[i];
+ if (zydata.zyimg[i].indexOf(this.data.serverUrl) == -1){
+ zydata.zyimg[i] = this.data.serverUrl + zydata.zyimg[i];
+ }
}
for (var i = 0; i < zydata.zyimg2.length; i++) {
+ if (zydata.zyimg[i].indexOf(this.data.serverUrl) == -1){
zydata.zyimg2[i] = this.data.serverUrl + zydata.zyimg2[i];
+ }
}
this.setData(zydata)
}else{
diff --git a/pages/operation/operationdetail.wxml b/pages/operation/operationdetail.wxml
index ae2aa56..d3cf476 100644
--- a/pages/operation/operationdetail.wxml
+++ b/pages/operation/operationdetail.wxml
@@ -86,7 +86,7 @@
作业人员
- {{zyry}}
+ {{zyry_names}}
@@ -109,7 +109,7 @@
风险分析和安全措施
-
+
{{item.fxfx}}
{{item.aqcs}}
@@ -169,9 +169,11 @@
{{item.jdmc}}
+
{{item.spr__name}} {{item.submittime}}
+ {{item.suggestion}}
-
+
待审批
@@ -180,6 +182,9 @@
通过并提交上级
+
+ 未通过
+
diff --git a/pages/operation/operationedit.js b/pages/operation/operationedit.js
new file mode 100644
index 0000000..6e1ed5a
--- /dev/null
+++ b/pages/operation/operationedit.js
@@ -0,0 +1,444 @@
+// pages/operation/operationadd.js
+var dateTimePicker = require('../../utils/dateTimePicker.js');
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ zyimg:[],
+ zyqy:'',
+ chosespr:false,
+ serverUrl:getApp().globalData.serverUrl
+ },
+ bindspr1change: function (e) {
+ this.setData({
+ spr1index: e.detail.value,
+ })
+ this.data.spr1s = this.data.spr1Array[e.detail.value].value
+ },
+ bindspr2change: function (e) {
+ this.setData({
+ spr2index: e.detail.value,
+ })
+ this.data.spr2s = this.data.spr2Array[e.detail.value].value
+ },
+ checkboxChangefxcs: function (e) {
+ console.log(e)
+ var x = this.data.fxcslist;
+ var values = e.detail.value;
+ for (var j = 0, lenJ = x.length; j < lenJ; ++j) {
+ if (values.indexOf(x[j]['id'].toString()) >= 0){
+ x[j].checked=true
+ }else{
+ x[j].checked=false
+ }
+ }
+ this.setData({
+ fxcslist:x,
+ fxcs: values
+ })
+ },
+
+ bindzyddInput: function (e) {
+ this.data.zydd = e.detail.value
+ },
+ bindzynrInput: function (e) {
+ this.data.zynr = e.detail.value
+ },
+ chosesprChange: function (e) {
+ if (e.detail.value) {
+ this.setData({
+ chosespr:true
+ })
+ } else {
+ this.setData({
+ chosespr:false
+ })
+ }
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ // 获取完整的年月日 时分秒,以及默认显示的数组
+ var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
+ var dateTimeArray1 = obj1.dateTimeArray
+ var dateTime1 = obj1.dateTime
+ var time = dateTimeArray1[0][dateTime1[0]] + '-' + dateTimeArray1[1][dateTime1[1]] + '-' + dateTimeArray1[2][dateTime1[2]] + ' ' + dateTimeArray1[3][dateTime1[3]] + ':' + dateTimeArray1[4][dateTime1[4]]
+ this.setData({
+ dateTimeArray1: obj1.dateTimeArray,
+ dateTime1: obj1.dateTime,
+ dateshow1: 0
+ });
+ // 获取完整的年月日 时分秒,以及默认显示的数组
+ var obj2 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
+ var dateTimeArray2 = obj2.dateTimeArray
+ var dateTime2 = obj2.dateTime
+ var time = dateTimeArray2[0][dateTime2[0]] + '-' + dateTimeArray2[1][dateTime2[1]] + '-' + dateTimeArray2[2][dateTime2[2]] + ' ' + dateTimeArray2[3][dateTime2[3]] + ':' + dateTimeArray2[4][dateTime2[4]]
+ this.setData({
+ dateTimeArray2: obj2.dateTimeArray,
+ dateTime2: obj2.dateTime,
+ dateshow2: 0
+ });
+
+ this.getZy(options.zyid);
+
+ //拉取地图权限
+ if (getApp().globalData.userInfo.perms.indexOf(30) != -1) {
+ this.setData({
+ mapright: true
+ })
+ } else {
+ this.setData({
+ mapright: false
+ })
+ }
+ },
+ getZy: function (zyid) {
+ wx.showLoading({
+ title: '加载中',
+ }),
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/operation?a=detail&zyid=' + zyid,
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ data: {},
+ success: res => {
+ wx.hideLoading();
+ if (res.statusCode === 200) {
+ var zydata = res.data
+ //格式化信息
+ for (var i = 0; i < zydata.zyimg.length; i++) {
+ zydata.zyimg[i] = getApp().globalData.serverUrl + zydata.zyimg[i];
+ }
+ for (var i = 0; i < zydata.zyimg2.length; i++) {
+ zydata.zyimg2[i] = getApp().globalData.serverUrl + zydata.zyimg2[i];
+ }
+ this.setData(zydata)
+ this.getspr12array()
+ let zylx = zydata.zylx
+ //风险分析和控制措施
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/fxcs?a=listall&zylx='+zylx,
+ header: {
+ 'content-type': 'application/json', //
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ method: 'GET',
+ success: res => {
+ if (res.statusCode === 200) {
+ let fxcslist = res.data.rows
+
+ for(var i=0;i {
+ if (res.statusCode === 200) {
+ this.setData({
+ spr1Array:res.data.data.spr1Array,
+ spr2Array:res.data.data.spr2Array
+ })
+ }
+ }
+ });
+ },
+ submit:function(){
+ var that = this;
+ if (!that.data.kssj) {
+ that.Tap1('请选择开始时间!')
+ }
+ else if (!that.data.jssj) {
+ that.Tap1('请选择结束时间!')
+ } else if (!that.data.zydd) {
+ that.Tap1('请输入作业地点!')
+ }else if (!that.data.sdbm) {
+ that.Tap1('请输入属地部门!')
+ } else if (!that.data.zyry) {
+ that.Tap1('请输入作业人员!')
+ } else if (!that.data.zynr) {
+ that.Tap1('请输入作业内容!')
+ } else if (!that.data.fxcs) {
+ that.Tap1('请确认分析措施!')
+ } else if (that.data.chosespr==true) {
+ if(!that.data.spr1s||!that.data.spr2s){
+ that.Tap1('审批人未选择!')
+ }else{
+ this.upimg(0, this.data.zyimg.length);
+ }
+ }else {
+ this.upimg(0, this.data.zyimg.length);
+ }
+
+ },
+ Tap1: function (x) {
+ wx.showModal({
+ title: "系统提示",
+ content: x,
+ showCancel: false,
+ confirmText: "确定"
+ })
+ },
+ //上传图片
+ upimg: function (x, y) {
+ var that = this
+ if (x < y) {
+ wx.showLoading({
+ title: '上传现场图片' + (x + 1) + '....',
+ })
+ if (that.data.zyimg[x].indexOf(that.data.serverUrl) == -1){
+ wx.uploadFile({
+ header: {
+ 'content-type': 'application/json', // 默认值
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ url: getApp().globalData.serverUrl + 'upfile',
+ filePath: that.data.zyimg[x],
+ name: 'upfile',
+ success(res) {
+ var obj = JSON.parse(res.data);
+ that.data.zyimg[x] = obj['filepath']
+ x = x + 1
+ if (x < y) {
+ that.upimg(x, y)
+ }
+ else {
+ that.editzy()
+ }
+ }
+ })}else{
+ that.data.zyimg[x].replace(that.data.serverUrl, "")
+ var bl = that.data.zyimg[x].replace(that.data.serverUrl, "")
+ that.data.zyimg[x] = bl
+ x = x + 1
+ if (x < y) {
+ that.upimg(x, y)
+ } else {
+ that.editzy()
+ }
+ }
+ } else {
+ that.editzy()
+ }
+ },
+ editzy: function () {
+ // let fxcs = []
+ // let x = this.data.fxcslist
+ // for (var i = 0, len = x.length; i < len; ++i) {
+ // if (x[i].checked = true) {
+ // fxcs.push(x[i].id)
+ // }
+ // }
+ var zydata = {
+ zyid:this.data.zyid,
+ zylx:this.data.zylx,
+ kssj: this.data.kssj,
+ jssj: this.data.jssj,
+ zyqy:this.data.zyqy,
+ zydd: this.data.zydd,
+ zynr: this.data.zynr,
+ zyry: this.data.zyry,
+ zyimg: this.data.zyimg,
+ sdbm:this.data.sdbm,
+ fxcs: this.data.fxcs,
+ chosespr:this.data.chosespr,
+ }
+ if(this.data.chosespr){
+ zydata.spr1s = this.data.spr1s
+ zydata.spr2s = this.data.spr2s
+ zydata.chosespr = this.data.chosespr
+ }
+ //console.log(gcdata.unsafe)
+ wx.showLoading({
+ title: '',
+ })
+ wx.request({
+ url: getApp().globalData.serverUrl + 'api/operation?a=edit',
+ header: {
+ 'content-type': 'application/json', //
+ 'Cookie': getApp().globalData.sessionId,
+ },
+ method: 'POST',
+ data: zydata,
+ success: res => {
+ if (res.statusCode === 200) {
+ wx.hideLoading();
+ wx.navigateBack({
+ })
+ }
+ }
+ });
+ },
+})
\ No newline at end of file
diff --git a/pages/operation/operationedit.json b/pages/operation/operationedit.json
new file mode 100644
index 0000000..82fe767
--- /dev/null
+++ b/pages/operation/operationedit.json
@@ -0,0 +1,4 @@
+{
+ "usingComponents": {},
+ "navigationBarTitleText": "修改作业申请"
+}
\ No newline at end of file
diff --git a/pages/operation/operationedit.wxml b/pages/operation/operationedit.wxml
new file mode 100644
index 0000000..c89e2a9
--- /dev/null
+++ b/pages/operation/operationedit.wxml
@@ -0,0 +1,189 @@
+
+
+ 错误提示
+
+
+ 作业详情
+
+
+
+ 当前状态
+
+ {{zyzt.jdmc}}-{{zyzt.zyzt}}
+ {{zyzt.zyzt}}
+
+
+
+ 审批意见
+
+ {{lastsuggestion}}
+
+
+
+ 开始时间
+
+
+
+
+ {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}}
+
+ {{jssj}}
+
+
+
+
+
+
+
+ 预计结束
+
+
+
+
+ {{dateTimeArray2[0][dateTime2[0]]}}-{{dateTimeArray2[1][dateTime2[1]]}}-{{dateTimeArray2[2][dateTime2[2]]}} {{dateTimeArray2[3][dateTime2[3]]}}:{{dateTimeArray2[4][dateTime2[4]]}}
+
+ {{jssj}}
+
+
+
+
+
+
+
+
+ 所在区域
+
+
+
+
+
+ {{zyqy__name}}
+
+
+
+
+
+
+ 作业地点
+
+
+
+
+
+
+
+ 属地部门
+
+
+
+
+
+ {{sdbm__partname}}
+
+
+
+
+
+
+ 作业人员
+
+
+
+ 请选择
+
+
+
+
+ {{zyry_names}}
+
+
+ 作业内容
+
+
+
+
+
+
+
+ 现场图片(如有)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 风险分析和安全措施
+
+
+
+
+
+
+
+ 手动选择审批人
+
+
+
+
+
+
+ 作业部门审批人
+
+
+
+ {{spr1Array[spr1index].text}}
+
+
+
+
+
+ 属地部门审批人
+
+
+
+ {{spr2Array[spr2index].text}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/operation/operationedit.wxss b/pages/operation/operationedit.wxss
new file mode 100644
index 0000000..ff29dfb
--- /dev/null
+++ b/pages/operation/operationedit.wxss
@@ -0,0 +1,5 @@
+/* pages/operation/operationadd.wxss */
+.weui-btn{
+ width:auto;
+ margin: 5px;
+}
\ No newline at end of file