educode_sales 1.10.24 → 1.10.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,252 @@
1
+ <script type="text/html" id="toolbarDemo_follow">
2
+ <div class="layui-btn-container">
3
+ <span class="table-label">跟进记录</span>
4
+ <%# if can? :create, EducodeSales::TeacherFollow %>
5
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录
6
+ </button>
7
+ <%# end %>
8
+ </div>
9
+ </script>
10
+ <div class="z-index">
11
+ <table class="layui-hide" id="sale_plan_follow_table" lay-filter="sale_plan_follow_table"></table>
12
+ </div>
13
+
14
+ <script type="text/html" id="currentTableBar_follows_idea">
15
+ <%# if can? :read, EducodeSales::TeacherFollow %>
16
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
17
+ <%# end %>
18
+ {{# if(d.is_latest){ }}
19
+ <%# if can? :update, EducodeSales::TeacherFollow %>
20
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
21
+ <%# end %>
22
+ <%# if can? :destroy, EducodeSales::TeacherFollow %>
23
+ <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
24
+ <%# end %>
25
+ {{# } }}
26
+ </script>
27
+
28
+
29
+ <script>
30
+ layui.use(['form', 'table', 'miniPage', 'element'], function () {
31
+ var $ = layui.jquery,
32
+ form = layui.form,
33
+ request = layui.request,
34
+ miniPage = layui.miniPage;
35
+
36
+ table = layui.table;
37
+ table.render({
38
+ elem: '#sale_plan_follow_table',
39
+ url: '/missions/ideas/follow_list?id=' + parent.id,
40
+ toolbar: '#toolbarDemo_follow',
41
+ defaultToolbar: ['filter'],
42
+ cols: [
43
+ [
44
+ {
45
+ field: 'id',
46
+ width: 60,
47
+ title: '序号', type: 'numbers',
48
+ },
49
+ {
50
+ field: 'content',
51
+ title: '最新进展',
52
+ width: 300
53
+ },
54
+ {
55
+ width: 120,
56
+ title: '所属商机',
57
+ field: 'name'
58
+ },
59
+ {
60
+ field: 'school_name',
61
+ width: 150,
62
+ title: '单位',
63
+ },
64
+ {
65
+ field: 'money',
66
+ width: 150,
67
+ title: '预算',
68
+ },
69
+ {
70
+ field: 'status',
71
+ title: '状态',
72
+ width: 150,
73
+ },
74
+ {
75
+ field: 'advise',
76
+ width: 160,
77
+ title: '团队建议',
78
+ },
79
+ {
80
+ field: 'sale_staff',
81
+ width: 120,
82
+ title: '销售经理',
83
+ },
84
+ {
85
+ field: 'idea_staff',
86
+ width: 180,
87
+ title: '方案经理',
88
+ sort: true,
89
+ },
90
+ {
91
+ field: 'staff',
92
+ width: 300,
93
+ title: '跟进人'
94
+ },
95
+ {
96
+ field: 'created_at',
97
+ width: 300,
98
+ title: '跟进时间'
99
+ },
100
+ {
101
+ title: '操作',
102
+ width: 200,
103
+ toolbar: '#currentTableBar_follows_idea',
104
+ align: "center",
105
+ fixed: 'right'
106
+ }
107
+ ]
108
+ ],
109
+
110
+
111
+ page: true,
112
+ skin: 'line'
113
+ });
114
+
115
+
116
+ /**
117
+ * toolbar事件监听
118
+ */
119
+ table.on('toolbar(sale_plan_follow_table)', function (obj) {
120
+ if (obj.event === 'add') { // 监听添加操作
121
+ var content = miniPage.getHrefContent('/missions/ideas/new_follow_up?id=' + parent.id);
122
+ var openWH = miniPage.getOpenWidthHeight();
123
+ sale_plan_index = layer.open({
124
+ title: '添加跟进记录',
125
+ type: 1,
126
+ shade: 0.2,
127
+ maxmin: true,
128
+ shadeClose: true,
129
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
130
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
131
+ content: content,
132
+ success: function (layero, index) {
133
+ // 重新渲染弹层中的下拉选择框select
134
+ form.render('select');
135
+ }
136
+ });
137
+ $(window).on("resize", function () {
138
+ layer.full(index);
139
+ });
140
+ }
141
+ });
142
+
143
+ table.on('tool(sale_plan_follow_table)', function (obj) {
144
+ var data = obj.data;
145
+ var id = data.id
146
+ if (obj.event === 'delete') {
147
+ layer.confirm('确定删除ID为' + data.id + "的跟进记录", function (index) {
148
+ request.authDelete("missions/idea_follows/" + data.id, {}, function () {
149
+ obj.del();
150
+ layer.close(index);
151
+ // parent.table.reload('sale_plan_follow_table')
152
+ // parent.table.reload('ideas_table')
153
+ // parent.table.reload('weekPlanTable1')
154
+ // parent.table.reload('monthPlanTable')
155
+ table.reload('activity_followp_table');
156
+ table.reload('ideas_table')
157
+ table.reload('sale_plan_follow_table')
158
+ })
159
+ });
160
+ } else if (obj.event === 'show') { // 监听添加操作
161
+ var content = miniPage.getHrefContent('/missions/ideas/show_follow?id=' + id);
162
+ var openWH = miniPage.getOpenWidthHeight();
163
+ sale_plan_index1 = layer.open({
164
+ title: '查看跟进记录',
165
+ type: 1,
166
+ shade: 0.2,
167
+ maxmin: true,
168
+ shadeClose: true,
169
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
170
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
171
+ content: content,
172
+ success: function (layero, index) {
173
+ // 重新渲染弹层中的下拉选择框select
174
+ form.render('select');
175
+ }
176
+ });
177
+ $(window).on("resize", function () {
178
+ layer.full(index);
179
+ });
180
+ } else if (obj.event === 'edit') {
181
+ content = miniPage.getHrefContent('/missions/ideas/edit_follow_record?id=' + id);
182
+ openWH = miniPage.getOpenWidthHeight();
183
+ edit_index1 = layer.open({
184
+ title: '编辑跟进记录',
185
+ type: 1,
186
+ shade: 0.2,
187
+ maxmin: true,
188
+ shadeClose: true,
189
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
190
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
191
+ content: content,
192
+ success: function (layero, index) {
193
+ // 重新渲染弹层中的下拉选择框select
194
+ form.render('select');
195
+ }
196
+ });
197
+ $(window).on("resize", function () {
198
+ layer.full(index);
199
+ });
200
+ } else if (obj.event === 'add_keys') { // 监听添加操作
201
+ content = miniPage.getHrefContent('/missions/businesses/add_keys');
202
+ openWH = miniPage.getOpenWidthHeight();
203
+ index = layer.open({
204
+ title: '关键人',
205
+ type: 1,
206
+ shade: 0.2,
207
+ maxmin: true,
208
+ shadeClose: true,
209
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
210
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
211
+ content: content,
212
+ success: function (layero, index) {
213
+ // 重新渲染弹层中的下拉选择框select
214
+ form.render('select');
215
+ }
216
+ });
217
+ $(window).on("resize", function () {
218
+ layer.full(index);
219
+ });
220
+ } else if (obj.event === 'edit_plan') {
221
+ content = miniPage.getHrefContent('/missions/businesses/edit_plan');
222
+ openWH = miniPage.getOpenWidthHeight();
223
+ index = layer.open({
224
+ title: '回款计划',
225
+ type: 1,
226
+ shade: 0.2,
227
+ maxmin: true,
228
+ shadeClose: true,
229
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
230
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
231
+ content: content,
232
+ success: function (layero, index) {
233
+ // 重新渲染弹层中的下拉选择框select
234
+ // form.render('select');
235
+ }
236
+ });
237
+ $(window).on("resize", function () {
238
+ layer.full(index);
239
+ });
240
+ }
241
+ });
242
+
243
+ });
244
+ </script>
245
+
246
+ </script>
247
+ <style>
248
+ .z-index .layui-table-tool {
249
+ z-index: 10000;
250
+ !important;
251
+ }
252
+ </style>
@@ -0,0 +1,16 @@
1
+ json.data do
2
+ json.array! @follow_ups do |d|
3
+ json.(d, *d.attributes.keys)
4
+ json.status d.idea&.status
5
+ json.name d.idea&.business&.name || d.idea&.name
6
+ json.school_name d.idea&.business&.department&.school&.name
7
+ json.created_at d.created_at.strftime("%Y-%m-%d %H:%M:%S")
8
+ json.staff d.staff&.user&.real_name
9
+ json.sale_staff d.sale_staff&.user&.real_name
10
+ json.idea_staff d.idea&.staff&.user&.real_name
11
+ json.is_latest d.id == @latest.id
12
+ end
13
+ end
14
+
15
+ json.code 0
16
+ json.count @follow_ups.total_count
@@ -10,6 +10,7 @@ json.data do
10
10
  json.creator d.creator&.user&.real_name
11
11
  json.deleter d.deleter&.user&.real_name
12
12
  json.created_at d.created_at.to_s(:date)
13
+ json.assist_staffs d.assist_staffs.map { |s| s.user.real_name }.join(",")
13
14
  json.history_type EducodeSales::Idea.where(school_id: d.school_id).size.to_i >= 2 ? "有" : "无"
14
15
  json.is_deleted @is_deleted
15
16
  json.sale_staff d.sale_staff&.user&.real_name
@@ -145,7 +145,7 @@
145
145
  <textarea name="content" placeholder="需求说明" class="layui-textarea"><%= @idea&.content.to_s %></textarea>
146
146
  </div>
147
147
  </div>
148
- <div class="layui-row" style="padding-top: 15px">
148
+ <div class="layui-row" style="padding-top: 15px;display: none">
149
149
  <div class="layui-col-md6">
150
150
  <labeL class="layui-form-label">方案材料:</labeL>
151
151
  <div class="layui-btn-container">
@@ -92,9 +92,11 @@
92
92
  layer.alert(res.msg)
93
93
  } else {
94
94
  layer.close(parent.followup_index);
95
+ layer.close(parent.sale_plan_index);
95
96
  parent.layer.close(parent.layer.getFrameIndex(window.name))
96
97
  table.reload('activity_followp_table');
97
98
  table.reload('ideas_table')
99
+ table.reload('sale_plan_follow_table')
98
100
  }
99
101
  })
100
102
  return false;