cloudPrintTask.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>云印任务</title>
  7. <meta name="description" content="">
  8. <meta name="keywords" content="">
  9. <link href="/css/ims/base.css" rel="stylesheet">
  10. <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
  11. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
  12. <link rel="stylesheet" type="text/css" href="/css/ims/cloudPrintTask.css"/>
  13. <style>
  14. input {
  15. height: 30px;
  16. border-radius: 4px;
  17. border: 1px solid #ccc;
  18. box-shadow: none;
  19. text-indent: 10px;
  20. margin-right: 5px;
  21. float:left;
  22. }
  23. .red {
  24. color: red;
  25. }
  26. .yellow {
  27. color: #FF9900;
  28. }
  29. .ims-box {
  30. margin: 20px;
  31. }
  32. .screen > div {
  33. margin-right: 5px;
  34. }
  35. .screen button {
  36. padding: 4px 12px;
  37. }
  38. .table-box {
  39. margin-top: 30px;
  40. }
  41. .table-box table,
  42. .table-box table th {
  43. text-align: center;
  44. }
  45. .table-box button {
  46. margin-right: 5px;
  47. }
  48. .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
  49. line-height: 140px;
  50. text-align: center;
  51. }
  52. .resubmit-layer-box input {
  53. line-height: 20px;
  54. }
  55. .urge-layer-box {
  56. margin-top: 30px;
  57. margin-left: 30px;
  58. }
  59. .urge-layer-box textarea {
  60. margin-left: 15px;
  61. vertical-align: top;
  62. }
  63. .alert-msg {
  64. text-align: center;
  65. vertical-align: top;
  66. }
  67. </style>
  68. </head>
  69. <body>
  70. <div class="ims-box">
  71. <form action="<?php echo Yii::app()->createUrl('imsSale/cloudPrintTask'); ?>" method="get">
  72. <?php require dirname(dirname(dirname(__FILE__))).'/components/CloudPrintTask.php';
  73. ?>
  74. <div class="screen">
  75. <div class="diy_select select-goods">
  76. <input type="hidden" id="centerId" name="centerId" class="diy_select_input" value="<?php echo $centerId; ?>">
  77. <div class="diy_select_txt"><?php echo isset($centerId) && $centerId > 0 ? $print_centers[$centerId] : '--选择印刷点--';?></div>
  78. <div class="diy_select_btn"></div>
  79. <ul class="diy_select_list" style="display: none;">
  80. <li val="0">请选择印刷点</li>
  81. <?php if ($print_centers): ?>
  82. <?php foreach ($print_centers as $center_id => $center_name): ?>
  83. <li val="<?php echo $center_id ?>"><?php echo $center_name ?></li>
  84. <?php endforeach; ?>
  85. <?php else: ?>
  86. <li val="0">暂无印刷点</li>
  87. <?php endif; ?>
  88. </ul>
  89. </div>
  90. <div class="diy_select select-package">
  91. <input type="hidden" id="status" name="status" class="diy_select_input" value="<?php echo $status; ?>">
  92. <div class="diy_select_txt"><?php echo $status > -1 ? CloudPrintTask::$STATUS[$status] : '--选择状态--';?></div>
  93. <div class="diy_select_btn"></div>
  94. <ul class="diy_select_list" style="display: none;">
  95. <li val="-1">请选择状态</li>
  96. <?php foreach(CloudPrintTask::$STATUS as $status => $status_name){
  97. ?>
  98. <li val="<?php echo $status ?>"><?php echo $status_name ?></li>
  99. <?php
  100. } ?>
  101. </ul>
  102. </div>
  103. <div class="diy_select select-good">
  104. <input type="hidden" id="goodsTypeId" name="goodsTypeId" class="diy_select_input" value="<?php echo $goodsTypeId; ?>">
  105. <div class="diy_select_txt"><?php echo (isset($goodsTypeId) && $goodsTypeId > 0) ? isset($productList[$goodsTypeId]) ? $productList[$goodsTypeId] : '--选择产品--' : '--选择产品--';?></div>
  106. <div class="diy_select_btn"></div>
  107. <ul class="diy_select_list" style="display: none;">
  108. <li val="0">请选择产品</li>
  109. <?php
  110. if($productList){
  111. foreach($productList as $pid=>$pname){
  112. ?>
  113. <li val="<?php echo $pid; ?>"><?php echo $pname;?></li>
  114. <?php }
  115. }?>
  116. </ul>
  117. </div>
  118. <div class="diy_select select-subject">
  119. <input type="hidden" id="subjectId" name="subjectId" class="diy_select_input" value="<?php echo $subjectId; ?>">
  120. <div class="diy_select_txt"><?php echo isset($subjectId) && $subjectId > 0 ? CloudPrintTask::$SUBJECT[$subjectId] : '--选择学科--';?></div>
  121. <div class="diy_select_btn"></div>
  122. <ul class="diy_select_list" style="display: none;">
  123. <li val="0">请选择学科</li>
  124. <?php foreach(CloudPrintTask::$SUBJECT as $subject_id => $subject_name){
  125. ?>
  126. <li val="<?php echo $subject_id; ?>"><?php echo $subject_name; ?></li>
  127. <?php
  128. }?>
  129. </ul>
  130. </div>
  131. <div class="purposeOrderNo">
  132. <input type="text" id="clazzName" name="clazzName" placeholder="输入班级" value="<?php echo isset($_GET['clazzName'])?$_GET['clazzName']:'' ;?>"/>
  133. </div>
  134. <div class="purposeOrderNo">
  135. <input type="text" id="examName" name="taskName" placeholder="输入任务名称" value="<?php echo isset($_GET['taskName'])?$_GET['taskName']:'' ;?>"/>
  136. </div>
  137. <div class="purposeOrderNo">
  138. <input type="text" id="taskNo" name="taskNo" placeholder="输入任务单号" value="<?php echo isset($_GET['taskNo'])?$_GET['taskNo']:'' ;?>"/>
  139. </div>
  140. <button type="submit" class="label-primary-s bth-s">查询</button>
  141. <button type="button" class="label-primary-s bth-s" onclick="p_receive();">批量确认收货</button>
  142. <button type="button" class="label-primary-s bth-s" onclick="p_print();">+应急打印</button>
  143. </div>
  144. </form>
  145. <div class="hgc_tableWrap">
  146. <div class="fixedLeft">
  147. <ul>
  148. <li class="title">
  149. <span><input type="checkbox" id="check_all" /> </span>
  150. <span>任务单号</span>
  151. <span>任务名称</span>
  152. </li>
  153. <?php
  154. if (!empty($list)){
  155. foreach ($list as $item){
  156. ?>
  157. <li>
  158. <span><input type="checkbox" name="task_id[]" value="<?php echo $item['taskId']; ?>" /></span>
  159. <span><a target="_blank" href="<?php echo Yii::app()->createUrl('imsSale/taskDetail' , array('task_id' => $item['taskId'])) ?>"> <?php echo $item['taskNo']; ?></a></span>
  160. <span title="<?php echo $item['taskName']; ?>"><?php echo $item['taskName']; ?></span>
  161. </li>
  162. <?php }
  163. }
  164. ?>
  165. </ul>
  166. </div>
  167. <div class="content" id="hgc_content">
  168. <ul>
  169. <li class="title">
  170. <span>年级</span>
  171. <span>班级</span>
  172. <span>产品名称</span>
  173. <span>学科</span>
  174. <span>打印量(页)</span>
  175. <span>打印量(张)</span>
  176. <span>打印人数</span>
  177. <span>单份页数</span>
  178. <span>打印份数</span>
  179. <span>纸张类型</span>
  180. <span>发送时间</span>
  181. <span>下载时间</span>
  182. <span>发货时间</span>
  183. <span>收货时间</span>
  184. <span>印刷点</span>
  185. </li>
  186. <?php
  187. if (!empty($list)){
  188. foreach ($list as $item){
  189. ?>
  190. <li>
  191. <span><?php echo $item['grade']; ?></span>
  192. <span><?php echo $item['clazzName']; ?></span>
  193. <span title="<?php echo $item['productName']; ?>"><?php echo $item['productName']; ?></span>
  194. <span><?php echo $item['subjectName']; ?></span>
  195. <span><?php echo $item['printPages']; ?></span>
  196. <span><?php echo $item['printSheets']; ?></span>
  197. <span><?php echo $item['printPeopleNum']; ?></span>
  198. <span><?php echo isset($item['singlePiecePages'])?$item['singlePiecePages']:''; ?></span>
  199. <span><?php echo isset($item['printPieces'])?$item['printPieces']:''; ?></span>
  200. <span><?php echo isset($item['sheetTypeText'])?$item['sheetTypeText']:''; ?></span>
  201. <span><?php echo isset($item['sendTime']) ? $item['sendTime'] : ''; ?></span>
  202. <span><?php echo isset($item['downloadTime']) ? $item['downloadTime'] : ''; ?></span>
  203. <span><?php echo isset($item['deliveryTime']) ? $item['deliveryTime'] : ''; ?></span>
  204. <span><?php echo isset($item['receiveTime']) ? $item['receiveTime'] : ''; ?></span>
  205. <span><?php echo $item['centerName']; ?></span>
  206. </li>
  207. <?php }
  208. }
  209. ?>
  210. </ul>
  211. <div class="scrollBar" id="scrollBar">
  212. <div class="barTip" id="barTip"></div>
  213. </div>
  214. </div>
  215. <div class="fixedRight">
  216. <ul>
  217. <li class="title">
  218. <span>状态</span>
  219. <span>操作</span>
  220. </li>
  221. <?php
  222. if (!empty($list)){
  223. foreach ($list as $item){
  224. ?>
  225. <li>
  226. <span><?php echo $item['statusName']; ?></span>
  227. <span><?php
  228. $back = '<a href="javascript:void(0);" style="text-decoration:underline;color:blue;" onclick="task_cancel(\''.$item['taskId'].'\')">退回</a>';
  229. $receive = '<a href="javascript:void(0);" style="text-decoration:underline;color:blue;" onclick="task_receive(\''.$item['taskId'].'\')">确认收货</a>';
  230. $delete = '<a href="javascript:void(0);" style="text-decoration:underline;color:blue;" onclick="task_delete(\''.$item['taskId'].'\')">删除</a>';
  231. if($item['status'] == CloudPrintTask::STATUS_UNDOWNLOAD)
  232. echo $back;
  233. elseif($item['status'] == CloudPrintTask::STATUS_SEND)
  234. echo $receive;
  235. elseif($item['status'] == CloudPrintTask::STATUS_BACK)
  236. echo $delete;
  237. ?>
  238. </span>
  239. </li>
  240. <?php }
  241. }
  242. ?>
  243. </ul>
  244. </div>
  245. </div>
  246. <?php if ($page): ?>
  247. <div class="col-sm-12">
  248. <ul class="pagination">
  249. <?php
  250. $params = array();
  251. if (isset($_GET['centerId']) && $_GET['centerId']) {
  252. $params['centerId'] = $_GET['centerId'];
  253. }
  254. if (isset($_GET['status']) && $_GET['status'] > -1) {
  255. $params['status'] = $_GET['status'];
  256. }
  257. if (isset($_GET['goodsTypeId']) && $_GET['goodsTypeId']) {
  258. $params['goodsTypeId'] = $_GET['goodsTypeId'];
  259. }
  260. if (isset($_GET['subjectId']) && $_GET['subjectId']) {
  261. $params['subjectId'] = $_GET['subjectId'];
  262. }
  263. if (isset($_GET['clazzName']) && $_GET['clazzName']) {
  264. $params['clazzName'] = $_GET['clazzName'];
  265. }
  266. if (isset($_GET['taskName']) && $_GET['taskName']) {
  267. $params['taskName'] = $_GET['taskName'];
  268. }
  269. if (isset($_GET['taskNo']) && $_GET['taskNo']) {
  270. $params['taskNo'] = $_GET['taskNo'];
  271. }
  272. if (isset($_GET['page'])) {
  273. $params['page'] = $_GET['page'];
  274. }else{
  275. $params['page'] = 1;
  276. }
  277. echo formatPage($pages, 'imsSale/cloudPrintTask', $params)
  278. ?>
  279. </ul>
  280. </div>
  281. <?php endif; ?>
  282. </div>
  283. <script src="/js/productset/jquery.min.js"></script>
  284. <script src="/js/ims/layer/layer.js"></script>
  285. <script src="/js/ims/xsgl.js"></script>
  286. <script src="/js/ims/cloudPrintTask.js"></script>
  287. <script>
  288. /**
  289. *任务退回
  290. * @param task_id
  291. * @returns {boolean}
  292. */
  293. function task_cancel(task_id){
  294. if(task_id <= 0)
  295. {
  296. layer.msg('非法的task_id');
  297. return false;
  298. }
  299. layer.confirm('确认退回吗?', {
  300. btn: ['确定', '取消'] //按钮
  301. }, function () {
  302. $.ajax({
  303. type: 'post',
  304. url: "<?php echo Yii::app()->createUrl('imsSale/taskCancel');?>",
  305. data: {'task_id': task_id},
  306. dataType: 'json',
  307. success: function (data) {
  308. layer.closeAll();
  309. if (data.status) {
  310. layer.alert(data.msg, {icon:1,closeBtn:0},function () {
  311. location.reload();
  312. })
  313. } else {
  314. layer.alert(data.msg, {icon: 7});
  315. }
  316. },
  317. error: function () {
  318. layer.msg("网络异常");
  319. }
  320. });
  321. });
  322. }
  323. /**
  324. * 确认收货
  325. * @param task_id
  326. * @returns {boolean}
  327. */
  328. function task_receive(task_id){
  329. if(task_id <= 0)
  330. {
  331. layer.msg('非法的task_id');
  332. return false;
  333. }
  334. layer.confirm('确认收货吗?', {
  335. btn: ['确定', '取消'] //按钮
  336. }, function () {
  337. $.ajax({
  338. type: 'post',
  339. url: "<?php echo Yii::app()->createUrl('imsSale/taskReceive');?>",
  340. data: {'task_id': task_id},
  341. dataType: 'json',
  342. success: function (data) {
  343. layer.closeAll();
  344. if (data.status) {
  345. layer.alert(data.msg, {icon:1,closeBtn:0},function () {
  346. location.reload();
  347. })
  348. } else {
  349. layer.alert(data.msg, {icon: 7});
  350. }
  351. },
  352. error: function () {
  353. layer.msg("网络异常");
  354. }
  355. });
  356. });
  357. }
  358. /**
  359. * 删除任务
  360. * @param task_id
  361. * @returns {boolean}
  362. */
  363. function task_delete(task_id){
  364. if(task_id <= 0)
  365. {
  366. layer.msg('非法的task_id');
  367. return false;
  368. }
  369. layer.confirm('确认删除吗?', {
  370. btn: ['确定', '取消'] //按钮
  371. }, function () {
  372. $.ajax({
  373. type: 'post',
  374. url: "<?php echo Yii::app()->createUrl('imsSale/taskDelete');?>",
  375. data: {'task_id': task_id},
  376. dataType: 'json',
  377. success: function (data) {
  378. layer.closeAll();
  379. if (data.status) {
  380. layer.alert(data.msg, {icon:1,closeBtn:0},function () {
  381. location.reload();
  382. })
  383. } else {
  384. layer.alert(data.msg, {icon: 7});
  385. }
  386. },
  387. error: function () {
  388. layer.msg("网络异常");
  389. }
  390. });
  391. });
  392. }
  393. function p_receive()
  394. {
  395. var obj = $("input[name='task_id[]']:checked");
  396. if(obj.length == 0)
  397. {
  398. layer.msg('请至少选择一条记录!');
  399. return false;
  400. }
  401. var check_val = [];
  402. for(k=0;k<obj.length;k++){
  403. check_val.push(obj[k].value);
  404. }
  405. layer.confirm('确认批量收货吗?', {
  406. btn: ['确定', '取消'] //按钮
  407. }, function () {
  408. $.ajax({
  409. type: 'post',
  410. url: "<?php echo Yii::app()->createUrl('imsSale/taskPReceive');?>",
  411. data: {'task_ids': check_val},
  412. dataType: 'json',
  413. success: function (data) {
  414. layer.closeAll();
  415. if (data.status) {
  416. layer.alert(data.msg, {icon:1,closeBtn:0},function () {
  417. location.reload();
  418. })
  419. } else {
  420. layer.alert(data.msg, {icon: 7});
  421. }
  422. },
  423. error: function () {
  424. layer.msg("网络异常");
  425. }
  426. });
  427. });
  428. }
  429. $(document).ready(function () {
  430. //全选/反选
  431. $('#check_all').click(function () {
  432. if($(this).is(':checked')){
  433. $(".fixedLeft :checkbox").prop("checked", true);
  434. }else{
  435. $(".fixedLeft :checkbox").prop("checked", false);
  436. }
  437. });
  438. $('body').on('focus', 'textarea', function () {
  439. $('.alert-msg').css("display", 'none');
  440. });
  441. $('body').on('focus', 'input', function () {
  442. $('.alert-msg').css("display", 'none');
  443. });
  444. });
  445. function p_print() {
  446. window.location.href = "<?php echo Yii::app()->createUrl('imsSale/contingencyPrint')?>";//成功跳转
  447. }
  448. </script>
  449. </body>
  450. </html>