allocation.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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/ace.min.css" />
  12. <style>
  13. .ims-box {
  14. margin: 20px;
  15. }
  16. .screen>div {
  17. margin-right: 30px;
  18. }
  19. .screen>span{
  20. line-height: 30px;
  21. margin-right:5px;
  22. }
  23. .screen button {
  24. padding: 4px 12px;
  25. }
  26. .table-box {
  27. margin-top: 30px;
  28. }
  29. .table-box table,
  30. .table-box table th {
  31. text-align: center;
  32. }
  33. .table>tbody>tr>td{
  34. vertical-align: middle;
  35. }
  36. .yellow{
  37. color: #FF9900;
  38. }
  39. .table-box a{
  40. color: blue
  41. }
  42. .red {
  43. color: red;
  44. }
  45. .yellow {
  46. color: #FF9900;
  47. }
  48. .ims-box {
  49. margin: 20px;
  50. }
  51. .screen > div {
  52. margin-right: 5px;
  53. }
  54. .screen button {
  55. padding: 4px 12px;
  56. }
  57. .table-box {
  58. margin-top: 30px;
  59. }
  60. .table-box table,
  61. .table-box table th {
  62. text-align: center;
  63. }
  64. .table-box button {
  65. margin-right: 5px;
  66. }
  67. .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
  68. line-height: 140px;
  69. text-align: center;
  70. }
  71. .resubmit-layer-box input {
  72. line-height: 20px;
  73. }
  74. .urge-layer-box {
  75. margin-top: 30px;
  76. margin-left: 30px;
  77. }
  78. .urge-layer-box textarea {
  79. margin-left: 15px;
  80. vertical-align: top;
  81. }
  82. .alert-msg {
  83. text-align: center;
  84. vertical-align: top;
  85. }
  86. </style>
  87. </head>
  88. <body>
  89. <div class="ims-box">
  90. <form action="<?php echo Yii::app()->createUrl('imsStore/allocation') ;?>" method="get">
  91. <div class="screen">
  92. <span class="fl">品目名称:</span>
  93. <div class="diy_select">
  94. <input type="hidden" id="itemId" name="itemId" class="diy_select_input" value="0">
  95. <div class="diy_select_txt pm_name_txt">请选择</div>
  96. <div class="diy_select_btn"></div>
  97. <ul class="diy_select_list pm_name" style="display: none;">
  98. <li val="">请选择</li>
  99. <?php foreach($itemList as $key => $value):?>
  100. <li val="<?php echo $value['itemId'];?>"><?php echo $value['itemName'];?></li>
  101. <?php endforeach;?>
  102. </ul>
  103. </div>
  104. <span class="fl">状态:</span>
  105. <div class="diy_select">
  106. <input type="hidden" id="deliveryStatus" name="deliveryStatus" class="diy_select_input" value="-1">
  107. <div class="diy_select_txt pm_status_txt">请选择</div>
  108. <div class="diy_select_btn"></div>
  109. <ul class="diy_select_list pm_status" style="display: none;">
  110. <li val="0">请选择</li>
  111. <li val="1">待处理</li>
  112. <li val="2">待收货</li>
  113. <li val="3">已收货</li>
  114. <li val="4">待打印面单</li>
  115. <li val="5">待拣货</li>
  116. <li val="6">待托运</li>
  117. <li val="7">待发货</li>
  118. <li val="8">已取消</li>
  119. <li val="9">凭据待审核</li>
  120. <li val="10">凭据不通过</li>
  121. <li val="12">凭据已取消</li>
  122. </ul>
  123. </div>
  124. <span class="fl">开始时间:</span>
  125. <input type="text" readonly name="startDate" class="some_class" value="" id="some_class_1"/>
  126. <span >结束时间:</span>
  127. <input type="text" readonly name="endDate" class="some_class" value="" id="some_class_2"/>
  128. <button type="submit" class="label-primary-s bth-s">搜索</button>
  129. <button type="button" class="label-primary-s bth-s create-allocation">+耗材申请</button>
  130. </div>
  131. </form>
  132. <div class="table-box ">
  133. <table id="record-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  134. <thead>
  135. <tr>
  136. <th>调拨单编号</th>
  137. <th>调拨单标题</th>
  138. <th>品目名称</th>
  139. <th>申请数量</th>
  140. <th>申请人</th>
  141. <th>申请到货时间</th>
  142. <th>物流状态</th>
  143. <th>审批状态</th>
  144. <th>发货数量</th>
  145. <th>到货数量</th>
  146. <th>合格数量</th>
  147. <th>记账数量</th>
  148. <th>不合格数量</th>
  149. <th>操作</th>
  150. </tr>
  151. </thead>
  152. <tbody>
  153. <?php
  154. if($list){
  155. foreach ($list as $value){
  156. $pmCount= count($value['details']);
  157. if(!$pmCount){
  158. ?>
  159. <tr>
  160. <td ><?php echo $value['atCode'];?></td>
  161. <td ><?php echo $value['atTitle'];?></td>
  162. <td></td>
  163. <td></td>
  164. <td ><?php echo $value['userName'];?></td>
  165. <td ><?php echo date('Y/m/d',strtotime($value['arriveDate']));?></td>
  166. <!-- 状态-->
  167. <td class="yellow"></td>
  168. <td class="yellow"><?php echo $value['statusName']?></td>
  169. <td></td>
  170. <td></td>
  171. <td></td>
  172. <td></td>
  173. <td></td>
  174. <td >
  175. <a href="<?php echo $this->createUrl('imsStore/allocationViewDetail', array('atId' => $value['atId'])); ?>" class="" atId="<?php echo $value['atId'] ?>">查看</a>
  176. <?php
  177. if(isset($value['processInfo']))
  178. $processInfo = $value['processInfo'];
  179. ?>
  180. <?php if(isset($processInfo['showUrge']) && $processInfo['showUrge']):?>
  181. <a href="javascript:;" class="btn-urge" businessKey="<?php echo $processInfo['businessKey'] ?>">催办</a>
  182. <?php endif;?>
  183. <?php if(isset($processInfo['showReset']) && $processInfo['showReset']):?>
  184. <a href="<?php echo $this->createUrl('imsStore/applyallocation', array('atId' => $value['atId'])); ?>" class="" atId="<?php echo $value['atId'] ?>">编辑</a>
  185. <?php endif;?>
  186. <?php if(isset($processInfo['showDelete']) && $processInfo['showDelete']):?>
  187. <a href="javascript:;" class="del-stop-btn" doType="del" businessKey="<?php echo $processInfo['businessKey'] ?>">删除</a>
  188. <?php endif;?>
  189. <?php if(isset($processInfo['showStop']) && $processInfo['showStop']):?>
  190. <a href="javascript:;" class="del-stop-btn" doType="stop" businessKey="<?php echo $processInfo['businessKey'] ?>">中止</a>
  191. <?php endif;?>
  192. <?php if($value['status']==1 && $value['details'][0]['deliveryStatus']==0):?>
  193. <a href="javascript:;" class="cancel-allocation-btn" atId="<?php echo $value['atId'] ?>">取消调拨</a>
  194. <?php endif;?>
  195. </td>
  196. </tr>
  197. <?php
  198. }else{
  199. $isFirst = false;
  200. foreach($value['details'] as $v){
  201. ?>
  202. <tr>
  203. <?php if(!$isFirst):?>
  204. <td rowspan="<?php echo $pmCount;?>"><?php echo $value['atCode'];?></td>
  205. <td rowspan="<?php echo $pmCount;?>"><?php echo $value['atTitle'];?></td>
  206. <?php endif;?>
  207. <td><?php echo $v['itemName'];?></td>
  208. <td><?php echo $v['applyNo'];?></td>
  209. <?php if(!$isFirst):?>
  210. <td rowspan="<?php echo $pmCount;?>"><?php echo $value['userName'];?></td>
  211. <td rowspan="<?php echo $pmCount;?>"><?php echo date('Y/m/d',strtotime($value['arriveDate']));?></td>
  212. <?php endif;?>
  213. <!-- 状态-->
  214. <td class="yellow"><?php echo $v['deliveryStatusName']?></td>
  215. <td class="yellow"><?php echo $value['statusName']?></td>
  216. <td><?php echo $v['no'];?></td>
  217. <td><?php echo $v['arriveNo'];?></td>
  218. <td><?php echo $v['qualifiedNo'];?></td>
  219. <td><?php echo $v['tallyNo'];?></td>
  220. <td><?php echo $v['scrapNo'];?></td>
  221. <?php if(!$isFirst):?>
  222. <td rowspan="<?php echo $pmCount?>">
  223. <a href="<?php echo $this->createUrl('imsStore/allocationViewDetail', array('atId' => $value['atId'])); ?>" class="" atId="<?php echo $value['atId'] ?>">查看</a>
  224. <?php if($value['showDelivery']==1 && $schoolName==$value['deliverName'] ):?>
  225. <a href="<?php echo $this->createUrl('imsStore/deliverGoods',array('atId'=>$value['atId']));?>">发货</a>
  226. <?php else:?>
  227. <?php if(!$isFirst && in_array($v['deliveryStatus'],array(1,2,8,9,11))):?>
  228. <?php if($value['showReceive']):?>
  229. <a href="<?php echo $this->createUrl('imsStore/allocationView',array('atId'=>$value['atId'],'showReceive'=>$value['showReceive']));?>">查看物流</a>
  230. <?php else:?>
  231. <a href="<?php echo $this->createUrl('imsStore/allocationView',array('atId'=>$value['atId']));?>">查看物流</a>
  232. <?php endif;?>
  233. <?php endif;?>
  234. <?php endif;?>
  235. <?php
  236. if(isset($value['processInfo']))
  237. $processInfo = $value['processInfo'];
  238. ?>
  239. <?php if(isset($processInfo['showUrge']) && $processInfo['showUrge']):?>
  240. <a href="javascript:;" class="btn-urge" businessKey="<?php echo $processInfo['businessKey'] ?>">催办</a>
  241. <?php endif;?>
  242. <?php if(isset($processInfo['showReset']) && $processInfo['showReset']):?>
  243. <a href="<?php echo $this->createUrl('imsStore/applyallocation', array('atId' => $value['atId'])); ?>" class="" atId="<?php echo $value['atId'] ?>">编辑</a>
  244. <?php endif;?>
  245. <?php if(isset($processInfo['showDelete']) && $processInfo['showDelete']):?>
  246. <a href="javascript:;" class="del-stop-btn" doType="del" businessKey="<?php echo $processInfo['businessKey'] ?>">删除</a>
  247. <?php endif;?>
  248. <?php if(isset($processInfo['showStop']) && $processInfo['showStop']):?>
  249. <a href="javascript:;" class="del-stop-btn" doType="stop" businessKey="<?php echo $processInfo['businessKey'] ?>">中止</a>
  250. <?php endif;?>
  251. <?php if($value['status']==1 && $value['details'][0]['deliveryStatus']==0):?>
  252. <a href="javascript:;" class="cancel-allocation-btn" atId="<?php echo $value['atId'] ?>">取消调拨</a>
  253. <?php endif;?>
  254. </td>
  255. <?php endif;?>
  256. </tr>
  257. <?php
  258. $isFirst = true;
  259. }
  260. }
  261. }
  262. }
  263. ?>
  264. </tbody>
  265. </table>
  266. <?php if ($page): ?>
  267. <div class="col-sm-12">
  268. <ul class="pagination">
  269. <?php
  270. $params = array();
  271. if (isset($_GET['deliveryStatus'])) {
  272. $params['deliveryStatus'] = $_GET['deliveryStatus'];
  273. }
  274. if (isset($_GET['itemId'])) {
  275. $params['itemId'] = $_GET['itemId'];
  276. }
  277. if (isset($_GET['page'])) {
  278. $params['page'] = $_GET['page'];
  279. }else{
  280. $params['page'] = 1;
  281. }
  282. echo formatPage($page, 'imsStore/allocation', $params);
  283. ?>
  284. </ul>
  285. </div>
  286. <?php endif; ?>
  287. </div>
  288. </div>
  289. <script src="/js/productset/jquery.min.js"></script>
  290. <script src="/js/ims/xsgl.js"></script>
  291. <script src="/js/ims/jquery.datetimepicker.js"></script>
  292. <link rel="stylesheet" type="text/css" href="/css/ims/jquery.datetimepicker.css"/>
  293. <?php include_once '_useOutJs.php'?>
  294. <script>
  295. $(document).ready(function() {
  296. //初始化状态
  297. var currStatus = "<?php echo isset($_GET['deliveryStatus'])?$_GET['deliveryStatus']:0;?>";
  298. if(currStatus){
  299. var statusText = $(".pm_status>li[val='"+currStatus+"']").text();
  300. $('#deliveryStatus').val(currStatus);
  301. $(".pm_status_txt").text(statusText);
  302. }
  303. //初始化品目
  304. var currPmId = "<?php echo isset($_GET['itemId'])?$_GET['itemId']:'';?>";
  305. if(currPmId > 0){
  306. var pmNameText = $(".pm_name>li[val='"+currPmId+"']").text();
  307. $('#itemId').val(currPmId);
  308. $(".pm_name_txt").text(pmNameText);
  309. }
  310. <?php if (isset($_GET['startDate'])):?>
  311. $("#some_class_1").attr("value", "<?php echo $_GET['startDate']?>");
  312. $("#some_class_2").attr("value", "<?php echo $_GET['endDate']?>");
  313. <?php endif;?>
  314. $('.some_class').datetimepicker({
  315. format: "Y-m-d", //格式化日期
  316. timepicker: false //关闭时间选项
  317. });
  318. $('.create-allocation').click(function(){
  319. window.location.href='<?php echo $this->createUrl('imsStore/applyallocation')?>';
  320. });
  321. //取消调拨
  322. $('.cancel-allocation-btn').click(function(){
  323. var obj = $(this);
  324. var atId = $(this).attr('atId');
  325. layer.confirm('确认取消调拨吗?', {
  326. btn: ['确定', '取消'] //按钮
  327. }, function () {
  328. $.ajax({
  329. url: "<?php echo $this->createUrl('imsStore/cancelAllocation')?>",
  330. type: "post",
  331. dataType:'json',
  332. data: {atId:atId},
  333. success: function (res) {
  334. layer.closeAll();
  335. if (res.status == 1) {
  336. obj.remove();
  337. layer.msg('操作成功');
  338. window.location.reload()
  339. } else {
  340. if(res.msg!=undefined){
  341. layer.msg(res.msg);
  342. }else{
  343. layer.msg('操作失败');
  344. }
  345. }
  346. }
  347. });
  348. });
  349. });
  350. });
  351. </script>
  352. </body>
  353. </html>