purposeTable.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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. .green {
  15. color: green;
  16. }
  17. .red {
  18. color: red;
  19. }
  20. .ims-box {
  21. margin: 20px;
  22. }
  23. .screen > div {
  24. float: left;
  25. margin-right: 8px;
  26. }
  27. .screen .date > input {
  28. height: 30px;
  29. border-radius: 4px;
  30. border: 1px solid #ccc;
  31. box-shadow: none;
  32. text-indent: 10px;
  33. }
  34. .screen .purposeOrderNo > input {
  35. height: 30px;
  36. border-radius: 4px;
  37. border: 1px solid #ccc;
  38. box-shadow: none;
  39. text-indent: 10px;
  40. }
  41. .screen button {
  42. padding: 4px 12px;
  43. }
  44. .table-box {
  45. margin-top: 30px;
  46. }
  47. .btn-formal-order {
  48. cursor: pointer;
  49. }
  50. .application-number-box {
  51. margin-top: 50px;
  52. text-align: center;
  53. }
  54. .application-number-box span {
  55. margin-right: 20px;
  56. }
  57. .layui-layer-btn .layui-layer-btn0 {
  58. border-color: #2977ff !important;
  59. background-color: #2977ff !important;
  60. color: #fff;
  61. }
  62. .btn-date_show{
  63. display: inline-block;width: 170px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <div class="ims-box">
  69. <form action="<?php echo Yii::app()->createUrl('imsSale/purposeTable'); ?>" method="get">
  70. <div class="screen">
  71. <div class="diy_select year">
  72. <input type="hidden" id="schoolYearId" name="schoolYearId" class="diy_select_input" value="0">
  73. <div class="diy_select_txt">请选择学年</div>
  74. <div class="diy_select_btn"></div>
  75. <ul class="diy_select_list" style="display: none;">
  76. <li val="">请选择学年</li>
  77. <?php if ($schoolYear): ?>
  78. <?php foreach ($schoolYear as $val): ?>
  79. <li val="<?php echo $val['schoolYearId'] ?>"><?php echo $val['schoolYearName'] ?></li>
  80. <?php endforeach; ?>
  81. <?php else: ?>
  82. <li val="">暂无学年</li>
  83. <?php endif; ?>
  84. </ul>
  85. </div>
  86. <div class="purposeOrderNo">
  87. <span>订单编号:</span>
  88. <input type="text" id="purposeOrderNo" name="purposeOrderNo" value="<?php echo isset($_GET['purposeOrderNo'])?$_GET['purposeOrderNo']:'' ;?>"/>
  89. </div>
  90. <div class="diy_select goods">
  91. <input type="hidden" id="goodsId" name="goodsId" class="diy_select_input" value="0">
  92. <div class="diy_select_txt">请选择商品</div>
  93. <div class="diy_select_btn"></div>
  94. <ul class="diy_select_list" style="display: none;width:570px;">
  95. <li val="">请选择商品</li>
  96. <?php if ($goodList): ?>
  97. <?php foreach ($goodList as $good): ?>
  98. <li val="<?php echo $good['goodsId'] ?>"><?php echo $good['goodsName'] ?></li>
  99. <?php endforeach; ?>
  100. <?php else: ?>
  101. <li val="">暂无商品</li>
  102. <?php endif; ?>
  103. </ul>
  104. </div>
  105. <div class="date">
  106. <span>下单时间:</span>
  107. <input type="text" name="beginTime" class="some_class" value="" id="some_class_1"/> --
  108. <input type="text" name="endTime" class="some_class" value="" id="some_class_2"/>
  109. </div>
  110. <button type="submit" class="label-primary-s bth-s">查询</button>
  111. </div>
  112. </form>
  113. <div class="table-box">
  114. <table id="intention-table"
  115. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  116. style="font-size:12px">
  117. <thead>
  118. <tr>
  119. <th>销售订单编号</th>
  120. <th>商品名称</th>
  121. <th>套餐</th>
  122. <th>学年</th>
  123. <th>下单年级</th>
  124. <th>使用月份</th>
  125. <th>下单时间</th>
  126. <th>预定人数</th>
  127. <th>调整数</th>
  128. <th>待审核人数</th>
  129. <th>已转财务订单人数</th>
  130. <th>满额状态</th>
  131. <th>转单状态</th>
  132. <th>操作</th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. <?php if ($list): ?>
  137. <?php foreach ($list as $item): ?>
  138. <tr>
  139. <td><?php echo $item['orderNo'];?></td>
  140. <td><?php echo $item['goodsName'];?></td>
  141. <td><?php echo $item['goodsPackageName'];?></td>
  142. <td><?php echo $item['schoolYearName'];?></td>
  143. <td><?php echo $item['gradeText'];?></td>
  144. <td><a class="btn-date_show" href="#"><?php echo $item['userTime'];?></a></td>
  145. <td><?php echo $item['createTime'];?></td>
  146. <td><?php echo $item['quantity'];?></td>
  147. <td><?php echo $item['adjustNum'];?></td>
  148. <td><?php echo $item['applyOfficialNum'];?></td>
  149. <td><?php echo $item['officialNum'];?></td>
  150. <td><?php echo $item['surplusNumber'] > 0 ? '未满额':'已满额'; ?></td>
  151. <td><?php
  152. if(isset($item['isAllowTurn'])){
  153. echo $item['isAllowTurn'];
  154. }
  155. ?></td>
  156. <td>
  157. <?php
  158. if(isset($item['isAllowTurn'])){
  159. if($item['surplusNumber'] > 0 && $item['isAllowTurn']=='开启'){
  160. ?>
  161. <a href="<?php echo Yii::app()->createUrl('imsSale/FormalOrder?useGrade='.$item['gradeText'].'&schoolYear='.$item['schoolYear'].'&goodsTypeId=0&orderId='.$item['orderId'].'&orderNo='.$item['orderNo'].'&goodsName='.$item['goodsName'].'&grade='.$item['grade'].'&surplus='.$item['surplusNumber']);?>">转财务订单</a>
  162. <?php
  163. }
  164. }elseif($item['surplusNumber'] > 0){
  165. ?>
  166. <a href="<?php echo Yii::app()->createUrl('imsSale/FormalOrder?useGrade='.$item['gradeText'].'&schoolYear='.$item['schoolYear'].'&goodsTypeId=0&orderId='.$item['orderId'].'&orderNo='.$item['orderNo'].'&goodsName='.$item['goodsName'].'&grade='.$item['grade'].'&surplus='.$item['surplusNumber']);?>">转财务订单</a>
  167. <?php
  168. }
  169. ?>
  170. <a href="<?php echo $this->createUrl('imsSale/pushList?orderId='.$item['orderId']) ?>"> 推送名单</a>
  171. </td>
  172. </tr>
  173. <?php endforeach; ?>
  174. <?php endif; ?>
  175. </tbody>
  176. </table>
  177. <?php if ($page): ?>
  178. <div class="col-sm-12">
  179. <ul class="pagination">
  180. <?php
  181. $params = array();
  182. if (isset($_GET['schoolYearId']) && $_GET['schoolYearId']) {
  183. $params['schoolYearId'] = $_GET['schoolYearId'];
  184. }
  185. if (isset($_GET['purposeOrderNo']) && $_GET['purposeOrderNo']) {
  186. $params['purposeOrderNo'] = $_GET['purposeOrderNo'];
  187. }
  188. if (isset($_GET['goodsId']) && $_GET['goodsId']) {
  189. $params['goodsId'] = $_GET['goodsId'];
  190. }
  191. if (isset($_GET['some_class_1']) && $_GET['some_class_1']) {
  192. $params['beginTime'] = $_GET['some_class_1'];
  193. }
  194. if (isset($_GET['some_class_2']) && $_GET['some_class_2']) {
  195. $params['endTime'] = $_GET['some_class_2'];
  196. }
  197. if (isset($_GET['page'])) {
  198. $params['page'] = $_GET['page'];
  199. }else{
  200. $params['page'] = 1;
  201. }
  202. echo formatPage($page, 'imsSale/purposeTable', $params);
  203. ?>
  204. </ul>
  205. </div>
  206. <?php endif; ?>
  207. </div>
  208. </div>
  209. <script src="/js/productset/jquery.min.js"></script>
  210. <script src="/js/ims/jquery.datetimepicker.js"></script>
  211. <script src="/js/ims/xsgl.js"></script>
  212. <script src="/js/layer/layer.js"></script>
  213. <script>
  214. $(document).ready(function () {
  215. //筛选条件赋值
  216. <?php if(isset($_GET['beginTime'])):?>
  217. $("#some_class_1").attr("value","<?php echo $_GET['beginTime']?>");
  218. $("#some_class_2").attr("value", "<?php echo $_GET['endTime']?>");
  219. <?php endif;?>
  220. <?php if(isset($_GET['goodsId']) && $_GET['goodsId']):?>
  221. var goodsId = "<?php echo $_GET['goodsId'];?>";
  222. $('#goodsId').val(goodsId);
  223. var txt = $('.goods li[val='+goodsId+']').html();
  224. $('.goods .diy_select_txt').html(txt);
  225. <?php endif;?>
  226. <?php if(isset($_GET['schoolYearId']) && $_GET['schoolYearId']):?>
  227. var schoolYearId = "<?php echo $_GET['schoolYearId'];?>";
  228. $('#schoolYearId').val(schoolYearId);
  229. var txt = $('.year li[val='+schoolYearId+']').html();
  230. $('.year .diy_select_txt').html(txt);
  231. <?php endif;?>
  232. $('.some_class').datetimepicker({
  233. format: "Y-m-d", //格式化日期
  234. timepicker: false //关闭时间选项
  235. });
  236. $(".btn-date_show").on("click", function () {
  237. layer.alert($(this).text(), {
  238. title: '使用月份',
  239. area: ['420px', '240px']
  240. });
  241. });
  242. $(".btn-formal-order").on("click", function () {
  243. var quantity= parseInt($(this).attr('a1'));
  244. var adjustNum = parseInt($(this).attr('a2'));
  245. var applyOfficialNum = parseInt($(this).attr('a3'));
  246. var officialNum2 = parseInt($(this).attr('a4'));
  247. var orderId = $(this).attr('orderId');
  248. var flag = true;
  249. layer.open({
  250. type: 1,
  251. title: '转财务订单',
  252. btn: ['确定', '取消'],
  253. area: ['420px', '240px'], //宽高
  254. btnAlign: 'c',
  255. content: '<div class="application-number-box"><p style="color: red;display: none;" class="alert-msg"></p><span>申请人数</span> <input type="number" id="applicationNumber" ></div>',
  256. yes: function (index, layero) {
  257. //提交
  258. var officialNum =$('#applicationNumber').val();
  259. if (officialNum>0) {
  260. if((officialNum>(quantity+adjustNum-applyOfficialNum-officialNum2))){
  261. $('.alert-msg').html("填写数额超出额度").fadeIn();
  262. }else{
  263. if (flag){
  264. flag = false;
  265. $.ajax({
  266. type: 'post',
  267. url: "<?php echo Yii::app()->createUrl('imsSale/toOfficial') ;?>",
  268. data: {'orderId':orderId, 'officialNum':officialNum},
  269. dataType: 'json',
  270. success: function (data) {
  271. if (data.status){
  272. location.reload();
  273. } else{
  274. flag = true;
  275. layer.msg(data.msg);
  276. }
  277. },
  278. error: function () {
  279. flag = true;
  280. layer.msg("异常错误");
  281. }
  282. });
  283. }
  284. }
  285. }else{
  286. layer.msg("请填写数量");
  287. }
  288. },
  289. btn2: function (index, layero) {
  290. //return false 开启该代码可禁止点击该按钮关闭
  291. }
  292. });
  293. return false;
  294. });
  295. });
  296. $('body').on('focus', '#applicationNumber', function () {
  297. $('.alert-msg').css("display",'none');
  298. });
  299. </script>
  300. </body>
  301. </html>