educode_sales 0.9.46 → 0.9.48

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: 7444b7d61d8ff5a5677b765e4d0580a49a3b425de52ffec51e0f4bce62b5d125
4
- data.tar.gz: 2752a018874ad957014ceff871ee1ef7cb77d8ea0300c0da9a1112344c579d51
3
+ metadata.gz: d4f2290fab449d9d2d89dfe4bfcd53904620bbd2148eac5c5b8d7836c453929a
4
+ data.tar.gz: af6f9ed2d1aaa95fc752f36929673464a69ccda4d8629dc15751572ca477391d
5
5
  SHA512:
6
- metadata.gz: 5a4e87f3e97aa8604d7656e36e044943129e6ee19414bc5a2ba2d6d5d1f8150797d9a0cd0e254693f74535cde2d1f9aa9eb27027cdb2f6dfae548c3bd1276435
7
- data.tar.gz: 05c6ce1070251dd40fb903ef901517228ebaddaa7690d84ac94f141768e6c065c0c31b7785d0eea71dc9aacba98ff548fb699b6a595a5877056c9b2a308c84d4
6
+ metadata.gz: f0bb000ce973b2a6cf8b1d2aeafb74e109b034954dbb754e9b1e612ed9f59d621ed77ff94d671b18e675770d426298df25bcc8683210237dec10ce5d958c8bd5
7
+ data.tar.gz: 9ebb366971b1b98eafff7415dcc7f6cb65df46d5068d6711ab14492298226b71c3c9b34c9b1dc9d42ecddf61f1cad1eb43374232ab73bc3d2ecd6d9381b47504
@@ -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("
@@ -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>
@@ -3,13 +3,13 @@ json.data do
3
3
  json.id d.id
4
4
  json.number d.number
5
5
  json.name d.name
6
- json.department d.department.name
7
- json.school d.department.school.name
8
- json.school_id d.department.school.id
6
+ json.department d.department&.name
7
+ json.school d.department&.school&.name
8
+ json.school_id d.department&.school_id
9
9
  follow_ups_count = d['follow_ups_count'] || 0
10
10
  json.follow_ups_count follow_ups_count
11
11
  json.follow_up_id d.last_follow_up_id
12
- json.clazz d.last_follow_up&.clazz&.name || ""
12
+ json.clazz d.clazz&.name || ""
13
13
  json.stage d.last_follow_up&.stage&.name
14
14
  json.invitation_at d.last_follow_up&.invitation_at.to_s
15
15
  json.reception_at d.last_follow_up&.reception_at.to_s
@@ -27,17 +27,22 @@ json.data do
27
27
  json.divide_rate d.divide_rate
28
28
  json.divide_money d.divide_amount
29
29
  json.budget_amount d.budget_amount
30
- json.area d.department.school.province
31
- school_property = d.department.school.school_property
32
- property = []
30
+ json.area d.department&.school&.province
31
+ # school_property = d.department&.school&.school_property
32
+ # property = []
33
33
 
34
- if school_property.present?
35
- property << '本科地方院校' if school_property.regular_college || school_property.project_985 || school_property.project_211
36
- property << '高职' if school_property.junior_college || school_property.secondary_school
37
- property << '本科军校' if school_property.military_school
38
- property << '企业' if school_property.enterprise
34
+ # if school_property.present?
35
+ # property << '本科地方院校' if school_property.regular_college || school_property.project_985 || school_property.project_211
36
+ # property << '高职' if school_property.junior_college || school_property.secondary_school
37
+ # property << '本科军校' if school_property.military_school
38
+ # property << '企业' if school_property.enterprise
39
+ # end
40
+ # json.property property.join("、")
41
+ if d.department&.school
42
+ json.property d.department.school.school_tags.where(for_missions: true).pluck(:name).join("、")
43
+ else
44
+ json.property ''
39
45
  end
40
- json.property property.join("、")
41
46
  json.sale_way d.last_follow_up&.place&.name.present? ? '渠道' : '直销'
42
47
  json.actual_amount d.last_follow_up&.actual_amount.to_f.round(2)
43
48
  json.return_money d.return_money
@@ -5,14 +5,14 @@ json.data do
5
5
  json.id d.id
6
6
  json.number d.number
7
7
  json.name d.name
8
- json.department d.department.name
9
- json.school d.department.school.name
10
- json.school_id d.department.school.id
8
+ json.department d.department&.name
9
+ json.school d.department&.school&.name
10
+ json.school_id d.department&.school_id
11
11
  follow_ups_count = d['follow_ups_counts'] || 0
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
@@ -27,7 +27,7 @@ json.data do
27
27
  json.divide_rate d.divide_rate
28
28
  json.divide_money d.divide_amount.to_f.round(2)
29
29
  json.budget_amount d.budget_amount.to_f.round(2) #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
30
- json.area d.department.school.province
30
+ json.area d.department&.school&.province
31
31
  # school_property = d.department.school.school_property
32
32
  # property = []
33
33
 
@@ -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) {
@@ -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
@@ -222,6 +222,7 @@ EducodeSales::Engine.routes.draw do
222
222
  get :edit_follow_record
223
223
  get :course_list
224
224
  get :activities
225
+ get :daily_paper
225
226
  end
226
227
 
227
228
  member do
@@ -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.46'
2
+ VERSION = '0.9.48'
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.46
4
+ version: 0.9.48
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-17 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
@@ -409,6 +409,7 @@ files:
409
409
  - app/views/educode_sales/teachers/add_keys.html.erb
410
410
  - app/views/educode_sales/teachers/course_list.json.jbuilder
411
411
  - app/views/educode_sales/teachers/course_subject.json.jbuilder
412
+ - app/views/educode_sales/teachers/daily_paper.html.erb
412
413
  - app/views/educode_sales/teachers/edit.html.erb
413
414
  - app/views/educode_sales/teachers/edit_follow_record.html.erb
414
415
  - app/views/educode_sales/teachers/import.html.erb
@@ -496,6 +497,7 @@ files:
496
497
  - db/migrate/20230206080303_create_educode_sales_staff_school_tags.rb
497
498
  - db/migrate/20230209102302_create_educode_sales_staff_permissions.rb
498
499
  - db/migrate/20230215141612_add_mobile_to_teachers.rb
500
+ - db/migrate/20230220144737_add_clazz_id_to_business.rb
499
501
  - lib/educode_sales.rb
500
502
  - lib/educode_sales/engine.rb
501
503
  - lib/educode_sales/version.rb