deliveryOut.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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/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 > span {
  28. line-height: 30px;
  29. margin-right: 5px;
  30. }
  31. .screen .date > input {
  32. height: 30px;
  33. border-radius: 4px;
  34. border: 1px solid #ccc;
  35. box-shadow: none;
  36. text-indent: 10px;
  37. }
  38. .screen button {
  39. padding: 4px 12px;
  40. }
  41. .table-box {
  42. margin-top: 30px;
  43. }
  44. .btn-formal-order {
  45. cursor: pointer;
  46. }
  47. .application-number-box {
  48. margin-top: 50px;
  49. text-align: center;
  50. }
  51. .application-number-box span {
  52. margin-right: 20px;
  53. }
  54. .layui-layer-btn .layui-layer-btn0 {
  55. border-color: #2977ff !important;
  56. background-color: #2977ff !important;
  57. color: #fff;
  58. }
  59. .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
  60. line-height: 140px;
  61. text-align: center;
  62. }
  63. .qrcode-fram{display:none;}
  64. #imsCode img{display:inline-block!important;margin:10px 0;}
  65. #qrcode{display:inline-block;}
  66. .use-out{margin:20px; border-bottom:1px solid #ccc;}
  67. .use-out a{line-height:30px;padding:0 50px;margin-right:20px;font-size:16px;color:#333;}
  68. .use-out a.active{color:#2977ff;border-bottom:3px solid #2977ff}
  69. .table-box table th,.table-box td{text-align:center;}
  70. .page-div{text-align:right;}
  71. .page-div a{display:inline-block;width:20px;height:20px;text-align:center;line-height:20px;background:#999;color:#fff;cursor:pointer;}
  72. .page-div a:hover{background:#666;}
  73. .page-div span{margin:0 10px;}
  74. .layui-layer-page .layui-layer-content{overflow-x:hidden;}
  75. .out-count-div{display:inline-block;}
  76. .out-count-div a{display:inline-block;width:20px;height:20px;text-align:center;line-height:20px; background:#999;color:#fff;cursor:pointer}
  77. .out-count-div a:hover{background:#666;}
  78. .out-count-div span{margin-left:10px;}
  79. </style>
  80. </head>
  81. <body>
  82. <div class="use-out clearfix">
  83. <a class="<?php echo ($useOutType == 'use')?'active':'';?> fl" href="javascript:;" type="use">销售出库</a>
  84. <a href="javascript:;" class="<?php echo ($useOutType == 'out')?'active':'';?> fl" type="out">销售退库</a>
  85. </div>
  86. <div class="ims-box">
  87. <form action="<?php echo Yii::app()->createUrl('imsStore/deliveryOut'); ?>" method="get">
  88. <div class="screen clearfix">
  89. <div class="diy_select select-isUse">
  90. <input type="hidden" id="isUse" name="isUse" class="diy_select_input" value="0">
  91. <div class="diy_select_txt pm_status_txt">请选择状态</div>
  92. <div class="diy_select_btn"></div>
  93. <ul class="diy_select_list pm_status" style="display: none;">
  94. <li val="0">请选择状态</li>
  95. <li val="1">待确认</li>
  96. <li val="2">已确认</li>
  97. </ul>
  98. </div>
  99. <div class="diy_select select-itemId">
  100. <input type="hidden" id="itemId" name="itemId" class="diy_select_input" value="0">
  101. <div class="diy_select_txt pm_name_txt">请选择品目名称</div>
  102. <div class="diy_select_btn"></div>
  103. <ul class="diy_select_list pm_name" style="display: none;">
  104. <li val="0">请选择品目名称</li>
  105. <?php foreach ($itemList as $key => $value): ?>
  106. <li val="<?php echo $value['itemId']; ?>"><?php echo $value['itemName']; ?></li>
  107. <?php endforeach; ?>
  108. </ul>
  109. </div>
  110. <div class="date">
  111. <span>发货时间:</span>
  112. <input type="text" readonly name="startDate" class="some_class" value="" id="some_class_1"/> --
  113. <input type="text" readonly name="endDate" class="some_class" value="" id="some_class_2"/>
  114. </div>
  115. <button type="submit" class="label-primary-s bth-s">搜索</button>
  116. <!-- <button type="button" class="label-primary-s bth-s add_out_order">新增退库单</button>-->
  117. </div>
  118. </form>
  119. <div class="table-box ">
  120. <table id="record-table"
  121. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  122. style="font-size:12px">
  123. <thead>
  124. <tr>
  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 (isset($pmDataList['list']) && $pmDataList['list']): ?>
  137. <?php foreach ($pmDataList['list'] as $key => $value): ?>
  138. <?php
  139. if (isset($value['inputDetails']) && isset($value['inputDetails'][0])) {
  140. $inputDetails = $value['inputDetails'][0];
  141. }
  142. ?>
  143. <tr>
  144. <td><?php echo $value['inCode']; ?></td>
  145. <td><?php echo isset($inputDetails['itemName']) ? $inputDetails['itemName'] : ''; ?></td>
  146. <td><?php echo isset($inputDetails['arriveNo']) ? $inputDetails['arriveNo'] : ''; ?></td>
  147. <td><a href="#" inId="<?php echo $value['inId'] ?>" class="viewStudent"><?php echo isset($inputDetails['arriveNo']) ? $inputDetails['arriveNo'] : ''; ?></a></td>
  148. <td><?php echo isset($value['oraNo']) ? $value['oraNo'] : '-'; ?></td>
  149. <td><?php echo isset($value['orderNo']) ? $value['orderNo'] : '-'; ?></td>
  150. <td class="red"><?php echo isset($value['statusDesc'])? $value['statusDesc'] : '-'?></td>
  151. <td>
  152. <?php if($value['inputStatus']==0):?>
  153. <!-- <a href="--><?php //echo $this->createUrl('imsStore/deliveryOutView', array('inId' => $value['inId'])); ?><!--" class="get-btn" inId="--><?php //echo $value['inId'] ?><!--">查看</a>-->
  154. <a href="javascript:;" class="send-btn" inId="<?php echo $value['inId'] ?>">确认退库</a>
  155. <?php endif; ?>
  156. </td>
  157. </tr>
  158. <?php endforeach; ?>
  159. <?php endif; ?>
  160. </tbody>
  161. </table>
  162. <?php if ($pmDataList): ?>
  163. <div class="col-sm-12">
  164. <ul class="pagination">
  165. <?php
  166. $params = array();
  167. if (isset($_GET['isUse']) && $_GET['isUse']) {
  168. $params['isUse'] = $_GET['isUse'];
  169. }
  170. if (isset($_GET['itemId']) && $_GET['itemId']) {
  171. $params['itemId'] = $_GET['itemId'];
  172. }
  173. if (isset($_GET['startDate']) && $_GET['startDate']) {
  174. $params['startDate'] = $_GET['startDate'];
  175. }
  176. if (isset($_GET['endDate']) && $_GET['endDate']) {
  177. $params['endDate'] = $_GET['endDate'];
  178. }
  179. if (isset($_GET['page'])) {
  180. $params['page'] = $_GET['page'];
  181. } else {
  182. $params['page'] = 1;
  183. }
  184. echo formatPage($pmDataList, 'imsStore/deliveryout', $params);
  185. ?>
  186. </ul>
  187. </div>
  188. <?php endif; ?>
  189. </div>
  190. </div>
  191. <!--二维码-->
  192. <div class="qrcode-fram" style="display: none">
  193. <div id="qrcode" style="width:100px; height:100px;margin: 10px auto"></div>
  194. <p>手机扫描二维码,到手机浏览器打开签字链接</p>
  195. </div>
  196. <!-- 关联正式订单弹层 -->
  197. <div class="layer-relate" style="display: none">
  198. <div class="layer-filter"></div>
  199. <table class="order-table table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  200. style="font-size:12px">
  201. <thead>
  202. <tr>
  203. <th>班级</th>
  204. <th>学生姓名</th>
  205. </tr>
  206. </thead>
  207. <tbody>
  208. </tbody>
  209. </table>
  210. <div class="col-sm-12">
  211. <a href="#" class="prev">上一页</a>
  212. <span class="now_page">1</span>/<span class="last_page">1</span>
  213. <a href="#" class="next">下一页</a>
  214. <input type="hidden" name="inId" value="0">
  215. </div>
  216. </div>
  217. <script src="/js/productset/jquery.min.js"></script>
  218. <script src="/js/ims/jquery.datetimepicker.js"></script>
  219. <script src="/js/layer/layer.js"></script>
  220. <script src="/js/ims/xsgl.js"></script>
  221. <script type="text/javascript" src="/js/ims/qrcode.min.js"></script>
  222. <script>
  223. $(document).ready(function () {
  224. <?php if (isset($_GET['startDate'])):?>
  225. $("#some_class_1").attr("value", "<?php echo $_GET['startDate']?>");
  226. $("#some_class_2").attr("value", "<?php echo $_GET['endDate']?>");
  227. <?php endif;?>
  228. <?php if(isset($_GET['isUse'])):?>
  229. var isUse = "<?php echo $_GET['isUse'];?>";
  230. $('#isUse').val(isUse);
  231. var txt = $('.select-isUse li[val=' + isUse + ']').html();
  232. $('.select-isUse .diy_select_txt').html(txt);
  233. <?php endif;?>
  234. <?php if(isset($_GET['itemId']) && $_GET['itemId'] != ''):?>
  235. var itemId = "<?php echo $_GET['itemId'];?>";
  236. $('#itemId').val(itemId);
  237. var txt = $('.select-itemId li[val=' + itemId + ']').html();
  238. $('.select-itemId .diy_select_txt').html(txt);
  239. <?php endif;?>
  240. $('.some_class').datetimepicker({
  241. format: "Y-m-d", //格式化日期
  242. timepicker: false //关闭时间选项
  243. });
  244. //初始化状态
  245. var currStatus = "<?php echo isset($_GET['status']) ? $_GET['status'] : '';?>";
  246. if (currStatus > 0) {
  247. var statusText = $(".pm_status>li[val='" + currStatus + "']").text();
  248. $(".pm_status_txt").text(statusText);
  249. }
  250. //初始化品目
  251. var currPmId = "<?php echo isset($_GET['itemId']) ? $_GET['itemId'] : '';?>";
  252. if (currPmId > 0) {
  253. var pmNameText = $(".pm_name>li[val='" + currPmId + "']").text();
  254. $(".pm_name_txt").text(pmNameText);
  255. }
  256. //确认退库
  257. $(".send-btn").on("click", function () {
  258. var inId = $(this).attr('inId');
  259. layer.open({
  260. type: 1,
  261. title: '确认退库',
  262. btn: ['确定', '取消'],
  263. area: ['420px', '240px'], //宽高
  264. btnAlign: 'c',
  265. content: '<div class="application-number-box" style="text-align: center;color: red;"><p>确认要退库吗?</p></div>',
  266. yes: function (index, layero) {
  267. //提交
  268. $.ajax({
  269. type: 'post',
  270. url: "<?php echo Yii::app()->createUrl('imsStore/SubmitSale');?>",
  271. data: {'inId': inId},
  272. dataType: 'json',
  273. success: function (data) {
  274. if (data.status) {
  275. layer.alert("确认成功", {icon:1,closeBtn:0},function () {
  276. location.reload();
  277. })
  278. } else {
  279. layer.msg(data.msg);
  280. }
  281. }
  282. })
  283. },
  284. btn2: function (index, layero) {
  285. //取消按钮
  286. // console.log(111)
  287. //return false 开启该代码可禁止点击该按钮关闭
  288. }
  289. });
  290. return false;
  291. });
  292. //切换领用和出库
  293. $(".use-out>a").click(function () {
  294. $(this).addClass("active").siblings().removeClass("active");
  295. var index = $(this).index();
  296. var type = $(this).attr('type');
  297. var url = '';
  298. if(type == 'out'){
  299. url = "<?php echo $this->createUrl('imsStore/DeliveryOut');?>";
  300. }else{
  301. url = "<?php echo $this->createUrl('/imsStore/Delivery');?>";
  302. }
  303. window.location.href = url;
  304. // $(".ims-box").eq(index).removeClass('hidden').siblings(".ims-box").addClass('hidden');
  305. });
  306. //学生列表
  307. $(".viewStudent").on("click", function () {
  308. var inId = $(this).attr('inId');
  309. loadStudent(inId,1);
  310. return false;
  311. });
  312. });
  313. var displayAlert = true;
  314. function loadStudent(inId,page){
  315. $('.layer-relate').find('tbody').html('');
  316. $('input[name=inId]').val(inId);
  317. $.ajax({
  318. type: 'post',
  319. url: "<?php echo Yii::app()->createUrl('imsStore/AjaxSaleStudentList');?>",
  320. data: {'inId': inId,'page':page},
  321. dataType: 'json',
  322. success: function (res) {
  323. if(res.status==1){
  324. list=res.data.list;
  325. if(list.length>0){
  326. var html='';
  327. for(var i=0;i<list.length;i++){
  328. html+='<tr>';
  329. html+='<td>'+list[i]['clazzName']+'</td>';
  330. html+='<td>'+list[i]['studentName']+'</td>';
  331. html+='</tr>';
  332. }
  333. $('.layer-relate').find('tbody').html(html);
  334. }
  335. $('.last_page').html(res.data['lastPage']);
  336. $('.now_page').html(res.data['pageNum']);
  337. if(page==1 || res.data['lastPage'] == 1){
  338. $('.prev').addClass('hide');
  339. }else{
  340. $('.prev').removeClass('hide');
  341. }
  342. if(page==res.data['lastPage']){
  343. $('.next').addClass('hide');
  344. }else{
  345. $('.next').removeClass('hide');
  346. }
  347. if(displayAlert){
  348. displayAlert = false;
  349. layer.open({
  350. type: 1,
  351. title: '学生列表',
  352. btn: ['关闭'],
  353. page:true,
  354. area: ['810px', '420px'], //宽高
  355. btnAlign: 'c',
  356. content: $('.layer-relate'),
  357. yes: function (index, layero) {
  358. layer.closeAll();
  359. displayAlert = true;
  360. }
  361. });
  362. }
  363. }
  364. }
  365. });
  366. $('.prev').click(function(){
  367. var now_page=parseInt($('.now_page').html());
  368. if(now_page<=1){
  369. return false;
  370. }
  371. var idId=$('input[name=inId]').val();
  372. loadStudent(idId,(now_page-1));
  373. });
  374. // $('.next').click(function(){
  375. // var now_page=parseInt($('.now_page').html());
  376. // var last_page=parseInt($('.last_page').html());
  377. // if(now_page>=last_page){
  378. // return false;
  379. // }
  380. // var idId=$('input[name=inId]').val();
  381. // loadStudent(idId,(now_page+1));
  382. // });
  383. $('.prev').off("click").on('click',function(){
  384. var now_page=parseInt($('.now_page').html());
  385. if(now_page<=1){
  386. return false;
  387. }
  388. var idId=$('input[name=inId]').val();
  389. loadStudent(idId,(now_page-1));
  390. })
  391. $('.next').off("click").on('click',function(){
  392. var now_page=parseInt($('.now_page').html());
  393. var last_page=parseInt($('.last_page').html());
  394. if(now_page>=last_page){
  395. return false;
  396. }
  397. var idId=$('input[name=inId]').val();
  398. loadStudent(idId,(now_page+1));
  399. })
  400. }
  401. //增加出库dan
  402. $(".add_out_order").click(function () {
  403. var url = window.location.href = "<?php echo $this->createUrl('imsStore/deliveryOutAdd');?>";
  404. });
  405. //删除
  406. $(".del-btn").on("click", function () {
  407. var inId = $(this).attr('inId');
  408. layer.confirm('您确定删除吗?', {
  409. btn: ['确定', '取消'] //按钮
  410. }, function () {
  411. $.ajax({
  412. type: 'post',
  413. url: "<?php echo Yii::app()->createUrl('imsStore/ajaxDelIn');?>",
  414. data: {'inId': inId},
  415. dataType: 'json',
  416. success: function (data) {
  417. if (data.status) {
  418. layer.alert("删除成功", {icon:1,closeBtn:0},function () {
  419. location.reload();
  420. })
  421. } else {
  422. layer.alert(data.msg, {icon: 7});
  423. }
  424. },
  425. error: function () {
  426. layer.msg("网络异常");
  427. }
  428. })
  429. });
  430. });
  431. </script>
  432. </body>
  433. </html>