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

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

@@ -171,3 +171,27 @@ export function userErrorExcelDownAPI(data) {
171 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

@@ -0,0 +1,80 @@
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,10 +130,12 @@ export function webFileSaveAPI(data) {
130 130
   var param = new FormData()
131 131
   Object.keys(data).forEach(key => {
132 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 137
   return request({
136
-    url: 'adminFile/upload',
138
+    url: 'admin/file/save',
137 139
     method: 'post',
138 140
     data: param,
139 141
     headers: {
@@ -210,7 +212,7 @@ export function crmFileUpdateAPI(data) {
210 212
  */
211 213
 export function crmFileDownByPathAPI(data) {
212 214
   return request({
213
-    url: 'crmPrint/down',
215
+    url: 'crm/printing/down',
214 216
     method: 'post',
215 217
     data: data,
216 218
     responseType: 'blob'
@@ -330,9 +332,9 @@ export function systemMessageDeleteByIdAPI(data) {
330 332
   })
331 333
 }
332 334
 
333
-export function downloadFileAPI(data) {
335
+export function downloadFileAPI(data, url) {
334 336
   return request({
335
-    url: 'admin/file/download',
337
+    url: `${url || `admin/file/download`}`,
336 338
     method: 'post',
337 339
     data,
338 340
     responseType: 'blob'

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

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

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

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

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

@@ -248,3 +248,49 @@ export function crmIndexUnContactCustomerAPI(data) {
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,7 +18,7 @@ export function oaAllExamineCategoryListAPI(data) {
18 18
  */
19 19
 export function oaAllExamineCategorySortAPI(data) {
20 20
   return request({
21
-    url: 'oaExamineCategory/saveOrUpdateOaExamineSort',
21
+    url: 'oa/examine/examineSort',
22 22
     method: 'post',
23 23
     data: data,
24 24
     headers: {

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

@@ -68,12 +68,12 @@
68 68
           <div class="sections__title">四、请选择公海</div>
69 69
           <div class="content">
70 70
             <div class="user-cell">
71
-              <el-select v-model="poolId" placeholder="请选择">
71
+              <el-select v-model="pool_id" placeholder="请选择">
72 72
                 <el-option
73 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 77
               </el-select>
78 78
             </div>
79 79
           </div>
@@ -153,7 +153,9 @@ import {
153 153
 import {
154 154
   crmCustomerExcelImportAPI,
155 155
   crmCustomerDownloadExcelAPI,
156
-  crmCustomerPoolExcelImportAPI
156
+  crmCustomerPoolExcelImportAPI,
157
+  crmCustomerPoolNameListAPI,
158
+  crmCustomerPoolDownloadExcelAPI
157 159
 } from '@/api/crm/customer'
158 160
 import {
159 161
   crmLeadsExcelImportAPI,
@@ -228,7 +230,7 @@ export default {
228 230
       user: [],
229 231
 
230 232
       // 公海数据
231
-      poolId: '',
233
+      pool_id: '',
232 234
       poolList: [],
233 235
 
234 236
       stepsActive: 1,
@@ -422,7 +424,7 @@ export default {
422 424
       params.file = this.file
423 425
       params.owner_user_id = this.user.length > 0 ? this.user[0].id : ''
424 426
       if (this.config.poolSelectShow) {
425
-        params.poolId = this.poolId
427
+        params.pool_id = this.pool_id
426 428
       }
427 429
 
428 430
       const request = this.config.importRequest || {
@@ -517,12 +519,12 @@ export default {
517 519
     // 下载模板操作
518 520
     download() {
519 521
       const request = this.config.templateRequest || {
520
-        customer: crmCustomerDownloadExcelAPI,
522
+        customer: this.config.poolSelectShow ? crmCustomerPoolDownloadExcelAPI : crmCustomerDownloadExcelAPI,
521 523
         leads: crmLeadsDownloadExcelAPI,
522 524
         contacts: crmContactsDownloadExcelAPI,
523 525
         product: crmProductDownloadExcelAPI
524 526
       }[this.crmType]
525
-      request()
527
+      request({ pool_id: this.config.poolSelectShow && this.pool_id })
526 528
         .then(res => {
527 529
           downloadExcelWithResData(res)
528 530
         })
@@ -571,17 +573,13 @@ export default {
571 573
      * 公海数据
572 574
      */
573 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,6 +296,7 @@ export default {
296 296
      * 删除
297 297
      */
298 298
     deleteDep(index) {
299
+      if (this.disabled) return
299 300
       // 直接 splice ,dataValue watch 的老旧值相同,复制之后新旧值不相同。暂时解决
300 301
       const dataValue = objDeepCopy(this.dataValue)
301 302
       dataValue.splice(index, 1)

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

@@ -33,27 +33,14 @@ export default {
33 33
   },
34 34
   data() {
35 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 46
   computed: {},

+ 1
- 1
src/config.js View File

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

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

@@ -250,7 +250,7 @@ export default {
250 250
      * 获取客户位置提交参数
251 251
      */
252 252
     getCustomerAddressParams(params, dataValue) {
253
-      params['address'] = dataValue.address
253
+      params['address'] = (dataValue.address && dataValue.address.filter(item => item).length > 0)
254 254
         ? dataValue.address
255 255
         : ''
256 256
       params['detail_address'] = dataValue.detail_address
@@ -298,14 +298,19 @@ export default {
298 298
         if (dataValue) {
299 299
           return dataValue
300 300
         }
301
-        delete data[field.field]
302
-        return
301
+        // delete data[field.field]
302
+        return ''
303 303
       } else if (field.form_type == 'datetime') {
304 304
         if (dataValue) {
305 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 316
       return dataValue

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

@@ -150,24 +150,24 @@ export default [
150 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 154
       path: 'customer',
164
-      component: () => import('@/views/admin/crm/customerPool'),
155
+      component: () => import('@/views/admin/crm/customer'),
165 156
       meta: {
166 157
         title: '客户公海规则设置',
167 158
         requiresAuth: true,
168 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 172
       path: 'print-templates',
173 173
       component: () => import('@/views/admin/crm/printTemplates'),
@@ -216,6 +216,39 @@ export default [
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 253
     ...layout({
221 254
       permissions: ['manage', 'other_rule', 'setwelcome']

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

@@ -5,14 +5,14 @@
5 5
       class="detail-recycle-rule__content">
6 6
       <div class="range-rule">
7 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 10
       </div>
11 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 14
         <el-table
15
-          :data="data.levelSetting"
15
+          :data="data.level_setting"
16 16
           border
17 17
           style="width: 100%">
18 18
           <el-table-column
@@ -21,9 +21,9 @@
21 21
             width="180"/>
22 22
           <el-table-column
23 23
             :label="limitDayName"
24
-            prop="limitDay">
24
+            prop="limit_day">
25 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 27
             </template>
28 28
           </el-table-column>
29 29
         </el-table>

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

@@ -28,7 +28,7 @@
28 28
               label-position="top"
29 29
               class="pool-add-items">
30 30
               <el-form-item
31
-                prop="poolName"
31
+                prop="pool_name"
32 32
                 class="pool-add-item pool-add-item__left">
33 33
                 <div
34 34
                   slot="label"
@@ -37,7 +37,7 @@
37 37
                     公海名称
38 38
                   </div>
39 39
                 </div>
40
-                <el-input v-model="baseFrom.poolName" :maxlength="100" />
40
+                <el-input v-model="baseFrom.pool_name" :maxlength="100" />
41 41
               </el-form-item>
42 42
               <el-form-item
43 43
                 prop="adminUsers"
@@ -89,13 +89,13 @@
89 89
             align="stretch">
90 90
             <div class="row-label">前负责人领取规则</div>
91 91
             <div class="row-content">
92
-              <el-radio-group v-model="baseFrom.preOwnerSetting">
92
+              <el-radio-group v-model="baseFrom.before_owner_conf">
93 93
                 <el-radio :label="0">不限制</el-radio>
94 94
                 <el-radio :label="1">限制</el-radio>
95 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 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 99
                 <span>天内不允许领取该客户</span>
100 100
               </div>
101 101
             </div>
@@ -106,13 +106,13 @@
106 106
             align="stretch">
107 107
             <div class="row-label">领取频率规则</div>
108 108
             <div class="row-content">
109
-              <el-radio-group v-model="baseFrom.receiveSetting">
109
+              <el-radio-group v-model="baseFrom.receive_conf">
110 110
                 <el-radio :label="0">不限制</el-radio>
111 111
                 <el-radio :label="1">限制</el-radio>
112 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 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 116
                 <span>个公海客户</span>
117 117
               </div>
118 118
             </div>
@@ -123,13 +123,13 @@
123 123
             align="stretch">
124 124
             <div class="row-label">提醒规则</div>
125 125
             <div class="row-content">
126
-              <el-radio-group v-model="baseFrom.remindSetting">
126
+              <el-radio-group v-model="baseFrom.remind_conf">
127 127
                 <el-radio :label="0">不提醒</el-radio>
128 128
                 <el-radio :label="1">提醒</el-radio>
129 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 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 133
                 <span>天提醒负责人</span>
134 134
               </div>
135 135
             </div>
@@ -140,14 +140,14 @@
140 140
             align="stretch">
141 141
             <div class="row-label">收回规则</div>
142 142
             <div class="row-content">
143
-              <el-radio-group v-model="baseFrom.putInRule">
143
+              <el-radio-group v-model="baseFrom.recycle_conf">
144 144
                 <el-radio :label="1">自动回收</el-radio>
145 145
                 <el-radio :label="0">不自动回收</el-radio>
146 146
               </el-radio-group>
147 147
             </div>
148 148
           </flexbox>
149 149
 
150
-          <template v-if="baseFrom.putInRule == 1">
150
+          <template v-if="baseFrom.recycle_conf == 1">
151 151
             <recycle-rule
152 152
               v-for="(item, index) in recycleRuleData"
153 153
               :key="index"
@@ -172,7 +172,7 @@
172 172
                   <el-checkbox
173 173
                     v-for="(item, index) in customerPoolFields"
174 174
                     :key="index"
175
-                    v-model="item.isHidden"
175
+                    v-model="item.is_hidden"
176 176
                     :true-label="0"
177 177
                     :false-label="1">{{ item.name }}</el-checkbox>
178 178
                 </flexbox>
@@ -251,7 +251,7 @@ export default {
251 251
       loading: false,
252 252
       baseFrom: null,
253 253
       baseRules: {
254
-        poolName: [
254
+        pool_name: [
255 255
           { required: true, message: '请输入公海名称', trigger: 'blur' }
256 256
         ],
257 257
         adminUsers: [
@@ -265,9 +265,9 @@ export default {
265 265
       levelCustomerName: [], // 客户级别数据源
266 266
       customerPoolFields: [],
267 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,7 +309,7 @@ export default {
309 309
     getDetail() {
310 310
       this.loading = true
311 311
       crmCustomerPoolSetDetailAPI({
312
-        poolId: this.action.id
312
+        pool_id: this.action.id
313 313
       }).then(res => {
314 314
         this.getEditInfo(res.data)
315 315
         this.loading = false
@@ -319,20 +319,25 @@ export default {
319 319
     },
320 320
 
321 321
     getEditInfo(data) {
322
+      if (data.user_info) {
323
+        data.user_info.forEach(item => {
324
+          item.type = 'user'
325
+        })
326
+      }
322 327
       this.baseFrom = {
323
-        poolName: data.poolName,
324
-        adminUsers: data.adminUser,
328
+        pool_name: data.pool_name,
329
+        adminUsers: data.admin_user_info,
325 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 343
       this.recycleRuleData = this.getEditRule(data.rule)
@@ -345,23 +350,23 @@ export default {
345 350
       const baseRule = [
346 351
         {
347 352
           type: '',
348
-          dealHandle: 1,
349
-          businessHandle: 1,
350
-          customerLevelSetting: 1,
353
+          deal_handle: 0,
354
+          business_handle: 0,
355
+          level_conf: 1,
351 356
           level: []
352 357
         },
353 358
         {
354 359
           type: '',
355
-          dealHandle: 1,
356
-          businessHandle: 1,
357
-          customerLevelSetting: 1,
360
+          deal_handle: 0,
361
+          business_handle: 0,
362
+          level_conf: 1,
358 363
           level: []
359 364
         },
360 365
         {
361 366
           type: '',
362
-          dealHandle: 1,
363
-          businessHandle: 1,
364
-          customerLevelSetting: 1,
367
+          deal_handle: 0,
368
+          business_handle: 0,
369
+          level_conf: 1,
365 370
           level: []
366 371
         }
367 372
       ]
@@ -369,7 +374,7 @@ export default {
369 374
       if (detailRule) {
370 375
         for (let index = 0; index < detailRule.length; index++) {
371 376
           const element = detailRule[index]
372
-          element.level = element.levelSetting
377
+          element.level = element.level_setting
373 378
           baseRule.splice(element.type - 1, 1, element)
374 379
         }
375 380
       }
@@ -382,19 +387,19 @@ export default {
382 387
      */
383 388
     getCreateInfo() {
384 389
       this.baseFrom = {
385
-        poolName: '',
390
+        pool_name: '',
386 391
         adminUsers: [],
387 392
         memberUsers: {
388 393
           users: [],
389 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 405
       this.recycleRuleData = this.getEditRule()
@@ -410,10 +415,18 @@ export default {
410 415
      */
411 416
     getCustomerPoolFields(allFields) {
412 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 427
           const list = res.data || []
415 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 430
             return item
418 431
           })
419 432
           if (allFields) {
@@ -436,16 +449,16 @@ export default {
436 449
 
437 450
         for (let editIndex = 0; editIndex < allFields.length; editIndex++) {
438 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 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,7 +516,7 @@ export default {
503 516
      */
504 517
     uploadPoolSet(params) {
505 518
       if (this.isEdit) {
506
-        params.poolId = this.action.id
519
+        params.pool_id = this.action.id
507 520
       }
508 521
       this.loading = true
509 522
       crmCustomerPoolSetAPI(params).then(res => {
@@ -520,11 +533,11 @@ export default {
520 533
      * 必填字段验证
521 534
      */
522 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 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 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 541
         return false
529 542
       }
530 543
 
@@ -544,17 +557,17 @@ export default {
544 557
         } else {
545 558
           if (key == 'adminUsers') {
546 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 562
             }).join(',')
550 563
           } else if (key == 'memberUsers') {
551 564
             const memberUserObj = this.baseFrom.memberUsers || {}
552 565
             const adminUsers = memberUserObj.users || []
553 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 569
             }).join(',')
557
-            params.memberDeptId = adminStrucs.map(item => {
570
+            params.department_ids = adminStrucs.map(item => {
558 571
               return item.id
559 572
             }).join(',')
560 573
           } else {
@@ -564,7 +577,7 @@ export default {
564 577
       }
565 578
 
566 579
       // 收回规则 1 自动收回
567
-      if (this.baseFrom.putInRule == 1) {
580
+      if (this.baseFrom.recycle_conf == 1) {
568 581
         const ruleVerify = this.recycleRuleData.filter(item => {
569 582
           return item.type
570 583
         })
@@ -583,7 +596,7 @@ export default {
583 596
             const newLevel = []
584 597
             for (let levelIndex = 0; levelIndex < ruleItem.level.length; levelIndex++) {
585 598
               const levelItem = ruleItem.level[levelIndex]
586
-              if (levelItem.limitDay && levelItem.limitDay > 0) {
599
+              if (levelItem.limit_day && levelItem.limit_day > 0) {
587 600
                 rulePass = true
588 601
                 newLevel.push(levelItem)
589 602
               }
@@ -604,7 +617,7 @@ export default {
604 617
       }
605 618
 
606 619
       const showFields = this.customerPoolFields.filter(item => {
607
-        return item.isHidden == 0
620
+        return item.is_hidden == 0
608 621
       })
609 622
 
610 623
       if (showFields.length < 2) {

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

@@ -17,11 +17,11 @@
17 17
         </div>
18 18
         <div>
19 19
           <div class="header-title">公海名称</div>
20
-          <div class="header-name">{{ detail.poolName }}</div>
20
+          <div class="header-name">{{ detail.pool_name }}</div>
21 21
         </div>
22 22
 
23 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 25
         </span>
26 26
       </flexbox>
27 27
       <flexbox
@@ -31,7 +31,7 @@
31 31
           <div class="label">公海管理员</div>
32 32
           <div class="value">
33 33
             <xr-avatar
34
-              v-for="(item, index) in detail.adminUser"
34
+              v-for="(item, index) in detail.admin_user_info"
35 35
               :key="`admin${index}`"
36 36
               :name="item.realname"
37 37
               :size="32"
@@ -42,13 +42,13 @@
42 42
           <div class="label">公海成员</div>
43 43
           <div class="value">
44 44
             <xr-avatar
45
-              v-for="(item, index) in detail.memberUser"
45
+              v-for="(item, index) in detail.user_info"
46 46
               :key="`member${index}`"
47 47
               :name="item.realname"
48 48
               :size="32"
49 49
               :src="item.img || item.thumb_img" />
50 50
             <xr-avatar
51
-              v-for="(item, index) in detail.memberDept"
51
+              v-for="(item, index) in detail.department_info"
52 52
               :title="`dept${index}`"
53 53
               :key="`dept${index}`"
54 54
               :name="item.name"
@@ -63,25 +63,25 @@
63 63
             align="stretch"
64 64
             class="rule-item">
65 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 67
           </flexbox>
68 68
           <flexbox
69 69
             align="stretch"
70 70
             class="rule-item">
71 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 73
           </flexbox>
74 74
           <flexbox
75 75
             align="stretch"
76 76
             class="rule-item">
77 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 79
           </flexbox>
80 80
           <flexbox
81 81
             align="stretch"
82 82
             class="rule-item">
83 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 85
             <div v-else class="value rule-value">
86 86
               <detail-recycle-rule
87 87
                 v-for="(item, index) in detail.rule"
@@ -121,7 +121,7 @@ export default {
121 121
   filters: {
122 122
     fieldNameFilter(list) {
123 123
       return list.filter(item => {
124
-        return item.isHidden === 0
124
+        return item.is_hidden === 0
125 125
       }).map(item => {
126 126
         return item.name
127 127
       }).join(',')
@@ -158,7 +158,7 @@ export default {
158 158
     getDetail() {
159 159
       this.loading = true
160 160
       crmCustomerPoolSetDetailAPI({
161
-        poolId: this.id
161
+        pool_id: this.id
162 162
       }).then(res => {
163 163
         this.detail = res.data
164 164
         this.loading = false

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

@@ -12,9 +12,9 @@
12 12
         <el-select v-model="selectId" >
13 13
           <el-option
14 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 18
         </el-select>
19 19
       </flexbox>
20 20
     </div>
@@ -62,14 +62,14 @@ export default {
62 62
   computed: {
63 63
     list() {
64 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 69
   watch: {
70 70
     list: {
71 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 74
       immediate: true
75 75
     },
@@ -89,9 +89,9 @@ export default {
89 89
       const loading = Loading.service({
90 90
         target: document.querySelector(`.el-dialog[aria-label="转移"]`)
91 91
       })
92
-      crmCustomerPoolSetNameListAPI()
92
+      crmCustomerPoolSetNameListAPI({ limit: 9999 })
93 93
         .then(res => {
94
-          this.allList = res.data || []
94
+          this.allList = res.data.list || []
95 95
           loading && loading.close()
96 96
         })
97 97
         .catch(() => {
@@ -115,8 +115,8 @@ export default {
115 115
           target: document.querySelector(`.el-dialog[aria-label="转移"]`)
116 116
         })
117 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 121
           .then(res => {
122 122
             this.$message({

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

@@ -10,9 +10,9 @@
10 10
         <span class="check-label">选择不进入公海客户</span>
11 11
         <el-checkbox
12 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 16
             content="已成交是指客户状态为“已成交”"
17 17
             effect="dark"
18 18
             placement="top">
@@ -20,12 +20,12 @@
20 20
         </el-tooltip></el-checkbox>
21 21
         <el-checkbox
22 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 26
       </div>
27 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 29
         <el-table
30 30
           :data="allCustomerData"
31 31
           border
@@ -36,10 +36,10 @@
36 36
             width="180"/>
37 37
           <el-table-column
38 38
             :label="limitDayName"
39
-            prop="limitDay">
39
+            prop="limit_day">
40 40
             <template slot-scope="scope">
41 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 43
               <span>天{{ limitDayUnit }},进入公海</span>
44 44
             </template>
45 45
           </el-table-column>
@@ -47,7 +47,7 @@
47 47
       </div>
48 48
 
49 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 51
         <el-table
52 52
           :data="levelCustomerData"
53 53
           border
@@ -58,10 +58,10 @@
58 58
             width="180"/>
59 59
           <el-table-column
60 60
             :label="limitDayName"
61
-            prop="limitDay">
61
+            prop="limit_day">
62 62
             <template slot-scope="scope">
63 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 65
               <span>天{{ limitDayUnit }},进入公海</span>
66 66
             </template>
67 67
           </el-table-column>
@@ -86,16 +86,16 @@ export default {
86 86
       default: () => {
87 87
         /**
88 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 91
         "level":1, // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先  客户)
92
-        "limitDay":30 // 公海规则限制天数
92
+        "limit_day":30 // 公海规则限制天数
93 93
          */
94 94
         return {
95 95
           type: '',
96
-          dealHandle: 1,
97
-          businessHandle: 1,
98
-          customerLevelSetting: null,
96
+          deal_handle: 0,
97
+          business_handle: 0,
98
+          level_conf: null,
99 99
           level: []
100 100
         }
101 101
       }
@@ -111,7 +111,7 @@ export default {
111 111
     return {
112 112
       allCustomerData: [{
113 113
         level: '所有客户', // 客户级别 1全部 2 A(重要客户)3 B(普通客户)4 C(非优先客户)
114
-        limitDay: ''
114
+        limit_day: ''
115 115
       }],
116 116
       levelCustomerData: []
117 117
     }
@@ -149,7 +149,7 @@ export default {
149 149
     }
150 150
   },
151 151
   watch: {
152
-    'data.customerLevelSetting': {
152
+    'data.level_conf': {
153 153
       handler(val, oldVal) {
154 154
         if (val == 1) {
155 155
           if (this.isEdit && oldVal == null) {
@@ -175,14 +175,14 @@ export default {
175 175
         if (value && value.length) {
176 176
           this.levelCustomerData = value.map(item => {
177 177
             const obj = {
178
-              limitDay: ''
178
+              limit_day: ''
179 179
             }
180 180
             obj.level = item
181 181
             return obj
182 182
           })
183 183
 
184 184
           // 类型是2
185
-          if (this.data.customerLevelSetting == 2) {
185
+          if (this.data.level_conf == 2) {
186 186
             if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) {
187 187
               this.data.level = this.getEditData(this.levelCustomerData, this.data.level)
188 188
             }
@@ -202,7 +202,7 @@ export default {
202 202
         for (let editIndex = 0; editIndex < editList.length; editIndex++) {
203 203
           const editItem = editList[editIndex]
204 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,7 +214,7 @@ export default {
214 214
      * 阻挡输入
215 215
      */
216 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,22 +27,22 @@
27 27
         @row-click="handleRowClick">
28 28
         <el-table-column
29 29
           show-overflow-tooltip
30
-          prop="poolName"
30
+          prop="pool_name"
31 31
           width="150"
32 32
           label="公海名称"/>
33 33
         <el-table-column
34 34
           :formatter="fieldFormatter"
35 35
           show-overflow-tooltip
36
-          prop="adminUser"
36
+          prop="admin_user_names"
37 37
           label="公海管理员"/>
38 38
         <el-table-column
39 39
           :formatter="fieldFormatter"
40 40
           show-overflow-tooltip
41
-          prop="memberUser"
41
+          prop="user_names"
42 42
           label="公海成员"/>
43 43
         <el-table-column
44 44
           show-overflow-tooltip
45
-          prop="customerNum"
45
+          prop="customer_count"
46 46
           width="100"
47 47
           label="客户数量"/>
48 48
         <el-table-column
@@ -188,7 +188,7 @@ export default {
188 188
       })
189 189
         .then(res => {
190 190
           this.list = res.data.list
191
-          this.total = res.data.totalRow
191
+          this.total = res.data.count
192 192
           this.loading = false
193 193
         })
194 194
         .catch(() => {
@@ -200,34 +200,35 @@ export default {
200 200
      * 格式化字段
201 201
      */
202 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 232
         if (row.status === 0) {
232 233
           return '停用'
233 234
         }
@@ -240,7 +241,7 @@ export default {
240 241
      * 通过回调控制class
241 242
      */
242 243
     cellClassName({ row, column, rowIndex, columnIndex }) {
243
-      if (column.property === 'poolName') {
244
+      if (column.property === 'pool_name') {
244 245
         return 'can-visit--underline'
245 246
       } else {
246 247
         return ''
@@ -262,8 +263,8 @@ export default {
262 263
      * 当某一行被点击时会触发该事件
263 264
      */
264 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 268
         this.detailShow = true
268 269
       }
269 270
     },
@@ -275,12 +276,12 @@ export default {
275 276
       if (type === 'edit') {
276 277
         this.createAction = {
277 278
           type: 'update',
278
-          id: scope.row.poolId,
279
+          id: scope.row.pool_id,
279 280
           data: scope.row
280 281
         }
281 282
         this.createShow = true
282 283
       } else if (type === 'transfer') {
283
-        this.detailId = scope.row.poolId
284
+        this.detailId = scope.row.pool_id
284 285
         this.transferShow = true
285 286
       } else if (type === 'delete') {
286 287
         this.$confirm('您确定要删除吗?', '提示', {
@@ -290,7 +291,7 @@ export default {
290 291
         })
291 292
           .then(() => {
292 293
             crmCustomerPoolSetDeleteAPI({
293
-              poolId: scope.row.poolId
294
+              pool_id: scope.row.pool_id
294 295
             })
295 296
               .then(res => {
296 297
                 this.list.splice(scope.$index, 1)
@@ -319,7 +320,7 @@ export default {
319 320
         )
320 321
           .then(() => {
321 322
             crmCustomerPoolSetChangeStatusAPI({
322
-              poolId: scope.row.poolId,
323
+              pool_id: scope.row.pool_id,
323 324
               status: scope.row.status === 0 ? 1 : 0
324 325
             })
325 326
               .then(res => {

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

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

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

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

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

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

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

@@ -0,0 +1,129 @@
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,7 +34,7 @@
34 34
                 <i
35 35
                   :class="item.icon"
36 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 38
               </flexbox>
39 39
             </div>
40 40
           </div>
@@ -86,13 +86,27 @@
86 86
           justify="space-between"
87 87
           class="table-top">
88 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 97
             <reminder
91 98
               v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'"
92 99
               class="all-user-reminder"
93 100
               content="未添加部门和角色的员工无法正常登录系统" />
94 101
           </div>
95 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 110
             <el-button
97 111
               v-if="userSaveAuth"
98 112
               type="text"
@@ -145,14 +159,16 @@
145 159
               width="55" />
146 160
             <el-table-column
147 161
               prop="realname"
148
-              width="100"
162
+              width="150"
149 163
               show-overflow-tooltip
150 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 172
               </template>
157 173
             </el-table-column>
158 174
             <el-table-column
@@ -217,6 +233,14 @@
217 233
             :value="item.id" />
218 234
         </el-select>
219 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 244
       <span
221 245
         slot="footer"
222 246
         class="dialog-footer">
@@ -402,7 +426,8 @@
402 426
           <template v-if="item.type == 'select'">
403 427
             <el-select
404 428
               v-model="formInline[item.field]"
405
-              filterable>
429
+              filterable
430
+              @change="addUserSelectChange(item)">
406 431
               <el-option
407 432
                 v-for="optionItem in optionsList[item.field].list"
408 433
                 :key="optionItem.id"
@@ -459,6 +484,13 @@
459 484
       :visible.sync="editRoleDialogShow"
460 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 494
   </div>
463 495
 </template>
464 496
 
@@ -473,7 +505,8 @@ import {
473 505
   adminUsersUpdatePwdAPI,
474 506
   adminUsersUsernameEditAPI,
475 507
   adminUsersManagerUsernameEditAPI,
476
-  usersEditStatusAPI
508
+  usersEditStatusAPI,
509
+  adminUserCountNumOfUserAPI
477 510
 } from '@/api/admin/employeeDep'
478 511
 
479 512
 import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' // 直属上级接口
@@ -487,6 +520,8 @@ import XrHeader from '@/components/XrHeader'
487 520
 import Reminder from '@/components/Reminder'
488 521
 import SlideVerify from '@/components/SlideVerify'
489 522
 import EditRoleDialog from './components/EditRoleDialog'
523
+import WkUserSelect from '@/components/NewCom/WkUserSelect'
524
+import EditDepDialog from './components/EditDepDialog'
490 525
 
491 526
 import { chinaMobileRegex, objDeepCopy } from '@/utils'
492 527
 
@@ -499,7 +534,9 @@ export default {
499 534
     XrHeader,
500 535
     Reminder,
501 536
     SlideVerify,
502
-    EditRoleDialog
537
+    EditRoleDialog,
538
+    EditDepDialog,
539
+    WkUserSelect
503 540
   },
504 541
   data() {
505 542
     return {
@@ -507,27 +544,42 @@ export default {
507 544
         {
508 545
           icon: 'wk wk-employees',
509 546
           label: '所有员工',
510
-          type: 'all'
547
+          type: 'all',
548
+          field: 'allUserCount',
549
+          count: 0,
550
+          tips: '未添加部门和角色的员工无法正常登录系统'
511 551
         },
512 552
         {
513 553
           icon: 'wk wk-new-employee',
514 554
           label: '新加入的员工',
515
-          type: 'new'
555
+          type: 'new',
556
+          field: 'addNewlyCount',
557
+          count: 0,
558
+          tips: '入职7天内的员工'
516 559
         },
517 560
         {
518 561
           icon: 'wk wk-active-employee',
519 562
           label: '激活员工',
520
-          type: 'active'
563
+          type: 'active',
564
+          field: 'activateCount',
565
+          count: 0,
566
+          tips: '已经登录系统的员工'
521 567
         },
522 568
         {
523 569
           icon: 'wk wk-inactive-employee',
524 570
           label: '未激活员工',
525
-          type: 'inactive'
571
+          type: 'inactive',
572
+          field: 'inactiveCount',
573
+          count: 0,
574
+          tips: '未登录过系统的员工'
526 575
         },
527 576
         {
528 577
           icon: 'wk wk-disable-employees',
529 578
           label: '停用员工',
530
-          type: 'disable'
579
+          type: 'disable',
580
+          field: 'disableCount',
581
+          count: 0,
582
+          tips: '已禁用的员工,无法登录系统'
531 583
         }
532 584
       ],
533 585
       // 右边导航
@@ -536,6 +588,7 @@ export default {
536 588
       depSelect: '',
537 589
       // 上级部门
538 590
       superDepList: [],
591
+      depOwnerUserId: '', // 部门负责人
539 592
       depCreateLabel: '',
540 593
       allDepData: [], // 包含全部部门信息
541 594
       showDepData: [],
@@ -569,6 +622,7 @@ export default {
569 622
           width: '150'
570 623
         }
571 624
       ],
625
+      isNeedChild: 1, // 是否展示子级部门 0不需要 1 需要
572 626
       selectionList: [], // 批量勾选数据
573 627
       tableData: [],
574 628
       tableHeight: document.documentElement.clientHeight - 240, // 表的高度
@@ -673,7 +727,10 @@ export default {
673 727
       bulkImportShow: false,
674 728
       // 角色操作
675 729
       editRoleType: '',
676
-      editRoleDialogShow: false
730
+      editRoleDialogShow: false,
731
+      userTotal: 0, // 当前下总数,
732
+      editDepDialogShow: false
733
+
677 734
     }
678 735
   },
679 736
   computed: {
@@ -787,7 +844,11 @@ export default {
787 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 853
       return temps
793 854
     },
@@ -828,6 +889,12 @@ export default {
828 889
      */
829 890
     canSlideVerify() {
830 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 900
   mounted() {
@@ -841,13 +908,43 @@ export default {
841 908
     this.currentMenuData = this.employeeMenu[0]
842 909
     this.getDepTreeList()
843 910
     this.getUserList()
911
+    this.getUserCount()
844 912
   },
845 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 945
     changeDepClick(data) {
850 946
       this.currentMenuData = data
947
+      this.userTotal = data.count
851 948
       // this.structureValue = data.id
852 949
       this.refreshUserList()
853 950
     },
@@ -857,6 +954,7 @@ export default {
857 954
      */
858 955
     changeUserClick(data) {
859 956
       // this.structureValue = ''
957
+      this.userTotal = data.count
860 958
       this.currentMenuData = data
861 959
       this.refreshUserList()
862 960
     },
@@ -879,7 +977,9 @@ export default {
879 977
         limit: this.pageSize,
880 978
         search: this.searchInput
881 979
       }
882
-
980
+      if (this.isDepUserShow) {
981
+        params.isNeedChild = this.isNeedChild
982
+      }
883 983
       if (this.currentMenuData) {
884 984
         // 员工有type值
885 985
         if (this.currentMenuData.type) {
@@ -959,7 +1059,10 @@ export default {
959 1059
         structure_id:
960 1060
           this.currentMenuData && this.currentMenuData.id
961 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 1067
       this.employeeCreateDialog = true
965 1068
     },
@@ -1036,6 +1139,7 @@ export default {
1036 1139
         this.depCreateLabelValue = ''
1037 1140
         this.depCreateLabel = '新增部门'
1038 1141
         this.depCreateTitle = '新增部门'
1142
+        this.depOwnerUserId = ''
1039 1143
         this.depSelect = id
1040 1144
         this.getStructuresListBySuperior({ id: id, type: 'save' })
1041 1145
         this.depCreateDialog = true
@@ -1084,6 +1188,7 @@ export default {
1084 1188
       this.depCreateLabelValue = data.label
1085 1189
       this.treeEditId = data.id
1086 1190
       this.depSelect = data.pid
1191
+      this.depOwnerUserId = data.owner_user_id
1087 1192
       this.depCreateTitle = '编辑部门'
1088 1193
       this.depCreateLabel = '编辑部门'
1089 1194
       this.getStructuresListBySuperior({ id: data.id, type: 'update' })
@@ -1126,7 +1231,7 @@ export default {
1126 1231
     // 新增或编辑确定按钮
1127 1232
     submitDialog() {
1128 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 1235
           res => {
1131 1236
             this.getDepList() // 增加了新部门 刷新数据
1132 1237
             this.getDepTreeList()
@@ -1137,7 +1242,8 @@ export default {
1137 1242
         depEditAPI({
1138 1243
           name: this.depCreateLabelValue,
1139 1244
           id: this.treeEditId,
1140
-          pid: this.depSelect
1245
+          pid: this.depSelect,
1246
+          owner_user_id: this.depOwnerUserId
1141 1247
         }).then(res => {
1142 1248
           this.$message.success('操作成功')
1143 1249
           this.getDepTreeList()
@@ -1309,7 +1415,7 @@ export default {
1309 1415
                   })
1310 1416
                 : []
1311 1417
             } else if (element.field === 'parent_id') {
1312
-              detail.parent_id = this.dialogData.parent_id
1418
+              detail.parent_id = this.dialogData.parent_id || ''
1313 1419
             } else if (element.field === 'structure_id') {
1314 1420
               detail.structure_id = this.dialogData.structure_id
1315 1421
             } else {
@@ -1323,6 +1429,8 @@ export default {
1323 1429
       } else if (type === 'editRole' || type === 'copyRole') {
1324 1430
         this.editRoleType = type
1325 1431
         this.editRoleDialogShow = true
1432
+      } else if (type === 'editDep') {
1433
+        this.editDepDialogShow = true
1326 1434
       }
1327 1435
     },
1328 1436
     // 重置密码 -- 关闭按钮
@@ -1692,9 +1800,8 @@ export default {
1692 1800
 // .status > span {
1693 1801
 //   margin-right: 10px;
1694 1802
 // }
1695
-
1696 1803
 .status-name {
1697
-  div {
1804
+  .status-mark {
1698 1805
     display: inline-block;
1699 1806
     width: 6px;
1700 1807
     height: 6px;
@@ -1702,7 +1809,31 @@ export default {
1702 1809
   }
1703 1810
   color: $xr-color-primary;
1704 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 1838
 .employee-dep-management /deep/ .el-dialog__wrapper {
1708 1839
   margin-top: 60px !important;
@@ -1737,6 +1868,9 @@ export default {
1737 1868
 }
1738 1869
 .nav-dialog-div {
1739 1870
   margin-bottom: 20px;
1871
+  .wk-user-select {
1872
+    flex: 1;
1873
+  }
1740 1874
 }
1741 1875
 .nav-dialog-div {
1742 1876
   .el-input,

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

@@ -0,0 +1,263 @@
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

@@ -0,0 +1,275 @@
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

@@ -0,0 +1,240 @@
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

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

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

@@ -16,10 +16,12 @@
16 16
     <div class="content">
17 17
       <el-table
18 18
         id="crm-table"
19
-        :data="newList"
19
+        ref="tableRef"
20
+        :data="list"
20 21
         :height="tableHeight"
21
-        :span-method="objectSpanMethod"
22
-        :cell-style="cellStyle"
22
+        :cell-class-name="cellClassName"
23
+        :summary-method="getSummaries"
24
+        show-summary
23 25
         border
24 26
         @row-click="handleRowClick">
25 27
         <el-table-column
@@ -31,277 +33,172 @@
31 33
           header-align="center"
32 34
           show-overflow-tooltip/>
33 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 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 58
   </div>
51 59
 </template>
52
-
53 60
 <script>
54 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 66
 import BaseMixin from '../mixins/Base'
60
-import { floatAdd } from '@/utils'
61 67
 
62 68
 export default {
63 69
   /** 产品销售情况统计 */
64 70
   name: 'ProductStatistics',
65 71
   components: {
66
-    ContractDetail,
67
-    CustomerDetail,
68
-    ProductDetail
72
+    ReportList
69 73
   },
70 74
   mixins: [BaseMixin],
71 75
   data() {
72 76
     return {
73 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 83
       postParams: {}, // 筛选参数
76 84
 
77 85
       headFieldList: [
78 86
         { field: 'category_id_info', name: '产品分类', width: '115px' },
79 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 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 118
   computed: {},
99 119
   mounted() {
100
-    var self = this
101 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 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 168
     getProductDatalist(params) {
180
-      this.postParams = params
169
+      if (params) {
170
+        this.postParams = params
171
+      }
181 172
       this.loading = true
182
-      biProductStatisticsAPI(params)
173
+      biProductStatisticsAPI({
174
+        ...this.postParams,
175
+        page: this.currentPage,
176
+        limit: this.pageSize
177
+      })
183 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 185
           this.loading = false
193 186
         })
194 187
         .catch(() => {
195 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,5 +274,6 @@ export default {
377 274
   tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] {
378 275
     border-right: 0 none !important;
379 276
   }
277
+   overflow:visible !important;
380 278
 }
381 279
 </style>

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

@@ -325,9 +325,9 @@ export default {
325 325
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
326 326
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
327 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 331
       return tempsTabs
332 332
     },
333 333
 

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

@@ -165,7 +165,7 @@ export default {
165 165
   props: {
166 166
     // 模块ID
167 167
     id: [String, Number],
168
-    poolId: [String, Number],
168
+    pool_id: [String, Number],
169 169
     detail: {
170 170
       type: Object,
171 171
       default: () => {
@@ -244,8 +244,8 @@ export default {
244 244
       }
245 245
 
246 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 251
       filedGetInformationAPI(params)

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

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

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

@@ -224,7 +224,7 @@ export default {
224 224
   props: {
225 225
     // 模块ID
226 226
     id: [String, Number],
227
-    poolId: [String, Number],
227
+    pool_id: [String, Number],
228 228
     isSeas: {
229 229
       type: Boolean,
230 230
       default: false
@@ -332,8 +332,8 @@ export default {
332 332
       }
333 333
 
334 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 339
       filedGetInformationAPI(params)
@@ -773,7 +773,8 @@ export default {
773 773
           } else {
774 774
             var validatesParams = {
775 775
               field: item.field,
776
-              types: 'crm_' + this.crmType
776
+              types: 'crm_' + this.crmType,
777
+              id: this.id
777 778
             }
778 779
             validatesParams.fieldId = item.fieldId
779 780
             if (isArray(value)) {

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

@@ -127,7 +127,7 @@ export default {
127 127
   },
128 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 131
       this.moreTypes.push({ type: 'enter', name: '导入', icon: 'import' })
132 132
     }
133 133
     if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) {

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

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

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

@@ -77,7 +77,7 @@ export default {
77 77
   },
78 78
   props: {
79 79
     id: [Number, String],
80
-    poolId: [Number, String],
80
+    pool_id: [Number, String],
81 81
     contactsId: [Number, String],
82 82
     crmType: {
83 83
       required: true,
@@ -189,8 +189,8 @@ export default {
189 189
       }
190 190
 
191 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 196
       filedGetInformationAPI(params)

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

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

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

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

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

@@ -18,9 +18,9 @@
18 18
           @change="getDetail">
19 19
           <el-option
20 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 24
         </el-select>
25 25
         <span class="select-label">选择模版</span>
26 26
         <el-select
@@ -146,7 +146,7 @@ export default {
146 146
           this.templateOptions = res.data.list || []
147 147
           if (this.$route.query.type != 'history') {
148 148
             if (this.templateOptions.length) {
149
-              this.templateId = this.templateOptions[0].templateId
149
+              this.templateId = this.templateOptions[0].id
150 150
               this.getDetail()
151 151
             } else {
152 152
               this.templateId = ''
@@ -166,8 +166,9 @@ export default {
166 166
     getDetail() {
167 167
       this.loading = true
168 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 173
         .then(res => {
173 174
           this.loading = false
@@ -184,17 +185,18 @@ export default {
184 185
     getRecordDetail() {
185 186
       this.loading = true
186 187
       printRecordDetailAPI({
187
-        recordId: this.$route.query.recordId
188
+        record_id: this.$route.query.id,
189
+        type: 20
188 190
       })
189 191
         .then(res => {
190 192
           this.loading = false
191 193
           const data = res.data || {}
192 194
           this.historyData = data
193
-          this.templateId = data.templateId
195
+          this.templateId = data.template_id
194 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 201
         .catch(() => {
200 202
           this.loading = false
@@ -221,8 +223,8 @@ export default {
221 223
         .then(res => {
222 224
           this.loading = false
223 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 228
             this.iframeUrl = window.URL.createObjectURL(res.data)
227 229
           }).catch(() => {})
228 230
 
@@ -240,9 +242,10 @@ export default {
240 242
     savePrintRecord() {
241 243
       if (this.templateId && this.typeId) {
242 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 250
           .then(res => {
248 251
           })

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

@@ -54,8 +54,8 @@ export default {
54 54
       nopermission: false,
55 55
       list: [],
56 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 60
       tableHeight: '450px'
61 61
     }
@@ -90,7 +90,7 @@ export default {
90 90
         .then(res => {
91 91
           this.nopermission = false
92 92
           this.loading = false
93
-          this.list = res.data
93
+          this.list = res.data.list
94 94
         })
95 95
         .catch(res => {
96 96
           if (res.code == 102) {
@@ -101,7 +101,7 @@ export default {
101 101
     },
102 102
 
103 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 105
       window.open(routeData.href, '_blank')
106 106
     }
107 107
   }

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

@@ -189,6 +189,7 @@ import VDistpicker from '@/components/VDistpicker'
189 189
 
190 190
 import { objDeepCopy } from '@/utils'
191 191
 import AdvancedFilterMixin from '@/mixins/AdvancedFilter'
192
+import { isArray } from '@/utils/types'
192 193
 
193 194
 /**
194 195
  * fieldList: 高级筛选的字段
@@ -312,15 +313,16 @@ export default {
312 313
                 item.value = []
313 314
                 this.getProductCategoryValue(item, element.value[0])
314 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 323
               } else {
322 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 328
               this.form.push(item)
@@ -386,7 +388,7 @@ export default {
386 388
           const users = res.data || []
387 389
           for (let index = 0; index < users.length; index++) {
388 390
             const user = users[index]
389
-            if (user.userId == id) {
391
+            if (user.id == id) {
390 392
               item.value = [user]
391 393
               break
392 394
             }
@@ -776,6 +778,8 @@ export default {
776 778
           if (typeof o.value === 'string') {
777 779
             const temp = o.value.replace(/;/g, ';')
778 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 783
           } else {
780 784
             value = [o.value]
781 785
           }

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

@@ -53,7 +53,7 @@ export default {
53 53
       type: String,
54 54
       default: ''
55 55
     },
56
-    poolId: [String, Number],
56
+    pool_id: [String, Number],
57 57
     /** 转移数据 */
58 58
     selectionList: {
59 59
       type: Array,
@@ -103,8 +103,8 @@ export default {
103 103
         this.$message.error('请选择负责人')
104 104
       } else {
105 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 109
         params.customer_id = this.selectionList.map(item => item[this.crmType + '_id'])
110 110
         this.loading = true

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

@@ -12,9 +12,9 @@
12 12
         <el-select v-model="selectId" >
13 13
           <el-option
14 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 18
         </el-select>
19 19
       </flexbox>
20 20
     </div>
@@ -31,7 +31,8 @@
31 31
 
32 32
 <script>
33 33
 import {
34
-  crmCustomerPutInPoolAPI
34
+  crmCustomerPutInPoolAPI,
35
+  crmCustomerPoolNameListAPI
35 36
 } from '@/api/crm/customer'
36 37
 
37 38
 import { Loading } from 'element-ui'
@@ -69,7 +70,7 @@ export default {
69 70
   watch: {
70 71
     list: {
71 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 75
       immediate: true
75 76
     },
@@ -86,20 +87,20 @@ export default {
86 87
      * 获取数据源
87 88
      */
88 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 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,8 +119,8 @@ export default {
118 119
           target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
119 120
         })
120 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 125
           .then(res => {
125 126
             this.$message({

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

@@ -203,9 +203,9 @@ export default {
203 203
       tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
204 204
       tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
205 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 209
       return tempsTabs
210 210
     },
211 211
 

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

@@ -23,7 +23,7 @@
23 23
           :detail="detailData"
24 24
           :head-details="headDetails"
25 25
           :id="id"
26
-          :pool-id="seasPoolId"
26
+          :pool_id="seasPoolId"
27 27
           :pool-auth="poolAuth"
28 28
           :crm-type="crmType"
29 29
           @handle="detailHeadHandle"
@@ -56,7 +56,7 @@
56 56
                 :detail="detailData"
57 57
                 :type-list="logTyps"
58 58
                 :id="id"
59
-                :pool-id="seasPoolId"
59
+                :pool_id="seasPoolId"
60 60
                 :handle="activityHandle"
61 61
                 :is-seas="isSeasDetail"
62 62
                 :crm-type="crmType"
@@ -77,7 +77,7 @@
77 77
                 <chiefly-contacts
78 78
                   :contacts-id="firstContactsId"
79 79
                   :id="id"
80
-                  :pool-id="seasPoolId"
80
+                  :pool_id="seasPoolId"
81 81
                   :crm-type="crmType"
82 82
                   :is-seas="isSeasDetail"
83 83
                   @add="addChieflyContacts" />
@@ -146,7 +146,7 @@ export default {
146 146
   props: {
147 147
     // 详情信息id
148 148
     id: [String, Number],
149
-    poolId: [String, Number],
149
+    pool_id: [String, Number],
150 150
     // 监听的dom 进行隐藏详情
151 151
     listenerIDs: {
152 152
       type: Array,
@@ -283,11 +283,10 @@ export default {
283 283
      * 公海id
284 284
      */
285 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,12 +364,10 @@ export default {
365 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 372
       crmCustomerReadAPI(params)
376 373
         .then(res => {
@@ -381,9 +378,9 @@ export default {
381 378
 
382 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 384
             this.poolAuth = res.data || {}
388 385
           })
389 386
 
@@ -416,7 +413,7 @@ export default {
416 413
           }
417 414
 
418 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 417
           this.headDetails[3].value = this.detailData.create_time
421 418
         })
422 419
         .catch(() => {

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

@@ -258,6 +258,11 @@ export default {
258 258
               name: '更新时间',
259 259
               // formType: 'text',
260 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,8 +145,8 @@ export default {
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 151
       if (this.filterObj && this.filterObj.length > 0) {
152 152
         this.filterObj.forEach(element => {
@@ -249,14 +249,15 @@ export default {
249 249
 
250 250
         let params = {}
251 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 255
           params = {
256 256
             types: 'crm_' + this.crmType,
257 257
             module: 'crm',
258 258
             action: 'pool',
259
-            controller: this.crmType
259
+            controller: this.crmType,
260
+            pool_id: this.pool_id
260 261
           }
261 262
         } else {
262 263
           // params.label = crmTypeModel[this.crmType]
@@ -466,8 +467,8 @@ export default {
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 474
       // if (this.filterObj && this.filterObj.length > 0) {
@@ -619,11 +620,11 @@ export default {
619 620
           }[column.property] || field
620 621
         }
621 622
         if (this.isSeas) {
622
-          if (!this.poolId) {
623
+          if (!this.pool_id) {
623 624
             return
624 625
           }
625 626
           request = crmPoolFieldColumnWidthAPI
626
-          params.poolId = this.poolId
627
+          params.pool_id = this.pool_id
627 628
         } else {
628 629
           request = crmFieldColumnWidthAPI
629 630
         }

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

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

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

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

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

@@ -148,9 +148,9 @@ export default {
148 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 155
       return tempsTabs
156 156
     }

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

@@ -34,7 +34,7 @@
34 34
       <c-r-m-table-head
35 35
         ref="crmTableHead"
36 36
         :is-seas="isSeas"
37
-        :pool-id="poolId"
37
+        :pool_id="pool_id"
38 38
         :pool-auth="poolAuth"
39 39
         :sort-data="sortData"
40 40
         crm-type="customer"
@@ -44,13 +44,13 @@
44 44
         <template slot="custom">
45 45
           <div>公海:</div>
46 46
           <el-select
47
-            v-model="poolId"
47
+            v-model="pool_id"
48 48
             @change="poolChange">
49 49
             <el-option
50 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 54
           </el-select>
55 55
         </template>
56 56
       </c-r-m-table-head>
@@ -109,7 +109,7 @@
109 109
             <field-set
110 110
               :is-seas="isSeas"
111 111
               :crm-type="crmType"
112
-              :pool-id="poolId"
112
+              :pool_id="pool_id"
113 113
               @change="setSave"/>
114 114
           </template>
115 115
         </el-table-column>
@@ -131,7 +131,7 @@
131 131
     <customer-detail
132 132
       v-if="showDview"
133 133
       :id="rowID"
134
-      :pool-id="poolId"
134
+      :pool_id="pool_id"
135 135
       :is-seas="isSeas"
136 136
       class="d-view"
137 137
       @handle="handleHandle"
@@ -165,7 +165,7 @@ export default {
165 165
     return {
166 166
       crmType: 'customer',
167 167
       isSeas: true, // 是公海
168
-      poolId: '',
168
+      pool_id: '',
169 169
       poolAuth: {},
170 170
       poolList: []
171 171
     }
@@ -201,7 +201,7 @@ export default {
201 201
     }
202 202
   },
203 203
   watch: {
204
-    poolId: {
204
+    pool_id: {
205 205
       handler(newVal) {
206 206
         if (newVal) {
207 207
           this.getCustomerPoolAuth(newVal)
@@ -215,10 +215,10 @@ export default {
215 215
     this.getPoolList()
216 216
   },
217 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 223
   deactivated() {
224 224
     this.$refs.elMenu.activeIndex = 'seas'
@@ -227,12 +227,13 @@ export default {
227 227
     /**
228 228
      * 获取公海权限
229 229
      */
230
-    getCustomerPoolAuth(poolId) {
230
+    getCustomerPoolAuth(pool_id) {
231 231
       crmCustomerPoolQueryAuthAPI({
232
-        poolId: poolId
232
+        pool_id: pool_id
233 233
       })
234 234
         .then(res => {
235 235
           this.poolAuth = res.data || {}
236
+          this.getFieldList()
236 237
         })
237 238
         .catch(() => {
238 239
           // this.poolAuth = { receive: true, excelexport: true, index: true, distribute: true, delete: true }
@@ -253,12 +254,9 @@ export default {
253 254
       crmCustomerPoolNameListAPI()
254 255
         .then(res => {
255 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 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,7 +35,7 @@ export default {
35 35
   },
36 36
   props: {
37 37
     data: Object,
38
-    dataIndex: Number
38
+    dataIndex: [String, Number]
39 39
   },
40 40
   data() {
41 41
     return {}

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

@@ -121,7 +121,8 @@ export default {
121 121
         .then(() => {
122 122
           crmFileDeleteAPI({
123 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 127
             .then(res => {
127 128
               this.$message.success('操作成功')

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

@@ -109,9 +109,7 @@ export default {
109 109
      * 拖拽结束
110 110
      */
111 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 113
         .then(res => {})
116 114
         .catch(() => {})
117 115
     }

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

@@ -148,7 +148,7 @@ export default {
148 148
       this.formData = {
149 149
         title: this.action.data.title,
150 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,7 +32,7 @@
32 32
         </el-dropdown>
33 33
       </flexbox>
34 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 36
       <div class="main__bd">{{ detail.content }}</div>
37 37
     </div>
38 38
 

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

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

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

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

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

@@ -39,6 +39,19 @@
39 39
           :label="item.label"
40 40
           :value="item.value" />
41 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 55
     </flexbox>
43 56
 
44 57
     <div
@@ -90,7 +103,16 @@
90 103
 </template>
91 104
 
92 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 117
 import RecordTabHead from './components/RecordTabHead'
96 118
 import XhUserCell from '@/components/CreateCom/XhUserCell'
@@ -99,7 +121,8 @@ import LogCell from '@/views/crm/components/Activity/LogCell'
99 121
 import LogEditDialog from '@/views/crm/components/Activity/LogEditDialog'
100 122
 
101 123
 import crmTypeModel from '@/views/crm/model/crmTypeModel'
102
-
124
+import { downloadExcelWithResData } from '@/utils'
125
+import { mapGetters } from 'vuex'
103 126
 export default {
104 127
   // 跟进记录
105 128
   name: 'FollowIndex',
@@ -182,10 +205,27 @@ export default {
182 205
         seciton: 0,
183 206
         index: 0
184 207
       },
185
-      logEditDialogVisible: false
208
+      logEditDialogVisible: false,
209
+      requestParams: {}
186 210
     }
187 211
   },
188 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 230
     scrollDisabled() {
191 231
       return this.loading || this.noMore
@@ -205,7 +245,18 @@ export default {
205 245
   },
206 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 260
   methods: {
210 261
     /**
211 262
      * 中间tabs改变
@@ -234,7 +285,7 @@ export default {
234 285
         limit: 15,
235 286
         isUser: 1,
236 287
         queryType: 0,
237
-        label: 2
288
+        label: 0
238 289
       }
239 290
 
240 291
       if (this.timeSelect.type) {
@@ -249,11 +300,12 @@ export default {
249 300
       if (this.userSelectShow) {
250 301
         params = { ...params, ...this.filterForm }
251 302
       } else {
252
-        // params.label = this.filterForm.crmType
303
+        params.label = this.filterForm.crmType
253 304
         params.subUser = this.filterForm.subUser
254 305
         params.dataType = this.filterForm.queryType
255 306
         params.search = this.filterForm.search
256 307
       }
308
+      this.requestParams = params
257 309
       crmIndexGetRecordListAPI(params)
258 310
         .then(res => {
259 311
           this.loading = false
@@ -332,7 +384,53 @@ export default {
332 384
       if (this.logEditPosition.index >= 0) {
333 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 436
 </script>