lvhao 4 месяцев назад
Родитель
Сommit
0eb28b3538
1 измененных файлов с 19 добавлено и 11 удалено
  1. 19 11
      template/erp/whlabel_typejs.html

+ 19 - 11
template/erp/whlabel_typejs.html

@@ -375,17 +375,25 @@ $(".dccrtype").click(function() {
             f = f + $(this).attr("name") + "=" + $(this).val() + "&";
         });
         layx.load('loadId','导出中,请稍后',{shadable:0.6});
-        let url = "/whlabel/"+$("select[name=dccz]").find("option:selected").data("url")+"js?excel="+$("select[name=dccz]").find("option:selected").val()+"&"+f;
-        $("select[name=dccz] option:eq(0)").prop('selected','selected');
-        $.get(url,{},function(res){
-            layx.destroy('loadId');
-            if(res.code == 1){
-                importRukuData(res.data,res.title)
-            }else{
-                layx.alert('错误',res.msg,function(id,button){
-                },{dialogIcon:'error'});
-            }
-        },'json')
+
+        if($("select[name=dccz]").find("option:selected").data("url") == "excelcr"){
+            window.location.href = "/whlabel/"+$("select[name=dccz]").find("option:selected").data("url")+"?excel="+$("select[name=dccz]").find("option:selected").val()+"&"+f;
+	$("select[name=dccz] option:eq(0)").prop('selected','selected'); 
+
+        }else{
+            let url = "/whlabel/"+$("select[name=dccz]").find("option:selected").data("url")+"js?excel="+$("select[name=dccz]").find("option:selected").val()+"&"+f;
+            $("select[name=dccz] option:eq(0)").prop('selected','selected');
+            $.get(url,{},function(res){
+                layx.destroy('loadId');
+                if(res.code == 1){
+                    importRukuData(res.data,res.title)
+                }else{
+                    layx.alert('错误',res.msg,function(id,button){
+                    },{dialogIcon:'error'});
+                }
+            },'json')
+        }
+       
         
     });
     //导出入库数据