<%inherit file="base.html"/>
<%def name="head()">

</%def>
<%def name="body()">
    <div class="panel panel-default">
    <div class="panel-heading"><span class="glyphicon glyphicon-th"></span> 用户工单详情
    <div class="bar pull-right"><a href="javascript:history.go(-1);">返回</a></div>
    </div>
        <div class="panel-body">

        <div class="container">

        <h5>工单基本信息</h5>
        <table class="table ">
                <tbody>
                    <tr style="background: url(/static/img/tab_title_bg.jpg) repeat;">
                        <td width="12%">ID-${issues.id}</td>
                        <td width="10%">工单状态</td>
                        <td width="10%">
                            <span ${colors[issues.status]}>${{0:u"未处理",1: u'处理中', 2: u'挂起', 3: u'取消',4:u'处理完成'}[issues.status]}</span>
                        </td>
                        <td>用户账号</td>
                        <td><a href="/member/detail?account_number=${issues.account_number}">${issues.account_number}</a></td>
                        <td>工单类型</td>
                        <td>${{0:u'新装',1:u'故障',2:u'投诉',3:u'其他'}[issues.issues_type]}</td>
                        <td>当前操作员</td>
                        <td>${issues.assign_operator}</td>
                    </tr>
                    <tr >
                        <td>工单内容</td>
                        <td colspan="8">${issues.content}</td>
                    </tr>
                    % if issues.status in (0,1,2) and (get_cookie("opr_type") == 0 or issues.assign_operator == get_cookie("username")):
                    <tr>
                        <td colspan="9">
                            <form class="form-inline" action="/issues/assign" method="post">
                                <div class="form-group">
                                    <input type="hidden" name="issues_id" value="${issues.id}"/>
                                    <label class="sr-only" for="assign_operator">操作员</label>
                                    <select class="form-control" name="assign_operator" id="assign_operator">
                                        % for opr in oprs:
                                        <option value="${opr[0]}">${opr[1]}</option>
                                        % endfor
                                    </select>
                                </div>
                                <button type="submit" class="btn btn-default">工单转派</button>
                            </form>
                            % if msg:
                            <span class="alert alert-warning">${msg}</span>
                            % endif
                        </td>
                    </tr>
                % endif
            </tbody>

        </table>

        <h5>工单处理信息</h5>

        % for iflow in issues_flows:
        <table class="table ">

            <tbody>

            <tr style="background: url(/static/img/tab_title_bg.jpg) repeat;">
                <td width="12%">FID-${iflow.id}</td>
                <td width="10%">工单处理状态</td>
                <td width="10%">
                    <span ${colors[iflow.accept_status]}>${{1: u'处理中', 2: u'挂起', 3: u'取消',4:u'处理完成'}[iflow.accept_status]}</span>
                </td>
                <td>操作员</td>
                <td>${iflow.operator_name}</td>
                <td>处理时间</td>
                <td>${iflow.accept_time}</td>
            </tr>
            <tr>
                <td >工单处理描述</td>
                <td colspan="8">${iflow.accept_result}</td>
            </tr>

            </tbody>
        </table>
        % endfor

        % if issues.status in (0,1,2) and (get_cookie("opr_type") == 0 or issues.assign_operator == get_cookie("username")):
        % if msg:
        <div class="alert alert-warning">${msg}</div>
        % endif
        <form class="form-horizontal form-well" role="form" action="${form.action}" method="post">
            ${form.render_css()}
        </form>
        % endif
        </div>
    </div>
</div>
</div>
</%def>