contingencyPrint.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>新增应急打印</title>
  6. <link href="/css/base.css" rel="stylesheet">
  7. <link href="/css/ims/ims.css" rel="stylesheet">
  8. <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
  9. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
  10. <link rel="stylesheet" type="text/css" href="/css/ims/jquery.datetimepicker.css"/>
  11. <link rel="stylesheet" type="text/css" href="/js/layui/css/layui.css"/>
  12. </head>
  13. <style>
  14. .file {
  15. position: relative;
  16. display: inline-block;
  17. background: #D0EEFF;
  18. border: 1px solid #99D3F5;
  19. border-radius: 4px;
  20. padding: 4px 12px;
  21. overflow: hidden;
  22. color: #1E88C7;
  23. text-decoration: none;
  24. text-indent: 0;
  25. line-height: 20px;
  26. }
  27. .file input {
  28. position: absolute;
  29. font-size: 100px;
  30. right: 0;
  31. top: 0;
  32. opacity: 0;
  33. }
  34. .file:hover {
  35. background: #AADFFD;
  36. border-color: #78C3F3;
  37. color: #004974;
  38. text-decoration: none;
  39. }
  40. </style>
  41. <body>
  42. <h3 class="sale-title" style="margin-top: 20px;margin-bottom: 20px;">新增应急打印</h3>
  43. <input type="hidden" name="oldOrderId" id="oldOrderId" value="0">
  44. <div class="sale-table">
  45. <form class="saveForm" name="taskInfo" method="post" enctype="multipart/form-data">
  46. <table width="100%">
  47. <tr>
  48. <th><em class="red">*</em>名称</th>
  49. <td><input type="text" placeholder="输入任务名称" name="taskName" value=""></td>
  50. </tr>
  51. <tr>
  52. <th><em class="red">*</em>年级</th>
  53. <td>
  54. <div class="diy_select">
  55. <input type="hidden" id="grade" name="grade" class="diy_select_input" value="0">
  56. <div class="diy_select_txt pm_name_txt">选择年级</div>
  57. <div class="diy_select_btn"></div>
  58. <ul class="diy_select_list pm_name" style="display: none;">
  59. <li val="0">选择年级</li>
  60. <?php
  61. if(Yii::app()->params['grade_config']){
  62. foreach (Yii::app()->params['grade_config'] as $val){
  63. echo '<li val="'.$val['id'].'" >'.$val['grade_name'].'</li>';
  64. }
  65. }
  66. ?>
  67. </ul>
  68. </div>
  69. </td>
  70. </tr>
  71. <tr>
  72. <th><em class="red">*</em>学科</th>
  73. <td>
  74. <div class="diy_select">
  75. <input type="hidden" id="subject" name="subject" class="diy_select_input" value="0">
  76. <div class="diy_select_txt pm_name_txt">选择学科</div>
  77. <div class="diy_select_btn"></div>
  78. <ul class="diy_select_list pm_name" style="display: none;">
  79. <li val="0">选择学科</li>
  80. <li val="3">数学</li>
  81. <li val="8">英语</li>
  82. <li val="9">语文</li>
  83. <li val="12">物理</li>
  84. <li val="13">化学</li>
  85. <li val="14">生物</li>
  86. <li val="15">政治</li>
  87. <li val="16">历史</li>
  88. <li val="17">地理</li>
  89. <li val="18">理综</li>
  90. <li val="19">文综</li>
  91. </ul>
  92. </div>
  93. </td>
  94. </tr>
  95. <tr>
  96. <th><em class="red">*</em>打印份数</th>
  97. <td>
  98. <input type="text" placeholder="输入数量" name="copies" value=""><span>份</span>
  99. </td>
  100. </tr>
  101. <tr>
  102. <th>单份页数</th>
  103. <td>
  104. <input type="text" placeholder="输入数量" name="eachCopies" value=""><span>页</span>
  105. </td>
  106. </tr>
  107. <tr>
  108. <th><em class="red">*</em>纸张类型</th>
  109. <td>
  110. <div class="diy_select">
  111. <input type="hidden" id="sheetType" name="sheetType" class="diy_select_input" value="-1">
  112. <div class="diy_select_txt pm_name_txt">选择类型</div>
  113. <div class="diy_select_btn"></div>
  114. <ul class="diy_select_list pm_name" style="display: none;">
  115. <li val="-1">选择类型</li>
  116. <li val="0">B5</li>
  117. <li val="1">A3</li>
  118. <li val="2">A4</li>
  119. <li val="3">8K</li>
  120. <li val="4">16K</li>
  121. </ul>
  122. </div>
  123. </td>
  124. </tr>
  125. <tr>
  126. <th><em class="red">*</em>上传文件</th>
  127. <td>
  128. <input type="file" name="file1">
  129. <p id="upload-tips" style="color: #BF2B2B">请上传不大于10M的文件,格式仅限rar或zip压缩文件</p>
  130. </td>
  131. </tr>
  132. </table>
  133. </form>
  134. </div>
  135. <div class="sale-submit" style="margin-top: 20px;">
  136. <button type="button" id="returnList" class="label-primary-s bth-s">取消</button>
  137. <button type="button" id="saveOrder" class="label-primary-s bth-s" onclick="saveOrder();">发送任务</button>
  138. </div>
  139. <script src="/js/productset/jquery.min.js"></script>
  140. <script src="/js/ims/layer/layer.js"></script>
  141. <script src="/js/ims/xsgl.js"></script>
  142. <script>
  143. function saveOrder(){
  144. if($(this).attr("active")){
  145. return false;
  146. }
  147. var title = $.trim($("input[name='taskName']").val());
  148. if(title.length === 0){
  149. layer.msg('任务名称不能为空');
  150. return false;
  151. }
  152. if($("input[name='grade']").val() == 0){
  153. layer.msg('请选择年级');
  154. return false;
  155. }
  156. if($("input[name='subject']").val() == 0){
  157. layer.msg('请选择学科');
  158. return false;
  159. }
  160. if($.trim($("input[name='copies']").val()) == ''){
  161. layer.msg('打印份数不能为空');
  162. return false;
  163. }
  164. if($.trim($("input[name='eachCopies']").val()) == ''){
  165. layer.msg('单份页数不能为空');
  166. return false;
  167. }
  168. if($("input[name='sheetType']").val() == -1){
  169. layer.msg('请选择纸张类型');
  170. return false;
  171. }
  172. var file=$("input[name='file1']");
  173. if($.trim(file.val())==''){
  174. layer.msg('请选择上传文件');
  175. return false;
  176. }
  177. var form = document.forms.namedItem("taskInfo");
  178. var formData = new FormData(form);
  179. $.ajax({
  180. url: "<?php echo Yii::app()->createUrl('imsSale/saveContingencyPrint')?>",
  181. type: "post",
  182. data: formData,
  183. contentType: false, //必须
  184. processData: false, //必须
  185. dataType: "json",
  186. beforeSend:function(){
  187. layer.load(1, {
  188. shade: [0.1,'#fff'] //0.1透明度的白色背景
  189. });
  190. },
  191. success: function (data) {
  192. var index = layer.load();
  193. layer.close(index);
  194. if (data.status == 1) {
  195. layer.msg('操作成功');
  196. window.location.href = "<?php echo Yii::app()->createUrl('imsSale/cloudPrintTask')?>";//成功跳转
  197. } else if (data.status == 0) {
  198. layer.msg(data.message);
  199. }
  200. }
  201. });
  202. }
  203. $('#returnList').click(function () {
  204. window.location.href = "<?php echo Yii::app()->createUrl('imsSale/cloudPrintTask')?>";//成功跳转
  205. });
  206. </script>
  207. </body>
  208. </html>