educode_sales 0.9.76 → 0.9.78

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.
@@ -1,358 +0,0 @@
1
- <div class="min-height-table" id="product_list">
2
- <div style="margin: 10px 10px 10px 10px">
3
- <form class="layui-form layui-form-pane" lay-filter="search_form">
4
- <div class="layui-form-item">
5
- <div class="layui-inline">
6
- <label class="layui-form-label">合同名称</label>
7
- <div class="layui-input-inline">
8
- <input type="text" name="name" class="layui-input" value="">
9
- </div>
10
- </div>
11
- <div class="layui-inline">
12
- <label class="layui-form-label">用户单位</label>
13
- <div class="layui-input-inline">
14
- <input type="text" name="department" value="" class="layui-input">
15
- </div>
16
- </div>
17
- <div class="layui-inline">
18
- <label class="layui-form-label">签约单位</label>
19
- <div class="layui-input-inline">
20
- <input type="text" name="assign_department" value="" class="layui-input">
21
- </div>
22
- </div>
23
- <div class="layui-inline">
24
- <label class="layui-form-label">销售经理</label>
25
- <div class="layui-input-inline">
26
- <%= select_tag "sales_staff_id", options_for_select(@staffs, params[:staff_id]), { 'lay-filter': 'staff_id', include_blank: true , "lay-search": "" } %>
27
- </div>
28
- </div>
29
- <div class="layui-inline show_item_contract">
30
- <label class="layui-form-label">区域</label>
31
- <div class="layui-input-inline">
32
- <%= select_tag "area", options_for_select(EducodeSales::Common.where(clazz: 'area').pluck(:name, :id)), { include_blank: true } %>
33
- </div>
34
- </div>
35
- <div class="layui-inline show_item_contract">
36
- <label class="layui-form-label">项目阶段</label>
37
- <div class="layui-input-inline">
38
- <div id="contract_business_step" style="width: 190px;"></div>
39
- </div>
40
- </div>
41
- <div class="layui-inline show_item_contract">
42
- <label class="layui-form-label">渠道名称</label>
43
- <div class="layui-input-inline">
44
- <div id="contract_index_place" style="width: 190px;"></div>
45
- </div>
46
- </div>
47
- <div class="layui-inline show_item_contract">
48
- <label class="layui-form-label">中标时间</label>
49
- <div class="layui-input-inline">
50
- <input type="text" class="layui-input" id="bidded_date" name="bidded_date" placeholder=" - " autocomplete="off">
51
- </div>
52
- </div>
53
- <div class="layui-inline show_item_contract">
54
- <label class="layui-form-label">签单时间</label>
55
- <div class="layui-input-inline">
56
- <input type="text" class="layui-input" id="signed_date" name="signed_date" placeholder=" - " autocomplete="off">
57
- </div>
58
- </div>
59
- <div class="layui-inline">
60
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
61
- </button>
62
- <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness_contract">搜索
63
- </button>
64
- </div>
65
- </div>
66
- </form>
67
- </div>
68
- <div id="contact_table_wraper">
69
- <table class="layui-hide" id="contact_product_table" lay-filter="contact_product_table"></table>
70
- </div>
71
- </div>
72
-
73
- <script type="text/html" id="currentTableBarProduct">
74
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_product">添加销售目录</a>
75
- </script>
76
-
77
-
78
- <script>
79
- layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate', 'dropdown','laytpl', 'xmSelect'], function () {
80
- var $ = layui.jquery,
81
- form = layui.form,
82
- request = layui.request,
83
- miniPage = layui.miniPage,
84
- dropdown = layui.dropdown,
85
- xmSelect = layui.xmSelect,
86
- laydate = layui.laydate;
87
- var openWH = miniPage.getOpenWidthHeight();
88
- laydate.render({
89
- elem: '#date',
90
- range: true
91
- });
92
-
93
- laydate.render({
94
- elem: '#invitation_at',
95
- range: true
96
- });
97
-
98
- laydate.render({
99
- elem: '#bidded_date',
100
- range: true,
101
- value: gon.bidded_date
102
- });
103
- laydate.render({
104
- elem: '#signed_date',
105
- range: true,
106
- value: gon.signed_date
107
- });
108
-
109
- laydate.render({
110
- elem: '#date_at',
111
- range: true,
112
- value: gon.date_at
113
- });
114
-
115
-
116
- var business_type_list = xmSelect.render({
117
- el: '#contract_business_type',
118
- data: gon.business_type
119
- })
120
-
121
-
122
- var business_step_list = xmSelect.render({
123
- el: '#contract_business_step',
124
- data: gon.business_step
125
- })
126
-
127
- var index_place_list = xmSelect.render({
128
- el: '#contract_index_place',
129
- model: {
130
- icon: 'hidden',
131
- label: {
132
- type: 'text',
133
- text: {
134
- //左边拼接的字符
135
- left: '',
136
- //右边拼接的字符
137
- right: '',
138
- //中间的分隔符
139
- separator: ', ',
140
- },
141
- }
142
- },
143
- remoteSearch: true,
144
- clickClose: true,
145
- delay: 1000,
146
- paging: true,
147
- radio: true,
148
- pageRemote: true,
149
- filterable: true,
150
- remoteMethod: function (val, cb, show, pageIndex) {
151
- $.ajax( '/missions/sales_place', {
152
- method: 'get',
153
- data: {
154
- q: val,
155
- page: pageIndex
156
- },
157
- dataType: 'json',
158
- success: function (res) {
159
- var data = res.data;
160
- if (res.code == 0) {
161
- cb(res.data, res.count);
162
- } else {
163
- layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
164
- }
165
- }
166
- })
167
- }
168
- })
169
- index_place_list.setValue(gon.place)
170
-
171
-
172
- var data = form.val("search_form");
173
- table = layui.table;
174
- var cols_table = [
175
- [
176
- {
177
- field: 'id',
178
- width: 60,
179
- title: '序号', type: 'numbers',
180
- totalRowText: '合计',
181
- fixed: "left"
182
- },
183
- {
184
- field: 'number',
185
- width: 120,
186
- title: '编号',
187
- fixed: 'left',
188
- },
189
- {
190
- field: 'name',
191
- width: 120,
192
- title: '合同名称',
193
- },
194
- {
195
- field: 'area',
196
- width: 100,
197
- title: '地域',
198
- },
199
- {
200
- field: 'school',
201
- width: 150,
202
- title: '用户单位',
203
- templet: '#school_name',
204
- },
205
- {
206
- field: 'property',
207
- width: 150,
208
- title: '客户类型',
209
- },
210
- {
211
- field: 'department',
212
- width: 150,
213
- title: '部门',
214
- templet: '<div><span title="{{d.department}}">{{d.department}}</span></div>',
215
- },
216
- {
217
- field: 'item_clazz',
218
- width: 150,
219
- title: '销售品目',
220
- },
221
- {
222
- field: 'brand',
223
- width: 150,
224
- title: '品牌',
225
- },
226
- {
227
- field: 'specification',
228
- width: 150,
229
- title: '规格',
230
- },
231
- {
232
- field: 'supplier',
233
- width: 150,
234
- title: '供货商',
235
- }
236
- ]
237
- ]
238
-
239
- var business_table = table.render({
240
- elem: '#contact_product_table',
241
- url: '/missions/contracts',
242
- autoSort: false,
243
- where: {q: data},
244
- defaultToolbar: ['filter'],
245
- title: '合同数据表',
246
- totalRow: true,//开启合并行
247
- cols: cols_table,
248
-
249
- limit: 20,
250
- limits: [10,15,20,30,40,50,60,70,80,90],
251
- page: true,
252
- skin: 'line',
253
- });
254
-
255
-
256
- var sort = {}, search = data;
257
-
258
- table.on('sort(contact_product_table)', function (obj) {
259
- var data = form.val("search_form");
260
- sort.field = obj.field;
261
- sort.order = obj.type;
262
- table.reload('contact_product_table', {
263
- url: '/missions/businesses',
264
- initSort: obj,
265
- where: {
266
- sort: sort,
267
- q: search
268
- }
269
- });
270
- })
271
-
272
- // 监听搜索操作
273
- form.on('submit(search_bussiness_contract)', function (data) {
274
- if (search['clazz']) {
275
- data.field['clazz'] = search['clazz']
276
- }
277
- search = data.field
278
- table.reload('contact_product_table', {
279
- url: '/missions/contracts',
280
- page: {
281
- curr: 1
282
- },
283
- where: {q: search, sort: sort}
284
- }, 'data');
285
-
286
- return false;
287
- });
288
-
289
- form.on('submit(reset_business_search)', function (data) {
290
- var field = data.field;
291
- form.val('search_form', {
292
- name: '', department: '', staff_id: '', business_type: '', business_step: '',
293
- place_id: '', date: '', area: '', invitation_at: '', business_year: '', number: ''
294
- })
295
- business_type_list.setValue([])
296
- business_step_list.setValue([])
297
- index_place_list.setValue([])
298
- return false;
299
- });
300
-
301
- table.on('tool(contact_product_table)', function (obj) {
302
- var data = obj.data;
303
- id = data.id
304
- if (obj.event === 'add_event') { // 监听添加操作
305
- business_id = data.id
306
- var content = miniPage.getHrefContent('/missions/contracts/new_follow_up?id=' + data.id);
307
- var openWH = miniPage.getOpenWidthHeight();
308
- new_follow_index = layer.open({
309
- title: '添加合同跟进记录',
310
- type: 1,
311
- shade: 0.2,
312
- maxmin: true,
313
- shadeClose: true,
314
- area: [openWH[0] + 'px', openWH[1] + 'px'],
315
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
316
- content: content,
317
- success: function (layero, index) {
318
- form.render('select');
319
- }
320
- });
321
- $(window).on("resize", function () {
322
- layer.full(new_follow_index);
323
- });
324
- } else if (obj.event === 'assign') {
325
- var content = miniPage.getHrefContent('/missions/contracts/' + id + '/assign');
326
- var openWH = miniPage.getOpenWidthHeight();
327
- name = data.name;
328
- sindex = layer.open({
329
- title: '指派合同【' + name + "】售后工程师",
330
- type: 1,
331
- shade: 0.2,
332
- maxmin: true,
333
- shadeClose: true,
334
- area: ['600px', '600px'],
335
- content: content
336
- });
337
- $(window).on("resize", function () {
338
- layer.full(sindex);
339
- });
340
- return false;
341
- }
342
- });
343
-
344
-
345
- });
346
- </script>
347
- <style>
348
- .layui-table-tool-temp{
349
- padding-right: 30px; !important;
350
- }
351
- .layui-table-fixed .layui-table-body {
352
- height: auto!important;
353
- }
354
- .layui-table-fixed.layui-hide {
355
- display: block!important;
356
- }
357
-
358
- </style>
@@ -1 +0,0 @@
1
- $("#contract_product_wraper").html("<%= j render 'product_list' %>");