中扬CRM客户关系管理系统
#
LSH
2023-11-04 aa0161bf05195ccb00bc1d8da4b1b8218f93f4d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<style>
    #formAdvForm {
        background-color: #f3f3f3;
    }
 
    #formAdvForm .layui-form-item {
        margin-top: 20px;
        margin-bottom: 0;
    }
 
    #formAdvForm .layui-form-item .layui-inline {
        margin-bottom: 25px;
        margin-right: 0;
    }
 
    .form-group-bottom {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px 20px;
        background-color: #fff;
        box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
    }
</style>
<!-- 正文开始 -->
<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%">
    <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box">
        <!-- 标题 -->
        <div class="layui-card">
            <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px">
                <div>
                    <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold">&#xe656;</i>
                    <span id="form-name"
                          style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span>
                    <span style="opacity: .5;font-size: small;margin-left: 5px">核价单</span>
                </div>
            </div>
            <div class="layui-card-body" style="padding: 30px 20px">
 
                <div class="layui-tab layui-steps">
                    <ul class="layui-tab-title" id="stepBox">
                    </ul>
                </div>
 
            </div>
        </div>
        <div class="layui-row">
            <!-- 数据 -->
            <!--            <div class="layui-col-md9">-->
            <!--                <div class="layui-card">-->
            <!--                    <div class="layui-card-header">-->
            <!--                        基本信息-->
            <!--                    </div>-->
            <!--                    <div class="layui-card-body">-->
 
            <!--                    </div>-->
            <!--                </div>-->
            <!--            </div>-->
            <!-- 动态 -->
            <!--            <div class="layui-col-md3" style="width: 24%;margin-left: 1%">-->
            <div class="layui-col-md3" style="width: 100%;">
                <!-- 时间线 -->
                <div class="layui-card">
                    <div class="layui-card-header">
                        <span>流程动态</span>
                    </div>
                    <div class="layui-card-body">
                        <ul class="layui-timeline" id="timelineBox">
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
 
    <div class="form-group-bottom text-right">
        <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon">&#xe666;</i>&emsp;刷新&emsp;
        </button>
    </div>
 
</form>
 
<script type="text/html" id="followerTabOperate">
    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">删除</a>
</script>
 
<script type="text/template" id="stepTpl">
    {{#each list}}
    <li id="step-{{step}}" style="pointer-events: none">
        <i class="layui-icon layui-icon-ok">{{step}}</i>
        <span class="layui-steps-title">{{title}}</span>
        {{# if username}}
        <span class="layui-steps-content">{{username}}</span>
        {{ else }}
        <span class="layui-steps-content">&nbsp;</span>
        {{/if}}
    </li>
    {{/each}}
</script>
 
<script type="text/template" id="timelineTpl">
    {{#each list}}
    <li class="layui-timeline-item">
        <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
        <div class="layui-timeline-content layui-text">
            <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4>
            <span>{{time}}</span>
            <p>
                {{msg}}
            </p>
        </div>
    </li>
    {{/each}}
</script>
 
<script>
    var priOnlineId = top.priOnlineByMore;
    $('.layui-layer-close').hide();
    layui.config({
        base: baseUrl + "/static/layui/lay/modules/"
    }).extend({
        notice: 'notice/notice',
        steps: 'steps/steps',
    }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        var table = layui.table;
        var laydate = layui.laydate;
        var notice = layui.notice;
        var xmSelect = layui.xmSelect;
        var steps = layui.steps;
 
        form.render('select');
 
        init();
 
        function init() {
            notice.msg('正在载入数据......', {icon: 4, position: "topRight"});
            $.ajax({
                url: baseUrl + "/priOnline2/" + priOnlineId + "/auth",
                headers: {'token': localStorage.getItem('token')},
                method: 'GET',
                success: function (res) {
                    notice.destroy();
                    if (res.code === 200) {
                        let priOnline = res.data;
                        top.priOnlineByMore = null;
                        $("#form-name").html(priOnline.name);
                        // 进度步骤图
                        let template0 = Handlebars.compile($('#stepTpl').html());
                        $('#stepBox').html(template0({list: JSON.parse(priOnline.settleMsg)}));
                        $('#step-' + Number(priOnline.step)).addClass("layui-this");
 
                        let template1 = Handlebars.compile($('#timelineTpl').html());
                        $('#timelineBox').html(template1({list: JSON.parse(priOnline.settleMsg)}));
                        // 补充html
                        $('#customizeBox').html(priOnline.formHtml);
                        // 设备明细
                        // form.val('formAdvForm', priOnline);
                        // top.convertDisabled($('#formAdvForm :input'), true);
                        // 跟进人
                        // initFollowers(priOnline.id);
                        layDateRender();
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/";
                    } else {
                        layer.msg(res.msg, {icon: 2})
                    }
                }
            })
        }
 
        /* 渲染laydate */
        function layDateRender() {
            laydate.render({
                elem: '#endTime',
                type: 'datetime'
            });
        }
 
        layDateRender();
 
        /* 监听表单提交 */
        form.on('submit(refresh)', function (data) {
            init();
            return false;
        });
 
    })
</script>