monkey 5 years ago
parent
commit
f131de1dc4
62 changed files with 2188 additions and 686 deletions
  1. 6
    6
      src/api/admin/crm.js
  2. 24
    0
      src/api/admin/employeeDep.js
  3. 80
    0
      src/api/admin/log.js
  4. 7
    5
      src/api/common.js
  5. 4
    4
      src/api/crm/common.js
  6. 15
    0
      src/api/crm/contract.js
  7. 38
    19
      src/api/crm/customer.js
  8. 46
    0
      src/api/crm/workbench.js
  9. 1
    1
      src/api/oa/examine.js
  10. 18
    20
      src/components/CRMImport/index.vue
  11. 1
    0
      src/components/NewCom/WkDepSelect/index.vue
  12. 8
    21
      src/components/XrUpgradeDialog.vue
  13. 1
    1
      src/config.js
  14. 10
    5
      src/mixins/CustomFields.js
  15. 44
    11
      src/router/modules/admin.js
  16. 7
    7
      src/views/admin/crm/customer/components/DetailRecycleRule.vue
  17. 83
    70
      src/views/admin/crm/customer/components/PoolAdd.vue
  18. 11
    11
      src/views/admin/crm/customer/components/PoolDetail.vue
  19. 9
    9
      src/views/admin/crm/customer/components/PoolTransfer.vue
  20. 24
    24
      src/views/admin/crm/customer/components/RecycleRule.vue
  21. 39
    38
      src/views/admin/crm/customer/index.vue
  22. 9
    9
      src/views/admin/crm/printTemplates/PrintTemplateDetail.vue
  23. 8
    4
      src/views/admin/crm/printTemplates/components/TemplateTypeAdd.vue
  24. 4
    4
      src/views/admin/crm/printTemplates/index.vue
  25. 129
    0
      src/views/admin/employeeDep/components/EditDepDialog.vue
  26. 159
    25
      src/views/admin/employeeDep/index.vue
  27. 263
    0
      src/views/admin/log/DataHandleLog.vue
  28. 275
    0
      src/views/admin/log/LoginLog.vue
  29. 240
    0
      src/views/admin/log/SysHandleLog.vue
  30. 226
    0
      src/views/admin/log/mixins/HandleLog.js
  31. 2
    2
      src/views/admin/roleAuth/index.vue
  32. 122
    224
      src/views/bi/product/ProductStatistics.vue
  33. 3
    3
      src/views/crm/business/Detail.vue
  34. 3
    3
      src/views/crm/components/CRMBaseInfo.vue
  35. 13
    13
      src/views/crm/components/CRMDetailHead.vue
  36. 5
    4
      src/views/crm/components/CRMEditBaseInfo.vue
  37. 1
    1
      src/views/crm/components/CRMListHead.vue
  38. 11
    12
      src/views/crm/components/CRMTableHead.vue
  39. 3
    3
      src/views/crm/components/ChieflyContacts.vue
  40. 8
    8
      src/views/crm/components/DuplicateCheck/index.vue
  41. 5
    5
      src/views/crm/components/FieldSet/index.vue
  42. 18
    15
      src/views/crm/components/Print/index.vue
  43. 4
    4
      src/views/crm/components/RelativePrint.vue
  44. 12
    8
      src/views/crm/components/SceneForm/SceneCreate.vue
  45. 3
    3
      src/views/crm/components/SelectionHandle/AllocHandle.vue
  46. 20
    19
      src/views/crm/components/SelectionHandle/PutPoolHandle.vue
  47. 3
    3
      src/views/crm/contract/Detail.vue
  48. 14
    17
      src/views/crm/customer/Detail.vue
  49. 5
    0
      src/views/crm/invoice/Detail.vue
  50. 10
    9
      src/views/crm/mixins/Table.js
  51. 1
    0
      src/views/crm/product/Create.vue
  52. 1
    0
      src/views/crm/receivables/Create.vue
  53. 3
    3
      src/views/crm/receivables/Detail.vue
  54. 17
    19
      src/views/crm/seas/index.vue
  55. 1
    1
      src/views/layout/components/MessageCell.vue
  56. 2
    1
      src/views/oa/components/FileCell/index.vue
  57. 1
    3
      src/views/oa/examine/components/ExamineCategorySelect.vue
  58. 1
    1
      src/views/oa/notice/NewDialog.vue
  59. 1
    1
      src/views/oa/notice/NoticeDetail.vue
  60. 1
    0
      src/views/pm/project/Corver.vue
  61. 1
    1
      src/views/pm/task/index.vue
  62. 104
    6
      src/views/workLog/FollowIndex.vue

+ 6
- 6
src/api/admin/crm.js View File

413
  */
413
  */
414
 export function printTemplateByIdAPI(data) {
414
 export function printTemplateByIdAPI(data) {
415
   return request({
415
   return request({
416
-    url: 'crmPrint/queryPrintTemplateById',
416
+    url: 'admin/printing/read',
417
     method: 'post',
417
     method: 'post',
418
     data: data
418
     data: data
419
   })
419
   })
488
  */
488
  */
489
 export function printPrintAPI(data) {
489
 export function printPrintAPI(data) {
490
   return request({
490
   return request({
491
-    url: 'crmPrint/print',
491
+    url: 'crm/printing/printingData',
492
     method: 'post',
492
     method: 'post',
493
     data: data
493
     data: data
494
   })
494
   })
514
  */
514
  */
515
 export function printSaveRecordAPI(data) {
515
 export function printSaveRecordAPI(data) {
516
   return request({
516
   return request({
517
-    url: 'crmPrint/savePrintRecord',
517
+    url: 'crm/printing/setRecord',
518
     method: 'post',
518
     method: 'post',
519
     data: data,
519
     data: data,
520
     headers: {
520
     headers: {
530
  */
530
  */
531
 export function printQueryPrintRecordAPI(data) {
531
 export function printQueryPrintRecordAPI(data) {
532
   return request({
532
   return request({
533
-    url: 'crmPrint/queryPrintRecord',
533
+    url: 'crm/printing/getRecord',
534
     method: 'post',
534
     method: 'post',
535
     data: data
535
     data: data
536
   })
536
   })
543
  */
543
  */
544
 export function printRecordDetailAPI(data) {
544
 export function printRecordDetailAPI(data) {
545
   return request({
545
   return request({
546
-    url: 'crmPrint/queryPrintRecordById',
546
+    url: 'crm/printing/printingData',
547
     method: 'post',
547
     method: 'post',
548
     data: data
548
     data: data
549
   })
549
   })
556
  */
556
  */
557
 export function printPreviewAPI(data) {
557
 export function printPreviewAPI(data) {
558
   return request({
558
   return request({
559
-    url: 'crmPrint/preview',
559
+    url: 'crm/printing/preview',
560
     method: 'post',
560
     method: 'post',
561
     data: data
561
     data: data
562
   })
562
   })

+ 24
- 0
src/api/admin/employeeDep.js View File

171
     responseType: 'blob'
171
     responseType: 'blob'
172
   })
172
   })
173
 }
173
 }
174
+/**
175
+ * 员工数量
176
+ * @param {*} data
177
+ */
178
+export function adminUserCountNumOfUserAPI() {
179
+  return request({
180
+    url: 'admin/users/countNumOfUser',
181
+    method: 'post'
182
+  })
183
+}
184
+/**
185
+ * 重置部门
186
+ * @param {*} data
187
+ */
188
+export function adminUserSetUserDeptPI(data) {
189
+  return request({
190
+    url: 'admin/users/setUserDept',
191
+    method: 'post',
192
+    data: data,
193
+    headers: {
194
+      'Content-Type': 'application/json;charset=UTF-8'
195
+    }
196
+  })
197
+}

+ 80
- 0
src/api/admin/log.js View File

1
+import request from '@/utils/request'
2
+
3
+/**
4
+ * 查询系统登录日志列表页接口
5
+ * @param {*} data
6
+ */
7
+export function queryLoginLogListAPI(data) {
8
+  return request({
9
+    url: 'admin/log/loginRecord',
10
+    method: 'post',
11
+    headers: {
12
+      'Content-Type': 'application/json;charset=UTF-8'
13
+    },
14
+    data: data
15
+  })
16
+}
17
+
18
+/**
19
+ * 系统登录日志导出
20
+ * @param {*} data
21
+ */
22
+// export function loginLogExportAPI(data) {
23
+//   return request({
24
+//     url: 'admin/log/excelImport',
25
+//     method: 'post',
26
+//     data: data,
27
+//     responseType: 'blob',
28
+//     headers: {
29
+//       'Content-Type': 'application/json;charset=UTF-8'
30
+//     },
31
+//     timeout: 60000
32
+//   })
33
+// }
34
+
35
+/**
36
+ * 查看系统操作日志接口
37
+ * @param {*} data
38
+ */
39
+export function querySystemLogListAPI(data) {
40
+  return request({
41
+    url: 'admin/log/systemRecord',
42
+    method: 'post',
43
+    headers: {
44
+      'Content-Type': 'application/json;charset=UTF-8'
45
+    },
46
+    data: data
47
+  })
48
+}
49
+
50
+/**
51
+ * 查看数据操作日志接口
52
+ * @param {*} data
53
+ */
54
+export function queryDataOptionLogListAPI(data) {
55
+  return request({
56
+    url: 'admin/log/dataRecord',
57
+    method: 'post',
58
+    headers: {
59
+      'Content-Type': 'application/json;charset=UTF-8'
60
+    },
61
+    data: data
62
+  })
63
+}
64
+
65
+/**
66
+ * 系统日志导出
67
+ * @param {*} data
68
+ */
69
+export function systemLogExportAPI(data) {
70
+  return request({
71
+    url: 'admin/log/excelImport',
72
+    method: 'post',
73
+    data: data,
74
+    responseType: 'blob',
75
+    headers: {
76
+      'Content-Type': 'application/json;charset=UTF-8'
77
+    },
78
+    timeout: 60000
79
+  })
80
+}

+ 7
- 5
src/api/common.js View File

130
   var param = new FormData()
130
   var param = new FormData()
131
   Object.keys(data).forEach(key => {
131
   Object.keys(data).forEach(key => {
132
     param.append(key, data[key])
132
     param.append(key, data[key])
133
-    param.append('isPublic', '1')
133
+    // param.append('isPublic', '1')
134
+    param.append('module', 'print')
135
+    param.append('type', 'img')
134
   })
136
   })
135
   return request({
137
   return request({
136
-    url: 'adminFile/upload',
138
+    url: 'admin/file/save',
137
     method: 'post',
139
     method: 'post',
138
     data: param,
140
     data: param,
139
     headers: {
141
     headers: {
210
  */
212
  */
211
 export function crmFileDownByPathAPI(data) {
213
 export function crmFileDownByPathAPI(data) {
212
   return request({
214
   return request({
213
-    url: 'crmPrint/down',
215
+    url: 'crm/printing/down',
214
     method: 'post',
216
     method: 'post',
215
     data: data,
217
     data: data,
216
     responseType: 'blob'
218
     responseType: 'blob'
330
   })
332
   })
331
 }
333
 }
332
 
334
 
333
-export function downloadFileAPI(data) {
335
+export function downloadFileAPI(data, url) {
334
   return request({
336
   return request({
335
-    url: 'admin/file/download',
337
+    url: `${url || `admin/file/download`}`,
336
     method: 'post',
338
     method: 'post',
337
     data,
339
     data,
338
     responseType: 'blob'
340
     responseType: 'blob'

+ 4
- 4
src/api/crm/common.js View File

92
  */
92
  */
93
 export function filedGetPoolTableFieldAPI(data) {
93
 export function filedGetPoolTableFieldAPI(data) {
94
   return request({
94
   return request({
95
-    url: 'admin/field/getField',
95
+    url: 'crm/customerPool/field',
96
     method: 'post',
96
     method: 'post',
97
     data: data
97
     data: data
98
   })
98
   })
245
  */
245
  */
246
 export function crmPoolFieldConfigIndexAPI(data) {
246
 export function crmPoolFieldConfigIndexAPI(data) {
247
   return request({
247
   return request({
248
-    url: 'admin/field/configIndex',
248
+    url: 'crm/customerPool/fieldConfig',
249
     method: 'post',
249
     method: 'post',
250
     data: data
250
     data: data
251
   })
251
   })
269
  */
269
  */
270
 export function crmPoolFieldConfigAPI(data) {
270
 export function crmPoolFieldConfigAPI(data) {
271
   return request({
271
   return request({
272
-    url: 'admin/field/config',
272
+    url: 'crm/customerPool/setFieldConfig',
273
     method: 'post',
273
     method: 'post',
274
     data: data
274
     data: data
275
   })
275
   })
296
  */
296
  */
297
 export function crmPoolFieldColumnWidthAPI(data) {
297
 export function crmPoolFieldColumnWidthAPI(data) {
298
   return request({
298
   return request({
299
-    url: 'crmField/setPoolFieldStyle',
299
+    url: 'crm/customerPool/setFieldWidth',
300
     method: 'post',
300
     method: 'post',
301
     data: data,
301
     data: data,
302
     headers: {
302
     headers: {

+ 15
- 0
src/api/crm/contract.js View File

264
     }
264
     }
265
   })
265
   })
266
 }
266
 }
267
+
268
+/**
269
+ *
270
+ * @param {*} data
271
+ */
272
+export function crmContractQueryListByProductIdAPI(data) {
273
+  return request({
274
+    url: 'bi/product/listProduct',
275
+    method: 'post',
276
+    data: data,
277
+    headers: {
278
+      'Content-Type': 'application/json;charset=UTF-8'
279
+    }
280
+  })
281
+}

+ 38
- 19
src/api/crm/customer.js View File

46
  */
46
  */
47
 export function crmCustomerPoolListAPI(data) {
47
 export function crmCustomerPoolListAPI(data) {
48
   return request({
48
   return request({
49
-    url: 'crm/customer/pool',
49
+    url: 'crm/customerPool/index',
50
     method: 'post',
50
     method: 'post',
51
     data: data
51
     data: data
52
   })
52
   })
58
  */
58
  */
59
 export function crmCustomerPoolDeleteAPI(data) {
59
 export function crmCustomerPoolDeleteAPI(data) {
60
   return request({
60
   return request({
61
-    url: 'crm/customer/delete',
61
+    url: 'crm/customerPool/delete',
62
     method: 'post',
62
     method: 'post',
63
     data: data,
63
     data: data,
64
     headers: {
64
     headers: {
73
  */
73
  */
74
 export function crmCustomerPoolSetAPI(data) {
74
 export function crmCustomerPoolSetAPI(data) {
75
   return request({
75
   return request({
76
-    url: 'crmCustomerPool/setCustomerPool',
76
+    url: 'admin/setting/setPool',
77
     method: 'post',
77
     method: 'post',
78
     data: data,
78
     data: data,
79
     headers: {
79
     headers: {
88
  */
88
  */
89
 export function crmCustomerPoolSetListAPI(data) {
89
 export function crmCustomerPoolSetListAPI(data) {
90
   return request({
90
   return request({
91
-    url: 'crmCustomerPool/queryPoolSettingList',
91
+    url: 'admin/setting/pool',
92
     method: 'post',
92
     method: 'post',
93
     data: data,
93
     data: data,
94
     headers: {
94
     headers: {
102
  */
102
  */
103
 export function crmCustomerPoolSetDeleteAPI(data) {
103
 export function crmCustomerPoolSetDeleteAPI(data) {
104
   return request({
104
   return request({
105
-    url: 'crmCustomerPool/deleteCustomerPool',
105
+    url: 'admin/setting/deletePool',
106
     method: 'post',
106
     method: 'post',
107
     data: data
107
     data: data
108
   })
108
   })
114
  */
114
  */
115
 export function crmCustomerPoolSetDetailAPI(data) {
115
 export function crmCustomerPoolSetDetailAPI(data) {
116
   return request({
116
   return request({
117
-    url: 'crmCustomerPool/queryPoolById',
117
+    url: 'admin/setting/readPool',
118
     method: 'post',
118
     method: 'post',
119
     data: data
119
     data: data
120
   })
120
   })
126
  */
126
  */
127
 export function crmCustomerPoolSetChangeStatusAPI(data) {
127
 export function crmCustomerPoolSetChangeStatusAPI(data) {
128
   return request({
128
   return request({
129
-    url: 'crmCustomerPool/changeStatus',
129
+    url: 'admin/setting/changePool',
130
     method: 'post',
130
     method: 'post',
131
     data: data
131
     data: data
132
   })
132
   })
140
  */
140
  */
141
 export function crmCustomerPoolSetTransferAPI(data) {
141
 export function crmCustomerPoolSetTransferAPI(data) {
142
   return request({
142
   return request({
143
-    url: 'crmCustomerPool/transfer',
143
+    url: 'admin/setting/transferPool',
144
     method: 'post',
144
     method: 'post',
145
     data: data
145
     data: data
146
   })
146
   })
152
  */
152
  */
153
 export function crmCustomerPoolSetNameListAPI(data) {
153
 export function crmCustomerPoolSetNameListAPI(data) {
154
   return request({
154
   return request({
155
-    url: 'crmCustomerPool/queryPoolNameList',
155
+    url: 'admin/setting/pool',
156
     method: 'post',
156
     method: 'post',
157
     data: data
157
     data: data
158
   })
158
   })
164
  */
164
  */
165
 export function crmCustomerPoolNameListAPI(data) {
165
 export function crmCustomerPoolNameListAPI(data) {
166
   return request({
166
   return request({
167
-    url: 'crmCustomerPool/queryPoolNameListByAuth',
167
+    url: 'crm/customerPool/pondList',
168
     method: 'post',
168
     method: 'post',
169
     data: data
169
     data: data
170
   })
170
   })
176
  */
176
  */
177
 export function crmCustomerPoolQueryLevelAPI(data) {
177
 export function crmCustomerPoolQueryLevelAPI(data) {
178
   return request({
178
   return request({
179
-    url: 'crmCustomerPool/queryCustomerLevel',
179
+    url: 'admin/setting/customerLevel',
180
     method: 'post',
180
     method: 'post',
181
     data: data
181
     data: data
182
   })
182
   })
187
  */
187
  */
188
 export function crmCustomerReadAPI(data) {
188
 export function crmCustomerReadAPI(data) {
189
   return request({
189
   return request({
190
-    url: `crm/customer/read`,
190
+    url: `crm/${data.pool_id ? 'customerPool' : 'customer'}/read`,
191
     method: 'post',
191
     method: 'post',
192
     data: data
192
     data: data
193
   })
193
   })
301
     param.append(key, data[key])
301
     param.append(key, data[key])
302
   })
302
   })
303
   return request({
303
   return request({
304
-    url: 'crmCustomerPool/uploadExcel',
304
+    url: 'crm/customerPool/import',
305
     method: 'post',
305
     method: 'post',
306
     data: param,
306
     data: param,
307
     headers: {
307
     headers: {
325
   })
325
   })
326
 }
326
 }
327
 
327
 
328
+/**
329
+ * 客户公海导入模板下载
330
+ * @param {*} data
331
+ *
332
+ */
333
+
334
+export function crmCustomerPoolDownloadExcelAPI(data) {
335
+  return request({
336
+    url: 'crm/customerPool/excelDownload',
337
+    method: 'post',
338
+    data: data,
339
+    headers: {
340
+      'Content-Type': 'application/json;charset=UTF-8'
341
+    },
342
+    responseType: 'blob'
343
+  })
344
+}
345
+
328
 /**
346
 /**
329
  * 公海导出
347
  * 公海导出
330
  * @param {*} data
348
  * @param {*} data
331
  */
349
  */
332
 export function crmCustomerPoolExcelExportAPI(data) {
350
 export function crmCustomerPoolExcelExportAPI(data) {
333
   return request({
351
   return request({
334
-    url: 'crm/customer/poolExcelExport',
352
+    url: 'crm/customerPool/export',
335
     method: 'post',
353
     method: 'post',
336
     data: data,
354
     data: data,
337
     headers: {
355
     headers: {
348
  */
366
  */
349
 export function crmCustomerPoolExcelAllExport(data) {
367
 export function crmCustomerPoolExcelAllExport(data) {
350
   return request({
368
   return request({
351
-    url: 'crm/customer/poolExcelExport',
369
+    url: 'crm/customerPool/export',
352
     method: 'post',
370
     method: 'post',
353
     data: data,
371
     data: data,
354
     responseType: 'blob',
372
     responseType: 'blob',
364
  */
382
  */
365
 export function crmCustomerPoolQueryPoolFieldAPI(data) {
383
 export function crmCustomerPoolQueryPoolFieldAPI(data) {
366
   return request({
384
   return request({
367
-    url: 'crmCustomerPool/queryPoolField',
385
+    url: 'admin/setting/poolField',
368
     method: 'post',
386
     method: 'post',
369
     data: data
387
     data: data
370
   })
388
   })
376
  */
394
  */
377
 export function crmCustomerPoolQueryAuthAPI(data) {
395
 export function crmCustomerPoolQueryAuthAPI(data) {
378
   return request({
396
   return request({
379
-    url: 'crm/customer/poolAuthority',
397
+    // url: 'crm/customer/poolAuthority',
398
+    url: 'crm/customerPool/authority',
380
     method: 'post',
399
     method: 'post',
381
     data: data
400
     data: data
382
   })
401
   })
388
  */
407
  */
389
 export function crmCustomerDistributeAPI(data) {
408
 export function crmCustomerDistributeAPI(data) {
390
   return request({
409
   return request({
391
-    url: 'crm/customer/distribute',
410
+    url: 'crm/customerPool/distribute',
392
     method: 'post',
411
     method: 'post',
393
     data: data,
412
     data: data,
394
     headers: {
413
     headers: {
403
  */
422
  */
404
 export function crmCustomerReceiveAPI(data) {
423
 export function crmCustomerReceiveAPI(data) {
405
   return request({
424
   return request({
406
-    url: 'crm/customer/receive',
425
+    url: 'crm/customerPool/receive',
407
     method: 'post',
426
     method: 'post',
408
     data: data,
427
     data: data,
409
     headers: {
428
     headers: {

+ 46
- 0
src/api/crm/workbench.js View File

248
     }
248
     }
249
   })
249
   })
250
 }
250
 }
251
+
252
+//* **********************************
253
+/**
254
+ *
255
+ * @param {*} data
256
+ */
257
+export function crmInstrumentExportRecordListAPI(data) {
258
+  return request({
259
+    url: '',
260
+    method: 'post',
261
+    data: data,
262
+    headers: {
263
+      'Content-Type': 'application/json;charset=UTF-8'
264
+    }
265
+  })
266
+}
267
+
268
+/**
269
+ *
270
+ * @param {*} data
271
+ */
272
+export function crmInstrumentImportRecordListAPI(data) {
273
+  return request({
274
+    url: '',
275
+    method: 'post',
276
+    data: data,
277
+    headers: {
278
+      'Content-Type': 'application/json;charset=UTF-8'
279
+    }
280
+  })
281
+}
282
+
283
+/**
284
+ *
285
+ * @param {*} data
286
+ */
287
+export function crmInstrumentDownloadRecordExcelAPI(data) {
288
+  return request({
289
+    url: '',
290
+    method: 'post',
291
+    data: data,
292
+    headers: {
293
+      'Content-Type': 'application/json;charset=UTF-8'
294
+    }
295
+  })
296
+}

+ 1
- 1
src/api/oa/examine.js View File

18
  */
18
  */
19
 export function oaAllExamineCategorySortAPI(data) {
19
 export function oaAllExamineCategorySortAPI(data) {
20
   return request({
20
   return request({
21
-    url: 'oaExamineCategory/saveOrUpdateOaExamineSort',
21
+    url: 'oa/examine/examineSort',
22
     method: 'post',
22
     method: 'post',
23
     data: data,
23
     data: data,
24
     headers: {
24
     headers: {

+ 18
- 20
src/components/CRMImport/index.vue View File

68
           <div class="sections__title">四、请选择公海</div>
68
           <div class="sections__title">四、请选择公海</div>
69
           <div class="content">
69
           <div class="content">
70
             <div class="user-cell">
70
             <div class="user-cell">
71
-              <el-select v-model="poolId" placeholder="请选择">
71
+              <el-select v-model="pool_id" placeholder="请选择">
72
                 <el-option
72
                 <el-option
73
                   v-for="item in poolList"
73
                   v-for="item in poolList"
74
-                  :key="item.poolId"
75
-                  :label="item.poolName"
76
-                  :value="item.poolId"/>
74
+                  :key="item.pool_id"
75
+                  :label="item.pool_name"
76
+                  :value="item.pool_id"/>
77
               </el-select>
77
               </el-select>
78
             </div>
78
             </div>
79
           </div>
79
           </div>
153
 import {
153
 import {
154
   crmCustomerExcelImportAPI,
154
   crmCustomerExcelImportAPI,
155
   crmCustomerDownloadExcelAPI,
155
   crmCustomerDownloadExcelAPI,
156
-  crmCustomerPoolExcelImportAPI
156
+  crmCustomerPoolExcelImportAPI,
157
+  crmCustomerPoolNameListAPI,
158
+  crmCustomerPoolDownloadExcelAPI
157
 } from '@/api/crm/customer'
159
 } from '@/api/crm/customer'
158
 import {
160
 import {
159
   crmLeadsExcelImportAPI,
161
   crmLeadsExcelImportAPI,
228
       user: [],
230
       user: [],
229
 
231
 
230
       // 公海数据
232
       // 公海数据
231
-      poolId: '',
233
+      pool_id: '',
232
       poolList: [],
234
       poolList: [],
233
 
235
 
234
       stepsActive: 1,
236
       stepsActive: 1,
422
       params.file = this.file
424
       params.file = this.file
423
       params.owner_user_id = this.user.length > 0 ? this.user[0].id : ''
425
       params.owner_user_id = this.user.length > 0 ? this.user[0].id : ''
424
       if (this.config.poolSelectShow) {
426
       if (this.config.poolSelectShow) {
425
-        params.poolId = this.poolId
427
+        params.pool_id = this.pool_id
426
       }
428
       }
427
 
429
 
428
       const request = this.config.importRequest || {
430
       const request = this.config.importRequest || {
517
     // 下载模板操作
519
     // 下载模板操作
518
     download() {
520
     download() {
519
       const request = this.config.templateRequest || {
521
       const request = this.config.templateRequest || {
520
-        customer: crmCustomerDownloadExcelAPI,
522
+        customer: this.config.poolSelectShow ? crmCustomerPoolDownloadExcelAPI : crmCustomerDownloadExcelAPI,
521
         leads: crmLeadsDownloadExcelAPI,
523
         leads: crmLeadsDownloadExcelAPI,
522
         contacts: crmContactsDownloadExcelAPI,
524
         contacts: crmContactsDownloadExcelAPI,
523
         product: crmProductDownloadExcelAPI
525
         product: crmProductDownloadExcelAPI
524
       }[this.crmType]
526
       }[this.crmType]
525
-      request()
527
+      request({ pool_id: this.config.poolSelectShow && this.pool_id })
526
         .then(res => {
528
         .then(res => {
527
           downloadExcelWithResData(res)
529
           downloadExcelWithResData(res)
528
         })
530
         })
571
      * 公海数据
573
      * 公海数据
572
      */
574
      */
573
     getPoolList() {
575
     getPoolList() {
574
-      // crmCustomerPoolNameListAPI()
575
-      //   .then(res => {
576
-      //     this.poolList = res.data || []
577
-      //     this.poolId = this.poolList.length > 0 ? this.poolList[0].poolId : ''
578
-      //   })
579
-      //   .catch(() => {
580
-      //   })
581
-      this.poolList = [
582
-        { 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }
583
-      ]
584
-      this.poolId = 1
576
+      crmCustomerPoolNameListAPI()
577
+        .then(res => {
578
+          this.poolList = res.data || []
579
+          this.pool_id = this.poolList.length > 0 ? this.poolList[0].pool_id : ''
580
+        })
581
+        .catch(() => {
582
+        })
585
     },
583
     },
586
 
584
 
587
     // 关闭操作
585
     // 关闭操作

+ 1
- 0
src/components/NewCom/WkDepSelect/index.vue View File

296
      * 删除
296
      * 删除
297
      */
297
      */
298
     deleteDep(index) {
298
     deleteDep(index) {
299
+      if (this.disabled) return
299
       // 直接 splice ,dataValue watch 的老旧值相同,复制之后新旧值不相同。暂时解决
300
       // 直接 splice ,dataValue watch 的老旧值相同,复制之后新旧值不相同。暂时解决
300
       const dataValue = objDeepCopy(this.dataValue)
301
       const dataValue = objDeepCopy(this.dataValue)
301
       dataValue.splice(index, 1)
302
       dataValue.splice(index, 1)

+ 8
- 21
src/components/XrUpgradeDialog.vue View File

33
   },
33
   },
34
   data() {
34
   data() {
35
     return {
35
     return {
36
-      message: `修复:
37
-1、修复自定义字段设置隐藏生效问题;
38
-2、修复线索自定义字段转化字段设置生效问题;
39
-3、修复导入数据超过100条部分的数据无法导入问题;
40
-4、修复新建场景保存报错问题;
41
-5、修复客户新建后显示为公海客户,无法操作问题;
42
-6、修复多选字段高级筛选不生效问题;
43
-7、修复产品编辑报错问题;
44
-8、修复部门、人员字段列表展示问题;
45
-9、修复手机、邮箱字段详情编辑校验问题;
46
-10、修复活动记录展示其他客户信息的问题;
47
-11、修复系统提示:“账号在其他地方登录”问题;
48
-12、修复待办事项今日需联系客户标记完成不生效问题;
49
-13、修复仪表盘数据统计错误问题;
50
-14、修复仪表盘遗忘提醒数据查询统计错误问题;
51
-15、修复仪表盘自定义时间、部门筛选数据统计错误问题;
52
-16、修复商业智能自定义时间筛选数据统计错误问题;
53
-17、修复商业智能部门、人员默认筛选数据统计错误问题;
54
-18、修复 72crm-11.0-web(PHP版)部署后部门、成员不展示问题;
55
-19、修复其他已知bug。
56
-20、新增商业智能导出功能。`
36
+      message: `新增:
37
+  1、客户管理模块字段授权
38
+  2、客户管理模块打印模板
39
+  3、客户管理多公海模块
40
+  4、数据操作日志
41
+  5、系统操作日志
42
+  6、登录日志
43
+  7、员工管理增加批量重设部门的功能`
57
     }
44
     }
58
   },
45
   },
59
   computed: {},
46
   computed: {},

+ 1
- 1
src/config.js View File

3
 }
3
 }
4
 
4
 
5
 const companyName = '悟空CRM'
5
 const companyName = '悟空CRM'
6
-const version = 'V11.0.2'
6
+const version = 'V11.0.3'
7
 const baiduKey = 'lcuOQ71SCZhqpxsr1vL2mXoplWEoVctL'
7
 const baiduKey = 'lcuOQ71SCZhqpxsr1vL2mXoplWEoVctL'
8
 
8
 
9
 export default {
9
 export default {

+ 10
- 5
src/mixins/CustomFields.js View File

250
      * 获取客户位置提交参数
250
      * 获取客户位置提交参数
251
      */
251
      */
252
     getCustomerAddressParams(params, dataValue) {
252
     getCustomerAddressParams(params, dataValue) {
253
-      params['address'] = dataValue.address
253
+      params['address'] = (dataValue.address && dataValue.address.filter(item => item).length > 0)
254
         ? dataValue.address
254
         ? dataValue.address
255
         : ''
255
         : ''
256
       params['detail_address'] = dataValue.detail_address
256
       params['detail_address'] = dataValue.detail_address
298
         if (dataValue) {
298
         if (dataValue) {
299
           return dataValue
299
           return dataValue
300
         }
300
         }
301
-        delete data[field.field]
302
-        return
301
+        // delete data[field.field]
302
+        return ''
303
       } else if (field.form_type == 'datetime') {
303
       } else if (field.form_type == 'datetime') {
304
         if (dataValue) {
304
         if (dataValue) {
305
           return moment(dataValue).unix()
305
           return moment(dataValue).unix()
306
         }
306
         }
307
-        delete data[field.field]
308
-        return
307
+        // delete data[field.field]
308
+        return ''
309
+      } else if (field.form_type == 'number') {
310
+        if (dataValue) {
311
+          return dataValue
312
+        }
313
+        return ''
309
       }
314
       }
310
 
315
 
311
       return dataValue
316
       return dataValue

+ 44
- 11
src/router/modules/admin.js View File

150
         permissions: ['manage', 'crm', 'field']
150
         permissions: ['manage', 'crm', 'field']
151
       }
151
       }
152
     },
152
     },
153
-    // {
154
-    //   path: 'customer',
155
-    //   component: () => import('@/views/admin/crm/customer'),
156
-    //   meta: {
157
-    //     title: '客户公海规则设置',
158
-    //     requiresAuth: true,
159
-    //     permissions: ['manage', 'crm', 'pool']
160
-    //   }
161
-    // },
162
-    { // 临时 使用 后期删除
153
+    {
163
       path: 'customer',
154
       path: 'customer',
164
-      component: () => import('@/views/admin/crm/customerPool'),
155
+      component: () => import('@/views/admin/crm/customer'),
165
       meta: {
156
       meta: {
166
         title: '客户公海规则设置',
157
         title: '客户公海规则设置',
167
         requiresAuth: true,
158
         requiresAuth: true,
168
         permissions: ['manage', 'crm', 'pool']
159
         permissions: ['manage', 'crm', 'pool']
169
       }
160
       }
170
     },
161
     },
162
+    // { // 临时 使用 后期删除
163
+    //   path: 'customer',
164
+    //   component: () => import('@/views/admin/crm/customerPool'),
165
+    //   meta: {
166
+    //     title: '客户公海规则设置',
167
+    //     requiresAuth: true,
168
+    //     permissions: ['manage', 'crm', 'pool']
169
+    //   }
170
+    // },
171
     {
171
     {
172
       path: 'print-templates',
172
       path: 'print-templates',
173
       component: () => import('@/views/admin/crm/printTemplates'),
173
       component: () => import('@/views/admin/crm/printTemplates'),
216
       }
216
       }
217
     }]
217
     }]
218
   },
218
   },
219
+  {
220
+    ...layout({
221
+      permissions: ['manage', 'adminLog'],
222
+      title: '系统日志',
223
+      icon: 'record'
224
+    }, '/manage/log/'),
225
+    alwaysShow: true,
226
+    children: [{
227
+      path: 'handle',
228
+      component: () => import('@/views/admin/log/DataHandleLog'),
229
+      meta: {
230
+        title: '数据操作日志',
231
+        requiresAuth: true,
232
+        permissions: ['manage', 'adminLog', 'actionRecord']
233
+      }
234
+    }, {
235
+      path: 'sys',
236
+      component: () => import('@/views/admin/log/SysHandleLog'),
237
+      meta: {
238
+        title: '系统操作日志',
239
+        requiresAuth: true,
240
+        permissions: ['manage', 'adminLog', 'systemLog']
241
+      }
242
+    }, {
243
+      path: 'login',
244
+      component: () => import('@/views/admin/log/LoginLog'),
245
+      meta: {
246
+        title: '登录日志',
247
+        requiresAuth: true,
248
+        permissions: ['manage', 'adminLog', 'loginLog']
249
+      }
250
+    }]
251
+  },
219
   {
252
   {
220
     ...layout({
253
     ...layout({
221
       permissions: ['manage', 'other_rule', 'setwelcome']
254
       permissions: ['manage', 'other_rule', 'setwelcome']

+ 7
- 7
src/views/admin/crm/customer/components/DetailRecycleRule.vue View File

5
       class="detail-recycle-rule__content">
5
       class="detail-recycle-rule__content">
6
       <div class="range-rule">
6
       <div class="range-rule">
7
         <span>选择不进入公海客户</span>
7
         <span>选择不进入公海客户</span>
8
-        <span v-if="dealHandleShow && data.dealHandle === 0">已成交客户</span>
9
-        <span v-if="businessHandleShow && data.businessHandle === 0">有商机客户</span>
8
+        <span v-if="dealHandleShow && data.deal_handle === 1">已成交客户</span>
9
+        <span v-if="businessHandleShow && data.business_handle === 1">有商机客户</span>
10
       </div>
10
       </div>
11
       <div>
11
       <div>
12
-        <div v-if="data.customerLevelSetting === 1" class="type-rule">所有客户统一设置</div>
13
-        <div v-else-if="data.customerLevelSetting === 2" class="type-rule">根据客户级别分别设置</div>
12
+        <div v-if="data.level_conf === 1" class="type-rule">所有客户统一设置</div>
13
+        <div v-else-if="data.level_conf === 2" class="type-rule">根据客户级别分别设置</div>
14
         <el-table
14
         <el-table
15
-          :data="data.levelSetting"
15
+          :data="data.level_setting"
16
           border
16
           border
17
           style="width: 100%">
17
           style="width: 100%">
18
           <el-table-column
18
           <el-table-column
21
             width="180"/>
21
             width="180"/>
22
           <el-table-column
22
           <el-table-column
23
             :label="limitDayName"
23
             :label="limitDayName"
24
-            prop="limitDay">
24
+            prop="limit_day">
25
             <template slot-scope="scope">
25
             <template slot-scope="scope">
26
-              <span>{{ `超过${scope.row.limitDay}天${getLimitDayUnit(data.type)},进入公海` }}</span>
26
+              <span>{{ `超过${scope.row.limit_day}天${getLimitDayUnit(data.type)},进入公海` }}</span>
27
             </template>
27
             </template>
28
           </el-table-column>
28
           </el-table-column>
29
         </el-table>
29
         </el-table>

+ 83
- 70
src/views/admin/crm/customer/components/PoolAdd.vue View File

28
               label-position="top"
28
               label-position="top"
29
               class="pool-add-items">
29
               class="pool-add-items">
30
               <el-form-item
30
               <el-form-item
31
-                prop="poolName"
31
+                prop="pool_name"
32
                 class="pool-add-item pool-add-item__left">
32
                 class="pool-add-item pool-add-item__left">
33
                 <div
33
                 <div
34
                   slot="label"
34
                   slot="label"
37
                     公海名称
37
                     公海名称
38
                   </div>
38
                   </div>
39
                 </div>
39
                 </div>
40
-                <el-input v-model="baseFrom.poolName" :maxlength="100" />
40
+                <el-input v-model="baseFrom.pool_name" :maxlength="100" />
41
               </el-form-item>
41
               </el-form-item>
42
               <el-form-item
42
               <el-form-item
43
                 prop="adminUsers"
43
                 prop="adminUsers"
89
             align="stretch">
89
             align="stretch">
90
             <div class="row-label">前负责人领取规则</div>
90
             <div class="row-label">前负责人领取规则</div>
91
             <div class="row-content">
91
             <div class="row-content">
92
-              <el-radio-group v-model="baseFrom.preOwnerSetting">
92
+              <el-radio-group v-model="baseFrom.before_owner_conf">
93
                 <el-radio :label="0">不限制</el-radio>
93
                 <el-radio :label="0">不限制</el-radio>
94
                 <el-radio :label="1">限制</el-radio>
94
                 <el-radio :label="1">限制</el-radio>
95
               </el-radio-group>
95
               </el-radio-group>
96
-              <div v-if="baseFrom.preOwnerSetting === 1" class="xr-input">
96
+              <div v-if="baseFrom.before_owner_conf === 1" class="xr-input">
97
                 <span>前负责人</span>
97
                 <span>前负责人</span>
98
-                <el-input v-model="baseFrom.preOwnerSettingDay" @keyup.native="inputLimit('preOwnerSettingDay')" />
98
+                <el-input v-model="baseFrom.before_owner_day" @keyup.native="inputLimit('before_owner_day')" />
99
                 <span>天内不允许领取该客户</span>
99
                 <span>天内不允许领取该客户</span>
100
               </div>
100
               </div>
101
             </div>
101
             </div>
106
             align="stretch">
106
             align="stretch">
107
             <div class="row-label">领取频率规则</div>
107
             <div class="row-label">领取频率规则</div>
108
             <div class="row-content">
108
             <div class="row-content">
109
-              <el-radio-group v-model="baseFrom.receiveSetting">
109
+              <el-radio-group v-model="baseFrom.receive_conf">
110
                 <el-radio :label="0">不限制</el-radio>
110
                 <el-radio :label="0">不限制</el-radio>
111
                 <el-radio :label="1">限制</el-radio>
111
                 <el-radio :label="1">限制</el-radio>
112
               </el-radio-group>
112
               </el-radio-group>
113
-              <div v-if="baseFrom.receiveSetting === 1" class="xr-input">
113
+              <div v-if="baseFrom.receive_conf === 1" class="xr-input">
114
                 <span>每天最多领取</span>
114
                 <span>每天最多领取</span>
115
-                <el-input v-model="baseFrom.receiveNum" @keyup.native="inputLimit('receiveNum')" />
115
+                <el-input v-model="baseFrom.receive_count" @keyup.native="inputLimit('receive_count')" />
116
                 <span>个公海客户</span>
116
                 <span>个公海客户</span>
117
               </div>
117
               </div>
118
             </div>
118
             </div>
123
             align="stretch">
123
             align="stretch">
124
             <div class="row-label">提醒规则</div>
124
             <div class="row-label">提醒规则</div>
125
             <div class="row-content">
125
             <div class="row-content">
126
-              <el-radio-group v-model="baseFrom.remindSetting">
126
+              <el-radio-group v-model="baseFrom.remind_conf">
127
                 <el-radio :label="0">不提醒</el-radio>
127
                 <el-radio :label="0">不提醒</el-radio>
128
                 <el-radio :label="1">提醒</el-radio>
128
                 <el-radio :label="1">提醒</el-radio>
129
               </el-radio-group>
129
               </el-radio-group>
130
-              <div v-if="baseFrom.remindSetting === 1" class="xr-input">
130
+              <div v-if="baseFrom.remind_conf === 1" class="xr-input">
131
                 <span>提前</span>
131
                 <span>提前</span>
132
-                <el-input v-model="baseFrom.remindDay" @keyup.native="inputLimit('remindDay')" />
132
+                <el-input v-model="baseFrom.remain_day" @keyup.native="inputLimit('remain_day')" />
133
                 <span>天提醒负责人</span>
133
                 <span>天提醒负责人</span>
134
               </div>
134
               </div>
135
             </div>
135
             </div>
140
             align="stretch">
140
             align="stretch">
141
             <div class="row-label">收回规则</div>
141
             <div class="row-label">收回规则</div>
142
             <div class="row-content">
142
             <div class="row-content">
143
-              <el-radio-group v-model="baseFrom.putInRule">
143
+              <el-radio-group v-model="baseFrom.recycle_conf">
144
                 <el-radio :label="1">自动回收</el-radio>
144
                 <el-radio :label="1">自动回收</el-radio>
145
                 <el-radio :label="0">不自动回收</el-radio>
145
                 <el-radio :label="0">不自动回收</el-radio>
146
               </el-radio-group>
146
               </el-radio-group>
147
             </div>
147
             </div>
148
           </flexbox>
148
           </flexbox>
149
 
149
 
150
-          <template v-if="baseFrom.putInRule == 1">
150
+          <template v-if="baseFrom.recycle_conf == 1">
151
             <recycle-rule
151
             <recycle-rule
152
               v-for="(item, index) in recycleRuleData"
152
               v-for="(item, index) in recycleRuleData"
153
               :key="index"
153
               :key="index"
172
                   <el-checkbox
172
                   <el-checkbox
173
                     v-for="(item, index) in customerPoolFields"
173
                     v-for="(item, index) in customerPoolFields"
174
                     :key="index"
174
                     :key="index"
175
-                    v-model="item.isHidden"
175
+                    v-model="item.is_hidden"
176
                     :true-label="0"
176
                     :true-label="0"
177
                     :false-label="1">{{ item.name }}</el-checkbox>
177
                     :false-label="1">{{ item.name }}</el-checkbox>
178
                 </flexbox>
178
                 </flexbox>
251
       loading: false,
251
       loading: false,
252
       baseFrom: null,
252
       baseFrom: null,
253
       baseRules: {
253
       baseRules: {
254
-        poolName: [
254
+        pool_name: [
255
           { required: true, message: '请输入公海名称', trigger: 'blur' }
255
           { required: true, message: '请输入公海名称', trigger: 'blur' }
256
         ],
256
         ],
257
         adminUsers: [
257
         adminUsers: [
265
       levelCustomerName: [], // 客户级别数据源
265
       levelCustomerName: [], // 客户级别数据源
266
       customerPoolFields: [],
266
       customerPoolFields: [],
267
       requestFields: {
267
       requestFields: {
268
-        preOwnerSettingDay: '前负责人限制领取天数需大于0',
269
-        receiveNum: '领取频率限制个数需大于0',
270
-        remindDay: '提醒规则天数需大于0'
268
+        before_owner_day: '前负责人限制领取天数需大于0',
269
+        receive_count: '领取频率限制个数需大于0',
270
+        remain_day: '提醒规则天数需大于0'
271
       }
271
       }
272
     }
272
     }
273
   },
273
   },
309
     getDetail() {
309
     getDetail() {
310
       this.loading = true
310
       this.loading = true
311
       crmCustomerPoolSetDetailAPI({
311
       crmCustomerPoolSetDetailAPI({
312
-        poolId: this.action.id
312
+        pool_id: this.action.id
313
       }).then(res => {
313
       }).then(res => {
314
         this.getEditInfo(res.data)
314
         this.getEditInfo(res.data)
315
         this.loading = false
315
         this.loading = false
319
     },
319
     },
320
 
320
 
321
     getEditInfo(data) {
321
     getEditInfo(data) {
322
+      if (data.user_info) {
323
+        data.user_info.forEach(item => {
324
+          item.type = 'user'
325
+        })
326
+      }
322
       this.baseFrom = {
327
       this.baseFrom = {
323
-        poolName: data.poolName,
324
-        adminUsers: data.adminUser,
328
+        pool_name: data.pool_name,
329
+        adminUsers: data.admin_user_info,
325
         memberUsers: {
330
         memberUsers: {
326
-          users: data.memberUser,
327
-          strucs: data.memberDept
331
+          users: data.user_info,
332
+          strucs: data.department_info
328
         },
333
         },
329
-        preOwnerSetting: data.preOwnerSetting, // 前负责人领取规则 0不限制 1限制
330
-        preOwnerSettingDay: data.preOwnerSettingDay,
331
-        receiveSetting: data.receiveSetting, // 0 不启用 1 启用
332
-        remindSetting: data.remindSetting, // 0 不提醒 1 提醒
333
-        receiveNum: data.receiveNum, // 领取频率规则
334
-        remindDay: data.remindDay, // 提醒规则天数
335
-        putInRule: data.putInRule // 收回规则 0不自动收回 1自动收回
334
+        before_owner_conf: data.before_owner_conf, // 前负责人领取规则 0不限制 1限制
335
+        before_owner_day: data.before_owner_day,
336
+        receive_conf: data.receive_conf, // 0 不启用 1 启用
337
+        remind_conf: data.remind_conf, // 0 不提醒 1 提醒
338
+        receive_count: data.receive_count, // 领取频率规则
339
+        remain_day: data.remain_day, // 提醒规则天数
340
+        recycle_conf: data.recycle_conf // 收回规则 0不自动收回 1自动收回
336
       }
341
       }
337
 
342
 
338
       this.recycleRuleData = this.getEditRule(data.rule)
343
       this.recycleRuleData = this.getEditRule(data.rule)
345
       const baseRule = [
350
       const baseRule = [
346
         {
351
         {
347
           type: '',
352
           type: '',
348
-          dealHandle: 1,
349
-          businessHandle: 1,
350
-          customerLevelSetting: 1,
353
+          deal_handle: 0,
354
+          business_handle: 0,
355
+          level_conf: 1,
351
           level: []
356
           level: []
352
         },
357
         },
353
         {
358
         {
354
           type: '',
359
           type: '',
355
-          dealHandle: 1,
356
-          businessHandle: 1,
357
-          customerLevelSetting: 1,
360
+          deal_handle: 0,
361
+          business_handle: 0,
362
+          level_conf: 1,
358
           level: []
363
           level: []
359
         },
364
         },
360
         {
365
         {
361
           type: '',
366
           type: '',
362
-          dealHandle: 1,
363
-          businessHandle: 1,
364
-          customerLevelSetting: 1,
367
+          deal_handle: 0,
368
+          business_handle: 0,
369
+          level_conf: 1,
365
           level: []
370
           level: []
366
         }
371
         }
367
       ]
372
       ]
369
       if (detailRule) {
374
       if (detailRule) {
370
         for (let index = 0; index < detailRule.length; index++) {
375
         for (let index = 0; index < detailRule.length; index++) {
371
           const element = detailRule[index]
376
           const element = detailRule[index]
372
-          element.level = element.levelSetting
377
+          element.level = element.level_setting
373
           baseRule.splice(element.type - 1, 1, element)
378
           baseRule.splice(element.type - 1, 1, element)
374
         }
379
         }
375
       }
380
       }
382
      */
387
      */
383
     getCreateInfo() {
388
     getCreateInfo() {
384
       this.baseFrom = {
389
       this.baseFrom = {
385
-        poolName: '',
390
+        pool_name: '',
386
         adminUsers: [],
391
         adminUsers: [],
387
         memberUsers: {
392
         memberUsers: {
388
           users: [],
393
           users: [],
389
           strucs: []
394
           strucs: []
390
         },
395
         },
391
-        preOwnerSetting: 0, // 前负责人领取规则 0不限制 1限制
392
-        preOwnerSettingDay: '',
393
-        receiveSetting: 0, // 0 不启用 1 启用
394
-        receiveNum: '', // 领取频率规则
395
-        remindSetting: 0, // 0 不提醒 1 提醒
396
-        remindDay: '', // 提醒规则天数
397
-        putInRule: 1 // 收回规则 0不自动收回 1自动收回
396
+        before_owner_conf: 0, // 前负责人领取规则 0不限制 1限制
397
+        before_owner_day: '',
398
+        receive_conf: 0, // 0 不启用 1 启用
399
+        receive_count: '', // 领取频率规则
400
+        remind_conf: 0, // 0 不提醒 1 提醒
401
+        remain_day: '', // 提醒规则天数
402
+        recycle_conf: 1 // 收回规则 0不自动收回 1自动收回
398
       }
403
       }
399
 
404
 
400
       this.recycleRuleData = this.getEditRule()
405
       this.recycleRuleData = this.getEditRule()
410
      */
415
      */
411
     getCustomerPoolFields(allFields) {
416
     getCustomerPoolFields(allFields) {
412
       return new Promise((resolve, reject) => {
417
       return new Promise((resolve, reject) => {
413
-        crmCustomerPoolQueryPoolFieldAPI().then(res => {
418
+        crmCustomerPoolQueryPoolFieldAPI(
419
+          {
420
+            types: 'crm_customer',
421
+            module: 'crm',
422
+            action: 'pool',
423
+            controller: 'customer',
424
+            pool_id: this.action.id
425
+          }
426
+        ).then(res => {
414
           const list = res.data || []
427
           const list = res.data || []
415
           const baseField = list.map(item => {
428
           const baseField = list.map(item => {
416
-            item.isHidden = item.isHidden = allFields ? 1 : 0
429
+            item.is_hidden = item.is_hidden = allFields ? 1 : 0
417
             return item
430
             return item
418
           })
431
           })
419
           if (allFields) {
432
           if (allFields) {
436
 
449
 
437
         for (let editIndex = 0; editIndex < allFields.length; editIndex++) {
450
         for (let editIndex = 0; editIndex < allFields.length; editIndex++) {
438
           const editItem = allFields[editIndex]
451
           const editItem = allFields[editIndex]
439
-          // fieldId 存在 匹配fieldId 不存在 匹配 fieldName
440
-          if (item.fieldId) {
441
-            if (item.fieldId === editItem.fieldId) {
442
-              item.settingId = editItem.settingId
443
-              item.isHidden = editItem.isHidden
452
+          // field_id 存在 匹配fieldId 不存在 匹配 field_name
453
+          if (item.field_id) {
454
+            if (item.field_id === editItem.field_id) {
455
+              item.setting_id = editItem.setting_id
456
+              item.is_hidden = editItem.is_hidden
444
             }
457
             }
445
           } else {
458
           } else {
446
-            if (item.fieldName === editItem.fieldName) {
447
-              item.settingId = editItem.settingId
448
-              item.isHidden = editItem.isHidden
459
+            if (item.field === editItem.field_name) {
460
+              item.setting_id = editItem.setting_id
461
+              item.is_hidden = editItem.is_hidden
449
             }
462
             }
450
           }
463
           }
451
         }
464
         }
503
      */
516
      */
504
     uploadPoolSet(params) {
517
     uploadPoolSet(params) {
505
       if (this.isEdit) {
518
       if (this.isEdit) {
506
-        params.poolId = this.action.id
519
+        params.pool_id = this.action.id
507
       }
520
       }
508
       this.loading = true
521
       this.loading = true
509
       crmCustomerPoolSetAPI(params).then(res => {
522
       crmCustomerPoolSetAPI(params).then(res => {
520
      * 必填字段验证
533
      * 必填字段验证
521
      */
534
      */
522
     requestFieldsVerify(key) {
535
     requestFieldsVerify(key) {
523
-      if (key == 'preOwnerSettingDay' && this.baseFrom.preOwnerSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
536
+      if (key == 'before_owner_day' && this.baseFrom.before_owner_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
524
         return false
537
         return false
525
-      } else if (key == 'receiveNum' && this.baseFrom.receiveSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
538
+      } else if (key == 'receive_count' && this.baseFrom.receive_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
526
         return false
539
         return false
527
-      } else if (key == 'remindDay' && this.baseFrom.remindSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
540
+      } else if (key == 'remain_day' && this.baseFrom.remind_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
528
         return false
541
         return false
529
       }
542
       }
530
 
543
 
544
         } else {
557
         } else {
545
           if (key == 'adminUsers') {
558
           if (key == 'adminUsers') {
546
             const adminUsers = this.baseFrom.adminUsers || []
559
             const adminUsers = this.baseFrom.adminUsers || []
547
-            params.adminUserId = adminUsers.map(item => {
548
-              return item.userId
560
+            params.admin_user_ids = adminUsers.map(item => {
561
+              return item.id
549
             }).join(',')
562
             }).join(',')
550
           } else if (key == 'memberUsers') {
563
           } else if (key == 'memberUsers') {
551
             const memberUserObj = this.baseFrom.memberUsers || {}
564
             const memberUserObj = this.baseFrom.memberUsers || {}
552
             const adminUsers = memberUserObj.users || []
565
             const adminUsers = memberUserObj.users || []
553
             const adminStrucs = memberUserObj.strucs || []
566
             const adminStrucs = memberUserObj.strucs || []
554
-            params.memberUserId = adminUsers.map(item => {
555
-              return item.userId
567
+            params.user_ids = adminUsers.map(item => {
568
+              return item.id
556
             }).join(',')
569
             }).join(',')
557
-            params.memberDeptId = adminStrucs.map(item => {
570
+            params.department_ids = adminStrucs.map(item => {
558
               return item.id
571
               return item.id
559
             }).join(',')
572
             }).join(',')
560
           } else {
573
           } else {
564
       }
577
       }
565
 
578
 
566
       // 收回规则 1 自动收回
579
       // 收回规则 1 自动收回
567
-      if (this.baseFrom.putInRule == 1) {
580
+      if (this.baseFrom.recycle_conf == 1) {
568
         const ruleVerify = this.recycleRuleData.filter(item => {
581
         const ruleVerify = this.recycleRuleData.filter(item => {
569
           return item.type
582
           return item.type
570
         })
583
         })
583
             const newLevel = []
596
             const newLevel = []
584
             for (let levelIndex = 0; levelIndex < ruleItem.level.length; levelIndex++) {
597
             for (let levelIndex = 0; levelIndex < ruleItem.level.length; levelIndex++) {
585
               const levelItem = ruleItem.level[levelIndex]
598
               const levelItem = ruleItem.level[levelIndex]
586
-              if (levelItem.limitDay && levelItem.limitDay > 0) {
599
+              if (levelItem.limit_day && levelItem.limit_day > 0) {
587
                 rulePass = true
600
                 rulePass = true
588
                 newLevel.push(levelItem)
601
                 newLevel.push(levelItem)
589
               }
602
               }
604
       }
617
       }
605
 
618
 
606
       const showFields = this.customerPoolFields.filter(item => {
619
       const showFields = this.customerPoolFields.filter(item => {
607
-        return item.isHidden == 0
620
+        return item.is_hidden == 0
608
       })
621
       })
609
 
622
 
610
       if (showFields.length < 2) {
623
       if (showFields.length < 2) {

+ 11
- 11
src/views/admin/crm/customer/components/PoolDetail.vue View File

17
         </div>
17
         </div>
18
         <div>
18
         <div>
19
           <div class="header-title">公海名称</div>
19
           <div class="header-title">公海名称</div>
20
-          <div class="header-name">{{ detail.poolName }}</div>
20
+          <div class="header-name">{{ detail.pool_name }}</div>
21
         </div>
21
         </div>
22
 
22
 
23
         <span class="customer-num">
23
         <span class="customer-num">
24
-          客户数量:<span class="customer-num__value">{{ detail.customerNum || 0 }}个</span>
24
+          客户数量:<span class="customer-num__value">{{ detail.customer_count || 0 }}个</span>
25
         </span>
25
         </span>
26
       </flexbox>
26
       </flexbox>
27
       <flexbox
27
       <flexbox
31
           <div class="label">公海管理员</div>
31
           <div class="label">公海管理员</div>
32
           <div class="value">
32
           <div class="value">
33
             <xr-avatar
33
             <xr-avatar
34
-              v-for="(item, index) in detail.adminUser"
34
+              v-for="(item, index) in detail.admin_user_info"
35
               :key="`admin${index}`"
35
               :key="`admin${index}`"
36
               :name="item.realname"
36
               :name="item.realname"
37
               :size="32"
37
               :size="32"
42
           <div class="label">公海成员</div>
42
           <div class="label">公海成员</div>
43
           <div class="value">
43
           <div class="value">
44
             <xr-avatar
44
             <xr-avatar
45
-              v-for="(item, index) in detail.memberUser"
45
+              v-for="(item, index) in detail.user_info"
46
               :key="`member${index}`"
46
               :key="`member${index}`"
47
               :name="item.realname"
47
               :name="item.realname"
48
               :size="32"
48
               :size="32"
49
               :src="item.img || item.thumb_img" />
49
               :src="item.img || item.thumb_img" />
50
             <xr-avatar
50
             <xr-avatar
51
-              v-for="(item, index) in detail.memberDept"
51
+              v-for="(item, index) in detail.department_info"
52
               :title="`dept${index}`"
52
               :title="`dept${index}`"
53
               :key="`dept${index}`"
53
               :key="`dept${index}`"
54
               :name="item.name"
54
               :name="item.name"
63
             align="stretch"
63
             align="stretch"
64
             class="rule-item">
64
             class="rule-item">
65
             <div class="label">前负责人领取规则</div>
65
             <div class="label">前负责人领取规则</div>
66
-            <div class="value">{{ detail.preOwnerSetting == 1 ? `前负责人${detail.preOwnerSettingDay}天内不允许领取该客户` : '不限制' }}</div>
66
+            <div class="value">{{ detail.before_owner_conf == 1 ? `前负责人${detail.before_owner_day}天内不允许领取该客户` : '不限制' }}</div>
67
           </flexbox>
67
           </flexbox>
68
           <flexbox
68
           <flexbox
69
             align="stretch"
69
             align="stretch"
70
             class="rule-item">
70
             class="rule-item">
71
             <div class="label">领取频率规则</div>
71
             <div class="label">领取频率规则</div>
72
-            <div class="value">{{ detail.receiveSetting == 1 ? `每天最多领取${detail.receiveNum}个公海客户` : '不限制' }}</div>
72
+            <div class="value">{{ detail.receive_conf == 1 ? `每天最多领取${detail.receive_count}个公海客户` : '不限制' }}</div>
73
           </flexbox>
73
           </flexbox>
74
           <flexbox
74
           <flexbox
75
             align="stretch"
75
             align="stretch"
76
             class="rule-item">
76
             class="rule-item">
77
             <div class="label">提醒规则</div>
77
             <div class="label">提醒规则</div>
78
-            <div class="value">{{ detail.remindSetting == 1 ? `提前${detail.remindDay}天提醒负责人` : '不提醒' }}</div>
78
+            <div class="value">{{ detail.remind_conf == 1 ? `提前${detail.remain_day}天提醒负责人` : '不提醒' }}</div>
79
           </flexbox>
79
           </flexbox>
80
           <flexbox
80
           <flexbox
81
             align="stretch"
81
             align="stretch"
82
             class="rule-item">
82
             class="rule-item">
83
             <div class="label">收回规则</div>
83
             <div class="label">收回规则</div>
84
-            <div v-if="detail.putInRule == 0" class="value">不自动回收</div>
84
+            <div v-if="detail.recycle_conf == 0" class="value">不自动回收</div>
85
             <div v-else class="value rule-value">
85
             <div v-else class="value rule-value">
86
               <detail-recycle-rule
86
               <detail-recycle-rule
87
                 v-for="(item, index) in detail.rule"
87
                 v-for="(item, index) in detail.rule"
121
   filters: {
121
   filters: {
122
     fieldNameFilter(list) {
122
     fieldNameFilter(list) {
123
       return list.filter(item => {
123
       return list.filter(item => {
124
-        return item.isHidden === 0
124
+        return item.is_hidden === 0
125
       }).map(item => {
125
       }).map(item => {
126
         return item.name
126
         return item.name
127
       }).join(',')
127
       }).join(',')
158
     getDetail() {
158
     getDetail() {
159
       this.loading = true
159
       this.loading = true
160
       crmCustomerPoolSetDetailAPI({
160
       crmCustomerPoolSetDetailAPI({
161
-        poolId: this.id
161
+        pool_id: this.id
162
       }).then(res => {
162
       }).then(res => {
163
         this.detail = res.data
163
         this.detail = res.data
164
         this.loading = false
164
         this.loading = false

+ 9
- 9
src/views/admin/crm/customer/components/PoolTransfer.vue View File

12
         <el-select v-model="selectId" >
12
         <el-select v-model="selectId" >
13
           <el-option
13
           <el-option
14
             v-for="item in list"
14
             v-for="item in list"
15
-            :key="item.poolId"
16
-            :label="item.poolName"
17
-            :value="item.poolId"/>
15
+            :key="item.pool_id"
16
+            :label="item.pool_name"
17
+            :value="item.pool_id"/>
18
         </el-select>
18
         </el-select>
19
       </flexbox>
19
       </flexbox>
20
     </div>
20
     </div>
62
   computed: {
62
   computed: {
63
     list() {
63
     list() {
64
       return this.allList.filter(item => {
64
       return this.allList.filter(item => {
65
-        return item.poolId != this.id
65
+        return item.pool_id != this.id
66
       })
66
       })
67
     }
67
     }
68
   },
68
   },
69
   watch: {
69
   watch: {
70
     list: {
70
     list: {
71
       handler() {
71
       handler() {
72
-        this.selectId = this.list && this.list.length > 0 ? this.list[0].poolId : ''
72
+        this.selectId = this.list && this.list.length > 0 ? this.list[0].pool_id : ''
73
       },
73
       },
74
       immediate: true
74
       immediate: true
75
     },
75
     },
89
       const loading = Loading.service({
89
       const loading = Loading.service({
90
         target: document.querySelector(`.el-dialog[aria-label="转移"]`)
90
         target: document.querySelector(`.el-dialog[aria-label="转移"]`)
91
       })
91
       })
92
-      crmCustomerPoolSetNameListAPI()
92
+      crmCustomerPoolSetNameListAPI({ limit: 9999 })
93
         .then(res => {
93
         .then(res => {
94
-          this.allList = res.data || []
94
+          this.allList = res.data.list || []
95
           loading && loading.close()
95
           loading && loading.close()
96
         })
96
         })
97
         .catch(() => {
97
         .catch(() => {
115
           target: document.querySelector(`.el-dialog[aria-label="转移"]`)
115
           target: document.querySelector(`.el-dialog[aria-label="转移"]`)
116
         })
116
         })
117
         crmCustomerPoolSetTransferAPI({
117
         crmCustomerPoolSetTransferAPI({
118
-          prePoolId: this.id,
119
-          postPoolId: this.selectId
118
+          source_pool_id: this.id,
119
+          target_pool_id: this.selectId
120
         })
120
         })
121
           .then(res => {
121
           .then(res => {
122
             this.$message({
122
             this.$message({

+ 24
- 24
src/views/admin/crm/customer/components/RecycleRule.vue View File

10
         <span class="check-label">选择不进入公海客户</span>
10
         <span class="check-label">选择不进入公海客户</span>
11
         <el-checkbox
11
         <el-checkbox
12
           v-if="dealHandleShow"
12
           v-if="dealHandleShow"
13
-          v-model="data.dealHandle"
14
-          :true-label="0"
15
-          :false-label="1">已成交客户<el-tooltip
13
+          v-model="data.deal_handle"
14
+          :true-label="1"
15
+          :false-label="0">已成交客户<el-tooltip
16
             content="已成交是指客户状态为“已成交”"
16
             content="已成交是指客户状态为“已成交”"
17
             effect="dark"
17
             effect="dark"
18
             placement="top">
18
             placement="top">
20
         </el-tooltip></el-checkbox>
20
         </el-tooltip></el-checkbox>
21
         <el-checkbox
21
         <el-checkbox
22
           v-if="businessHandleShow"
22
           v-if="businessHandleShow"
23
-          v-model="data.businessHandle"
24
-          :true-label="0"
25
-          :false-label="1">有商机客户</el-checkbox>
23
+          v-model="data.business_handle"
24
+          :true-label="1"
25
+          :false-label="0">有商机客户</el-checkbox>
26
       </div>
26
       </div>
27
       <div>
27
       <div>
28
-        <el-radio v-model="data.customerLevelSetting" :label="1">所有客户统一设置</el-radio>
28
+        <el-radio v-model="data.level_conf" :label="1">所有客户统一设置</el-radio>
29
         <el-table
29
         <el-table
30
           :data="allCustomerData"
30
           :data="allCustomerData"
31
           border
31
           border
36
             width="180"/>
36
             width="180"/>
37
           <el-table-column
37
           <el-table-column
38
             :label="limitDayName"
38
             :label="limitDayName"
39
-            prop="limitDay">
39
+            prop="limit_day">
40
             <template slot-scope="scope">
40
             <template slot-scope="scope">
41
               <span>超过</span>
41
               <span>超过</span>
42
-              <el-input v-model="scope.row.limitDay" class="value-input" @keyup.native="inputLimit(scope.row)" />
42
+              <el-input v-model="scope.row.limit_day" class="value-input" @keyup.native="inputLimit(scope.row)" />
43
               <span>天{{ limitDayUnit }},进入公海</span>
43
               <span>天{{ limitDayUnit }},进入公海</span>
44
             </template>
44
             </template>
45
           </el-table-column>
45
           </el-table-column>
47
       </div>
47
       </div>
48
 
48
 
49
       <div>
49
       <div>
50
-        <el-radio v-model="data.customerLevelSetting" :label="2">根据客户级别分别设置</el-radio>
50
+        <el-radio v-model="data.level_conf" :label="2">根据客户级别分别设置</el-radio>
51
         <el-table
51
         <el-table
52
           :data="levelCustomerData"
52
           :data="levelCustomerData"
53
           border
53
           border
58
             width="180"/>
58
             width="180"/>
59
           <el-table-column
59
           <el-table-column
60
             :label="limitDayName"
60
             :label="limitDayName"
61
-            prop="limitDay">
61
+            prop="limit_day">
62
             <template slot-scope="scope">
62
             <template slot-scope="scope">
63
               <span>超过</span>
63
               <span>超过</span>
64
-              <el-input v-model="scope.row.limitDay" class="value-input" @keyup.native="inputLimit(scope.row)" />
64
+              <el-input v-model="scope.row.limit_day" class="value-input" @keyup.native="inputLimit(scope.row)" />
65
               <span>天{{ limitDayUnit }},进入公海</span>
65
               <span>天{{ limitDayUnit }},进入公海</span>
66
             </template>
66
             </template>
67
           </el-table-column>
67
           </el-table-column>
86
       default: () => {
86
       default: () => {
87
         /**
87
         /**
88
          * "type":1, // 收回规则判断类型 1跟进记录 2商机 3成交状态
88
          * "type":1, // 收回规则判断类型 1跟进记录 2商机 3成交状态
89
-        "dealHandle":0, // 已成交客户是否进入公海 0不进入 1进入
90
-        "businessHandle":1, // 有商机客户是否进入公海 0不进入 1进入
89
+        "deal_handle":0, // 已成交客户是否进入公海 0不进入 1进入
90
+        "business_handle":1, // 有商机客户是否进入公海 0不进入 1进入
91
         "level":1, // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先  客户)
91
         "level":1, // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先  客户)
92
-        "limitDay":30 // 公海规则限制天数
92
+        "limit_day":30 // 公海规则限制天数
93
          */
93
          */
94
         return {
94
         return {
95
           type: '',
95
           type: '',
96
-          dealHandle: 1,
97
-          businessHandle: 1,
98
-          customerLevelSetting: null,
96
+          deal_handle: 0,
97
+          business_handle: 0,
98
+          level_conf: null,
99
           level: []
99
           level: []
100
         }
100
         }
101
       }
101
       }
111
     return {
111
     return {
112
       allCustomerData: [{
112
       allCustomerData: [{
113
         level: '所有客户', // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先客户)
113
         level: '所有客户', // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先客户)
114
-        limitDay: ''
114
+        limit_day: ''
115
       }],
115
       }],
116
       levelCustomerData: []
116
       levelCustomerData: []
117
     }
117
     }
149
     }
149
     }
150
   },
150
   },
151
   watch: {
151
   watch: {
152
-    'data.customerLevelSetting': {
152
+    'data.level_conf': {
153
       handler(val, oldVal) {
153
       handler(val, oldVal) {
154
         if (val == 1) {
154
         if (val == 1) {
155
           if (this.isEdit && oldVal == null) {
155
           if (this.isEdit && oldVal == null) {
175
         if (value && value.length) {
175
         if (value && value.length) {
176
           this.levelCustomerData = value.map(item => {
176
           this.levelCustomerData = value.map(item => {
177
             const obj = {
177
             const obj = {
178
-              limitDay: ''
178
+              limit_day: ''
179
             }
179
             }
180
             obj.level = item
180
             obj.level = item
181
             return obj
181
             return obj
182
           })
182
           })
183
 
183
 
184
           // 类型是2
184
           // 类型是2
185
-          if (this.data.customerLevelSetting == 2) {
185
+          if (this.data.level_conf == 2) {
186
             if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) {
186
             if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) {
187
               this.data.level = this.getEditData(this.levelCustomerData, this.data.level)
187
               this.data.level = this.getEditData(this.levelCustomerData, this.data.level)
188
             }
188
             }
202
         for (let editIndex = 0; editIndex < editList.length; editIndex++) {
202
         for (let editIndex = 0; editIndex < editList.length; editIndex++) {
203
           const editItem = editList[editIndex]
203
           const editItem = editList[editIndex]
204
           if (editItem.level == item.level) {
204
           if (editItem.level == item.level) {
205
-            item.limitDay = editItem.limitDay
205
+            item.limit_day = editItem.limit_day
206
           }
206
           }
207
         }
207
         }
208
       }
208
       }
214
      * 阻挡输入
214
      * 阻挡输入
215
      */
215
      */
216
     inputLimit(data) {
216
     inputLimit(data) {
217
-      data.limitDay = data.limitDay.replace(/[^0-9]/g, '')
217
+      data.limit_day = data.limit_day.replace(/[^0-9]/g, '')
218
     }
218
     }
219
   }
219
   }
220
 }
220
 }

+ 39
- 38
src/views/admin/crm/customer/index.vue View File

27
         @row-click="handleRowClick">
27
         @row-click="handleRowClick">
28
         <el-table-column
28
         <el-table-column
29
           show-overflow-tooltip
29
           show-overflow-tooltip
30
-          prop="poolName"
30
+          prop="pool_name"
31
           width="150"
31
           width="150"
32
           label="公海名称"/>
32
           label="公海名称"/>
33
         <el-table-column
33
         <el-table-column
34
           :formatter="fieldFormatter"
34
           :formatter="fieldFormatter"
35
           show-overflow-tooltip
35
           show-overflow-tooltip
36
-          prop="adminUser"
36
+          prop="admin_user_names"
37
           label="公海管理员"/>
37
           label="公海管理员"/>
38
         <el-table-column
38
         <el-table-column
39
           :formatter="fieldFormatter"
39
           :formatter="fieldFormatter"
40
           show-overflow-tooltip
40
           show-overflow-tooltip
41
-          prop="memberUser"
41
+          prop="user_names"
42
           label="公海成员"/>
42
           label="公海成员"/>
43
         <el-table-column
43
         <el-table-column
44
           show-overflow-tooltip
44
           show-overflow-tooltip
45
-          prop="customerNum"
45
+          prop="customer_count"
46
           width="100"
46
           width="100"
47
           label="客户数量"/>
47
           label="客户数量"/>
48
         <el-table-column
48
         <el-table-column
188
       })
188
       })
189
         .then(res => {
189
         .then(res => {
190
           this.list = res.data.list
190
           this.list = res.data.list
191
-          this.total = res.data.totalRow
191
+          this.total = res.data.count
192
           this.loading = false
192
           this.loading = false
193
         })
193
         })
194
         .catch(() => {
194
         .catch(() => {
200
      * 格式化字段
200
      * 格式化字段
201
      */
201
      */
202
     fieldFormatter(row, column) {
202
     fieldFormatter(row, column) {
203
-      if (column.property === 'adminUser') {
204
-        const users = row['adminUser'] || []
205
-        return users
206
-          .map(item => {
207
-            return item.realname
208
-          })
209
-          .join('、')
210
-      } else if (column.property === 'memberUser') {
211
-        const structures = row['memberDept'] || []
212
-        let strName = structures
213
-          .map(item => {
214
-            return item.name
215
-          })
216
-          .join('、')
203
+      // if (column.property === 'admin_user_names') {
204
+      //   const users = row['admin_user_names'] || []
205
+      //   return users
206
+      //     .map(item => {
207
+      //       return item.realname
208
+      //     })
209
+      //     .join('、')
210
+      // } else if (column.property === 'user_names') {
211
+      //   const structures = row['memberDept'] || []
212
+      //   let strName = structures
213
+      //     .map(item => {
214
+      //       return item.name
215
+      //     })
216
+      //     .join('、')
217
 
217
 
218
-        const users = row['memberUser'] || []
219
-        const userName = users
220
-          .map(item => {
221
-            return item.realname
222
-          })
223
-          .join('、')
218
+      //   const users = row['user_names'] || []
219
+      //   const userName = users
220
+      //     .map(item => {
221
+      //       return item.realname
222
+      //     })
223
+      //     .join('、')
224
 
224
 
225
-        if (strName && userName) {
226
-          strName += '、'
227
-        }
228
-        const name = strName + userName
229
-        return name
230
-      } else if (column.property === 'status') {
225
+      //   if (strName && userName) {
226
+      //     strName += '、'
227
+      //   }
228
+      //   const name = strName + userName
229
+      //   return name
230
+      // } else
231
+      if (column.property === 'status') {
231
         if (row.status === 0) {
232
         if (row.status === 0) {
232
           return '停用'
233
           return '停用'
233
         }
234
         }
240
      * 通过回调控制class
241
      * 通过回调控制class
241
      */
242
      */
242
     cellClassName({ row, column, rowIndex, columnIndex }) {
243
     cellClassName({ row, column, rowIndex, columnIndex }) {
243
-      if (column.property === 'poolName') {
244
+      if (column.property === 'pool_name') {
244
         return 'can-visit--underline'
245
         return 'can-visit--underline'
245
       } else {
246
       } else {
246
         return ''
247
         return ''
262
      * 当某一行被点击时会触发该事件
263
      * 当某一行被点击时会触发该事件
263
      */
264
      */
264
     handleRowClick(row, column, event) {
265
     handleRowClick(row, column, event) {
265
-      if (column.property === 'poolName') {
266
-        this.detailId = row.poolId
266
+      if (column.property === 'pool_name') {
267
+        this.detailId = row.pool_id
267
         this.detailShow = true
268
         this.detailShow = true
268
       }
269
       }
269
     },
270
     },
275
       if (type === 'edit') {
276
       if (type === 'edit') {
276
         this.createAction = {
277
         this.createAction = {
277
           type: 'update',
278
           type: 'update',
278
-          id: scope.row.poolId,
279
+          id: scope.row.pool_id,
279
           data: scope.row
280
           data: scope.row
280
         }
281
         }
281
         this.createShow = true
282
         this.createShow = true
282
       } else if (type === 'transfer') {
283
       } else if (type === 'transfer') {
283
-        this.detailId = scope.row.poolId
284
+        this.detailId = scope.row.pool_id
284
         this.transferShow = true
285
         this.transferShow = true
285
       } else if (type === 'delete') {
286
       } else if (type === 'delete') {
286
         this.$confirm('您确定要删除吗?', '提示', {
287
         this.$confirm('您确定要删除吗?', '提示', {
290
         })
291
         })
291
           .then(() => {
292
           .then(() => {
292
             crmCustomerPoolSetDeleteAPI({
293
             crmCustomerPoolSetDeleteAPI({
293
-              poolId: scope.row.poolId
294
+              pool_id: scope.row.pool_id
294
             })
295
             })
295
               .then(res => {
296
               .then(res => {
296
                 this.list.splice(scope.$index, 1)
297
                 this.list.splice(scope.$index, 1)
319
         )
320
         )
320
           .then(() => {
321
           .then(() => {
321
             crmCustomerPoolSetChangeStatusAPI({
322
             crmCustomerPoolSetChangeStatusAPI({
322
-              poolId: scope.row.poolId,
323
+              pool_id: scope.row.pool_id,
323
               status: scope.row.status === 0 ? 1 : 0
324
               status: scope.row.status === 0 ? 1 : 0
324
             })
325
             })
325
               .then(res => {
326
               .then(res => {

+ 9
- 9
src/views/admin/crm/printTemplates/PrintTemplateDetail.vue View File

32
           <div
32
           <div
33
             v-for="(item, index) in menuList"
33
             v-for="(item, index) in menuList"
34
             :key="index"
34
             :key="index"
35
-            :class="{'is-select' : item.fieldName == menuIndex}"
35
+            :class="{'is-select' : item.field == menuIndex}"
36
             class="menu-item"
36
             class="menu-item"
37
             @click="menuSelect(item, index)">
37
             @click="menuSelect(item, index)">
38
             {{ item.name }}
38
             {{ item.name }}
122
     getDetail() {
122
     getDetail() {
123
       this.loading = true
123
       this.loading = true
124
       printTemplateByIdAPI({
124
       printTemplateByIdAPI({
125
-        templateId: this.$route.query.templateId
125
+        id: this.$route.query.templateId
126
       }).then(res => {
126
       }).then(res => {
127
         const data = res.data || {}
127
         const data = res.data || {}
128
         this.content = data.content
128
         this.content = data.content
178
 
178
 
179
     menuSelect(item, index) {
179
     menuSelect(item, index) {
180
       // console.log(this.editor.selection.getNode())
180
       // console.log(this.editor.selection.getNode())
181
-      this.menuIndex = item.fieldName
181
+      this.menuIndex = item.field
182
       // 整单折扣 产品总金额 不能插入
182
       // 整单折扣 产品总金额 不能插入
183
-      if (this.activeTab == 'product' && item.fieldName != 'discount_rate' && item.fieldName != 'total_price') {
183
+      if (this.activeTab == 'product' && item.field != 'discount_rate' && item.field != 'total_price') {
184
         const tableParent = this.getCurrentParentByTag('table[data-wk-table-tag="table"]')
184
         const tableParent = this.getCurrentParentByTag('table[data-wk-table-tag="table"]')
185
         if (tableParent) {
185
         if (tableParent) {
186
           const headerTr = this.editor.dom.select('tr[data-wk-table-tr-tag="header"]', tableParent)
186
           const headerTr = this.editor.dom.select('tr[data-wk-table-tr-tag="header"]', tableParent)
201
           // 产品下字段 整单折扣 产品总金额 用商机和合同的
201
           // 产品下字段 整单折扣 产品总金额 用商机和合同的
202
 
202
 
203
           // const parentPNode = this.getCurrentParentByTag('p')
203
           // const parentPNode = this.getCurrentParentByTag('p')
204
-          if (this.activeTab == 'product' && (item.fieldName == 'discount_rate' || item.fieldName == 'total_price')) {
204
+          if (this.activeTab == 'product' && (item.field == 'discount_rate' || item.field == 'total_price')) {
205
             this.editor.insertContent(this.getSpanNode(item, '', crmTypeModel.convertTypeToKey(this.type)))
205
             this.editor.insertContent(this.getSpanNode(item, '', crmTypeModel.convertTypeToKey(this.type)))
206
             // this.editor.dom.add(parentPNode, 'span', this.getSpanNodeAttrsByType(item, '', crmTypeModel.convertTypeToKey(this.type)), `{${item.name}}`)
206
             // this.editor.dom.add(parentPNode, 'span', this.getSpanNodeAttrsByType(item, '', crmTypeModel.convertTypeToKey(this.type)), `{${item.name}}`)
207
           } else {
207
           } else {
244
     getSpanNodeAttrsByType(item, tag = '', type) {
244
     getSpanNodeAttrsByType(item, tag = '', type) {
245
       const attrs = {}
245
       const attrs = {}
246
       const dataKey = `data-wk${tag ? `-${tag}` : ''}-tag`
246
       const dataKey = `data-wk${tag ? `-${tag}` : ''}-tag`
247
-      const dataValue = `${type}.${item.fieldName}`
247
+      const dataValue = `${type}.${item.field}`
248
 
248
 
249
       attrs[dataKey] = dataValue
249
       attrs[dataKey] = dataValue
250
       attrs.class = `wk-print-tag-wukong ${this.getSpanColorClass()}`
250
       attrs.class = `wk-print-tag-wukong ${this.getSpanColorClass()}`
253
     },
253
     },
254
 
254
 
255
     getSpanNode(item, tag = '', type = this.activeTab) {
255
     getSpanNode(item, tag = '', type = this.activeTab) {
256
-      return `<span data-wk${tag ? `-${tag}` : ''}-tag="${type}.${item.fieldName}" class="wk-print-tag-wukong ${this.getSpanColorClass()}" contenteditable="false">{${item.name}}</span>`
256
+      return `<span data-wk${tag ? `-${tag}` : ''}-tag="${type}.${item.field}" class="wk-print-tag-wukong ${this.getSpanColorClass()}" contenteditable="false">{${item.name}}</span>`
257
     },
257
     },
258
 
258
 
259
     /**
259
     /**
281
       const request = this.isCreate ? printAddTemplateAPI : printUpdateTemplateAPI
281
       const request = this.isCreate ? printAddTemplateAPI : printUpdateTemplateAPI
282
       const data = this.$route.query
282
       const data = this.$route.query
283
       const params = {
283
       const params = {
284
-        name: data.templateName,
284
+        name: data.name,
285
         type: data.type,
285
         type: data.type,
286
         content: this.content
286
         content: this.content
287
       }
287
       }
288
 
288
 
289
       if (!this.isCreate) {
289
       if (!this.isCreate) {
290
-        params.templateId = data.templateId
290
+        params.id = data.templateId
291
       }
291
       }
292
 
292
 
293
       request(params)
293
       request(params)

+ 8
- 4
src/views/admin/crm/printTemplates/components/TemplateTypeAdd.vue View File

55
       options: [
55
       options: [
56
         {
56
         {
57
           label: '商机',
57
           label: '商机',
58
-          value: 1
58
+          value: 5
59
         },
59
         },
60
         {
60
         {
61
           label: '合同',
61
           label: '合同',
62
-          value: 2
62
+          value: 6
63
         },
63
         },
64
         {
64
         {
65
           label: '回款',
65
           label: '回款',
66
-          value: 3
66
+          value: 7
67
         }
67
         }
68
       ]
68
       ]
69
     }
69
     }
87
         if (val) {
87
         if (val) {
88
           this.dataForm = {
88
           this.dataForm = {
89
             name: '',
89
             name: '',
90
-            type: 1
90
+            type: 5
91
           }
91
           }
92
 
92
 
93
           if (this.isEdit) {
93
           if (this.isEdit) {
112
      */
112
      */
113
     handleConfirm() {
113
     handleConfirm() {
114
       if (!this.dataForm.name) {
114
       if (!this.dataForm.name) {
115
+        this.$message({
116
+          type: 'error',
117
+          message: '请输入模板名称'
118
+        })
115
         return
119
         return
116
       }
120
       }
117
 
121
 

+ 4
- 4
src/views/admin/crm/printTemplates/index.vue View File

198
      * 通过回调控制class
198
      * 通过回调控制class
199
      */
199
      */
200
     cellClassName({ row, column, rowIndex, columnIndex }) {
200
     cellClassName({ row, column, rowIndex, columnIndex }) {
201
-      if (column.property === 'templateName') {
201
+      if (column.property === 'name') {
202
         return 'can-visit--underline'
202
         return 'can-visit--underline'
203
       } else {
203
       } else {
204
         return ''
204
         return ''
209
      * 当某一行被点击时会触发该事件
209
      * 当某一行被点击时会触发该事件
210
      */
210
      */
211
     handleRowClick(row, column, event) {
211
     handleRowClick(row, column, event) {
212
-      if (column.property === 'templateName') {
212
+      if (column.property === 'name') {
213
         this.$router.push({
213
         this.$router.push({
214
           name: 'crmPrintDetail',
214
           name: 'crmPrintDetail',
215
           query: {
215
           query: {
216
             handle: 'detail',
216
             handle: 'detail',
217
-            templateName: row.templateName,
218
-            templateId: row.templateId,
217
+            name: row.name,
218
+            templateId: row.id,
219
             type: row.type
219
             type: row.type
220
           }
220
           }
221
         })
221
         })

+ 129
- 0
src/views/admin/employeeDep/components/EditDepDialog.vue View File

1
+<template>
2
+  <el-dialog
3
+    ref="wkDialog"
4
+    :visible="visible"
5
+    :append-to-body="true"
6
+    :close-on-click-modal="false"
7
+    title="重置部门"
8
+    width="500px"
9
+    @close="handleCancel">
10
+    <div >
11
+      <el-form
12
+        ref="form"
13
+        :model="fieldFrom"
14
+        :rules="rules"
15
+        label-position="top">
16
+        <el-form-item
17
+          label="部门"
18
+          prop="structure_id">
19
+          <wk-dep-select
20
+            v-model="fieldFrom.structure_id"
21
+            radio
22
+            style="width: 100%;"
23
+          />
24
+        </el-form-item>
25
+      </el-form>
26
+    </div>
27
+    <span
28
+      slot="footer"
29
+      class="dialog-footer">
30
+      <el-button @click.native="handleCancel">取消</el-button>
31
+      <el-button
32
+        v-debounce="handleConfirm"
33
+        type="primary">保存</el-button>
34
+    </span>
35
+  </el-dialog>
36
+</template>
37
+
38
+<script>
39
+import {
40
+  adminUserSetUserDeptPI
41
+} from '@/api/admin/employeeDep'
42
+
43
+import WkDepSelect from '@/components/NewCom/WkDepSelect'
44
+
45
+import ElDialogLoadingMixin from '@/mixins/ElDialogLoading'
46
+
47
+export default {
48
+  // 重置部门
49
+  name: 'EditDepDialog',
50
+
51
+  components: {
52
+    WkDepSelect
53
+  },
54
+
55
+  mixins: [ElDialogLoadingMixin],
56
+
57
+  props: {
58
+    selectionList: Array, // 员工信息
59
+    visible: {
60
+      type: Boolean,
61
+      required: true,
62
+      default: false
63
+    }
64
+  },
65
+
66
+  data() {
67
+    return {
68
+      fieldFrom: {
69
+        structure_id: ''
70
+      },
71
+      rules: {
72
+        structure_id: { required: true, message: '请选择', trigger: 'change' }
73
+      }
74
+    }
75
+  },
76
+
77
+  computed: {},
78
+
79
+  watch: {},
80
+
81
+  created() {},
82
+
83
+  mounted() {},
84
+
85
+  beforeDestroy() {},
86
+
87
+  methods: {
88
+    /**
89
+     * 取消选择
90
+     */
91
+    handleCancel() {
92
+      this.$emit('update:visible', false)
93
+    },
94
+
95
+    /**
96
+     * 点击确定
97
+     */
98
+    handleConfirm() {
99
+      this.$refs.form.validate(valid => {
100
+        if (valid) {
101
+          const id = this.selectionList.map(item => item.id)
102
+          this.loading = true
103
+          adminUserSetUserDeptPI({
104
+            ...this.fieldFrom,
105
+            id
106
+          }).then(res => {
107
+            this.loading = false
108
+            this.$message.success('操作成功')
109
+            this.$emit('change')
110
+            this.handleCancel()
111
+          }).catch(() => {
112
+            this.loading = false
113
+          })
114
+        }
115
+      })
116
+    }
117
+  }
118
+}
119
+</script>
120
+
121
+<style lang="scss" scoped>
122
+.el-form {
123
+  margin-top: 10px;
124
+  /deep/ .el-form-item__label {
125
+    line-height: 30px;
126
+    padding-bottom: 0;
127
+  }
128
+}
129
+</style>

+ 159
- 25
src/views/admin/employeeDep/index.vue View File

34
                 <i
34
                 <i
35
                   :class="item.icon"
35
                   :class="item.icon"
36
                   class="menu-item__icon" />
36
                   class="menu-item__icon" />
37
-                <div class="menu-item__content">{{ item.label }}</div>
37
+                <div class="menu-item__content">{{ item.label }}&nbsp;<span v-if="item.count > 0" style="color: #999;">({{ item.count }})</span></div>
38
               </flexbox>
38
               </flexbox>
39
             </div>
39
             </div>
40
           </div>
40
           </div>
86
           justify="space-between"
86
           justify="space-between"
87
           class="table-top">
87
           class="table-top">
88
           <div class="table-top__title">
88
           <div class="table-top__title">
89
-            <span>{{ `${currentMenuData ? currentMenuData.label : ''}:${ total || 0 }` }}</span>
89
+            <span>{{ `${currentMenuData ? currentMenuData.label : ''}` }}<template v-if="!isDepUserShow">{{ `:${userTotal || 0}` }}</template></span>
90
+            <el-tooltip
91
+              v-if="currentMenuData && currentMenuData.tips"
92
+              :content="currentMenuData.tips"
93
+              effect="dark"
94
+              placement="top">
95
+              <i class="wk wk-help wk-help-tips"/>
96
+            </el-tooltip>
90
             <reminder
97
             <reminder
91
               v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'"
98
               v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'"
92
               class="all-user-reminder"
99
               class="all-user-reminder"
93
               content="未添加部门和角色的员工无法正常登录系统" />
100
               content="未添加部门和角色的员工无法正常登录系统" />
94
           </div>
101
           </div>
95
           <div>
102
           <div>
103
+
104
+            <el-checkbox
105
+              v-if="isDepUserShow"
106
+              v-model="isNeedChild"
107
+              :true-label="1"
108
+              :false-label="0"
109
+              @change="refreshUserList">包含子部门</el-checkbox>
96
             <el-button
110
             <el-button
97
               v-if="userSaveAuth"
111
               v-if="userSaveAuth"
98
               type="text"
112
               type="text"
145
               width="55" />
159
               width="55" />
146
             <el-table-column
160
             <el-table-column
147
               prop="realname"
161
               prop="realname"
148
-              width="100"
162
+              width="150"
149
               show-overflow-tooltip
163
               show-overflow-tooltip
150
               label="姓名">
164
               label="姓名">
151
-              <template slot-scope="scope">
152
-                <div class="status-name">
153
-                  <div :style="{'background-color' : getStatusColor(scope.row.status)}" />
154
-                  {{ scope.row.realname }}
155
-                </div>
165
+              <template slot-scope="{ row, column }">
166
+                <span class="status-name">
167
+                  <span :style="{'background-color' : getStatusColor(row.status)}" class="status-mark" />
168
+                  <span v-if="row.userIdentity === 0" class="main-mark">主账号</span>
169
+                  <span v-if="row.userIdentity === 1" class="main-mark">负责人</span>
170
+                  <span>{{ row.realname }}</span>
171
+                </span>
156
               </template>
172
               </template>
157
             </el-table-column>
173
             </el-table-column>
158
             <el-table-column
174
             <el-table-column
217
             :value="item.id" />
233
             :value="item.id" />
218
         </el-select>
234
         </el-select>
219
       </div>
235
       </div>
236
+      <flexbox
237
+        class="nav-dialog-div">
238
+        <label>部门负责人:</label>
239
+        <wk-user-select
240
+          v-model="depOwnerUserId"
241
+          radio
242
+        />
243
+      </flexbox>
220
       <span
244
       <span
221
         slot="footer"
245
         slot="footer"
222
         class="dialog-footer">
246
         class="dialog-footer">
402
           <template v-if="item.type == 'select'">
426
           <template v-if="item.type == 'select'">
403
             <el-select
427
             <el-select
404
               v-model="formInline[item.field]"
428
               v-model="formInline[item.field]"
405
-              filterable>
429
+              filterable
430
+              @change="addUserSelectChange(item)">
406
               <el-option
431
               <el-option
407
                 v-for="optionItem in optionsList[item.field].list"
432
                 v-for="optionItem in optionsList[item.field].list"
408
                 :key="optionItem.id"
433
                 :key="optionItem.id"
459
       :visible.sync="editRoleDialogShow"
484
       :visible.sync="editRoleDialogShow"
460
       @change="getUserList"
485
       @change="getUserList"
461
     />
486
     />
487
+    <!-- 重置部门 -->
488
+    <edit-dep-dialog
489
+      v-if="editDepDialogShow"
490
+      :selection-list="selectionList"
491
+      :visible.sync="editDepDialogShow"
492
+      @change="getUserList"
493
+    />
462
   </div>
494
   </div>
463
 </template>
495
 </template>
464
 
496
 
473
   adminUsersUpdatePwdAPI,
505
   adminUsersUpdatePwdAPI,
474
   adminUsersUsernameEditAPI,
506
   adminUsersUsernameEditAPI,
475
   adminUsersManagerUsernameEditAPI,
507
   adminUsersManagerUsernameEditAPI,
476
-  usersEditStatusAPI
508
+  usersEditStatusAPI,
509
+  adminUserCountNumOfUserAPI
477
 } from '@/api/admin/employeeDep'
510
 } from '@/api/admin/employeeDep'
478
 
511
 
479
 import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' // 直属上级接口
512
 import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' // 直属上级接口
487
 import Reminder from '@/components/Reminder'
520
 import Reminder from '@/components/Reminder'
488
 import SlideVerify from '@/components/SlideVerify'
521
 import SlideVerify from '@/components/SlideVerify'
489
 import EditRoleDialog from './components/EditRoleDialog'
522
 import EditRoleDialog from './components/EditRoleDialog'
523
+import WkUserSelect from '@/components/NewCom/WkUserSelect'
524
+import EditDepDialog from './components/EditDepDialog'
490
 
525
 
491
 import { chinaMobileRegex, objDeepCopy } from '@/utils'
526
 import { chinaMobileRegex, objDeepCopy } from '@/utils'
492
 
527
 
499
     XrHeader,
534
     XrHeader,
500
     Reminder,
535
     Reminder,
501
     SlideVerify,
536
     SlideVerify,
502
-    EditRoleDialog
537
+    EditRoleDialog,
538
+    EditDepDialog,
539
+    WkUserSelect
503
   },
540
   },
504
   data() {
541
   data() {
505
     return {
542
     return {
507
         {
544
         {
508
           icon: 'wk wk-employees',
545
           icon: 'wk wk-employees',
509
           label: '所有员工',
546
           label: '所有员工',
510
-          type: 'all'
547
+          type: 'all',
548
+          field: 'allUserCount',
549
+          count: 0,
550
+          tips: '未添加部门和角色的员工无法正常登录系统'
511
         },
551
         },
512
         {
552
         {
513
           icon: 'wk wk-new-employee',
553
           icon: 'wk wk-new-employee',
514
           label: '新加入的员工',
554
           label: '新加入的员工',
515
-          type: 'new'
555
+          type: 'new',
556
+          field: 'addNewlyCount',
557
+          count: 0,
558
+          tips: '入职7天内的员工'
516
         },
559
         },
517
         {
560
         {
518
           icon: 'wk wk-active-employee',
561
           icon: 'wk wk-active-employee',
519
           label: '激活员工',
562
           label: '激活员工',
520
-          type: 'active'
563
+          type: 'active',
564
+          field: 'activateCount',
565
+          count: 0,
566
+          tips: '已经登录系统的员工'
521
         },
567
         },
522
         {
568
         {
523
           icon: 'wk wk-inactive-employee',
569
           icon: 'wk wk-inactive-employee',
524
           label: '未激活员工',
570
           label: '未激活员工',
525
-          type: 'inactive'
571
+          type: 'inactive',
572
+          field: 'inactiveCount',
573
+          count: 0,
574
+          tips: '未登录过系统的员工'
526
         },
575
         },
527
         {
576
         {
528
           icon: 'wk wk-disable-employees',
577
           icon: 'wk wk-disable-employees',
529
           label: '停用员工',
578
           label: '停用员工',
530
-          type: 'disable'
579
+          type: 'disable',
580
+          field: 'disableCount',
581
+          count: 0,
582
+          tips: '已禁用的员工,无法登录系统'
531
         }
583
         }
532
       ],
584
       ],
533
       // 右边导航
585
       // 右边导航
536
       depSelect: '',
588
       depSelect: '',
537
       // 上级部门
589
       // 上级部门
538
       superDepList: [],
590
       superDepList: [],
591
+      depOwnerUserId: '', // 部门负责人
539
       depCreateLabel: '',
592
       depCreateLabel: '',
540
       allDepData: [], // 包含全部部门信息
593
       allDepData: [], // 包含全部部门信息
541
       showDepData: [],
594
       showDepData: [],
569
           width: '150'
622
           width: '150'
570
         }
623
         }
571
       ],
624
       ],
625
+      isNeedChild: 1, // 是否展示子级部门 0不需要 1 需要
572
       selectionList: [], // 批量勾选数据
626
       selectionList: [], // 批量勾选数据
573
       tableData: [],
627
       tableData: [],
574
       tableHeight: document.documentElement.clientHeight - 240, // 表的高度
628
       tableHeight: document.documentElement.clientHeight - 240, // 表的高度
673
       bulkImportShow: false,
727
       bulkImportShow: false,
674
       // 角色操作
728
       // 角色操作
675
       editRoleType: '',
729
       editRoleType: '',
676
-      editRoleDialogShow: false
730
+      editRoleDialogShow: false,
731
+      userTotal: 0, // 当前下总数,
732
+      editDepDialogShow: false
733
+
677
     }
734
     }
678
   },
735
   },
679
   computed: {
736
   computed: {
787
           icon: 'wk wk-edit'
844
           icon: 'wk wk-edit'
788
         })
845
         })
789
       }
846
       }
790
-
847
+      temps.push({
848
+        name: '重置部门',
849
+        type: 'editDep',
850
+        icon: 'wk wk-employees'
851
+      })
791
 
852
 
792
       return temps
853
       return temps
793
     },
854
     },
828
      */
889
      */
829
     canSlideVerify() {
890
     canSlideVerify() {
830
       return chinaMobileRegex.test(this.resetUserNameForm.username)
891
       return chinaMobileRegex.test(this.resetUserNameForm.username)
892
+    },
893
+    /**
894
+     * 是查看部门员工
895
+     */
896
+    isDepUserShow() {
897
+      return this.currentMenuData && this.currentMenuData.structure_id
831
     }
898
     }
832
   },
899
   },
833
   mounted() {
900
   mounted() {
841
     this.currentMenuData = this.employeeMenu[0]
908
     this.currentMenuData = this.employeeMenu[0]
842
     this.getDepTreeList()
909
     this.getDepTreeList()
843
     this.getUserList()
910
     this.getUserList()
911
+    this.getUserCount()
844
   },
912
   },
845
   methods: {
913
   methods: {
914
+    /**
915
+     * 编辑员工单选change
916
+     */
917
+    addUserSelectChange(item) {
918
+      if (item.field === 'structure_id') {
919
+        const options = this.optionsList.structure_id.list || []
920
+        const deptObj = options.find(o => o.id === this.formInline.structure_id)
921
+        if (deptObj) {
922
+          this.$set(this.formInline, 'parent_id', deptObj.owner_user_id || '')
923
+        }
924
+      }
925
+    },
926
+    /**
927
+     * 员工数量
928
+     */
929
+    getUserCount() {
930
+      this.depLoading = true
931
+      adminUserCountNumOfUserAPI().then(res => {
932
+        this.depLoading = false
933
+        const resData = res.data[0] || {}
934
+        this.employeeMenu.forEach(item => {
935
+          item.count = resData[item.field]
936
+        })
937
+        this.userTotal = this.currentMenuData.count
938
+      }).catch(() => {
939
+        this.depLoading = false
940
+      })
941
+    },
846
     /**
942
     /**
847
      * 选择部门
943
      * 选择部门
848
      */
944
      */
849
     changeDepClick(data) {
945
     changeDepClick(data) {
850
       this.currentMenuData = data
946
       this.currentMenuData = data
947
+      this.userTotal = data.count
851
       // this.structureValue = data.id
948
       // this.structureValue = data.id
852
       this.refreshUserList()
949
       this.refreshUserList()
853
     },
950
     },
857
      */
954
      */
858
     changeUserClick(data) {
955
     changeUserClick(data) {
859
       // this.structureValue = ''
956
       // this.structureValue = ''
957
+      this.userTotal = data.count
860
       this.currentMenuData = data
958
       this.currentMenuData = data
861
       this.refreshUserList()
959
       this.refreshUserList()
862
     },
960
     },
879
         limit: this.pageSize,
977
         limit: this.pageSize,
880
         search: this.searchInput
978
         search: this.searchInput
881
       }
979
       }
882
-
980
+      if (this.isDepUserShow) {
981
+        params.isNeedChild = this.isNeedChild
982
+      }
883
       if (this.currentMenuData) {
983
       if (this.currentMenuData) {
884
         // 员工有type值
984
         // 员工有type值
885
         if (this.currentMenuData.type) {
985
         if (this.currentMenuData.type) {
959
         structure_id:
1059
         structure_id:
960
           this.currentMenuData && this.currentMenuData.id
1060
           this.currentMenuData && this.currentMenuData.id
961
             ? this.currentMenuData.id
1061
             ? this.currentMenuData.id
962
-            : ''
1062
+            : '',
1063
+        parent_id: this.currentMenuData && this.currentMenuData.owner_user_id
1064
+          ? this.currentMenuData.owner_user_id
1065
+          : ''
963
       }
1066
       }
964
       this.employeeCreateDialog = true
1067
       this.employeeCreateDialog = true
965
     },
1068
     },
1036
         this.depCreateLabelValue = ''
1139
         this.depCreateLabelValue = ''
1037
         this.depCreateLabel = '新增部门'
1140
         this.depCreateLabel = '新增部门'
1038
         this.depCreateTitle = '新增部门'
1141
         this.depCreateTitle = '新增部门'
1142
+        this.depOwnerUserId = ''
1039
         this.depSelect = id
1143
         this.depSelect = id
1040
         this.getStructuresListBySuperior({ id: id, type: 'save' })
1144
         this.getStructuresListBySuperior({ id: id, type: 'save' })
1041
         this.depCreateDialog = true
1145
         this.depCreateDialog = true
1084
       this.depCreateLabelValue = data.label
1188
       this.depCreateLabelValue = data.label
1085
       this.treeEditId = data.id
1189
       this.treeEditId = data.id
1086
       this.depSelect = data.pid
1190
       this.depSelect = data.pid
1191
+      this.depOwnerUserId = data.owner_user_id
1087
       this.depCreateTitle = '编辑部门'
1192
       this.depCreateTitle = '编辑部门'
1088
       this.depCreateLabel = '编辑部门'
1193
       this.depCreateLabel = '编辑部门'
1089
       this.getStructuresListBySuperior({ id: data.id, type: 'update' })
1194
       this.getStructuresListBySuperior({ id: data.id, type: 'update' })
1126
     // 新增或编辑确定按钮
1231
     // 新增或编辑确定按钮
1127
     submitDialog() {
1232
     submitDialog() {
1128
       if (this.depCreateLabel == '新增部门') {
1233
       if (this.depCreateLabel == '新增部门') {
1129
-        depSaveAPI({ name: this.depCreateLabelValue, pid: this.depSelect }).then(
1234
+        depSaveAPI({ name: this.depCreateLabelValue, pid: this.depSelect, owner_user_id: this.depOwnerUserId }).then(
1130
           res => {
1235
           res => {
1131
             this.getDepList() // 增加了新部门 刷新数据
1236
             this.getDepList() // 增加了新部门 刷新数据
1132
             this.getDepTreeList()
1237
             this.getDepTreeList()
1137
         depEditAPI({
1242
         depEditAPI({
1138
           name: this.depCreateLabelValue,
1243
           name: this.depCreateLabelValue,
1139
           id: this.treeEditId,
1244
           id: this.treeEditId,
1140
-          pid: this.depSelect
1245
+          pid: this.depSelect,
1246
+          owner_user_id: this.depOwnerUserId
1141
         }).then(res => {
1247
         }).then(res => {
1142
           this.$message.success('操作成功')
1248
           this.$message.success('操作成功')
1143
           this.getDepTreeList()
1249
           this.getDepTreeList()
1309
                   })
1415
                   })
1310
                 : []
1416
                 : []
1311
             } else if (element.field === 'parent_id') {
1417
             } else if (element.field === 'parent_id') {
1312
-              detail.parent_id = this.dialogData.parent_id
1418
+              detail.parent_id = this.dialogData.parent_id || ''
1313
             } else if (element.field === 'structure_id') {
1419
             } else if (element.field === 'structure_id') {
1314
               detail.structure_id = this.dialogData.structure_id
1420
               detail.structure_id = this.dialogData.structure_id
1315
             } else {
1421
             } else {
1323
       } else if (type === 'editRole' || type === 'copyRole') {
1429
       } else if (type === 'editRole' || type === 'copyRole') {
1324
         this.editRoleType = type
1430
         this.editRoleType = type
1325
         this.editRoleDialogShow = true
1431
         this.editRoleDialogShow = true
1432
+      } else if (type === 'editDep') {
1433
+        this.editDepDialogShow = true
1326
       }
1434
       }
1327
     },
1435
     },
1328
     // 重置密码 -- 关闭按钮
1436
     // 重置密码 -- 关闭按钮
1692
 // .status > span {
1800
 // .status > span {
1693
 //   margin-right: 10px;
1801
 //   margin-right: 10px;
1694
 // }
1802
 // }
1695
-
1696
 .status-name {
1803
 .status-name {
1697
-  div {
1804
+  .status-mark {
1698
     display: inline-block;
1805
     display: inline-block;
1699
     width: 6px;
1806
     width: 6px;
1700
     height: 6px;
1807
     height: 6px;
1702
   }
1809
   }
1703
   color: $xr-color-primary;
1810
   color: $xr-color-primary;
1704
   cursor: pointer;
1811
   cursor: pointer;
1812
+  .main-mark {
1813
+    background-color: #ff6a00;
1814
+    color: white;
1815
+    border-radius: 2px;
1816
+    font-size: 12px;
1817
+    padding: 0px 4px;
1818
+    margin: 0 3px;
1819
+  }
1705
 }
1820
 }
1821
+/* .status-name {
1822
+  .status-mark {
1823
+    display: inline-block;
1824
+    width: 6px;
1825
+    height: 6px;
1826
+    border-radius: 3px;
1827
+  }
1828
+  div {
1829
+    display: inline-block;
1830
+    width: 6px;
1831
+    height: 6px;
1832
+    border-radius: 3px;
1833
+  }
1834
+  color: $xr-color-primary;
1835
+  cursor: pointer;
1836
+} */
1706
 /* 详情 */
1837
 /* 详情 */
1707
 .employee-dep-management /deep/ .el-dialog__wrapper {
1838
 .employee-dep-management /deep/ .el-dialog__wrapper {
1708
   margin-top: 60px !important;
1839
   margin-top: 60px !important;
1737
 }
1868
 }
1738
 .nav-dialog-div {
1869
 .nav-dialog-div {
1739
   margin-bottom: 20px;
1870
   margin-bottom: 20px;
1871
+  .wk-user-select {
1872
+    flex: 1;
1873
+  }
1740
 }
1874
 }
1741
 .nav-dialog-div {
1875
 .nav-dialog-div {
1742
   .el-input,
1876
   .el-input,

+ 263
- 0
src/views/admin/log/DataHandleLog.vue View File

1
+<template>
2
+  <div class="main">
3
+    <xr-header
4
+      icon-class="wk wk-record"
5
+      icon-color="#2362FB"
6
+      label="数据操作日志" />
7
+    <div class="main-body">
8
+      <flexbox class="main-table-header">
9
+        <el-date-picker
10
+          v-model="dateTime"
11
+          type="daterange"
12
+          value-format="yyyy-MM-dd"
13
+          range-separator="-"
14
+          start-placeholder="开始时间"
15
+          end-placeholder="结束时间"/>
16
+        <xh-user-cell
17
+          :radio="false"
18
+          placeholder="选择人员"
19
+          @value-change="userChange" />
20
+        <el-select
21
+          v-model="model"
22
+          @click="modelChange">
23
+          <el-option
24
+            v-for="item in modelOptions"
25
+            :key="item.value"
26
+            :label="item.label"
27
+            :value="item.value"/>
28
+        </el-select>
29
+        <el-select
30
+          v-model="subModelLabels"
31
+          multiple
32
+          collapse-tags>
33
+          <el-option
34
+            v-for="item in subModelsOptions"
35
+            :key="item.value"
36
+            :label="item.label"
37
+            :value="item.value"/>
38
+        </el-select>
39
+        <el-button
40
+          type="primary"
41
+          @click="refreshList">查询</el-button>
42
+        <el-button
43
+          class="main-table-header-button"
44
+          @click="exportClick">导出</el-button>
45
+      </flexbox>
46
+      <el-table
47
+        v-loading="loading"
48
+        :data="list"
49
+        :height="tableHeight"
50
+        class="main-table"
51
+        highlight-current-row
52
+        style="width: 100%">
53
+        <el-table-column
54
+          v-for="(item, index) in fieldList"
55
+          :key="index"
56
+          :prop="item.prop"
57
+          :label="item.label"
58
+          show-overflow-tooltip/>
59
+        <el-table-column/>
60
+      </el-table>
61
+      <div class="p-contianer">
62
+        <el-pagination
63
+          :current-page="currentPage"
64
+          :page-sizes="pageSizes"
65
+          :page-size.sync="pageSize"
66
+          :total="total"
67
+          class="p-bar"
68
+          background
69
+          layout="prev, pager, next, sizes, total, jumper"
70
+          @size-change="handleSizeChange"
71
+          @current-change="handleCurrentChange"/>
72
+      </div>
73
+    </div>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import {
79
+  systemLogExportAPI,
80
+  queryDataOptionLogListAPI
81
+} from '@/api/admin/log'
82
+
83
+import XrHeader from '@/components/XrHeader'
84
+import XhUserCell from '@/components/CreateCom/XhUserCell'
85
+import { Loading } from 'element-ui'
86
+import HandleLogMixin from './mixins/HandleLog'
87
+
88
+import { downloadExcelWithResData } from '@/utils'
89
+
90
+export default {
91
+  // 操作日志日志
92
+  name: 'DataHandleLog',
93
+  components: {
94
+    XrHeader,
95
+    XhUserCell
96
+  },
97
+  mixins: [HandleLogMixin],
98
+  data() {
99
+    return {
100
+      loading: false, // 加载动画
101
+      tableHeight: document.documentElement.clientHeight - 240, // 表的高度
102
+      dateTime: [],
103
+      userList: [],
104
+      model: '',
105
+      subModelLabels: [],
106
+      list: [],
107
+      currentPage: 1,
108
+      pageSize: 10,
109
+      pageSizes: [10, 20, 30, 40],
110
+      total: 0,
111
+
112
+      postParams: {}
113
+    }
114
+  },
115
+  computed: {
116
+    subModelsOptions() {
117
+      const item = this.modelOptions.find(item => item.value === this.model)
118
+      return item ? item.list : []
119
+    }
120
+  },
121
+  mounted() {
122
+    // 控制table的高度
123
+    window.onresize = () => {
124
+      self.tableHeight = document.documentElement.clientHeight - 240
125
+    }
126
+
127
+    this.getList()
128
+  },
129
+  methods: {
130
+    userChange(data) {
131
+      this.userList = data.value || []
132
+    },
133
+
134
+    refreshList() {
135
+      this.currentPage = 1
136
+      this.getList()
137
+    },
138
+
139
+    /**
140
+     * 模块change
141
+     */
142
+    modelChange() {
143
+      this.subModelLabels = []
144
+    },
145
+
146
+    /**
147
+     * 获取列表数据
148
+     */
149
+    getList() {
150
+      this.loading = true
151
+      const params = {
152
+        page: this.currentPage,
153
+        limit: this.pageSize,
154
+        model: this.model
155
+        // type: 1 //  1 数据操作日志 2 系统操作日志
156
+      }
157
+      if (this.userList && this.userList.length) {
158
+        params.userIds = this.userList.map(item => item.id)
159
+      }
160
+
161
+      if (this.dateTime && this.dateTime.length) {
162
+        params.startTime = this.dateTime[0]
163
+        params.endTime = this.dateTime[1]
164
+      }
165
+
166
+      params.subModelLabels = this.subModelLabels
167
+      this.postParams = params
168
+      queryDataOptionLogListAPI(params)
169
+        .then(res => {
170
+          const list = res.data.list
171
+          // list.forEach(item => {
172
+          //   item.model = this.getModelName(item.model)
173
+          // })
174
+          this.list = list
175
+          this.total = res.data.count
176
+          this.loading = false
177
+        })
178
+        .catch(() => {
179
+          this.loading = false
180
+        })
181
+    },
182
+
183
+    /**
184
+     *  添加审批流
185
+     */
186
+    exportClick() {
187
+      const loading = Loading.service({ fullscreen: true, text: '导出中...' })
188
+      systemLogExportAPI({ ...this.postParams, action: 'getRecordLogs' })
189
+        .then(res => {
190
+          downloadExcelWithResData(res)
191
+          loading.close()
192
+        })
193
+        .catch(() => {
194
+          loading.close()
195
+        })
196
+    },
197
+    // 更改每页展示数量
198
+    handleSizeChange(val) {
199
+      this.pageSize = val
200
+      this.getList()
201
+    },
202
+    // 更改当前页数
203
+    handleCurrentChange(val) {
204
+      this.currentPage = val
205
+      this.getList()
206
+    }
207
+  }
208
+}
209
+</script>
210
+
211
+<style lang="scss" scoped>
212
+.main {
213
+  height:100%;
214
+
215
+  /deep/ .xr-header {
216
+    padding: 15px 30px;
217
+  }
218
+}
219
+
220
+.main-body {
221
+  background-color: white;
222
+  border-top: 1px solid $xr-border-line-color;
223
+  border-bottom: 1px solid $xr-border-line-color;
224
+}
225
+
226
+.main-table-header {
227
+  height: 50px;
228
+  background-color: white;
229
+  position: relative;
230
+  .main-table-header-button {
231
+    margin-right: 20px;
232
+    position: absolute;
233
+    right: 20px;
234
+  }
235
+
236
+  .el-date-editor--daterange {
237
+    width: 300px;
238
+    margin: 0 20px;
239
+  }
240
+
241
+  /deep/ .user-container {
242
+    width: 200px;
243
+    margin-right: 20px;
244
+  }
245
+
246
+  .el-select {
247
+    margin-right: 20px;
248
+  }
249
+}
250
+
251
+.p-contianer {
252
+  position: relative;
253
+  background-color: white;
254
+  height: 44px;
255
+  .p-bar {
256
+    float: right;
257
+    margin: 5px 100px 0 0;
258
+    font-size: 14px !important;
259
+  }
260
+}
261
+
262
+@import '../styles/table.scss';
263
+</style>

+ 275
- 0
src/views/admin/log/LoginLog.vue View File

1
+<template>
2
+  <div class="main">
3
+    <xr-header
4
+      icon-class="wk wk-record"
5
+      icon-color="#2362FB"
6
+      label="登录日志" />
7
+    <div class="main-body">
8
+      <flexbox class="main-table-header">
9
+        <el-date-picker
10
+          v-model="dateTime"
11
+          type="daterange"
12
+          value-format="yyyy-MM-dd"
13
+          range-separator="-"
14
+          start-placeholder="开始时间"
15
+          end-placeholder="结束时间"/>
16
+        <xh-user-cell
17
+          :radio="false"
18
+          placeholder="选择人员"
19
+          @value-change="userChange" />
20
+        <el-button
21
+          type="primary"
22
+          @click="refreshList">查询</el-button>
23
+        <el-button
24
+          class="main-table-header-button"
25
+          @click="exportClick">导出</el-button>
26
+      </flexbox>
27
+      <el-table
28
+        v-loading="loading"
29
+        :data="list"
30
+        :height="tableHeight"
31
+        :cell-class-name="cellClassName"
32
+        class="main-table"
33
+        highlight-current-row
34
+        style="width: 100%">
35
+        <el-table-column
36
+          v-for="(item, index) in fieldList"
37
+          :key="index"
38
+          :prop="item.prop"
39
+          :label="item.label"
40
+          show-overflow-tooltip/>
41
+        <el-table-column/>
42
+      </el-table>
43
+      <div class="p-contianer">
44
+        <el-pagination
45
+          :current-page="currentPage"
46
+          :page-sizes="pageSizes"
47
+          :page-size.sync="pageSize"
48
+          :total="total"
49
+          class="p-bar"
50
+          background
51
+          layout="prev, pager, next, sizes, total, jumper"
52
+          @size-change="handleSizeChange"
53
+          @current-change="handleCurrentChange"/>
54
+      </div>
55
+    </div>
56
+  </div>
57
+</template>
58
+
59
+<script>
60
+import {
61
+  queryLoginLogListAPI,
62
+  systemLogExportAPI
63
+} from '@/api/admin/log'
64
+
65
+import XrHeader from '@/components/XrHeader'
66
+import XhUserCell from '@/components/CreateCom/XhUserCell'
67
+import { Loading } from 'element-ui'
68
+
69
+import { downloadExcelWithResData } from '@/utils'
70
+
71
+export default {
72
+  // 登录日志
73
+  name: 'LoginLog',
74
+  components: {
75
+    XrHeader,
76
+    XhUserCell
77
+  },
78
+  mixins: [],
79
+  data() {
80
+    return {
81
+      loading: false, // 加载动画
82
+      tableHeight: document.documentElement.clientHeight - 240, // 表的高度
83
+      dateTime: [],
84
+      userList: [],
85
+      list: [],
86
+      fieldList: [
87
+        {
88
+          prop: 'username',
89
+          label: '用户',
90
+          width: 100
91
+        },
92
+        {
93
+          prop: 'create_time',
94
+          label: '登录时间',
95
+          width: 150
96
+        },
97
+        {
98
+          prop: 'ip',
99
+          label: 'IP地址',
100
+          width: 100
101
+        },
102
+        {
103
+          prop: 'address',
104
+          label: '登录地点',
105
+          width: 150
106
+        },
107
+        {
108
+          prop: 'remark',
109
+          label: '设备类型',
110
+          width: 150
111
+        },
112
+        {
113
+          prop: 'browser',
114
+          label: '终端内核',
115
+          width: 150
116
+        },
117
+        {
118
+          prop: 'os',
119
+          label: '平台',
120
+          width: 100
121
+        },
122
+        {
123
+          prop: 'type',
124
+          label: '认证结果',
125
+          width: 100
126
+        }
127
+      ],
128
+      currentPage: 1,
129
+      pageSize: 10,
130
+      pageSizes: [10, 20, 30, 40],
131
+      total: 0,
132
+
133
+      postParams: {}
134
+    }
135
+  },
136
+  computed: {},
137
+  mounted() {
138
+    // 控制table的高度
139
+    window.onresize = () => {
140
+      self.tableHeight = document.documentElement.clientHeight - 240
141
+    }
142
+
143
+    this.getList()
144
+  },
145
+  methods: {
146
+    userChange(data) {
147
+      this.userList = data.value || []
148
+    },
149
+
150
+    refreshList() {
151
+      this.currentPage = 1
152
+      this.getList()
153
+    },
154
+
155
+    /** 获取列表数据 */
156
+    getList() {
157
+      this.loading = true
158
+      const params = {
159
+        page: this.currentPage,
160
+        limit: this.pageSize
161
+      }
162
+      if (this.userList && this.userList.length) {
163
+        params.userIds = this.userList.map(item => item.id)
164
+      }
165
+
166
+      if (this.dateTime && this.dateTime.length) {
167
+        params.startTime = this.dateTime[0]
168
+        params.endTime = this.dateTime[1]
169
+      }
170
+
171
+      this.postParams = params
172
+      queryLoginLogListAPI(params)
173
+        .then(res => {
174
+          const list = res.data.list || []
175
+          // list.forEach(item => {
176
+          //   item.authResult = {
177
+          //     1: '成功',
178
+          //     2: '失败'
179
+          //   }[item.authResult]
180
+          // })
181
+          this.list = list
182
+          this.total = res.data.dataCount
183
+          this.loading = false
184
+        })
185
+        .catch(() => {
186
+          this.loading = false
187
+        })
188
+    },
189
+    /**
190
+     * 通过回调控制class
191
+     */
192
+    cellClassName({ row, column, rowIndex, columnIndex }) {
193
+      if (column.property === 'name') {
194
+        return 'can-visit--underline'
195
+      } else {
196
+        return ''
197
+      }
198
+    },
199
+    /**
200
+     *  添加审批流
201
+     */
202
+    exportClick() {
203
+      const loading = Loading.service({ fullscreen: true, text: '导出中...' })
204
+      systemLogExportAPI({ ...this.postParams, action: 'getLoginRecord' })
205
+        .then(res => {
206
+          downloadExcelWithResData(res)
207
+          loading.close()
208
+        })
209
+        .catch(() => {
210
+          loading.close()
211
+        })
212
+    },
213
+    // 更改每页展示数量
214
+    handleSizeChange(val) {
215
+      this.pageSize = val
216
+      this.getList()
217
+    },
218
+    // 更改当前页数
219
+    handleCurrentChange(val) {
220
+      this.currentPage = val
221
+      this.getList()
222
+    }
223
+  }
224
+}
225
+</script>
226
+
227
+<style lang="scss" scoped>
228
+.main {
229
+  height:100%;
230
+
231
+  /deep/ .xr-header {
232
+    padding: 15px 30px;
233
+  }
234
+}
235
+
236
+.main-body {
237
+  background-color: white;
238
+  border-top: 1px solid $xr-border-line-color;
239
+  border-bottom: 1px solid $xr-border-line-color;
240
+}
241
+
242
+.main-table-header {
243
+  height: 50px;
244
+  background-color: white;
245
+  position: relative;
246
+  .main-table-header-button {
247
+    margin-right: 20px;
248
+    position: absolute;
249
+    right: 20px;
250
+  }
251
+
252
+  .el-date-editor--daterange {
253
+    width: 300px;
254
+    margin: 0 20px;
255
+  }
256
+
257
+  /deep/ .user-container {
258
+    width: 200px;
259
+    margin-right: 20px;
260
+  }
261
+}
262
+
263
+.p-contianer {
264
+  position: relative;
265
+  background-color: white;
266
+  height: 44px;
267
+  .p-bar {
268
+    float: right;
269
+    margin: 5px 100px 0 0;
270
+    font-size: 14px !important;
271
+  }
272
+}
273
+
274
+@import '../styles/table.scss';
275
+</style>

+ 240
- 0
src/views/admin/log/SysHandleLog.vue View File

1
+<template>
2
+  <div class="main">
3
+    <xr-header
4
+      icon-class="wk wk-record"
5
+      icon-color="#2362FB"
6
+      label="系统操作日志" />
7
+    <div class="main-body">
8
+      <flexbox class="main-table-header">
9
+        <el-date-picker
10
+          v-model="dateTime"
11
+          type="daterange"
12
+          value-format="yyyy-MM-dd"
13
+          range-separator="-"
14
+          start-placeholder="开始时间"
15
+          end-placeholder="结束时间"/>
16
+        <xh-user-cell
17
+          :radio="false"
18
+          placeholder="选择人员"
19
+          @value-change="userChange" />
20
+        <el-select
21
+          v-model="subModelLabels"
22
+          multiple
23
+          style="width: 200px;"
24
+          collapse-tags>
25
+          <el-option
26
+            v-for="item in sysOptions"
27
+            :key="item.value"
28
+            :label="item.label"
29
+            :value="item.value"/>
30
+        </el-select>
31
+        <el-button
32
+          type="primary"
33
+          @click="refreshList">查询</el-button>
34
+        <el-button
35
+          class="main-table-header-button"
36
+          @click="exportClick">导出</el-button>
37
+      </flexbox>
38
+      <el-table
39
+        v-loading="loading"
40
+        :data="list"
41
+        :height="tableHeight"
42
+        class="main-table"
43
+        highlight-current-row
44
+        style="width: 100%">
45
+        <el-table-column
46
+          v-for="(item, index) in fieldList"
47
+          :key="index"
48
+          :prop="item.prop"
49
+          :label="item.label"
50
+          show-overflow-tooltip/>
51
+        <el-table-column/>
52
+      </el-table>
53
+      <div class="p-contianer">
54
+        <el-pagination
55
+          :current-page="currentPage"
56
+          :page-sizes="pageSizes"
57
+          :page-size.sync="pageSize"
58
+          :total="total"
59
+          class="p-bar"
60
+          background
61
+          layout="prev, pager, next, sizes, total, jumper"
62
+          @size-change="handleSizeChange"
63
+          @current-change="handleCurrentChange"/>
64
+      </div>
65
+    </div>
66
+  </div>
67
+</template>
68
+
69
+<script>
70
+import {
71
+  querySystemLogListAPI,
72
+  systemLogExportAPI
73
+} from '@/api/admin/log'
74
+
75
+import XrHeader from '@/components/XrHeader'
76
+import XhUserCell from '@/components/CreateCom/XhUserCell'
77
+import { Loading } from 'element-ui'
78
+
79
+import HandleLogMixin from './mixins/HandleLog'
80
+import { downloadExcelWithResData } from '@/utils'
81
+
82
+export default {
83
+  // 系统操作日志
84
+  name: 'SysHandleLog',
85
+  components: {
86
+    XrHeader,
87
+    XhUserCell
88
+  },
89
+  mixins: [HandleLogMixin],
90
+  data() {
91
+    return {
92
+      loading: false, // 加载动画
93
+      tableHeight: document.documentElement.clientHeight - 240, // 表的高度
94
+      dateTime: [],
95
+      userList: [],
96
+      subModelLabels: [],
97
+      list: [],
98
+      currentPage: 1,
99
+      pageSize: 10,
100
+      pageSizes: [10, 20, 30, 40],
101
+      total: 0,
102
+
103
+      postParams: {}
104
+    }
105
+  },
106
+  computed: {},
107
+  mounted() {
108
+    // 控制table的高度
109
+    window.onresize = () => {
110
+      self.tableHeight = document.documentElement.clientHeight - 240
111
+    }
112
+
113
+    this.getList()
114
+  },
115
+  methods: {
116
+    userChange(data) {
117
+      this.userList = data.value || []
118
+    },
119
+
120
+    refreshList() {
121
+      this.currentPage = 1
122
+      this.getList()
123
+    },
124
+
125
+    /** 获取列表数据 */
126
+    getList() {
127
+      this.loading = true
128
+      const params = {
129
+        page: this.currentPage,
130
+        limit: this.pageSize
131
+        // modules: 'admin'
132
+        // type: 2 //  1 数据操作日志 2 系统操作日志
133
+      }
134
+      if (this.userList && this.userList.length) {
135
+        params.userIds = this.userList.map(item => item.id)
136
+      }
137
+
138
+      if (this.dateTime && this.dateTime.length) {
139
+        params.startTime = this.dateTime[0]
140
+        params.endTime = this.dateTime[1]
141
+      }
142
+
143
+      params.subModelLabels = this.subModelLabels
144
+      this.postParams = params
145
+      querySystemLogListAPI(params)
146
+        .then(res => {
147
+          const list = res.data.list
148
+          list.forEach(item => {
149
+            item.action = item.module
150
+          })
151
+          this.list = list
152
+          this.total = res.data.count
153
+          this.loading = false
154
+        })
155
+        .catch(() => {
156
+          this.loading = false
157
+        })
158
+    },
159
+
160
+    /**
161
+     *  添加审批流
162
+     */
163
+    exportClick() {
164
+      const loading = Loading.service({ fullscreen: true, text: '导出中...' })
165
+      systemLogExportAPI({ ...this.postParams, action: 'getSystemLogs' })
166
+        .then(res => {
167
+          downloadExcelWithResData(res)
168
+          loading.close()
169
+        })
170
+        .catch(() => {
171
+          loading.close()
172
+        })
173
+    },
174
+    // 更改每页展示数量
175
+    handleSizeChange(val) {
176
+      this.pageSize = val
177
+      this.getList()
178
+    },
179
+    // 更改当前页数
180
+    handleCurrentChange(val) {
181
+      this.currentPage = val
182
+      this.getList()
183
+    }
184
+  }
185
+}
186
+</script>
187
+
188
+<style lang="scss" scoped>
189
+.main {
190
+  height:100%;
191
+
192
+  /deep/ .xr-header {
193
+    padding: 15px 30px;
194
+  }
195
+}
196
+
197
+.main-body {
198
+  background-color: white;
199
+  border-top: 1px solid $xr-border-line-color;
200
+  border-bottom: 1px solid $xr-border-line-color;
201
+}
202
+
203
+.main-table-header {
204
+  height: 50px;
205
+  background-color: white;
206
+  position: relative;
207
+  .main-table-header-button {
208
+    margin-right: 20px;
209
+    position: absolute;
210
+    right: 20px;
211
+  }
212
+
213
+  .el-date-editor--daterange {
214
+    width: 300px;
215
+    margin: 0 20px;
216
+  }
217
+
218
+  /deep/ .user-container {
219
+    width: 200px;
220
+    margin-right: 20px;
221
+  }
222
+
223
+  .el-select {
224
+    margin-right: 20px;
225
+  }
226
+}
227
+
228
+.p-contianer {
229
+  position: relative;
230
+  background-color: white;
231
+  height: 44px;
232
+  .p-bar {
233
+    float: right;
234
+    margin: 5px 100px 0 0;
235
+    font-size: 14px !important;
236
+  }
237
+}
238
+
239
+@import '../styles/table.scss';
240
+</style>

+ 226
- 0
src/views/admin/log/mixins/HandleLog.js View File

1
+export default {
2
+  data() {
3
+    return {
4
+      modelOptions: [{
5
+        label: '客户管理',
6
+        value: 'crm',
7
+        list: [{
8
+          label: '线索',
9
+          value: 'crm_leads'
10
+        }, {
11
+          label: '客户',
12
+          value: 'crm_customer'
13
+        }, {
14
+          label: '联系人',
15
+          value: 'crm_contacts'
16
+        }, {
17
+          label: '商机',
18
+          value: 'crm_business'
19
+        }, {
20
+          label: '合同',
21
+          value: 'crm_contract'
22
+        }, {
23
+          label: '回款',
24
+          value: 'crm_receivables'
25
+        }, {
26
+          label: '发票',
27
+          value: 'crm_invoice'
28
+        }, {
29
+          label: '回访',
30
+          value: 'crm_visit'
31
+        }, {
32
+          label: '产品',
33
+          value: 'crm_product'
34
+        }
35
+        // {
36
+        //   label: '市场活动',
37
+        //   value: 30
38
+        // }
39
+        ]
40
+      }, {
41
+        label: '办公管理',
42
+        value: 'oa',
43
+        list: [{
44
+          label: '日历',
45
+          value: 'oa_event'
46
+        }, {
47
+          label: '日志',
48
+          value: 'oa_log'
49
+        }]
50
+      }, {
51
+        label: '项目管理',
52
+        value: 'work',
53
+        list: [{
54
+          label: '项目',
55
+          value: 'work'
56
+        }, {
57
+          label: '任务',
58
+          value: 'work_task'
59
+        }]
60
+      }
61
+      // {
62
+      //   label: '人力资源',
63
+      //   value: 'hrm',
64
+      //   list: [{
65
+      //     label: '组织管理',
66
+      //     value: 61
67
+      //   }, {
68
+      //     label: '招聘管理',
69
+      //     value: 62
70
+      //   }, {
71
+      //     label: '候选人',
72
+      //     value: 63
73
+      //   }, {
74
+      //     label: '员工管理',
75
+      //     value: 64
76
+      //   }, {
77
+      //     label: '社保管理',
78
+      //     value: 65
79
+      //   }, {
80
+      //     label: '薪资管理',
81
+      //     value: 66
82
+      //   }, {
83
+      //     label: '薪资档案',
84
+      //     value: 67
85
+      //   }, {
86
+      //     label: '工资条',
87
+      //     value: 68
88
+      //   }, {
89
+      //     label: '绩效考核',
90
+      //     value: 69
91
+      //   }]
92
+      // },
93
+      // {
94
+      //   label: '进销存',
95
+      //   value: 'jxc',
96
+      //   list: [{
97
+      //     label: '供应商',
98
+      //     value: 81
99
+      //   }, {
100
+      //     label: '采购订单',
101
+      //     value: 82
102
+      //   }, {
103
+      //     label: '采购退货',
104
+      //     value: 83
105
+      //   }, {
106
+      //     label: '产品管理',
107
+      //     value: 84
108
+      //   }, {
109
+      //     label: '销售订单',
110
+      //     value: 85
111
+      //   }, {
112
+      //     label: '销售退货',
113
+      //     value: 86
114
+      //   }, {
115
+      //     label: '仓库管理',
116
+      //     value: 87
117
+      //   }, {
118
+      //     label: '产品库存',
119
+      //     value: 88
120
+      //   }, {
121
+      //     label: '产品入库',
122
+      //     value: 89
123
+      //   }, {
124
+      //     label: '产品出库',
125
+      //     value: 90
126
+      //   }, {
127
+      //     label: '库存调拨',
128
+      //     value: 91
129
+      //   }, {
130
+      //     label: '库存盘点',
131
+      //     value: 92
132
+      //   }, {
133
+      //     label: '回款',
134
+      //     value: 93
135
+      //   }, {
136
+      //     label: '付款',
137
+      //     value: 93
138
+      //   }]
139
+      // }
140
+      ],
141
+      sysOptions: [{
142
+        label: '企业首页',
143
+        value: 'company'
144
+      }, {
145
+        label: '应用管理',
146
+        value: 'application'
147
+      }, {
148
+        label: '员工管理',
149
+        value: 'employee'
150
+      }, {
151
+        label: '部门管理',
152
+        value: 'structures'
153
+      }, {
154
+        label: '角色管理',
155
+        value: 'role'
156
+      }, {
157
+        label: '项目管理',
158
+        value: 'project'
159
+      }, {
160
+        label: '客户管理',
161
+        value: 'customer'
162
+      },
163
+      // {
164
+      //   label: '人力资源',
165
+      //   value: 8
166
+      // }, {
167
+      //   label: '进销存',
168
+      //   value: 9
169
+      // },
170
+      {
171
+        label: '其他设置',
172
+        value: 'work_task'
173
+      }],
174
+      fieldList: [
175
+        {
176
+          prop: 'user_name',
177
+          label: '用户',
178
+          width: 100
179
+        },
180
+        {
181
+          prop: 'create_time',
182
+          label: '时间',
183
+          width: 150
184
+        },
185
+        {
186
+          prop: 'ip',
187
+          label: 'IP地址',
188
+          width: 100
189
+        },
190
+        {
191
+          prop: 'action',
192
+          label: '模块',
193
+          width: 150
194
+        },
195
+        {
196
+          prop: 'action_name',
197
+          label: '行为',
198
+          width: 150
199
+        },
200
+        {
201
+          prop: 'source_name',
202
+          label: '对象',
203
+          width: 150
204
+        },
205
+        {
206
+          prop: 'content',
207
+          label: '操作详情',
208
+          width: 100
209
+        }
210
+      ]
211
+    }
212
+  },
213
+
214
+  methods: {
215
+    getModelName(model) {
216
+      return {
217
+        crm: '客户管理',
218
+        oa: '办公管理',
219
+        work: '项目管理',
220
+        hrm: '人力资源',
221
+        jxc: '进销存',
222
+        admin: '系统管理'
223
+      }[model]
224
+    }
225
+  }
226
+}

+ 2
- 2
src/views/admin/roleAuth/index.vue View File

171
                         style="height: 0;"
171
                         style="height: 0;"
172
                         empty-text=""
172
                         empty-text=""
173
                         default-expand-all>
173
                         default-expand-all>
174
-                        <!-- <span
174
+                        <span
175
                           slot-scope="{ node }"
175
                           slot-scope="{ node }"
176
                           :class="{ 'node-label': node.level == 1 || node.level == 2} ">{{ node.label }}<el-button
176
                           :class="{ 'node-label': node.level == 1 || node.level == 2} ">{{ node.label }}<el-button
177
                             v-if="node.level == 2 && canSetField(node.data.name) && node.data.title!='公海管理'"
177
                             v-if="node.level == 2 && canSetField(node.data.name) && node.data.title!='公海管理'"
178
                             icon="wk wk-manage"
178
                             icon="wk wk-manage"
179
                             type="text"
179
                             type="text"
180
-                            @click="fieldSetClick(node)" >字段授权</el-button></span> -->
180
+                            @click="fieldSetClick(node)" >字段授权</el-button></span>
181
                       </el-tree>
181
                       </el-tree>
182
                     </div>
182
                     </div>
183
                   </div>
183
                   </div>

+ 122
- 224
src/views/bi/product/ProductStatistics.vue View File

16
     <div class="content">
16
     <div class="content">
17
       <el-table
17
       <el-table
18
         id="crm-table"
18
         id="crm-table"
19
-        :data="newList"
19
+        ref="tableRef"
20
+        :data="list"
20
         :height="tableHeight"
21
         :height="tableHeight"
21
-        :span-method="objectSpanMethod"
22
-        :cell-style="cellStyle"
22
+        :cell-class-name="cellClassName"
23
+        :summary-method="getSummaries"
24
+        show-summary
23
         border
25
         border
24
         @row-click="handleRowClick">
26
         @row-click="handleRowClick">
25
         <el-table-column
27
         <el-table-column
31
           header-align="center"
33
           header-align="center"
32
           show-overflow-tooltip/>
34
           show-overflow-tooltip/>
33
       </el-table>
35
       </el-table>
36
+      <div class="p-contianer">
37
+        <el-pagination
38
+          :current-page="currentPage"
39
+          :page-sizes="pageSizes"
40
+          :page-size.sync="pageSize"
41
+          :total="total"
42
+          :pager-count="5"
43
+          class="p-bar"
44
+          background
45
+          layout="prev, pager, next, sizes, total, jumper"
46
+          @size-change="handleSizeChange"
47
+          @current-change="handleCurrentChange"/>
48
+      </div>
34
     </div>
49
     </div>
35
-    <contract-detail
36
-      v-if="showContractview && rowID"
37
-      :id="rowID"
38
-      class="d-view"
39
-      @hide-view="showContractview=false"/>
40
-    <customer-detail
41
-      v-if="showCustomerView && rowID"
42
-      :id="rowID"
43
-      class="d-view"
44
-      @hide-view="showCustomerView=false"/>
45
-    <product-detail
46
-      v-if="showProductview && rowID"
47
-      :id="rowID"
48
-      class="d-view"
49
-      @hide-view="showProductview=false"/>
50
+    <!-- 预览合同 -->
51
+    <report-list
52
+      :show.sync="reportListShow"
53
+      :title="reportData.title"
54
+      :placeholder="reportData.placeholder"
55
+      :request="reportData.request"
56
+      :params="reportData.params"
57
+      crm-type="contract"/>
50
   </div>
58
   </div>
51
 </template>
59
 </template>
52
-
53
 <script>
60
 <script>
54
 import { biProductStatisticsAPI, biProductStatisticsExportAPI } from '@/api/bi/bi'
61
 import { biProductStatisticsAPI, biProductStatisticsExportAPI } from '@/api/bi/bi'
55
-import ContractDetail from '@/views/crm/contract/Detail'
56
-import CustomerDetail from '@/views/crm/customer/Detail'
57
-import ProductDetail from '@/views/crm/product/Detail'
62
+import { crmContractQueryListByProductIdAPI } from '@/api/crm/contract'
63
+
64
+import ReportList from '@/views/crm/workbench/components/ReportList'
58
 
65
 
59
 import BaseMixin from '../mixins/Base'
66
 import BaseMixin from '../mixins/Base'
60
-import { floatAdd } from '@/utils'
61
 
67
 
62
 export default {
68
 export default {
63
   /** 产品销售情况统计 */
69
   /** 产品销售情况统计 */
64
   name: 'ProductStatistics',
70
   name: 'ProductStatistics',
65
   components: {
71
   components: {
66
-    ContractDetail,
67
-    CustomerDetail,
68
-    ProductDetail
72
+    ReportList
69
   },
73
   },
70
   mixins: [BaseMixin],
74
   mixins: [BaseMixin],
71
   data() {
75
   data() {
72
     return {
76
     return {
73
       loading: false,
77
       loading: false,
74
-      tableHeight: document.documentElement.clientHeight - 170,
78
+      tableHeight: document.documentElement.clientHeight - 220,
79
+      currentPage: 1,
80
+      pageSize: 15,
81
+      pageSizes: [15, 30, 60, 100],
82
+      total: 0,
75
       postParams: {}, // 筛选参数
83
       postParams: {}, // 筛选参数
76
 
84
 
77
       headFieldList: [
85
       headFieldList: [
78
         { field: 'category_id_info', name: '产品分类', width: '115px' },
86
         { field: 'category_id_info', name: '产品分类', width: '115px' },
79
         { field: 'product_name', name: '产品名称', width: '115px' },
87
         { field: 'product_name', name: '产品名称', width: '115px' },
80
-        { field: 'contract_num', name: '合同编号', width: '115px' },
81
-        { field: 'owner_user_name', name: '负责人', width: '115px' },
82
-        { field: 'contract_name', name: '客户名称', width: '115px' },
83
-        { field: 'price', name: '销售单价', width: '115px' },
84
-        { field: 'num', name: '数量', width: '115px' },
85
-        { field: 'subtotal', name: '订单产品小计', width: '115px' }
88
+        { field: 'contract_product_sum', name: '合同数', width: '115px' },
89
+        { field: 'product_sum', name: '数量合计', width: '115px' },
90
+        { field: 'contract_money', name: '订单产品小计', width: '115px' }
91
+
92
+        // { field: 'category_id_info', name: '产品分类', width: '115px' },
93
+        // { field: 'product_name', name: '产品名称', width: '115px' },
94
+        // { field: 'contract_product_sum', name: '合同编号', width: '115px' },
95
+        // { field: 'owner_user_name', name: '负责人', width: '115px' },
96
+        // { field: 'contract_name', name: '客户名称', width: '115px' },
97
+        // { field: 'price', name: '销售单价', width: '115px' },
98
+        // { field: 'product_sum', name: '数量', width: '115px' },
99
+        // { field: 'subtotal', name: '订单产品小计', width: '115px' }
86
       ],
100
       ],
87
       list: [],
101
       list: [],
88
       //
102
       //
89
-      spanList: [],
90
-      newList: [],
91
-      /** 控制详情展示 */
92
-      showContractview: false,
93
-      showCustomerView: false,
94
-      showProductview: false,
95
-      rowID: ''
103
+      extraData: {
104
+        contract_product_sum: 0,
105
+        product_sum: 0,
106
+        contract_money: 0
107
+      },
108
+
109
+      reportListShow: false,
110
+      reportData: {
111
+        title: '',
112
+        placeholder: '',
113
+        request: null,
114
+        params: null
115
+      }
96
     }
116
     }
97
   },
117
   },
98
   computed: {},
118
   computed: {},
99
   mounted() {
119
   mounted() {
100
-    var self = this
101
     /** 控制table的高度 */
120
     /** 控制table的高度 */
102
-    window.onresize = function() {
103
-      var offsetHei = document.documentElement.clientHeight
104
-      self.tableHeight = offsetHei - 170
121
+    window.onresize = () => {
122
+      const offsetHei = document.documentElement.clientHeight
123
+      this.tableHeight = offsetHei - 220
105
     }
124
     }
106
   },
125
   },
107
   methods: {
126
   methods: {
108
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
109
-      var item = this.spanList[rowIndex]
110
-      if (columnIndex == 0) {
111
-        if (item.rowspan == 0) {
112
-          return {
113
-            rowspan: 0,
114
-            colspan: 0
115
-          }
116
-        } else {
117
-          return {
118
-            rowspan: item.rowspan,
119
-            colspan: 1
120
-          }
121
-        }
122
-      } else if (columnIndex == 1) {
123
-        if (item.productRowspan == 0) {
124
-          return {
125
-            rowspan: 0,
126
-            colspan: 0
127
-          }
128
-        } else {
129
-          return {
130
-            rowspan: item.productRowspan,
131
-            colspan: 1
132
-          }
133
-        }
127
+    /**
128
+     * 通过回调控制class
129
+     */
130
+    cellClassName({ row, column, rowIndex, columnIndex }) {
131
+      if (column.property === 'contract_product_sum') {
132
+        return 'can-visit--underline'
133
+      } else {
134
+        return ''
134
       }
135
       }
135
     },
136
     },
136
-    /** 列表操作 */
137
-    // 当某一行被点击时会触发该事件
138
-    handleRowClick(row, column, event) {
139
-      if (column.property === 'contract_name') {
140
-        if (this.showProductview) {
141
-          this.showProductview = false
142
-        }
143
-        if (this.showContractview) {
144
-          this.showContractview = false
145
-        }
146
-        this.rowID = row.customer_id
147
-        this.showCustomerView = true
148
-      } else if (column.property === 'product_name') {
149
-        if (this.showCustomerView) {
150
-          this.showCustomerView = false
151
-        }
152
-        if (this.showContractview) {
153
-          this.showContractview = false
154
-        }
155
-        this.rowID = row.product_id
156
-        this.showProductview = true
157
-      } else if (column.property === 'contract_num') {
158
-        if (this.showProductview) {
159
-          this.showProductview = false
160
-        }
161
-        if (this.showCustomerView) {
162
-          this.showCustomerView = false
163
-        }
164
-        this.rowID = row.contract_id
165
-        this.showContractview = true
166
-      }
137
+    /**
138
+     * 更改每页展示数量
139
+     */
140
+    handleSizeChange(val) {
141
+      this.pageSize = val
142
+      this.getProductDatalist()
143
+    },
144
+
145
+    /**
146
+     * 更改当前页数
147
+     */
148
+    handleCurrentChange(val) {
149
+      this.currentPage = val
150
+      this.getProductDatalist()
167
     },
151
     },
168
-    cellStyle({ row, column, rowIndex, columnIndex }) {
169
-      var item = this.spanList[rowIndex]
170
-      if (item.isSum == true) {
171
-        return { backgroundColor: '#FFF9F2', borderRight: '0 none', fontWeight: 'bold' }
172
-      } else if (item.isAllSum == true) {
173
-        return { backgroundColor: '#FFF3E8', borderRight: '0 none', fontWeight: 'bold' }
174
-      } else if (columnIndex === 1 || columnIndex === 2 || columnIndex === 4) {
175
-        return { color: '#2362FB', cursor: 'pointer' }
152
+
153
+    /**
154
+     * 当某一行被点击时会触发该事件
155
+     */
156
+    handleRowClick(row, column, event) {
157
+      if (column.property === 'contract_product_sum') {
158
+        this.reportData.title = `${column.label}详情`
159
+        this.reportData.request = crmContractQueryListByProductIdAPI
160
+        this.reportData.placeholder = '请输入客户名称/合同编号/合同名称'
161
+        const params = { ...this.postParams, product_id: row.product_id }
162
+        this.reportData.params = params
163
+        this.reportListShow = true
176
       }
164
       }
177
     },
165
     },
166
+
178
     /** 获取部门业绩完成信息 */
167
     /** 获取部门业绩完成信息 */
179
     getProductDatalist(params) {
168
     getProductDatalist(params) {
180
-      this.postParams = params
169
+      if (params) {
170
+        this.postParams = params
171
+      }
181
       this.loading = true
172
       this.loading = true
182
-      biProductStatisticsAPI(params)
173
+      biProductStatisticsAPI({
174
+        ...this.postParams,
175
+        page: this.currentPage,
176
+        limit: this.pageSize
177
+      })
183
         .then(res => {
178
         .then(res => {
184
-          if (res.data && res.data.length > 0) {
185
-            this.list = res.data
186
-            this.handleShowInfo()
187
-          } else {
188
-            this.list = []
189
-            this.spanList = []
190
-            this.newList = []
191
-          }
179
+          const resData = res.data || {}
180
+          this.list = resData.list || []
181
+          this.extraData = resData.total || { extraData: 0,
182
+            product_sum: 0,
183
+            contract_money: 0 }
184
+          this.total = resData.count
192
           this.loading = false
185
           this.loading = false
193
         })
186
         })
194
         .catch(() => {
187
         .catch(() => {
195
           this.loading = false
188
           this.loading = false
196
         })
189
         })
197
     },
190
     },
198
-    /** 处理展示数据 */
199
-    handleShowInfo() {
200
-      // 记录分类合并
201
-      // 产品合并
202
-      // 小产品
203
-      /**
204
-       * rowspan 数量
205
-       *
206
-       */
207
-
208
-      var newList = []
209
-      var spanList = []
210
-      var seriesIndex = 0 // 操控span中元素
211
-      var productIndex = 0
212
-
213
-      var subCount = 0 // 产品
214
-      var subMoney = 0
215
-      var allCount = 0 // 系列
216
-      var allMoney = 0
217
-
218
-      for (let index = 0; index < this.list.length; index++) {
219
-        const element = this.list[index]
220
-        if (spanList.length == 0) {
221
-          seriesIndex = 0 // 一个新系列的开始
222
-          productIndex = 0 // 一个新产品的开始
223
-          subCount = parseFloat(element.num) // 产品
224
-          subMoney = parseFloat(element.subtotal)
225
-          allCount = parseFloat(element.num) // 系列
226
-          allMoney = parseFloat(element.subtotal)
227
-
228
-          spanList.push({ rowspan: 1, productRowspan: 1 })
229
-          newList.push(element) // 真实数据
230
-        } else if (element.category_id != this.list[index - 1].category_id) {
231
-          // 系列改变时候的逻辑
232
-          /** 上一个最后产品的处理 */
233
-          var preItem = spanList[seriesIndex]
234
-          preItem.rowspan += 1
235
-          newList.push({ price: '合计', num: subCount, subtotal: subMoney }) // 产品小计数据
236
-          spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // 产品小计style
237
-
238
-          newList.push({ price: '总计', num: allCount, subtotal: allMoney }) // 系列小计数据
239
-          spanList.push({ rowspan: 1, productRowspan: 1, isAllSum: true }) // 系列小计style
240
-
241
-          /** * 新系列开始 */
242
-          spanList.push({ rowspan: 1, productRowspan: 1 }) // 新系列 新产品的 展示数据开始 style
243
-          subCount = parseFloat(element.num) // 新产品的值 所以取消了重置为0
244
-          subMoney = parseFloat(element.subtotal)
245
-          allCount = parseFloat(element.num) // 系列
246
-          allMoney = parseFloat(element.subtotal)
247
-          newList.push(element) // 真实数据
248
-          seriesIndex = spanList.length - 1 // 一个新系列的开始
249
-          productIndex = spanList.length - 1 // 一个新产品的开始
250
-        } else {
251
-          var preItem = spanList[seriesIndex]
252
-          preItem.rowspan += 1
253
-          /** * 相同产品 */
254
-          if (element.product_id == this.list[index - 1].product_id) {
255
-            var preProItem = spanList[productIndex]
256
-            preProItem.productRowspan += 1
257
-            spanList.push({ rowspan: 0, productRowspan: 0 }) // 产品 非第一条数据的style
258
-
259
-
260
-            subCount = floatAdd(subCount, parseFloat(element.num)) // 产品
261
-            subMoney = floatAdd(subMoney, parseFloat(element.subtotal))
262
-            allCount = floatAdd(allCount, parseFloat(element.num)) // 系列
263
-            allMoney = floatAdd(allMoney, parseFloat(element.subtotal))
264
-
265
-            newList.push(element) // 真实数据
266
-          } else {
267
-            /** * 不相同产品 */
268
-            // 需要添加一个小计
269
-            preItem.rowspan += 1
270
-
271
-            newList.push({ price: '合计', num: subCount, subtotal: subMoney }) // 产品小计数据
272
-            spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // 产品小计Style
273
-
274
-            spanList.push({ rowspan: 0, productRowspan: 1 }) // 新产品 第一条数据style
275
-            productIndex = spanList.length - 1 // 一个新产品的开始=
276
-            subCount = parseFloat(element.num)
277
-            subMoney = parseFloat(element.subtotal) // 开始了一个新的产品  所以没有 清空数据
278
-            allCount = floatAdd(allCount, parseFloat(element.num)) // 系列 继续 叠加
279
-            allMoney = floatAdd(allMoney, parseFloat(element.subtotal))
280
-            newList.push(element) // 真实数据
281
-          }
282
-        }
283
-
284
-        if (this.list.length - 1 == index) {
285
-          // 最后一个产品的处理
286
-          var preItem = spanList[seriesIndex]
287
-          preItem.rowspan += 1
288
-          newList.push({ price: '合计', num: subCount, subtotal: subMoney }) // 产品小计数据
289
-          subCount = 0
290
-          subMoney = 0 // 完成一个产品统计 清空数据
291
-          spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // 产品小计style
292
-
293
-          newList.push({ price: '合计', num: allCount, subtotal: allMoney }) // 系列小计数据
294
-          allCount = 0
295
-          allMoney = 0 // 完成一个系列统计 清空数据
296
-          spanList.push({ rowspan: 1, productRowspan: 1, isAllSum: true }) // 系列小计style
297
-        }
298
-      }
299
-
300
-      this.spanList = spanList
301
-      newList[newList.length - 1].price = '总计'
302
-      this.newList = newList
191
+    /**
192
+     * 合计
193
+     */
194
+    getSummaries(param) {
195
+      this.$nextTick(() => {
196
+        this.$refs.tableRef.doLayout()
197
+      })
198
+      return ['合计', '', this.extraData.contract_product_sum, this.extraData.product_sum, this.extraData.contract_money]
303
     },
199
     },
304
 
200
 
201
+
305
     /**
202
     /**
306
      * 导出点击
203
      * 导出点击
307
      */
204
      */
377
   tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] {
274
   tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] {
378
     border-right: 0 none !important;
275
     border-right: 0 none !important;
379
   }
276
   }
277
+   overflow:visible !important;
380
 }
278
 }
381
 </style>
279
 </style>

+ 3
- 3
src/views/crm/business/Detail.vue View File

325
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
325
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
326
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
326
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
327
       tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
327
       tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
328
-      // if (this.crm.business && this.crm.business.print) {
329
-      //   tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
330
-      // }
328
+      if (this.crm.business && this.crm.business.print) {
329
+        tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
330
+      }
331
       return tempsTabs
331
       return tempsTabs
332
     },
332
     },
333
 
333
 

+ 3
- 3
src/views/crm/components/CRMBaseInfo.vue View File

165
   props: {
165
   props: {
166
     // 模块ID
166
     // 模块ID
167
     id: [String, Number],
167
     id: [String, Number],
168
-    poolId: [String, Number],
168
+    pool_id: [String, Number],
169
     detail: {
169
     detail: {
170
       type: Object,
170
       type: Object,
171
       default: () => {
171
       default: () => {
244
       }
244
       }
245
 
245
 
246
       // 如果有公海id 需上传确定展示字段
246
       // 如果有公海id 需上传确定展示字段
247
-      if (this.poolId) {
248
-        params.poolId = this.poolId
247
+      if (this.pool_id) {
248
+        params.pool_id = this.pool_id
249
       }
249
       }
250
 
250
 
251
       filedGetInformationAPI(params)
251
       filedGetInformationAPI(params)

+ 13
- 13
src/views/crm/components/CRMDetailHead.vue View File

93
       @handle="handleCallBack" />
93
       @handle="handleCallBack" />
94
     <alloc-handle
94
     <alloc-handle
95
       :crm-type="crmType"
95
       :crm-type="crmType"
96
-      :pool-id="poolId"
96
+      :pool_id="pool_id"
97
       :selection-list="[detail]"
97
       :selection-list="[detail]"
98
       :dialog-visible.sync="allocDialogShow"
98
       :dialog-visible.sync="allocDialogShow"
99
       @handle="handleCallBack" />
99
       @handle="handleCallBack" />
150
   props: {
150
   props: {
151
     /** 模块ID */
151
     /** 模块ID */
152
     id: [String, Number],
152
     id: [String, Number],
153
-    poolId: [String, Number],
153
+    pool_id: [String, Number],
154
     // 公海权限
154
     // 公海权限
155
     poolAuth: Object,
155
     poolAuth: Object,
156
     /** 没有值就是全部类型 有值就是当个类型 */
156
     /** 没有值就是全部类型 有值就是当个类型 */
415
         }[this.crmType]
415
         }[this.crmType]
416
         const params = {}
416
         const params = {}
417
         if (this.isSeas) {
417
         if (this.isSeas) {
418
-          // params.poolId = this.poolId
418
+          params.pool_id = this.pool_id
419
           params.isSeas = 1
419
           params.isSeas = 1
420
         }
420
         }
421
         params.id = [parseInt(this.id)]
421
         params.id = [parseInt(this.id)]
431
       } else if (type === 'get') {
431
       } else if (type === 'get') {
432
         // 领取
432
         // 领取
433
         crmCustomerReceiveAPI({
433
         crmCustomerReceiveAPI({
434
-          customer_id: [this.id]
435
-          // poolId: this.poolId
434
+          customer_id: [this.id],
435
+          pool_id: this.pool_id
436
         })
436
         })
437
           .then(res => {
437
           .then(res => {
438
             this.$message({
438
             this.$message({
606
         return this.crm[this.crmType].transform
606
         return this.crm[this.crmType].transform
607
       } else if (type == 'export') {
607
       } else if (type == 'export') {
608
         if (this.isSeas) {
608
         if (this.isSeas) {
609
-          if (this.poolId) {
609
+          if (this.pool_id) {
610
             return this.poolAuth.excelexport
610
             return this.poolAuth.excelexport
611
           }
611
           }
612
           return this.crm.pool.excelexport
612
           return this.crm.pool.excelexport
614
         return this.crm[this.crmType].excelexport
614
         return this.crm[this.crmType].excelexport
615
       } else if (type == 'delete') {
615
       } else if (type == 'delete') {
616
         if (this.isSeas) {
616
         if (this.isSeas) {
617
-          if (this.poolId) {
617
+          if (this.pool_id) {
618
             return this.poolAuth && this.poolAuth.delete
618
             return this.poolAuth && this.poolAuth.delete
619
           }
619
           }
620
-          return this.crm.pool.delete && this.poolId
620
+          return this.crm.pool.delete && this.pool_id
621
         }
621
         }
622
         return this.crm[this.crmType].delete
622
         return this.crm[this.crmType].delete
623
       } else if (type == 'put_seas') {
623
       } else if (type == 'put_seas') {
631
         return this.crm[this.crmType].teamsave
631
         return this.crm[this.crmType].teamsave
632
       } else if (type == 'alloc') {
632
       } else if (type == 'alloc') {
633
         // 分配(公海)
633
         // 分配(公海)
634
-        if (this.poolId) {
634
+        if (this.pool_id) {
635
           return this.poolAuth && this.poolAuth.distribute
635
           return this.poolAuth && this.poolAuth.distribute
636
         }
636
         }
637
         return this.crm.pool.distribute
637
         return this.crm.pool.distribute
638
       } else if (type == 'get') {
638
       } else if (type == 'get') {
639
         // 领取(公海)
639
         // 领取(公海)
640
-        if (this.poolId) {
640
+        if (this.pool_id) {
641
           return this.poolAuth && this.poolAuth.receive
641
           return this.poolAuth && this.poolAuth.receive
642
         }
642
         }
643
-        return this.crm.pool.receive && this.poolId
643
+        return this.crm.pool.receive && this.pool_id
644
       } else if (type == 'start' || type == 'disable') {
644
       } else if (type == 'start' || type == 'disable') {
645
         // 上架 下架(产品)
645
         // 上架 下架(产品)
646
         return this.crm[this.crmType].status
646
         return this.crm[this.crmType].status
655
         return false
655
         return false
656
       } else if (type == 'print') {
656
       } else if (type == 'print') {
657
         // 打印
657
         // 打印
658
-        // return this.crm[this.crmType].print
659
-        return false
658
+        return this.crm[this.crmType].print
659
+        // return false
660
       } else if (type == 'copyContract') {
660
       } else if (type == 'copyContract') {
661
         // 合同复制
661
         // 合同复制
662
         return this.crm[this.crmType].save
662
         return this.crm[this.crmType].save

+ 5
- 4
src/views/crm/components/CRMEditBaseInfo.vue View File

224
   props: {
224
   props: {
225
     // 模块ID
225
     // 模块ID
226
     id: [String, Number],
226
     id: [String, Number],
227
-    poolId: [String, Number],
227
+    pool_id: [String, Number],
228
     isSeas: {
228
     isSeas: {
229
       type: Boolean,
229
       type: Boolean,
230
       default: false
230
       default: false
332
       }
332
       }
333
 
333
 
334
       // 如果有公海id 需上传确定展示字段
334
       // 如果有公海id 需上传确定展示字段
335
-      if (this.poolId) {
336
-        params.poolId = this.poolId
335
+      if (this.pool_id) {
336
+        params.pool_id = this.pool_id
337
       }
337
       }
338
 
338
 
339
       filedGetInformationAPI(params)
339
       filedGetInformationAPI(params)
773
           } else {
773
           } else {
774
             var validatesParams = {
774
             var validatesParams = {
775
               field: item.field,
775
               field: item.field,
776
-              types: 'crm_' + this.crmType
776
+              types: 'crm_' + this.crmType,
777
+              id: this.id
777
             }
778
             }
778
             validatesParams.fieldId = item.fieldId
779
             validatesParams.fieldId = item.fieldId
779
             if (isArray(value)) {
780
             if (isArray(value)) {

+ 1
- 1
src/views/crm/components/CRMListHead.vue View File

127
   },
127
   },
128
   mounted() {
128
   mounted() {
129
     // 线索和客户判断更多操作
129
     // 线索和客户判断更多操作
130
-    if (this.crm[this.crmType] && this.crm[this.crmType].excelimport && !this.isSeas) {
130
+    if (this.crm[this.crmType] && this.crm[this.crmType].excelimport) {
131
       this.moreTypes.push({ type: 'enter', name: '导入', icon: 'import' })
131
       this.moreTypes.push({ type: 'enter', name: '导入', icon: 'import' })
132
     }
132
     }
133
     if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) {
133
     if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) {

+ 11
- 12
src/views/crm/components/CRMTableHead.vue View File

82
       @handle="handleCallBack" />
82
       @handle="handleCallBack" />
83
     <alloc-handle
83
     <alloc-handle
84
       :crm-type="crmType"
84
       :crm-type="crmType"
85
-      :pool-id="poolId"
85
+      :pool_id="pool_id"
86
       :selection-list="selectionList"
86
       :selection-list="selectionList"
87
       :dialog-visible.sync="allocDialogShow"
87
       :dialog-visible.sync="allocDialogShow"
88
       @handle="handleCallBack" />
88
       @handle="handleCallBack" />
202
       type: Boolean,
202
       type: Boolean,
203
       default: false
203
       default: false
204
     },
204
     },
205
-    poolId: [String, Number],
205
+    pool_id: [String, Number],
206
     // 公海权限
206
     // 公海权限
207
     poolAuth: Object,
207
     poolAuth: Object,
208
     // 排序信息
208
     // 排序信息
284
     getFilterFieldInfo() {
284
     getFilterFieldInfo() {
285
       const params = {}
285
       const params = {}
286
       if (this.isSeas) {
286
       if (this.isSeas) {
287
-        // params.poolId = this.poolId
288
-        params.types = crmTypeModel[this.crmType]
287
+        params.types = 'crm_customer_pool'
289
       } else {
288
       } else {
290
         params.types = crmTypeModel[this.crmType]
289
         params.types = crmTypeModel[this.crmType]
291
       }
290
       }
363
         let request = null
362
         let request = null
364
         if (this.isSeas) {
363
         if (this.isSeas) {
365
           request = crmCustomerPoolExcelExportAPI
364
           request = crmCustomerPoolExcelExportAPI
366
-          // params.poolId = this.poolId
365
+          params.pool_id = this.pool_id
367
           // params.isSeas = 1
366
           // params.isSeas = 1
368
           params.customer_id = this.selectionList
367
           params.customer_id = this.selectionList
369
             .map(item => item.customer_id)
368
             .map(item => item.customer_id)
509
         const params = {
508
         const params = {
510
         }
509
         }
511
         if (this.isSeas) {
510
         if (this.isSeas) {
512
-          // params.poolId = this.poolId
511
+          params.pool_id = this.pool_id
513
           params.isSeas = 1
512
           params.isSeas = 1
514
         }
513
         }
515
         params.id = id
514
         params.id = id
530
         // 领取
529
         // 领取
531
         this.loading = true
530
         this.loading = true
532
         crmCustomerReceiveAPI({
531
         crmCustomerReceiveAPI({
533
-          customer_id: this.selectionList.map(item => item.customer_id)
534
-          // poolId: this.poolId
532
+          customer_id: this.selectionList.map(item => item.customer_id),
533
+          pool_id: this.pool_id
535
         })
534
         })
536
           .then(res => {
535
           .then(res => {
537
             this.loading = false
536
             this.loading = false
714
           : this.crm[this.crmType].transform
713
           : this.crm[this.crmType].transform
715
       } else if (type == 'export') {
714
       } else if (type == 'export') {
716
         if (this.isSeas) {
715
         if (this.isSeas) {
717
-          if (this.poolId) {
716
+          if (this.pool_id) {
718
             return this.poolAuth.excelexport
717
             return this.poolAuth.excelexport
719
           }
718
           }
720
           return this.crm.pool.excelexport
719
           return this.crm.pool.excelexport
726
         }
725
         }
727
       } else if (type == 'delete') {
726
       } else if (type == 'delete') {
728
         if (this.isSeas) {
727
         if (this.isSeas) {
729
-          if (this.poolId) {
728
+          if (this.pool_id) {
730
             return this.poolAuth.delete
729
             return this.poolAuth.delete
731
           }
730
           }
732
           return this.crm.pool.delete
731
           return this.crm.pool.delete
743
         return this.crm[this.crmType].teamsave
742
         return this.crm[this.crmType].teamsave
744
       } else if (type == 'alloc') {
743
       } else if (type == 'alloc') {
745
         // 分配(公海)
744
         // 分配(公海)
746
-        if (this.poolId) {
745
+        if (this.pool_id) {
747
           return this.poolAuth.distribute
746
           return this.poolAuth.distribute
748
         }
747
         }
749
         return this.crm.pool.distribute
748
         return this.crm.pool.distribute
750
       } else if (type == 'get') {
749
       } else if (type == 'get') {
751
         // 领取(公海)
750
         // 领取(公海)
752
-        if (this.poolId) {
751
+        if (this.pool_id) {
753
           return this.poolAuth.receive
752
           return this.poolAuth.receive
754
         }
753
         }
755
         return this.crm.pool.receive
754
         return this.crm.pool.receive

+ 3
- 3
src/views/crm/components/ChieflyContacts.vue View File

77
   },
77
   },
78
   props: {
78
   props: {
79
     id: [Number, String],
79
     id: [Number, String],
80
-    poolId: [Number, String],
80
+    pool_id: [Number, String],
81
     contactsId: [Number, String],
81
     contactsId: [Number, String],
82
     crmType: {
82
     crmType: {
83
       required: true,
83
       required: true,
189
       }
189
       }
190
 
190
 
191
       // 如果有公海id 需上传确定展示字段
191
       // 如果有公海id 需上传确定展示字段
192
-      if (this.poolId) {
193
-        params.poolId = this.poolId
192
+      if (this.pool_id) {
193
+        params.pool_id = this.pool_id
194
       }
194
       }
195
 
195
 
196
       filedGetInformationAPI(params)
196
       filedGetInformationAPI(params)

+ 8
- 8
src/views/crm/components/DuplicateCheck/index.vue View File

78
         :visible.sync="showFullDetail"
78
         :visible.sync="showFullDetail"
79
         :crm-type="relationCrmType"
79
         :crm-type="relationCrmType"
80
         :id="relationId"
80
         :id="relationId"
81
-        :pool-id="poolId"
81
+        :pool_id="pool_id"
82
         @handle="getList"/>
82
         @handle="getList"/>
83
 
83
 
84
       <alloc-handle
84
       <alloc-handle
85
-        :pool-id="poolId"
85
+        :pool_id="pool_id"
86
         :selection-list="[relationData]"
86
         :selection-list="[relationData]"
87
         :dialog-visible.sync="allocDialogShow"
87
         :dialog-visible.sync="allocDialogShow"
88
         crm-type="customer"
88
         crm-type="customer"
124
       showFullDetail: false, // 查看相关客户管理详情
124
       showFullDetail: false, // 查看相关客户管理详情
125
       relationId: '', // 相关ID参数
125
       relationId: '', // 相关ID参数
126
       relationData: {}, // 关联数据
126
       relationData: {}, // 关联数据
127
-      poolId: '', // 公海Id
127
+      pool_id: '', // 公海Id
128
       relationCrmType: '', // 相关类型
128
       relationCrmType: '', // 相关类型
129
       allocDialogShow: false //  分配弹窗
129
       allocDialogShow: false //  分配弹窗
130
     }
130
     }
222
         const list = res.data || []
222
         const list = res.data || []
223
         this.tableData = list.map(item => {
223
         this.tableData = list.map(item => {
224
           // item.module = crmTypeModel.convertTypeToName(item.type)
224
           // item.module = crmTypeModel.convertTypeToName(item.type)
225
-          if (item.poolName) {
226
-            item.module = `${item.module}(${item.poolName})`
225
+          if (item.pool_name) {
226
+            item.module = `${item.module}(${item.pool_name})`
227
           }
227
           }
228
           // 是手机号
228
           // 是手机号
229
           if (!this.isCustomerFilter) {
229
           if (!this.isCustomerFilter) {
254
       if (column.property == 'name' && row.id) {
254
       if (column.property == 'name' && row.id) {
255
         this.relationId = row.id
255
         this.relationId = row.id
256
         if (row.poolAuthList) {
256
         if (row.poolAuthList) {
257
-          this.poolId = row.poolAuthList.poolId
257
+          this.pool_id = row.poolAuthList.pool_id
258
         } else {
258
         } else {
259
-          this.poolId = ''
259
+          this.pool_id = ''
260
         }
260
         }
261
         const key = crmTypeModel.convertTypeToKey(row.type)
261
         const key = crmTypeModel.convertTypeToKey(row.type)
262
         this.relationCrmType = key == 'pool' ? 'customer' : key
262
         this.relationCrmType = key == 'pool' ? 'customer' : key
289
           .then(() => {
289
           .then(() => {
290
             crmCustomerReceiveAPI({
290
             crmCustomerReceiveAPI({
291
               customer_id: [data.id],
291
               customer_id: [data.id],
292
-              poolId: data.poolAuthList.poolId
292
+              pool_id: data.poolAuthList.pool_id
293
             })
293
             })
294
               .then(res => {
294
               .then(res => {
295
                 this.$message.success('操作成功')
295
                 this.$message.success('操作成功')

+ 5
- 5
src/views/crm/components/FieldSet/index.vue View File

67
       default: false
67
       default: false
68
     },
68
     },
69
 
69
 
70
-    poolId: [String, Number]
70
+    pool_id: [String, Number]
71
   },
71
   },
72
   data() {
72
   data() {
73
     return {
73
     return {
97
       }
97
       }
98
     },
98
     },
99
 
99
 
100
-    poolId() {
100
+    pool_id() {
101
       this.fields = []
101
       this.fields = []
102
     }
102
     }
103
   },
103
   },
114
       const params = {}
114
       const params = {}
115
       if (this.isSeas) {
115
       if (this.isSeas) {
116
         request = crmPoolFieldConfigIndexAPI
116
         request = crmPoolFieldConfigIndexAPI
117
-        params.poolId = this.poolId
118
-        params.types = crmTypeModel[this.crmType] + '_pool'
117
+        params.pool_id = this.pool_id
118
+        // params.types = crmTypeModel[this.crmType] + '_pool'
119
       } else {
119
       } else {
120
         request = crmFieldConfigAPIIndexAPI
120
         request = crmFieldConfigAPIIndexAPI
121
         params.types = crmTypeModel[this.crmType]
121
         params.types = crmTypeModel[this.crmType]
184
         }
184
         }
185
         if (this.isSeas) {
185
         if (this.isSeas) {
186
           request = crmPoolFieldConfigAPI
186
           request = crmPoolFieldConfigAPI
187
-          params.poolId = this.poolId
187
+          params.pool_id = this.pool_id
188
           params.types = crmTypeModel[this.crmType] + '_pool'
188
           params.types = crmTypeModel[this.crmType] + '_pool'
189
         } else {
189
         } else {
190
           request = crmFieldConfigAPI
190
           request = crmFieldConfigAPI

+ 18
- 15
src/views/crm/components/Print/index.vue View File

18
           @change="getDetail">
18
           @change="getDetail">
19
           <el-option
19
           <el-option
20
             v-for="item in templateOptions"
20
             v-for="item in templateOptions"
21
-            :key="item.templateId"
22
-            :label="item.templateName"
23
-            :value="item.templateId"/>
21
+            :key="item.id"
22
+            :label="item.name"
23
+            :value="item.id"/>
24
         </el-select>
24
         </el-select>
25
         <span class="select-label">选择模版</span>
25
         <span class="select-label">选择模版</span>
26
         <el-select
26
         <el-select
146
           this.templateOptions = res.data.list || []
146
           this.templateOptions = res.data.list || []
147
           if (this.$route.query.type != 'history') {
147
           if (this.$route.query.type != 'history') {
148
             if (this.templateOptions.length) {
148
             if (this.templateOptions.length) {
149
-              this.templateId = this.templateOptions[0].templateId
149
+              this.templateId = this.templateOptions[0].id
150
               this.getDetail()
150
               this.getDetail()
151
             } else {
151
             } else {
152
               this.templateId = ''
152
               this.templateId = ''
166
     getDetail() {
166
     getDetail() {
167
       this.loading = true
167
       this.loading = true
168
       printPrintAPI({
168
       printPrintAPI({
169
-        templateId: this.templateId,
170
-        id: this.typeId
169
+        template_id: this.templateId,
170
+        action_id: this.typeId,
171
+        type: crmTypeModel.convertKeyToType(this.$route.query.module)
171
       })
172
       })
172
         .then(res => {
173
         .then(res => {
173
           this.loading = false
174
           this.loading = false
184
     getRecordDetail() {
185
     getRecordDetail() {
185
       this.loading = true
186
       this.loading = true
186
       printRecordDetailAPI({
187
       printRecordDetailAPI({
187
-        recordId: this.$route.query.recordId
188
+        record_id: this.$route.query.id,
189
+        type: 20
188
       })
190
       })
189
         .then(res => {
191
         .then(res => {
190
           this.loading = false
192
           this.loading = false
191
           const data = res.data || {}
193
           const data = res.data || {}
192
           this.historyData = data
194
           this.historyData = data
193
-          this.templateId = data.templateId
195
+          this.templateId = data.template_id
194
           this.typeId = data.typeId
196
           this.typeId = data.typeId
195
 
197
 
196
-          this.getTemplateOptions(data.crmType)
197
-          this.content = data.recordContent || ''
198
+          this.getTemplateOptions(data.type)
199
+          this.content = data.content || ''
198
         })
200
         })
199
         .catch(() => {
201
         .catch(() => {
200
           this.loading = false
202
           this.loading = false
221
         .then(res => {
223
         .then(res => {
222
           this.loading = false
224
           this.loading = false
223
           const data = res.data
225
           const data = res.data
224
-          const iframeUrl = `/crmPrint/preview.pdf?type=1&key=${data}`
225
-          downloadFileAPI(iframeUrl).then(res => {
226
+          const iframeUrl = `/crm/preview/previewPDF?key=${data}`
227
+          downloadFileAPI({ key: data }, iframeUrl).then(res => {
226
             this.iframeUrl = window.URL.createObjectURL(res.data)
228
             this.iframeUrl = window.URL.createObjectURL(res.data)
227
           }).catch(() => {})
229
           }).catch(() => {})
228
 
230
 
240
     savePrintRecord() {
242
     savePrintRecord() {
241
       if (this.templateId && this.typeId) {
243
       if (this.templateId && this.typeId) {
242
         printSaveRecordAPI({
244
         printSaveRecordAPI({
243
-          templateId: this.templateId,
244
-          typeId: this.typeId,
245
-          recordContent: this.content
245
+          template_id: this.templateId,
246
+          action_id: this.typeId,
247
+          recordContent: this.content,
248
+          type: crmTypeModel.convertKeyToType(this.$route.query.module)
246
         })
249
         })
247
           .then(res => {
250
           .then(res => {
248
           })
251
           })

+ 4
- 4
src/views/crm/components/RelativePrint.vue View File

54
       nopermission: false,
54
       nopermission: false,
55
       list: [],
55
       list: [],
56
       fieldList: [
56
       fieldList: [
57
-        { prop: 'createTime', label: '打印时间', width: '115px' },
58
-        { prop: 'templateName', label: '打印模板', width: '115px' }
57
+        { prop: 'create_time', label: '打印时间', width: '115px' },
58
+        { prop: 'template_name', label: '打印模板', width: '115px' }
59
       ],
59
       ],
60
       tableHeight: '450px'
60
       tableHeight: '450px'
61
     }
61
     }
90
         .then(res => {
90
         .then(res => {
91
           this.nopermission = false
91
           this.nopermission = false
92
           this.loading = false
92
           this.loading = false
93
-          this.list = res.data
93
+          this.list = res.data.list
94
         })
94
         })
95
         .catch(res => {
95
         .catch(res => {
96
           if (res.code == 102) {
96
           if (res.code == 102) {
101
     },
101
     },
102
 
102
 
103
     print(data) {
103
     print(data) {
104
-      const routeData = this.$router.resolve(`/print/?&type=history&recordId=${data.recordId}`)
104
+      const routeData = this.$router.resolve(`/print/?&type=history&module=${this.crmType}&id=${data.record_id}`)
105
       window.open(routeData.href, '_blank')
105
       window.open(routeData.href, '_blank')
106
     }
106
     }
107
   }
107
   }

+ 12
- 8
src/views/crm/components/SceneForm/SceneCreate.vue View File

189
 
189
 
190
 import { objDeepCopy } from '@/utils'
190
 import { objDeepCopy } from '@/utils'
191
 import AdvancedFilterMixin from '@/mixins/AdvancedFilter'
191
 import AdvancedFilterMixin from '@/mixins/AdvancedFilter'
192
+import { isArray } from '@/utils/types'
192
 
193
 
193
 /**
194
 /**
194
  * fieldList: 高级筛选的字段
195
  * fieldList: 高级筛选的字段
312
                 item.value = []
313
                 item.value = []
313
                 this.getProductCategoryValue(item, element.value[0])
314
                 this.getProductCategoryValue(item, element.value[0])
314
               } else if (element.form_type == 'map_address') {
315
               } else if (element.form_type == 'map_address') {
315
-                const addressArr = element.value[0].split(',')
316
-                item.address = {
317
-                  state: addressArr.length > 0 ? addressArr[0] : '',
318
-                  city: addressArr.length > 1 ? addressArr[1] : '',
319
-                  area: addressArr.length > 2 ? addressArr[2] : ''
320
-                }
316
+                const addressArr = element.value
317
+                item.address = addressArr
318
+                // item.address = {
319
+                //   state: addressArr.length > 0 ? addressArr[0] : '',
320
+                //   city: addressArr.length > 1 ? addressArr[1] : '',
321
+                //   area: addressArr.length > 2 ? addressArr[2] : ''
322
+                // }
321
               } else {
323
               } else {
322
                 item.setting = element.setting
324
                 item.setting = element.setting
323
-                item.value = element.value
325
+                item.value = isArray(element.value) ? element.value.join(';') : element.value
324
               }
326
               }
325
 
327
 
326
               this.form.push(item)
328
               this.form.push(item)
386
           const users = res.data || []
388
           const users = res.data || []
387
           for (let index = 0; index < users.length; index++) {
389
           for (let index = 0; index < users.length; index++) {
388
             const user = users[index]
390
             const user = users[index]
389
-            if (user.userId == id) {
391
+            if (user.id == id) {
390
               item.value = [user]
392
               item.value = [user]
391
               break
393
               break
392
             }
394
             }
776
           if (typeof o.value === 'string') {
778
           if (typeof o.value === 'string') {
777
             const temp = o.value.replace(/;/g, ';')
779
             const temp = o.value.replace(/;/g, ';')
778
             value = temp.split(';').filter(item => item !== '' && item !== null)
780
             value = temp.split(';').filter(item => item !== '' && item !== null)
781
+          } else if (Object.prototype.toString.call(o.value) === '[object Array]') {
782
+            value = o.value
779
           } else {
783
           } else {
780
             value = [o.value]
784
             value = [o.value]
781
           }
785
           }

+ 3
- 3
src/views/crm/components/SelectionHandle/AllocHandle.vue View File

53
       type: String,
53
       type: String,
54
       default: ''
54
       default: ''
55
     },
55
     },
56
-    poolId: [String, Number],
56
+    pool_id: [String, Number],
57
     /** 转移数据 */
57
     /** 转移数据 */
58
     selectionList: {
58
     selectionList: {
59
       type: Array,
59
       type: Array,
103
         this.$message.error('请选择负责人')
103
         this.$message.error('请选择负责人')
104
       } else {
104
       } else {
105
         const params = {
105
         const params = {
106
-          owner_user_id: this.usersList[0].id
107
-          // poolId: this.poolId
106
+          user_id: this.usersList[0].id,
107
+          pool_id: this.pool_id
108
         }
108
         }
109
         params.customer_id = this.selectionList.map(item => item[this.crmType + '_id'])
109
         params.customer_id = this.selectionList.map(item => item[this.crmType + '_id'])
110
         this.loading = true
110
         this.loading = true

+ 20
- 19
src/views/crm/components/SelectionHandle/PutPoolHandle.vue View File

12
         <el-select v-model="selectId" >
12
         <el-select v-model="selectId" >
13
           <el-option
13
           <el-option
14
             v-for="item in list"
14
             v-for="item in list"
15
-            :key="item.poolId"
16
-            :label="item.poolName"
17
-            :value="item.poolId"/>
15
+            :key="item.pool_id"
16
+            :label="item.pool_name"
17
+            :value="item.pool_id"/>
18
         </el-select>
18
         </el-select>
19
       </flexbox>
19
       </flexbox>
20
     </div>
20
     </div>
31
 
31
 
32
 <script>
32
 <script>
33
 import {
33
 import {
34
-  crmCustomerPutInPoolAPI
34
+  crmCustomerPutInPoolAPI,
35
+  crmCustomerPoolNameListAPI
35
 } from '@/api/crm/customer'
36
 } from '@/api/crm/customer'
36
 
37
 
37
 import { Loading } from 'element-ui'
38
 import { Loading } from 'element-ui'
69
   watch: {
70
   watch: {
70
     list: {
71
     list: {
71
       handler() {
72
       handler() {
72
-        this.selectId = this.list && this.list.length > 0 ? this.list[0].poolId : ''
73
+        this.selectId = this.list && this.list.length > 0 ? this.list[0].pool_id : ''
73
       },
74
       },
74
       immediate: true
75
       immediate: true
75
     },
76
     },
86
      * 获取数据源
87
      * 获取数据源
87
      */
88
      */
88
     getList() {
89
     getList() {
89
-      // const loading = Loading.service({
90
-      //   target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
91
-      // })
90
+      const loading = Loading.service({
91
+        target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
92
+      })
92
       this.list = [
93
       this.list = [
93
-        { 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }
94
+        // { 'pool_id': 1, 'pool_name': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }
94
       ]
95
       ]
95
-      // crmCustomerPoolNameListAPI()
96
-      //   .then(res => {
97
-      //     this.list = res.data || []
98
-      //     loading && loading.close()
99
-      //   })
100
-      //   .catch(() => {
101
-      //     loading && loading.close()
102
-      //   })
96
+      crmCustomerPoolNameListAPI()
97
+        .then(res => {
98
+          this.list = res.data || []
99
+          loading && loading.close()
100
+        })
101
+        .catch(() => {
102
+          loading && loading.close()
103
+        })
103
     },
104
     },
104
 
105
 
105
     /**
106
     /**
118
           target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
119
           target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
119
         })
120
         })
120
         crmCustomerPutInPoolAPI({
121
         crmCustomerPutInPoolAPI({
121
-          customer_id: this.selectionList.map(item => item.customer_id)
122
-          // poolId: this.selectId
122
+          customer_id: this.selectionList.map(item => item.customer_id),
123
+          pool_id: this.selectId
123
         })
124
         })
124
           .then(res => {
125
           .then(res => {
125
             this.$message({
126
             this.$message({

+ 3
- 3
src/views/crm/contract/Detail.vue View File

203
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
203
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
204
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
204
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
205
       tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
205
       tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
206
-      // if (this.crm.contract && this.crm.contract.print) {
207
-      //   tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
208
-      // }
206
+      if (this.crm.contract && this.crm.contract.print) {
207
+        tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
208
+      }
209
       return tempsTabs
209
       return tempsTabs
210
     },
210
     },
211
 
211
 

+ 14
- 17
src/views/crm/customer/Detail.vue View File

23
           :detail="detailData"
23
           :detail="detailData"
24
           :head-details="headDetails"
24
           :head-details="headDetails"
25
           :id="id"
25
           :id="id"
26
-          :pool-id="seasPoolId"
26
+          :pool_id="seasPoolId"
27
           :pool-auth="poolAuth"
27
           :pool-auth="poolAuth"
28
           :crm-type="crmType"
28
           :crm-type="crmType"
29
           @handle="detailHeadHandle"
29
           @handle="detailHeadHandle"
56
                 :detail="detailData"
56
                 :detail="detailData"
57
                 :type-list="logTyps"
57
                 :type-list="logTyps"
58
                 :id="id"
58
                 :id="id"
59
-                :pool-id="seasPoolId"
59
+                :pool_id="seasPoolId"
60
                 :handle="activityHandle"
60
                 :handle="activityHandle"
61
                 :is-seas="isSeasDetail"
61
                 :is-seas="isSeasDetail"
62
                 :crm-type="crmType"
62
                 :crm-type="crmType"
77
                 <chiefly-contacts
77
                 <chiefly-contacts
78
                   :contacts-id="firstContactsId"
78
                   :contacts-id="firstContactsId"
79
                   :id="id"
79
                   :id="id"
80
-                  :pool-id="seasPoolId"
80
+                  :pool_id="seasPoolId"
81
                   :crm-type="crmType"
81
                   :crm-type="crmType"
82
                   :is-seas="isSeasDetail"
82
                   :is-seas="isSeasDetail"
83
                   @add="addChieflyContacts" />
83
                   @add="addChieflyContacts" />
146
   props: {
146
   props: {
147
     // 详情信息id
147
     // 详情信息id
148
     id: [String, Number],
148
     id: [String, Number],
149
-    poolId: [String, Number],
149
+    pool_id: [String, Number],
150
     // 监听的dom 进行隐藏详情
150
     // 监听的dom 进行隐藏详情
151
     listenerIDs: {
151
     listenerIDs: {
152
       type: Array,
152
       type: Array,
283
      * 公海id
283
      * 公海id
284
      */
284
      */
285
     seasPoolId() {
285
     seasPoolId() {
286
-      // if (this.poolAuth && this.poolAuth.poolId) {
287
-      //   return this.poolAuth.poolId
288
-      // }
289
-      // return this.poolId
290
-      return 1
286
+      if (this.poolAuth && this.poolAuth.pool_id) {
287
+        return this.poolAuth.pool_id
288
+      }
289
+      return this.pool_id
291
     },
290
     },
292
 
291
 
293
     /**
292
     /**
365
         id: this.id
364
         id: this.id
366
       }
365
       }
367
 
366
 
368
-      if (this.poolId) {
369
-        params.poolId = this.poolId
367
+      if (this.pool_id) {
368
+        params.pool_id = this.pool_id
369
+        params.customer_id = this.id
370
       }
370
       }
371
-      // if(this.isPool){
372
-
373
-      // }
374
 
371
 
375
       crmCustomerReadAPI(params)
372
       crmCustomerReadAPI(params)
376
         .then(res => {
373
         .then(res => {
381
 
378
 
382
           this.firstContactsId = this.detailData.contacts_id
379
           this.firstContactsId = this.detailData.contacts_id
383
           // 公海权限
380
           // 公海权限
384
-          // this.poolAuth = resData.poolAuthList || {}
381
+          this.poolAuth = resData.poolAuthList || {}
385
 
382
 
386
-          crmCustomerPoolQueryAuthAPI().then(res => {
383
+          crmCustomerPoolQueryAuthAPI({ pool_id: this.pool_id }).then(res => {
387
             this.poolAuth = res.data || {}
384
             this.poolAuth = res.data || {}
388
           })
385
           })
389
 
386
 
416
           }
413
           }
417
 
414
 
418
           this.headDetails[2].title = this.isSeasDetail ? '' : '负责人'
415
           this.headDetails[2].title = this.isSeasDetail ? '' : '负责人'
419
-          this.headDetails[2].value = this.detailData.owner_user_id_info.realname || ''
416
+          this.headDetails[2].value = this.isSeasDetail ? this.detailDatabefore_owner_user_name : this.detailData.owner_user_id_info.realname || ''
420
           this.headDetails[3].value = this.detailData.create_time
417
           this.headDetails[3].value = this.detailData.create_time
421
         })
418
         })
422
         .catch(() => {
419
         .catch(() => {

+ 5
- 0
src/views/crm/invoice/Detail.vue View File

258
               name: '更新时间',
258
               name: '更新时间',
259
               // formType: 'text',
259
               // formType: 'text',
260
               value: data.essential.update_time
260
               value: data.essential.update_time
261
+            },
262
+            {
263
+              name: '审核状态',
264
+              // formType: 'text',
265
+              value: data.essential.check_status
261
             }
266
             }
262
           ]
267
           ]
263
         },
268
         },

+ 10
- 9
src/views/crm/mixins/Table.js View File

145
       }
145
       }
146
 
146
 
147
       // 公海切换
147
       // 公海切换
148
-      if (this.poolId) {
149
-        // params.poolId = this.poolId
148
+      if (this.pool_id) {
149
+        params.pool_id = this.pool_id
150
       }
150
       }
151
       if (this.filterObj && this.filterObj.length > 0) {
151
       if (this.filterObj && this.filterObj.length > 0) {
152
         this.filterObj.forEach(element => {
152
         this.filterObj.forEach(element => {
249
 
249
 
250
         let params = {}
250
         let params = {}
251
         if (this.isSeas) {
251
         if (this.isSeas) {
252
-          if (this.poolId) {
253
-            params.poolId = this.poolId
252
+          if (this.pool_id) {
253
+            params.pool_id = this.pool_id
254
           }
254
           }
255
           params = {
255
           params = {
256
             types: 'crm_' + this.crmType,
256
             types: 'crm_' + this.crmType,
257
             module: 'crm',
257
             module: 'crm',
258
             action: 'pool',
258
             action: 'pool',
259
-            controller: this.crmType
259
+            controller: this.crmType,
260
+            pool_id: this.pool_id
260
           }
261
           }
261
         } else {
262
         } else {
262
           // params.label = crmTypeModel[this.crmType]
263
           // params.label = crmTypeModel[this.crmType]
466
       }
467
       }
467
 
468
 
468
       // 公海切换
469
       // 公海切换
469
-      if (this.poolId) {
470
-        // params.poolId = this.poolId
470
+      if (this.pool_id) {
471
+        params.pool_id = this.pool_id
471
       }
472
       }
472
 
473
 
473
       // if (this.filterObj && this.filterObj.length > 0) {
474
       // if (this.filterObj && this.filterObj.length > 0) {
619
           }[column.property] || field
620
           }[column.property] || field
620
         }
621
         }
621
         if (this.isSeas) {
622
         if (this.isSeas) {
622
-          if (!this.poolId) {
623
+          if (!this.pool_id) {
623
             return
624
             return
624
           }
625
           }
625
           request = crmPoolFieldColumnWidthAPI
626
           request = crmPoolFieldColumnWidthAPI
626
-          params.poolId = this.poolId
627
+          params.pool_id = this.pool_id
627
         } else {
628
         } else {
628
           request = crmFieldColumnWidthAPI
629
           request = crmFieldColumnWidthAPI
629
         }
630
         }

+ 1
- 0
src/views/crm/product/Create.vue View File

17
         <template slot-scope="{ data }">
17
         <template slot-scope="{ data }">
18
           <xh-prouct-cate
18
           <xh-prouct-cate
19
             v-if="data && data.formType == 'category'"
19
             v-if="data && data.formType == 'category'"
20
+            :disabled="data.disabled"
20
             :value="fieldForm[data.field]"
21
             :value="fieldForm[data.field]"
21
             @value-change="otherChange($event, data)"
22
             @value-change="otherChange($event, data)"
22
           />
23
           />

+ 1
- 0
src/views/crm/receivables/Create.vue View File

34
           <xh-receivables-plan
34
           <xh-receivables-plan
35
             v-if="data && data.formType == 'receivables_plan'"
35
             v-if="data && data.formType == 'receivables_plan'"
36
             :value="fieldForm[data.field]"
36
             :value="fieldForm[data.field]"
37
+            :disabled="data.disabled"
37
             :receivables-id="editId"
38
             :receivables-id="editId"
38
             :relation="data.relation"
39
             :relation="data.relation"
39
             @value-change="otherChange($event, data)"
40
             @value-change="otherChange($event, data)"

+ 3
- 3
src/views/crm/receivables/Detail.vue View File

148
         { label: '操作记录', name: 'RelativeHandle' }
148
         { label: '操作记录', name: 'RelativeHandle' }
149
       ]
149
       ]
150
 
150
 
151
-      // if (this.crm.receivables && this.crm.receivables.print) {
152
-      //   tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
153
-      // }
151
+      if (this.crm.receivables && this.crm.receivables.print) {
152
+        tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
153
+      }
154
 
154
 
155
       return tempsTabs
155
       return tempsTabs
156
     }
156
     }

+ 17
- 19
src/views/crm/seas/index.vue View File

34
       <c-r-m-table-head
34
       <c-r-m-table-head
35
         ref="crmTableHead"
35
         ref="crmTableHead"
36
         :is-seas="isSeas"
36
         :is-seas="isSeas"
37
-        :pool-id="poolId"
37
+        :pool_id="pool_id"
38
         :pool-auth="poolAuth"
38
         :pool-auth="poolAuth"
39
         :sort-data="sortData"
39
         :sort-data="sortData"
40
         crm-type="customer"
40
         crm-type="customer"
44
         <template slot="custom">
44
         <template slot="custom">
45
           <div>公海:</div>
45
           <div>公海:</div>
46
           <el-select
46
           <el-select
47
-            v-model="poolId"
47
+            v-model="pool_id"
48
             @change="poolChange">
48
             @change="poolChange">
49
             <el-option
49
             <el-option
50
               v-for="item in poolList"
50
               v-for="item in poolList"
51
-              :key="item.poolId"
52
-              :label="item.poolName"
53
-              :value="item.poolId"/>
51
+              :key="item.pool_id"
52
+              :label="item.pool_name"
53
+              :value="item.pool_id"/>
54
           </el-select>
54
           </el-select>
55
         </template>
55
         </template>
56
       </c-r-m-table-head>
56
       </c-r-m-table-head>
109
             <field-set
109
             <field-set
110
               :is-seas="isSeas"
110
               :is-seas="isSeas"
111
               :crm-type="crmType"
111
               :crm-type="crmType"
112
-              :pool-id="poolId"
112
+              :pool_id="pool_id"
113
               @change="setSave"/>
113
               @change="setSave"/>
114
           </template>
114
           </template>
115
         </el-table-column>
115
         </el-table-column>
131
     <customer-detail
131
     <customer-detail
132
       v-if="showDview"
132
       v-if="showDview"
133
       :id="rowID"
133
       :id="rowID"
134
-      :pool-id="poolId"
134
+      :pool_id="pool_id"
135
       :is-seas="isSeas"
135
       :is-seas="isSeas"
136
       class="d-view"
136
       class="d-view"
137
       @handle="handleHandle"
137
       @handle="handleHandle"
165
     return {
165
     return {
166
       crmType: 'customer',
166
       crmType: 'customer',
167
       isSeas: true, // 是公海
167
       isSeas: true, // 是公海
168
-      poolId: '',
168
+      pool_id: '',
169
       poolAuth: {},
169
       poolAuth: {},
170
       poolList: []
170
       poolList: []
171
     }
171
     }
201
     }
201
     }
202
   },
202
   },
203
   watch: {
203
   watch: {
204
-    poolId: {
204
+    pool_id: {
205
       handler(newVal) {
205
       handler(newVal) {
206
         if (newVal) {
206
         if (newVal) {
207
           this.getCustomerPoolAuth(newVal)
207
           this.getCustomerPoolAuth(newVal)
215
     this.getPoolList()
215
     this.getPoolList()
216
   },
216
   },
217
   activated() {
217
   activated() {
218
-    // if (this.isRequested) {
219
-    //   this.getList()
220
-    // }
221
-    this.getFieldList()
218
+    if (this.isRequested) {
219
+      // this.getList()
220
+    }
221
+    // this.getFieldList()
222
   },
222
   },
223
   deactivated() {
223
   deactivated() {
224
     this.$refs.elMenu.activeIndex = 'seas'
224
     this.$refs.elMenu.activeIndex = 'seas'
227
     /**
227
     /**
228
      * 获取公海权限
228
      * 获取公海权限
229
      */
229
      */
230
-    getCustomerPoolAuth(poolId) {
230
+    getCustomerPoolAuth(pool_id) {
231
       crmCustomerPoolQueryAuthAPI({
231
       crmCustomerPoolQueryAuthAPI({
232
-        poolId: poolId
232
+        pool_id: pool_id
233
       })
233
       })
234
         .then(res => {
234
         .then(res => {
235
           this.poolAuth = res.data || {}
235
           this.poolAuth = res.data || {}
236
+          this.getFieldList()
236
         })
237
         })
237
         .catch(() => {
238
         .catch(() => {
238
           // this.poolAuth = { receive: true, excelexport: true, index: true, distribute: true, delete: true }
239
           // this.poolAuth = { receive: true, excelexport: true, index: true, distribute: true, delete: true }
253
       crmCustomerPoolNameListAPI()
254
       crmCustomerPoolNameListAPI()
254
         .then(res => {
255
         .then(res => {
255
           this.poolList = res.data || []
256
           this.poolList = res.data || []
256
-          // this.poolId = this.poolList.length > 0 ? this.poolList[0].poolId : ''
257
-          this.poolId = 1
257
+          this.pool_id = this.poolList.length > 0 ? this.poolList[0].pool_id : ''
258
         })
258
         })
259
         .catch(() => {
259
         .catch(() => {
260
-          this.poolList = [{ 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }]
261
-          this.poolId = 1
262
         })
260
         })
263
     },
261
     },
264
 
262
 

+ 1
- 1
src/views/layout/components/MessageCell.vue View File

35
   },
35
   },
36
   props: {
36
   props: {
37
     data: Object,
37
     data: Object,
38
-    dataIndex: Number
38
+    dataIndex: [String, Number]
39
   },
39
   },
40
   data() {
40
   data() {
41
     return {}
41
     return {}

+ 2
- 1
src/views/oa/components/FileCell/index.vue View File

121
         .then(() => {
121
         .then(() => {
122
           crmFileDeleteAPI({
122
           crmFileDeleteAPI({
123
             id: this.data.file_id,
123
             id: this.data.file_id,
124
-            save_name: this.data.save_name
124
+            save_name: this.data.save_name,
125
+            module: 'work_task'
125
           })
126
           })
126
             .then(res => {
127
             .then(res => {
127
               this.$message.success('操作成功')
128
               this.$message.success('操作成功')

+ 1
- 3
src/views/oa/examine/components/ExamineCategorySelect.vue View File

109
      * 拖拽结束
109
      * 拖拽结束
110
      */
110
      */
111
     draggableEnd() {
111
     draggableEnd() {
112
-      oaAllExamineCategorySortAPI(this.categorys.map(item => {
113
-        return { categoryId: item.categoryId }
114
-      }))
112
+      oaAllExamineCategorySortAPI({ examineIds: this.categorys.map(item => item.category_id) })
115
         .then(res => {})
113
         .then(res => {})
116
         .catch(() => {})
114
         .catch(() => {})
117
     }
115
     }

+ 1
- 1
src/views/oa/notice/NewDialog.vue View File

148
       this.formData = {
148
       this.formData = {
149
         title: this.action.data.title,
149
         title: this.action.data.title,
150
         content: this.action.data.content,
150
         content: this.action.data.content,
151
-        dep: { staff: this.action.data.ownerUserList, dep: this.action.data.deptList }
151
+        dep: { staff: this.action.data.ownerUserList, dep: this.action.data.structureList }
152
       }
152
       }
153
     }
153
     }
154
   },
154
   },

+ 1
- 1
src/views/oa/notice/NoticeDetail.vue View File

32
         </el-dropdown>
32
         </el-dropdown>
33
       </flexbox>
33
       </flexbox>
34
       <div class="detail-title">{{ detail.title }}</div>
34
       <div class="detail-title">{{ detail.title }}</div>
35
-      <div class="detail-time">{{ detail.updateTime }}</div>
35
+      <div class="detail-time">{{ detail.update_time }}</div>
36
       <div class="main__bd">{{ detail.content }}</div>
36
       <div class="main__bd">{{ detail.content }}</div>
37
     </div>
37
     </div>
38
 
38
 

+ 1
- 0
src/views/pm/project/Corver.vue View File

10
       @search="searchClick">
10
       @search="searchClick">
11
       <div slot="ft">
11
       <div slot="ft">
12
         <el-button
12
         <el-button
13
+          v-if="permissonProject"
13
           type="primary"
14
           type="primary"
14
           icon="el-icon-plus"
15
           icon="el-icon-plus"
15
           class="xr-btn--orange"
16
           class="xr-btn--orange"

+ 1
- 1
src/views/pm/task/index.vue View File

398
             fromlist: fromlist.map(item => {
398
             fromlist: fromlist.map(item => {
399
               return item.task_id
399
               return item.task_id
400
             }),
400
             }),
401
-            fromTopId: fromTop,
401
+            from_top_id: fromTop,
402
             tolist: tolist.map(item => {
402
             tolist: tolist.map(item => {
403
               return item.task_id
403
               return item.task_id
404
             }),
404
             }),

+ 104
- 6
src/views/workLog/FollowIndex.vue View File

39
           :label="item.label"
39
           :label="item.label"
40
           :value="item.value" />
40
           :value="item.value" />
41
       </el-select>
41
       </el-select>
42
+      <el-dropdown
43
+        v-if="moreTypes.length > 0"
44
+        trigger="click"
45
+        @command="handleTypeDrop">
46
+        <el-button icon="el-icon-more"/>
47
+        <el-dropdown-menu slot="dropdown">
48
+          <el-dropdown-item
49
+            v-for="(item, index) in moreTypes"
50
+            :key="index"
51
+            :icon="item.icon"
52
+            :command="item.type">{{ item.name }}</el-dropdown-item>
53
+        </el-dropdown-menu>
54
+      </el-dropdown>
42
     </flexbox>
55
     </flexbox>
43
 
56
 
44
     <div
57
     <div
90
 </template>
103
 </template>
91
 
104
 
92
 <script>
105
 <script>
93
-import { crmIndexGetRecordListAPI } from '@/api/crm/workbench'
106
+// import { crmIndexGetRecordListAPI } from '@/api/crm/workbench'
107
+import {
108
+  crmIndexGetRecordListAPI,
109
+  crmInstrumentExportRecordListAPI,
110
+  crmInstrumentImportRecordListAPI,
111
+  crmInstrumentDownloadRecordExcelAPI
112
+} from '@/api/crm/workbench'
113
+import {
114
+  userErrorExcelDownAPI
115
+} from '@/api/admin/employeeDep'
94
 
116
 
95
 import RecordTabHead from './components/RecordTabHead'
117
 import RecordTabHead from './components/RecordTabHead'
96
 import XhUserCell from '@/components/CreateCom/XhUserCell'
118
 import XhUserCell from '@/components/CreateCom/XhUserCell'
99
 import LogEditDialog from '@/views/crm/components/Activity/LogEditDialog'
121
 import LogEditDialog from '@/views/crm/components/Activity/LogEditDialog'
100
 
122
 
101
 import crmTypeModel from '@/views/crm/model/crmTypeModel'
123
 import crmTypeModel from '@/views/crm/model/crmTypeModel'
102
-
124
+import { downloadExcelWithResData } from '@/utils'
125
+import { mapGetters } from 'vuex'
103
 export default {
126
 export default {
104
   // 跟进记录
127
   // 跟进记录
105
   name: 'FollowIndex',
128
   name: 'FollowIndex',
182
         seciton: 0,
205
         seciton: 0,
183
         index: 0
206
         index: 0
184
       },
207
       },
185
-      logEditDialogVisible: false
208
+      logEditDialogVisible: false,
209
+      requestParams: {}
186
     }
210
     }
187
   },
211
   },
188
   computed: {
212
   computed: {
213
+    ...mapGetters(['crm']),
214
+
215
+    followRecordAuth() {
216
+      return this.crm.followRecord
217
+    },
218
+
219
+    moreTypes() {
220
+      const temps = []
221
+      // if (this.followRecordAuth.excelimport) {
222
+      //   temps.push({ type: 'enter', name: '导入', icon: 'wk wk-import' })
223
+      // }
224
+      // if (this.followRecordAuth.excelexport) {
225
+      //   temps.push({ type: 'out', name: '导出', icon: 'wk wk-export' })
226
+      // }
227
+      return temps
228
+    },
189
     // 无线滚动控制
229
     // 无线滚动控制
190
     scrollDisabled() {
230
     scrollDisabled() {
191
       return this.loading || this.noMore
231
       return this.loading || this.noMore
205
   },
245
   },
206
   mounted() {},
246
   mounted() {},
207
 
247
 
208
-  beforeDestroy() {},
248
+  created() {
249
+    // 监听导入
250
+    this.$bus.on('import-crm-done-bus', (type) => {
251
+      console.log(type)
252
+      if (type === 'crmFollowLog') {
253
+        this.refreshList()
254
+      }
255
+    })
256
+  },
257
+  beforeDestroy() {
258
+    this.$bus.off('import-crm-done-bus')
259
+  },
209
   methods: {
260
   methods: {
210
     /**
261
     /**
211
      * 中间tabs改变
262
      * 中间tabs改变
234
         limit: 15,
285
         limit: 15,
235
         isUser: 1,
286
         isUser: 1,
236
         queryType: 0,
287
         queryType: 0,
237
-        label: 2
288
+        label: 0
238
       }
289
       }
239
 
290
 
240
       if (this.timeSelect.type) {
291
       if (this.timeSelect.type) {
249
       if (this.userSelectShow) {
300
       if (this.userSelectShow) {
250
         params = { ...params, ...this.filterForm }
301
         params = { ...params, ...this.filterForm }
251
       } else {
302
       } else {
252
-        // params.label = this.filterForm.crmType
303
+        params.label = this.filterForm.crmType
253
         params.subUser = this.filterForm.subUser
304
         params.subUser = this.filterForm.subUser
254
         params.dataType = this.filterForm.queryType
305
         params.dataType = this.filterForm.queryType
255
         params.search = this.filterForm.search
306
         params.search = this.filterForm.search
256
       }
307
       }
308
+      this.requestParams = params
257
       crmIndexGetRecordListAPI(params)
309
       crmIndexGetRecordListAPI(params)
258
         .then(res => {
310
         .then(res => {
259
           this.loading = false
311
           this.loading = false
332
       if (this.logEditPosition.index >= 0) {
384
       if (this.logEditPosition.index >= 0) {
333
         this.list.splice(this.logEditPosition.index, 1, data)
385
         this.list.splice(this.logEditPosition.index, 1, data)
334
       }
386
       }
387
+    },
388
+    handleTypeDrop(command) {
389
+      if (!this.requestParams.label) {
390
+        this.$message.error('请先选择一个模块导入/导出')
391
+        return
392
+      }
393
+      if (command == 'out') {
394
+        crmInstrumentExportRecordListAPI(this.requestParams)
395
+          .then(res => {
396
+            downloadExcelWithResData(res)
397
+          })
398
+          .catch(() => {})
399
+      } else if (command == 'enter') {
400
+        const labelObj = this.options.find(item => item.value === this.requestParams.label)
401
+        this.$bus.emit('import-crm-bus', 'crmFollowLog', {
402
+          typeName: `${labelObj.label}跟进记录`,
403
+          ownerSelectShow: false,
404
+          repeatHandleShow: false,
405
+          historyShow: false,
406
+          noImportProcess: true,
407
+          importRequest: crmInstrumentImportRecordListAPI, // 导入请求
408
+          importParams: { crmType: this.requestParams.label },
409
+          templateRequest: crmInstrumentDownloadRecordExcelAPI, // 模板请求
410
+          templateParams: { crmType: this.requestParams.label },
411
+          downloadErrFuc: this.getImportError
412
+        })
413
+      }
414
+    },
415
+
416
+    /**
417
+     * 导入错误下载
418
+     */
419
+    getImportError(result) {
420
+      return new Promise((resolve, reject) => {
421
+        userErrorExcelDownAPI({
422
+          token: result.token
423
+        })
424
+          .then(res => {
425
+            resolve(res)
426
+          })
427
+          .catch(() => {
428
+            reject()
429
+          })
430
+      })
335
     }
431
     }
432
+
433
+
336
   }
434
   }
337
 }
435
 }
338
 </script>
436
 </script>