Authored by weiqingting

批量导出

@@ -487,32 +487,39 @@ $("#basedaochu").click(function(){ @@ -487,32 +487,39 @@ $("#basedaochu").click(function(){
487 selectedArr = g.selected, 487 selectedArr = g.selected,
488 len = selectedArr.length, 488 len = selectedArr.length,
489 data = g.options.parms(); 489 data = g.options.parms();
  490 + data.isAuditing=200;
490 491
491 var filter=$(".wqt_all").prop("checked"); 492 var filter=$(".wqt_all").prop("checked");
492 493
493 - $.each(data, function(key, value) {  
494 - if (value && value != '' && key != 'size' && key != 'tab') {  
495 - count++;  
496 - }  
497 - }); 494 + $.each(data, function(key, value) {
  495 + if (value && value != '' && key != 'size' && key != 'tab') {
  496 + count++;
  497 + }
  498 + });
498 499
499 if ((count > 0&&filter) || len > 0) { 500 if ((count > 0&&filter) || len > 0) {
500 var productSknList=[]; 501 var productSknList=[];
501 502
502 if (len > 0) { 503 if (len > 0) {
503 - data.productSknList = [];  
504 $.each(selectedArr, function(i, value) { 504 $.each(selectedArr, function(i, value) {
505 - data.productSknList.push(value['productSkn']); 505 + productSknList.push(value['productSkn']);
506 }); 506 });
507 } 507 }
508 - data.isAuditing=200;  
509 - var result={};  
510 - for(var name in data){  
511 - if(data.hasOwnProperty(name)&&data[name]){  
512 - result[name]=data[name]; 508 + var getResult=function(){
  509 + if(filter){
  510 +
  511 + var result={};
  512 + for(var name in data){
  513 + if(data.hasOwnProperty(name)&&data[name]){
  514 + result[name]=data[name];
  515 + }
  516 + }
  517 + return result
  518 + }else{
  519 + return{productSknList:productSknList,isAuditing:200};
513 } 520 }
514 } 521 }
515 - window.open("/ajax/down?queryConf=" + JSON.stringify(result) + "&type=baseProduce"); 522 + window.open("/ajax/down?queryConf=" + JSON.stringify(getResult()) + "&type=baseProduce");
516 }else{ 523 }else{
517 common.util.__tip('请选择导出商品的条件', 'warning'); 524 common.util.__tip('请选择导出商品的条件', 'warning');
518 return; 525 return;