info.php 11.9 KB
<?php

use yii\helpers\Url;
use app\ht\helpers\CssFiles;
use domain\trade\workorder\WorkOrderStatus;

$this->title = '工单详情';
$this->params['breadcrumbs'][] = '工单管理';
$this->params['breadcrumbs'][] = ['label' => '工单列表', 'url' => ['/trade/work-order/index']];
$this->params['breadcrumbs'][] =  $this->title;

CssFiles::register($this, 'exts/showimg/css/showimg.css');
$markTag = false;
$is_finished_tag = 0;
if (isset($is_finished)) {
    // 如果有回访记录提交,回访完成,则标记为1,未完成,则标记为2
    $is_finished_tag = ($is_finished == 1) ? 1 : 2 ;
}
?>
<style>
    .checkout_m{float: left;margin-right: 8px !important;}
    .checkLabel{margin-right:40px}
    .actionBtn{cursor: pointer }
    .jumper{margin-left:20px}

    .content-wrap .content-edit-ready{float: right;}
    .content-wrap .content-show{width: 80%;float: left!important;}
    .content-edit-ready{width: 20%;}
    .fake-textarea{
        padding: 10px 15px;
        border: 1px solid #CCCCCC;
        color: #777777;
        font-size: 14px;
        cursor: text;
        border-radius: 4px;
        text-align: left;
        width: 49%;
    }
    .content-show-textarea{width: 80%;height: 80px;}
    textarea {border-radius: 4px;}
    .ready-editor{display: none;}
    .select-div {
        display: inline-block;
        float: left;
        margin-right: 10px;
        margin-bottom:5px;
        color: #FFFFFF;
        border-radius: 5px;
        padding: 5px 10px 5px 10px;
        /*background-color: #F4F4F4*/
    }
    .select-div:hover {
        cursor: pointer;
    }
    .select-div input {
        display: none;
    }
    .select-div span {
        text-align: center;
    }
</style>
<div class="panel panel-default">
    <div id="warning"></div>
    <input type="hidden" value="<?=$order['id'] ?>" name="order_id" id="order_id" >
    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
                <td colspan="6" class="bg-info">订单信息</td>
            </tr>
            <tr>
                <th width="10%">订单号</th>
                <td width="20%"><?=$order['order_no']; ?></td>
                <th width="10%">订单状态</th>
                <td width="20%"><?= WorkOrderStatus::label($order['status']); ?></td>
                <th width="10%">支付单号</th>
                <td width="20%"><?=$order['pay_no']; ?></td>
            </tr>
            <tr>
                <th>工程师姓名</th>
                <td><?=$order['realname']; ?></td>
                <th>工程师昵称</th>
                <td><?=$order['nickname']; ?></td>
                <th>工程师电话</th>
                <td><?= $order['phone'] ?></td>
            </tr>
            <tr>
                <th>支付时间</th>
                <td><?php if (!empty($order['pay_at'])) {
                        echo Yii::$app->formatter->asTime($order['pay_at'],"yyyy-MM-dd HH:mm:ss");
                        ?>

                    <?php }else{ ?>
                        暂无时间
                    <?php }?>
                </td>

                <th>用工类型</th>
                <td><?=$order['employ_type']; ?></td>
                <th>用工人数</th>
                <td><?= $order['employ_num'] ?></td>
            </tr>
            <tr>
                <th>用工地址</th>
                <td>
                    <?= $order['address'] . "(" . $order['address_title'] . ")" ?>
                </td>
                <th>结算方式</th>
                <td><?= $order["pay_type"] == 1 ? "按天" : "按小时" ?></td>

                <th>是否支付</th>
                <td><?= $order["has_pay"] == 1 ? "已支付" : "未支付" ?></td>
            </tr>
            <tr>
                <th>单位时间用工费用</th>
                <td><?=$order['pay_unit_fee']; ?></td>

                <th>单位服务费金额</th>
                <td><?=$order['service_unit_fee']; ?></td>

                <th>服务费金额</th>
                <td><?=$order['service_fee']; ?></td>
            </tr>
            <tr>
                <th>实付服务费金额</th>
                <td>
                    <?=$order['pay_service_fee']; ?> </span>
                </td>
                <th>备注</th>
                <td colspan="3"> <?=$order['remark'];?> </td>
            </tr>
            <tr>
                <th>是否已派单</th>
                <td>
                    <?= $order["has_dispatch"] == 1 ? "已派单" : "未派单" ?>
                </td>
                <th>派单工程师</th>
                <td><?= $order["dispatch_engineer_count"] ?></td>

                <th>工单用人时间</th>
                <td><?=date("Y-m-d H:i:s", $order['start_at']) ?> 至 <?=date("Y-m-d H:i:s", $order['end_at']) ?></td>
            </tr>
            <tr>
                <th>订单操作</th>
                <td colspan="5"></td>
            </tr>
        </table>
    </div>

    <div class="panel-body">
        <table class="table table-bordered text-center">
            <tr>
                <td colspan="4" class="bg-info text-left">接单工程师</td>
            </tr>
            <tr>
                <th class="text-center" width="25%">工程师姓名</th>
                <th class="text-center" width="25%">工程师昵称</th>
                <th class="text-center" width="25%">工程师手机号码</th>
                <th class="text-center" width="25%">接单时间</th>
            </tr>
            <?php
            if ($engineers){
                foreach($engineers as $engineer): ?>
                    <tr>
                        <td class="text-left"><?=$engineer['realname'] ?></td>
                        <td class="text-left" ><?=$engineer['nickname'] ?></td>
                        <td><?=$engineer['phone'] ?></td>
                        <td><?=date("Y-m-d H:i:s", $engineer['created_at']) ?></td>
                    </tr>
                <?php endforeach;
            }else{
                ?>
                <tr><td colspan="4" >暂无接单工程师</td></tr>
                <?php
            }
            ?>
        </table>
    </div>

    <div class="panel-body form-inline">
        <table class="table" style="border-top:none;">
            <tr>
                <td class="col-sm-6" style="vertical-align: top">
                    <table class="table table-bordered">
                        <tr>
                            <td class="bg-info">后台备注</td>
                        </tr>
                        <tr>
                            <td width="100%"><textarea class="form-control" style="width:100%;" rows="3" id="remark" name="remark"></textarea></td>
                        </tr>
                        <tr class="text-center">
                            <td>
                                <button type="button" class="btn btn-primary ladda-button" data-style="slide-up" id="save">提交备注</button>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="col-sm-6" style="vertical-align: top">
                    <table class="table table-bordered">
                        <tr>
                            <td colspan="3" class="bg-info">操作日志</td>
                        </tr>
                        <tr>
                            <th width="112" >操作时间</th>
                            <th width="130" >操作人员</th>
                            <th >操作内容</th>
                        </tr>
                        <?php  foreach($logs as $log): ?>
                            <tr>
                                <td><?=Yii::$app->formatter->asTime($log['log_at'],"yyyy-MM-dd HH:mm:ss"); ?></td>
                                <td><?=$log['operator_user'] ?></td>
                                <td><?=$log['content'] ?></td>
                            </tr>
                        <?php endforeach; ?>

                    </table>
                </td>
            </tr>
        </table>
    </div>

</div>
<div class="modal fade" id="phoneModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">修改联系电话</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <input type="text" class="form-control" id="changePhoneNumber" placeholder="例如 1380038000">
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="phoneSubmitBtn">提交</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<script type="text/javascript" src="<?=Url::toRoute('/exts/showimg/js/showimg.js')?>" ></script>
<script src="<?=Yii::$app->request->baseUrl?>/exts/base/1.0.0/ui/kindeditor/kindeditor-all-min.js"></script>
<link rel="stylesheet" href="<?=Yii::$app->request->baseUrl?>/exts//base/1.0.0/ui/kindeditor/themes/simple/simple.css" />

<script type="text/javascript">
    var kinditerArry = new Array();
    function createMoreEditor(id) {
        if (kinditerArry.hasOwnProperty(id)) {
            kinditerArry[id].remove();
        }

        kinditerArry[id] = KindEditor.create('#content-show-textarea-' + id, {
            allowFileManager : true,
            themeType : 'simple',
            minWidth : '432px',
            filterMode: false, // 允许输入任何代码(不做过滤)
            items : [
                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',  'gallery', '|',
                'table', 'hr', 'pagebreak',
                'anchor', 'link', 'unlink'
            ],
            uploadJson : '<?= Url::toRoute(['/site/editor-upload']) ?>',
            formatUploadUrl: false,
            baseUrl: '<?= Yii::$app->request->baseUrl ?>'
        });
    }
</script>

<script>
    $(document).ready(function () {
        $("#save").bind("click", function () {
            var id = $("#order_id").val();
            var remark = $("#remark").val();
            if (remark == null || remark == ""){
                alert("请填写备注内容");
                return false;
            }
            if (id == null || id == ""){
                alert("丢失标记信息,无法提交备注");
                return false;
            }
            var l = $.ladda(this);
            $.ajax({
                type: "post",
                url: "do-update-remark",
                dataType:"json",
                data: $.csrf({"id":id,"remark":remark}),
                success:function(msg){
                    alert(msg['msg']);
                    if (msg['status'] == 1){
                        location.reload();
                    }else{
                    }
                },
                beforeSend: function () {
                    // 开始显示
                    l.start();
                },
                complete: function () {
                    // 取消加载提示
                    l.stop();
                },
                error:function(msg){
                }
            });
        });
    })
</script>