educode_sales 0.9.45 → 0.9.47

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 490547dd6002957fc97b49d5944e48b43476036a6f9090689c457ebdf0ad2167
4
- data.tar.gz: e82a58a5dfdc42d2ad607f6c702a643ed3a91227a42771fdada0034b823340e9
3
+ metadata.gz: 7f238eee39f7340e6339b2b26e6140ac62ce0da5da1f009dbcdc0a146b1566b8
4
+ data.tar.gz: 3fc72b20f031ecaa646083fcc34ca6d4a5702dd2cc770dc7ef83229f9f718674
5
5
  SHA512:
6
- metadata.gz: 42827e0c0a5c605af5bd4ecd2dd4dd82faed892a6697d3c8c684c6d4dd4a3c96e9c67e94e7fe20eedd68c6545dad6ab5a8e66b02f39a3f2048fa8afa0b994f0c
7
- data.tar.gz: 25005c073e6b4f7bf406d6950907a3fe2a95fb68a14d45ade420a663a31d29795292e168614e61501f48c08e53d8b888ba72adac3fffb05bd299b0121d7a7237
6
+ metadata.gz: 3bb437ceeb215fae404672b90276d28c7d454d85815cf846d2c9f7ec9cdd5c32041ba3c4ef1f2f67edbc23192d091351d98009b0f649d174990c7cdd7de73d91
7
+ data.tar.gz: 641baf6fd5b3e9576401d7c0fc142d829237d01b4f3fc9bdc2bd43c91d0921935f51433b13fee229570be5a74b6112516dd5d2adc80851c0344e6e50a32a5eaa
@@ -97,17 +97,20 @@ module EducodeSales
97
97
  format.json do
98
98
  if params[:q] && (params[:q][:clazz] == 'area' || params[:q][:clazz] == 'special')
99
99
  if params[:q][:clazz] == 'special'
100
- school_ids = []
101
- # 专项商机
102
- school_tag_ids = @current_admin.staff_school_tags.pluck(:school_tag_id)
103
- school_ids = SchoolTagMiddle.where(school_tag_id: school_tag_ids).pluck(:school_id)
104
- @businesses = Business.joins("JOIN departments AS dp ON educode_sales_businesses.department_id = dp.id").where("dp.school_id in (?)", school_ids)
105
- elsif params[:q][:clazz] == 'area'
106
- school_ids = []
107
- # 区域管理商机
108
- school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
109
- @businesses = Business.joins("JOIN departments AS dp ON educode_sales_businesses.department_id = dp.id").where("dp.school_id in (?)", school_ids)
110
- end
100
+ school_ids = []
101
+ # 专项商机
102
+ school_tag_ids = @current_admin.staff_school_tags.pluck(:school_tag_id)
103
+ school_ids = SchoolTagMiddle.where(school_tag_id: school_tag_ids).pluck(:school_id)
104
+ @businesses = Business.joins("JOIN departments AS dp ON educode_sales_businesses.department_id = dp.id").where("dp.school_id in (?)", school_ids)
105
+ elsif params[:q][:clazz] == 'area'
106
+ school_ids = []
107
+ # 区域管理商机
108
+ # 排查看区域商机,需要排除掉其它人员手上的监管学校
109
+ other_staff_school_id = EducodeSales::StaffSchool.where.not(staff_id: @current_admin.id).where("school_id IN (SELECT school_id FROM educode_sales_staff_schools WHERE staff_id = #{@current_admin.id}) IS NOT TRUE").distinct.pluck :school_id
110
+
111
+ school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id) - other_staff_school_id
112
+ @businesses = Business.joins("JOIN departments AS dp ON educode_sales_businesses.department_id = dp.id").where("dp.school_id in (?)", school_ids)
113
+ end
111
114
  else
112
115
  if @current_admin.is_admin?
113
116
  @businesses = Business
@@ -118,8 +121,10 @@ module EducodeSales
118
121
  business_ids = Business.joins(last_follow_up: :assign_follow_ups).where("educode_sales_assign_follow_ups.staff_id = ?", @current_admin.id).pluck(:id)
119
122
  @businesses = Business.where("educode_sales_businesses.staff_id = ? OR educode_sales_businesses.id in (?)", @current_admin.id, business_ids)
120
123
  when '区域'
121
-
122
- school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
124
+ # 查看区域商机,需要排除掉其它人员手上的监管学校
125
+ other_staff_school_id = EducodeSales::StaffSchool.where.not(staff_id: @current_admin.id).where("school_id IN (SELECT school_id FROM educode_sales_staff_schools WHERE staff_id = #{@current_admin.id}) IS NOT TRUE").distinct.pluck :school_id
126
+
127
+ school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id) - other_staff_school_id
123
128
  if can?(:special, EducodeSales::Business)
124
129
  # 专项商机
125
130
  school_tag_ids = @current_admin.staff_school_tags.pluck(:school_tag_id)
@@ -178,9 +183,7 @@ module EducodeSales
178
183
  @businesses = EducodeSales::Business.where(id:business_ids)
179
184
  end
180
185
  if params[:q].present? && params[:q][:business_type].present?
181
- @businesses = @businesses.joins("
182
- JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
183
- ").where("educode_sales_follow_ups.clazz_id in (?)", params[:q][:business_type].split(",").map(&:to_i))
186
+ @businesses = @businesses.where("educode_sales_businesses.clazz_id in (?)", params[:q][:business_type].split(",").map(&:to_i))
184
187
  end
185
188
  if params[:q].present? && params[:q][:business_step].present?
186
189
  @businesses = @businesses.joins("
@@ -332,7 +335,7 @@ module EducodeSales
332
335
 
333
336
  def create
334
337
  department = Department.find(params[:department_id])
335
- business = @current_admin.businesses.build(name: params[:name], department_id: department.id, source: params[:source], school_id: department.school_id)
338
+ business = @current_admin.businesses.build(name: params[:name], department_id: department.id, source: params[:source], school_id: department.school_id, clazz_id: params[:clazz_id])
336
339
  if business.save
337
340
  render_success
338
341
  else
@@ -341,6 +344,7 @@ module EducodeSales
341
344
  end
342
345
 
343
346
  def new
347
+ @clazz = Common.where(clazz: 'business_type').order("position").pluck(:name, :id)
344
348
  render layout: false
345
349
  end
346
350
 
@@ -602,9 +606,7 @@ module EducodeSales
602
606
  @businesses = EducodeSales::Business.where(id:business_ids)
603
607
  end
604
608
  if params[:business_type].present?
605
- @businesses = @businesses.joins("
606
- JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
607
- ").where("educode_sales_follow_ups.clazz_id in (?)", params[:business_type].split(",").map(&:to_i))
609
+ @businesses = @businesses.where("educode_sales_businesses.clazz_id in (?)", params[:business_type].split(",").map(&:to_i))
608
610
  end
609
611
  if params[:business_step].present?
610
612
  @businesses = @businesses.joins("
@@ -33,6 +33,25 @@ module EducodeSales
33
33
  render_success
34
34
  end
35
35
 
36
+ def majors
37
+ department = Department.find(params[:id])
38
+ @majors = department.department_majors
39
+ end
40
+
41
+ def major
42
+ department = Department.find(params[:id])
43
+ major = department.department_majors.new(name: params[:name])
44
+ if major.save
45
+ render_success
46
+ else
47
+ render_failure major
48
+ end
49
+ end
50
+
51
+ def new_major
52
+ render layout: false
53
+ end
54
+
36
55
  def index
37
56
  authorize! :read, Customer
38
57
  respond_to do |format|
@@ -137,6 +156,26 @@ module EducodeSales
137
156
  end
138
157
  end
139
158
 
159
+ def update_major
160
+ department = Department.find(params[:id])
161
+ major = department.department_majors.find(params[:major_id])
162
+ if major.update(name: params[:name])
163
+ render_success
164
+ else
165
+ render_failure major
166
+ end
167
+ end
168
+
169
+ def delete_major
170
+ department = Department.find(params[:id])
171
+ major = department.department_majors.find(params[:major_id])
172
+ if major.destroy
173
+ render_success
174
+ else
175
+ render_failure major
176
+ end
177
+ end
178
+
140
179
  def give
141
180
  common = Common.find_by(clazz: 'staff_type', name: '销售')
142
181
  @staffs = Staff.joins(:user).where(job_type: common.id).map { |d| [d.user.real_name, d.id] }
@@ -84,10 +84,10 @@ module EducodeSales
84
84
 
85
85
  follow_up.profit_amount = follow_up.actual_amount - (follow_up.divide_amount.to_i) if follow_up.actual_amount
86
86
  last_follow_up = @business.last_follow_up
87
- if last_follow_up.present?
88
- follow_up.clazz_changed = last_follow_up.clazz_id != follow_up.clazz_id
87
+ if @business.clazz.present?
88
+ follow_up.clazz_changed = @business.clazz_id != follow_up.clazz_id
89
89
  if follow_up.clazz_changed
90
- clazz_changes = "#{last_follow_up.clazz.extras.split('_')[0]}-#{follow_up.clazz.extras.split('_')[0]}"
90
+ clazz_changes = "#{@business.clazz.extras.split('_')[0]}-#{follow_up.clazz.extras.split('_')[0]}"
91
91
  business_clazz_change = EducodeSales::BusinessClazzChange.find_or_initialize_by(business_id: @business.id, clazz_changed: clazz_changes)
92
92
  business_clazz_change.save unless business_clazz_change.persisted?
93
93
  end
@@ -107,7 +107,7 @@ module EducodeSales
107
107
  end
108
108
 
109
109
  end
110
- @business.update(last_follow_up_id: follow_up.id)
110
+ @business.update(last_follow_up_id: follow_up.id, clazz_id: follow_up.clazz_id)
111
111
  # 增加o商机编号
112
112
  add_business_number
113
113
  update_department
@@ -122,6 +122,9 @@ module EducodeSales
122
122
  business = follow_up.business
123
123
  if follow_up.soft_destroy(@current_admin.id)
124
124
  if follow_up.id == business.last_follow_up_id
125
+ if business.follow_ups.last&.clazz_id
126
+ business.clazz_id = business.follow_ups.last&.clazz_id
127
+ end
125
128
  business.update(last_follow_up: business.follow_ups.last, return_money: MoneyPlan.where(clazz: '实际回款', follow_up_id: business.follow_ups.last&.id).sum(:amount))
126
129
  end
127
130
  render_success
@@ -148,6 +151,7 @@ module EducodeSales
148
151
  if follow_up.save
149
152
  # 增加o类商机
150
153
  @business = follow_up.business
154
+ @business.update(clazz_id: follow_up.clazz_id)
151
155
  add_business_number
152
156
  update_department
153
157
  render_success
@@ -192,7 +192,7 @@ module EducodeSales
192
192
  teacher_assists << teacher.teacher_assign_follows.find_or_initialize_by(staff_id: d)
193
193
  end
194
194
  teacher.teacher_assign_follows = teacher_assists
195
-
195
+
196
196
  if params[:user_id].present?
197
197
  user = User.find(params[:user_id])
198
198
  teacher.user_id = user.id
@@ -212,7 +212,7 @@ module EducodeSales
212
212
  teacher = Teacher.find(params[:id])
213
213
  teacher.destroy
214
214
  end
215
-
215
+
216
216
  render_success
217
217
  end
218
218
 
@@ -323,13 +323,18 @@ module EducodeSales
323
323
  @courses = Course.none
324
324
  end
325
325
  end
326
-
326
+
327
327
 
328
328
  def activities
329
329
  teacher = Teacher.find(params[:id])
330
330
  @activities = teacher.activities.page(params[:page]).per(params[:limit])
331
331
  end
332
332
 
333
+ def daily_paper
334
+ @num_1 = @current_admin.operation_plans.where("month >= ? AND month < ?", Time.now.beginning_of_month, Time.now.end_of_month).count
335
+ render layout: false
336
+ end
337
+
333
338
  private
334
339
  def teacher_params
335
340
  params.permit(:name, :professional_title, :job, :source_id, :wechat)
@@ -3,6 +3,7 @@ module EducodeSales
3
3
 
4
4
  validates_uniqueness_of :number ,allow_nil: true
5
5
 
6
+ belongs_to :clazz, class_name: 'Common'
6
7
  belongs_to :staff
7
8
  belongs_to :department
8
9
  belongs_to :last_follow_up, class_name: 'FollowUp', optional: true # 允许last_follow_up_id字段中的数为nil
@@ -226,7 +226,7 @@
226
226
  </script>
227
227
  <style>
228
228
  .layui-table-tool-temp{
229
- padding-right: 0px; !important;
229
+ padding-right: 30px; !important;
230
230
  }
231
231
 
232
232
  </style>
@@ -1,4 +1,7 @@
1
1
  <div class="min-height-table">
2
+
3
+ <table class="layui-hide" id="show_teachers_table" style="min-height: 300px;" lay-filter="teachers_table"></table>
4
+ </div>
2
5
  <script type="text/html" id="teacher_toolbar">
3
6
  <div class="layui-btn-container">
4
7
  <span class="table-label">教师列表</span>
@@ -6,8 +9,6 @@
6
9
  </button>
7
10
  </div>
8
11
  </script>
9
- <table class="layui-hide" id="show_teachers_table" style="min-height: 300px;" lay-filter="teachers_table"></table>
10
- </div>
11
12
  <script type="text/html" id="show_teachersTableBar">
12
13
  <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
13
14
  </script>
@@ -12,7 +12,7 @@ json.data do
12
12
  json.follow_ups_count follow_ups_count
13
13
  follow_count += follow_ups_count
14
14
  json.follow_up_id d.last_follow_up_id
15
- json.clazz d.last_follow_up&.clazz&.name || ""
15
+ json.clazz d.clazz&.name || ""
16
16
  json.clazz_changed d.last_follow_up&.clazz_changed || false
17
17
  json.stage d.last_follow_up&.stage&.name
18
18
  json.invitation_at d.last_follow_up&.invitation_at.to_s
@@ -37,7 +37,7 @@ json.data do
37
37
  # property << '本科军校' if school_property.military_school
38
38
  # property << '企业' if school_property.enterprise
39
39
  # end
40
- if d.department.school
40
+ if d.department&.school
41
41
  json.property d.department.school.school_tags.where(for_missions: true).pluck(:name).join("、")
42
42
  else
43
43
  json.property ''
@@ -51,7 +51,7 @@ json.data do
51
51
  json.wait_return_money d.wait_return_money.to_f.round(2)
52
52
  json.return_money_days d.last_follow_up&.reception_at.present? && d.last_follow_up.money_plans.where(clazz: '实际回款').present? ? (d.last_follow_up.money_plans.where(clazz: '实际回款').order(created_at: :asc).first.date_at.to_s(:date).to_date - d.last_follow_up&.reception_at).to_i : ''
53
53
  json.place d.last_follow_up&.place&.name
54
- json.last_follow_person d.last_follow_up.present? ? d.last_follow_up.staff.user.real_name : EducodeSales::Staff.find(d.staff_id).user.real_name
54
+ json.last_follow_person d.last_follow_up.present? ? d.last_follow_up.staff&.user&.real_name : d.staff&.user&.real_name
55
55
  json.source d.source
56
56
  json.assign_follow_ups d.last_follow_up.present? ? d.last_follow_up.assign_follow_ups.pluck(:staff_id) : []
57
57
  json.current_staff_id @current_admin.id
@@ -21,6 +21,13 @@
21
21
  <div class="layui-inline" style="padding-top: 20px">
22
22
  <p style="padding-left: 40px">请填写提供本商机的人名(如‘张明’);如果为非头歌用户,请增加单位信息(如‘张明,华为公司’)</p>
23
23
  </div>
24
+ <br>
25
+ <div class="layui-inline" style="padding-top: 20px">
26
+ <label class="layui-form-label required">项目类型</label>
27
+ <div class="layui-input-inline">
28
+ <%= select_tag "clazz_id", options_for_select(@clazz), { 'lay-filter': 'clazz_id', class: 'required' } %>
29
+ </div>
30
+ </div>
24
31
  <div class="layui-form-item m-t-20">
25
32
  <div class="layui-input-block">
26
33
  <button class="layui-btn layui-btn-normal" lay-submit lay-filter="create_business">提交</button>
@@ -74,7 +81,8 @@
74
81
  request.authPost("missions/businesses", {
75
82
  department_id: add_department.getValue(),
76
83
  name: data.field.name,
77
- source: data.field.source
84
+ source: data.field.source,
85
+ clazz_id: data.field.clazz_id,
78
86
 
79
87
  }, function (res) {
80
88
  if (res.success == false) {
@@ -16,7 +16,24 @@
16
16
  </div>
17
17
  </div>
18
18
  </form>
19
+ <div>
20
+ <table class="layui-hide" id="major_table" lay-filter="major_table"></table>
21
+ </div>
19
22
  </div>
23
+ <script type="text/html" id="add_major">
24
+ <div class="layui-btn-container">
25
+ <span class="table-label">专业列表</span>
26
+ <% if can? :create_department, EducodeSales::Customer %>
27
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加专业</button>
28
+ <% end %>
29
+ </div>
30
+ </script>
31
+ <script type="text/html" id="tab_major">
32
+ <% if can? :update_department, EducodeSales::Customer %>
33
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
34
+ <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-danger data-count-delete" lay-event="del">删除</a>
35
+ <% end %>
36
+ </script>
20
37
 
21
38
  <script>
22
39
 
@@ -50,5 +67,106 @@
50
67
  })
51
68
  return false;
52
69
  });
70
+
71
+ table.render({
72
+ elem: '#major_table',
73
+ url: '/missions/customers/majors?id=' + parent.department_id ,
74
+ toolbar: '#add_major',
75
+ defaultToolbar: [],
76
+ cols: [
77
+ [
78
+ {
79
+ field: 'id',
80
+ width: 100,
81
+ title:'序号',type: 'numbers',
82
+ },
83
+ {
84
+ field: 'name',
85
+ title: '专业',
86
+ },
87
+ {
88
+ title: '操作',
89
+ width: 190,
90
+ toolbar: '#tab_major',
91
+ align: "center",
92
+ fixed: 'right'
93
+ }
94
+ ]
95
+ ],
96
+ });
97
+
98
+ table.on('toolbar(major_table)', function (obj) {
99
+ if (obj.event === 'add') {
100
+ department_id = parent.department_id;
101
+ var content = miniPage.getHrefContent('/missions/customers/new_major?id=' + parent.department_id);
102
+ var openWH = miniPage.getOpenWidthHeight();
103
+ new_major_index = layer.open({
104
+ title: '添加专业',
105
+ type: 1,
106
+ shade: 0.2,
107
+ maxmin: true,
108
+ shadeClose: true,
109
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
110
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
111
+ content: content,
112
+ success: function (layero, index) {
113
+ form.render('select');
114
+ }
115
+ });
116
+ $(window).on("resize", function () {
117
+ layer.full(index);
118
+ });
119
+ }
53
120
  });
121
+ table.on('tool(major_table)', function (obj) {
122
+ if (obj.event == 'edit') {
123
+ var index = layer.open({
124
+ title: '修改专业名称',
125
+ closeBtn: 0,
126
+ type: 1,
127
+ area: '400px;',
128
+ id: 'LAY_layuipro',
129
+ content: '<div class="layui-form" lay-filter="edit_data" style="padding: 20px;"><input autocomplete="off" type="text" name="name" lay-verify="required" class="layui-input" value="' + obj.data.name +'"/></div>' ,
130
+ btn: ['保存', '取消'],
131
+ btn1: function(index, l) {
132
+ if (l.find("input").val().trim() == '') {
133
+ layer.msg('名称不能为空')
134
+ return false;
135
+ } else {
136
+ request.authPut("missions/customers/" + parent.department_id + "/update_major", {name: l.find("input").val().trim(), major_id: obj.data.id}, function(res) {
137
+ if (res.success == false) {
138
+ layer.alert(res.msg);
139
+ } else {
140
+ table.reload('major_table');
141
+ parent.table.reload('sale_plan_follow_table');
142
+ layer.close(index);
143
+ }
144
+ })
145
+ }
146
+
147
+ return false
148
+ },
149
+ btn2: function(index, l) {
150
+ layer.close(index)
151
+ }
152
+ });
153
+ } else if (obj.event == 'del') {
154
+ var index = layer.open({
155
+ content: '确定删除该专业 ' + obj.data.name + ' 吗',
156
+ yes: function(index, layero){
157
+ request.authDelete("missions/customers/" + parent.department_id + "/delete_major?major_id=" + obj.data.id, {}, function(res) {
158
+ if (res.success == false) {
159
+ layer.alert(res.msg)
160
+ } else {
161
+ table.reload('major_table');
162
+ parent.table.reload('sale_plan_follow_table');
163
+ layer.close(index);
164
+ }
165
+ })
166
+ }
167
+ });
168
+ }
169
+ })
170
+
171
+ });
54
172
  </script>
@@ -0,0 +1,10 @@
1
+ json.data do
2
+ i = 0
3
+ json.array! @majors do |d|
4
+ json.num i + 1
5
+ json.id d.id
6
+ json.name d.name
7
+ end
8
+ end
9
+ json.code 0
10
+ json.count @majors.size
@@ -0,0 +1,40 @@
1
+ <div class="layuimini-main">
2
+ <form class="layui-form layuimini-form">
3
+ <div class="layui-form-item" style="padding: 25px">
4
+ <div class="layui-form-item" style="padding: 25px">
5
+ <div class="layui-inline">
6
+ <label class="layui-form-label required">专业名称</label>
7
+ <div class="layui-input-block" style="width: 300px;">
8
+ <input type="text" name="name" required lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input" >
9
+ </div>
10
+ </div>
11
+ </div>
12
+ <div class="layui-form-item" style="padding-left: 130px">
13
+ <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="add_major_btn">提交</button>
14
+ </div>
15
+ </div>
16
+ </form>
17
+ </div>
18
+
19
+ <script>
20
+ layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
21
+ var form = layui.form,
22
+ request = layui.request,
23
+ $ = layui.$;
24
+
25
+ form.on('submit(add_major_btn)', function (data) {
26
+ data.field.school_id = parent.school_id
27
+ request.authPost("missions/customers/"+ parent.department_id +"/major", data.field, function (res) {
28
+ if (res.success === false) {
29
+ layer.alert(res.msg)
30
+ } else {
31
+ layer.close(parent.new_department_index); //关闭所有层
32
+ parent.table.reload('major_table');
33
+ parent.table.reload('sale_plan_follow_table');
34
+ layer.close(parent.new_major_index);
35
+ }
36
+ })
37
+ return false;
38
+ });
39
+ });
40
+ </script>
@@ -4,6 +4,7 @@ json.data do
4
4
  # json.created_at d.created_at.to_s
5
5
  # json.staff d.staff.user.real_name
6
6
  json.department d.name
7
+ json.department_major d.department_majors.pluck(:name).join("、")
7
8
  # json.content d.content
8
9
  # json.is_latest d.id == @latest.id
9
10
  end
@@ -51,6 +51,11 @@
51
51
  {
52
52
  field: 'department',
53
53
  title: '学院/部门',
54
+ width: 200,
55
+ },
56
+ {
57
+ field: 'department_major',
58
+ title: '专业',
54
59
  },
55
60
  {
56
61
  title: '操作',
@@ -131,7 +136,7 @@
131
136
  layer.full(index);
132
137
  });
133
138
  } else if (obj.event === 'edit') {
134
- department_id = obj.data.id
139
+ department_id = obj.data.id;
135
140
  content = miniPage.getHrefContent('/missions/customers/edit_department?id='+ obj.data.id);
136
141
  openWH = miniPage.getOpenWidthHeight();
137
142
  edit_index1 = layer.open({
@@ -0,0 +1,68 @@
1
+ <div style="padding: 15px;" id="day_content">
2
+ <h2>生态经理日报-转正后</h2>
3
+ <hr>
4
+ <div style="height: 450px;overflow: auto;">
5
+
6
+ <p>一、数据指标</p>
7
+ <p>1、【教师合作-老客户运营】</p>
8
+ <p>本月目标<%= @num_1 %>人;</p>
9
+ <p>累计完成xx人; </p>
10
+ <p>今日已完成沟通xx人;</p>
11
+ <p style="margin-bottom: 30px;">今日已完成新建课堂xx个;</p>
12
+ <p>2、【市场活动-新客户注册】</p>
13
+ <p>本月目标xx人;</p>
14
+ <p>累计完成xx人;</p>
15
+ <p style="margin-bottom: 30px;">今日已完成转化注册xx人;</p>
16
+ <p>3、课程建设-新型态教材合作】</p>
17
+ <p>本月目标xx门课程(教材);</p>
18
+ <p>累计完成xx门课程(教材);</p>
19
+ <p style="margin-bottom: 30px;">今日已完成挖掘xx门课程(教材);</p>
20
+ <p>二、客户跟进情况</p>
21
+ <p style="margin-bottom: 30px;">(填写每日重点客户沟通内容,可涵盖总部安排的重要工作事项) </p>
22
+ <p>三、商机与项目线索</p>
23
+ <p style="margin-bottom: 30px;">(在运营过程中发现的商机以及小toB非招标项目商机:saas课程、在线考试等)</p>
24
+ <p>四、需要支持事宜索</p>
25
+ <p style="margin-bottom: 30px;">(业务上遇到的难点问题)</p>
26
+ </div>
27
+
28
+ <% text = "\n" %>
29
+ <% text += "一、数据指标\n" %>
30
+ <% text += "1、【教师合作-老客户运营】\n" %>
31
+ <% text += "本月目标xx人;\n" %>
32
+ <% text += "累计完成xx人;\n" %>
33
+ <% text += "今日已完成沟通xx人;\n" %>
34
+ <% text += "今日已完成新建课堂xx个;\n\n" %>
35
+ <% text += "2、【市场活动-新客户注册】\n" %>
36
+ <% text += "本月目标xx人\n" %>
37
+ <% text += "累计完成xx人\n" %>
38
+ <% text += "今日已完成挖掘xx门课程(教材)\n\n" %>
39
+ <% text += "3、课程建设-新型态教材合作】\n" %>
40
+ <% text += "本月目标xx门课程(教材);\n" %>
41
+ <% text += "累计完成xx门课程(教材);\n" %>
42
+ <% text += "今日已完成挖掘xx门课程(教材);\n\n" %>
43
+ <% text += "二、客户跟进情况\n" %>
44
+ <% text += "(填写每日重点客户沟通内容,可涵盖总部安排的重要工作事项\n\n" %>
45
+ <% text += "三、商机与项目线索\n" %>
46
+ <% text += "(在运营过程中发现的商机以及小toB非招标项目商机:saas课程、在线考试等)\n\n" %>
47
+ <% text += "四、需要支持事宜索\n" %>
48
+ <% text += "(业务上遇到的难点问题)\n\n" %>
49
+ <% text += "头歌营销系统 \n"%>
50
+ <% text += "#{Time.now.to_s}"%>
51
+ <div id="content" style="display: none;" data-content="生态经理日报-转正后<%=text %>"></div>
52
+ <p>头歌营销系统</p>
53
+ <p><%= Time.now.to_s %></p>
54
+ <button type="button" onclick="copy()" style=" margin-right: 20px; float: right;" class="layui-btn layui-btn-primary">复制</button>
55
+ </div>
56
+ <script>
57
+ function copy() {
58
+ var copyText = document.getElementById("content").dataset.content;
59
+ var textArea = document.createElement("textarea");
60
+ textArea.value = copyText;
61
+ document.body.appendChild(textArea);
62
+ textArea.select();
63
+ if (document.execCommand("Copy")) {
64
+ layer.msg('已复制到剪贴板');
65
+ textArea.remove();
66
+ }
67
+ }
68
+ </script>
@@ -81,7 +81,11 @@
81
81
  <% if can? :create, EducodeSales::Teacher %>
82
82
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="import">导入数据</button>
83
83
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加老师</button>
84
- <% end %>
84
+ <% end %>
85
+ <!-- <div class="layui-btn-container">
86
+ <span class="table-label">跟进动态</span>
87
+ <a class="layui-btn layui-btn-normal layui-btn-sm" style="margin-left: 20px;" lay-event="report_day">日报</a>
88
+ </div> -->
85
89
  <!-- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="search_new"> 搜索添加 -->
86
90
  </button>
87
91
  </div>
@@ -117,7 +121,6 @@
117
121
  <a href="javascript:void(0);" lay-event="follow" class="layui-table-link">{{ d.teacher_follows_count }}</a>
118
122
  </script>
119
123
 
120
-
121
124
  <script>
122
125
  layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate'], function () {
123
126
  var $ = layui.jquery,
@@ -469,6 +472,21 @@
469
472
  $(window).on("resize", function () {
470
473
  layer.full(index);
471
474
  });
475
+ } else if (obj.event === 'report_day') {
476
+ content = miniPage.getHrefContent('/missions/teachers/daily_paper');
477
+ openWH = miniPage.getOpenWidthHeight();
478
+ index = layer.open({
479
+ title: '',
480
+ type: 1,
481
+ shade: 0.2,
482
+ // maxmin: true,
483
+ shadeClose: true,
484
+ area: ['600px', '600px'],
485
+ content: content
486
+ });
487
+ $(window).on("resize", function () {
488
+ layer.full(index);
489
+ });
472
490
  }
473
491
  });
474
492
 
@@ -9,7 +9,7 @@ json.data do
9
9
  json.professional_title d.professional_title
10
10
  json.job d.job
11
11
  json.user_id d.user_id
12
- json.login d.user_id ? d.user.login : ''
12
+ json.login d.user&.login || ''
13
13
  json.course_subjects_count d.course_subjects_count
14
14
  json.teacher_follows_count d.teacher_follows_count
15
15
  json.activities_count d.activity_teachers_count
data/config/routes.rb CHANGED
@@ -38,6 +38,8 @@ EducodeSales::Engine.routes.draw do
38
38
  get :edit_department
39
39
  get :give
40
40
  post :batch_update_school_tags
41
+ get :majors
42
+ get :new_major
41
43
  end
42
44
 
43
45
  member do
@@ -45,6 +47,9 @@ EducodeSales::Engine.routes.draw do
45
47
  put :update_follow_up
46
48
  post :create_department
47
49
  put :update_department
50
+ post :major
51
+ put :update_major
52
+ delete :delete_major
48
53
  end
49
54
  end
50
55
 
@@ -217,6 +222,7 @@ EducodeSales::Engine.routes.draw do
217
222
  get :edit_follow_record
218
223
  get :course_list
219
224
  get :activities
225
+ get :daily_paper
220
226
  end
221
227
 
222
228
  member do
@@ -0,0 +1,5 @@
1
+ class AddMobileToTeachers < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_teachers, :mobile, :string
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class AddClazzIdToBusiness < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_businesses, :clazz_id, :integer
4
+ EducodeSales::Business.all.each do |d|
5
+ d.update(clazz_id: d.last_follow_up&.clazz_id)
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.45'
2
+ VERSION = '0.9.47'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.45
4
+ version: 0.9.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-12 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -274,9 +274,11 @@ files:
274
274
  - app/views/educode_sales/customers/give.html.erb
275
275
  - app/views/educode_sales/customers/index.html.erb
276
276
  - app/views/educode_sales/customers/index.json.jbuilder
277
+ - app/views/educode_sales/customers/majors.json.jbuilder
277
278
  - app/views/educode_sales/customers/new.html.erb
278
279
  - app/views/educode_sales/customers/new_department.html.erb
279
280
  - app/views/educode_sales/customers/new_follow_record.html.erb
281
+ - app/views/educode_sales/customers/new_major.html.erb
280
282
  - app/views/educode_sales/customers/show_department.json.jbuilder
281
283
  - app/views/educode_sales/customers/show_follow.html.erb
282
284
  - app/views/educode_sales/customers/show_follow.json.jbuilder
@@ -407,6 +409,7 @@ files:
407
409
  - app/views/educode_sales/teachers/add_keys.html.erb
408
410
  - app/views/educode_sales/teachers/course_list.json.jbuilder
409
411
  - app/views/educode_sales/teachers/course_subject.json.jbuilder
412
+ - app/views/educode_sales/teachers/daily_paper.html.erb
410
413
  - app/views/educode_sales/teachers/edit.html.erb
411
414
  - app/views/educode_sales/teachers/edit_follow_record.html.erb
412
415
  - app/views/educode_sales/teachers/import.html.erb
@@ -493,6 +496,8 @@ files:
493
496
  - db/migrate/20230117144025_create_educode_sales_business_clazz_changes.rb
494
497
  - db/migrate/20230206080303_create_educode_sales_staff_school_tags.rb
495
498
  - db/migrate/20230209102302_create_educode_sales_staff_permissions.rb
499
+ - db/migrate/20230215141612_add_mobile_to_teachers.rb
500
+ - db/migrate/20230220144737_add_clazz_id_to_business.rb
496
501
  - lib/educode_sales.rb
497
502
  - lib/educode_sales/engine.rb
498
503
  - lib/educode_sales/version.rb