goodsChange.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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: #15ae68 !important;
  59. background-color: #15ae68 !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/goodsChange'); ?>" method="get">
  70. <div class="screen">
  71. <select name="seasonId" id="seasonId" style="width: 100px;">
  72. <option value="0">赛季</option>
  73. <?php
  74. if($seasonList){
  75. foreach ($seasonList as $value){
  76. if(isset($seasonId) && $seasonId==$value['seasonId']){
  77. echo '<option value="'.$value['seasonId'].'" selected>'.$value['seasonName'].'</option>';
  78. }else{
  79. echo '<option value="'.$value['seasonId'].'">'.$value['seasonName'].'</option>';
  80. }
  81. }
  82. }
  83. ?>
  84. </select>
  85. <span>创建时间:</span>
  86. <input type="text" name="begin" class="some_class" value="<?php if(isset($begin)) echo $begin;?>" id="some_class_1"/> --
  87. <input type="text" name="end" class="some_class" value="<?php if(isset($end)) echo $end;?>" id="some_class_2"/>
  88. <select name="status" id="status" style="width: 100px;">
  89. <option value="0">审批状态</option>
  90. <option value="1" <?php if(isset($status) && $status==1) echo 'selected'?>>审批中</option>
  91. <option value="2" <?php if(isset($status) && $status==2) echo 'selected'?>>已通过</option>
  92. <option value="3" <?php if(isset($status) && $status==3) echo 'selected'?>>已驳回</option>
  93. <option value="4" <?php if(isset($status) && $status==4) echo 'selected'?>>已取消</option>
  94. </select>
  95. <button type="submit" class="label-primary-s bth-s">查询</button>
  96. <a href="<?php echo $this->createUrl('imsSale/newGoodsChange')?>" class="label-primary-s bth-s">新建</a>
  97. <a href="<?php echo $this->createUrl('imsSale/searchGoodsChange')?>" class="label-primary-s bth-s">查询用于商品变更的订单</a>
  98. </div>
  99. </form>
  100. <div class="table-box">
  101. <table id="intention-table"
  102. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  103. style="font-size:12px">
  104. <thead>
  105. <tr>
  106. <th>学年</th>
  107. <th>年级</th>
  108. <th>变更类型</th>
  109. <th>商品变更</th>
  110. <th>原销售订单编号</th>
  111. <th>原财务订单号</th>
  112. <th>原商品名称</th>
  113. <th>原售价(元)</th>
  114. <th>新销售订单号</th>
  115. <th>新商品名称</th>
  116. <th>新售价</th>
  117. <th>变更人数</th>
  118. <th>创建时间</th>
  119. <th>审批状态</th>
  120. <th>操作</th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. <?php if ($list): ?>
  125. <?php foreach ($list as $item): ?>
  126. <tr>
  127. <td><?php echo $item['schoolYearName'];?></td>
  128. <td><?php echo $item['gradeStr'];?></td>
  129. <td><?php echo $item['typeStr'];?></td>
  130. <td><?php echo $item['changeTypeName'];?></td>
  131. <td><?php echo $item['oldPurposeOrderNo'];?></td>
  132. <td><?php echo $item['oldOrderNo'];?></td>
  133. <td><?php echo $item['oldGoodsName'];?></td>
  134. <td><?php echo $item['oldSellingPrice'];?></td>
  135. <td><?php echo $item['purposeOrderNo'];?></td>
  136. <td><?php echo $item['goodsName'];?></td>
  137. <td><?php echo $item['sellingPrice'];?></td>
  138. <td><?php echo $item['quantity'];?></td>
  139. <td><?php echo $item['createTime'];?></td>
  140. <td><?php echo $item['statusStr'];?></td>
  141. <td>
  142. <a href="<?php echo $this->createUrl('imsSale/viewGoodsChange',array('id'=>$item['ogcId']))?>">【查看】</a>
  143. <?php if($item['status']==0):?>
  144. <a href="javascript:;" class="btn-urge" businessKey="<?php echo $item['processInfo']['businessKey'] ?>">【催办】</a>
  145. <a href="javascript:;" class="del-stop-btn" doType="stop" businessKey="<?php echo $item['processInfo']['businessKey'] ?>">【中止】</a>
  146. <?php endif;?>
  147. <?php if($item['status']==2 || $item['status']==3):?>
  148. <!-- <a href="<?php echo $this->createUrl('imsSale/editGoodsChange',array('id'=>$item['ogcId']))?>">【重新提交】</a>-->
  149. <a href="javascript:;" class="del-stop-btn" doType="del" businessKey="<?php echo $item['processInfo']['businessKey'] ?>">【删除】</a>
  150. <?php endif;?>
  151. </td>
  152. </tr>
  153. <?php endforeach; ?>
  154. <?php endif; ?>
  155. </tbody>
  156. </table>
  157. <?php if ($page): ?>
  158. <div class="col-sm-12">
  159. <ul class="pagination">
  160. <?php
  161. $params = array();
  162. if (isset($_GET['seasonId']) && $_GET['seasonId']) {
  163. $params['seasonId'] = $_GET['seasonId'];
  164. }
  165. if (isset($_GET['begin']) && $_GET['begin']) {
  166. $params['begin'] = $_GET['begin'];
  167. }
  168. if (isset($_GET['end']) && $_GET['end']) {
  169. $params['end'] = $_GET['end'];
  170. }
  171. if (isset($_GET['status']) && $_GET['status']) {
  172. $params['status'] = $_GET['status'];
  173. }
  174. if (isset($_GET['page'])) {
  175. $params['page'] = $_GET['page'];
  176. }else{
  177. $params['page'] = 1;
  178. }
  179. echo formatPage($page, 'imsSale/goodsChange', $params);
  180. ?>
  181. </ul>
  182. </div>
  183. <?php endif; ?>
  184. </div>
  185. </div>
  186. <script src="/js/productset/jquery.min.js"></script>
  187. <script src="/js/ims/jquery.datetimepicker.js"></script>
  188. <script src="/js/ims/xsgl.js"></script>
  189. <script src="/js/layer/layer.js"></script>
  190. <script>
  191. $(document).ready(function () {
  192. $('.some_class').datetimepicker({
  193. format: "Y-m-d", //格式化日期
  194. timepicker: false //关闭时间选项
  195. });
  196. //催办
  197. $("body").on("click", ".btn-urge", function () {
  198. var flag = true;
  199. var businessKey = $(this).attr('businessKey');
  200. layer.open({
  201. type: 1,
  202. title: '催办',
  203. btn: ['确定', '取消'],
  204. area: ['600px', '400px'], //宽高
  205. btnAlign: 'c',
  206. content: '<p style="color: red;display: none;" class="alert-msg"></p><div class="urge-layer-box"><span>内容:</span><textarea rows="10" cols="60" id="urgeText" /></div>',
  207. yes: function (index, layero) {
  208. //提交
  209. var text = $('#urgeText').val();
  210. var data = {
  211. 'smeDesc': text,
  212. 'businessKey': businessKey
  213. };
  214. if ($.trim(text)) {
  215. if (flag) {
  216. flag = false;
  217. $.ajax({
  218. type: 'post',
  219. url: "<?php echo Yii::app()->createUrl('imsSale/urge');?>",
  220. data: data,
  221. dataType: 'json',
  222. success: function (data) {
  223. if (data.status) {
  224. layer.closeAll();
  225. location.reload();
  226. } else {
  227. flag = true;
  228. $('.alert-msg').html(data.msg).fadeIn();
  229. }
  230. },
  231. error: function () {
  232. flag = true;
  233. $('.alert-msg').html("异常错误").fadeIn();
  234. }
  235. });
  236. }
  237. } else {
  238. $('.alert-msg').html("请填写内容").fadeIn();
  239. }
  240. },
  241. btn2: function (index, layero) {
  242. //取消按钮
  243. console.log(111)
  244. //return false 开启该代码可禁止点击该按钮关闭
  245. }
  246. });
  247. });
  248. //出库和退库,删除和中止
  249. $(".del-stop-btn").click(function () {
  250. var businessKey = $(this).attr('businessKey');
  251. var doType = $(this).attr('doType');
  252. $.ajax({
  253. type: 'get',
  254. url: "<?php echo Yii::app()->createUrl('imsStore/ajaxOutDelStop');?>",
  255. data: {'businessKey': businessKey,doType:doType},
  256. dataType: 'json',
  257. success: function (data) {
  258. if (data.status) {
  259. layer.alert("提交成功", {icon: 1,closeBtn:0},function (index) {
  260. location.reload();
  261. layer.closeAll();
  262. });
  263. } else {
  264. layer.alert(data.msg, {icon: 7});
  265. return false;
  266. }
  267. },
  268. error: function () {
  269. layer.msg("网络异常");
  270. return false;
  271. }
  272. })
  273. });
  274. });
  275. </script>
  276. </body>
  277. </html>