@@ -21,7 +21,7 @@ Page({ | |||
status:0, | |||
id:"", | |||
bankTypeOptions:[], | |||
bankTypeindex:'' | |||
bankTypeindex:0 | |||
}, | |||
back:function(){ | |||
wx.navigateBack({ | |||
@@ -164,16 +164,18 @@ Page({ | |||
if(that.data.form.id==""||that.data.form.id==null){ | |||
UTIL.httpRequest(API.URL_GET_DEPOSITADD, that.data.form, { | |||
success: (res) => { | |||
wx.showToast({ | |||
title: "提交成功!", | |||
duration: 2000, | |||
icon:"success" | |||
}) | |||
setTimeout(function(){ | |||
wx.navigateBack({ | |||
delta:1 | |||
}) | |||
},2000) | |||
console.log(res); | |||
that.setData({'status':0}) | |||
if(res.code == 200){ | |||
UTIL.showToastNoneIcon('新增成功'); | |||
setTimeout(function(){ | |||
wx.navigateBack({ | |||
delta:1 | |||
}) | |||
},2000) | |||
}else{ | |||
UTIL.showToastNoneIcon('新增失败:'+res.msg); | |||
} | |||
}, | |||
fail: function (response) { | |||
if (typeof fail === FUNCTION_TEXT) { | |||
@@ -184,23 +186,23 @@ Page({ | |||
this.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
}else{ | |||
UTIL.httpRequest(API.URL_POST_DEPOSITUPDATE, that.data.form, { | |||
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) { | |||
if (typeof fail === FUNCTION_TEXT) { | |||
@@ -211,7 +213,6 @@ Page({ | |||
this.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
@@ -27,6 +27,9 @@ Page({ | |||
showBtn:true, | |||
showStartTime:false, | |||
showEndTime:false, | |||
status:0, | |||
orderTypeindex:0, | |||
orderStatusindex:0 | |||
}, | |||
/** | |||
@@ -113,7 +116,8 @@ Page({ | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'order_type', {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({ | |||
orderTypeOptions:res.data | |||
orderTypeOptions:res.data, | |||
'form.orderType':res.data[0].dictValue | |||
}); | |||
} | |||
}) | |||
@@ -121,7 +125,8 @@ Page({ | |||
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'order_status', {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({ | |||
orderStatusOptions:res.data | |||
orderStatusOptions:res.data, | |||
'form.orderStatus':res.data[0].dictValue | |||
}); | |||
} | |||
}) | |||
@@ -144,12 +149,19 @@ Page({ | |||
[even.currentTarget.dataset.name]:false | |||
}) | |||
}, | |||
onConfirmOrderType(event) { | |||
onConfirmorderType (e) { | |||
let obj = e.detail.value; | |||
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(){ | |||
if(this.data.form.orderNum===''||this.data.form.orderNum==null){ //汇票号码 | |||
@@ -161,8 +173,8 @@ Page({ | |||
}else if(this.data.form.orderAmount===''||this.data.form.orderAmount==null){ //出票金额 | |||
UTIL.showToastNoneIcon('请输入出票金额!'); | |||
return false; | |||
}else if(this.data.form.billPayUnit===''||this.data.form.billPayUnit==null){ //付飘单位 | |||
UTIL.showToastNoneIcon('请输入付飘单位!'); | |||
}else if(this.data.form.billPayUnit===''||this.data.form.billPayUnit==null){ //付票单位 | |||
UTIL.showToastNoneIcon('请输入付票单位!'); | |||
return false; | |||
}else if(this.data.form.billReceiveUnit === ''||this.data.form.billReceiveUnit==null){//收票单位 | |||
UTIL.showToastNoneIcon('请输入收票单位!'); | |||
@@ -174,42 +186,45 @@ Page({ | |||
UTIL.showToastNoneIcon('请输入到期日期!'); | |||
return false; | |||
}else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | |||
UTIL.showToastNoneIcon('汇票状态不能为空!'); | |||
UTIL.showToastNoneIcon('联行号不能为空!'); | |||
return false; | |||
}else if(this.data.form.orderStatus === ''||this.data.form.orderStatus==null){//联行号 | |||
UTIL.showToastNoneIcon('汇票状态不能为空!'); | |||
UTIL.showToastNoneIcon('联行号不能为空!'); | |||
return false; | |||
}else{ | |||
}else if(this.data.status=='0'){ | |||
this.setData({'status':'1'}) | |||
var that = this; | |||
that.data.form.method = 'POST'; | |||
if(that.data.form.id==""||that.data.form.id==null){ | |||
UTIL.httpRequest(API.URL_POST_MONEYORDERADD, that.data.form , { | |||
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{ | |||
UTIL.httpRequest(API.URL_POST_MONEYORDERUPDATE, that.data.form , { | |||
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('修改失败'); | |||
} | |||
} | |||
}) | |||
} | |||
@@ -163,10 +163,10 @@ Page({ | |||
UTIL.showToastNoneIcon('请输入合同名称!'); | |||
return false; | |||
}else if(this.data.form.firstParty===''||this.data.form.firstParty==null){ //甲方 | |||
UTIL.showToastNoneIcon('请输入单据编码!'); | |||
UTIL.showToastNoneIcon('请输入甲方名称!'); | |||
return false; | |||
}else if(this.data.form.secondParty===''||this.data.form.secondParty==null){ //乙方 | |||
UTIL.showToastNoneIcon('请输入备注说明!'); | |||
UTIL.showToastNoneIcon('请输入乙方名称!'); | |||
return false; | |||
}else if(this.data.form.collectionPay === ''||this.data.form.collectionPay==null){//收付款类型 | |||
UTIL.showToastNoneIcon('收付款类型不能为空!'); | |||
@@ -178,7 +178,7 @@ Page({ | |||
UTIL.showToastNoneIcon('合同金额不能为空!'); | |||
return false; | |||
}else if(this.data.form.buildingTime === ''||this.data.form.buildingTime==null){//签订日期 | |||
UTIL.showToastNoneIcon('合同金额不能为空!'); | |||
UTIL.showToastNoneIcon('签订日期不能为空!'); | |||
return false; | |||
}else if(this.data.form.startTime === ''||this.data.form.startTime==null){//开始日期 | |||
UTIL.showToastNoneIcon('开始日期不能为空!'); | |||
@@ -193,7 +193,7 @@ Page({ | |||
UTIL.showToastNoneIcon('已结款不能为空!'); | |||
return false; | |||
}else if(this.data.form.contractionStatus === ''||this.data.form.contractionStatus==null){//合同状态 | |||
UTIL.showToastNoneIcon('单价不能为空!'); | |||
UTIL.showToastNoneIcon('合同状态不能为空!'); | |||
return false; | |||
}else if(this.data.status=='0'){ | |||
this.setData({'status':1}) | |||
@@ -202,6 +202,7 @@ Page({ | |||
data.method = "POST"; | |||
UTIL.httpRequest(API.URL_POST_CONTRACTUPDATE,data,{ | |||
success: (res) => { | |||
this.setData({'status':0}) | |||
if(res.code == 200){ | |||
UTIL.showToastNoneIcon('修改成功'); | |||
setTimeout(function(){ | |||
@@ -222,7 +223,6 @@ Page({ | |||
this.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
@@ -231,6 +231,7 @@ Page({ | |||
data.method = "POST"; | |||
UTIL.httpRequest(API.URL_POST_CONTRACTADD,data,{ | |||
success: (res) => { | |||
this.setData({'status':0}) | |||
if(res.code == 200){ | |||
UTIL.showToastNoneIcon('新增成功'); | |||
setTimeout(function(){ | |||
@@ -248,10 +249,8 @@ Page({ | |||
} else { | |||
showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
} | |||
this.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
@@ -273,7 +272,6 @@ Page({ | |||
UTIL.httpRequest(API.URL_GET_CONTRACTDETAIL + this.data.id, {method:'GET'}, { | |||
success: (res) => { | |||
this.setData({'form':res.data}); | |||
log | |||
res.data.biddingDate = res.data.biddingDate.slice(0,9) | |||
res.data.reviewTime = res.data.reviewTime.slice(0,9) | |||
let that = this; | |||
@@ -211,6 +211,7 @@ Page({ | |||
data.method = "POST"; | |||
UTIL.httpRequest(API.URL_POST_PERMANENTUPDATE,data,{ | |||
success: (res) => { | |||
this.setData({'status':'0'}) | |||
if(res.code == 200){ | |||
UTIL.showToastNoneIcon('修改成功'); | |||
setTimeout(function(){ | |||
@@ -220,7 +221,6 @@ Page({ | |||
},2000) | |||
}else{ | |||
UTIL.showToastNoneIcon('修改失败'); | |||
that.setData({'status':'0'}) | |||
} | |||
}, | |||
fail: function (response) { | |||
@@ -232,7 +232,6 @@ Page({ | |||
that.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
that.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
@@ -241,6 +240,7 @@ Page({ | |||
data.method = "POST"; | |||
UTIL.httpRequest(API.URL_POST_PERMANENTADD,data,{ | |||
success: (res) => { | |||
that.setData({'status':'0'}) | |||
if(res.code == 200){ | |||
UTIL.showToastNoneIcon(res.msg); | |||
setTimeout(function(){ | |||
@@ -250,7 +250,6 @@ Page({ | |||
},2000) | |||
}else{ | |||
UTIL.showToastNoneIcon(res.msg); | |||
that.setData({'status':'0'}) | |||
} | |||
}, | |||
fail: function (response) { | |||
@@ -262,7 +261,6 @@ Page({ | |||
that.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
that.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
@@ -132,7 +132,7 @@ Page({ | |||
UTIL.showToastNoneIcon('请输入竣工日期!'); | |||
return false; | |||
}else if(this.data.form.projectAmount === ''||this.data.form.projectAmount==null){//合共价款 | |||
UTIL.showToastNoneIcon('请输入收票单位!'); | |||
UTIL.showToastNoneIcon('请输入合共价款!'); | |||
return false; | |||
}else if(this.data.form.ynProjcetStatus === ''||this.data.form.ynProjcetStatus==null){//工程状态 | |||
UTIL.showToastNoneIcon('工程状态不能为空!'); | |||
@@ -145,16 +145,17 @@ Page({ | |||
if(that.data.form.id==""||that.data.form.id==null){ | |||
UTIL.httpRequest(API.URL_GET_PROJECTADD, data, { | |||
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) { | |||
if (typeof fail === FUNCTION_TEXT) { | |||
@@ -162,26 +163,26 @@ Page({ | |||
} else { | |||
showToastNoneIcon(API.MSG_FAIL_HTTP); | |||
} | |||
this.setData({'status':0}) | |||
that.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||
}else{ | |||
UTIL.httpRequest(API.URL_POST_PROJECTUPDATE, data, { | |||
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) { | |||
if (typeof fail === FUNCTION_TEXT) { | |||
@@ -192,7 +193,6 @@ Page({ | |||
this.setData({'status':0}) | |||
}, | |||
complete: function (response) { | |||
this.setData({'status':0}) | |||
wx.hideNavigationBarLoading(); | |||
} | |||
}) | |||