@@ -68,7 +68,6 @@ Page({ | |||||
if(r.data.length>0){ | if(r.data.length>0){ | ||||
that.setData({ | that.setData({ | ||||
bankTypeOptions:r.data, | bankTypeOptions:r.data, | ||||
'form.bankType':r.data[0].dictValue | |||||
}) | }) | ||||
} | } | ||||
} | } | ||||
@@ -164,16 +163,17 @@ Page({ | |||||
if(that.data.form.id==""||that.data.form.id==null){ | if(that.data.form.id==""||that.data.form.id==null){ | ||||
UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, { | UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: "提交成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('新增成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('新增失败'); | |||||
} | |||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
if (typeof fail === FUNCTION_TEXT) { | if (typeof fail === FUNCTION_TEXT) { | ||||
@@ -184,23 +184,23 @@ Page({ | |||||
this.setData({'status':0}) | this.setData({'status':0}) | ||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
this.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||
}else{ | }else{ | ||||
UTIL.httpRequest(API.URL_POST_DEPOSITUPDATE, that.data.form, { | UTIL.httpRequest(API.URL_POST_DEPOSITUPDATE, that.data.form, { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: "修改成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('修改成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('修改失败'); | |||||
} | |||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
if (typeof fail === FUNCTION_TEXT) { | if (typeof fail === FUNCTION_TEXT) { | ||||
@@ -211,7 +211,6 @@ Page({ | |||||
this.setData({'status':0}) | this.setData({'status':0}) | ||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
this.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||
@@ -27,6 +27,9 @@ Page({ | |||||
showBtn:true, | showBtn:true, | ||||
showStartTime:false, | showStartTime:false, | ||||
showEndTime:false, | showEndTime:false, | ||||
status:0, | |||||
orderTypeindex:0, | |||||
orderStatusindex:0 | |||||
}, | }, | ||||
/** | /** | ||||
@@ -144,12 +147,19 @@ Page({ | |||||
[even.currentTarget.dataset.name]:false | [even.currentTarget.dataset.name]:false | ||||
}) | }) | ||||
}, | }, | ||||
onConfirmOrderType(event) { | |||||
onConfirmorderType (e) { | |||||
let obj = e.detail.value; | |||||
this.setData({ | this.setData({ | ||||
[event.currentTarget.dataset.name]: false, | |||||
[event.currentTarget.dataset.value]: event.detail.value.dictValue, | |||||
[event.currentTarget.dataset.value+'Text']: event.detail.value.dictLabel, | |||||
}); | |||||
'form.orderType':this.data.orderTypeOptions[obj].dictValue, | |||||
'orderTypeindex':obj | |||||
}) | |||||
}, | |||||
onConfirmorderStatus (e) { | |||||
let obj = e.detail.value; | |||||
this.setData({ | |||||
'form.orderStatus':this.data.orderStatusOptions[obj].dictValue, | |||||
'orderStatusindex':obj | |||||
}) | |||||
}, | }, | ||||
goSubmit(){ | goSubmit(){ | ||||
if(this.data.form.orderNum===''||this.data.form.orderNum==null){ //汇票号码 | if(this.data.form.orderNum===''||this.data.form.orderNum==null){ //汇票号码 | ||||
@@ -179,37 +189,40 @@ Page({ | |||||
}else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | }else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | ||||
UTIL.showToastNoneIcon('汇票状态不能为空!'); | UTIL.showToastNoneIcon('汇票状态不能为空!'); | ||||
return false; | return false; | ||||
}else{ | |||||
}else if(this.data.status=='0'){ | |||||
this.setData({'status':'1'}) | |||||
var that = this; | var that = this; | ||||
that.data.form.method = 'POST'; | that.data.form.method = 'POST'; | ||||
if(that.data.form.id==""||that.data.form.id==null){ | if(that.data.form.id==""||that.data.form.id==null){ | ||||
UTIL.httpRequest(API.URL_POST_MONEYORDERADD, that.data.form , { | UTIL.httpRequest(API.URL_POST_MONEYORDERADD, that.data.form , { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: '新增成功', | |||||
icon: 'success', | |||||
duration: 2000, | |||||
complete(){ | |||||
setTimeout(function(){ | |||||
that.back(); | |||||
},2000) | |||||
} | |||||
}) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('新增成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('新增失败'); | |||||
} | |||||
} | } | ||||
}) | }) | ||||
}else{ | }else{ | ||||
UTIL.httpRequest(API.URL_POST_MONEYORDERUPDATE, that.data.form , { | UTIL.httpRequest(API.URL_POST_MONEYORDERUPDATE, that.data.form , { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: '修改成功', | |||||
icon: 'success', | |||||
duration: 2000, | |||||
complete(){ | |||||
setTimeout(function(){ | |||||
that.back(); | |||||
},2000) | |||||
} | |||||
}) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('修改成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('修改失败'); | |||||
} | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
@@ -211,6 +211,7 @@ Page({ | |||||
data.method = "POST"; | data.method = "POST"; | ||||
UTIL.httpRequest(API.URL_POST_PERMANENTUPDATE,data,{ | UTIL.httpRequest(API.URL_POST_PERMANENTUPDATE,data,{ | ||||
success: (res) => { | success: (res) => { | ||||
this.setData({'status':'0'}) | |||||
if(res.code == 200){ | if(res.code == 200){ | ||||
UTIL.showToastNoneIcon('修改成功'); | UTIL.showToastNoneIcon('修改成功'); | ||||
setTimeout(function(){ | setTimeout(function(){ | ||||
@@ -220,7 +221,6 @@ Page({ | |||||
},2000) | },2000) | ||||
}else{ | }else{ | ||||
UTIL.showToastNoneIcon('修改失败'); | UTIL.showToastNoneIcon('修改失败'); | ||||
that.setData({'status':'0'}) | |||||
} | } | ||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
@@ -232,7 +232,6 @@ Page({ | |||||
that.setData({'status':0}) | that.setData({'status':0}) | ||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
that.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||
@@ -241,6 +240,7 @@ Page({ | |||||
data.method = "POST"; | data.method = "POST"; | ||||
UTIL.httpRequest(API.URL_POST_PERMANENTADD,data,{ | UTIL.httpRequest(API.URL_POST_PERMANENTADD,data,{ | ||||
success: (res) => { | success: (res) => { | ||||
that.setData({'status':'0'}) | |||||
if(res.code == 200){ | if(res.code == 200){ | ||||
UTIL.showToastNoneIcon(res.msg); | UTIL.showToastNoneIcon(res.msg); | ||||
setTimeout(function(){ | setTimeout(function(){ | ||||
@@ -250,7 +250,6 @@ Page({ | |||||
},2000) | },2000) | ||||
}else{ | }else{ | ||||
UTIL.showToastNoneIcon(res.msg); | UTIL.showToastNoneIcon(res.msg); | ||||
that.setData({'status':'0'}) | |||||
} | } | ||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
@@ -262,7 +261,6 @@ Page({ | |||||
that.setData({'status':0}) | that.setData({'status':0}) | ||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
that.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||
@@ -145,16 +145,17 @@ Page({ | |||||
if(that.data.form.id==""||that.data.form.id==null){ | if(that.data.form.id==""||that.data.form.id==null){ | ||||
UTIL.httpRequest(API.URL_GET_PROJECTADD, data, { | UTIL.httpRequest(API.URL_GET_PROJECTADD, data, { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: "新增成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('新增成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('新增失败'); | |||||
} | |||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
if (typeof fail === FUNCTION_TEXT) { | if (typeof fail === FUNCTION_TEXT) { | ||||
@@ -162,26 +163,26 @@ Page({ | |||||
} else { | } else { | ||||
showToastNoneIcon(API.MSG_FAIL_HTTP); | showToastNoneIcon(API.MSG_FAIL_HTTP); | ||||
} | } | ||||
this.setData({'status':0}) | |||||
that.setData({'status':0}) | |||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
this.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||
}else{ | }else{ | ||||
UTIL.httpRequest(API.URL_POST_PROJECTUPDATE, data, { | UTIL.httpRequest(API.URL_POST_PROJECTUPDATE, data, { | ||||
success: (res) => { | success: (res) => { | ||||
wx.showToast({ | |||||
title: "修改成功!", | |||||
duration: 2000, | |||||
icon:"success" | |||||
}) | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
this.setData({'status':0}) | |||||
if(res.code == 200){ | |||||
UTIL.showToastNoneIcon('修改成功'); | |||||
setTimeout(function(){ | |||||
wx.navigateBack({ | |||||
delta:1 | |||||
}) | |||||
},2000) | |||||
}else{ | |||||
UTIL.showToastNoneIcon('修改失败'); | |||||
} | |||||
}, | }, | ||||
fail: function (response) { | fail: function (response) { | ||||
if (typeof fail === FUNCTION_TEXT) { | if (typeof fail === FUNCTION_TEXT) { | ||||
@@ -192,7 +193,6 @@ Page({ | |||||
this.setData({'status':0}) | this.setData({'status':0}) | ||||
}, | }, | ||||
complete: function (response) { | complete: function (response) { | ||||
this.setData({'status':0}) | |||||
wx.hideNavigationBarLoading(); | wx.hideNavigationBarLoading(); | ||||
} | } | ||||
}) | }) | ||||