detailOrder.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  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/jquery.datetimepicker.css"/>
  12. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
  13. <style>
  14. .ims-box {
  15. margin: 20px;
  16. }
  17. .screen > div {
  18. margin: 0 5px;
  19. line-height: 30px;
  20. }
  21. .yellow {
  22. color: #FF9900;
  23. }
  24. .screen > input {
  25. height: 30px;
  26. border-radius: 4px;
  27. border: 1px solid #ccc;
  28. box-shadow: none;
  29. text-indent: 10px;
  30. }
  31. .screen button {
  32. padding: 4px 12px;
  33. }
  34. .table-box {
  35. margin-top: 30px;
  36. }
  37. .btn-date_show{
  38. display: inline-block;width: 170px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  39. }
  40. .list {
  41. padding: 0 40px;
  42. /*margin-top: 40px;*/
  43. overflow: hidden;
  44. }
  45. .list h2 {
  46. line-height: 30px;
  47. font-size: 14px;
  48. }
  49. .list .student-list_box {
  50. width: 500px;
  51. margin-bottom: 15px;
  52. }
  53. .list .student-list_box>ul {
  54. height: 260px;
  55. overflow: auto;
  56. padding: 20px;
  57. background-color: #eef3ff;
  58. }
  59. .list .student-list_box li {
  60. line-height: 30px;
  61. cursor: pointer;
  62. }
  63. .list .student-list {
  64. display: none;
  65. margin-left: 20px;
  66. }
  67. .list .student-list li.active .btn-select_all {
  68. display: inline-block;
  69. }
  70. .list .student-list span {
  71. cursor: pointer;
  72. }
  73. .list .btn-select_all {
  74. margin-left: 84px;
  75. color: #008000;
  76. }
  77. .student-name_box li {
  78. position: relative;
  79. margin-left: 28px;
  80. line-height: 30px;
  81. }
  82. .student-name_box input {
  83. position: absolute;
  84. left: 155px;
  85. top: 8px;
  86. }
  87. </style>
  88. </head>
  89. <body>
  90. <div class="ims-box">
  91. <form action="<?php echo Yii::app()->createUrl('imsSale/detailOrder'); ?>" method="get">
  92. <div class="screen">
  93. <div class="diy_select select-goods">
  94. <input type="hidden" id="goodsId" name="goodsId" class="diy_select_input" value="0">
  95. <div class="diy_select_txt">请选择商品</div>
  96. <div class="diy_select_btn"></div>
  97. <ul class="diy_select_list" style="display: none;width:570px;">
  98. <li val="0">请选择商品</li>
  99. <?php if ($goodList): ?>
  100. <?php foreach ($goodList as $item): ?>
  101. <li val="<?php echo $item['goodsId'] ?>"><?php echo $item['goodsName'] ?></li>
  102. <?php endforeach; ?>
  103. <?php else: ?>
  104. <li val="0">暂无商品</li>
  105. <?php endif; ?>
  106. </ul>
  107. </div>
  108. <div class="diy_select select-package">
  109. <input type="hidden" id="packageId" name="packageId" class="diy_select_input" value="0">
  110. <div class="diy_select_txt">请选择套餐</div>
  111. <div class="diy_select_btn"></div>
  112. <ul class="diy_select_list" style="display: none;">
  113. </ul>
  114. </div>
  115. <div class="diy_select select-useStatus">
  116. <input type="hidden" id="useStatus" name="useStatus" class="diy_select_input" value="0">
  117. <div class="diy_select_txt">状态</div>
  118. <div class="diy_select_btn"></div>
  119. <ul class="diy_select_list" style="display: none;">
  120. <li val="0">状态</li>
  121. <li val="1">使用中</li>
  122. <li val="3">已过期</li>
  123. <li val="2">未生效</li>
  124. </ul>
  125. </div>
  126. <div class="diy_select select-takeStatus">
  127. <input type="hidden" id="takeStatus" name="takeStatus" class="diy_select_input" value="0">
  128. <div class="diy_select_txt">是否收货</div>
  129. <div class="diy_select_btn"></div>
  130. <ul class="diy_select_list" style="display: none;">
  131. <li val="0">是否收货</li>
  132. <li val="2">是</li>
  133. <li val="1">否</li>
  134. </ul>
  135. </div>
  136. <div class="diy_select select-payStatus">
  137. <input type="hidden" id="payStatus" name="payStatus" class="diy_select_input" value="0">
  138. <div class="diy_select_txt">是否支付</div>
  139. <div class="diy_select_btn"></div>
  140. <ul class="diy_select_list" style="display: none;">
  141. <li val="0">是否支付</li>
  142. <li val="2">是</li>
  143. <li val="1">否</li>
  144. </ul>
  145. </div>
  146. <input value="" type="text" name="studentName" id="studentName" placeholder="学生名称">
  147. <input value="" type="text" name="orderOfficialNo" id="orderOfficialNo" placeholder="财务订单号">
  148. <div class="diy_select select-orderTypes">
  149. <input type="hidden" id="orderTypes" name="orderTypes" class="diy_select_input" value="0">
  150. <div class="diy_select_txt">订单类型</div>
  151. <div class="diy_select_btn"></div>
  152. <ul class="diy_select_list" style="display: none;">
  153. <li val="0">订单类型</li>
  154. <li val="1">线上销售单</li>
  155. <li val="2">线下销售单</li>
  156. </ul>
  157. </div>
  158. <div class="diy_select select-schoolYearName">
  159. <input type="hidden" id="schoolYearName" name="schoolYearName" class="diy_select_input" value="0">
  160. <div class="diy_select_txt">请选择学年</div>
  161. <div class="diy_select_btn"></div>
  162. <ul class="diy_select_list" style="display: none;">
  163. <li val="0">请选择学年</li>
  164. <?php if ($schoolYear): ?>
  165. <?php foreach ($schoolYear as $val): ?>
  166. <li val="<?php echo $val['schoolYearId'] ?>"><?php echo $val['schoolYearName'] ?></li>
  167. <?php endforeach; ?>
  168. <?php else: ?>
  169. <li val="">暂无学年</li>
  170. <?php endif; ?>
  171. </ul>
  172. </div>
  173. <div class="diy_select select-semesterTypes">
  174. <input type="hidden" id="semesterTypes" name="semesterTypes" class="diy_select_input" value="0">
  175. <div class="diy_select_txt">请选择学期</div>
  176. <div class="diy_select_btn"></div>
  177. <ul class="diy_select_list" style="display: none;">
  178. <li val="0">请选择学期</li>
  179. <li val="1">上学期</li>
  180. <li val="2">下学期</li>
  181. <li val="3">跨学期</li>
  182. </ul>
  183. </div>
  184. <input value="" type="text" name="className" id="className" placeholder="班级">
  185. <br> <br>
  186. <input type="text" name="beginTime" class="some_class" value="<?php if(isset($_GET['beginTime'])) echo $_GET['beginTime']?>" readonly id="some_class_1" placeholder="创建开始时间"/> 到
  187. <input type="text" name="endTime" class="some_class" value="<?php if(isset($_GET['endTime'])) echo $_GET['endTime']?>" readonly id="some_class_2" placeholder="创建结束时间"/>
  188. <button type="submit" class="label-primary-s bth-s">查询</button>
  189. <a class="label-primary-s bth-s download-excel">导出</a>
  190. <a class="label-primary-s bth-s not-buy">导出未订购学生</a>
  191. </div>
  192. </form>
  193. <div class="table-box">
  194. <table id="intention-table"
  195. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  196. style="font-size:12px">
  197. <thead>
  198. <tr>
  199. <th>订单编号</th>
  200. <th>是否允许退订</th>
  201. <th>订单类型</th>
  202. <th>学年</th>
  203. <th>学期</th>
  204. <th>财务订单号</th>
  205. <th>商品名称</th>
  206. <th>套餐</th>
  207. <th>下单年级</th>
  208. <th>使用月份</th>
  209. <th>下单时间</th>
  210. <th>学生ID</th>
  211. <th>学生</th>
  212. <th>年级</th>
  213. <th>班级</th>
  214. <th>状态</th>
  215. <th>是否收货</th>
  216. <th>是否支付</th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <?php if ($list): ?>
  221. <?php foreach ($list as $item): ?>
  222. <tr>
  223. <td><?php echo $item['orderNo'];?></td>
  224. <?php if($item['isAllowRefund']){ ?>
  225. <td style="color: red">否</td>
  226. <?php }else{ ?>
  227. <td style="color: #0e8e54">是</td>
  228. <?php } ?>
  229. <td><?php echo $item['orderTypeName'];?></td>
  230. <td><?php echo isset($item['schoolYearName'])?$item['schoolYearName']:"";?></td>
  231. <td><?php echo isset($item['semesterName'])?$item['semesterName']:"";?></td>
  232. <td><?php echo $item['orderOfficialNo'];?></td>
  233. <td><?php echo $item['goodsName'];?></td>
  234. <td><?php echo $item['goodsPackageName'];?></td>
  235. <td><?php echo isset($item['gradeText'])?$item['gradeText']:'';?></td>
  236. <td><a class="btn-date_show" href="#"><?php echo $item['useTimes'];?></a></td>
  237. <td><?php echo $item['createTime'];?></td>
  238. <td><?php echo $item['studentId'];?></td>
  239. <td><?php echo $item['studentName'];?></td>
  240. <td><?php echo isset($item['gradeText'])?$item['gradeText']:"";?></td>
  241. <td><?php echo isset($item['clazzName'])?$item['clazzName']:"";?></td>
  242. <td class="use-type" status="<?php echo $item['status'];?>"><?php echo $item['statusName'];?></td>
  243. <?php if ($item['isTake']):?>
  244. <td style="color: #0e8e54">是</td>
  245. <?php else:?>
  246. <td style="color: red">否</td>
  247. <?php endif;?>
  248. <?php if ($item['isPay']):?>
  249. <td style="color: #0e8e54">是</td>
  250. <?php else:?>
  251. <td style="color: red">否</td>
  252. <?php endif;?>
  253. </tr>
  254. <?php endforeach; ?>
  255. <?php endif; ?>
  256. </tbody>
  257. </table>
  258. <?php if ($page): ?>
  259. <div class="col-sm-12">
  260. <ul class="pagination">
  261. <?php
  262. $params = array();
  263. if (isset($_GET['orderNo']) && $_GET['orderNo']) {
  264. $params['orderNo'] = $_GET['orderNo'];
  265. }
  266. if (isset($_GET['orderOfficialNo']) && $_GET['orderOfficialNo']) {
  267. $params['orderOfficialNo'] = $_GET['orderOfficialNo'];
  268. }
  269. if (isset($_GET['goodsId']) && $_GET['goodsId']>0) {
  270. $params['goodsId'] = $_GET['goodsId'];
  271. }
  272. if (isset($_GET['packageId']) && $_GET['packageId']>0) {
  273. $params['packageId'] = $_GET['packageId'];
  274. }
  275. if (isset($_GET['useStatus']) && $_GET['useStatus']>0) {
  276. $params['useStatus'] = $_GET['useStatus'];
  277. }
  278. if (isset($_GET['payStatus']) && $_GET['payStatus']>0) {
  279. $params['payStatus'] = $_GET['payStatus'];
  280. }
  281. if (isset($_GET['takeStatus']) && $_GET['takeStatus']>0) {
  282. $params['takeStatus'] = $_GET['takeStatus'];
  283. }
  284. if (isset($_GET['studentName']) && $_GET['studentName']) {
  285. $params['studentName'] = $_GET['studentName'];
  286. }
  287. if (isset($_GET['page'])) {
  288. $params['page'] = $_GET['page'];
  289. }else{
  290. $params['page'] = 1;
  291. }
  292. if (isset($_GET['orderTypes']) && $_GET['orderTypes']) {
  293. $params['orderTypes'] = $_GET['orderTypes'];
  294. }
  295. if (isset($_GET['schoolYearName']) && $_GET['schoolYearName']) {
  296. $params['schoolYearName'] = $_GET['schoolYearName'];
  297. }
  298. if (isset($_GET['semesterTypes']) && $_GET['semesterTypes']) {
  299. $params['semesterTypes'] = $_GET['semesterTypes'];
  300. }
  301. if (isset($_GET['className']) && $_GET['className']) {
  302. $params['className'] = $_GET['className'];
  303. }
  304. if (isset($_GET['beginTime']) && $_GET['beginTime']) {
  305. $params['beginTime'] = $_GET['beginTime'];
  306. }
  307. if (isset($_GET['endTime']) && $_GET['endTime']) {
  308. $params['endTime'] = $_GET['endTime'];
  309. }
  310. echo formatPage($page, 'imsSale/detailOrder', $params)
  311. ?>
  312. </ul>
  313. </div>
  314. <?php endif; ?>
  315. </div>
  316. </div>
  317. <!--导出未订购学生弹窗-->
  318. <div class="layer-edit" style="display: none">
  319. <p class="red"></p>
  320. <div class="list">
  321. <div class="student-list_box fl">
  322. <select name="schoolYearId" class="schoolYearId">
  323. <option value="0">选择学年</option>
  324. <?php if ($schoolYear): ?>
  325. <?php foreach ($schoolYear as $val): ?>
  326. <option value="<?php echo $val['schoolYearId'] ?>"><?php echo $val['schoolYearName'] ?></option>
  327. <?php endforeach; ?>
  328. <?php else: ?>
  329. <option value="">暂无学年</option>
  330. <?php endif; ?>
  331. </select>
  332. <select name="semesterId" class="semesterId">
  333. <option value="0">选择学期</option>
  334. <option value="1">上学期</option>
  335. <option value="2">下学期</option>
  336. <option value="3">跨学期</option>
  337. </select>
  338. <select name="grade" class="grade">
  339. <option value="0">选择年级</option>
  340. <?php
  341. if(Yii::app()->params['grade_list']){
  342. foreach (Yii::app()->params['grade_list'] as $val){
  343. echo '<option value="'.$val['id'].'" >'.$val['grade_name'].'</option>';
  344. }
  345. }
  346. ?>
  347. </select>
  348. <button class="label-primary-s student_search">查询</button>
  349. <button class="label-primary-s bth-s export_student">导出</button>
  350. </div>
  351. <hr>
  352. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  353. <tr>
  354. <td>姓名</td>
  355. <td>编号</td>
  356. <td>年级</td>
  357. <td>班级</td>
  358. </tr>
  359. <tbody class="item_list">
  360. </tbody>
  361. </table>
  362. <div class="fr">
  363. <a href="#" class="prev">上一页</a>
  364. <span class="now_page">1</span>/<span class="last_page">1</span>
  365. <a href="#" class="next">下一页</a>
  366. </div>
  367. </div>
  368. </div>
  369. <script src="/js/productset/jquery.min.js"></script>
  370. <script src="/js/ims/jquery.datetimepicker.js"></script>
  371. <script src="/js/ims/xsgl.js"></script>
  372. <script src="/js/layer/layer.js"></script>
  373. <script>
  374. $(document).ready(function () {
  375. function useType() {
  376. $(".use-type").each(function (index) {
  377. if ($(this).attr('status') == 1) {
  378. $(this).addClass("yellow");
  379. } else if ($(this).attr('status') == 2) {
  380. $(this).addClass("red");
  381. }else {
  382. $(this).addClass("green");
  383. }
  384. })
  385. }
  386. useType();
  387. //筛选条件赋值
  388. <?php if(isset($_GET['goodsId']) && $_GET['goodsId']>0):?>
  389. var goodsId = "<?php echo $_GET['goodsId'];?>";
  390. $('#goodsId').val(goodsId);
  391. var txt = $('.select-goods li[val=' + goodsId + ']').html();
  392. $('.select-goods .diy_select_txt').html(txt);
  393. getPackage(goodsId);
  394. <?php endif;?>
  395. <?php if(isset($_GET['useStatus'])):?>
  396. var useStatus = "<?php echo $_GET['useStatus'];?>";
  397. $('#useStatus').val(useStatus);
  398. var txt = $('.select-useStatus li[val=' + useStatus + ']').html();
  399. $('.select-useStatus .diy_select_txt').html(txt);
  400. <?php endif;?>
  401. <?php if(isset($_GET['payStatus'])):?>
  402. var payStatus = "<?php echo $_GET['payStatus'];?>";
  403. $('#payStatus').val(payStatus);
  404. var txt = $('.select-payStatus li[val=' + payStatus + ']').html();
  405. $('.select-payStatus .diy_select_txt').html(txt);
  406. <?php endif;?>
  407. <?php if(isset($_GET['takeStatus'])):?>
  408. var takeStatus = "<?php echo $_GET['takeStatus'];?>";
  409. $('#takeStatus').val(takeStatus);
  410. var txt = $('.select-takeStatus li[val=' + takeStatus + ']').html();
  411. $('.select-takeStatus .diy_select_txt').html(txt);
  412. <?php endif;?>
  413. <?php if(isset($_GET['studentName'])):?>
  414. var txt = "<?php echo $_GET['studentName'];?>";
  415. $('#studentName').val(txt);
  416. <?php endif;?>
  417. <?php if(isset($_GET['orderOfficialNo'])):?>
  418. var txt = "<?php echo $_GET['orderOfficialNo'];?>";
  419. $('#orderOfficialNo').val(txt);
  420. <?php endif;?>
  421. <?php if(isset($_GET['orderTypes'])):?>
  422. var orderTypes = "<?php echo $_GET['orderTypes'];?>";
  423. $('#orderTypes').val(orderTypes);
  424. var txt = $('.select-orderTypes li[val=' + orderTypes + ']').html();
  425. $('.select-orderTypes .diy_select_txt').html(txt);
  426. <?php endif;?>
  427. <?php if(isset($_GET['semesterTypes'])):?>
  428. var semesterTypes = "<?php echo $_GET['semesterTypes'];?>";
  429. $('#semesterTypes').val(semesterTypes);
  430. var txt = $('.select-semesterTypes li[val=' + semesterTypes + ']').html();
  431. $('.select-semesterTypes .diy_select_txt').html(txt);
  432. <?php endif;?>
  433. <?php if(isset($_GET['schoolYearName'])):?>
  434. var schoolYearName = "<?php echo $_GET['schoolYearName'];?>";
  435. $('#schoolYearName').val(schoolYearName);
  436. var txt = $('.select-schoolYearName li[val=' + schoolYearName + ']').html();
  437. $('.select-schoolYearName .diy_select_txt').html(txt);
  438. <?php endif;?>
  439. <?php if(isset($_GET['className'])):?>
  440. var txt = "<?php echo $_GET['className'];?>";
  441. $('#className').val(txt);
  442. <?php endif;?>
  443. $('.some_class').datetimepicker({
  444. format: "Y-m-d", //格式化日期
  445. timepicker: false //关闭时间选项
  446. });
  447. //获取套餐
  448. $('.select-goods li').click(function () {
  449. var currentGoodsId = $(this).attr('val');
  450. if(currentGoodsId>0){
  451. getPackage(currentGoodsId);
  452. }else{
  453. $('.select-package .diy_select_txt').val("请选择套餐");
  454. $('#packageId').val(0);
  455. $('.select-package ul').html('<li val="0">请选择套餐</li>');
  456. }
  457. });
  458. function getPackage(goodsId) {
  459. if (goodsId<=0){
  460. var html = '<li val="0">请选择套餐</li>';
  461. $('.select-package ul').html(html);
  462. }else{
  463. $.ajax({
  464. type: 'post',
  465. url: "<?php echo Yii::app()->createUrl('imsSale/getPackages');?>",
  466. data: {goodsId: goodsId},
  467. dataType: 'json',
  468. success: function (data) {
  469. console.log(data);
  470. if (data.status) {
  471. var html = '<li val="0">请选择套餐</li>';
  472. for (var i = 0; i < data.data.length; i++) {
  473. var item = data.data[i];
  474. if (item['packageId']) {
  475. html += '<li val="' + item['packageId'] + '">';
  476. html += item['packageName'];
  477. html += '</li>'
  478. }
  479. }
  480. } else {
  481. var html = '<li val="0">暂无套餐</li>';
  482. }
  483. $('.select-package ul').html(html);
  484. <?php if(isset($_GET['packageId'])):?>
  485. var packageId = "<?php echo $_GET['packageId'];?>";
  486. $('#packageId').val(packageId);
  487. var txt = $('.select-package li[val=' + packageId + ']').html();
  488. $('.select-package .diy_select_txt').html(txt);
  489. <?php endif;?>
  490. },
  491. error: function () {
  492. return;
  493. }
  494. })
  495. }
  496. }
  497. $(".btn-date_show").on("click", function () {
  498. layer.alert($(this).text(), {
  499. title: '使用月份',
  500. area: ['420px', '240px']
  501. });
  502. });
  503. //导出excel
  504. $(".download-excel").on("click", function () {
  505. var goodsId = "<?php echo isset($_GET['goodsId'])?$_GET['goodsId']:'';?>";
  506. var packageId = "<?php echo isset($_GET['packageId'])?$_GET['packageId']:'';?>";
  507. var useStatus = "<?php echo isset($_GET['useStatus'])?$_GET['useStatus']:'';?>";
  508. var payStatus = "<?php echo isset($_GET['payStatus'])?$_GET['payStatus']:'';?>";
  509. var takeStatus = "<?php echo isset($_GET['takeStatus'])?$_GET['takeStatus']:'';?>";
  510. var studentName = "<?php echo isset($_GET['studentName'])?$_GET['studentName']:'';?>";
  511. var orderOfficialNo = "<?php echo isset($_GET['orderOfficialNo'])?$_GET['orderOfficialNo']:'';?>";
  512. var orderTypes = "<?php echo isset($_GET['orderTypes'])?$_GET['orderTypes']:'';?>";
  513. var semesterTypes = "<?php echo isset($_GET['semesterTypes'])?$_GET['semesterTypes']:'';?>";
  514. var schoolYearName = "<?php echo isset($_GET['schoolYearName'])?$_GET['schoolYearName']:'';?>";
  515. var className = "<?php echo isset($_GET['className'])?$_GET['className']:'';?>";
  516. var beginTime = "<?php echo isset($_GET['beginTime'])?$_GET['beginTime']:'';?>";
  517. var endTime = "<?php echo isset($_GET['endTime'])?$_GET['endTime']:'';?>";
  518. $.ajax({
  519. type: 'post',
  520. url: "<?php echo Yii::app()->createUrl('imsSale/detailOrderExcel');?>",
  521. data: {
  522. goodsId: goodsId,
  523. packageId:packageId,
  524. useStatus:useStatus,
  525. payStatus:payStatus,
  526. takeStatus:takeStatus,
  527. studentName:studentName,
  528. orderOfficialNo:orderOfficialNo,
  529. orderTypes:orderTypes,
  530. semesterTypes:semesterTypes,
  531. schoolYearName:schoolYearName,
  532. className:className,
  533. beginTime:beginTime,
  534. endTime:endTime
  535. },
  536. dataType: 'json',
  537. success: function (result) {
  538. if (result.status == 1) {
  539. window.location.href = result.data;
  540. } else {
  541. layer.msg(result.data);
  542. }
  543. },
  544. error: function () {
  545. return;
  546. }
  547. })
  548. });
  549. //导出未订购学生弹窗
  550. $('.not-buy').click(function(){
  551. layer.open({
  552. type: 1,
  553. title: '导出未订购学生',
  554. btn: ['关闭'],
  555. area: ['720px', '520px'], //宽高
  556. btnAlign: 'c',
  557. content: $('.layer-edit'),
  558. yes: function (index, layero) {
  559. layer.closeAll();
  560. }
  561. });
  562. });
  563. $('.student_search').click(function(){
  564. loadPM(1);
  565. })
  566. $('.prev').click(function(){
  567. var now_page=parseInt($('.now_page').html());
  568. if(now_page<=1){
  569. return false;
  570. }
  571. loadPM(now_page-1);
  572. });
  573. $('.next').click(function(){
  574. var now_page=parseInt($('.now_page').html());
  575. var last_page=parseInt($('.last_page').html());
  576. if(now_page>=last_page){
  577. return false;
  578. }
  579. loadPM(now_page+1);
  580. });
  581. function loadPM(page){
  582. var schoolYearId=$('.schoolYearId').val();
  583. var semesterId=$('.semesterId').val();
  584. var grade=$('.grade').val();
  585. if(schoolYearId==0){
  586. layer.msg('请选择学年');
  587. return false;
  588. }
  589. if(semesterId==0){
  590. layer.msg('请选择学期');
  591. return false;
  592. }
  593. if(grade==0){
  594. layer.msg('请选择年级');
  595. return false;
  596. }
  597. alertIndex=layer.msg('正在查询,请稍候。。。。。。',{time:0});
  598. $.ajax({
  599. url:'<?php echo $this->createUrl('imsSale/searchNoBuy')?>',
  600. type:'POST',
  601. dataType:'json',
  602. data:{schoolYearId:schoolYearId,semesterId:semesterId,grade:grade,page:page},
  603. success:function(res){
  604. layer.close(alertIndex);
  605. if(res.status==1){
  606. //填充数据
  607. var html='';
  608. var list=res.data.list;
  609. $('.prev').removeClass('hide');
  610. $('.next').removeClass('hide');
  611. for(var i=0;i<list.length;i++){
  612. html+='<tr>';
  613. html+='<td>'+list[i]['studentName']+'</td>';
  614. html+='<td class="itemName">'+list[i]['studentId']+'</td>';
  615. html+='<td class="itemType">'+list[i]['gradeName']+'</td>';
  616. html+='<td>'+list[i]['clazzName']+'</td>';
  617. html+='</tr>';
  618. }
  619. $('.item_list').html(html);
  620. $('.last_page').html(res.data['total_page']);
  621. $('.now_page').html(res.data['now_page']);
  622. if(res.data['now_page']==1){
  623. $('.prev').addClass('hide');
  624. }
  625. if(res.data['now_page']==res.data['total_page']){
  626. $('.next').addClass('hide');
  627. }
  628. }
  629. }
  630. })
  631. }
  632. $('.export_student').click(function () {
  633. var schoolYearId=$('.schoolYearId').val();
  634. var semesterId=$('.semesterId').val();
  635. var grade=$('.grade').val();
  636. if(schoolYearId==0){
  637. layer.msg('请选择学年');
  638. return false;
  639. }
  640. if(semesterId==0){
  641. layer.msg('请选择学期');
  642. return false;
  643. }
  644. if(grade==0){
  645. layer.msg('请选择年级');
  646. return false;
  647. }
  648. alertIndex=layer.msg('正在导出,请稍候。。。。。。',{time:0});
  649. $.ajax({
  650. url:'<?php echo $this->createUrl('imsSale/exportNoBuyStudent')?>',
  651. type:'POST',
  652. dataType:'json',
  653. data:{schoolYearId:schoolYearId,semesterId:semesterId,grade:grade},
  654. success:function(res){
  655. layer.close(alertIndex);
  656. if(res.status==1){
  657. window.location.href = res.data;
  658. } else {
  659. layer.msg(res.data);
  660. }
  661. }
  662. })
  663. })
  664. });
  665. </script>
  666. </body>
  667. </html>