seimin 3 月之前
父節點
當前提交
0b68c62328

+ 1 - 1
components/IncidentAttachment.vue

@@ -1,7 +1,7 @@
1
 <template>
1
 <template>
2
   <view class="container" @touchmove.stop.prevent>
2
   <view class="container" @touchmove.stop.prevent>
3
     <view class="container_head">
3
     <view class="container_head">
4
-      {{incidentData.reqAttachment ? '报修图片' : ''}}{{incidentData.reqAttachment && incidentData.callID ? '及' : ''}}{{incidentData.callID ? '录音' : ''}}
4
+      {{incidentData.reqAttachment ? '报修图片' : ''}}{{incidentData.reqAttachment && incidentData.callID ? '及' : ''}}{{incidentData.callID ? '通话录音' : ''}}
5
     </view>
5
     </view>
6
     <view class="container_form">
6
     <view class="container_form">
7
       <view class="repairImgList" v-if="incidentData.reqAttachment">
7
       <view class="repairImgList" v-if="incidentData.reqAttachment">

+ 132 - 0
components/RequireAttachment.vue

@@ -0,0 +1,132 @@
1
+<template>
2
+  <view class="container" @touchmove.stop.prevent>
3
+    <view class="container_head">
4
+      报修录音
5
+    </view>
6
+    <view class="container_form">
7
+      <view class="audio" v-if="incidentData.reqRecord">
8
+        <sy-audio ref="audio" isCountDown :src='pageData.audioSrc' audioTitle="" subheading=""></sy-audio>
9
+      </view>
10
+    </view>
11
+    <view class="container_foot">
12
+      <view class="foot_btns">
13
+        <view class="know" @click="know">知道了</view>
14
+      </view>
15
+    </view>
16
+  </view>
17
+  <view class="mask" @touchmove.stop.prevent></view>
18
+</template>
19
+
20
+<script setup>
21
+  import { defineEmits, ref, reactive, defineProps } from 'vue'
22
+  import { onLoad } from '@dcloudio/uni-app'
23
+  import { useLoginUserStore } from '@/stores/loginUser'
24
+  import { api_wechatIncidentRecord } from "@/http/api.js"
25
+
26
+  const emit = defineEmits(['cancelEmit', 'knowEmit']);
27
+  const { incidentData } = defineProps({
28
+    incidentData: Object,
29
+  });
30
+  const loginUserStore = useLoginUserStore();
31
+
32
+  // 页面数据
33
+  const pageData = reactive({
34
+    audioSrc: '',//音频
35
+  });
36
+
37
+  const audio = ref(null);
38
+
39
+  // 取消
40
+  function cancel(){
41
+    emit('cancelEmit')
42
+  }
43
+
44
+  // 确认
45
+  function know(){
46
+    audio.value && audio.value.audioDestroy()
47
+    emit('knowEmit');
48
+  }
49
+
50
+  // 获取报修录音
51
+  function getRepairAudio() {
52
+    uni.showLoading({
53
+      title: "加载中",
54
+      mask: true,
55
+    });
56
+    api_wechatIncidentRecord(incidentData.id).then((res) => {
57
+        uni.hideLoading();
58
+        res.data = res.data || [];
59
+        res.data.forEach(v => {
60
+          v.previewUrl = location.origin + "/file" + v.relativeFilePath;
61
+        })
62
+        res.data[0] && (pageData.audioSrc = res.data[0].previewUrl);
63
+      });
64
+  }
65
+
66
+  onLoad((option) => {
67
+    incidentData.reqRecord && getRepairAudio();
68
+  })
69
+</script>
70
+
71
+<style lang="scss" scoped>
72
+.mask{
73
+  position: fixed;
74
+  left: 0;
75
+  top: 0;
76
+  right: 0;
77
+  bottom: 0;
78
+  background-color: rgba(0, 0, 0, 0.4);
79
+  z-index: 999;
80
+}
81
+.container{
82
+  position: fixed;
83
+  left: 50%;
84
+  top: 50%;
85
+  transform: translate(-50%, -50%);
86
+  z-index: 9999;
87
+  width: 690rpx;
88
+  background-color: #fff;
89
+  border-radius: 10rpx;
90
+
91
+  .container_head{
92
+    padding: 55rpx;
93
+    font-size: 32rpx;
94
+    color: #333;
95
+    text-align: center;
96
+  }
97
+
98
+  .container_form{
99
+    padding: 0 55rpx;
100
+    .repairImgList{
101
+      margin-bottom: 55rpx;
102
+      display: flex;
103
+      justify-content: space-between;
104
+      align-items: center;
105
+      gap: 15rpx;
106
+      .repairImg{
107
+        width: 184rpx;
108
+        height: 186rpx;
109
+      }
110
+    }
111
+
112
+    .audio{
113
+      margin-bottom: 45rpx;
114
+    }
115
+  }
116
+
117
+  .container_foot{
118
+    .foot_btns{
119
+      display: flex;
120
+      border-top: 1rpx solid #DDDDDD;
121
+      .know{
122
+        flex: 1;
123
+        font-size: 32rpx;
124
+        padding: 30rpx;
125
+        display: flex;
126
+        justify-content: center;
127
+        color: $uni-primary;
128
+      }
129
+    }
130
+  }
131
+}
132
+</style>

+ 14 - 0
http/api.js

@@ -71,6 +71,13 @@ export function api_wechatRequesterIncident(data){
71
 }
71
 }
72
 
72
 
73
 /**
73
 /**
74
+ * 获取报修录音
75
+ */
76
+export function api_wechatIncidentRecord(data){
77
+  return get("/common/common/listAttachment/wechatIncidentRecord/" + data);
78
+}
79
+
80
+/**
74
  * 获取通话音频
81
  * 获取通话音频
75
  */
82
  */
76
 export function api_callrecord(data){
83
 export function api_callrecord(data){
@@ -315,4 +322,11 @@ export function api_repairScanCode(data){
315
 // 报修工单撤回
322
 // 报修工单撤回
316
 export function api_repairCancel(data){
323
 export function api_repairCancel(data){
317
   return post("/flow/incident/task/cancel", data);
324
   return post("/flow/incident/task/cancel", data);
325
+}
326
+
327
+/**
328
+ * 获取科室详情
329
+ */
330
+export function api_departmentDetail(id){
331
+  return get("/simple/data/fetchData/department/" + id);
318
 }
332
 }

+ 18 - 1
pages/assign/assign.vue

@@ -809,6 +809,11 @@
809
   
809
   
810
   // 处理提交事件
810
   // 处理提交事件
811
   async function handlerOrder(){
811
   async function handlerOrder(){
812
+    let repairIncidentTypeList = await api_getDictionary({
813
+      "key": 'repair_incident_type',
814
+      "type": "list",
815
+    })
816
+    repairIncidentTypeList = repairIncidentTypeList || [];
812
     let postData = {
817
     let postData = {
813
       incident: dataInfo.incidentData,
818
       incident: dataInfo.incidentData,
814
 			solutionId: solutionId.value
819
 			solutionId: solutionId.value
@@ -824,6 +829,7 @@
824
     //   });
829
     //   });
825
     //   return;
830
     //   return;
826
     // }
831
     // }
832
+    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
827
 		postData.incident.place = {}
833
 		postData.incident.place = {}
828
 		postData.incident.place.id = floorId.value
834
 		postData.incident.place.id = floorId.value
829
     postData.incident.handleDescription = dataInfo.handleDescription;
835
     postData.incident.handleDescription = dataInfo.handleDescription;
@@ -842,6 +848,11 @@
842
   
848
   
843
   // 补单提交事件
849
   // 补单提交事件
844
   async function supplementOrder(){
850
   async function supplementOrder(){
851
+    let repairIncidentTypeList = await api_getDictionary({
852
+      "key": 'repair_incident_type',
853
+      "type": "list",
854
+    })
855
+    repairIncidentTypeList = repairIncidentTypeList || [];
845
     let postData = {
856
     let postData = {
846
       incident: dataInfo.incidentData,
857
       incident: dataInfo.incidentData,
847
 			solutionId: solutionId.value
858
 			solutionId: solutionId.value
@@ -861,6 +872,7 @@
861
     // if(HandleData.simpleness==1){
872
     // if(HandleData.simpleness==1){
862
     // 	dataInfo.closecode = '1'
873
     // 	dataInfo.closecode = '1'
863
     // }
874
     // }
875
+    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
864
 		postData.incident.place = {}
876
 		postData.incident.place = {}
865
 		postData.incident.place.id = floorId.value
877
 		postData.incident.place.id = floorId.value
866
     postData.incident.handleDescription = dataInfo.handleDescription;
878
     postData.incident.handleDescription = dataInfo.handleDescription;
@@ -897,6 +909,11 @@
897
   
909
   
898
   // 派单提交事件
910
   // 派单提交事件
899
   async function assignOrder(){
911
   async function assignOrder(){
912
+    let repairIncidentTypeList = await api_getDictionary({
913
+      "key": 'repair_incident_type',
914
+      "type": "list",
915
+    })
916
+    repairIncidentTypeList = repairIncidentTypeList || [];
900
     let postData = {
917
     let postData = {
901
       incident: dataInfo.incidentData,
918
       incident: dataInfo.incidentData,
902
     }
919
     }
@@ -912,7 +929,7 @@
912
     //   });
929
     //   });
913
     //   return;
930
     //   return;
914
     // }
931
     // }
915
-    
932
+    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
916
 		postData.incident.place = {}
933
 		postData.incident.place = {}
917
 		postData.incident.place.id = floorId.value
934
 		postData.incident.place.id = floorId.value
918
 		postData.incident.candidateGroupId = dataInfo.groupId;
935
 		postData.incident.candidateGroupId = dataInfo.groupId;

+ 19 - 4
pages/incidentList/incidentList.vue

@@ -36,9 +36,10 @@
36
             <text class="name" v-else>
36
             <text class="name" v-else>
37
               <template v-if="computedSynergetic(data.synergetic)">,{{computedSynergetic(data.synergetic)}}</template>
37
               <template v-if="computedSynergetic(data.synergetic)">,{{computedSynergetic(data.synergetic)}}</template>
38
             </text>
38
             </text>
39
-            <view class="icon_all" @click.stop="attachmentClick(data)">
40
-              <uni-icons type="mic-filled" class="mic-filled" :size="22" color="#949494" v-if="data.callID"></uni-icons>
41
-              <uni-icons type="image-filled" class="image-filled" :size="22" color="#949494" v-if="data.reqAttachment"></uni-icons>
39
+            <view class="icon_all">
40
+              <text class="mic-filled" v-if="data.callID" @click.stop="attachmentClick(data)"><uni-icons type="mic-filled" :size="22" color="#949494"></uni-icons></text>
41
+              <text class="mic-filled" v-if="data.reqRecord" @click.stop="attachmentRequireClick(data)"><uni-icons type="mic-filled" :size="22" color="#949494"></uni-icons></text>
42
+              <text class="image-filled" v-if="data.reqAttachment" @click.stop="attachmentClick(data)"><uni-icons type="image-filled" :size="22" color="#949494"></uni-icons></text>
42
             </view>
43
             </view>
43
           </view>
44
           </view>
44
         </view>
45
         </view>
@@ -61,12 +62,14 @@
61
     </view>
62
     </view>
62
     <IncidentListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></IncidentListFilter>
63
     <IncidentListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></IncidentListFilter>
63
     <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
64
     <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
65
+    <RequireAttachment v-if="dataInfo.isRequireAttachment" @knowEmit="knowRequireAttachment" :incidentData="dataInfo.incidentData"></RequireAttachment>
64
   </view>
66
   </view>
65
 </template>
67
 </template>
66
 
68
 
67
 <script setup>
69
 <script setup>
68
   import IncidentListFilter from '@/components/IncidentListFilter.vue';
70
   import IncidentListFilter from '@/components/IncidentListFilter.vue';
69
   import IncidentAttachment from '@/components/IncidentAttachment.vue';
71
   import IncidentAttachment from '@/components/IncidentAttachment.vue';
72
+  import RequireAttachment from '@/components/RequireAttachment.vue';
70
   import { startOfDay, endOfDay, format, add } from 'date-fns'
73
   import { startOfDay, endOfDay, format, add } from 'date-fns'
71
   import { ref, reactive, computed } from 'vue'
74
   import { ref, reactive, computed } from 'vue'
72
   import { onLoad, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
75
   import { onLoad, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
@@ -133,7 +136,8 @@
133
     idx: 0,//页码
136
     idx: 0,//页码
134
     hasMore: true,//是否有更多数据
137
     hasMore: true,//是否有更多数据
135
     isFilter: false,//筛选框开关
138
     isFilter: false,//筛选框开关
136
-    isAttachment: false,//图片和录音开关
139
+    isAttachment: false,//图片和通话录音开关
140
+    isRequireAttachment: false,//报修录音开关
137
     incidentId: undefined,
141
     incidentId: undefined,
138
     evtFilter: {
142
     evtFilter: {
139
       hospital: {},
143
       hospital: {},
@@ -205,6 +209,17 @@
205
   function knowAttachment(){
209
   function knowAttachment(){
206
     dataInfo.isAttachment = false;
210
     dataInfo.isAttachment = false;
207
   }
211
   }
212
+  
213
+  // 点击报修录音
214
+  function attachmentRequireClick(incidentData){
215
+    dataInfo.incidentData = incidentData;
216
+    dataInfo.isRequireAttachment = true;
217
+  }
218
+
219
+  // 知道了报修录音
220
+  function knowRequireAttachment(){
221
+    dataInfo.isRequireAttachment = false;
222
+  }
208
 
223
 
209
   // 处理按钮
224
   // 处理按钮
210
   function handler(type, incidentId){
225
   function handler(type, incidentId){

+ 8 - 9
pages/repair/rapidRepNext.vue

@@ -107,7 +107,7 @@
107
   import NumberModal from '@/components/NumberModal.vue';
107
   import NumberModal from '@/components/NumberModal.vue';
108
   import { onLoad } from '@dcloudio/uni-app'
108
   import { onLoad } from '@dcloudio/uni-app'
109
   import { generateNumberArray } from '@/utils/index.js'
109
   import { generateNumberArray } from '@/utils/index.js'
110
-  import { api_getDictionary, api_sj,api_request, getFetchDataList, api_place, api_getSolution, api_area, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_department, api_querySummaryDoc, api_addSummaryDoc } from "@/http/api.js"
110
+  import { api_getDictionary, api_sj,api_request, getFetchDataList, api_place, api_getSolution, api_area, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_department, api_querySummaryDoc, api_addSummaryDoc, api_departmentDetail } from "@/http/api.js"
111
   import { defaultColor } from '@/static/js/theme.js'
111
   import { defaultColor } from '@/static/js/theme.js'
112
   import { useSetTitle } from '@/share/useSetTitle.js'
112
   import { useSetTitle } from '@/share/useSetTitle.js'
113
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
113
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
@@ -500,7 +500,7 @@
500
   }
500
   }
501
   
501
   
502
   // 处理提交事件
502
   // 处理提交事件
503
-  function handlerOrder(){
503
+   async function handlerOrder(){
504
 		let postData = {
504
 		let postData = {
505
 		  incident: dataInfo.incidentData,
505
 		  incident: dataInfo.incidentData,
506
 			serverId: ''
506
 			serverId: ''
@@ -509,17 +509,17 @@
509
 		if(dataInfo.tabActiveValue === 'doing'){
509
 		if(dataInfo.tabActiveValue === 'doing'){
510
 			let data = repairIncident.value.find(i=>i.value=='dept')
510
 			let data = repairIncident.value.find(i=>i.value=='dept')
511
 			dataInfo.incidentData.repairIncidentType.id = data.id
511
 			dataInfo.incidentData.repairIncidentType.id = data.id
512
-			let deptItem = dataInfo.repairTypeList.find(i=>i.value == dataInfo.department)
513
-			console.log(333,deptItem)
514
-			if(deptItem){
515
-				postData.incident.place.id = deptItem.floor.id
516
-			}
512
+      let result = await api_departmentDetail(dataInfo.department);
513
+      let deptDTO = result.data || {};
514
+      postData.incident.place.id = deptDTO.floor ? deptDTO.floor.id : undefined;
515
+      postData.incident.houseNumber = deptDTO.address || undefined;
517
 		}else if(dataInfo.tabActiveValue === 'overtime'){
516
 		}else if(dataInfo.tabActiveValue === 'overtime'){
518
 			let data = repairIncident.value.find(i=>i.value=='public')
517
 			let data = repairIncident.value.find(i=>i.value=='public')
519
 			dataInfo.incidentData.repairIncidentType.id = data.id
518
 			dataInfo.incidentData.repairIncidentType.id = data.id
520
 			postData.incident.place.id = dataInfo.placeId;
519
 			postData.incident.place.id = dataInfo.placeId;
520
+      postData.incident.houseNumber = dataInfo.address;
521
 		}
521
 		}
522
-		dataInfo.incidentData.department.id = dataInfo.department
522
+    dataInfo.incidentData.department.id = dataInfo.department
523
     postData.incident.description = dataInfo.description;
523
     postData.incident.description = dataInfo.description;
524
 		if(dataInfo.serverId){
524
 		if(dataInfo.serverId){
525
 			postData.serverId = dataInfo.serverId;
525
 			postData.serverId = dataInfo.serverId;
@@ -527,7 +527,6 @@
527
 			delete postData.serverId 
527
 			delete postData.serverId 
528
 		}
528
 		}
529
     postData.incident.assetId = dataInfo.assetId;
529
     postData.incident.assetId = dataInfo.assetId;
530
-		postData.incident.houseNumber = dataInfo.address;
531
 		postData.incident.contacts = dataInfo.contacts;
530
 		postData.incident.contacts = dataInfo.contacts;
532
 		postData.incident.contactsInformation = dataInfo.contactsInformation;
531
 		postData.incident.contactsInformation = dataInfo.contactsInformation;
533
 		postData.incident.hosId = dataInfo.branch;
532
 		postData.incident.hosId = dataInfo.branch;