Selaa lähdekoodia

代码整理,优化

miaofuhao 3 vuotta sitten
vanhempi
commit
4474ca183f

+ 1 - 1
CallCenterWeb.UI/RMYY/src/store/modules/user.js

@@ -66,7 +66,7 @@ const user = {
66 66
       window.localStorage.setItem('ext', userInfo.extension)
67 67
       return new Promise((resolve, reject) => {
68 68
         login(username, password).then(response => {
69
-          console.log(response.data)
69
+          
70 70
           setToken(response.data)
71 71
           commit('SET_TOKEN', response.data)
72 72
           resolve()

+ 127 - 27
CallCenterWeb.UI/RMYY/src/utils/index.js

@@ -280,7 +280,7 @@ export function formatterContent(strVal) {
280 280
 
281 281
 // GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中的 x 是 0-9 或 a-f 范围内的一个32位十六进制数
282 282
 export function guid() {
283
-  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
283
+  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
284 284
     const r = Math.random() * 16 | 0
285 285
     const v = c === 'x' ? r : (r & 0x3 | 0x8)
286 286
     return v.toString(16)
@@ -317,7 +317,7 @@ export function uniqueObjArray(oldArr, attr) {
317 317
 // 针对此类高频度触发事件问题(例如页面 scroll ,屏幕 resize,监听用户输入等),有两种常用的解决方法,防抖和节流。
318 318
 export function debounce(func, wait, immediate) {
319 319
   let timeout, args, context, timestamp, result
320
-  const later = function() {
320
+  const later = function () {
321 321
     // 据上一次触发时间间隔
322 322
     const last = +new Date() - timestamp
323 323
 
@@ -333,7 +333,7 @@ export function debounce(func, wait, immediate) {
333 333
       }
334 334
     }
335 335
   }
336
-  return function(...args) {
336
+  return function (...args) {
337 337
     context = this
338 338
     timestamp = +new Date()
339 339
     const callNow = immediate && !timeout
@@ -352,31 +352,131 @@ export function firstToUpper(str) {
352 352
   return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
353 353
 }
354 354
 
355
- // 导出
356
-export function exportData(response) {
357
-  const content = response.data
358
-  const blob = new Blob([content])
359
-  // let fileName = '报表数据.xls'
360
-  let fileName = response.headers['content-disposition'].split(';')[1].split('=')[1]
361
-  var explorer = navigator.userAgent
362
-  if (explorer.indexOf('MSIE') >= 0 || explorer.indexOf('Chrome') >= 0) { // IE和google浏览器
363
-    fileName = decodeURIComponent(fileName)
364
-  } else {
365
-    fileName = decodeURI(escape(fileName))
355
+// 导出
356
+export function exportExcel(exporParams, getListExpt) {
357
+  return new Promise(resolve => {
358
+
359
+    getListExpt(exporParams).then(response => {
360
+      if (response.headers['content-disposition']) {
361
+        const content = response.data
362
+        const blob = new Blob([content])
363
+        // let fileName = '报表数据.xls'
364
+        let fileName = response.headers['content-disposition'].split(';')[1].split('=')[1]
365
+        var explorer = navigator.userAgent
366
+        if (explorer.indexOf('MSIE') >= 0 || explorer.indexOf('Chrome') >= 0) { // IE和google浏览器
367
+          fileName = decodeURIComponent(fileName)
368
+        } else {
369
+          fileName = decodeURI(escape(fileName))
370
+        }
371
+        if ('download' in document.createElement('a')) {
372
+          // 非IE下载
373
+          const elink = document.createElement('a')
374
+          elink.download = fileName
375
+          elink.style.display = 'none'
376
+          elink.href = URL.createObjectURL(blob)
377
+          document.body.appendChild(elink)
378
+          elink.click()
379
+          URL.revokeObjectURL(elink.href) // 释放URL 对象
380
+          document.body.removeChild(elink)
381
+        } else {
382
+          // IE10+下载
383
+          navigator.msSaveBlob(blob, fileName)
384
+        }
385
+      } else {
386
+        this.$message.error(response)
387
+      }
388
+    })
389
+    resolve()
390
+  })
391
+
392
+}
393
+
394
+/**
395
+     * 将一维的扁平数组转换为多层级对象
396
+     * @param  {[type]} list 一维数组,数组中每一个元素需包含id和pid两个属性
397
+     * @return {[type]} tree 多层级树状结构
398
+     */
399
+export function buildTree(list) {
400
+  const temp = {}
401
+  const tree = {}
402
+  const arr = []
403
+  for (const j in list) {
404
+    temp[list[j].id] = list[j]
366 405
   }
367
-  if ('download' in document.createElement('a')) {
368
-  // 非IE下载
369
-    const elink = document.createElement('a')
370
-    elink.download = fileName
371
-    elink.style.display = 'none'
372
-    elink.href = URL.createObjectURL(blob)
373
-    document.body.appendChild(elink)
374
-    elink.click()
375
-    URL.revokeObjectURL(elink.href) // 释放URL 对象
376
-    document.body.removeChild(elink)
377
-  } else {
378
-  // IE10+下载
379
-    navigator.msSaveBlob(blob, fileName)
406
+  for (const i in temp) {
407
+    // if (temp[i].pid !== 'Moudle_000000000000000000000000') {
408
+    if (temp[i].pid !== 0) {
409
+      if (!temp[temp[i].pid].children) {
410
+        temp[temp[i].pid].children = []
411
+      }
412
+      temp[temp[i].pid].children[temp[i].id] = temp[i]
413
+    } else {
414
+      tree[temp[i].id] = temp[i]
415
+    }
380 416
   }
417
+
418
+  return tree
419
+}
420
+// 处理菜单树形结构数据格式
421
+export function filterTreeDatas(tree) {
422
+  const accessedRouters = []
423
+  let j = -1
424
+  for (const i in tree) {
425
+    j++
426
+    accessedRouters.push({
427
+      id: tree[i].id,
428
+      label: tree[i].name,
429
+      children: []
430
+    })
431
+    if (tree[i].children) {
432
+      accessedRouters[j].children = filterTreeDatas(tree[i].children)
433
+    }
434
+  }
435
+  return accessedRouters
436
+}
437
+export function buildMenuTree(list) {
438
+  const temp = {}
439
+  const tree = {}
440
+  for (const j in list) {
441
+    temp[list[j].F_MenuId] = list[j]
442
+  }
443
+  for (const i in temp) {
444
+    if (temp[i].F_ParentId !== 0) {
445
+      if (!temp[temp[i].F_ParentId].childnodes) {
446
+        temp[temp[i].F_ParentId].childnodes = {}
447
+      }
448
+      temp[temp[i].F_ParentId].childnodes[temp[i].F_MenuId] = temp[i]
449
+    } else {
450
+      tree[temp[i].F_MenuId] = temp[i]
451
+    }
452
+  }
453
+  return tree
454
+}
455
+// 处理菜单数据格式
456
+export function filterMenuDatas(menudatas) {
457
+  const accessedRouters = []
458
+  let j = -1
459
+  for (const i in menudatas) {
460
+    j++
461
+    accessedRouters.push({
462
+      id: menudatas[i].F_MenuId,
463
+      path: menudatas[i].F_Url,
464
+      code: menudatas[i].F_MenuCode,
465
+      name: menudatas[i].F_MenuName,
466
+      target: menudatas[i].F_Type, // 菜单类型
467
+      stateFlag: menudatas[i].F_State, // 是否启用
468
+      remark: menudatas[i].F_Remark, // 介绍
469
+      sort: menudatas[i].F_Sort, // 排序
470
+      children: []
471
+    })
472
+
473
+    if (menudatas[i].childnodes) {
474
+      accessedRouters[j].children = filterMenuDatas(menudatas[i].childnodes)
475
+    }
476
+  }
477
+  accessedRouters.sort(function (x, y) {
478
+    return x.sort - y.sort
479
+  })
480
+  return accessedRouters
381 481
 }
382 482
 

+ 12 - 1
CallCenterWeb.UI/RMYY/src/views/callScreen/components/addressNumber.vue

@@ -23,7 +23,12 @@
23 23
       </p>
24 24
     </el-col>
25 25
     <el-col :span="4">
26
+        
26 27
       <div class="callin_btns">
28
+        <div class="swBtn">
29
+          <img src="../../../../static/img/dingding.png" alt="">
30
+          <img src="../../../../static/img/dx.png" alt="">
31
+        </div>
27 32
         <el-tooltip content="点击加入黑名单" placement="top">
28 33
           <i v-show="!isBlack" class="callin_btn callinblack" @click="btn_addBlack" />
29 34
         </el-tooltip>
@@ -194,6 +199,7 @@ export default {
194 199
 			position: absolute;
195 200
 			right: 0;
196 201
 			top: 0;
202
+      display: flex;
197 203
 		}
198 204
 
199 205
 		.callin_btn {
@@ -211,5 +217,10 @@ export default {
211 217
 		.callincelblack {
212 218
 			background: url("~@/assets/imgs/callincelblack.png") center center no-repeat;
213 219
 		}
214
-
220
+    .swBtn img{
221
+      width: 38px;
222
+      height: 38px;
223
+      margin-right: 5px;
224
+      display: none;
225
+    }
215 226
 </style>

+ 1 - 15
CallCenterWeb.UI/RMYY/src/views/callScreen/components/callScreen.vue

@@ -23,10 +23,6 @@
23 23
         <add-or-edit-order :callid="callinCallid"/>
24 24
       </el-card>
25 25
     </el-col>
26
-    <div class="swBtn">
27
-      <img src="../../../../static/img/dingding.png" alt="">
28
-      <img src="../../../../static/img/dx.png" alt="">
29
-    </div>
30 26
     <!-- tab切换 -->
31 27
     <el-col :span="24">
32 28
       <el-card shadow="hover" class="records">
@@ -58,10 +54,10 @@ import { mapGetters } from 'vuex'
58 54
 
59 55
 // 此处引用的是黑名单管理的添加视图
60 56
 import AddressNumber from './AddressNumber'
57
+import AddOrEditCustomer from './AddOrEditCustomer'
61 58
 import CallList from './CallList'
62 59
 import OrderList from './OrderList'
63 60
 import KnowledgeList from './KnowledgeList'
64
-import AddOrEditCustomer from './AddOrEditCustomer'
65 61
 import AddOrEditOrder from './AddOrEditOrder'
66 62
 
67 63
 export default {
@@ -276,14 +272,4 @@ export default {
276 272
 			padding-right: 15px;
277 273
 		}
278 274
 	}
279
-  .swBtn img{
280
-    width: 38px;
281
-    height: 38px;
282
-    margin-right: 5px;
283
-  }
284
-  .swBtn{
285
-    position: absolute;
286
-    top: 6px;
287
-    right: 46px;
288
-  }
289 275
 </style>

+ 4 - 21
CallCenterWeb.UI/RMYY/src/views/comDispatch/EquipmentLeasing/EquipmentLeasingReport/index.vue

@@ -44,7 +44,7 @@
44 44
   } from '@/api/EquipmentLeasing/EquipmentLeasing.js'
45 45
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
46 46
   import {
47
-    exportData
47
+    exportExcel
48 48
   } from '@/utils'
49 49
   export default {
50 50
     name: 'EquiTableList',
@@ -60,6 +60,7 @@
60 60
         state: '',
61 61
         rowList: [],
62 62
         orderstate: [], // 工单状态数据
63
+        exporParams: {},
63 64
         ruleForm: {
64 65
           startTime: '',
65 66
           keyword: ''
@@ -82,6 +83,7 @@
82 83
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
83 84
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
84 85
           }
86
+          this.exporParams = Object.assign({isdc: 1},params)
85 87
           getReportList(params).then((response) => {
86 88
             if (response.state.toLowerCase() === 'success') {
87 89
               if (response.message === '暂无记录!') {
@@ -106,26 +108,7 @@
106 108
         this.getListTask()
107 109
       },
108 110
       btn_export() {
109
-        return new Promise(resolve => {
110
-          const params = {
111
-            isdc: 1,
112
-            pageindex: this.pageParams.pageindex, // 第几页
113
-            pagesize: this.pageParams.pagesize, // 每页几条信息
114
-            type: this.orderId,
115
-            state: this.state,
116
-            starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
117
-            endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
118
-            keyword: this.ruleForm.keyword.replace(/\s+/g, '')
119
-          }
120
-          getListExpt(params).then(response => {
121
-            if (response.headers['content-disposition']) {
122
-              exportData(response)
123
-            } else {
124
-              this.$message.error(response)
125
-            }
126
-          })
127
-          resolve()
128
-        })
111
+        exportExcel(this.exporParams,getListExpt)
129 112
       },
130 113
       // 工单状态
131 114
       getOrderStat() {

+ 4 - 21
CallCenterWeb.UI/RMYY/src/views/comDispatch/Escortservice/EscortserviceReport/index.vue

@@ -47,7 +47,7 @@
47 47
   } from '@/api/Escortservice/Escortservice.js'
48 48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
49 49
   import {
50
-    exportData
50
+    exportExcel
51 51
   } from '@/utils'
52 52
   export default {
53 53
     name: 'EscortsTableList',
@@ -63,6 +63,7 @@
63 63
         state: '',
64 64
         rowList: [],
65 65
         orderstate: [], // 工单状态数据
66
+        exporParams: {},
66 67
         ruleForm: {
67 68
           startTime: '',
68 69
           keyword: ''
@@ -86,6 +87,7 @@
86 87
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87 88
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88 89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89 91
           getReportList(params).then((response) => {
90 92
             if (response.state.toLowerCase() === 'success') {
91 93
               if (response.message === '暂无记录!') {
@@ -110,26 +112,7 @@
110 112
         this.getListTask()
111 113
       },
112 114
       btn_export() {
113
-        return new Promise(resolve => {
114
-          const params = {
115
-            isdc: 1,
116
-            pageindex: this.pageParams.pageindex, // 第几页
117
-            pagesize: this.pageParams.pagesize, // 每页几条信息
118
-            type: 2008,
119
-            state: this.state,
120
-            starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
121
-            endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
122
-            keyword: this.ruleForm.keyword.replace(/\s+/g, '')
123
-          }
124
-          getListExpt(params).then(response => {
125
-            if (response.headers['content-disposition']) {
126
-              exportData(response)
127
-            } else {
128
-              this.$message.error(response)
129
-            }
130
-          })
131
-          resolve()
132
-        })
115
+        exportExcel(this.exporParams,getListExpt)
133 116
       },
134 117
       // 工单状态
135 118
       getOrderStat() {

+ 4 - 21
CallCenterWeb.UI/RMYY/src/views/comDispatch/Takeblood/TakebloodReport/index.vue

@@ -47,7 +47,7 @@
47 47
   } from '@/api/Escortservice/Escortservice.js'
48 48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
49 49
   import {
50
-    exportData
50
+    exportExcel
51 51
   } from '@/utils'
52 52
   export default {
53 53
     name: 'EscortsTableList',
@@ -63,6 +63,7 @@
63 63
         state: '',
64 64
         rowList: [],
65 65
         orderstate: [], // 工单状态数据
66
+        exporParams: {},
66 67
         ruleForm: {
67 68
           startTime: '',
68 69
           keyword: ''
@@ -86,6 +87,7 @@
86 87
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87 88
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88 89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89 91
           getReportList(params).then((response) => {
90 92
             if (response.state.toLowerCase() === 'success') {
91 93
               if (response.message === '暂无记录!') {
@@ -110,26 +112,7 @@
110 112
         this.getListTask()
111 113
       },
112 114
       btn_export() {
113
-        return new Promise(resolve => {
114
-          const params = {
115
-            isdc: 1,
116
-            pageindex: this.pageParams.pageindex, // 第几页
117
-            pagesize: this.pageParams.pagesize, // 每页几条信息
118
-            type: 2009,
119
-            state: this.state,
120
-            starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
121
-            endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
122
-            keyword: this.ruleForm.keyword.replace(/\s+/g, '')
123
-          }
124
-          getListExpt(params).then(response => {
125
-            if (response.headers['content-disposition']) {
126
-              exportData(response)
127
-            } else {
128
-              this.$message.error(response)
129
-            }
130
-          })
131
-          resolve()
132
-        })
115
+        exportExcel(this.exporParams,getListExpt)
133 116
       },
134 117
       // 工单状态
135 118
       getOrderStat() {

+ 4 - 19
CallCenterWeb.UI/RMYY/src/views/comDispatch/components/distributionReport.vue

@@ -25,7 +25,7 @@ import bprTableList from '@/views/comDispatch/bloodProductDistribution/bloodProd
25 25
 import OrTableList from '@/views/comDispatch/otherDistribution/otherReport/OrTableList'
26 26
 import rprTableList from '@/views/comDispatch/redPrescriptionDistribution/redPrescriptionReport/rprTableList'
27 27
 import mrTableList from '@/views/comDispatch/salvageMuter/muterReport/mrTableList'
28
-import { exportData } from '@/utils'
28
+import { exportExcel } from '@/utils'
29 29
 export default {
30 30
   name: 'List',
31 31
   components: {
@@ -50,6 +50,7 @@ export default {
50 50
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
51 51
         total: 0
52 52
       },
53
+      exporParams:{},
53 54
       dataLists: []
54 55
     }
55 56
   },
@@ -72,6 +73,7 @@ export default {
72 73
           type: this.orderId,
73 74
           keyword: this.keyword.replace(/\s+/g, '')
74 75
         }
76
+        this.exporParams = Object.assign({isdc: 1},params)
75 77
         getDisList(params).then((response) => {
76 78
           this.loading = false
77 79
           if (response.rows.length >= 0) {
@@ -87,25 +89,8 @@ export default {
87 89
       this.getList()
88 90
     },
89 91
     // 导出
90
-
91 92
     btn_export() {
92
-      return new Promise(resolve => {
93
-        const params = {
94
-          isdc: 1,
95
-          pageindex: this.pageParams.pageindex, // 第几页
96
-          pagesize: this.pageParams.pagesize, // 每页几条信息
97
-          type: this.orderId,
98
-          keyword: this.keyword.replace(/\s+/g, '')
99
-        }
100
-        getListExpt(params).then(response => {
101
-          if (response.headers['content-disposition']) {
102
-            exportData(response)
103
-          } else {
104
-            this.$message.error(response)
105
-          }
106
-        })
107
-        resolve()
108
-      })
93
+      exportExcel(this.exporParams,getListExpt)
109 94
     }
110 95
   }
111 96
 }

+ 3 - 1
CallCenterWeb.UI/RMYY/src/views/comDispatch/ebcomponents/escortAddOrEdit.vue

@@ -252,12 +252,14 @@
252 252
         this.ruleForm.id = this.rowid
253 253
         this.getDetail(this.rowid)
254 254
       }
255
-      if(this.orderTypeData){
255
+      if(this.orderTypeData&&this.orderTypeData.F_Type2){
256
+        
256 257
         this.orderId=this.orderTypeData.F_Type2
257 258
       }
258 259
       if (JSON.stringify(this.orderTypeData) === '{}') {
259 260
         this.ruleForm.source = ''
260 261
       }
262
+      
261 263
       this.getPositon()
262 264
     },
263 265
     methods: {

+ 4 - 18
CallCenterWeb.UI/RMYY/src/views/comDispatch/materialTransfer/materialTransferReport/index.vue

@@ -28,7 +28,7 @@
28 28
 <script>
29 29
 import { getListExpt,getListExptIsdc } from '@/api/comDispatch/materialTransfer'
30 30
 import Pagination from '@/components/context/Pagination'
31
-import { exportData } from '@/utils'
31
+import { exportExcel } from '@/utils'
32 32
 
33 33
 export default {
34 34
   name: 'List',
@@ -39,6 +39,7 @@ export default {
39 39
     return {
40 40
       loading: false,
41 41
       keyword: '',
42
+      exporParams: {},
42 43
       pageParams: {
43 44
         pageindex: 1,
44 45
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
@@ -68,6 +69,7 @@ export default {
68 69
           stime: this.searchDate && this.searchDate[0],
69 70
           etime: this.searchDate && this.searchDate[1]
70 71
         }
72
+        this.exporParams = Object.assign({isdc: 1},params)
71 73
         getListExpt(params).then((response) => {
72 74
           this.loading = false
73 75
           if (response.rows.length > 0) {
@@ -83,23 +85,7 @@ export default {
83 85
       this.getList()
84 86
     },
85 87
     btn_export() {
86
-      return new Promise(resolve => {
87
-        const params = {
88
-          isdc: 1,
89
-          pageindex: this.pageParams.pageindex, // 第几页
90
-          pagesize: this.pageParams.pagesize, // 每页几条信息
91
-          type: this.orderId,
92
-          keyword: this.keyword.replace(/\s+/g, '')
93
-        }
94
-        getListExptIsdc(params).then(response => {
95
-          if (response.headers['content-disposition']) {
96
-            exportData(response)
97
-          } else {
98
-            this.$message.error(response)
99
-          }
100
-        })
101
-        resolve()
102
-      })
88
+     exportExcel(this.exporParams,getListExptIsdc)
103 89
     }
104 90
     
105 91
   }

+ 1 - 1
CallCenterWeb.UI/RMYY/src/views/reportForm/operationEvaluationForm/index.vue

@@ -15,7 +15,7 @@
15 15
         <select-order-type :third-order-type="thirdOrderTypeParam" @post-third-order-type="getthirdOrderType" />
16 16
       </el-form-item>
17 17
       <el-form-item label="工单状态:">
18
-        <el-input v-model="ruleForm.keyword" placeholder="请输入关键字" size="medium" />
18
+        <el-input v-model="ruleForm.keyword" placeholder="请输入工单状态" size="medium" />
19 19
       </el-form-item>
20 20
       <el-form-item label="时间范围:">
21 21
         <el-col :span="16">

+ 3 - 63
CallCenterWeb.UI/RMYY/src/views/systemSetup/roleSetting/menuSetup/index.vue

@@ -61,6 +61,7 @@ import { getMenuLists, deleteMenu } from '@/api/systemSetup/roleSetting/menuSetu
61 61
 import treeToArray from './customEval'
62 62
 import addOrEditMenu from './components/addOrEditMenu'
63 63
 import menuBtn from './menuBtn'
64
+import {buildMenuTree,filterMenuDatas } from '@/utils'
64 65
 export default {
65 66
   name: 'MenuSetup',
66 67
   data() {
@@ -87,7 +88,7 @@ export default {
87 88
       const keyword = this.keyword.replace(/\s+/g, '')
88 89
       getMenuLists(keyword).then((response) => {
89 90
         this.loading = false
90
-        this.menuData = this.$options.methods.buildTree(response.data)
91
+        this.menuData = filterMenuDatas(buildMenuTree(response.data))
91 92
       })
92 93
     },
93 94
     formatterTarget(row, column) {
@@ -171,68 +172,7 @@ export default {
171 172
           this.$message.info('已取消删除')
172 173
         })
173 174
     },
174
-    /**
175
-     * 将一维的扁平数组转换为多层级对象
176
-     * @param  {[type]} list 一维数组,数组中每一个元素需包含id和parent_id两个属性
177
-     * @return {[type]} tree 多层级树状结构
178
-     */
179
-    buildTree(list) {
180
-      const temp = {}
181
-      const tree = {}
182
-      for (const j in list) {
183
-        temp[list[j].F_MenuId] = list[j]
184
-      }
185
-      for (const i in temp) {
186
-        if (temp[i].F_ParentId !== 0) {
187
-          if (!temp[temp[i].F_ParentId].childnodes) {
188
-            temp[temp[i].F_ParentId].childnodes = {}
189
-          }
190
-          temp[temp[i].F_ParentId].childnodes[temp[i].F_MenuId] = temp[i]
191
-        } else {
192
-          tree[temp[i].F_MenuId] = temp[i]
193
-        }
194
-      }
195
-      return this.filterMenuDatas(tree)
196
-    },
197
-    // 处理数据格式
198
-    filterMenuDatas(menudatas) {
199
-      const accessedRouters = []
200
-      let j = -1
201
-      for (const i in menudatas) {
202
-        j++
203
-        if (menudatas[i].F_ParentId === '000000000000000000000000') {
204
-          accessedRouters.push({
205
-            id: menudatas[i].F_MenuId,
206
-            path: menudatas[i].F_Url,
207
-            code: menudatas[i].F_MenuCode,
208
-            name: menudatas[i].F_MenuName,
209
-            target: menudatas[i].F_Type, // 菜单类型
210
-            stateFlag: menudatas[i].F_State, // 是否启用
211
-            remark: menudatas[i].F_Remark, // 介绍
212
-            sort: menudatas[i].F_Sort, // 排序
213
-            children: []
214
-          })
215
-        } else {
216
-          accessedRouters.push({
217
-            id: menudatas[i].F_MenuId,
218
-            path: menudatas[i].F_Url,
219
-            code: menudatas[i].F_MenuCode,
220
-            name: menudatas[i].F_MenuName,
221
-            target: menudatas[i].F_Type, // 菜单类型
222
-            stateFlag: menudatas[i].F_State, // 是否启用
223
-            remark: menudatas[i].F_Remark, // 介绍
224
-            sort: menudatas[i].F_Sort // 排序
225
-          })
226
-        }
227
-        if (menudatas[i].childnodes) {
228
-          accessedRouters[j].children = this.filterMenuDatas(menudatas[i].childnodes)
229
-        }
230
-      }
231
-      accessedRouters.sort(function(x, y) {
232
-        return x.sort - y.sort
233
-      })
234
-      return accessedRouters
235
-    },
175
+
236 176
     // 获取父级id
237 177
     getParents(poptions) {
238 178
       this.parentids.unshift(poptions.id)

+ 3 - 44
CallCenterWeb.UI/RMYY/src/views/systemSetup/roleSetting/roleSetup/index.vue

@@ -32,7 +32,7 @@
32 32
 <script>
33 33
 import { getRoleLists, deleteRole, saveRoleList, getRoleTree } from '@/api/systemSetup/roleSetting/roleSetup'
34 34
 import addOrEditRole from './addOrEditRole'
35
-import { pickerOptions } from '@/utils'
35
+import { pickerOptions,buildTree,filterTreeDatas } from '@/utils'
36 36
 import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
37 37
 
38 38
 export default {
@@ -175,7 +175,7 @@ export default {
175 175
       return new Promise((resolve) => {
176 176
         getRoleTree(this.role_id).then((response) => {
177 177
           if (response.state.toLowerCase() === 'success') {
178
-            this.treelists = this.buildTree(response.data)
178
+            this.treelists = filterTreeDatas(buildTree(response.data))
179 179
             if (this.role_id) {
180 180
               // 获取ischecked数组 设置选中
181 181
               const checkedKeys = this.getIsChecked(response.data)
@@ -196,48 +196,7 @@ export default {
196 196
       }
197 197
       return checkedArr
198 198
     },
199
-    /**
200
-     * 将一维的扁平数组转换为多层级对象
201
-     * @param  {[type]} list 一维数组,数组中每一个元素需包含id和pid两个属性
202
-     * @return {[type]} tree 多层级树状结构
203
-     */
204
-    buildTree(list) {
205
-      const temp = {}
206
-      const tree = {}
207
-      const arr = []
208
-      for (const j in list) {
209
-        temp[list[j].id] = list[j]
210
-      }
211
-      for (const i in temp) {
212
-        // if (temp[i].pid !== 'Moudle_000000000000000000000000') {
213
-        if (temp[i].pid !== 0) {
214
-          if (!temp[temp[i].pid].children) {
215
-            temp[temp[i].pid].children = []
216
-          }
217
-          temp[temp[i].pid].children[temp[i].id] = temp[i]
218
-        } else {
219
-          tree[temp[i].id] = temp[i]
220
-        }
221
-      }
222
-      return this.filterTreeDatas(tree)
223
-    },
224
-    // 处理数据格式
225
-    filterTreeDatas(treeDatas) {
226
-      const accessedRouters = []
227
-      let j = -1
228
-      for (const i in treeDatas) {
229
-        j++
230
-        accessedRouters.push({
231
-          id: treeDatas[i].id,
232
-          label: treeDatas[i].name,
233
-          children: []
234
-        })
235
-        if (treeDatas[i].children) {
236
-          accessedRouters[j].children = this.filterTreeDatas(treeDatas[i].children)
237
-        }
238
-      }
239
-      return accessedRouters
240
-    }
199
+    
241 200
   }
242 201
 }
243 202
 </script>

+ 1 - 1
CallCenterWeb.UI/RMYY/src/views/trafficData/callRecord/index.vue

@@ -207,12 +207,12 @@ export default {
207 207
       this.getList()
208 208
     },
209 209
     // 导出
210
-
211 210
     btn_export() {
212 211
       window.location.href = this.$store.getters.serverConfig.BASE_API + 'Callrecords/GetList?isdc=1' +
213 212
 			'&pageindex=' + this.pageParams.pageindex +
214 213
       '&pagesize=' + this.pageParams.pagesize +
215 214
       '&type=' + this.orderId +
215
+      '&token=' + localStorage.getItem("Admin-Token").split(' ')[1] +
216 216
       '&keyword=' + this.keyword.replace(/\s+/g, '')
217 217
     },
218 218
     // 播放录音

+ 4 - 19
CallCenterWeb.UI/RMYY/src/views/vehicleDispatch/vehicleScheduling/vehicleSchedulingReport/index.vue

@@ -44,7 +44,7 @@
44 44
   } from '@/api/vehicleDispatch/vehicleScheduling.js'
45 45
   import Pagination from '@/components/context/Pagination'
46 46
   import {
47
-    exportData
47
+    exportExcel
48 48
   } from '@/utils'
49 49
 
50 50
   export default {
@@ -58,6 +58,7 @@
58 58
         keyword: '',
59 59
         startTime: '',
60 60
         orderId: '',
61
+        exporParams:{},
61 62
         pageParams: {
62 63
           pageindex: 1,
63 64
           pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
@@ -86,6 +87,7 @@
86 87
             pagesize: this.pageParams.pagesize, // 每页几条信息
87 88
             keyword: this.keyword.replace(/\s+/g, '')
88 89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89 91
           getListExpt(params).then((response) => {
90 92
             this.loading = false
91 93
             if (response.rows.length > 0) {
@@ -101,24 +103,7 @@
101 103
         this.getList()
102 104
       },
103 105
       btn_export() {
104
-        return new Promise(resolve => {
105
-          const params = {
106
-            isdc: 1,
107
-            pageindex: this.pageParams.pageindex, // 第几页
108
-            pagesize: this.pageParams.pagesize, // 每页几条信息
109
-            keyword: this.keyword.replace(/\s+/g, ''),
110
-            starttime: this.startTime && this.startTime[0],
111
-            endtime: this.startTime && this.startTime[1]
112
-          }
113
-          getListExptIsdc(params).then(response => {
114
-            if (response.headers['content-disposition']) {
115
-              exportData(response)
116
-            } else {
117
-              this.$message.error(response)
118
-            }
119
-          })
120
-          resolve()
121
-        })
106
+        exportExcel(this.exporParams,getListExpt)
122 107
       }
123 108
 
124 109
     }