lvhao 2 months ago
parent
commit
e9c291c571
1 changed files with 34 additions and 0 deletions
  1. 34 0
      template/erp/systemfout.html

+ 34 - 0
template/erp/systemfout.html

@@ -70,6 +70,7 @@
 </div>
 <input name="hidden" value="" id="hidden" type="hidden">
 <a href="javascript:void(0);" class="excel">导出Excel</a>
+<a href="javascript:void(0);" class="exceltwo">导出Excel</a>
 <a href="javascript:void(0);" class="cpexcel">导出产品详情</a>
 </div>
 <table class="datatitle data" border="0" style="border-collapse:collapse;">
@@ -147,6 +148,39 @@ window.parent.parent.com();
 window.onload = function() { 
 if(typeof $("select[name='printer']").length < 1) return;
 setTimeout(function(){ wprinter.printer()},1000);}; 
+
+
+$(".exceltwo").click(function() {
+    var f = "";
+    $(".select").each(function() {
+        f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
+    });
+    $("input:text").each(function() {
+		var text = $(this).val().replace(/&/g,"%26");
+	    text = text.replace(/#/g,"%23");
+	    text = text.replace(/\+/g,"%2B");
+        f = f + $(this).attr("name") + "=" + text + "&";
+    });
+    $("input:hidden").each(function() {
+        f = f + $(this).attr("name") + "=" + $(this).val() + "&";
+    });
+    var t = "";
+    var i = 0;
+    $(".datatitle td").each(function() {
+        if (i > 0) {
+            t = t + "<td>" + $(this).text() + "</td>";
+        }
+        i++;
+    });
+    var a = "";
+    $(".datatext input[name='check']:checked").each(function() {
+        a = a + $(this).val() + ",";
+    });
+    f = f + "excel=1&a=" + a + "&t=" + t;
+    window.location.href = "/systemfoutfz/exceltwo?fexcel=" + $("select[name=fexcel]").find("option:selected").val() + "&" + f;
+    $("select[name=fexcel] option:eq(0)").prop('selected', 'selected');
+});
+
 </script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 <script type="text/javascript" src="{$theme}js/print.js?v=202406260002"></script>