miaofuhao 11 mesi fa
parent
commit
b80936e7bc

+ 26 - 7
src/components/main/drawer-phone/index.vue

36
             <div class="p-6 bg-gradient-to-r from-blue-500 to-blue-600 rounded-t-lg text-white">
36
             <div class="p-6 bg-gradient-to-r from-blue-500 to-blue-600 rounded-t-lg text-white">
37
                 <div class="flex justify-between items-center mb-4">
37
                 <div class="flex justify-between items-center mb-4">
38
                     <div class="flex items-center space-x-2">
38
                     <div class="flex items-center space-x-2">
39
-                        <el-avatar :size="48" :src="currentCall.avatar" />
39
+                        <el-avatar :size="48" :src="defaultTubiao" />
40
                         <div>
40
                         <div>
41
                             <h3 class="font-semibold text-lg">{{ currentCall.name || '暂无姓名' }}</h3>
41
                             <h3 class="font-semibold text-lg">{{ currentCall.name || '暂无姓名' }}</h3>
42
                             <p class="text-sm opacity-90">{{ currentCall.phone || '暂无电话'}}</p>
42
                             <p class="text-sm opacity-90">{{ currentCall.phone || '暂无电话'}}</p>
131
                         <div class="flex items-center">
131
                         <div class="flex items-center">
132
                             <el-avatar :size="32" :src="defaultTubiao" class="mr-3" />
132
                             <el-avatar :size="32" :src="defaultTubiao" class="mr-3" />
133
                             <div>
133
                             <div>
134
-                                <p class="font-medium">{{ record.patientName || '未知' }}</p>
134
+                                <p class="font-medium">{{ record.phone || '未知' }}</p>
135
                                 <div class="flex items-center space-x-2">
135
                                 <div class="flex items-center space-x-2">
136
                                     <p class="text-xs text-gray-500">{{ record.answerTime }}</p>
136
                                     <p class="text-xs text-gray-500">{{ record.answerTime }}</p>
137
-                                    <p class="text-xs text-gray-500">{{ record.phone }}</p>
137
+                                    <!-- <p class="text-xs text-gray-500">{{ record.phone }}</p> -->
138
                                 </div>
138
                                 </div>
139
                             </div>
139
                             </div>
140
                         </div>
140
                         </div>
162
 import { useRouter } from 'vue-router';
162
 import { useRouter } from 'vue-router';
163
 import { getPageListData } from '@/api/main/system/system'
163
 import { getPageListData } from '@/api/main/system/system'
164
 import defaultTubiao from '@/assets/images/defaultTubiao.png'
164
 import defaultTubiao from '@/assets/images/defaultTubiao.png'
165
-import { getCallSate} from '@/utils/index';
165
+import { getCallSate,getUnprefixNuber} from '@/utils/index';
166
 
166
 
167
 const router = useRouter();
167
 const router = useRouter();
168
 import {
168
 import {
260
     // document.removeEventListener('mousemove', handleDrag);
260
     // document.removeEventListener('mousemove', handleDrag);
261
     // document.removeEventListener('mouseup', stopDrag);
261
     // document.removeEventListener('mouseup', stopDrag);
262
     initWs();
262
     initWs();
263
-    getCustomeData()
263
+    getcalllogData()
264
+
264
 });
265
 });
265
 
266
 
266
 const stateObj = {
267
 const stateObj = {
329
                     break
330
                     break
330
                 case 'incoming': // 来电
331
                 case 'incoming': // 来电
331
                     {
332
                     {
332
-                        currentCall.value.phone = telWSData.Number
333
+                        currentCall.value.phone = getUnprefixNuber(telWSData.Number) 
333
                         currentCall.value.truePhone = hidePhone(telWSData.Number)
334
                         currentCall.value.truePhone = hidePhone(telWSData.Number)
335
+                        getUserInfo(currentCall.value.phone)
334
                         router.push({
336
                         router.push({
335
                             path: '/inComming/callScreen/' + telWSData.Number,
337
                             path: '/inComming/callScreen/' + telWSData.Number,
336
                             query: {
338
                             query: {
475
 
477
 
476
 ];
478
 ];
477
 const callHistory  = ref([])
479
 const callHistory  = ref([])
478
-function getCustomeData() {
480
+
481
+function getcalllogData() {
479
   callHistory.value = []
482
   callHistory.value = []
480
   const params = {
483
   const params = {
481
     pageNum: 1,
484
     pageNum: 1,
489
     }
492
     }
490
   )
493
   )
491
 }
494
 }
495
+
496
+function getUserInfo(phoneNumber) {
497
+  
498
+  getPageListData('/patient/patient', { phoneNumber }).then(
499
+    ({ data, total }) => {
500
+      const newArray = data[0]
501
+      console.log(newArray)
502
+      currentCall.value = {
503
+        name: newArray.name,
504
+        phone: phoneNumber,
505
+        avatar: newArray.avatar,
506
+        location:  newArray.address
507
+      }
508
+    }
509
+  )
510
+}
492
 const dialKeys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#'];
511
 const dialKeys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#'];
493
 
512
 
494
 
513
 

+ 16 - 0
src/components/page-order/index.vue

53
 import useSelectStore from '@/store/commonSelect/common';
53
 import useSelectStore from '@/store/commonSelect/common';
54
 import { ElMessage } from 'element-plus';
54
 import { ElMessage } from 'element-plus';
55
 import { getPageListData, editPageData, createPageData } from '@/api/main/system/system';
55
 import { getPageListData, editPageData, createPageData } from '@/api/main/system/system';
56
+import { getUnprefixNuber} from '@/utils/index';
56
 
57
 
57
 const formRef: any = ref(null);
58
 const formRef: any = ref(null);
58
 let form = ref({
59
 let form = ref({
71
         type: Object,
72
         type: Object,
72
         default: () => ({}),
73
         default: () => ({}),
73
     },
74
     },
75
+    propRecordData: {
76
+        type: Object,
77
+        default: () => ({}),
78
+    }
74
 });
79
 });
75
 watch(props, (nweProps) => {
80
 watch(props, (nweProps) => {
76
     initMethod(props);
81
     initMethod(props);
93
             department: '',
98
             department: '',
94
         }
99
         }
95
     }
100
     }
101
+    console.log(props.propRecordData)
102
+    if (props.propRecordData.id) {
103
+        form.value = {
104
+            callId: props.propRecordData.id,
105
+            phone: getUnprefixNuber(props.propRecordData.phone),
106
+            handleMethod:'1'
107
+        }
108
+    }
96
 }
109
 }
97
 
110
 
98
 const emit = defineEmits(["refreshOrder", "orderTypeChange"]);
111
 const emit = defineEmits(["refreshOrder", "orderTypeChange"]);
158
                 isend: +form.value.handleMethod,
171
                 isend: +form.value.handleMethod,
159
                 workordercate: form.value.type[form.value.type.length - 1],
172
                 workordercate: form.value.type[form.value.type.length - 1],
160
             };
173
             };
174
+            if (form.value.callId) {
175
+                params.callId = form.value.callId
176
+            }
161
             // 提交表单
177
             // 提交表单
162
             if (form.value.id) {
178
             if (form.value.id) {
163
                 params.workorderId = form.value.id;
179
                 params.workorderId = form.value.id;

+ 32 - 1
src/utils/index.js

53
   }
53
   }
54
   return typeStr + '-' + stateStr
54
   return typeStr + '-' + stateStr
55
 }
55
 }
56
+// export function getUnprefixNuber(teleNuber) {
57
+//   let resultValue = ''
58
+//   if (teleNuber) {
59
+//     const dataValue =  teleNuber.toString()
60
+//     if (dataValue.length=== 12) {
61
+//       if(dataValue.substr(0, 2) == '01'){
62
+//         resultValue  = dataValue.substring(1,12)
63
+//       }
64
+//     }else{
65
+//       resultValue = dataValue
66
+//     }
67
+//   }
68
+  
69
+//   return resultValue
70
+// }
56
 export function getUnprefixNuber(teleNuber) {
71
 export function getUnprefixNuber(teleNuber) {
57
   let resultValue = ''
72
   let resultValue = ''
58
   if (teleNuber) {
73
   if (teleNuber) {
59
     const dataValue =  teleNuber.toString()
74
     const dataValue =  teleNuber.toString()
60
-    if (dataValue.length=== 12) {
75
+    // if (dataValue.length=== 12) {
76
+    //   if(dataValue.substr(0, 2) == '01'){
77
+    //     resultValue  = dataValue.substring(1,12)
78
+    //   }
79
+    // }else{
80
+    //   resultValue = dataValue
81
+    // }
82
+    if (dataValue.length === 12) {
61
       if(dataValue.substr(0, 2) == '01'){
83
       if(dataValue.substr(0, 2) == '01'){
62
         resultValue  = dataValue.substring(1,12)
84
         resultValue  = dataValue.substring(1,12)
63
       }
85
       }
86
+      
87
+      if (dataValue.startsWith(9)) {
88
+        resultValue = dataValue.substring(1,12)
89
+      }
90
+      
91
+    }else if (dataValue.length === 13) {
92
+      if(dataValue.substr(0, 2) == '90'){
93
+        resultValue  = dataValue.substring(2,13)
94
+      }
64
     }else{
95
     }else{
65
       resultValue = dataValue
96
       resultValue = dataValue
66
     }
97
     }

+ 14 - 9
src/views/main/telephone/callRecord/callRecord.vue

36
       </template>
36
       </template>
37
       <template #recordCreatOrderHandler="scope">
37
       <template #recordCreatOrderHandler="scope">
38
         <el-button
38
         <el-button
39
-          v-if="!scope.row.callType"
39
+          v-if="scope.row.callType === 1"
40
           size="small"
40
           size="small"
41
           type="primary"
41
           type="primary"
42
           text
42
           text
61
       :modal="false"
61
       :modal="false"
62
       :show-close="true"
62
       :show-close="true"
63
     >
63
     >
64
-      <add-order
64
+    
65
+      <page-order
65
         :OrderSource="'话务'"
66
         :OrderSource="'话务'"
66
-        :porpRecordData="recordData"
67
-        @handleClose="getDialogHandle"
68
-      ></add-order>
67
+        :propRecordData="recordData"
68
+        @refreshOrder="getDialogHandle"
69
+      ></page-order>
69
     </el-dialog>
70
     </el-dialog>
70
     <handle v-if="openViewOrder" v-model:dialogVisible="openViewOrder" :rowData="clRowData">
71
     <handle v-if="openViewOrder" v-model:dialogVisible="openViewOrder" :rowData="clRowData">
71
     </handle>
72
     </handle>
78
   import PageSearch from '@/components/page-search';
79
   import PageSearch from '@/components/page-search';
79
   import PageContent from '@/components/page-content';
80
   import PageContent from '@/components/page-content';
80
   import audioPlayer from './cpns/audioPlayer';
81
   import audioPlayer from './cpns/audioPlayer';
82
+
81
   import addOrder from '@/components/workOrder/add-order/add-order';
83
   import addOrder from '@/components/workOrder/add-order/add-order';
84
+  import pageOrder from '@/components/page-order';
85
+
82
   import handle from '@/components/workOrder/handle';
86
   import handle from '@/components/workOrder/handle';
83
 
87
 
84
   import { searchFormConfig } from './config/search.config';
88
   import { searchFormConfig } from './config/search.config';
103
       PageContent,
107
       PageContent,
104
       audioPlayer,
108
       audioPlayer,
105
       addOrder,
109
       addOrder,
110
+      pageOrder,
106
       handle,
111
       handle,
107
     },
112
     },
108
     setup() {
113
     setup() {
136
         open.value = true;
141
         open.value = true;
137
       };
142
       };
138
 
143
 
139
-      const getDialogHandle = (data) => {
140
-        if (data) {
141
-          openCreatOrder.value = false;
144
+      const getDialogHandle = () => {
145
+        openCreatOrder.value = false;
142
           useSystemStore().getPageListAction({
146
           useSystemStore().getPageListAction({
143
             pageName: '/call/calllog',
147
             pageName: '/call/calllog',
144
             queryInfo: {
148
             queryInfo: {
146
               pageSize: 10,
150
               pageSize: 10,
147
             },
151
             },
148
           });
152
           });
149
-        }
150
       };
153
       };
151
       const handleOrderCall = (data) => {
154
       const handleOrderCall = (data) => {
152
         if (data.workordercode) {
155
         if (data.workordercode) {
158
           router.push({ path: '/workHandle' });
161
           router.push({ path: '/workHandle' });
159
         } else {
162
         } else {
160
           recordData.value = data;
163
           recordData.value = data;
164
+          console.log(recordData.value)
161
           openCreatOrder.value = true;
165
           openCreatOrder.value = true;
162
         }
166
         }
163
       };
167
       };
212
         openCreatOrder,
216
         openCreatOrder,
213
         openViewOrder,
217
         openViewOrder,
214
         addOrder,
218
         addOrder,
219
+        pageOrder,
215
         filePath,
220
         filePath,
216
         getDialogHandle,
221
         getDialogHandle,
217
         handleViewData,
222
         handleViewData,