Index: ssts-web/src/main/webapp/disinfectsystem/common/terminateInvoicePlan.js =================================================================== diff -u -r12331 -r13846 --- ssts-web/src/main/webapp/disinfectsystem/common/terminateInvoicePlan.js (.../terminateInvoicePlan.js) (revision 12331) +++ ssts-web/src/main/webapp/disinfectsystem/common/terminateInvoicePlan.js (.../terminateInvoicePlan.js) (revision 13846) @@ -1,24 +1,43 @@ function terminateInvoicePlan(grid) { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { - showResult("请选择需要结束的申请单"); + showResult("请选择需要终止的申请单"); return false; } - if (records.length > 1) { - showResult("一次只能结束一个申请单"); - return false; - } var record = records[0]; + var id = record.data['id']; - var endStatus = record.data['endStatus']; - if(endStatus == "已终止"){ - showResult("该申请单已终止!"); - return false; + var url = '/disinfectSystem/invoicePlanAction!terminateInvoicePlan.do'; + if (records.length > 1) { + /*showResult("一次只能终止一个申请单"); + return false;*/ + + id = ""; + for(var i = 0;i < records.length;i++){ + + var endStatus = records[i].data['endStatus']; + if(endStatus == "已终止"){ + showResult("单号为" + records[i].data['serialNumber'] + "的申请单已终止!"); + return false; + } + id += records[i].data['id']; + if(i < records.length-1){ + id += ","; + } + } + url = '/disinfectSystem/invoicePlanAction!terminateMultiInvoicePlans.do'; + }else{ + var endStatus = records[0].data['endStatus']; + if(endStatus == "已终止"){ + showResult("该申请单已终止!"); + return false; + } } + var endCase = openModalWindow(WWWROOT+"/disinfectsystem/recyclingApplication/selectEndCause.jsp?time="+new Date(), "选择回收员", "760", "400"); if(endCase != null && endCase !=undefined && endCase.length > 0){ Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/invoicePlanAction!terminateInvoicePlan.do', + url: WWWROOT + url, params: { recyclingAppId : id ,endCause:endCase}, success: function(response, options){ var result = JSON.parse(response.responseText); @@ -38,7 +57,8 @@ } }); }else{ - showResult("请选择终止申请单原因。"); + //在选择终止原因的页面已经有判断原因是否为空,所以本处不需要再提示. + //showResult("请选择终止申请单原因。"); return false; } } \ No newline at end of file