作业审批驳回
This commit is contained in:
parent
7133cf7a90
commit
196e82bc95
3
app.json
3
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",
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
|
@ -36,7 +36,7 @@
|
|||
共{{todototal}}条作业许可</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<block wx:for="{{todozylist}}" wx:key="unique">
|
||||
<navigator url="operationcheck?zyid={{item.zyid}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
||||
<view bindtap="toDo" data-item="{{item}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
||||
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
||||
<view class="weui-media-box__title">{{item.zylx__dickeyname}}
|
||||
</view>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<view class="weui-panel__ft weui-cell__ft_in-access">
|
||||
<view class="weui-media-box__title">{{item.zyzt.zyzt}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -136,7 +136,7 @@ Page({
|
|||
nst1.push(lst[i]['id'])
|
||||
}
|
||||
this.setData({
|
||||
zyryname: nst.join(','),
|
||||
zyry_names: nst.join(','),
|
||||
zyry: nst1
|
||||
})
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access" style="height: 4.3em">
|
||||
{{zyryname}}
|
||||
{{zyry_names}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">作业内容</view>
|
||||
|
@ -86,7 +86,6 @@
|
|||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" placeholder="请输入描述" style="height: 4.6em" bindinput="bindzynrInput" maxlength="-1" />
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -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();
|
||||
|
@ -312,6 +324,26 @@ 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
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>作业人员</view>
|
||||
<view class="weui-cell__ft">
|
||||
{{zyry}}
|
||||
{{zyry_names}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -93,7 +93,7 @@
|
|||
|
||||
<view class="weui-cells__title">风险分析和安全措施</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<block wx:for="{{fxcs}}" wx:key="unique" wx:for-item="item">
|
||||
<block wx:for="{{fxcs_}}" wx:key="unique" wx:for-item="item">
|
||||
<view class="weui-media-box">
|
||||
<view style='color:red'>{{item.fxfx}}</view>
|
||||
<view style='color:green'>{{item.aqcs}}</view>
|
||||
|
@ -102,6 +102,15 @@
|
|||
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="weui-cells__title" wx:if="{{zyzt.zyzt == '审批中'}}">审批意见</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" placeholder="请输入意见" style="height: 4.6em" bindinput="bindspyjInput" maxlength="-1" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title" wx:if="{{zyzt.zyzt == '待关闭'}}">关闭现场图片(如有)</view>
|
||||
<view class="weui-cells weui-cells_after-title" wx:if="{{zyzt.zyzt == '待关闭'}}">
|
||||
<view class="weui-cell">
|
||||
|
|
|
@ -58,12 +58,17 @@ Page({
|
|||
var prepage = pages[pages.length - 2];//上一页面指针
|
||||
var zydata = prepage.data
|
||||
//格式化信息
|
||||
|
||||
for (var i = 0; i < zydata.zyimg.length; 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{
|
||||
this.getZy(options.zyid);
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>作业人员</view>
|
||||
<view class="weui-cell__ft">
|
||||
{{zyry}}
|
||||
{{zyry_names}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -109,7 +109,7 @@
|
|||
|
||||
<view class="weui-cells__title">风险分析和安全措施</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<block wx:for="{{fxcs}}" wx:key="unique" wx:for-item="item">
|
||||
<block wx:for="{{fxcs_}}" wx:key="unique" wx:for-item="item">
|
||||
<view class="weui-media-box">
|
||||
<view style='color:red'>{{item.fxfx}}</view>
|
||||
<view style='color:green'>{{item.aqcs}}</view>
|
||||
|
@ -169,9 +169,11 @@
|
|||
<view class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>{{item.jdmc}}</view>
|
||||
|
||||
<view class="weui-media-box__desc">{{item.spr__name}} {{item.submittime}}</view>
|
||||
<view class="weui-media-box__desc" style="color:red" wx:if="{{item.checked == 3}}">{{item.suggestion}}</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft" wx:if="{{item.checked == 0}}" style="color:red">
|
||||
<view class="weui-cell__ft" wx:if="{{item.checked == 0}}" style="color:orange">
|
||||
待审批
|
||||
</view>
|
||||
<view class="weui-cell__ft" wx:if="{{item.checked == 1}}" style="color:green">
|
||||
|
@ -180,6 +182,9 @@
|
|||
<view class="weui-cell__ft" wx:if="{{item.checked == 2}}" style="color:green">
|
||||
通过并提交上级
|
||||
</view>
|
||||
<view class="weui-cell__ft" wx:if="{{item.checked == 3}}" style="color:red">
|
||||
未通过
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
|
|
@ -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<fxcslist.length;i++){
|
||||
if(zydata.fxcs.indexOf(fxcslist[i].id)!=-1){
|
||||
fxcslist[i].checked=true
|
||||
}else{
|
||||
fxcslist[i].checked=false
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
fxcslist: fxcslist,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
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({
|
||||
zyry_names: nst.join(','),
|
||||
zyry: nst1
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
changeDateTime1(e) {
|
||||
var dateTimeArray1 = this.data.dateTimeArray1
|
||||
var dateTime1 = this.data.dateTime1
|
||||
var time = dateTimeArray1[0][dateTime1[0]] + '-' + dateTimeArray1[1][dateTime1[1]] + '-' + dateTimeArray1[2][dateTime1[2]] + ' ' + dateTimeArray1[3][dateTime1[3]] + ':' + dateTimeArray1[4][dateTime1[4]]
|
||||
//console.log(time)
|
||||
this.data.kssj = time
|
||||
this.setData({
|
||||
dateTime1: e.detail.value,
|
||||
dateshow1:1
|
||||
});
|
||||
|
||||
},
|
||||
changeDateTimeColumn1(e) {
|
||||
var arr = this.data.dateTime1,
|
||||
dateArr = this.data.dateTimeArray1;
|
||||
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
|
||||
this.setData({
|
||||
dateTimeArray1: dateArr,
|
||||
dateTime1: arr
|
||||
});
|
||||
},
|
||||
changeDateTime2(e) {
|
||||
var dateTimeArray2 = this.data.dateTimeArray2
|
||||
var dateTime2 = this.data.dateTime2
|
||||
var time = dateTimeArray2[0][dateTime2[0]] + '-' + dateTimeArray2[1][dateTime2[1]] + '-' + dateTimeArray2[2][dateTime2[2]] + ' ' + dateTimeArray2[3][dateTime2[3]] + ':' + dateTimeArray2[4][dateTime2[4]]
|
||||
//console.log(time)
|
||||
this.data.jssj = time
|
||||
this.setData({
|
||||
dateTime2: e.detail.value,
|
||||
dateshow2: 1
|
||||
});
|
||||
|
||||
},
|
||||
changeDateTimeColumn2(e) {
|
||||
var arr = this.data.dateTime2,
|
||||
dateArr = this.data.dateTimeArray2;
|
||||
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
|
||||
this.setData({
|
||||
dateTimeArray2: dateArr,
|
||||
dateTime2: arr
|
||||
});
|
||||
},
|
||||
chooseImage: function () {
|
||||
var that = this
|
||||
wx.chooseImage({
|
||||
count: 9,
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
zyimg: that.data.zyimg.concat(res.tempFilePaths)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
previewImage: function (e) {
|
||||
var current = e.target.dataset.src
|
||||
wx.previewImage({
|
||||
current: current,
|
||||
urls: this.data.zyimg
|
||||
})
|
||||
},
|
||||
deleteImage: function (e) {
|
||||
var that = this;
|
||||
var zyimg = that.data.zyimg;
|
||||
var index = e.currentTarget.dataset.index; //获取当前长按图片下标
|
||||
wx.showModal({
|
||||
title: '系统提醒',
|
||||
content: '确定要删除此图片吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
zyimg.splice(index, 1);
|
||||
} else if (res.cancel) {
|
||||
return false;
|
||||
}
|
||||
that.setData({
|
||||
zyimg: zyimg
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getspr12array:function(){
|
||||
wx.request({
|
||||
url: getApp().globalData.serverUrl + 'api/operation?a=getspr12',
|
||||
header: {
|
||||
'content-type': 'application/json', //
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
},
|
||||
method: 'POST',
|
||||
data: {'sdbm':this.data.sdbm},
|
||||
success: res => {
|
||||
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({
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "修改作业申请"
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
<view class="page">
|
||||
<view class="page__bd">
|
||||
<view class="weui-toptips weui-toptips_warn" wx:if="{{showTopTips}}">错误提示</view>
|
||||
|
||||
|
||||
<view class="weui-cells__title">作业详情</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<navigator url="operationdetail?zyid={{zyid}}&fromwx=1" class="weui-cell weui-cell_access">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>当前状态</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft_in-access" style="color:green" wx:if="{{zyzt.zyzt=='审批中'}}">{{zyzt.jdmc}}-{{zyzt.zyzt}}</view>
|
||||
<view class="weui-cell__ft_in-access" style="color:green" wx:else>{{zyzt.zyzt}}</view>
|
||||
</navigator>
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>审批意见</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft">{{lastsuggestion}}</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">开始时间</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<picker mode="multiSelector" value="{{dateTime1}}" bindchange="changeDateTime1" bindcolumnchange="changeDateTimeColumn1" range="{{dateTimeArray1}}">
|
||||
<view class="weui-select" wx:if="{{dateshow1==1}}">
|
||||
{{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}}
|
||||
</view>
|
||||
<view class="weui-select" wx:elif="{{jssj}}">{{jssj}}</view>
|
||||
<view class="weui-select" wx:else>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">预计结束</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<picker mode="multiSelector" value="{{dateTime2}}" bindchange="changeDateTime2" bindcolumnchange="changeDateTimeColumn2" range="{{dateTimeArray2}}">
|
||||
<view class="weui-select" wx:if="{{dateshow2==1}}">
|
||||
{{dateTimeArray2[0][dateTime2[0]]}}-{{dateTimeArray2[1][dateTime2[1]]}}-{{dateTimeArray2[2][dateTime2[2]]}} {{dateTimeArray2[3][dateTime2[3]]}}:{{dateTimeArray2[4][dateTime2[4]]}}
|
||||
</view>
|
||||
<view class="weui-select" wx:elif="{{jssj}}">{{jssj}}</view>
|
||||
<view class="weui-select" wx:else>
|
||||
</view>
|
||||
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select" wx:if='{{mapright}}'>
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">所在区域</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell__bd">
|
||||
<navigator url="/pages/area/tree">
|
||||
<view class="weui-select">
|
||||
{{zyqy__name}}
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">作业地点</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<input class="weui-input" placeholder="请输入" bindinput="bindzyddInput" value="{{zydd}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">属地部门</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell__bd">
|
||||
<navigator url="/pages/parttree/index">
|
||||
<view class="weui-select">
|
||||
{{sdbm__partname}}
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">作业人员</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<navigator url="/pages/userSelect/userSelect">
|
||||
<view class="weui-select">请选择</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access" style="height: 4.3em">
|
||||
{{zyry_names}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">作业内容</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" placeholder="请输入描述" style="height: 4.6em" bindinput="bindzynrInput" maxlength="-1"
|
||||
value="{{zynr}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">现场图片(如有)</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view class="weui-uploader">
|
||||
<view class="weui-uploader__bd">
|
||||
<view class="weui-uploader__files">
|
||||
<block wx:for="{{zyimg}}" wx:for-item="image" wx:key="unique">
|
||||
<view class="weui-uploader__file">
|
||||
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" data-index="{{index}}" bindtap="previewImage" bindlongpress="deleteImage" data-index="{{index}}"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="weui-uploader__input-box">
|
||||
<view class="weui-uploader__input" bindtap="chooseImage"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">风险分析和安全措施</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<checkbox-group bindchange="checkboxChangefxcs" >
|
||||
<label class="weui-cell weui-check__label" wx:for="{{fxcslist}}" wx:key="value">
|
||||
<checkbox class="weui-check" value="{{item.id}}" checked="{{item.checked}}"/>
|
||||
<view class="weui-cell__hd weui-check__hd_in-checkbox">
|
||||
<icon class="weui-icon-checkbox_circle" type="circle" size="23" wx:if="{{!item.checked}}"></icon>
|
||||
<icon class="weui-icon-checkbox_success" type="success" size="23" wx:if="{{item.checked}}"></icon>
|
||||
</view>
|
||||
<view>
|
||||
<view style='color:red'>{{item.fxfx}}</view>
|
||||
<view style='color:green'>{{item.aqcs}}</view>
|
||||
<view class="weui-media-box__desc">{{item.cslx}}</view>
|
||||
</view>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<!-- <view class="weui-cells__title">审批人</view>
|
||||
<view class="weui-cell weui-cell_select">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view class="weui-label">审批人</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<navigator url="/pages/userSelect/userSelect">
|
||||
<view class="weui-select">请依次选择审批人</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_access" style="height: 4.3em">
|
||||
{{spryname}}
|
||||
</view> -->
|
||||
<view class="weui-cell weui-cell_switch">
|
||||
<view class="weui-cell__bd">手动选择审批人</view>
|
||||
<view class="weui-cell__ft">
|
||||
<switch bindchange="chosesprChange" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select" wx:if="{{chosespr}}">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view>作业部门审批人</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<picker bindchange="bindspr1change" value="{{spr1index}}" range="{{spr1Array}}" range-key="text">
|
||||
<view class="weui-select" style="color:blue;font-weight:bold">{{spr1Array[spr1index].text}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell weui-cell_select" wx:if="{{chosespr}}">
|
||||
<view class="weui-cell__hd weui-cell__hd_in-select-after">
|
||||
<view>属地部门审批人</view>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<picker bindchange="bindspr2change" value="{{spr2index}}" range="{{spr2Array}}" range-key="text">
|
||||
<view class="weui-select" style="color:blue;font-weight:bold">{{spr2Array[spr2index].text}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<button class="weui-btn" type="primary" bindtap="submit">分析完毕,发起作业</button>
|
||||
</view>
|
||||
</view>
|
|
@ -0,0 +1,5 @@
|
|||
/* pages/operation/operationadd.wxss */
|
||||
.weui-btn{
|
||||
width:auto;
|
||||
margin: 5px;
|
||||
}
|
Loading…
Reference in New Issue