whlabel_error.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="fixed">
  5. <ul class="search">
  6. <li>SKU:<input value="" name="sku" type="text" ></li>
  7. <li>仓库:<select name="warehouse" class="select">
  8. <option value="">请选择</option>{loop warehouse(10) as $val}
  9. <option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
  10. <li><span>确 定</span></li>
  11. </ul>
  12. <div class="control">
  13. <a href="javascript:void(0);" class="check">删 除</a>
  14. <a href="javascript:void(0);" class="whlabelerror">导出零库存汇总</a>
  15. <a href="javascript:void(0);" class="whlabeldr0kc">导入删除0库存</a>(非删除的表中不要存在)
  16. </div>
  17. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  18. <tr>
  19. <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
  20. <td>仓库</td>
  21. <td>SKU</td>
  22. <td>产品名称</td>
  23. <td>当前库存</td>
  24. </tr>
  25. </table>
  26. </div>
  27. <table class="datatext data" border="0" style="border-collapse:collapse;">
  28. </table>
  29. <div class="bomf"></div>
  30. </div>
  31. <script>
  32. var dataurl = "/whlabel/error";
  33. var customon = 1;
  34. function custom(){
  35. $(".data tr").each(function() {
  36. $(this).find('td:eq(3)').css("width","25%");
  37. });}
  38. $(".whlabelerror").click(function() {
  39. var f = "";
  40. $(".select").each(function() {
  41. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  42. });
  43. $("input:text").each(function() {
  44. f = f + $(this).attr("name") + "=" + encodeURIComponent($(this).val()) + "&";
  45. });
  46. $("input:hidden").each(function() {
  47. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  48. });
  49. window.location.href = "/whlabel/errorexcel?excel=1&"+f;
  50. });
  51. $(".whlabeldr0kc").click(function() {
  52. var dr = $(this);
  53. $("#upload-file").click();
  54. $("#upload-file").unbind("change");
  55. $("#upload-file").bind("change",function(){
  56. whlabeldr0kc(dr);
  57. layx.load('loadId','导入中,请稍后',{shadable:0.6});
  58. });
  59. });
  60. function whlabeldr0kc(dr){
  61. var file = document.getElementById("upload-file").files[0];
  62. var data = new FormData();
  63. data.append("userfile",file);
  64. $.ajax({
  65. data : data,
  66. type : "POST",
  67. url : "/whlabel/0kcdel/",
  68. cache : false,
  69. contentType : false,
  70. processData : false,
  71. dataType:"json",
  72. success: function(a) {
  73. layx.destroy('loadId');
  74. if (a && a.success) {
  75. if(a.error == 1)
  76. {
  77. errora(a);
  78. }
  79. else
  80. {
  81. errorb(a);
  82. }
  83. } else {
  84. errorc(a);
  85. }
  86. }
  87. });
  88. }
  89. </script>
  90. <script type="text/javascript" src="{$theme}js/time.js"></script>
  91. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  92. <div style="display:none;">
  93. <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
  94. </div>
  95. {Template footer}