Procházet zdrojové kódy

代码整理,优化

miaofuhao %!s(int64=3) %!d(string=před) roky
rodič
revize
4474ca183f

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

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

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

280
 
280
 
281
 // GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中的 x 是 0-9 或 a-f 范围内的一个32位十六进制数
281
 // GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中的 x 是 0-9 或 a-f 范围内的一个32位十六进制数
282
 export function guid() {
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
     const r = Math.random() * 16 | 0
284
     const r = Math.random() * 16 | 0
285
     const v = c === 'x' ? r : (r & 0x3 | 0x8)
285
     const v = c === 'x' ? r : (r & 0x3 | 0x8)
286
     return v.toString(16)
286
     return v.toString(16)
317
 // 针对此类高频度触发事件问题(例如页面 scroll ,屏幕 resize,监听用户输入等),有两种常用的解决方法,防抖和节流。
317
 // 针对此类高频度触发事件问题(例如页面 scroll ,屏幕 resize,监听用户输入等),有两种常用的解决方法,防抖和节流。
318
 export function debounce(func, wait, immediate) {
318
 export function debounce(func, wait, immediate) {
319
   let timeout, args, context, timestamp, result
319
   let timeout, args, context, timestamp, result
320
-  const later = function() {
320
+  const later = function () {
321
     // 据上一次触发时间间隔
321
     // 据上一次触发时间间隔
322
     const last = +new Date() - timestamp
322
     const last = +new Date() - timestamp
323
 
323
 
333
       }
333
       }
334
     }
334
     }
335
   }
335
   }
336
-  return function(...args) {
336
+  return function (...args) {
337
     context = this
337
     context = this
338
     timestamp = +new Date()
338
     timestamp = +new Date()
339
     const callNow = immediate && !timeout
339
     const callNow = immediate && !timeout
352
   return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase())
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
       </p>
23
       </p>
24
     </el-col>
24
     </el-col>
25
     <el-col :span="4">
25
     <el-col :span="4">
26
+        
26
       <div class="callin_btns">
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
         <el-tooltip content="点击加入黑名单" placement="top">
32
         <el-tooltip content="点击加入黑名单" placement="top">
28
           <i v-show="!isBlack" class="callin_btn callinblack" @click="btn_addBlack" />
33
           <i v-show="!isBlack" class="callin_btn callinblack" @click="btn_addBlack" />
29
         </el-tooltip>
34
         </el-tooltip>
194
 			position: absolute;
199
 			position: absolute;
195
 			right: 0;
200
 			right: 0;
196
 			top: 0;
201
 			top: 0;
202
+      display: flex;
197
 		}
203
 		}
198
 
204
 
199
 		.callin_btn {
205
 		.callin_btn {
211
 		.callincelblack {
217
 		.callincelblack {
212
 			background: url("~@/assets/imgs/callincelblack.png") center center no-repeat;
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
 </style>
226
 </style>

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

23
         <add-or-edit-order :callid="callinCallid"/>
23
         <add-or-edit-order :callid="callinCallid"/>
24
       </el-card>
24
       </el-card>
25
     </el-col>
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
     <!-- tab切换 -->
26
     <!-- tab切换 -->
31
     <el-col :span="24">
27
     <el-col :span="24">
32
       <el-card shadow="hover" class="records">
28
       <el-card shadow="hover" class="records">
58
 
54
 
59
 // 此处引用的是黑名单管理的添加视图
55
 // 此处引用的是黑名单管理的添加视图
60
 import AddressNumber from './AddressNumber'
56
 import AddressNumber from './AddressNumber'
57
+import AddOrEditCustomer from './AddOrEditCustomer'
61
 import CallList from './CallList'
58
 import CallList from './CallList'
62
 import OrderList from './OrderList'
59
 import OrderList from './OrderList'
63
 import KnowledgeList from './KnowledgeList'
60
 import KnowledgeList from './KnowledgeList'
64
-import AddOrEditCustomer from './AddOrEditCustomer'
65
 import AddOrEditOrder from './AddOrEditOrder'
61
 import AddOrEditOrder from './AddOrEditOrder'
66
 
62
 
67
 export default {
63
 export default {
276
 			padding-right: 15px;
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
 </style>
275
 </style>

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

44
   } from '@/api/EquipmentLeasing/EquipmentLeasing.js'
44
   } from '@/api/EquipmentLeasing/EquipmentLeasing.js'
45
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
45
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
46
   import {
46
   import {
47
-    exportData
47
+    exportExcel
48
   } from '@/utils'
48
   } from '@/utils'
49
   export default {
49
   export default {
50
     name: 'EquiTableList',
50
     name: 'EquiTableList',
60
         state: '',
60
         state: '',
61
         rowList: [],
61
         rowList: [],
62
         orderstate: [], // 工单状态数据
62
         orderstate: [], // 工单状态数据
63
+        exporParams: {},
63
         ruleForm: {
64
         ruleForm: {
64
           startTime: '',
65
           startTime: '',
65
           keyword: ''
66
           keyword: ''
82
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
83
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
83
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
84
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
84
           }
85
           }
86
+          this.exporParams = Object.assign({isdc: 1},params)
85
           getReportList(params).then((response) => {
87
           getReportList(params).then((response) => {
86
             if (response.state.toLowerCase() === 'success') {
88
             if (response.state.toLowerCase() === 'success') {
87
               if (response.message === '暂无记录!') {
89
               if (response.message === '暂无记录!') {
106
         this.getListTask()
108
         this.getListTask()
107
       },
109
       },
108
       btn_export() {
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
       getOrderStat() {
114
       getOrderStat() {

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

47
   } from '@/api/Escortservice/Escortservice.js'
47
   } from '@/api/Escortservice/Escortservice.js'
48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
49
   import {
49
   import {
50
-    exportData
50
+    exportExcel
51
   } from '@/utils'
51
   } from '@/utils'
52
   export default {
52
   export default {
53
     name: 'EscortsTableList',
53
     name: 'EscortsTableList',
63
         state: '',
63
         state: '',
64
         rowList: [],
64
         rowList: [],
65
         orderstate: [], // 工单状态数据
65
         orderstate: [], // 工单状态数据
66
+        exporParams: {},
66
         ruleForm: {
67
         ruleForm: {
67
           startTime: '',
68
           startTime: '',
68
           keyword: ''
69
           keyword: ''
86
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88
           }
89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89
           getReportList(params).then((response) => {
91
           getReportList(params).then((response) => {
90
             if (response.state.toLowerCase() === 'success') {
92
             if (response.state.toLowerCase() === 'success') {
91
               if (response.message === '暂无记录!') {
93
               if (response.message === '暂无记录!') {
110
         this.getListTask()
112
         this.getListTask()
111
       },
113
       },
112
       btn_export() {
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
       getOrderStat() {
118
       getOrderStat() {

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

47
   } from '@/api/Escortservice/Escortservice.js'
47
   } from '@/api/Escortservice/Escortservice.js'
48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
48
   import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
49
   import {
49
   import {
50
-    exportData
50
+    exportExcel
51
   } from '@/utils'
51
   } from '@/utils'
52
   export default {
52
   export default {
53
     name: 'EscortsTableList',
53
     name: 'EscortsTableList',
63
         state: '',
63
         state: '',
64
         rowList: [],
64
         rowList: [],
65
         orderstate: [], // 工单状态数据
65
         orderstate: [], // 工单状态数据
66
+        exporParams: {},
66
         ruleForm: {
67
         ruleForm: {
67
           startTime: '',
68
           startTime: '',
68
           keyword: ''
69
           keyword: ''
86
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87
             starttime: this.ruleForm.startTime && this.ruleForm.startTime[0],
87
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88
             endtime: this.ruleForm.startTime && this.ruleForm.startTime[1],
88
           }
89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89
           getReportList(params).then((response) => {
91
           getReportList(params).then((response) => {
90
             if (response.state.toLowerCase() === 'success') {
92
             if (response.state.toLowerCase() === 'success') {
91
               if (response.message === '暂无记录!') {
93
               if (response.message === '暂无记录!') {
110
         this.getListTask()
112
         this.getListTask()
111
       },
113
       },
112
       btn_export() {
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
       getOrderStat() {
118
       getOrderStat() {

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

25
 import OrTableList from '@/views/comDispatch/otherDistribution/otherReport/OrTableList'
25
 import OrTableList from '@/views/comDispatch/otherDistribution/otherReport/OrTableList'
26
 import rprTableList from '@/views/comDispatch/redPrescriptionDistribution/redPrescriptionReport/rprTableList'
26
 import rprTableList from '@/views/comDispatch/redPrescriptionDistribution/redPrescriptionReport/rprTableList'
27
 import mrTableList from '@/views/comDispatch/salvageMuter/muterReport/mrTableList'
27
 import mrTableList from '@/views/comDispatch/salvageMuter/muterReport/mrTableList'
28
-import { exportData } from '@/utils'
28
+import { exportExcel } from '@/utils'
29
 export default {
29
 export default {
30
   name: 'List',
30
   name: 'List',
31
   components: {
31
   components: {
50
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
50
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
51
         total: 0
51
         total: 0
52
       },
52
       },
53
+      exporParams:{},
53
       dataLists: []
54
       dataLists: []
54
     }
55
     }
55
   },
56
   },
72
           type: this.orderId,
73
           type: this.orderId,
73
           keyword: this.keyword.replace(/\s+/g, '')
74
           keyword: this.keyword.replace(/\s+/g, '')
74
         }
75
         }
76
+        this.exporParams = Object.assign({isdc: 1},params)
75
         getDisList(params).then((response) => {
77
         getDisList(params).then((response) => {
76
           this.loading = false
78
           this.loading = false
77
           if (response.rows.length >= 0) {
79
           if (response.rows.length >= 0) {
87
       this.getList()
89
       this.getList()
88
     },
90
     },
89
     // 导出
91
     // 导出
90
-
91
     btn_export() {
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
         this.ruleForm.id = this.rowid
252
         this.ruleForm.id = this.rowid
253
         this.getDetail(this.rowid)
253
         this.getDetail(this.rowid)
254
       }
254
       }
255
-      if(this.orderTypeData){
255
+      if(this.orderTypeData&&this.orderTypeData.F_Type2){
256
+        
256
         this.orderId=this.orderTypeData.F_Type2
257
         this.orderId=this.orderTypeData.F_Type2
257
       }
258
       }
258
       if (JSON.stringify(this.orderTypeData) === '{}') {
259
       if (JSON.stringify(this.orderTypeData) === '{}') {
259
         this.ruleForm.source = ''
260
         this.ruleForm.source = ''
260
       }
261
       }
262
+      
261
       this.getPositon()
263
       this.getPositon()
262
     },
264
     },
263
     methods: {
265
     methods: {

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

28
 <script>
28
 <script>
29
 import { getListExpt,getListExptIsdc } from '@/api/comDispatch/materialTransfer'
29
 import { getListExpt,getListExptIsdc } from '@/api/comDispatch/materialTransfer'
30
 import Pagination from '@/components/context/Pagination'
30
 import Pagination from '@/components/context/Pagination'
31
-import { exportData } from '@/utils'
31
+import { exportExcel } from '@/utils'
32
 
32
 
33
 export default {
33
 export default {
34
   name: 'List',
34
   name: 'List',
39
     return {
39
     return {
40
       loading: false,
40
       loading: false,
41
       keyword: '',
41
       keyword: '',
42
+      exporParams: {},
42
       pageParams: {
43
       pageParams: {
43
         pageindex: 1,
44
         pageindex: 1,
44
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
45
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
68
           stime: this.searchDate && this.searchDate[0],
69
           stime: this.searchDate && this.searchDate[0],
69
           etime: this.searchDate && this.searchDate[1]
70
           etime: this.searchDate && this.searchDate[1]
70
         }
71
         }
72
+        this.exporParams = Object.assign({isdc: 1},params)
71
         getListExpt(params).then((response) => {
73
         getListExpt(params).then((response) => {
72
           this.loading = false
74
           this.loading = false
73
           if (response.rows.length > 0) {
75
           if (response.rows.length > 0) {
83
       this.getList()
85
       this.getList()
84
     },
86
     },
85
     btn_export() {
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
         <select-order-type :third-order-type="thirdOrderTypeParam" @post-third-order-type="getthirdOrderType" />
15
         <select-order-type :third-order-type="thirdOrderTypeParam" @post-third-order-type="getthirdOrderType" />
16
       </el-form-item>
16
       </el-form-item>
17
       <el-form-item label="工单状态:">
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
       </el-form-item>
19
       </el-form-item>
20
       <el-form-item label="时间范围:">
20
       <el-form-item label="时间范围:">
21
         <el-col :span="16">
21
         <el-col :span="16">

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

61
 import treeToArray from './customEval'
61
 import treeToArray from './customEval'
62
 import addOrEditMenu from './components/addOrEditMenu'
62
 import addOrEditMenu from './components/addOrEditMenu'
63
 import menuBtn from './menuBtn'
63
 import menuBtn from './menuBtn'
64
+import {buildMenuTree,filterMenuDatas } from '@/utils'
64
 export default {
65
 export default {
65
   name: 'MenuSetup',
66
   name: 'MenuSetup',
66
   data() {
67
   data() {
87
       const keyword = this.keyword.replace(/\s+/g, '')
88
       const keyword = this.keyword.replace(/\s+/g, '')
88
       getMenuLists(keyword).then((response) => {
89
       getMenuLists(keyword).then((response) => {
89
         this.loading = false
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
     formatterTarget(row, column) {
94
     formatterTarget(row, column) {
171
           this.$message.info('已取消删除')
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
     // 获取父级id
176
     // 获取父级id
237
     getParents(poptions) {
177
     getParents(poptions) {
238
       this.parentids.unshift(poptions.id)
178
       this.parentids.unshift(poptions.id)

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

32
 <script>
32
 <script>
33
 import { getRoleLists, deleteRole, saveRoleList, getRoleTree } from '@/api/systemSetup/roleSetting/roleSetup'
33
 import { getRoleLists, deleteRole, saveRoleList, getRoleTree } from '@/api/systemSetup/roleSetting/roleSetup'
34
 import addOrEditRole from './addOrEditRole'
34
 import addOrEditRole from './addOrEditRole'
35
-import { pickerOptions } from '@/utils'
35
+import { pickerOptions,buildTree,filterTreeDatas } from '@/utils'
36
 import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
36
 import Pagination from '@/components/context/Pagination' // 对el-pagination 二次封装
37
 
37
 
38
 export default {
38
 export default {
175
       return new Promise((resolve) => {
175
       return new Promise((resolve) => {
176
         getRoleTree(this.role_id).then((response) => {
176
         getRoleTree(this.role_id).then((response) => {
177
           if (response.state.toLowerCase() === 'success') {
177
           if (response.state.toLowerCase() === 'success') {
178
-            this.treelists = this.buildTree(response.data)
178
+            this.treelists = filterTreeDatas(buildTree(response.data))
179
             if (this.role_id) {
179
             if (this.role_id) {
180
               // 获取ischecked数组 设置选中
180
               // 获取ischecked数组 设置选中
181
               const checkedKeys = this.getIsChecked(response.data)
181
               const checkedKeys = this.getIsChecked(response.data)
196
       }
196
       }
197
       return checkedArr
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
 </script>
202
 </script>

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

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

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

44
   } from '@/api/vehicleDispatch/vehicleScheduling.js'
44
   } from '@/api/vehicleDispatch/vehicleScheduling.js'
45
   import Pagination from '@/components/context/Pagination'
45
   import Pagination from '@/components/context/Pagination'
46
   import {
46
   import {
47
-    exportData
47
+    exportExcel
48
   } from '@/utils'
48
   } from '@/utils'
49
 
49
 
50
   export default {
50
   export default {
58
         keyword: '',
58
         keyword: '',
59
         startTime: '',
59
         startTime: '',
60
         orderId: '',
60
         orderId: '',
61
+        exporParams:{},
61
         pageParams: {
62
         pageParams: {
62
           pageindex: 1,
63
           pageindex: 1,
63
           pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
64
           pagesize: Number(this.$store.getters.serverConfig.PAGESIZE),
86
             pagesize: this.pageParams.pagesize, // 每页几条信息
87
             pagesize: this.pageParams.pagesize, // 每页几条信息
87
             keyword: this.keyword.replace(/\s+/g, '')
88
             keyword: this.keyword.replace(/\s+/g, '')
88
           }
89
           }
90
+          this.exporParams = Object.assign({isdc: 1},params)
89
           getListExpt(params).then((response) => {
91
           getListExpt(params).then((response) => {
90
             this.loading = false
92
             this.loading = false
91
             if (response.rows.length > 0) {
93
             if (response.rows.length > 0) {
101
         this.getList()
103
         this.getList()
102
       },
104
       },
103
       btn_export() {
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
     }