educode_sales 0.5.8 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales//345/256/242/346/210/267/347/256/241/347/220/206.png +0 -0
  3. data/app/controllers/educode_sales/businesses_controller.rb +1 -0
  4. data/app/controllers/educode_sales/customer_extensions_controller.rb +17 -0
  5. data/app/controllers/educode_sales/customer_follows_controller.rb +41 -0
  6. data/app/controllers/educode_sales/customers_controller.rb +194 -0
  7. data/app/controllers/educode_sales/roles_controller.rb +4 -1
  8. data/app/models/educode_sales/customer.rb +4 -0
  9. data/app/models/educode_sales/customer_extension.rb +7 -0
  10. data/app/models/educode_sales/customer_follow.rb +5 -0
  11. data/app/models/educode_sales/permission.rb +2 -1
  12. data/app/models/educode_sales/role_area.rb +1 -0
  13. data/app/views/educode_sales/businesses/_follows.html.erb +7 -4
  14. data/app/views/educode_sales/businesses/edit_follow_record.html.erb +2 -2
  15. data/app/views/educode_sales/businesses/index.html.erb +3 -2
  16. data/app/views/educode_sales/businesses/new.html.erb +3 -0
  17. data/app/views/educode_sales/businesses/new_follow_record.html.erb +2 -2
  18. data/app/views/educode_sales/businesses/show_follow.html.erb +6 -1
  19. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -0
  20. data/app/views/educode_sales/customers/edit.html.erb +60 -0
  21. data/app/views/educode_sales/customers/edit_department.html.erb +52 -0
  22. data/app/views/educode_sales/customers/edit_follow_record.html.erb +50 -0
  23. data/app/views/educode_sales/customers/give.html.erb +51 -0
  24. data/app/views/educode_sales/customers/index.html.erb +485 -0
  25. data/app/views/educode_sales/customers/index.json.jbuilder +25 -0
  26. data/app/views/educode_sales/customers/new.html.erb +89 -0
  27. data/app/views/educode_sales/customers/new_department.html.erb +53 -0
  28. data/app/views/educode_sales/customers/new_follow_record.html.erb +54 -0
  29. data/app/views/educode_sales/customers/show_department.json.jbuilder +13 -0
  30. data/app/views/educode_sales/customers/show_follow.html.erb +439 -0
  31. data/app/views/educode_sales/customers/show_follow.json.jbuilder +13 -0
  32. data/app/views/educode_sales/customers/show_follow_record.html.erb +17 -0
  33. data/app/views/educode_sales/places/index.json.jbuilder +1 -1
  34. data/app/views/educode_sales/roles/edit.html.erb +8 -0
  35. data/app/views/educode_sales/sales/index.html.erb +44 -20
  36. data/app/views/educode_sales/sales/index.json.jbuilder +7 -5
  37. data/app/views/educode_sales/teachers/index.json.jbuilder +2 -2
  38. data/app/views/educode_sales/teachers/show_follow.html.erb +10 -5
  39. data/app/views/educode_sales/teachers/show_follow.json.jbuilder +1 -0
  40. data/app/views/layouts/educode_sales/application.html.erb +8 -1
  41. data/config/routes.rb +25 -0
  42. data/db/migrate/20210902064109_create_educode_sales_role_permissions.rb +15 -0
  43. data/db/migrate/20211214100803_create_customer_extensions.rb +9 -0
  44. data/db/migrate/20211215025029_create_educode_sales_customer_follows.rb +12 -0
  45. data/lib/educode_sales/version.rb +1 -1
  46. metadata +24 -2
@@ -0,0 +1,51 @@
1
+ <%= Gon::Base.render_data %>
2
+ <form class="layui-form " action="">
3
+ <div class="layui-form-item" style="padding: 25px">
4
+ <div class="layui-inline">
5
+ <label class="layui-form-label required">负责人</label>
6
+ <div class="layui-input-block">
7
+ <%= select_tag "staff_id", options_for_select(@staffs), { include_blank: true } %>
8
+ </div>
9
+ </div>
10
+ <div class="layui-inline" style="padding-left: 30px">
11
+ <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="data-reset-btn">提交
12
+ </button>
13
+ </div>
14
+ </div>
15
+ </form>
16
+
17
+
18
+ <script>
19
+ layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
20
+ var form = layui.form,
21
+ layer = layui.layer,
22
+ table = layui.table,
23
+ transfer = layui.transfer,
24
+ laytpl = layui.laytpl,
25
+ request = layui.request,
26
+ $ = layui.$;
27
+
28
+ form.render();
29
+
30
+ // 当前弹出层,防止ID被覆盖
31
+ var parentIndex = layer.index;
32
+
33
+
34
+
35
+ //监听提交
36
+ form.on('submit(data-reset-btn)', function (data) {
37
+ var school_ids = parent.ids
38
+ data.field['school_ids'] = school_ids;
39
+ console.log(data.field);
40
+ request.authPost("missions/customer_extensions", data.field, function (res) {
41
+ if (res.success === false) {
42
+ layer.alert(res.msg)
43
+ } else {
44
+ layer.closeAll(); //关闭所有层
45
+ table.reload('customers_table')
46
+ }
47
+ })
48
+ return false;
49
+ });
50
+ });
51
+ </script>
@@ -0,0 +1,485 @@
1
+ <div style="margin: 10px 10px 10px 10px">
2
+ <form class="layui-form layui-form-pane" lay-filter="search_teachers">
3
+ <div class="layui-form-item">
4
+ <div class="layui-inline">
5
+ <label class="layui-form-label">客户名称</label>
6
+ <div class="layui-input-inline">
7
+ <input type="text" name="name" autocomplete="off" class="layui-input">
8
+ </div>
9
+ </div>
10
+ <div class="layui-inline">
11
+ <label class="layui-form-label">区域</label>
12
+ <div class="layui-input-inline">
13
+ <%= select_tag "area", options_for_select(EducodeSales::Common.where(clazz: 'area').pluck(:name)), { include_blank: true } %>
14
+ </div>
15
+ </div>
16
+ <div class="layui-inline">
17
+ <label class="layui-form-label">负责人</label>
18
+ <div class="layui-input-inline">
19
+ <%= select_tag "staff_id", options_for_select(@staffs), { include_blank: true } %>
20
+ </div>
21
+ </div>
22
+ <div class="layui-inline">
23
+ <label class="layui-form-label">最后跟进</label>
24
+ <div class="layui-input-inline">
25
+ <input type="text" class="layui-input" id="date" name="date" placeholder=" - ">
26
+ </div>
27
+ </div>
28
+
29
+ <div class="layui-inline">
30
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
31
+ </button>
32
+ <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_teachers">搜 索
33
+ </button>
34
+ </div>
35
+ </div>
36
+ </form>
37
+ </div>
38
+
39
+ <script type="text/html" id="toolbarDemo">
40
+ <div class="layui-btn-container">
41
+ <span class="table-label">客户列表</span>
42
+ <% if can? :create, EducodeSales::Customer %>
43
+ <!-- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加客户</button>-->
44
+ <% end %>
45
+ <% if can? :give, EducodeSales::Customer %>
46
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="give">分配/移交</button>
47
+ <% end %>
48
+ </button>
49
+ </div>
50
+ </script>
51
+ <div class="">
52
+ <table class="layui-hide" id="customers_table" style="min-height: 300px;" lay-filter="customers_table"></table>
53
+ </div>
54
+ <script type="text/html" id="currentTableBar">
55
+ <% if can? :create_department, EducodeSales::Customer %>
56
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_department">添加部门</a>
57
+ <% end %>
58
+ <% if can? :create_follow, EducodeSales::Customer %>
59
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_follow">添加跟进记录</a>
60
+ <% end %>
61
+ <% if can? :update, EducodeSales::Customer %>
62
+ <!--<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>-->
63
+ <% end %>
64
+ </script>
65
+ <script type="text/html" id="business">
66
+ <a href="/missions/businesses?school={{d.name}}" class="layui-table-link">{{ d.business }}</a>
67
+ </script>
68
+ <script type="text/html" id="name">
69
+ <a href="javascript:void(0);" lay-event="name" class="layui-table-link">{{ d.name }}</a>
70
+ </script>
71
+ <script type="text/html" id="department">
72
+ <a href="javascript:void(0);" lay-event="department" class="layui-table-link">{{ d.department }}</a>
73
+ </script>
74
+ <script type="text/html" id="follow">
75
+ <a href="javascript:void(0);" lay-event="follow" class="layui-table-link">{{ d.follow }}</a>
76
+ </script>
77
+
78
+
79
+ <script>
80
+ layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate'], function () {
81
+ var $ = layui.jquery,
82
+ form = layui.form,
83
+ request = layui.request,
84
+ dropdown = layui.dropdown,
85
+ miniPage = layui.miniPage,
86
+ laydate = layui.laydate;
87
+
88
+ var laydate = layui.laydate;
89
+
90
+ laydate.render({
91
+ elem: '#date',
92
+ range: true
93
+ });
94
+ laydate.render({
95
+ elem: '#time',
96
+ });
97
+
98
+ table = layui.table;
99
+ table.render({
100
+ elem: '#customers_table',
101
+ url: '/missions/customers',
102
+ // where: {q: form.val('search_form')},
103
+ toolbar: '#toolbarDemo',
104
+ // totalRow:true,
105
+ defaultToolbar: ['filter'],
106
+ cols: [
107
+ [
108
+ {type:'checkbox'},
109
+ {
110
+ field: 'id',
111
+ width: 60,
112
+ title:'序号',type: 'numbers',
113
+
114
+ },
115
+ {
116
+ field: 'name',
117
+ width: 160,
118
+ title: '客户名称',
119
+ templet: "#name"
120
+ },
121
+ {
122
+ field: 'area',
123
+ width: 100,
124
+ title: '区域',
125
+ },
126
+ {
127
+ field: 'department',
128
+ width: 100,
129
+ title: '二级部门',
130
+ templet: "#department"
131
+ },
132
+ {
133
+ field: 'business',
134
+ width: 60,
135
+ title: '商机',
136
+ templet: "#business"
137
+ },
138
+ {
139
+ field: 'follow',
140
+ width: 100,
141
+ title: '跟进次数',
142
+ templet: "#follow"
143
+ },
144
+ {
145
+ field: 'last_follow_time',
146
+ width: 160,
147
+ title: '最后跟进时间',
148
+ },
149
+ {
150
+ field: 'staff',
151
+ width: 100,
152
+ title: '负责人',
153
+ },
154
+ {
155
+ title: '操作',
156
+ minWidth: 170,
157
+ toolbar: '#currentTableBar',
158
+ align: "center",
159
+ fixed: 'right'
160
+ }
161
+ ]
162
+ ],
163
+
164
+ limit: 20,
165
+ limits: [10,15,20,30,40,50,60,70,80,90],
166
+ page: true,
167
+ });
168
+
169
+ //监听表格复选框选择
170
+ table.on('checkbox(customers_table)', function (obj) {
171
+ });
172
+
173
+
174
+
175
+ function edit(id) {
176
+ var content = miniPage.getHrefContent('/missions/teachers/' + id + '/edit');
177
+ var openWH = miniPage.getOpenWidthHeight();
178
+ sindex = layer.open({
179
+ title: '编辑',
180
+ type: 1,
181
+ shade: 0.2,
182
+ maxmin: true,
183
+ shadeClose: true,
184
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
185
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
186
+ content: content
187
+ });
188
+ $(window).on("resize", function () {
189
+ layer.full(sindex);
190
+ });
191
+ }
192
+
193
+ function month(id) {
194
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_month?teacher_id=' + id);
195
+ var openWH = miniPage.getOpenWidthHeight();
196
+ teacherindex2 = layer.open({
197
+ title: '添加月计划',
198
+ type: 1,
199
+ shade: 0.2,
200
+ maxmin: true,
201
+ shadeClose: true,
202
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
203
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
204
+ content: content
205
+ });
206
+ $(window).on("resize", function () {
207
+ layer.full(sindex);
208
+ });
209
+ }
210
+
211
+ function deleteBusiness(id, name) {
212
+ layer.confirm('确定删除' + name, function (index) {
213
+ request.delete('missions/teachers/' + id, {}, function (res) {
214
+ layer.close(index);
215
+ table.reload("customers_table")
216
+ })
217
+ });
218
+ }
219
+
220
+ var sort = {}, search = {};
221
+ table.on('sort(customers_table)', function (obj) {
222
+ sort.field = obj.field;
223
+ sort.order = obj.type;
224
+ table.reload('customers_table', {
225
+ initSort: obj,
226
+ where: {
227
+ sort: sort,
228
+ q: search
229
+ }
230
+ });
231
+ })
232
+
233
+ // 监听搜索操作
234
+ form.on('submit(search_teachers)', function (data) {
235
+ search = data.field
236
+ table.reload('customers_table', {
237
+ page: {
238
+ curr: 1
239
+ },
240
+ where: {q: search, sort: sort}
241
+ }, 'data');
242
+ return false;
243
+ });
244
+
245
+ form.on('submit(reset_business_search)', function (data) {
246
+ var field = data.field;
247
+ form.val('search_teachers', {
248
+ area: "",
249
+ date: "",
250
+ attitude: "",
251
+ name: "",
252
+ professional_title: "",
253
+ regist_at: "",
254
+ status: "",
255
+ school: "",
256
+ assist: "",
257
+ teacher_source: ""
258
+ })
259
+ return false;
260
+ });
261
+ /**
262
+ * toolbar事件监听
263
+ */
264
+ table.on('toolbar(customers_table)', function (obj) {
265
+ if (obj.event === 'add') { // 手动添加
266
+ var content = miniPage.getHrefContent('/missions/customers/new');
267
+ var openWH = miniPage.getOpenWidthHeight();
268
+ index = layer.open({
269
+ title: '添加客户',
270
+ type: 1,
271
+ shade: 0.2,
272
+ maxmin: true,
273
+ shadeClose: true,
274
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
275
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
276
+ content: content,
277
+ });
278
+ $(window).on("resize", function () {
279
+ layer.full(index);
280
+ });
281
+ }else if (obj.event === 'give') { //
282
+ var school_ids = []
283
+ var checkStatus = table.checkStatus('customers_table')
284
+ ,data = checkStatus.data;
285
+ for (var i=0,len=data.length; i<len; i++){
286
+ school_ids.push(data[i].id)
287
+ }
288
+ ids = school_ids
289
+ if(ids.length == 0){
290
+ layer.msg('请选择客户')
291
+ return
292
+ }
293
+ content = miniPage.getHrefContent('/missions/customers/give');
294
+ openWH = miniPage.getOpenWidthHeight();
295
+ index = layer.open({
296
+ title: '分配/移交',
297
+ type: 1,
298
+ shade: 0.2,
299
+ maxmin: true,
300
+ shadeClose: true,
301
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
302
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
303
+ content: content,
304
+ });
305
+ $(window).on("resize", function () {
306
+ layer.full(index);
307
+ });
308
+ } else if (obj.event === 'search_new') { // 搜索添加
309
+ content = miniPage.getHrefContent('/missions/teachers/search_new');
310
+ openWH = miniPage.getOpenWidthHeight();
311
+ index = layer.open({
312
+ title: '搜索添加',
313
+ type: 1,
314
+ shade: 0.2,
315
+ maxmin: true,
316
+ shadeClose: true,
317
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
318
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
319
+ content: content,
320
+ });
321
+ $(window).on("resize", function () {
322
+ layer.full(index);
323
+ });
324
+ }
325
+ });
326
+
327
+
328
+
329
+ table.on('tool(customers_table)', function (obj) {
330
+ var data = obj.data;
331
+ id = data.id
332
+ if (obj.event === 'edit') { // 监听添加操作
333
+ var content = miniPage.getHrefContent('/missions/customers' + data.id + '/edit');
334
+ var openWH = miniPage.getOpenWidthHeight();
335
+ sale_plan_index = layer.open({
336
+ title: '编辑客户',
337
+ type: 1,
338
+ shade: 0.2,
339
+ maxmin: true,
340
+ shadeClose: true,
341
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
342
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
343
+ content: content,
344
+ success: function (layero, index) {
345
+ form.render('select');
346
+ }
347
+ });
348
+ $(window).on("resize", function () {
349
+ layer.full(sale_plan_index);
350
+ });
351
+ } else if (obj.event === 'delete') {
352
+ layer.confirm('确定删除' + data.name, function (index) {
353
+ request.delete('missions/teachers/' + data.id, {}, function (res) {
354
+ layer.close(index);
355
+ table.reload("customers_table")
356
+ })
357
+ });
358
+ } else if (obj.event === 'addWeek') {
359
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_week?teacher_id=' + obj.data.id);
360
+ var openWH = miniPage.getOpenWidthHeight();
361
+
362
+ teacherindex1 = layer.open({
363
+ title: '添加周计划',
364
+ type: 1,
365
+ shade: 0.2,
366
+ maxmin: true,
367
+ shadeClose: true,
368
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
369
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
370
+ content: content
371
+ });
372
+ $(window).on("resize", function () {
373
+ layer.full(sindex);
374
+ });
375
+ } else if (obj.event === 'addMonth') {
376
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_month?teacher_id=' + obj.data.id);
377
+ var openWH = miniPage.getOpenWidthHeight();
378
+ teacherindex2 = layer.open({
379
+ title: '添加月计划',
380
+ type: 1,
381
+ shade: 0.2,
382
+ maxmin: true,
383
+ shadeClose: true,
384
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
385
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
386
+ content: content
387
+ });
388
+ $(window).on("resize", function () {
389
+ layer.full(sindex);
390
+ });
391
+
392
+ } else if (obj.event === 'courses') {
393
+ teacher_id = data.id
394
+ content = miniPage.getHrefContent('/missions/teachers/add_courses?id='+data.id);
395
+ openWH = miniPage.getOpenWidthHeight();
396
+ index = layer.open({
397
+ title: '课程方向',
398
+ type: 1,
399
+ shade: 0.2,
400
+ maxmin: true,
401
+ shadeClose: true,
402
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
403
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
404
+ content: content,
405
+ success: function (layero, index) {
406
+ // 重新渲染弹层中的下拉选择框select
407
+ // form.render('select');
408
+ }
409
+ });
410
+ $(window).on("resize", function () {
411
+ layer.full(index);
412
+ });
413
+ } else if (obj.event === 'add_department') {
414
+ school_id = data.id
415
+ var content = miniPage.getHrefContent('/missions/customers/new_department?id=' + data.id);
416
+ var openWH = miniPage.getOpenWidthHeight();
417
+ new_department_index = layer.open({
418
+ title: '添加部门',
419
+ type: 1,
420
+ shade: 0.2,
421
+ maxmin: true,
422
+ shadeClose: true,
423
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
424
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
425
+ content: content,
426
+ success: function (layero, index) {
427
+ // 重新渲染弹层中的下拉选择框select
428
+ form.render('select');
429
+ }
430
+ });
431
+ $(window).on("resize", function () {
432
+ layer.full(index);
433
+ });
434
+ } else if (obj.event === 'add_follow') { // 监听添加操作
435
+ var content = miniPage.getHrefContent('/missions/customers/new_follow_record?id=' + data.id)
436
+ var openWH = miniPage.getOpenWidthHeight();
437
+ addFollowIndex = layer.open({
438
+ title: '添加跟进记录',
439
+ type: 1,
440
+ shade: 0.2,
441
+ maxmin: true,
442
+ shadeClose: true,
443
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
444
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
445
+ content: content,
446
+ success: function (layero, index) {
447
+ // 重新渲染弹层中的下拉选择框select
448
+ form.render('select');
449
+ }
450
+ });
451
+ $(window).on("resize", function () {
452
+ layer.full(index);
453
+ });
454
+ } else if (obj.event === 'follow' || obj.event === 'name' ||obj.event === 'department' ) {
455
+ id = data.id
456
+ time = data.last_follow_time || ''
457
+ content = miniPage.getHrefContent('/missions/customers/show_follow?id=' + data.id);
458
+ openWH = miniPage.getOpenWidthHeight();
459
+ index = layer.open({
460
+ title: '客户列表/' + data.name,
461
+ type: 1,
462
+ shade: 0.2,
463
+ maxmin: true,
464
+ shadeClose: true,
465
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
466
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
467
+ content: content,
468
+ success: function (layero, index) {
469
+ // 重新渲染弹层中的下拉选择框select
470
+ // form.render('select');
471
+ }
472
+ });
473
+ $(window).on("resize", function () {
474
+ layer.full(index);
475
+ });
476
+ }
477
+ });
478
+
479
+ });
480
+ </script>
481
+ <style>
482
+ .layui-table-tool-temp{
483
+ padding-right: 30px; !important;
484
+ }
485
+ </style>
@@ -0,0 +1,25 @@
1
+ json.data do
2
+ json.array! @customers do |d|
3
+ department_ids = d.departments.ids
4
+ business_ids = EducodeSales::Business.where(department_id: department_ids).ids
5
+ follow_ups = EducodeSales::FollowUp.where(business_id: business_ids)
6
+ customer_follows = EducodeSales::CustomerFollow.where(school_id: d.id)
7
+ a_last_follow_time = follow_ups.last&.created_at&.to_s(:date)
8
+ b_last_follow_time = customer_follows.last&.created_at&.to_s(:date)
9
+ if a_last_follow_time.present? && b_last_follow_time.present?
10
+ json.last_follow_time a_last_follow_time < b_last_follow_time ? b_last_follow_time : a_last_follow_time
11
+ else
12
+ json.last_follow_time a_last_follow_time || b_last_follow_time
13
+ end
14
+ json.id d.id
15
+ json.name d.name
16
+ json.area d.province
17
+ json.department d.departments.size
18
+ json.business business_ids.size
19
+ json.follow follow_ups.size + customer_follows.size
20
+ json.staff EducodeSales::CustomerExtension.find_by(school_id: d.id)&.customer_staff&.user&.real_name
21
+ end
22
+ end
23
+
24
+ json.code 0
25
+ json.count @customers.total_count
@@ -0,0 +1,89 @@
1
+ <form class="layui-form " action="">
2
+ <div class="layui-form-item" style="padding: 25px">
3
+ <div class="layui-inline">
4
+ <label class="layui-form-label required">学校:</label>
5
+ <div class="layui-input-block">
6
+ <input type="text" name="name" required lay-verify="required" placeholder="请输入学校" autocomplete="off"
7
+ class="layui-input" id="inputFocus">
8
+ </div>
9
+ </div>
10
+ <br>
11
+ <div class="layui-inline">
12
+ <label class="layui-form-label required">地址:</label>
13
+ <div class="layui-input-block">
14
+ <input type="text" name="address" required lay-verify="required" autocomplete="off"
15
+ class="layui-input" placeholder="请输入地址" >
16
+ </div>
17
+ </div>
18
+ <div class="layui-form-item">
19
+ <label class="layui-form-label">学校性质:</label>
20
+ <div class="layui-input-block">
21
+ <input type="checkbox" name="project_985" lay-skin="primary" value="1" title="985工程">
22
+ <input type="checkbox" name="project_211" lay-skin="primary" value="1" title="211工程" >
23
+ <input type="checkbox" name="regular_college" lay-skin="primary" value="1" title="本科院校">
24
+ </div>
25
+ </div>
26
+ <div class="layui-form-item">
27
+ <div class="layui-input-block">
28
+ <input type="checkbox" name="junior_college" lay-skin="primary" value="1" title="大专院校">
29
+ <input type="checkbox" name="secondary_school" lay-skin="primary" value="1" title="中专院校" >
30
+ <input type="checkbox" name="military_school" lay-skin="primary" value="1" title="军事院校">
31
+ </div>
32
+ </div>
33
+ <div class="layui-form-item">
34
+ <div class="layui-input-block">
35
+ <input type="checkbox" name="enterprise" lay-skin="primary" value="1" title="企业">
36
+ </div>
37
+ </div>
38
+ <div class="layui-inline" style="padding-left: 30px">
39
+ <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="data-reset-btn">提交
40
+ </button>
41
+ </div>
42
+ </div>
43
+ </form>
44
+
45
+
46
+ <script>
47
+ document.getElementById("inputFocus").focus();
48
+
49
+ layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
50
+ var form = layui.form,
51
+ layer = layui.layer,
52
+ table = layui.table,
53
+ transfer = layui.transfer,
54
+ laytpl = layui.laytpl,
55
+ request = layui.request,
56
+ $ = layui.$;
57
+
58
+ form.render();
59
+
60
+ // 当前弹出层,防止ID被覆盖
61
+ var parentIndex = layer.index;
62
+
63
+
64
+
65
+
66
+ //监听提交
67
+ form.on('submit(data-reset-btn)', function (data) {
68
+ console.log(data.field);
69
+ // var area_ids = []
70
+ // layui.each(transfer.getData('area_list'), function (i, v) {
71
+ // area_ids.push(v.value)
72
+ // })
73
+ // if (area_ids.length === 0) {
74
+ // layer.alert("请选择负责区域");
75
+ // return false;
76
+ // }
77
+ // data.field['area_ids'] = area_ids;
78
+ // request.authPost("missions/places", data.field, function (res) {
79
+ // if (res.success === false) {
80
+ // layer.alert(res.msg)
81
+ // } else {
82
+ // layer.closeAll(); //关闭所有层
83
+ // table.reload('place')
84
+ // }
85
+ // })
86
+ return false;
87
+ });
88
+ });
89
+ </script>