repairOrder.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. $orderStatus = array(0=>'待提交',1=>'待派单',2=>'维修中',3=>'已完成',4=>'已关闭');
  3. $isGoods = array(0=>'已修好',1=>'未修好',2=>'接单人申请维修好');
  4. $allocationType = array(0=>'内部派单',1=>'外部派单');
  5. $priority_arr = array(1=>'紧急维修',2=>'巡检');
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta charset="utf-8">
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  12. <title>维修工单</title>
  13. <meta name="description" content="">
  14. <meta name="keywords" content="">
  15. <link href="/css/ims/base.css" rel="stylesheet">
  16. <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
  17. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
  18. <style>
  19. .ims-box {
  20. margin: 20px;
  21. }
  22. .screen > div {
  23. margin: 0 5px;
  24. line-height: 30px;
  25. }
  26. .yellow {
  27. color: #FF9900;
  28. }
  29. .screen > input {
  30. height: 30px;
  31. border-radius: 4px;
  32. border: 1px solid #ccc;
  33. box-shadow: none;
  34. text-indent: 10px;
  35. }
  36. .screen button {
  37. padding: 4px 12px;
  38. }
  39. .table-box {
  40. margin-top: 30px;
  41. }
  42. .btn-date_show{
  43. display: inline-block;width: 170px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
  44. }
  45. .btn-review{
  46. cursor: pointer;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <div class="ims-box">
  52. <form action="<?php echo Yii::app()->createUrl('imsDevice/createRepairOrder');?>" method="get">
  53. <div class="screen">
  54. <button type="submit" class="label-primary-s bth-s">+ 新增工单</button>
  55. </div>
  56. </form>
  57. <div class="table-box">
  58. <table id="intention-table"
  59. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  60. style="font-size:12px">
  61. <thead>
  62. <tr>
  63. <th>工单号</th>
  64. <th>工单标题</th>
  65. <th>维修品目</th>
  66. <th>品目编号</th>
  67. <th>品目类型</th>
  68. <th>规格</th>
  69. <th>预约维修日期</th>
  70. <th>工单类型</th>
  71. <th>状态</th>
  72. <th>是否修好</th>
  73. <th>派单类型</th>
  74. <th>派单时间</th>
  75. <th>接单人员</th>
  76. <th>维修方式</th>
  77. <th>提交人</th>
  78. <th>操作</th>
  79. </tr>
  80. </thead>
  81. <tbody>
  82. <?php if ($list):?>
  83. <?php foreach ($list as $item):?>
  84. <tr>
  85. <td><?php echo $item['code'];?></td>
  86. <td><?php echo $item['title'];?></td>
  87. <td><?php echo isset($item['itemName'])?$item['itemName']:'';?></td>
  88. <td><?php echo isset($item['fixedCode'])?$item['fixedCode']:'';?></td>
  89. <td><?php echo isset($item['itemType'])?$item['itemType']:'';?></td>
  90. <td><?php echo isset($item['itemSpec'])?$item['itemSpec']:'';?></td>
  91. <td><?php echo $item['reserveTime'];?></td>
  92. <td class="use-type" status="<?php echo $item['priority'];?>"><?php echo isset($priority_arr[$item['priority']])?$priority_arr[$item['priority']]:'';?></td>
  93. <td><?php echo isset($orderStatus[$item['orderStatus']])?$orderStatus[$item['orderStatus']]:'';?></td>
  94. <td><?php echo isset($item['isGoods'])?(isset($isGoods[$item['isGoods']])?$isGoods[$item['isGoods']]:''):'';?></td>
  95. <td><?php echo isset($item['allocationType'])?(isset($allocationType[$item['allocationType']])?$allocationType[$item['allocationType']]:''):'';?></td>
  96. <td><?php echo isset($item['allocationTime'])?$item['allocationTime']:'';?></td>
  97. <td><?php echo isset($item['userName'])?$item['userName']:'';?></td>
  98. <td><?php echo $item['repairType']==0 ? '远程': '上门';?></td>
  99. <td><?php echo $item['createName'];?></td>
  100. <td>
  101. <?php if($item['orderStatus'] == 0):?>
  102. <a onclick="submitOrder('<?php echo $item['id'];?>')" class="btn-review">确认提交</a>
  103. <a href="<?php echo $this->createUrl('imsDevice/editRepairOrder',array('id'=>$item['id']));?>" class="btn-review">编辑</a>
  104. <?php endif;?>
  105. <?php if($item['orderStatus'] == 1 || $item['orderStatus']==4):?>
  106. <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
  107. <?php endif;?>
  108. <?php if($item['orderStatus'] == 2):?>
  109. <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
  110. <a href="<?php echo $this->createUrl('imsDevice/repairRecord',array('rCode'=>$item['code']));?>" class="btn-review">维修记录</a>
  111. <a onclick="confirmResult('<?php echo $item['id'];?>')" class="btn-review">确认结果</a>
  112. <?php endif;?>
  113. <?php if($item['orderStatus'] == 3):?>
  114. <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
  115. <a href="<?php echo $this->createUrl('imsDevice/repairRecord',array('rCode'=>$item['code']));?>" class="btn-review">维修记录</a>
  116. <?php endif;?>
  117. </td>
  118. </tr>
  119. <?php endforeach;?>
  120. <?php endif; ?>
  121. </tbody>
  122. </table>
  123. <?php if ($page): ?>
  124. <div class="col-sm-12">
  125. <ul class="pagination">
  126. <?php
  127. $params = array();
  128. if (isset($_GET['page'])) {
  129. $params['page'] = $_GET['page'];
  130. }else{
  131. $params['page'] = 1;
  132. }
  133. echo formatPage($page, 'imsDevice/repairOrder', $params)
  134. ?>
  135. </ul>
  136. </div>
  137. <?php endif; ?>
  138. </div>
  139. </div>
  140. <script src="/js/productset/jquery.min.js"></script>
  141. <script src="/js/ims/xsgl.js"></script>
  142. <script src="/js/layer/layer.js"></script>
  143. <script>
  144. $(document).ready(function () {
  145. function useType() {
  146. $(".use-type").each(function (index) {
  147. if ($(this).attr('status') == 1) {
  148. $(this).addClass("yellow");
  149. } else if ($(this).attr('status') == 2) {
  150. $(this).addClass("red");
  151. }else {
  152. $(this).addClass("green");
  153. }
  154. })
  155. }
  156. useType();
  157. });
  158. //确认提交
  159. function submitOrder(id) {
  160. layer.confirm('确认提交工单?', {
  161. btn: ['确定','取消'] //按钮
  162. }, function(){
  163. $.ajax({
  164. url: "<?php echo $this->createUrl('imsDevice/confirmSubmit?id=');?>" + id,
  165. type: "post",
  166. dataType: "json",
  167. success: function (data) {
  168. if (data.status === 1) {
  169. layer.alert("操作成功", {icon: 1,closeBtn:0}, function () {
  170. location.reload();
  171. })
  172. }else {
  173. layer.msg(data.msg);
  174. }
  175. }
  176. });
  177. });
  178. }
  179. //确认维修结果
  180. function confirmResult(id) {
  181. layer.confirm('维修结果:已修好,可正常使用<br><p style="color: red;">确认后,工单关闭,不可取消</p>', {
  182. btn: ['确定','取消'] //按钮
  183. }, function(){
  184. $.ajax({
  185. url: "<?php echo $this->createUrl('imsDevice/confirmResult?id=');?>" + id,
  186. type: "post",
  187. dataType: "json",
  188. success: function (data) {
  189. if (data.status === 1) {
  190. layer.alert("操作成功", {icon: 1,closeBtn:0}, function () {
  191. location.reload();
  192. })
  193. }else {
  194. layer.msg(data.msg);
  195. }
  196. }
  197. });
  198. });
  199. }
  200. </script>
  201. </body>
  202. </html>