machining.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="fixed">
  5. <ul class="search">
  6. <li>名称:<input value="" name="title" type="text" ></li>
  7. <li>蕾丝颜色:<input value="" name="color" type="text" ></li>
  8. <li>类型:<select name="type" class="select"></li>
  9. <option value="">半成品+成品</option>
  10. <option value="1">半成品</option>
  11. <option value="2">成品</option>
  12. </select></li>
  13. <span>确 定</span>
  14. </ul>
  15. <div class="control">
  16. <a href="javascript:void(0);" class="window" data-h="/machining/add/" data-t="添加信息">添 加</a>
  17. <a href="javascript:void(0);" class="check">删 除</a>
  18. <a href="javascript:void(0);" id="excel">导入产品</a>
  19. <a href="/machining/down?excel=1" id="excel">导入模板</a>
  20. </div>
  21. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  22. <tr>
  23. <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
  24. <td>类型</td>
  25. <td>数量</td>
  26. <td>名称</td>
  27. <td>蕾丝颜色</td>
  28. </tr>
  29. </table>
  30. </div>
  31. <table class="datatext data" border="0" style="border-collapse:collapse;">
  32. </table>
  33. <div class="bomf"></div>
  34. <script>
  35. var dataurl = "/machining";
  36. var editurl = "/machining/edit/";
  37. var editdj = 3;
  38. var editt = "修 改";
  39. var customon = 1;
  40. function custom(){
  41. $(".data tr").each(function() {
  42. $(this).find('td:eq(0)').css("width","1%");
  43. $(this).find('td:eq(1)').css("width","7%");
  44. $(this).find('td:eq(2)').css("width","7%");
  45. $(this).find('td:eq(3)').css("width","65%");
  46. $(this).find('td:eq(4)').css("width","20%");
  47. });}
  48. $(document).ready(function() {
  49. var button = $("#excel"), interval;
  50. var fileType = "pic", fileNum = "one";
  51. new AjaxUpload(button, {
  52. action: dataurl+"/excel",
  53. name: "userfile",
  54. onSubmit: function(file, ext) {
  55. if (fileType == "pic") {
  56. if (ext && /^(xls|xlsx)$/.test(ext)) {
  57. this.setData({
  58. info: "文件类型为xls"
  59. });
  60. } else {
  61. $(".ts p").html("上传的文件类型不正确");
  62. $(".ts").fadeIn();
  63. setTimeout('$(".ts").fadeOut()', 700);
  64. return false;
  65. }
  66. }
  67. $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在处理中,请稍后...");
  68. $(".express p:eq(1)").html("");
  69. $(".express").show();
  70. if (fileNum == "one") {
  71. this.disable();
  72. }
  73. },
  74. onComplete: function(file, response) {
  75. eval("var obj=" + response);
  76. if (obj.success) {
  77. $(".express").hide();
  78. $(".express p:eq(0)").html("<i class='fa fa-2x fa-check-square-o'></i> &nbsp; "+obj.msg);
  79. $(".express p:eq(1)").html("<font class='sx'>确 定</font><font class='sx'>取 消</font>");
  80. $(".express").show();
  81. } else {
  82. $(".express").hide();
  83. $(".ts p").html(obj.msg);
  84. $(".ts").fadeIn();
  85. setTimeout('$(".ts").fadeOut()', 700);
  86. return false;
  87. }
  88. window.clearInterval(interval);
  89. this.enable();
  90. }
  91. });
  92. });
  93. </script>
  94. <script src="{$theme}js/ajaxupload.3.5.js"></script>
  95. {Template footer}