123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <?php
- $orderStatus = array(0=>'待提交',1=>'待派单',2=>'维修中',3=>'已完成',4=>'已关闭');
- $isGoods = array(0=>'已修好',1=>'未修好',2=>'接单人申请维修好');
- $allocationType = array(0=>'内部派单',1=>'外部派单');
- $priority_arr = array(1=>'紧急维修',2=>'巡检');
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>维修工单</title>
- <meta name="description" content="">
- <meta name="keywords" content="">
- <link href="/css/ims/base.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
- <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
- <style>
- .ims-box {
- margin: 20px;
- }
- .screen > div {
- margin: 0 5px;
- line-height: 30px;
- }
- .yellow {
- color: #FF9900;
- }
- .screen > input {
- height: 30px;
- border-radius: 4px;
- border: 1px solid #ccc;
- box-shadow: none;
- text-indent: 10px;
- }
- .screen button {
- padding: 4px 12px;
- }
- .table-box {
- margin-top: 30px;
- }
- .btn-date_show{
- display: inline-block;width: 170px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
- }
- .btn-review{
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsDevice/createRepairOrder');?>" method="get">
- <div class="screen">
- <button type="submit" class="label-primary-s bth-s">+ 新增工单</button>
- </div>
- </form>
- <div class="table-box">
- <table id="intention-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px">
- <thead>
- <tr>
- <th>工单号</th>
- <th>工单标题</th>
- <th>维修品目</th>
- <th>品目编号</th>
- <th>品目类型</th>
- <th>规格</th>
- <th>预约维修日期</th>
- <th>工单类型</th>
- <th>状态</th>
- <th>是否修好</th>
- <th>派单类型</th>
- <th>派单时间</th>
- <th>接单人员</th>
- <th>维修方式</th>
- <th>提交人</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if ($list):?>
- <?php foreach ($list as $item):?>
- <tr>
- <td><?php echo $item['code'];?></td>
- <td><?php echo $item['title'];?></td>
- <td><?php echo isset($item['itemName'])?$item['itemName']:'';?></td>
- <td><?php echo isset($item['fixedCode'])?$item['fixedCode']:'';?></td>
- <td><?php echo isset($item['itemType'])?$item['itemType']:'';?></td>
- <td><?php echo isset($item['itemSpec'])?$item['itemSpec']:'';?></td>
- <td><?php echo $item['reserveTime'];?></td>
- <td class="use-type" status="<?php echo $item['priority'];?>"><?php echo isset($priority_arr[$item['priority']])?$priority_arr[$item['priority']]:'';?></td>
- <td><?php echo isset($orderStatus[$item['orderStatus']])?$orderStatus[$item['orderStatus']]:'';?></td>
- <td><?php echo isset($item['isGoods'])?(isset($isGoods[$item['isGoods']])?$isGoods[$item['isGoods']]:''):'';?></td>
- <td><?php echo isset($item['allocationType'])?(isset($allocationType[$item['allocationType']])?$allocationType[$item['allocationType']]:''):'';?></td>
- <td><?php echo isset($item['allocationTime'])?$item['allocationTime']:'';?></td>
- <td><?php echo isset($item['userName'])?$item['userName']:'';?></td>
- <td><?php echo $item['repairType']==0 ? '远程': '上门';?></td>
- <td><?php echo $item['createName'];?></td>
- <td>
- <?php if($item['orderStatus'] == 0):?>
- <a onclick="submitOrder('<?php echo $item['id'];?>')" class="btn-review">确认提交</a>
- <a href="<?php echo $this->createUrl('imsDevice/editRepairOrder',array('id'=>$item['id']));?>" class="btn-review">编辑</a>
- <?php endif;?>
- <?php if($item['orderStatus'] == 1 || $item['orderStatus']==4):?>
- <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
- <?php endif;?>
- <?php if($item['orderStatus'] == 2):?>
- <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
- <a href="<?php echo $this->createUrl('imsDevice/repairRecord',array('rCode'=>$item['code']));?>" class="btn-review">维修记录</a>
- <a onclick="confirmResult('<?php echo $item['id'];?>')" class="btn-review">确认结果</a>
- <?php endif;?>
- <?php if($item['orderStatus'] == 3):?>
- <a href="<?php echo $this->createUrl('imsDevice/viewRepairOrder',array('id'=>$item['id']));?>" class="btn-review">查看</a>
- <a href="<?php echo $this->createUrl('imsDevice/repairRecord',array('rCode'=>$item['code']));?>" class="btn-review">维修记录</a>
- <?php endif;?>
- </td>
- </tr>
- <?php endforeach;?>
- <?php endif; ?>
- </tbody>
- </table>
- <?php if ($page): ?>
- <div class="col-sm-12">
- <ul class="pagination">
- <?php
- $params = array();
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- }else{
- $params['page'] = 1;
- }
- echo formatPage($page, 'imsDevice/repairOrder', $params)
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- $(document).ready(function () {
- function useType() {
- $(".use-type").each(function (index) {
- if ($(this).attr('status') == 1) {
- $(this).addClass("yellow");
- } else if ($(this).attr('status') == 2) {
- $(this).addClass("red");
- }else {
- $(this).addClass("green");
- }
- })
- }
- useType();
- });
- //确认提交
- function submitOrder(id) {
- layer.confirm('确认提交工单?', {
- btn: ['确定','取消'] //按钮
- }, function(){
- $.ajax({
- url: "<?php echo $this->createUrl('imsDevice/confirmSubmit?id=');?>" + id,
- type: "post",
- dataType: "json",
- success: function (data) {
- if (data.status === 1) {
- layer.alert("操作成功", {icon: 1,closeBtn:0}, function () {
- location.reload();
- })
- }else {
- layer.msg(data.msg);
- }
- }
- });
- });
- }
- //确认维修结果
- function confirmResult(id) {
- layer.confirm('维修结果:已修好,可正常使用<br><p style="color: red;">确认后,工单关闭,不可取消</p>', {
- btn: ['确定','取消'] //按钮
- }, function(){
- $.ajax({
- url: "<?php echo $this->createUrl('imsDevice/confirmResult?id=');?>" + id,
- type: "post",
- dataType: "json",
- success: function (data) {
- if (data.status === 1) {
- layer.alert("操作成功", {icon: 1,closeBtn:0}, function () {
- location.reload();
- })
- }else {
- layer.msg(data.msg);
- }
- }
- });
- });
- }
- </script>
- </body>
- </html>
|