educode_sales 1.10.18 → 1.10.19
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8037147081840dd2c090f239b68e31c0262e1e395be83430565da7dab45da06e
|
4
|
+
data.tar.gz: 40e32c9627b100fc6da0e7fdd66fc0cecf3e745263aaf9df12fdbd80803d83e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9dcc35f2f24582825fd8a74e840f1c9534240934a28cf6771f263d4b9295382c1b8c870695c1be5fd20f643ded2aec496675f8c1b379ed74b5f14fd32e41f9c
|
7
|
+
data.tar.gz: 036a61625d1c003e35d8602e56e57635aa4108d6e9246853da7d97c06aa31ec9be40821a027d6a8890e91690489f89ddd63d60eed602ee924fe9670b083a59d2
|
@@ -12,6 +12,8 @@ module EducodeSales
|
|
12
12
|
gon.edit_record = can?(:update_record, EducodeSales::MoneyPlan)
|
13
13
|
gon.edit_record_self = can?(:update_record_self, EducodeSales::MoneyPlan)
|
14
14
|
gon.staff_id = @current_admin.id
|
15
|
+
common = Common.find_by(clazz: 'staff_type', name: '销售')
|
16
|
+
gon.staffs = Staff.joins(:user).where(job_type: common.id).where.not(role_id: 11).map { |d| {name: d.user.real_name, value: d.id } }
|
15
17
|
end
|
16
18
|
format.json do
|
17
19
|
@money_plan_records = MoneyPlanRecord.left_joins(:money_plan_claims).group("educode_sales_money_plan_records.id").select("educode_sales_money_plan_records.*, COUNT(educode_sales_money_plan_claims.id) AS claim_num")
|
@@ -50,6 +52,15 @@ module EducodeSales
|
|
50
52
|
end
|
51
53
|
|
52
54
|
end
|
55
|
+
|
56
|
+
if params[:q].present? && params[:q][:staff_manages].present?
|
57
|
+
# 销售经理
|
58
|
+
@money_plan_records = @money_plan_records.joins(:business).joins("
|
59
|
+
LEFT JOIN educode_sales_follow_ups AS last_follow_up ON educode_sales_businesses.last_follow_up_id = last_follow_up.id AND last_follow_up.deleted_at IS NULL
|
60
|
+
LEFT JOIN educode_sales_assign_follow_ups ON educode_sales_assign_follow_ups.follow_up_id = last_follow_up.id").
|
61
|
+
where("(educode_sales_assign_follow_ups.id IS NOT NULL AND educode_sales_assign_follow_ups.staff_id = ?) OR (educode_sales_assign_follow_ups.id IS NULL AND educode_sales_businesses.staff_id = ?)", params[:q][:staff_manages], params[:q][:staff_manages])
|
62
|
+
end
|
63
|
+
|
53
64
|
if params[:q].present? && params[:q][:amount].present?
|
54
65
|
@money_plan_records = @money_plan_records.where(amount: params[:q][:amount])
|
55
66
|
end
|
@@ -32,6 +32,12 @@
|
|
32
32
|
<%= select_tag "state", options_for_select(['已认领', '待认领', '无对应合同', '无对应应收款']), { 'lay-filter': 'state', include_blank: true, "lay-search": "" } %>
|
33
33
|
</div>
|
34
34
|
</div>
|
35
|
+
<div class="layui-inline show_item">
|
36
|
+
<label class="layui-form-label">销售经理</label>
|
37
|
+
<div class="layui-input-inline">
|
38
|
+
<div id="staff_manages" style="width: 190px;"></div>
|
39
|
+
</div>
|
40
|
+
</div>
|
35
41
|
<div class="layui-inline">
|
36
42
|
<button type="reset" class="layui-btn layui-btn-primary" lay-submit
|
37
43
|
lay-filter="reset_business_search_record">重置
|
@@ -69,11 +75,12 @@
|
|
69
75
|
</script>
|
70
76
|
|
71
77
|
<script>
|
72
|
-
layui.use(['form', 'table', 'miniPage', 'element', 'request', 'upload'], function() {
|
78
|
+
layui.use(['form', 'table', 'miniPage', 'element', 'request', 'upload', 'xmSelect'], function() {
|
73
79
|
var $ = layui.jquery,
|
74
80
|
form = layui.form,
|
75
81
|
request = layui.request,
|
76
82
|
upload = layui.upload,
|
83
|
+
xmSelect = layui.xmSelect,
|
77
84
|
miniPage = layui.miniPage;
|
78
85
|
laydate = layui.laydate;
|
79
86
|
table = layui.table;
|
@@ -110,6 +117,11 @@
|
|
110
117
|
title: '回款日期',
|
111
118
|
sort: true
|
112
119
|
},
|
120
|
+
{
|
121
|
+
field: 'staff_manages',
|
122
|
+
width: 180,
|
123
|
+
title: '销售经理',
|
124
|
+
},
|
113
125
|
{
|
114
126
|
field: 'business',
|
115
127
|
width: 180,
|
@@ -146,6 +158,13 @@
|
|
146
158
|
uploadMoneyPlan()
|
147
159
|
}
|
148
160
|
});
|
161
|
+
|
162
|
+
var staff_manages_list = xmSelect.render({
|
163
|
+
el: '#staff_manages',
|
164
|
+
data: gon.staffs,
|
165
|
+
filterable: true,
|
166
|
+
radio: true,
|
167
|
+
})
|
149
168
|
var sort = {},
|
150
169
|
search = {};
|
151
170
|
table.on('sort(money_plan_record_table)', function(obj) {
|
@@ -161,7 +180,8 @@
|
|
161
180
|
})
|
162
181
|
// 监听搜索操作
|
163
182
|
form.on('submit(submit_form_record)', function(data) {
|
164
|
-
search = data.field
|
183
|
+
search = data.field;
|
184
|
+
search.staff_manages = staff_manages_list.getValue('valueStr');
|
165
185
|
table.reload('money_plan_record_table', {
|
166
186
|
page: {
|
167
187
|
curr: 1
|
@@ -184,6 +204,7 @@
|
|
184
204
|
school: "",
|
185
205
|
business: ""
|
186
206
|
});
|
207
|
+
staff_manages_list.setValue([]);
|
187
208
|
return false;
|
188
209
|
});
|
189
210
|
table.on('toolbar(money_plan_record_table)', function(obj) {
|
@@ -13,6 +13,7 @@ json.data do
|
|
13
13
|
json.staff_id d.staff_id
|
14
14
|
json.number d.business&.number
|
15
15
|
json.payer_name d.payer_name
|
16
|
+
json.staff_manages d.business&.last_follow_up&.assign_follow_ups.present? ? (d.business.last_follow_up.assign_follow_ups.map{ |s| s.staff.user.real_name}.join("、")) : d.business&.staff&.user&.real_name
|
16
17
|
if d['claim_num'] > 0
|
17
18
|
json.state '已认领'
|
18
19
|
elsif d.business&.name.nil?
|