Commit 3506ce7d by 高宇强

gyq

parent 345ec605
......@@ -193,13 +193,37 @@ class SchemeCtl extends CtlBase {
/*根据商机编号更新方案详情*/
async updateInfoByDemandCode(pobj, qobj, req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.planInfo && pobj.planInfo != 'undefined'){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.schemeNumber && schemeNumber != 'undefined'
&& pobj.planInfo && pobj.planInfo != 'undefined'){
try{
pobj.currentStatus = "beforeConfirmation";//同时把方案的状态也更新为待确认
var retn = await this.service.updateInfoByDemandCode(pobj);//更新方案详情
var bobj = {"businessMode":pobj.businessMode,"currentStatus":"beforeConfirmation"};//同时把商机状态更新回待确认
await this.bizoptService.updateStatusByDemandCode(bobj);
return system.getResult("更新成功!");
//修改方案的时候,需要把修改的方案传给商城
var mobj = pobj;
mobj.businessType = appconfig.pdict.fdyDict[pobj.businessType];
var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl;
var params = {
"actionType":"submitSolution",
"actionBody":{
"needNum": pobj.businessMode,
"solutionNum":pobj.schemeNumber,
"solutionContent": mobj
}
}
var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
if (j.status == 1){
var retn = await this.service.updateInfoByDemandCode(pobj);//更新方案详情
var bobj = {"businessMode":pobj.businessMode,"currentStatus":"beforeConfirmation"};//同时把商机状态更新回待确认
await this.bizoptService.updateStatusByDemandCode(bobj);
return system.getResult("更新成功!");
}
else{
return system.getResultError("更新方案出错!");
}
}
catch(error){
return system.getResultError(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment