educode_sales 0.4.6 → 0.4.7

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/educode_sales/home_controller.rb +4 -0
  3. data/app/controllers/educode_sales/operation_plans_controller.rb +4 -0
  4. data/app/controllers/educode_sales/operation_reports_controller.rb +6 -0
  5. data/app/controllers/educode_sales/operations_controller.rb +1 -1
  6. data/app/controllers/educode_sales/plans_controller.rb +12 -4
  7. data/app/controllers/educode_sales/sale_reports_controller.rb +6 -0
  8. data/app/controllers/educode_sales/sale_trends_controller.rb +6 -5
  9. data/app/views/educode_sales/activities/show_teachers.html.erb +16 -16
  10. data/app/views/educode_sales/businesses/index.html.erb +9 -9
  11. data/app/views/educode_sales/businesses/show_follow.html.erb +1 -1
  12. data/app/views/educode_sales/home/search_operation_teacher.json.jbuilder +12 -0
  13. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +7 -7
  14. data/app/views/educode_sales/operation_plans/_monthly.html.erb +4 -4
  15. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +8 -8
  16. data/app/views/educode_sales/operation_plans/_weekly.html.erb +5 -5
  17. data/app/views/educode_sales/operation_plans/new_month.html.erb +34 -3
  18. data/app/views/educode_sales/operation_plans/new_monthly.html.erb +12 -0
  19. data/app/views/educode_sales/operation_plans/new_week.html.erb +32 -4
  20. data/app/views/educode_sales/operation_plans/new_weekly.html.erb +12 -0
  21. data/app/views/educode_sales/operation_reports/audit.html.erb +12 -0
  22. data/app/views/educode_sales/operation_reports/edit.html.erb +12 -0
  23. data/app/views/educode_sales/operation_reports/show.html.erb +12 -0
  24. data/app/views/educode_sales/plans/_monthPlan.html.erb +8 -8
  25. data/app/views/educode_sales/plans/_monthly.html.erb +3 -3
  26. data/app/views/educode_sales/plans/_weekPlan.html.erb +7 -7
  27. data/app/views/educode_sales/plans/_weekly.html.erb +4 -4
  28. data/app/views/educode_sales/plans/edit_month.html.erb +1 -1
  29. data/app/views/educode_sales/plans/edit_week.html.erb +1 -1
  30. data/app/views/educode_sales/plans/new_month.html.erb +1 -1
  31. data/app/views/educode_sales/plans/new_monthly.html.erb +12 -0
  32. data/app/views/educode_sales/plans/new_week.html.erb +1 -1
  33. data/app/views/educode_sales/plans/new_weekly.html.erb +12 -0
  34. data/app/views/educode_sales/sale_reports/audit.html.erb +12 -0
  35. data/app/views/educode_sales/sale_reports/edit.html.erb +12 -0
  36. data/app/views/educode_sales/sale_reports/show.html.erb +12 -0
  37. data/app/views/educode_sales/teachers/index.html.erb +2 -2
  38. data/app/views/educode_sales/teachers/show_follow.html.erb +1 -1
  39. data/app/views/layouts/educode_sales/application.html.erb +4 -1
  40. data/config/routes.rb +1 -0
  41. data/lib/educode_sales/version.rb +1 -1
  42. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5ec520db3019e20ddbbd8615880ee3060fdd6d6e5f859130dfb0b0845be8f6d
4
- data.tar.gz: 7f678fb5d8c6b9dd77dc8c002b49f1e7228d8ce30b3eddb77fb2e7717b93d1d4
3
+ metadata.gz: 2e609ed864a33df3f8398ab53416e7652333965a094df7965414cd93058e0965
4
+ data.tar.gz: b506ac92b247f3bbdebb03ffa7e5d7e4c5bd48d0ac4e68a01919d81137cf175d
5
5
  SHA512:
6
- metadata.gz: 7ffcbfc616f3ab9241834c9642dfc13e8d18a1ea7c5bc16edcb46398503f80456e2fee80a09da8fec8377a748f0f60a56e4fdf53640470a1e7521a160642a7b7
7
- data.tar.gz: 3dd3605a2b1f4cd3469201c87dc7237bb76c01ea6da7cb968e81fd5702b57ab847c919a176a792cb3b7c47547bcc1dad06711cc38dda351935f7096d87001fc1
6
+ metadata.gz: 5ef7c7f3635c83459308d71cc80e89a6f1e45b38e0fec1c65d53fe469f4fb4d75a5b1c2982cd04c7cf4fc66299742275b8fe1f655f6f656f525fb40abceac5b0
7
+ data.tar.gz: 943c29ffb564e3cc318c3bc55ce6daf4dd08e5986039f463abac740d6626d6e6b062300280e0b015cc4ce31114ffe913350e0ec95540cdf70add0ee000ac0bc2
@@ -33,6 +33,10 @@ module EducodeSales
33
33
  @data += User.joins(:user_extension).where.not(id: user_ids).where("identity='teacher'", user_ids).where("lastname like ?", "%#{params[:q]}%").limit(50)
34
34
  end
35
35
 
36
+ def search_operation_teacher
37
+ @data = Teacher.where("name like ? and is_key = false", "%#{params[:q]}%").limit(20)
38
+ end
39
+
36
40
  def search_edu_teacher
37
41
  @data = User.joins(:user_extension).where("identity='teacher'").where("concat(lastname, firstname) like :q OR phone like :q OR mail like :q", q: "%#{params[:q]}%").limit(50)
38
42
  end
@@ -77,6 +77,8 @@ module EducodeSales
77
77
  end
78
78
 
79
79
  def new_weekly
80
+ @area =@current_admin.areas.present? ? @current_admin.areas.pluck(:name).join("、") : ''
81
+ @name = @current_admin.user.real_name
80
82
  sale_plans = OperationPlan.where(month: Time.now.strftime("%Y-%m") + "-01 00:00:00", weekly: Time.now.strftime('%W').to_i, staff_id: @current_admin.id)
81
83
  @rate = sale_plans.present? ? (sale_plans.sum("finish_rate") / sale_plans.size) : 0
82
84
  @departments_count = sale_plans.joins(:teacher).count("distinct(department_id)")
@@ -92,6 +94,8 @@ module EducodeSales
92
94
  end
93
95
 
94
96
  def new_monthly
97
+ @area =@current_admin.areas.present? ? @current_admin.areas.pluck(:name).join("、") : ''
98
+ @name = @current_admin.user.real_name
95
99
  sale_plans = OperationPlan.where(month: Time.now.strftime("%Y-%m") + "-01 00:00:00", staff_id: @current_admin.id, weekly: nil)
96
100
  @rate = sale_plans.present? ? (sale_plans.sum("finish_rate") / sale_plans.size) : 0
97
101
  @departments_count = sale_plans.joins(:teacher).count("distinct(department_id)")
@@ -67,6 +67,8 @@ module EducodeSales
67
67
 
68
68
  def show
69
69
  @sale_report = OperationReport.find(params[:id])
70
+ @name = @sale_report.staff.user.real_name
71
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
70
72
  render layout: false
71
73
  end
72
74
 
@@ -78,6 +80,8 @@ module EducodeSales
78
80
 
79
81
  def edit
80
82
  @sale_report = OperationReport.find(params[:id])
83
+ @name = @sale_report.staff.user.real_name
84
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
81
85
  render layout: false
82
86
  end
83
87
 
@@ -113,6 +117,8 @@ module EducodeSales
113
117
 
114
118
  def audit
115
119
  @sale_report = OperationReport.find(params[:id])
120
+ @name = @sale_report.staff.user.real_name
121
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
116
122
  render layout: false
117
123
  end
118
124
 
@@ -4,7 +4,7 @@ module EducodeSales
4
4
  class OperationsController < ApplicationController
5
5
 
6
6
  def trends
7
- @years = (1..(Time.now.year - 2020)).map { |d| 2020 + d }
7
+ @years = (1..(Time.now.year - 2014)).map { |d| 2014 + d }
8
8
  @year = params[:year] ? params[:year] : Time.now.year
9
9
  @operation_trend = OperationTrend.find_or_create_by(year: @year)
10
10
  @inc_users_count = User.where("created_on > ? AND created_on <= ?", "#{@year}-01-01 00:00:00", "#{@year}-12-31 23:59:59").count
@@ -80,11 +80,14 @@ module EducodeSales
80
80
  end
81
81
  ids = AssignFollowUp.where(staff_id: @current_admin.id).pluck(:follow_up_id)
82
82
  ids1 = FollowUp.where(id: ids).pluck(:business_id)
83
- @businesses =Business.where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids1, @current_admin.id).pluck(:name, :id)
83
+ @businesses =Business.includes(:department, :last_follow_up).where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids1, @current_admin.id)
84
+ @businesses = @businesses.map { |b| [b.name + "(" + b.department.school.name + ")" + "---" + "最新跟进:" + (b.last_follow_up.present? ? b.last_follow_up.created_at.to_s : '无'), b.id] }
84
85
  render layout: false
85
86
  end
86
87
 
87
88
  def new_weekly
89
+ @area =@current_admin.areas.present? ? @current_admin.areas.pluck(:name).join("、") : ''
90
+ @name = @current_admin.user.real_name
88
91
  sale_plans = SalePlan.where(month: Time.now.strftime("%Y-%m") + "-01 00:00:00", weekly: Time.now.strftime('%W').to_i, staff_id: @current_admin.id)
89
92
  @rate = sale_plans.present? ? (sale_plans.sum("finish_rate") / sale_plans.size) : 0
90
93
  @departments_count = sale_plans.joins(:business).count("distinct(department_id)")
@@ -96,11 +99,14 @@ module EducodeSales
96
99
  @business = Business.find_by(id: params[:business_id])
97
100
  ids = AssignFollowUp.where(staff_id: @current_admin.id).pluck(:follow_up_id)
98
101
  ids1 = FollowUp.where(id: ids).pluck(:business_id)
99
- @businesses =Business.where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids1, @current_admin.id).pluck(:name, :id)
102
+ @businesses =Business.includes(:department, :last_follow_up).where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids1, @current_admin.id)
103
+ @businesses = @businesses.map { |b| [b.name + "(" + b.department.school.name + ")" + "---" + "最新跟进:" + (b.last_follow_up.present? ? b.last_follow_up.created_at.to_s : '无'), b.id] }
100
104
  render layout: false
101
105
  end
102
106
 
103
107
  def new_monthly
108
+ @area =@current_admin.areas.present? ? @current_admin.areas.pluck(:name).join("、") : ''
109
+ @name = @current_admin.user.real_name
104
110
  sale_plans = SalePlan.where(month: Time.now.strftime("%Y-%m") + "-01 00:00:00", staff_id: @current_admin.id, weekly: nil)
105
111
  @rate = sale_plans.present? ? (sale_plans.sum("finish_rate") / sale_plans.size) : 0
106
112
  @departments_count = sale_plans.joins(:business).count("distinct(department_id)")
@@ -127,7 +133,8 @@ module EducodeSales
127
133
  end
128
134
 
129
135
  def edit_week
130
- @businesses = @current_admin.businesses.pluck(:name, :id)
136
+ @businesses = @current_admin.businesses
137
+ @businesses = @businesses.map { |b| [b.name + "(" + b.department.school.name + ")" + "---" + "最新跟进:" + (b.last_follow_up.present? ? b.last_follow_up.created_at.to_s : '无'), b.id] }
131
138
  @sale_plan = SalePlan.find(params[:id])
132
139
  if @sale_plan.weekly.present?
133
140
  week = Time.now.strftime('%W').to_i
@@ -173,7 +180,8 @@ module EducodeSales
173
180
  end
174
181
 
175
182
  def edit_month
176
- @businesses = @current_admin.businesses.pluck(:name, :id)
183
+ @businesses = @current_admin.businesses
184
+ @businesses = @businesses.map { |b| [b.name + "(" + b.department.school.name + ")" + "---" + "最新跟进:" + (b.last_follow_up.present? ? b.last_follow_up.created_at.to_s : '无'), b.id] }
177
185
  @sale_plan = SalePlan.find(params[:id])
178
186
  @finish_rates = []
179
187
  11.times { |d| @finish_rates << ["#{d*10}%", d * 10]}
@@ -23,6 +23,8 @@ module EducodeSales
23
23
 
24
24
  def show
25
25
  @sale_report = SaleReport.find(params[:id])
26
+ @name = @sale_report.staff.user.real_name
27
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
26
28
  render layout: false
27
29
  end
28
30
 
@@ -83,6 +85,8 @@ module EducodeSales
83
85
 
84
86
  def edit
85
87
  @sale_report = SaleReport.find(params[:id])
88
+ @name = @sale_report.staff.user.real_name
89
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
86
90
  render layout: false
87
91
  end
88
92
 
@@ -118,6 +122,8 @@ module EducodeSales
118
122
 
119
123
  def audit
120
124
  @sale_report = SaleReport.find(params[:id])
125
+ @name = @sale_report.staff.user.real_name
126
+ @area = @sale_report.staff.areas.present? ? @sale_report.staff.areas.pluck(:name).join("、") : ''
121
127
  render layout: false
122
128
  end
123
129
 
@@ -7,17 +7,18 @@ module EducodeSales
7
7
  def trends
8
8
  # authorize! :trends, EducodeSales::SaleTrend
9
9
  @year = params[:year] ? params[:year] : Time.now.year
10
- @years = (1..(Time.now.year - 2020)).map { |d| 2020 + d }
10
+ @years = (1..(Time.now.year - 2014)).map { |d| 2014 + d }
11
11
  year_time = "#{@year}-01-01 00:00:00"
12
+ year_over_time = "#{@year}-12-31 23:59:59"
12
13
  x = Common.find_by(extras: EducodeSales::Common::XTYPE)&.id
13
14
  o = Common.find_by(extras: EducodeSales::Common::OTYPE)&.id
14
15
  @sale_trend = SaleTrend.find_or_create_by(year: @year)
15
- @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).where("educode_sales_follow_ups.created_at >= ?", year_time).sum(:total_amount).round(2)
16
+ @business_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.clazz_id != ?", x, o).sum(:total_amount).round(2)
16
17
  stage_ids = Common.where(clazz: '商机阶段', name: ['已中标','已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
17
- @goal_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.created_at >= ? AND educode_sales_follow_ups.stage_id IN (?)", year_time, stage_ids).sum(:total_amount).round(2)
18
+ @goal_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.created_at >= ? AND educode_sales_follow_ups.created_at <= ? AND educode_sales_follow_ups.stage_id IN (?)", year_time, year_over_time, stage_ids).sum(:total_amount).round(2)
18
19
  s_stage_ids = Common.where(clazz: '商机阶段', name: ['已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
19
- @service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.created_at >= ? AND educode_sales_follow_ups.stage_id IN (?)", year_time, s_stage_ids).sum(:total_amount).round(2)
20
- @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at >= ?", year_time).sum(:amount).round(2)
20
+ @service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.created_at >= ? AND educode_sales_follow_ups.created_at <= ? AND educode_sales_follow_ups.stage_id IN (?)", year_time, year_over_time, s_stage_ids).sum(:total_amount).round(2)
21
+ @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at >= ? AND educode_sales_follow_ups.created_at <= ? ", year_time, year_over_time).sum(:amount).round(2)
21
22
  a = Common.where(clazz: '商机类型', name: 'A类').pluck(:id)
22
23
  @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).sum(:total_amount).round(2)
23
24
  b = Common.where(clazz: '商机类型', name: 'B类').pluck(:id)
@@ -1,3 +1,4 @@
1
+ <div class="min-height-table">
1
2
  <script type="text/html" id="teacher_toolbar">
2
3
  <div class="layui-btn-container">
3
4
  <span class="table-label">教师列表</span>
@@ -5,7 +6,6 @@
5
6
  </button>
6
7
  </div>
7
8
  </script>
8
- <div class="layuimini-main edit-table">
9
9
  <table class="layui-hide" id="show_teachers_table" style="min-height: 300px;" lay-filter="teachers_table"></table>
10
10
  </div>
11
11
  <script type="text/html" id="show_teachersTableBar">
@@ -53,84 +53,84 @@
53
53
  elem: '#show_teachers_table',
54
54
  url: '/missions/teachers?activity_id=' + parent.activity_id,
55
55
  toolbar: '#teacher_toolbar',
56
- defaultToolbar: [],
56
+ defaultToolbar: ['filter'],
57
57
  cols: [
58
58
  [
59
59
  {
60
60
  field: 'id',
61
- width: 120,
61
+ width: 60,
62
62
  title:'序号',type: 'numbers',
63
63
  },
64
64
  {
65
65
  field: 'name',
66
- width: 120,
66
+ width: 90,
67
67
  title: '姓名',
68
68
  templet: "#name"
69
69
  },
70
70
  {
71
71
  field: 'school',
72
- width: 190,
72
+ width: 120,
73
73
  title: '单位',
74
74
  },
75
75
  {
76
76
  field: 'department',
77
- width: 190,
77
+ width: 120,
78
78
  title: '部门'
79
79
  },
80
80
  {
81
81
  field: 'professional_title',
82
82
  title: '职称',
83
- width: 120,
83
+ width: 80,
84
84
  templet: '#show_follow'
85
85
  },
86
86
  {
87
87
  field: 'job',
88
- width: 120,
88
+ width: 80,
89
89
  title: '职务',
90
90
  templet: '#show_keys'
91
91
 
92
92
  },
93
93
  {
94
94
  field: 'source',
95
- width: 120,
95
+ width: 100,
96
96
  title: '来源',
97
97
  },
98
98
  {
99
99
  field: 'attitude',
100
- width: 120,
100
+ width: 80,
101
101
  title: '态度',
102
102
  },
103
103
  {
104
104
  field: 'course_subjects_count',
105
- width: 120,
105
+ width: 90,
106
106
  title: '课程方向',
107
107
  templet: "#courses"
108
108
  },
109
109
  {
110
110
  field: 'teacher_follows_count',
111
- width: 120,
111
+ width: 90,
112
112
  title: '跟进情况',
113
113
  templet: "#follow"
114
114
  },
115
115
  {
116
116
  field: 'teacher_used',
117
- width: 120,
117
+ width: 110,
118
118
  title: '学院渗透率',
119
119
  },
120
120
  {
121
121
  field: 'students',
122
- width: 120,
122
+ width: 60,
123
123
  title: '学生',
124
124
  },
125
125
  {
126
126
  field: 'courses_count',
127
- width: 120,
127
+ width: 60,
128
128
  title: '课堂',
129
129
  templet: "#class"
130
130
  },
131
131
  {
132
132
  field: 'activities_count',
133
- width: 120,
133
+ width: 100,
134
134
  title: '参与活动',
135
135
  templet: "#event"
136
136
  },
@@ -114,9 +114,9 @@
114
114
  elem: '#businesses_table',
115
115
  url: '/missions/businesses',
116
116
  where: {q: form.val('search_form')},
117
+ defaultToolbar: ['filter'],
117
118
  toolbar: '#bussinessBar',
118
119
  totalRow: true,//开启合并行
119
- defaultToolbar: [],
120
120
  cols: [
121
121
  [
122
122
  {
@@ -132,18 +132,18 @@
132
132
  },
133
133
  {
134
134
  field: 'school',
135
- width: 200,
135
+ width: 150,
136
136
  title: '单位',
137
137
  },
138
138
  {
139
139
  field: 'department',
140
- width: 140,
140
+ width: 150,
141
141
  title: '部门'
142
142
  },
143
143
  {
144
144
  field: 'follow_ups_count',
145
145
  title: '跟进',
146
- width: 100,
146
+ width: 60,
147
147
  templet: '#show_follow',
148
148
  totalRow: true,
149
149
  },
@@ -155,12 +155,12 @@
155
155
  // },
156
156
  {
157
157
  field: 'clazz',
158
- width: 120,
158
+ width: 80,
159
159
  title: '类型'
160
160
  },
161
161
  {
162
162
  field: 'stage',
163
- width: 100,
163
+ width: 90,
164
164
  title: '阶段'
165
165
  },
166
166
  {
@@ -191,17 +191,17 @@
191
191
  },
192
192
  {
193
193
  field: 'place',
194
- width: 110,
194
+ width: 80,
195
195
  title: '渠道'
196
196
  },
197
197
  {
198
198
  field: 'source',
199
- width: 110,
199
+ width: 90,
200
200
  title: '商机来源'
201
201
  },
202
202
  {
203
203
  field: 'last_follow_person',
204
- width: 120,
204
+ width: 100,
205
205
  title: '最新跟进人'
206
206
  },
207
207
  {
@@ -72,7 +72,7 @@
72
72
  elem: '#sale_plan_follow_table',
73
73
  url: '/missions/businesses/show_follow?id=' + parent.id ,
74
74
  toolbar: '#toolbarDemo_follow',
75
- defaultToolbar: [],
75
+ defaultToolbar: ['filter'],
76
76
  cols: [
77
77
  [
78
78
  {
@@ -0,0 +1,12 @@
1
+ json.data do
2
+ json.array! @data do |d|
3
+ json.value d.id
4
+ if d.department.present?
5
+ json.name "#{d.name}(#{d.department&.school&.name}-#{d.department&.name})"
6
+ else
7
+ json.name "#{d.name}"
8
+ end
9
+ end
10
+ end
11
+ json.code 0
12
+ json.msg 'succcess'
@@ -78,33 +78,33 @@
78
78
  url: '/missions/operation_plans?clazz=month',
79
79
  toolbar: '#monthPlanToolbar',
80
80
  totalRow:true,
81
- defaultToolbar: [],
81
+ defaultToolbar: ['filter'],
82
82
  cols: [
83
83
  [
84
84
  {
85
85
  field: 'id',
86
- width: 80,
86
+ width: 60,
87
87
  title:'序号',type: 'numbers',
88
88
  totalRowText:"合计",
89
89
  },
90
90
  {
91
91
  field: 'staff',
92
- width: 100,
92
+ width: 90,
93
93
  title: '姓名'
94
94
  },
95
95
  {
96
96
  field: 'teacher_name',
97
- width: 100,
97
+ width: 120,
98
98
  title: '教师姓名',
99
99
  },
100
100
  {
101
101
  field: 'school',
102
- width: 190,
102
+ width: 170,
103
103
  title: '单位'
104
104
  },
105
105
  {
106
106
  field: 'department',
107
- width: 190,
107
+ width: 170,
108
108
  title: '部门'
109
109
  },
110
110
  {
@@ -114,7 +114,7 @@
114
114
  },
115
115
  {
116
116
  field: 'count',
117
- width: 100,
117
+ width: 80,
118
118
  title: '跟进',
119
119
  totalRow:true,
120
120
  templet: '#show_follow2'
@@ -78,19 +78,19 @@
78
78
  elem: '#monthlyTable',
79
79
  url: '/missions/operation_reports?clazz=month',
80
80
  toolbar: '#monthlyToolbar',
81
- defaultToolbar: [],
81
+ defaultToolbar: ['filter'],
82
82
  totalRow:true,
83
83
  cols: [
84
84
  [
85
85
  {
86
86
  field: 'id',
87
- width: 80,
87
+ width: 60,
88
88
  title:'序号',type: 'numbers',
89
89
  totalRowText:"合计",
90
90
  },
91
91
  {
92
92
  field: 'staff',
93
- width: 100,
93
+ width: 90,
94
94
  title: '姓名'
95
95
  },
96
96
  {
@@ -100,7 +100,7 @@
100
100
  },
101
101
  {
102
102
  field: 'finish_rate',
103
- width: 100,
103
+ width: 80,
104
104
  title: '完成率',
105
105
  totalRow:true,
106
106
  },
@@ -79,33 +79,33 @@
79
79
  url: '/missions/operation_plans?clazz=week',
80
80
  toolbar: '#weekPlanToolbar',
81
81
  totalRow:true,
82
- defaultToolbar: [],
82
+ defaultToolbar: ['filter'],
83
83
  cols: [
84
84
  [
85
85
  {
86
86
  field: 'id',
87
- width: 80,
87
+ width: 60,
88
88
  title:'序号',type: 'numbers',
89
89
  totalRowText:"合计",
90
90
  },
91
91
  {
92
92
  field: 'staff',
93
- width: 100,
93
+ width: 80,
94
94
  title: '姓名'
95
95
  },
96
96
  {
97
97
  field: 'teacher_name',
98
- width: 100,
98
+ width: 120,
99
99
  title: '教师姓名',
100
100
  },
101
101
  {
102
102
  field: 'school',
103
- width: 190,
103
+ width: 170,
104
104
  title: '单位'
105
105
  },
106
106
  {
107
107
  field: 'department',
108
- width: 190,
108
+ width: 170,
109
109
  title: '部门'
110
110
  },
111
111
  {
@@ -115,7 +115,7 @@
115
115
  },
116
116
  {
117
117
  field: 'week',
118
- width: 100,
118
+ width: 80,
119
119
  title: '周次',
120
120
  },
121
121
  {
@@ -125,7 +125,7 @@
125
125
  },
126
126
  {
127
127
  field: 'count',
128
- width: 100,
128
+ width: 80,
129
129
  title: '跟进',
130
130
  totalRow:true,
131
131
  templet: '#show_follow1'
@@ -80,28 +80,28 @@
80
80
  url: '/missions/operation_reports?clazz=week',
81
81
  toolbar: '#weeklyToolbar',
82
82
  totalRow:true,
83
- defaultToolbar: [],
83
+ defaultToolbar: ['filter'],
84
84
  cols: [
85
85
  [
86
86
  {
87
87
  field: 'id',
88
- width: 80,
88
+ width: 60,
89
89
  title:'序号',type: 'numbers',
90
90
  totalRowText:"合计",
91
91
  },
92
92
  {
93
93
  field: 'staff',
94
- width: 100,
94
+ width: 90,
95
95
  title: '姓名'
96
96
  },
97
97
  {
98
98
  field: 'weekly',
99
- width: 100,
99
+ width: 60,
100
100
  title: '周次'
101
101
  },
102
102
  {
103
103
  field: 'finish_rate',
104
- width: 100,
104
+ width: 80,
105
105
  title: '完成率',
106
106
  totalRow:true,
107
107
  },
@@ -8,9 +8,7 @@
8
8
  </div>
9
9
  <div class="layui-inline">
10
10
  <label class="layui-form-label required">教师</label>
11
- <div class="layui-input-inline">
12
- <%= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
13
- </div>
11
+ <div class="layui-input-block" id="add_teacher" style="width: 400px"></div>
14
12
  </div>
15
13
  <div class="layui-form-item layui-form-text">
16
14
  <label class="layui-form-label">计划内容</label>
@@ -55,9 +53,41 @@
55
53
  request = layui.request,
56
54
  laydate = layui.laydate,
57
55
  $ = layui.$;
56
+ selectInput = layui.selectInput;
57
+
58
58
 
59
59
  form.render();
60
60
 
61
+ var add_teacher = selectInput.render({
62
+ elem: '#add_teacher',
63
+ name: 'teacher_id', // 渲染的input的name值
64
+ layFilter: 'teacher_id', //同layui form参数lay-filter
65
+ layVerify: 'required', //同layui form参数lay-verify
66
+ layVerType: 'tips', // 同layui form参数lay-verType
67
+ layReqText: '请填写文本', //同layui form参数lay-ReqText
68
+ initValue: '', // 渲染初始化默认值
69
+ hasSelectIcon: false,
70
+ placeholder: '支持姓名搜索', // 渲染的inputplaceholder值
71
+ data: [],
72
+ remoteSearch: true, // 是否启用远程搜索 默认是false,和远程搜索回调保存同步
73
+ remoteMethod: function (value, cb) { // 远程搜索的回调函数
74
+ if (!value) {
75
+ return cb([]);
76
+ }
77
+ request.get('missions/search_operation_teacher?q=' + value, {}, function (res) {
78
+ return cb(res)
79
+ })
80
+ }
81
+ });
82
+
83
+ add_teacher.on('itemSelect(add_teacher)', function (obj) {
84
+ teacher_id = obj.data;
85
+ var name = obj.textContent
86
+ add_teacher.setValue(name)
87
+ });
88
+
89
+
90
+
61
91
  laydate.render({
62
92
  elem: '#new_month_plan',
63
93
  type: 'month'
@@ -66,6 +96,7 @@
66
96
  var parentIndex = layer.index;
67
97
 
68
98
  form.on('submit(add_month_plan)', function (data) {
99
+ data.field.teacher_id = teacher_id
69
100
  request.authPost("missions/operation_plans", data.field, function (res) {
70
101
  if (res.success == false) {
71
102
  layer.alert(res.msg)
@@ -4,7 +4,14 @@
4
4
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加计划</button>
5
5
  </div>
6
6
  </script>
7
+ <h1 class="m-t-20 text-center">报告人员:<%=@name %></h1>
7
8
  <form class="layui-form layui-form-pane" action="" style="padding-right: 20px">
9
+ <div class="layui-form-item">
10
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
11
+ <label>负责区域:</label>
12
+ <span><%= @area %></span>
13
+ </div>
14
+ </div>
8
15
  <div class="layui-form-item">
9
16
  <div class="layui-inline" style="margin:18px; font-weight: bold">
10
17
  <label>完成率:</label>
@@ -16,6 +23,11 @@
16
23
  <span><%= @departments_count%></span>
17
24
  <%= hidden_field_tag 'client', @departments_count, {id: 'monthly_client_hide'} %>
18
25
  </div>
26
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
27
+ <label style="margin-left: 100px">提交时间:</label>
28
+ <span><%= Time.now %></span>
29
+ <%= hidden_field_tag 'amount', @total_amount, {id: 'monthly_amount_hide'} %>
30
+ </div>
19
31
  </div>
20
32
  <div class="layui-form-item" style="margin-left: 18px">
21
33
  <div class="layui-form-item layui-form-text">