中扬CRM客户关系管理系统
#
LSH
2023-11-22 0a9160ff7f91d63b5d55a5abee8efe93b68d78dd
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<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);
    }
 
    .card-body-item {
        display: inline-block;
        border-right: 1px solid #e0e0e0;
        width: 250px;
        padding: 0 30px 0 10px;
    }
    .header-desc {
        overflow:hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        -o-text-overflow:ellipsis;
    }
 
</style>
<!-- 正文开始 -->
<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%">
    <div class="layui-fluid" style="padding-bottom: 75px;">
        <!-- 标题 -->
        <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">&#xe609;</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>
        <div class="layui-row">
            <!-- 基本信息 -->
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        基本信息
                    </div>
                    <div class="layui-card-body">
 
                        <div class="layui-form-item layui-row">
                            <input name="id" type="hidden" />
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">项目代号:</label>
                                <div class="layui-input-block">
                                    <input name="uuid" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">客户信息:</label>
                                <div class="layui-input-block">
                                    <input name="cstmrId$" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">项目总金额:</label>
                                <div class="layui-input-block">
                                    <input name="money" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">所属公司:</label>
                                <div class="layui-input-block">
                                    <input name="company$" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">省市区:</label>
                                <div class="layui-input-block">
                                    <input name="pcd$" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">项目地址:</label>
                                <div class="layui-input-block">
                                    <input name="addr" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">负责人:</label>
                                <div class="layui-input-block">
                                    <input name="director$" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">备注:</label>
                                <div class="layui-input-block">
                                    <input name="remarks" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">项目预算金额(万):</label>
                                <div class="layui-input-block">
                                    <input name="money" class="layui-input" disabled />
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">项目预估成交率:</label>
                                <div class="layui-input-block">
                                    <input name="transactionRate" class="layui-input" disabled />
                                </div>
                            </div>
 
                            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                                <legend style="font-size: 13px">其他</legend>
                            </fieldset>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">添加人员:</label>
                                <div class="layui-input-block">
                                    <input name="createBy$" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">修改人员:</label>
                                <div class="layui-input-block">
                                    <input name="updateBy$" class="layui-input" disabled/>
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">添加时间:</label>
                                <div class="layui-input-block">
                                    <input name="createTime$" class="layui-input icon-date" autocomplete="off" disabled/>
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md6">
                                <label class="layui-form-label">修改时间:</label>
                                <div class="layui-input-block">
                                    <input name="updateTime$" class="layui-input icon-date" autocomplete="off" disabled/>
                                </div>
                            </div>
                        </div>
 
                    </div>
                </div>
            </div>
<!--            &lt;!&ndash; 跟进人 &ndash;&gt;-->
<!--            <div class="layui-col-md3" style="width: 24%;margin-left: 1%">-->
<!--                <div class="layui-card">-->
<!--                    <div class="layui-card-header">-->
<!--                        <span>跟进人</span>-->
<!--                        <span lay-filter="followerAdd" lay-submit style="float: right;cursor: pointer;">-->
<!--                            <i class="layui-icon" style="font-size: 20px;color: #1890ff;">&#xe61f;</i>-->
<!--                        </span>-->
<!--                    </div>-->
<!--                    <div class="layui-card-body">-->
<!--                        <table id="followersTable" lay-filter="followersTable"></table>-->
<!--                    </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/html" id="followerEditDialog">
    <form id="followerEditForm" lay-filter="followerEditForm" class="layui-form model-form">
        <input name="experimentId" type="hidden"/>
        <div class="layui-form-item" style="float: left;clear: none;margin-right: 20px">
            <label class="layui-form-label">选择成员</label>
            <div class="layui-input-block">
                <div id="followersBox" name="followersBox">
                </div>
            </div>
        </div>
        <div class="layui-form-item text-right" style="float: left;clear: none">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
            <button class="layui-btn" lay-filter="followerSubmit" lay-submit>保存</button>
        </div>
    </form>
</script>
 
<script>
    var orderId = top.orderByMore;
    $('.layui-layer-close').hide();
    layui.config({
        base: baseUrl + "/static/layui/lay/modules/"
    }).extend({
        notice: 'notice/notice',
    }).use(['form', 'table', 'laydate', 'notice', 'xmSelect'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        var table = layui.table;
        var laydate = layui.laydate;
        var notice = layui.notice;
        var xmSelect = layui.xmSelect;
 
        form.render('select');
 
        init();
        function init(){
            notice.msg('正在载入数据......', {icon: 4, position: "topRight"});
            $.ajax({
                url: baseUrl + "/order/" + orderId + "/auth",
                headers: {'token': localStorage.getItem('token')},
                method: 'GET',
                success: function (res) {
                    notice.destroy();
                    if (res.code === 200) {
                        let order = res.data;
                        top.orderByMore = null;
                        $("#form-name").html(order.name);
                        // 设备明细
                        form.val('formAdvForm', order);
                        // 跟进人
                        // initFollowers(order.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();
 
        // 渲染跟进人模块
        function initFollowers(orderId) {
            if (!orderId) {
                return;
            }
            $.ajax({
                url: baseUrl+"/order/followers/table/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {
                    orderId: orderId
                },
                method: 'GET',
                success: function (res) {
                    if (res.code === 200){
                        var follTab = table.render({
                            elem: '#followersTable',
                            data: res.data,
                            limit: 999,
                            height: 'full-408',
                            cols: [[
                                {field: 'userName', title: '工作人员'},
                                {fixed: 'right', title:'', align: 'center', toolbar: '#followerTabOperate', width: 70}
                            ]],
                            done: function (res, curr, count) {
                                $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
                            }
                        });
                        // 监听行工具事件
                        table.on('tool(followersTable)', function(obj){
                            let data = obj.data;
                            switch (obj.event) {
                                case "del":
                                    let loadIndex = layer.load(2);
                                    $.ajax({
                                        url: baseUrl+"/order/followers/remove/auth",
                                        headers: {'token': localStorage.getItem('token')},
                                        data: {
                                            orderId: orderId,
                                            userId: data.userId
                                        },
                                        method: 'POST',
                                        success: function (res) {
                                            layer.close(loadIndex);
                                            if (res.code === 200){
                                                initFollowers(orderId);
                                            } else if (res.code === 403){
                                                top.location.href = baseUrl+"/";
                                            } else {
                                                layer.msg(res.msg, {icon: 2});
                                            }
                                        }
                                    })
                                    break;
                            }
                        });
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    }else {
                        layer.msg(res.msg, {icon: 2})
                    }
                }
            })
        }
 
        // 添加跟进人
        var followerLayer;
        form.on('submit(followerAdd)', function (data) {
            if (followerLayer) {return;}
            followerLayer = admin.open({
                type: 1,
                offset: '150px',
                area: '600px',
                title: '添加跟进人',
                content: $('#followerEditDialog').html(),
                success: function (layero, dIndex) {
                    // 表单提交事件
                    form.on('submit(followerSubmit)', function (data) {
                        let selectList = xmSelectIdx.getValue();
                        if (selectList.length === 0) {
                            layer.msg("请选择至少一条数据", {icon: 3});
                            return false;
                        }
                        let loadIndex = layer.load(2);
                        $.ajax({
                            url: baseUrl+"/order/followers/add/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {
                                orderId: orderId,
                                followerIds: selectList.map(function (d) {
                                    return d.value;
                                })
                            },
                            method: 'POST',
                            success: function (res) {
                                if (res.code === 200){
                                    layer.close(loadIndex);
                                    initFollowers(orderId);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                }else {
                                    layer.msg(res.msg, {icon: 2})
                                }
                            }
                        })
                        layer.close(dIndex);
                        return false;
                    });
                    let xmSelectIdx = xmSelect.render({
                        el: '#followersBox',
                        style: {
                            width: '280px',
                        },
                        autoRow: true,
                        toolbar: { show: true },
                        filterable: true,
                        remoteSearch: true,
                        remoteMethod: function(val, cb, show){
                            $.ajax({
                                url: baseUrl+"/user/all/get/kv",
                                headers: {'token': localStorage.getItem('token')},
                                data: {
                                    condition: val
                                },
                                method: 'POST',
                                success: function (res) {
                                    if (res.code === 200){
                                        cb(res.data)
                                    } else {
                                        cb([]);
                                        layer.msg(res.msg, {icon: 2});
                                    }
                                }
                            });
                        }
                    })
                    // 弹窗不出现滚动条
                    $(layero).children('.layui-layer-content').css('overflow', 'visible');
                    layui.form.render('select');
                },
                end: function () {
                    followerLayer = null;
                }
            })
        });
 
        /* 监听表单提交 */
        form.on('submit(refresh)', function (data) {
            init();
            return false;
        });
 
    })
</script>