<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>潜客跟踪详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
    <style>
        .input {
            border-radius: 2px;
            height: 38px;
            border-width: 1px;
            border-color: lightgray;
            border-style: solid;
            background-color: white;
            padding-left: 3px;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card">
            <div class="layui-card-body" pad15>
                <div id="tableDom"></div>
                <h3 style="margin: 20px 0 10px 0">潜客跟踪报告</h3>
                <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
            </div>
        </div>
    </div>
</div>
<script id="demo" type="text/html">
    <table class="layui-table">
          <tbody>
            <tr>
              <td style="background: #f8f8f8; width: 70px">姓名：</td>
              <td>{{ d.name }}</td>
              <td style="background: #f8f8f8; width: 70px">性别：</td>
              <td>{{ d.gender_text }}</td>
            </tr>
            <tr>
              <td style="background: #f8f8f8; width: 70px">电话：</td>
              <td>{{ d.tel }}</td>
              <td style="background: #f8f8f8; width: 70px">地址：</td>
              <td>{{ d.address }}</td>
            </tr>
            <tr>
              <td style="background: #f8f8f8; width: 70px">小区：</td>
              <td>{{ d.village }}</td>
              <td style="background: #f8f8f8; width: 70px">来源：</td>
              <td>{{ d.source_text }}</td>
            </tr>
            <tr>
              <td style="background: #f8f8f8; width: 70px">项目：</td>
              <td>{{ d.project_text }}</td>
              <td style="background: #f8f8f8; width: 70px">阶段进度：</td>
              <td>{{ d.stage_progress_text }}</td>
            </tr>
            <tr>
              <td style="background: #f8f8f8; width: 70px">备注：</td>
              <td colspan="3">{{ d.notes || ""}}</td>
            </tr>
          </tbody>
        </table>
</script>
<script src="../../layuiadmin/layui/layui.js"></script>
<script>
    layui.link('../../../layuiadmin/style/autocomplete.css');
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
        , autocomplete: 'autocomplete'
    }).extend({
        index: 'lib/index',
        formSelects: 'formSelects-v4'
    }).use(['index', 'table', 'form', 'autocomplete', 'formSelects', 'laytpl' ], function () {
        var $ = layui.$
            , table = layui.table
            , admin = layui.admin
            , laytpl = layui.laytpl
            , formSelects = layui.formSelects
            , form = layui.form;

        editdata = JSON.parse(JSON.stringify(parent.layui.table.editdata)); // 框架有Bug所以这么转换
        var data = editdata;
        var getTpl = demo.innerHTML
        ,tableDom = document.getElementById('tableDom');
        laytpl(getTpl).render(data, function(html){
          tableDom.innerHTML = html;
        });
        var id = layui.view.getParameterByName('customer');
        table.render({
            elem: '#customer_datagrid'
            , url: '/customer/get_review/?customer=' + id
            , cols: [[
                {field: 'create_user_text', title: '跟踪人', width: 100}
                , {field: 'create_time_f', title: "跟踪时间", width: 150}
                , {field: 'description', title: '回访情况', width: 200}
                , {field: 'instruction', title: '支援或放弃', width: 150}
                , {field: 'check_comment', title: "审核批示", width: 150}
                , {field: 'check_status_text', title: '审核状态', width: 100}
            ]]
            , page: true
        });

    });
</script>
</body>
</html>
