Browse Source

代码提交

miaofuhao 11 months ago
parent
commit
b80936e7bc

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

@@ -36,7 +36,7 @@
36 36
             <div class="p-6 bg-gradient-to-r from-blue-500 to-blue-600 rounded-t-lg text-white">
37 37
                 <div class="flex justify-between items-center mb-4">
38 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 40
                         <div>
41 41
                             <h3 class="font-semibold text-lg">{{ currentCall.name || '暂无姓名' }}</h3>
42 42
                             <p class="text-sm opacity-90">{{ currentCall.phone || '暂无电话'}}</p>
@@ -131,10 +131,10 @@
131 131
                         <div class="flex items-center">
132 132
                             <el-avatar :size="32" :src="defaultTubiao" class="mr-3" />
133 133
                             <div>
134
-                                <p class="font-medium">{{ record.patientName || '未知' }}</p>
134
+                                <p class="font-medium">{{ record.phone || '未知' }}</p>
135 135
                                 <div class="flex items-center space-x-2">
136 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 138
                                 </div>
139 139
                             </div>
140 140
                         </div>
@@ -162,7 +162,7 @@ import { hidePhone } from '@/utils/tools';
162 162
 import { useRouter } from 'vue-router';
163 163
 import { getPageListData } from '@/api/main/system/system'
164 164
 import defaultTubiao from '@/assets/images/defaultTubiao.png'
165
-import { getCallSate} from '@/utils/index';
165
+import { getCallSate,getUnprefixNuber} from '@/utils/index';
166 166
 
167 167
 const router = useRouter();
168 168
 import {
@@ -260,7 +260,8 @@ onMounted(() => {
260 260
     // document.removeEventListener('mousemove', handleDrag);
261 261
     // document.removeEventListener('mouseup', stopDrag);
262 262
     initWs();
263
-    getCustomeData()
263
+    getcalllogData()
264
+
264 265
 });
265 266
 
266 267
 const stateObj = {
@@ -329,8 +330,9 @@ const initWs = () => {
329 330
                     break
330 331
                 case 'incoming': // 来电
331 332
                     {
332
-                        currentCall.value.phone = telWSData.Number
333
+                        currentCall.value.phone = getUnprefixNuber(telWSData.Number) 
333 334
                         currentCall.value.truePhone = hidePhone(telWSData.Number)
335
+                        getUserInfo(currentCall.value.phone)
334 336
                         router.push({
335 337
                             path: '/inComming/callScreen/' + telWSData.Number,
336 338
                             query: {
@@ -475,7 +477,8 @@ const callActions = [
475 477
 
476 478
 ];
477 479
 const callHistory  = ref([])
478
-function getCustomeData() {
480
+
481
+function getcalllogData() {
479 482
   callHistory.value = []
480 483
   const params = {
481 484
     pageNum: 1,
@@ -489,6 +492,22 @@ function getCustomeData() {
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 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,6 +53,7 @@ import transport from './src/form/transport';
53 53
 import useSelectStore from '@/store/commonSelect/common';
54 54
 import { ElMessage } from 'element-plus';
55 55
 import { getPageListData, editPageData, createPageData } from '@/api/main/system/system';
56
+import { getUnprefixNuber} from '@/utils/index';
56 57
 
57 58
 const formRef: any = ref(null);
58 59
 let form = ref({
@@ -71,6 +72,10 @@ const props = defineProps({
71 72
         type: Object,
72 73
         default: () => ({}),
73 74
     },
75
+    propRecordData: {
76
+        type: Object,
77
+        default: () => ({}),
78
+    }
74 79
 });
75 80
 watch(props, (nweProps) => {
76 81
     initMethod(props);
@@ -93,6 +98,14 @@ const initMethod = (props) => {
93 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 111
 const emit = defineEmits(["refreshOrder", "orderTypeChange"]);
@@ -158,6 +171,9 @@ const submit = async () => {
158 171
                 isend: +form.value.handleMethod,
159 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 178
             if (form.value.id) {
163 179
                 params.workorderId = form.value.id;

+ 32 - 1
src/utils/index.js

@@ -53,14 +53,45 @@ export function getCallSate(type, state) {
53 53
   }
54 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 71
 export function getUnprefixNuber(teleNuber) {
57 72
   let resultValue = ''
58 73
   if (teleNuber) {
59 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 83
       if(dataValue.substr(0, 2) == '01'){
62 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 95
     }else{
65 96
       resultValue = dataValue
66 97
     }

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

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