|
@@ -8,6 +8,7 @@ Page({
|
|
|
data: {
|
|
|
images: [],
|
|
|
signs: [],
|
|
|
+ submitting:false,
|
|
|
worksheetinfo: {},
|
|
|
chargstations: [],
|
|
|
chargstationsindex: 0,
|
|
@@ -98,8 +99,8 @@ Page({
|
|
|
placeholder: '请选择时间',
|
|
|
startDateTime: '2020-01-01 00:00',
|
|
|
endDateTime: '2040-01-01 00:00',
|
|
|
- // pText: Util.formatTimePicker(new Date()) //'2022-04-30 00:00'
|
|
|
- pText: '0000-00-00 00:00' //'2022-04-30 00:00'
|
|
|
+ pText: Util.formatTimePicker(new Date()) //'2022-04-30 00:00'
|
|
|
+ //pText: '0000-00-00 00:00' //'2022-04-30 00:00'
|
|
|
},
|
|
|
finishdate: null,
|
|
|
finishtime: '00:00',
|
|
@@ -199,6 +200,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
bindMainLocationInput(e) {
|
|
|
+ console.log(e);
|
|
|
let mainLocation = e.detail.value;
|
|
|
let worksheetinfo = this.data.worksheetinfo;
|
|
|
worksheetinfo.mainLocation = mainLocation;
|
|
@@ -206,6 +208,12 @@ Page({
|
|
|
worksheetinfo
|
|
|
});
|
|
|
},
|
|
|
+ bindAccendantInput(e){
|
|
|
+ let accendant = e.detail.value;
|
|
|
+ this.setData({
|
|
|
+ "worksheetinfo.accendant":accendant
|
|
|
+ });
|
|
|
+ },
|
|
|
bindContentInput(e) {
|
|
|
let content = e.detail.value;
|
|
|
// let worksheetinfo = this.data.worksheetinfo;
|
|
@@ -219,6 +227,13 @@ Page({
|
|
|
worksheetinfo.operatorName = this.data.userNames.length>0?this.data.userNames[0]:"";
|
|
|
worksheetinfo.pams = this.data.accendantids;
|
|
|
console.info(this.data.accendantids)
|
|
|
+ console.log("783756349857235");
|
|
|
+
|
|
|
+ // 如果正在提交,则不执行重复操作
|
|
|
+ if (this.data.submitting) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// worksheetinfo.accendant = null;
|
|
|
// if (this.data.exceptdate ) {
|
|
|
// // if (this.data.exceptdate && this.data.excepttime) {
|
|
@@ -249,7 +264,15 @@ Page({
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(worksheetinfo.pams.length == 0){
|
|
|
+ // if(worksheetinfo.pams.length == 0){
|
|
|
+ // wx.showModal({
|
|
|
+ // showCancel: false,
|
|
|
+ // content: '运维人员不能为空,请填写!',
|
|
|
+ // confirmColor:'#00AADD',
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ if(worksheetinfo.accendant == '' || worksheetinfo.accendant == undefined){
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '运维人员不能为空,请填写!',
|
|
@@ -268,7 +291,7 @@ Page({
|
|
|
let signs = this.data.signs;
|
|
|
console.log(signs.length == 0);
|
|
|
|
|
|
-
|
|
|
+ let that = this
|
|
|
var signString = [];
|
|
|
if (signs.length == 0) {
|
|
|
//2021-1-1撤销校验
|
|
@@ -305,6 +328,12 @@ Page({
|
|
|
var uploadSignOverFlag = setInterval(function() {
|
|
|
if (signString.length == signs.length) {
|
|
|
clearInterval(uploadSignOverFlag);
|
|
|
+ // 设置提交状态为 true
|
|
|
+ that.setData({
|
|
|
+ submitting: true
|
|
|
+ });
|
|
|
+ console.log("1111");
|
|
|
+ console.log(that.data.submitting);
|
|
|
if (images.length == 0) {
|
|
|
if (worksheetinfo.pciture) {
|
|
|
console.log(worksheetinfo.pciture);
|
|
@@ -312,7 +341,9 @@ Page({
|
|
|
//worksheetinfo.pciture = ((worksheetinfo.pciture.split(",")).concat(signString)).join(",");
|
|
|
console.log(worksheetinfo.pciture);
|
|
|
}
|
|
|
-
|
|
|
+ wx.showLoading({
|
|
|
+ title: '提交中...',
|
|
|
+ })
|
|
|
wx.request({
|
|
|
url: getApp().globalData.postHeadAgreement + '/restapi/wechat/saveWorkSheet',
|
|
|
data: worksheetinfo,
|
|
@@ -327,6 +358,11 @@ Page({
|
|
|
});
|
|
|
} else {
|
|
|
wx.navigateBack();
|
|
|
+ wx.hideLoading()
|
|
|
+ //提交完成重置按钮
|
|
|
+ that.setData({
|
|
|
+ submitting: false
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -355,6 +391,7 @@ Page({
|
|
|
//worksheetinfo.pciture = ((worksheetinfo.pciture.split(",")).concat(signString)).join(",");
|
|
|
worksheetinfo.pciture = (pciString.concat(imgString).concat(signString)).join(",");
|
|
|
//var images = this.data.images.concat(res.tempFilePaths);
|
|
|
+ wx.showLoading({title: "提交中...."})
|
|
|
wx.request({
|
|
|
url: getApp().globalData.postHeadAgreement + '/restapi/wechat/saveWorkSheet',
|
|
|
data: worksheetinfo,
|
|
@@ -369,6 +406,11 @@ Page({
|
|
|
});
|
|
|
} else {
|
|
|
wx.navigateBack();
|
|
|
+ wx.hideLoading()
|
|
|
+ //提交完成重置按钮
|
|
|
+ that.setData({
|
|
|
+ submitting: false
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -384,7 +426,6 @@ Page({
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}, 100);
|
|
|
|
|
|
|
|
@@ -557,7 +598,6 @@ Page({
|
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
|
let isLogin = wx.getStorageSync('isLogin');
|
|
|
let that = this;
|
|
|
- //console.log(12345);
|
|
|
|
|
|
|
|
|
if (userInfo && isLogin) {
|
|
@@ -581,18 +621,20 @@ Page({
|
|
|
chargStationName = item.chargStationName
|
|
|
// chargStationId = item.id
|
|
|
});
|
|
|
+
|
|
|
let worksheetinfo = that.data.worksheetinfo;
|
|
|
worksheetinfo.chargStationId = chargStationId;
|
|
|
+ worksheetinfo.accendant = userInfo.userName
|
|
|
+ that.data.accendantids.push(userInfo.userId);//解决初始页面未给pams赋值
|
|
|
that.setData({
|
|
|
// chargStationName:that.data.chargStationNameNullValue,
|
|
|
- worksheetinfo
|
|
|
+ worksheetinfo,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
// wx.request({
|
|
|
// url: getApp().globalData.postHeadAgreement + '/restapi/wechat/getuserworksheet',
|
|
|
// data: worksheetinfo.id,
|