소스 검색

长江水利需求开发

maotao 1 개월 전
부모
커밋
8828278121

+ 1 - 1
App.vue

@@ -9,7 +9,7 @@
9 9
 		},
10 10
 		onHide: function() {
11 11
 			uni.setStorageSync('repairData','')
12
-			uni.setStorageSync('rapidRepNext','')
12
+			// uni.setStorageSync('rapidRepNext','')
13 13
 			uni.removeStorageSync('pollingCode')
14 14
 			console.log('App Hide')
15 15
 		}

+ 29 - 1
components/IncidentAttachment.vue

@@ -10,6 +10,9 @@
10 10
       <view class="audio" v-if="incidentData.callID">
11 11
         <sy-audio ref="audio" isCountDown :src='pageData.audioSrc' audioTitle="" subheading=""></sy-audio>
12 12
       </view>
13
+			<view class="audio" v-if="incidentData.type && incidentData.path">
14
+			  <sy-audio ref="audio" isCountDown :src='pageData.audioSrc' audioTitle="" subheading=""></sy-audio>
15
+			</view>
13 16
     </view>
14 17
     <view class="container_foot">
15 18
       <view class="foot_btns">
@@ -119,10 +122,35 @@
119 122
 
120 123
     });
121 124
   }
122
-
125
+	
126
+	// 获取通话录音
127
+	function getCallrecordDifferent(){
128
+		uni.showLoading({
129
+		  title: "加载中",
130
+		  mask: true,
131
+		});
132
+		let postData = {
133
+		  path: incidentData.path,
134
+			hosId: incidentData.hosId
135
+		};
136
+		api_getRecordCall(postData).then((res)=>{
137
+			uni.hideLoading();
138
+			if(res.state == 200){
139
+				// pageData.audioSrc = '192.168.3.108' + res.relativePath;
140
+			  pageData.audioSrc = location.origin + res.relativePath;
141
+			}else{
142
+			  uni.showToast({
143
+			    icon: 'none',
144
+			    title: res.error || '请求数据失败!'
145
+			  });
146
+			}
147
+		})
148
+	}
149
+	
123 150
   onLoad((option) => {
124 151
     incidentData.reqAttachment && getRepairImgs();
125 152
     incidentData.callID && getCallrecord();
153
+		incidentData.type=='call' && incidentData.path && getCallrecordDifferent();
126 154
   })
127 155
 </script>
128 156
 

+ 386 - 0
components/callFilter.vue

@@ -0,0 +1,386 @@
1
+<template>
2
+  <view class="container" @touchmove.stop.prevent>
3
+    <view class="container_form">
4
+      <view class="hospital">
5
+        <view class="name">开始通话时间区间</view>
6
+				<view>
7
+					<uni-datetime-picker v-model="searchData.datetimerange" 
8
+					type="datetimerange" rangeSeparator="至" @change="changeDate($event)"/>
9
+				</view>
10
+      </view>
11
+
12
+      <view class="hospital">
13
+        <view class="name">已接/未接</view>
14
+        <view class="tabs">
15
+          <view class="tab" :class="{active: tab.value === searchData.selected1}" v-for="tab in tabs1" :key="tab.value" @click="clickTab(tab,1)">{{tab.name}}<text class="newicon newicon-xuanzejiaobiao"></text></view>
16
+        </view>
17
+      </view>
18
+			
19
+			<view class="hospital">
20
+			  <view class="name">呼入/呼出</view>
21
+			  <view class="tabs">
22
+			    <view class="tab" :class="{active: tab.value === searchData.selected2}" v-for="tab in tabs2" :key="tab.value" @click="clickTab(tab,2)">{{tab.name}}<text class="newicon newicon-xuanzejiaobiao"></text></view>
23
+			  </view>
24
+			</view>
25
+			
26
+			<view class="category">
27
+			  <text class="name">主叫号码</text>
28
+				<input class="uni-input" v-model="searchData.dialing"  placeholder="请输入主叫号码" />
29
+			</view>
30
+			
31
+			<view class="category">
32
+			  <text class="name">被叫号码</text>
33
+			  <input class="uni-input" v-model="searchData.called"  placeholder="请输入被叫号码" />
34
+			</view>
35
+<!--      <view class="acceptDate" @click="changeIsShowDate()">
36
+        <text class="name">登记时间</text>
37
+        <text class="value ellipsis" v-if="searchData.acceptDate.length">{{searchData.acceptDate[0] || ''}}至{{searchData.acceptDate[1] || ''}}</text>
38
+        <text class="value ellipsis" v-else>全部</text>
39
+      </view> -->
40
+    </view>
41
+    <view class="container_foot">
42
+      <view class="clear" @click="clear">清除选项</view>
43
+      <view class="foot_btns">
44
+        <view class="cancel" @click="cancel">取消</view>
45
+        <view class="confirm" @click="confirm">确认</view>
46
+      </view>
47
+    </view>
48
+  </view>
49
+
50
+  <view class="mask" @touchmove.stop.prevent></view>
51
+  <view class="line" @touchmove.stop.prevent></view>
52
+
53
+</template>
54
+
55
+<script setup>
56
+  import PyhRdtpicker from '@/components/PyhRdtpicker/PyhRdtpicker.vue';
57
+  import { defineEmits, ref, reactive, defineProps } from 'vue'
58
+  import { subMonths, startOfMonth, endOfMonth, format, add, setDate } from 'date-fns'
59
+  import { onLoad } from '@dcloudio/uni-app'
60
+  import { useLoginUserStore } from '@/stores/loginUser'
61
+  import { api_area, getFetchDataList, api_incidentcategory } from "@/http/api.js"
62
+  import { defaultColor } from '@/static/js/theme.js'
63
+  import { transform } from '@/utils/index.js'
64
+
65
+  const emit = defineEmits(['cancelEmit', 'confirmEmit']);
66
+  const { evt } = defineProps({
67
+    evt: {
68
+      type: Object,
69
+      required: true,
70
+    },
71
+  });
72
+  const loginUserStore = useLoginUserStore();
73
+
74
+  // 主题颜色
75
+  const primaryColor = ref(defaultColor)
76
+
77
+  // 登记时间
78
+  const isShowDate = ref(false)
79
+
80
+  // const start = ref(format(startOfYear(add(new Date(), { years: -5})), 'yyyy-MM-dd'));
81
+  // const end = ref(format(endOfYear(add(new Date(), { years: 0})), 'yyyy-MM-dd'));
82
+
83
+  const tabs1 = reactive([
84
+    { name: '全部', value: 'all' },
85
+    { name: '已接', value: '1' },
86
+    { name: '未接', value: '0' },
87
+  ])
88
+	
89
+	const tabs2 = reactive([
90
+	  { name: '全部', value: 'all' },
91
+	  { name: '呼入', value: '1' },
92
+	  { name: '呼出', value: '0' },
93
+	])
94
+	
95
+  // 页面数据
96
+  const pageData = reactive({
97
+    pageRouter: 'default',
98
+    areaList: [],
99
+    categoryList: [],
100
+		deptList:[],
101
+		selectBuildingList:[],
102
+  });
103
+	
104
+	// 是否开启跨科查看
105
+	const showDept = ref(false);
106
+
107
+  const searchData = reactive({
108
+    called: null,
109
+		dialing: null,
110
+		datetimerange:[],
111
+    selected1: '-1',
112
+		selected2: '-1'
113
+  })
114
+
115
+  // 显示登记时间
116
+  function showDatechange(){
117
+    isShowDate.value = !isShowDate.value;
118
+  }
119
+
120
+  // 登记时间确定
121
+  function bindDateChange(e){
122
+    console.log(e);
123
+    searchData.acceptDate = e;
124
+  }
125
+
126
+  // 点击tab
127
+  function clickTab(tab, type){
128
+		if(type==1){
129
+			searchData.selected1 = tab.value;
130
+		}else{
131
+			searchData.selected2 = tab.value;
132
+		}
133
+  }
134
+	
135
+	function changeDate(e){
136
+		console.log(123, e)
137
+	}
138
+	
139
+  // 清空
140
+  function clear(){
141
+    searchData.called = null
142
+    searchData.dialing = null
143
+    setDefaultDate()
144
+    searchData.selected1 = 'all'
145
+    searchData.selected2 = 'all'
146
+  }
147
+
148
+  // 取消
149
+  function cancel(){
150
+    emit('cancelEmit')
151
+  }
152
+
153
+  // 确认
154
+  function confirm(){
155
+    emit('confirmEmit', searchData);
156
+  }
157
+
158
+  // 页面路由跳转
159
+  function clickPageRouter(type){
160
+    pageData.pageRouter = type;
161
+    switch(type){
162
+      case 'area':
163
+        getAreaList();
164
+      break;
165
+    }
166
+  }
167
+
168
+  // 显示登记时间
169
+  function changeIsShowDate(type){
170
+    isShowDate.value = true;
171
+  }
172
+	
173
+	// 设置默认时间
174
+	function setDefaultDate(){
175
+		// 获取当前日期
176
+		const today = new Date();
177
+		// 获取上个月的第一天
178
+		const startOfLastMonth = startOfMonth(subMonths(today, 1));
179
+		// 获取上个月的最后一天
180
+		const endOfLastMonth = endOfMonth(subMonths(today, 1));
181
+		
182
+		searchData.datetimerange = [format(startOfLastMonth, 'yyyy-MM-dd HH:mm:ss'),format(endOfLastMonth, 'yyyy-MM-dd HH:mm:ss')]
183
+	}
184
+	
185
+  onLoad((option) => {
186
+		console.log(123, evt)
187
+		if(evt.datetimerange.length>0){
188
+			searchData.datetimerange = evt.datetimerange
189
+		}else{
190
+			setDefaultDate()
191
+		}
192
+		let data = loginUserStore.loginUser.infoPermission
193
+		pageData.deptList = data.dutyList
194
+		searchData.selected1 = evt.selected1;
195
+		searchData.selected2 = evt.selected2;
196
+		searchData.called = evt.called;
197
+		searchData.dialing = evt.dialing;
198
+  })
199
+</script>
200
+
201
+<style lang="scss" scoped>
202
+.mask{
203
+  position: fixed;
204
+  left: 0;
205
+  top: 0;
206
+  right: 0;
207
+  bottom: 0;
208
+  background-color: rgba(0, 0, 0, 0.4);
209
+  z-index: 999;
210
+}
211
+.line{
212
+  content: '';
213
+  position: fixed;
214
+  top: 0;
215
+  left: 0;
216
+  z-index: 9999;
217
+  height: 8rpx;
218
+  width: 100%;
219
+  background-color: #EBEBEB;
220
+}
221
+.container{
222
+  position: fixed;
223
+  left: 125rpx;
224
+  top: 0;
225
+  right: 0;
226
+  bottom: 0;
227
+  z-index: 9999;
228
+  background-color: #F7F7F7;
229
+  display: flex;
230
+  flex-direction: column;
231
+  justify-content: space-between;
232
+
233
+  .container_form{
234
+    height: 100%;
235
+    display: flex;
236
+    flex-direction: column;
237
+    flex: 1;
238
+    min-height: 0;
239
+  }
240
+
241
+  .hospital{
242
+    padding: 32rpx 24rpx 24rpx;
243
+    background-color: #fff;
244
+    .name{
245
+      font-size: 30rpx;
246
+      flex-shrink: 0;
247
+			margin-bottom: 20rpx;
248
+    }
249
+    .value{
250
+      font-size: 26rpx;
251
+      color: #5DAAB6;
252
+    }
253
+  }
254
+
255
+  .areas{
256
+    flex: 1;
257
+    min-height: 0;
258
+    margin-top: 20rpx;
259
+		padding-top: 20rpx;
260
+    background-color: #fff;
261
+		.view-box{
262
+			display: flex; 
263
+			flex-wrap: wrap;
264
+			.areas_item{
265
+				width: 30%;
266
+				height: 80rpx;
267
+				background: #F6F6F6;
268
+				display: flex;
269
+				align-items: center;
270
+				justify-content: center;
271
+				border-radius: 10rpx;
272
+				margin: 0 10rpx 20rpx 10rpx;
273
+			}
274
+			.ActiveClass{
275
+				background: #FFEAE7;
276
+				color: #D95D4D;
277
+				border: 1px solid #A13728;
278
+				box-sizing: border-box;
279
+			}
280
+		}
281
+    
282
+  }
283
+
284
+  .categorys{
285
+    flex: 1;
286
+    min-height: 0;
287
+    margin-top: 16rpx;
288
+    background-color: #fff;
289
+    .categorys_item{
290
+      padding: 24rpx;
291
+      border-bottom: 1rpx solid #DEDEDE;
292
+    }
293
+  }
294
+
295
+  .tabs{
296
+    margin-top: 16rpx;
297
+    background-color: #FBFBFB;
298
+    display: flex;
299
+    flex-wrap: wrap;
300
+    justify-content: space-between;
301
+    gap: 16rpx 0;
302
+    padding: 24rpx 16rpx;
303
+    .tab{
304
+      width: 180rpx;
305
+      height: 60rpx;
306
+      display: flex;
307
+      justify-content: center;
308
+      align-items: center;
309
+      background-color: #F7F7F7;
310
+      font-size: 28rpx;
311
+      position: relative;
312
+      .newicon-xuanzejiaobiao{
313
+        opacity: 0;
314
+        position: absolute;
315
+        right: 0;
316
+        bottom: 0;
317
+        font-size: 38rpx;
318
+        color: #53B9BB;
319
+      }
320
+      &.active{
321
+        background-color: rgba(149, 220, 231, 0.30);
322
+        .newicon-xuanzejiaobiao{
323
+          opacity: 1;
324
+        }
325
+      }
326
+    }
327
+  }
328
+
329
+  .area,
330
+  .category,
331
+  .acceptDate{
332
+    display: flex;
333
+    justify-content: space-between;
334
+    align-items: center;
335
+    padding: 24rpx;
336
+    background-color: #fff;
337
+    margin-top: 24rpx;
338
+    .name{
339
+      font-size: 28rpx;
340
+      flex-shrink: 0;
341
+      margin-right: 24rpx;
342
+    }
343
+		.flex-1{
344
+			flex: 3;
345
+		}
346
+  }
347
+
348
+  .container_foot{
349
+    .clear{
350
+      padding: 24rpx;
351
+      font-size: 28rpx;
352
+      background-color: #fff;
353
+      margin: 0 16rpx;
354
+      display: flex;
355
+      align-items: center;
356
+      justify-content: center;
357
+    }
358
+    .foot_btns{
359
+      margin-top: 24rpx;
360
+      display: flex;
361
+      border-top: 1rpx solid #BFBFBF;
362
+      .cancel{
363
+        flex: 1;
364
+        background-color: #fff;
365
+        font-size: 32rpx;
366
+        padding: 24rpx;
367
+        display: flex;
368
+        justify-content: center;
369
+      }
370
+			.submit{
371
+				color: #49b856;
372
+				border-left: 1px solid #BFBFBF;
373
+			}
374
+      .confirm{
375
+        flex: 1;
376
+        font-size: 32rpx;
377
+        padding: 24rpx;
378
+        background-color: $uni-primary;
379
+        display: flex;
380
+        justify-content: center;
381
+        color: #fff;
382
+      }
383
+    }
384
+  }
385
+}
386
+</style>

+ 21 - 0
http/api.js

@@ -376,3 +376,24 @@ export function api_inspectionFormValues(data){
376 376
 export function api_in_consumables(id){
377 377
   return post(`/incident/commonlyUse/consumables/${id}`, {});
378 378
 }
379
+
380
+/**
381
+ * 工单不受理
382
+ */
383
+export function api_reject(data){
384
+  return post(`/flow/incident/task/reject`, data);
385
+}
386
+
387
+/**
388
+ * 通话记录
389
+ */
390
+export function api_callLog(data){
391
+  return post(`/callLog/fetchDataList/callLog`, data);
392
+}
393
+
394
+/**
395
+ * 资产列表
396
+ */
397
+export function api_get_asset(data){
398
+  return post(`/simple/data/fetchDataList/asset`, data);
399
+}

+ 36 - 0
pages.json

@@ -325,6 +325,42 @@
325 325
 	     },
326 326
 	     "enablePullDownRefresh": true
327 327
 	   }
328
+	 },
329
+	 {
330
+	   "path": "pages/addrRepairs/addrRepairs",
331
+	   "style": {
332
+	     "h5": {
333
+	       "titleNView": false
334
+	     },
335
+	     "enablePullDownRefresh": true
336
+	   }
337
+	 },
338
+	 {
339
+	   "path": "pages/callRecord/callRecord",
340
+	   "style": {
341
+	     "h5": {
342
+	       "titleNView": false
343
+	     },
344
+	     "enablePullDownRefresh": true
345
+	   }
346
+	 },
347
+	 {
348
+	   "path": "pages/addrRepairsDetail/addrRepairsDetail",
349
+	   "style": {
350
+	     "h5": {
351
+	       "titleNView": false
352
+	     },
353
+	     "enablePullDownRefresh": false
354
+	   }
355
+	 },
356
+	 {
357
+	   "path": "pages/searchAsset/searchAsset",
358
+	   "style": {
359
+	     "h5": {
360
+	       "titleNView": false
361
+	     },
362
+	     "enablePullDownRefresh": true
363
+	   }
328 364
 	 }
329 365
   ],
330 366
   "globalStyle": {

+ 631 - 0
pages/addrRepairs/addrRepairs.vue

@@ -0,0 +1,631 @@
1
+<template>
2
+  <view class="incidentList">
3
+    <view class="head">
4
+      <view class="tab" :class="{active: tab.value === dataInfo.tabActiveId}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.value)">
5
+        {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
6
+      </view>
7
+   <!--   <view class="filter" @click="filterClick">
8
+        <text class="newicon newicon-shaixuan"></text>
9
+      </view> -->
10
+    </view>
11
+    <view class="body" v-if="dataInfo.list.length">
12
+      <view class="body_item" v-for="data in dataInfo.list" :key="data.id" @click="toIncidentDetail(data)">
13
+        <view class="body_item_head ellipsis-multiline">
14
+          <text :style="priorityStyle(data.priority)">{{data.priority ? data.priority.name + ' ' : ''}}</text>{{data.description}}
15
+        </view>
16
+
17
+        <view class="body_item_content">
18
+          <view class="body_item_content_p">
19
+            <text class="name ellipsis" v-if="data.repairIncidentType.value === 'dept'">报修科室:{{data.department?data.department.dept:''}}</text>
20
+            <text class="name ellipsis" v-if="data.repairIncidentType.value === 'public'">报修类型:{{data.repairIncidentType.name}}</text>
21
+            <view class="status" :style="stateStyle(data.state)">{{data.state ? data.state.name : ''}}</view>
22
+          </view>
23
+          <view class="body_item_content_p" v-if="data.place || data.houseNumber">
24
+            <text class="name ellipsis">详细地址:{{data.place ? data.place.building.buildingName : ''}}{{data.place ? data.place.floorName : ''}}<text v-if="data.place && data.place.floorName">层</text> {{data.houseNumber}}</text>
25
+          </view>
26
+         <!-- <view class="body_item_content_p" v-if="data.overtimeRemark">
27
+            <text class="name ellipsis">延期处理:{{data.overtimeRemark}}</text>
28
+          </view> -->
29
+       <!--   <view class="body_item_content_p">
30
+            <text class="name" v-if="data.assigneeName">
31
+              处理人:{{data.assigneeName}}<template v-if="computedSynergetic(data.synergetic)">,{{computedSynergetic(data.synergetic)}}</template>
32
+            </text>
33
+            <text class="name" v-else-if="data.candidateGroupsName">
34
+              处理组:{{data.candidateGroupsName}}<template v-if="computedSynergetic(data.synergetic)">,{{computedSynergetic(data.synergetic)}}</template>
35
+            </text>
36
+            <text class="name" v-else>
37
+              <template v-if="computedSynergetic(data.synergetic)">,{{computedSynergetic(data.synergetic)}}</template>
38
+            </text>
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>
43
+            </view>
44
+          </view> -->
45
+        </view>
46
+
47
+        <view class="body_item_foot">
48
+          <view class="foot_info">
49
+            <view class="name" @click.stop="makePhoneCall(data.contactsInformation)">联系电话:{{data.contactsInformation}}<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></view>
50
+            <text class="date">{{formatDate(data.acceptDate, 'MM-dd HH:mm')}}</text>
51
+          </view>
52
+          <view class="btns">
53
+            <button @click.stop="createOrder(data, data.id)" type="default" class="primaryButton btn" v-if="data.state.value === 'accept'">生成工单</button>
54
+            <button @click.stop="noProcessing( data, data.id)" type="default" class="primaryButton btn" v-if="data.state.value === 'accept'">不受理</button>
55
+          </view>
56
+        </view>
57
+				
58
+				<div class="sign-style">
59
+					<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.value=='dept'">
60
+						<view class="img-url1"></view>
61
+						<view class="img-name">科</view>
62
+					</view>
63
+					<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.value=='public'">
64
+						<view class="img-url2"></view>
65
+						<view class="img-name">公</view>
66
+					</view>
67
+				</div>
68
+      </view>
69
+    </view>
70
+    <view class="zanwu" v-else>
71
+      <text class="newicon newicon-zanwu"></text>
72
+    </view>
73
+    <IncidentListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></IncidentListFilter>
74
+    <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
75
+    <RequireAttachment v-if="dataInfo.isRequireAttachment" @knowEmit="knowRequireAttachment" :incidentData="dataInfo.incidentData"></RequireAttachment>
76
+		<!-- 不受理 -->
77
+		<uni-popup ref="inputDialog" type="dialog">
78
+			<uni-popup-dialog ref="inputClose" :before-close="true" mode="input" title="不受理"
79
+				placeholder="请输入不受理内容" @close="closeDialog" @confirm="dialogInputConfirm"></uni-popup-dialog>
80
+		</uni-popup>
81
+	</view>
82
+</template>
83
+
84
+<script setup>
85
+  import IncidentListFilter from '@/components/IncidentListFilter.vue';
86
+  import IncidentAttachment from '@/components/IncidentAttachment.vue';
87
+  import RequireAttachment from '@/components/RequireAttachment.vue';
88
+  import { startOfDay, endOfDay, format, add } from 'date-fns'
89
+  import { ref, reactive, computed } from 'vue'
90
+  import { onLoad, onUnload, onHide, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
91
+  import { api_reject, api_getDictionary, api_incident, api_incident_count, api_incidentTask } from "@/http/api.js"
92
+  import { filterFormatDate } from '@/filters/filterFormatDate.js'
93
+  import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
94
+  import { computedStateStyle } from '@/filters/computedStateStyle.js'
95
+  import { computedCurrentLogOverTime } from '@/filters/computedCurrentLogOverTime.js'
96
+  import { defaultColor } from '@/static/js/theme.js'
97
+  import { useSetTitle } from '@/share/useSetTitle.js'
98
+  import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
99
+  import { useSetTabbar } from '@/share/useSetTabbar.js'
100
+  import { useLoginUserStore } from '@/stores/loginUser'
101
+  import { useIncidentNumStore } from '@/stores/incidentNum'
102
+  import { useIncidentListSearchStore } from '@/stores/incidentListSearch'
103
+	import { useHandlerStore } from '@/stores/handler'
104
+	import { useIncidentBuildStore } from '@/stores/incidentBuild'
105
+	
106
+  useSetTitle();
107
+  const loginUserStore = useLoginUserStore();
108
+  const incidentNumStore = useIncidentNumStore();
109
+  const incidentListSearchStore = useIncidentListSearchStore();
110
+  const { formatDate }  = filterFormatDate();
111
+  const { priorityStyle }  = computedPriorityStyle();
112
+  const { stateStyle }  = computedStateStyle();
113
+  const { currentLogOverTime }  = computedCurrentLogOverTime();
114
+  const { makePhoneCall }  = useMakePhoneCall();
115
+  const { setTabbar }  = useSetTabbar();
116
+	const handlerStore = useHandlerStore();
117
+	const incidentBuildStore = useIncidentBuildStore();
118
+		
119
+  // 主题颜色
120
+  const primaryColor = ref(defaultColor)
121
+
122
+  const assignFlag = ref(false);//指派权限
123
+  const qiangdan = ref(false);//接单权限
124
+	const showDept = ref(false);//跨科权限
125
+  // 判断是否显示接单按钮
126
+  const computedReceive = computed(() => (data) => {
127
+    let inUser = data.handlingPersonnelUser && data.handlingPersonnelUser.id == loginUserStore.loginUser.user.id;
128
+		let inUser2 = data.currentLog.workerId == loginUserStore.loginUser.user.id;
129
+		let inGroup = false;
130
+		if(loginUserStore.loginUser.user&&loginUserStore.loginUser.user.group){
131
+			loginUserStore.loginUser.user.group.forEach(item => {
132
+			    if(data.currentLog){
133
+			        if (item.id == data.currentLog.groupId) {
134
+			            inGroup = true;
135
+			        }
136
+			    }
137
+			})
138
+		}
139
+
140
+    return data.state.value === 'pending' && (inUser2 || inGroup) && qiangdan.value;
141
+  })
142
+
143
+  // 转换协同人
144
+  const computedSynergetic = computed(() => (synergetic) => {
145
+    return (synergetic && synergetic.length) ? synergetic.map(v => v.name).join(',') : ''
146
+  })
147
+
148
+  // 数据
149
+  const dataInfo = reactive({
150
+    tabs: [
151
+			{id: 0, name: '全部', value: 'accept,reject', num: ''},
152
+			{id: 1, name: '待受理', value: 'accept', num: ''},
153
+			{id: 2, name: '不受理', value: 'reject', num: ''},
154
+		],
155
+    tabActiveId: 'accept,reject',//当前选择的tab
156
+    list: [],//工单列表
157
+    idx: 0,//页码
158
+    hasMore: true,//是否有更多数据
159
+    isFilter: false,//筛选框开关
160
+    isAttachment: false,//图片和通话录音开关
161
+    isRequireAttachment: false,//报修录音开关
162
+    incidentId: undefined,
163
+    evtFilter: {
164
+      hospital: {},
165
+      selected: 'todoingAll',
166
+      area: {id: 0, area: '全部'},
167
+      category: {id: 0, category: '全部'},
168
+      acceptDate: [],
169
+			dept: {text: '全部', value: 0},
170
+    },//筛选框数据
171
+		itemData: null
172
+  })
173
+	
174
+	const inputDialog = ref(null);//指派权限
175
+	
176
+  // 工单详情
177
+  function toIncidentDetail(data){
178
+    uni.navigateTo({
179
+      url: `/pages/addrRepairsDetail/addrRepairsDetail?incidentId=${data.id}`
180
+    })
181
+  }
182
+
183
+  // 获取tab选项
184
+  function getTabs(){
185
+    uni.showLoading({
186
+      title: "加载中",
187
+      mask: true,
188
+    });
189
+    api_getDictionary({
190
+      "type": "list",
191
+      "key": "incident_status"
192
+    }).then(res => {
193
+      uni.hideLoading();
194
+      let incidentStatusList = res || [];
195
+      let pending = incidentStatusList.find(v => v.value === 'pending');
196
+      let handler = incidentStatusList.find(v => v.value === 'handler');
197
+      dataInfo.tabs = [{id: 0, name: '全部', value: 'all', num: ''}];
198
+      pending && dataInfo.tabs.push({...pending, ...{num: ''}});
199
+      handler && dataInfo.tabs.push({...handler, ...{num: ''}});
200
+    })
201
+  }
202
+
203
+  // 点击tab
204
+  function clickTab(value){
205
+    dataInfo.tabActiveId = value;
206
+    getList(0);
207
+  }
208
+
209
+  // 点击筛选
210
+  function filterClick(){
211
+    dataInfo.isFilter = true;
212
+  }
213
+
214
+  // 确认筛选
215
+  function conformFilter(evtFilter){
216
+    dataInfo.evtFilter = evtFilter;
217
+    dataInfo.isFilter = false;
218
+    getList(0);
219
+  }
220
+
221
+  // 关闭筛选
222
+  function cancelFilter(){
223
+    dataInfo.isFilter = false;
224
+  }
225
+
226
+  // 点击图片和录音
227
+  function attachmentClick(incidentData){
228
+    dataInfo.incidentData = incidentData;
229
+    dataInfo.isAttachment = true;
230
+  }
231
+
232
+  // 返回图片和录音
233
+  function knowAttachment(){
234
+    dataInfo.isAttachment = false;
235
+  }
236
+
237
+  // 点击报修录音
238
+  function attachmentRequireClick(incidentData){
239
+    dataInfo.incidentData = incidentData;
240
+    dataInfo.isRequireAttachment = true;
241
+  }
242
+
243
+  // 返回报修录音
244
+  function knowRequireAttachment(){
245
+    dataInfo.isRequireAttachment = false;
246
+  }
247
+
248
+  // 生成工单
249
+  function createOrder(data, incidentId){
250
+		let incidentData = {
251
+			branch: data.hosId,
252
+			assetDTO: data.assetDTO || undefined,
253
+			assetId: data.assetDTO ? data.assetDTO.id : undefined,
254
+			department: data.department,
255
+			requester: data.requester || undefined,
256
+		  houseNumber: data.houseNumber,
257
+			place: data.place || undefined,
258
+		  source: data.source.id,
259
+		  description: data.description,
260
+		  contacts: data.contacts,
261
+		  contactsInformation: data.contactsInformation,
262
+			AttachmentId: data.id,
263
+			reqAttachment: data.reqAttachment || false,
264
+			repairIncidentType: data.repairIncidentType,
265
+			id: data.id,
266
+			state: data.state,
267
+			entranceType: 'create',
268
+			incidentsign: data.incidentsign,
269
+			fromWx: true,
270
+			// repairIncidentType: data.repairIncidentType.value
271
+		}
272
+		incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident');
273
+		uni.navigateTo({
274
+		  url: `/pages/buildIncident/buildIncident?type=inspection`
275
+		})
276
+  }
277
+	
278
+	// 不处理
279
+	function noProcessing(data, incidentId){
280
+		dataInfo.itemData = data
281
+		inputDialog.value.open()
282
+	}
283
+	
284
+	function closeDialog(){
285
+		inputDialog.value.close()
286
+	}
287
+	// 确认不受理
288
+	function dialogInputConfirm(e){
289
+		if(e==''){
290
+			uni.showToast({
291
+				icon: 'none',
292
+			  title: '请输入不受理内容',
293
+			});
294
+			return
295
+		}
296
+		uni.showLoading({
297
+		  title: "加载中",
298
+		  mask: true,
299
+		});
300
+		let postData = {
301
+			incident:{
302
+				rejectRemark: e,
303
+				...dataInfo.itemData
304
+			}
305
+		}
306
+		api_reject(postData).then(res => {
307
+      uni.hideLoading();
308
+      if(res.state == 200){
309
+        getList(0);
310
+				inputDialog.value.close()
311
+        uni.showToast({
312
+        	icon: 'none',
313
+          title: '操作成功',
314
+        });
315
+      }else{
316
+        uni.showToast({
317
+          icon: 'none',
318
+          title: res.msg || '请求数据失败!'
319
+        });
320
+      }
321
+    })
322
+	}
323
+	
324
+  // 接单调用方案
325
+  function receiveFn(incidentData){
326
+		let placeId = null
327
+		if(incidentData.place){
328
+			placeId = JSON.parse(JSON.stringify(incidentData.place.id))
329
+		}
330
+    uni.showLoading({
331
+      title: "加载中",
332
+      mask: true,
333
+    });
334
+
335
+    let postData = {
336
+      incident: incidentData,
337
+    }
338
+		if(placeId){
339
+			postData.incident.place = {}
340
+			postData.incident.place.id = placeId
341
+		}
342
+    api_incidentTask('receive', postData).then(res => {
343
+      uni.hideLoading();
344
+      if(res.state == 200){
345
+        getList(0);
346
+        uni.showToast({
347
+        	icon: 'none',
348
+          title: '接单成功',
349
+        });
350
+      }else{
351
+        uni.showToast({
352
+          icon: 'none',
353
+          title: res.msg || '请求数据失败!'
354
+        });
355
+      }
356
+    })
357
+  }
358
+  // 接单按钮
359
+  function receive(incidentData){
360
+    uni.showModal({
361
+      title: '提示',
362
+      content: `您确认要接单吗?`,
363
+      confirmColor: defaultColor,
364
+      confirmText: '确认',
365
+      success: function(res) {
366
+        if (res.confirm) {
367
+          receiveFn(incidentData);
368
+        }
369
+      }
370
+    });
371
+  }
372
+
373
+  // 获取列表信息
374
+  function getList(idx){
375
+    uni.showLoading({
376
+      title: "加载中",
377
+      mask: true,
378
+    });
379
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
380
+    if(dataInfo.idx === 0){
381
+      dataInfo.list = [];
382
+    }
383
+    let postData = {
384
+        "idx": dataInfo.idx,
385
+        "sum": 10,
386
+        "incident": {
387
+            "state": {
388
+							value: dataInfo.tabActiveId || undefined,
389
+						}
390
+        }
391
+    }
392
+    api_incident(postData).then(res => {
393
+      uni.hideLoading();
394
+      uni.stopPullDownRefresh();
395
+      if(res.status == 200){
396
+        let list = res.list || [];
397
+        if(list.length){
398
+          dataInfo.hasMore = true;
399
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
400
+        }else{
401
+          dataInfo.hasMore = false;
402
+        }
403
+      }else{
404
+        uni.showToast({
405
+          icon: 'none',
406
+          title: res.msg || '请求数据失败!'
407
+        });
408
+      }
409
+    })
410
+
411
+    getCount(postData.incident);
412
+  }
413
+
414
+  // 获取列表数量
415
+  function getCount(incident = {}){
416
+    let postData = {
417
+      wxCount: 'true',
418
+      incidentList: [],
419
+    }
420
+    dataInfo.tabs.forEach(v => {
421
+        postData.incidentList = [
422
+					{
423
+						state:{
424
+							value:'accept,reject'
425
+						},
426
+						queryTask: 'wxCount',
427
+					},
428
+					{
429
+						state:{
430
+							value:'accept'
431
+						},
432
+						queryTask: 'wxCount',
433
+					},
434
+					{
435
+						state:{
436
+							value:'reject'
437
+						},
438
+						queryTask: 'wxCount',
439
+					}
440
+				]
441
+    })
442
+
443
+    api_incident_count(postData).then(res => {
444
+      if(res.state == 200){
445
+        let myData = res.data || [];
446
+        dataInfo.tabs.forEach((v, i) => {
447
+            v.num = myData[i];
448
+        })
449
+      }else{
450
+        uni.showToast({
451
+          icon: 'none',
452
+          title: res.msg || '请求数据失败!'
453
+        });
454
+      }
455
+    })
456
+  }
457
+
458
+  // 初始化
459
+  function onLoadFn(){
460
+    getTabs();
461
+  }
462
+  onLoad((option) => {
463
+    getList(0);
464
+  })
465
+
466
+	onUnload(() => {
467
+    dataInfo.isFilter = false;
468
+  })
469
+
470
+	onHide(() => {
471
+	  dataInfo.isFilter = false;
472
+	})
473
+
474
+  onTabItemTap(e => {
475
+    // onLoadFn();
476
+  })
477
+
478
+  onPullDownRefresh(() => {
479
+		getList(0);
480
+  })
481
+
482
+  onReachBottom(() => {
483
+    dataInfo.idx += 1;
484
+    if (dataInfo.hasMore) {
485
+      getList(); // 当触底时加载更多数据
486
+    }
487
+  })
488
+</script>
489
+
490
+<style lang="scss" scoped>
491
+page{
492
+  height: calc(100vh - var(--window-bottom));
493
+}
494
+.incidentList{
495
+  display: flex;
496
+  flex-direction: column;
497
+  justify-content: space-between;
498
+  .head{
499
+    height: 88rpx;
500
+    display: flex;
501
+    position: fixed;
502
+    z-index: 99;
503
+    width: 100%;
504
+    background-color: #fff;
505
+    font-size: 30rpx;
506
+    .tab{
507
+      flex: 1;
508
+      display: flex;
509
+      justify-content: center;
510
+      align-items: center;
511
+      border-bottom: 4rpx solid transparent;
512
+      &.active{
513
+        color: $uni-primary;
514
+        border-color: $uni-primary;
515
+      }
516
+    }
517
+    .filter{
518
+      width: 84rpx;
519
+      display: flex;
520
+      justify-content: center;
521
+      align-items: center;
522
+      .newicon-shaixuan{
523
+        font-size: 36rpx;
524
+        color: #2C2C2C;
525
+      }
526
+    }
527
+  }
528
+  .body{
529
+    margin-bottom: var(--window-bottom);
530
+    margin-top: 88rpx;
531
+    border-top: 6rpx solid #EBEBEB;
532
+    .body_item{
533
+			background: #fff;
534
+      border-bottom: 8rpx solid #EBEBEB;
535
+			position: relative;
536
+			.sign-style{
537
+				position: absolute;
538
+				right: 0;
539
+				top: 0rpx;
540
+				.img-box{
541
+					position: relative;
542
+					.img-url1{
543
+						width: 70rpx;
544
+						height: 70rpx;
545
+						background-image: url('../../static/img/jiaobiao1.png');
546
+					}
547
+					.img-url2{
548
+						width: 70rpx;
549
+						height: 70rpx;
550
+						background-image: url('../../static/img/jiaobiao2.png');
551
+					}
552
+					.img-name{
553
+						position: absolute;
554
+						right: 8rpx;
555
+						top: 0;
556
+						color: #fff;
557
+						font-size: 24rpx;
558
+					}
559
+				}
560
+			}
561
+      .body_item_head{
562
+        word-break: break-all;
563
+        text-align: justify;
564
+        text-align: left;
565
+        padding: 24rpx;
566
+        font-size: 30rpx;
567
+      }
568
+      .body_item_content{
569
+        border-top: 1rpx solid #D8D8D8;
570
+        padding: 24rpx 24rpx 24rpx 48rpx;
571
+        .body_item_content_p{
572
+          color: #6A6A6A;
573
+          font-size: 26rpx;
574
+          display: flex;
575
+          justify-content: space-between;
576
+          align-items: center;
577
+          margin-bottom: 24rpx;
578
+          &:last-of-type{
579
+            margin-bottom: 0;
580
+          }
581
+          .name{
582
+            flex: 1;
583
+          }
584
+          .status{
585
+            padding: 4rpx 10rpx;
586
+            border-radius: 20rpx;
587
+            background-color: #DBE8FE;
588
+            font-size: 22rpx;
589
+            color: #006CF9;
590
+          }
591
+          .icon_all{
592
+            .mic-filled,
593
+            .image-filled
594
+            {
595
+              margin-left: 16rpx;
596
+            }
597
+          }
598
+        }
599
+      }
600
+      .body_item_foot{
601
+        border-top: 1rpx solid #D8D8D8;
602
+        font-size: 26rpx;
603
+        padding: 24rpx;
604
+        .foot_info{
605
+          display: flex;
606
+          justify-content: space-between;
607
+          align-items: center;
608
+          .phone-filled{
609
+            margin-left: 5rpx;
610
+          }
611
+        }
612
+      }
613
+    }
614
+  }
615
+  .zanwu{
616
+    box-sizing: border-box;
617
+    margin-bottom: var(--window-bottom);
618
+    margin-top: 88rpx;
619
+    border-top: 6rpx solid #EBEBEB;
620
+    height: calc(100vh - var(--window-bottom) - 88rpx);
621
+    display: flex;
622
+    justify-content: center;
623
+    background-color: #F7F7F7;
624
+    .newicon-zanwu{
625
+      font-size: 256rpx;
626
+      color: #D6D6D6;
627
+      margin-top: 140rpx;
628
+    }
629
+  }
630
+}
631
+</style>

+ 774 - 0
pages/addrRepairsDetail/addrRepairsDetail.vue

@@ -0,0 +1,774 @@
1
+<template>
2
+  <view class="incidentDetail">
3
+    <view class="head">
4
+      <view class="tab" :class="{active: tab.value === dataInfo.tabActiveValue}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.value)">
5
+        {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
6
+      </view>
7
+    </view>
8
+    <scroll-view scroll-y class="body">
9
+      <!-- 工单信息 -->
10
+      <template v-if="dataInfo.tabActiveValue === '1'">
11
+        <view class="detail_head">
12
+          <text class="title">报修信息</text>
13
+          <view class="other">
14
+            <text class="priority" :style="priorityStyle(dataInfo.incidentData.priority)">{{dataInfo.incidentData.priority ? dataInfo.incidentData.priority.name + ' ' : ''}}</text>
15
+            <view class="status" :style="stateStyle(dataInfo.incidentData.state)">{{dataInfo.incidentData.state ? dataInfo.incidentData.state.name : ''}}</view>
16
+          </view>
17
+        </view>
18
+        <view class="detail_item_wrap">
19
+          <view class="deital_item">
20
+            <text class="name">单号:</text>
21
+            <text class="value">{{dataInfo.incidentData.incidentsign || '无'}}</text>
22
+          </view>
23
+          <view class="deital_item">
24
+            <text class="name">报修类型:</text>
25
+            <text class="value">{{dataInfo.incidentData.repairIncidentType.name || '无'}}</text>
26
+          </view>
27
+					<view class="deital_item">
28
+					  <text class="name">关联资产:</text>
29
+					  <text class="value">{{dataInfo.incidentData.assetDTO ? dataInfo.incidentData.assetDTO.name : '无'}}</text>
30
+					</view>
31
+          <view class="deital_item">
32
+            <text class="name">故障现象:</text>
33
+            <text class="value">{{dataInfo.incidentData.category ? dataInfo.incidentData.category.mutiCategory : '无'}}</text>
34
+          </view>
35
+          <view class="deital_item">
36
+            <text class="name">故障描述:</text>
37
+            <text class="value">{{dataInfo.incidentData.description || '无'}}</text>
38
+          </view>
39
+          <view class="deital_item">
40
+            <text class="name">报修图片:</text>
41
+            <view class="value img">
42
+              <image class="resourceItem" :src="img.thumbFilePath" mode="aspectFill" v-for="(img, i) in dataInfo.repairImgs" :key="i" @click="previewImg(i, 'repairImgs')"></image>
43
+            </view>
44
+          </view>
45
+					<view class="deital_item">
46
+					  <text class="name">报修录音:</text>
47
+					  <view class="value img" v-if="dataInfo.repairAudio.length>0">
48
+							<sy-audio class="resourceItem-audio" ref="audio" isCountDown :src="img.thumbFilePath" v-for="(img, i) in dataInfo.repairAudio" :key="i" ></sy-audio>
49
+					  </view>
50
+					</view>
51
+          <view class="deital_item">
52
+            <text class="name">联系人:</text>
53
+            <text class="value">{{dataInfo.incidentData.contacts || '无'}}</text>
54
+            <text v-if="dataInfo.incidentData.contactsInformation" @click="makePhoneCall(dataInfo.incidentData.contactsInformation)">{{dataInfo.incidentData.contactsInformation}}<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></text>
55
+          </view>
56
+          <view class="deital_item">
57
+            <text class="name">来电电话:</text>
58
+            <view class="value" @click="makePhoneCall(dataInfo.incidentData.incomingPhone)" v-if="dataInfo.incidentData.incomingPhone">{{dataInfo.incidentData.incomingPhone}}<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></view>
59
+            <text class="value" v-else>无</text>
60
+            <uni-icons v-if="dataInfo.incidentData.callID" @click="attachmentClick" type="mic-filled" class="mic-filled" :size="22" :color="primaryColor"></uni-icons>
61
+          </view>
62
+          <view class="deital_item">
63
+            <text class="name">报修科室:</text>
64
+            <text class="value">{{dataInfo.incidentData.department ? dataInfo.incidentData.department.dept : '无'}}</text>
65
+          </view>
66
+          <view class="deital_item">
67
+            <text class="name">详细地址:</text>
68
+            <text class="value" v-if="dataInfo.incidentData.place || dataInfo.incidentData.houseNumber">{{dataInfo.incidentData.place ? dataInfo.incidentData.place.building.buildingName : ''}}{{dataInfo.incidentData.place ? dataInfo.incidentData.place.floorName : ''}}<text v-if="dataInfo.incidentData.place && dataInfo.incidentData.place.floorName">层</text> {{dataInfo.incidentData.houseNumber}}</text>
69
+            <text class="value" v-else>无</text>
70
+          </view>
71
+          <view class="deital_item">
72
+            <text class="name">报修人:</text>
73
+            <text class="value">{{dataInfo.incidentData.requester ? dataInfo.incidentData.requester.name : '无'}}</text>
74
+          </view>
75
+          <view class="deital_item">
76
+            <text class="name">报修来源:</text>
77
+            <text class="value">{{dataInfo.incidentData.source ? dataInfo.incidentData.source.name : '无'}}</text>
78
+          </view>
79
+          <view class="deital_item" v-if="dataInfo.incidentData.inspectionTaskNo">
80
+            <text class="name">巡检单号:</text>
81
+            <text class="value">{{dataInfo.incidentData.inspectionTaskNo}}</text>
82
+          </view>
83
+          <view class="deital_item">
84
+            <text class="name">预约维修时间:</text>
85
+            <text class="value">{{dataInfo.incidentData.yyTime || '无'}}</text>
86
+          </view>
87
+          <view class="deital_item">
88
+            <text class="name">受理人:</text>
89
+            <text class="value">{{dataInfo.incidentData.acceptUser ? dataInfo.incidentData.acceptUser.name : '无'}}</text>
90
+          </view>
91
+          <view class="deital_item">
92
+            <text class="name">登记时间:</text>
93
+            <text class="value">{{formatDate(dataInfo.incidentData.acceptDate, 'yyyy-MM-dd HH:mm')}}</text>
94
+          </view>
95
+          <view class="deital_item">
96
+            <text class="name">逾期解决时间:</text>
97
+            <text class="value">{{formatDate(dataInfo.incidentData.overdueTime, 'yyyy-MM-dd HH:mm')}}</text>
98
+          </view>
99
+        </view>
100
+
101
+        <view class="detail_head">
102
+          <text class="title">处理信息</text>
103
+        </view>
104
+        <view class="detail_item_wrap">
105
+          <view class="deital_item">
106
+            <text class="name">处理方式:</text>
107
+            <text class="value">{{dataInfo.incidentData.handleCategory ? dataInfo.incidentData.handleCategory.name : '无'}}</text>
108
+            <text class="value">处理结果:{{dataInfo.incidentData.closecode ? dataInfo.incidentData.closecode.name : '无'}}</text>
109
+          </view>
110
+          <view class="deital_item">
111
+            <text class="name">处理人:</text>
112
+            <text class="value" v-if="dataInfo.incidentData.state.value == 'pending' && dataInfo.incidentData.currentLog">{{dataInfo.incidentData.currentLog.workerName}}<text @click="makePhoneCall(dataInfo.incidentData.currentLog.workerPhone)" v-if="dataInfo.incidentData.currentLog.workerPhone">({{dataInfo.incidentData.currentLog.workerPhone}})<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></text></text>
113
+
114
+            <text class="value" v-else-if="dataInfo.incidentData.state.value != 'pending' && dataInfo.incidentData.handlingPersonnelUser">{{dataInfo.incidentData.handlingPersonnelUser.name}}<text @click="makePhoneCall(dataInfo.incidentData.handlingPersonnelUser.phone)" v-if="dataInfo.incidentData.handlingPersonnelUser.phone">({{dataInfo.incidentData.handlingPersonnelUser.phone}})<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></text></text>
115
+            <text class="value" v-else>无</text>
116
+          </view>
117
+          <view class="deital_item">
118
+            <text class="name">处理方案:</text>
119
+            <text class="value">{{dataInfo.incidentData.handleDescription || '无'}}</text>
120
+          </view>
121
+          <view class="deital_item">
122
+            <text class="name">处理图片:</text>
123
+            <view class="value img">
124
+              <image class="imgItem" :src="img.thumbFilePath" mode="aspectFill" v-for="(img, i) in dataInfo.handlerImgs" :key="i" @click="previewImg(i, 'handlerImgs')"></image>
125
+            </view>
126
+          </view>
127
+          <view class="deital_item">
128
+            <text class="name">维修总价:</text>
129
+            <text class="value">{{dataInfo.incidentData.rsPrice === undefined ? '无' : dataInfo.incidentData.rsPrice + '元'}}</text>
130
+          </view>
131
+          <view class="deital_item">
132
+            <text class="name">协同人:</text>
133
+            <text class="value">{{dataInfo.incidentData.synergetic && dataInfo.incidentData.synergetic.length ? dataInfo.incidentData.synergetic.map(v => v.name).join(',') : '无'}}</text>
134
+          </view>
135
+					<view class="deital_item">
136
+					  <text class="name">引用知识库:</text>
137
+					  <text class="value">{{dataInfo.incidentData.solutionNo?dataInfo.incidentData.solutionNo:'未引用'}}</text>
138
+					</view>
139
+					<view class="deital_item" v-if="dataInfo.incidentData.provideBackupMachine && dataInfo.incidentData.provideBackupMachine==1">
140
+					  <text class="name">是否归还备用机:</text>
141
+					  <text class="value">{{dataInfo.incidentData.returnBackupMachine==1?'是':'否'}}</text>
142
+					</view>
143
+        </view>
144
+      </template>
145
+
146
+      <!-- 维修汇总单 -->
147
+      <template v-if="dataInfo.tabActiveValue === '2'">
148
+        <view class="detail_head">
149
+          <text class="title">耗材清单</text>
150
+        </view>
151
+        <view class="summaryItem_bodyItem" v-for="item in dataInfo.summaryObj.consumableList" :key="item.id">
152
+          <view class="summaryItem_bodyItem_top">
153
+            <text class="name ellipsis">{{ item.consumableName }}<template v-if="item.consumableBrandModel">({{ item.consumableBrandModel }})</template></text>
154
+            <text class="value">{{ item.consumableEndPrice }}元</text>
155
+          </view>
156
+          <view class="summaryItem_bodyItem_bottom">
157
+            <text class="name">x{{ item.consumablesNum }}{{ item.consumablesUnit }}</text>
158
+            <text class="value">总价{{item.consumablesNum * item.consumableEndPrice}}元</text>
159
+          </view>
160
+        </view>
161
+        <view class="summaryItem_bodyItem_total">耗材总价:{{dataInfo.summaryObj.consumablePrice}}元</view>
162
+        <view class="detail_head">
163
+          <text class="title">工时清单</text>
164
+        </view>
165
+        <view class="summaryItem_bodyItem" v-for="item in dataInfo.summaryObj.workHourManagementList" :key="item.id">
166
+          <view class="summaryItem_bodyItem_top">
167
+            <text class="name ellipsis">{{ item.workName }}</text>
168
+            <text class="value">{{ item.wage }}元</text>
169
+          </view>
170
+          <view class="summaryItem_bodyItem_bottom">
171
+            <text class="name">x{{ item.workHourNum2 }}{{ item.workUnit }}</text>
172
+            <text class="value">总价{{item.workHourNum2 * item.wage}}元</text>
173
+          </view>
174
+        </view>
175
+        <view class="summaryItem_bodyItem_total">工时总价:{{dataInfo.summaryObj.workHourPrice}}元</view>
176
+        <view class="summaryItem_total">汇总单总价:{{dataInfo.summaryObj.totalMaintenancePrice}}元</view>
177
+      </template>
178
+
179
+      <!-- 处理流程 -->
180
+      <template v-if="dataInfo.tabActiveValue === '3'">
181
+        <view class="process_item_wrap">
182
+          <view class="process_item" v-for="item in dataInfo.incidentLogList" :key="item.id">
183
+            <view class="process_item_top">
184
+              <view class="name">{{item.logType ? item.logType.name : ''}}</view>
185
+              <view class="value" v-if="item.remark">({{item.remark}})</view>
186
+            </view>
187
+            <view class="process_item_bottom">
188
+              <text class="name">{{formatDate(item.startTime, 'yyyy-MM-dd HH:mm:ss')}}</text>
189
+              <text class="value" v-if="item.appointorName">{{item.appointorName}}</text>
190
+            </view>
191
+          </view>
192
+        </view>
193
+      </template>
194
+
195
+      <!-- 评价信息 -->
196
+      <template v-if="dataInfo.tabActiveValue === '4'">
197
+        <view class="detail_head">
198
+          <text class="title">评价信息</text>
199
+        </view>
200
+        <view class="appraise_detail" v-for="item in dataInfo.resolveLogs" :key="item.id">
201
+          <view class="appraise_detail_top">
202
+            <text>{{formatDate(item.startTime, 'yyyy-MM-dd HH:mm:ss')}}</text>
203
+            <view v-if="dataInfo.incidentData.wxdegree">
204
+              <uni-rate readonly :value="dataInfo.incidentData.wxdegree.value" />
205
+            </view>
206
+          </view>
207
+          <view class="appraise_detail_bottom">
208
+            <text>{{item.remark}}</text>
209
+          </view>
210
+        </view>
211
+
212
+        <view class="detail_head">
213
+          <text class="title">回访信息</text>
214
+        </view>
215
+        <view class="appraise_detail" v-for="item in dataInfo.callbackLogs" :key="item.id">
216
+          <view class="appraise_detail_top">
217
+            <text>{{formatDate(item.startTime, 'yyyy-MM-dd HH:mm:ss')}}</text>
218
+            <text v-if="dataInfo.incidentData.degree">{{dataInfo.incidentData.degree.name}}</text>
219
+          </view>
220
+          <view class="appraise_detail_bottom">
221
+            <text>{{item.remark}}</text>
222
+          </view>
223
+        </view>
224
+      </template>
225
+
226
+    </scroll-view>
227
+    <view class="foot_common_btns">
228
+      <button @click="viewIncidentList()" type="default" class="primaryButton btn">返回</button>
229
+      <button v-if="dataInfo.incidentData.inspectionTaskId" @click="viewInspectionDetail(dataInfo.incidentData.inspectionTaskId)" type="default" class="primaryButton btn">查看巡检单</button>
230
+    </view>
231
+		<uni-popup ref="popup" background-color="#fff" type="center" :before-close="true">
232
+			<view class="popup-content">
233
+				<video :src="videoUrl" controls></video>
234
+			</view>
235
+			<view class="foot_common_btns">
236
+			  <button @click="closePop" type="default" class="primaryButton btn">关闭</button>
237
+			</view>
238
+		</uni-popup>
239
+    <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
240
+  </view>
241
+</template>
242
+
243
+<script setup>
244
+  import { ref, reactive } from 'vue'
245
+  import IncidentAttachment from '@/components/IncidentAttachment.vue';
246
+  import { onLoad } from '@dcloudio/uni-app'
247
+  import { api_listAttachment, getFetchDataList, api_incidentDetail, api_querySummaryDoc, api_incidentLog } from "@/http/api.js"
248
+  import { defaultColor } from '@/static/js/theme.js'
249
+  import { useSetTitle } from '@/share/useSetTitle.js'
250
+  import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
251
+  import { useLoginUserStore } from '@/stores/loginUser'
252
+  import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
253
+  import { computedStateStyle } from '@/filters/computedStateStyle.js'
254
+  import { filterFormatDate } from '@/filters/filterFormatDate.js'
255
+
256
+  useSetTitle();
257
+  const loginUserStore = useLoginUserStore();
258
+  const { makePhoneCall }  = useMakePhoneCall();
259
+  const { priorityStyle }  = computedPriorityStyle();
260
+  const { stateStyle }  = computedStateStyle();
261
+  const { formatDate }  = filterFormatDate();
262
+
263
+  // 主题颜色
264
+  const primaryColor = ref(defaultColor)
265
+
266
+	const videoUrl = ref(null)
267
+	const popup = ref(null)
268
+
269
+  // 数据
270
+  const dataInfo = reactive({
271
+    tabs: [
272
+      {id: 1, name: '工单信息', value: '1', num: ''},
273
+      // {id: 2, name: '维修汇总单', value: '2', num: ''},
274
+      {id: 3, name: '处理流程', value: '3', num: ''},
275
+      {id: 4, name: '评价信息', value: '4', num: ''},
276
+    ],
277
+    tabActiveValue: 0,//当前选择的tab
278
+    incidentId: undefined,//事件ID
279
+    incidentData: {},//事件对象
280
+    repairImgs: [],//报修图片
281
+		repairVideo:[], //视频
282
+		repairAudio:[], //录音
283
+    handlerImgs: [],//处理图片
284
+    summaryObj: {
285
+      consumableList: [],//耗材列表
286
+      workHourManagementList: [],//工时列表
287
+    },//汇总单信息
288
+    incidentLogList: [],//流程列表
289
+    resolveLogs: [],//评价
290
+    callbackLogs: [],//回访
291
+    isAttachment: false,//录音开关
292
+		summaryData:null
293
+  })
294
+
295
+  // 点击录音
296
+  function attachmentClick(){
297
+    dataInfo.isAttachment = true;
298
+  }
299
+
300
+  // 返回录音
301
+  function knowAttachment(){
302
+    dataInfo.isAttachment = false;
303
+  }
304
+
305
+  // 获取汇总单信息
306
+  function getSummaryList(){
307
+    uni.showLoading({
308
+      title: "加载中",
309
+      mask: true,
310
+    });
311
+    let postData = {
312
+      "incidentId": dataInfo.incidentId,
313
+    };
314
+    api_querySummaryDoc(postData).then(res => {
315
+      uni.hideLoading();
316
+      if(res.status == 200){
317
+        dataInfo.summaryObj = {...{consumableList:[], workHourManagementList: []}, ...res };
318
+      }else{
319
+        uni.showToast({
320
+          icon: 'none',
321
+          title: res.msg || '请求数据失败!'
322
+        });
323
+      }
324
+    })
325
+  }
326
+
327
+  // 获取流程列表
328
+  function getIncidentLogList(){
329
+    uni.showLoading({
330
+      title: "加载中",
331
+      mask: true,
332
+    });
333
+    let postData = {
334
+        "idx": 0,
335
+        "sum": 9999,
336
+        "incidentLog": {
337
+            "incidentId": dataInfo.incidentId,
338
+        }
339
+    };
340
+    api_incidentLog(postData).then(res => {
341
+      uni.hideLoading();
342
+      if(res.status == 200){
343
+        let incidentLogList = res.list || [];
344
+        dataInfo.incidentLogList = incidentLogList;
345
+      }else{
346
+        uni.showToast({
347
+          icon: 'none',
348
+          title: res.msg || '请求数据失败!'
349
+        });
350
+      }
351
+    })
352
+  }
353
+
354
+  // 预览图片
355
+  function previewImg(index, type){
356
+    uni.previewImage({
357
+      current: index,
358
+      urls: dataInfo[type].map(v => v.previewUrl),
359
+      longPressActions: {
360
+        itemList: ['发送给朋友', '保存图片', '收藏'],
361
+        success: function(data) {
362
+          console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
363
+        },
364
+        fail: function(err) {
365
+          console.log(err.errMsg);
366
+        }
367
+      }
368
+    });
369
+  }
370
+
371
+  // 初始化表单
372
+  function initForm(){
373
+    if(dataInfo.tabActiveValue === '1'){
374
+      getRepairImgs();
375
+      getHandlerImgs();
376
+    }else if(dataInfo.tabActiveValue === '2'){
377
+      getSummaryList();
378
+    }else if(dataInfo.tabActiveValue === '3'){
379
+      getIncidentLogList();
380
+    }else if(dataInfo.tabActiveValue === '4'){
381
+
382
+    }
383
+  }
384
+
385
+  // 点击tab
386
+  function clickTab(tabValue){
387
+    if(dataInfo.tabActiveValue == tabValue){
388
+      return;
389
+    }
390
+    dataInfo.tabActiveValue = tabValue;
391
+    initForm()
392
+  }
393
+
394
+  // 获取事件详情
395
+  function getIncidentDetail(){
396
+    uni.showLoading({
397
+      title: "加载中",
398
+      mask: true,
399
+    });
400
+
401
+    api_incidentDetail(dataInfo.incidentId).then(res => {
402
+      uni.hideLoading();
403
+      if(res.status == 200){
404
+        dataInfo.incidentData = res.data || {};
405
+        let logs = dataInfo.incidentData.logs || [];
406
+        dataInfo.resolveLogs = logs.filter(v => v.logType.value == 'resolve').slice(0, 1);
407
+        dataInfo.callbackLogs = logs.filter(v => v.logType.value == 'callback').slice(0, 1);
408
+        // 维修汇总单
409
+        if(dataInfo.incidentData.state.value == 'close' && dataInfo.summaryData.value == 1 && dataInfo.incidentData.summaryId){
410
+          let flag = dataInfo.tabs.some(v => v.value === '2');
411
+          !flag && dataInfo.tabs.splice(1, 0, {id: 2, name: '维修汇总单', value: '2', num: ''});
412
+        }
413
+
414
+        dataInfo.tabActiveValue = dataInfo.tabs[0].value;
415
+        initForm()
416
+      }else{
417
+        uni.showToast({
418
+          icon: 'none',
419
+          title: res.msg || '请求数据失败!'
420
+        });
421
+      }
422
+    })
423
+  }
424
+
425
+	function videoView(item){
426
+		videoUrl.value = item.thumbFilePath
427
+		setTimeout(_=>{
428
+			popup.value.open()
429
+		},100)
430
+	}
431
+
432
+	function closePop(){
433
+		popup.value.close()
434
+	}
435
+
436
+  // 获取报修图片
437
+  function getRepairImgs(){
438
+    uni.showLoading({
439
+      title: "加载中",
440
+      mask: true,
441
+    });
442
+    api_listAttachment('wechatRequesterIncident', dataInfo.incidentId).then(res => {
443
+      // uni.hideLoading();
444
+      res.data = res.data || [];
445
+      res.data.forEach(v => {
446
+        v.previewUrl = location.origin + "/file" + v.relativeFilePath;
447
+        v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
448
+      })
449
+      dataInfo.repairImgs = res.data;
450
+    })
451
+		api_listAttachment('wechatIncidentVideo', dataInfo.incidentId).then(res => {
452
+		  res.data = res.data || [];
453
+		  res.data.forEach(v => {
454
+		    v.thumbFilePath = location.origin + "/file" + v.relativeFilePath;
455
+		  })
456
+			dataInfo.repairVideo = res.data
457
+		})
458
+
459
+		api_listAttachment('wechatIncidentRecord', dataInfo.incidentId).then(res => {
460
+		  uni.hideLoading();
461
+		  res.data = res.data || [];
462
+		  res.data.forEach(v => {
463
+		    v.thumbFilePath = location.origin + "/file" + v.relativeFilePath;
464
+		  })
465
+			dataInfo.repairAudio = res.data
466
+		})
467
+  }
468
+
469
+  // 获取处理图片
470
+  function getHandlerImgs(){
471
+    uni.showLoading({
472
+      title: "加载中",
473
+      mask: true,
474
+    });
475
+    api_listAttachment('incident', dataInfo.incidentId).then(res => {
476
+      uni.hideLoading();
477
+      res.data = res.data || [];
478
+      res.data.forEach(v => {
479
+        v.previewUrl = location.origin + "/file" + v.relativeFilePath;
480
+        v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
481
+      })
482
+      dataInfo.handlerImgs = res.data;
483
+    })
484
+  }
485
+
486
+  // 返回事件列表
487
+  function viewIncidentList(){
488
+    uni.reLaunch({
489
+      url: `/pages/addrRepairs/addrRepairs`
490
+    })
491
+  }
492
+
493
+  // 查看巡检单
494
+  function viewInspectionDetail(inspectionTaskId){
495
+    uni.navigateTo({
496
+      url: `/pages/inspection/inspectionDetail/inspectionDetail?inspectionTaskId=${inspectionTaskId}`
497
+    })
498
+  }
499
+
500
+  onLoad((option) => {
501
+    dataInfo.incidentId = option.incidentId;
502
+		// 获取是否开启汇总单、简易处理
503
+		let postData = {
504
+			idx: 0,
505
+			sum: 9999,
506
+			hospitalConfig:{
507
+				hosId: loginUserStore.loginUser.user.currentHospital.id,
508
+				model: "itsm"
509
+			}
510
+		};
511
+		getFetchDataList("simple/data", "hospitalConfig", postData)
512
+		.then((res) => {
513
+			dataInfo.summaryData = res.list.find(i=>i.key=='itsmSummarySheet')
514
+			getIncidentDetail();
515
+		});
516
+  })
517
+</script>
518
+
519
+<style lang="scss" scoped>
520
+.popup-content{
521
+	padding: 40rpx;
522
+}
523
+.incidentDetail{
524
+  height: 100%;
525
+  display: flex;
526
+  flex-direction: column;
527
+  justify-content: space-between;
528
+  .head{
529
+    height: 88rpx;
530
+    display: flex;
531
+    position: fixed;
532
+    z-index: 99;
533
+    width: 100%;
534
+    background-color: #fff;
535
+    font-size: 30rpx;
536
+    .tab{
537
+      flex: 1;
538
+      display: flex;
539
+      justify-content: center;
540
+      align-items: center;
541
+      border-bottom: 4rpx solid transparent;
542
+      position: relative;
543
+      &:last-of-type{
544
+        &:after{
545
+          display: none;
546
+        }
547
+      }
548
+      &:after{
549
+        content: '';
550
+        position: absolute;
551
+        right: 0;
552
+        top: 50%;
553
+        transform: translateY(-50%);
554
+        width: 1rpx;
555
+        height: 44rpx;
556
+        background-color: #515151;
557
+      }
558
+      &.active{
559
+        color: $uni-primary;
560
+        border-color: $uni-primary;
561
+      }
562
+    }
563
+  }
564
+  .body{
565
+    margin-top: 88rpx;
566
+    box-sizing: border-box;
567
+    flex: 1;
568
+    min-height: 0;
569
+    border-top: 7rpx solid #EBEBEB;
570
+    .phone-filled{
571
+      margin-left: 5rpx;
572
+    }
573
+    .mic-filled{
574
+      margin-right: 100rpx;
575
+    }
576
+    .detail_item_wrap{
577
+      padding-bottom: 24rpx;
578
+    }
579
+    .detail_head{
580
+      padding: 24rpx;
581
+      border-top: 1rpx solid #D2D2D2;
582
+      border-bottom: 1rpx solid #D2D2D2;
583
+      display: flex;
584
+      justify-content: space-between;
585
+      align-items: center;
586
+      &:first-of-type{
587
+        border-top: none;
588
+      }
589
+      .title{
590
+        font-size: 26rpx;
591
+        color: $uni-primary;
592
+        padding-left: 18rpx;
593
+        position: relative;
594
+        &:before{
595
+          content: '';
596
+          width: 8rpx;
597
+          height: 25rpx;
598
+          background-color: $uni-primary;
599
+          position: absolute;
600
+          left: 0;
601
+          top: 50%;
602
+          transform: translateY(-50%);
603
+        }
604
+      }
605
+      .other{
606
+        display: flex;
607
+        align-items: center;
608
+        .priority{
609
+          font-size: 26rpx;
610
+          margin-right: 15rpx;
611
+        }
612
+        .status{
613
+          padding: 4rpx 10rpx;
614
+          border-radius: 20rpx;
615
+          background-color: #DBE8FE;
616
+          font-size: 22rpx;
617
+          color: #006CF9;
618
+        }
619
+      }
620
+    }
621
+
622
+    .deital_item{
623
+      font-size: 26rpx;
624
+      color: #555;
625
+      padding: 24rpx 24rpx 0;
626
+      display: flex;
627
+      align-items: center;
628
+      .name{
629
+        width: 8em;
630
+        margin-right: 24rpx;
631
+      }
632
+      .value{
633
+        flex: 1;
634
+        word-break: break-all;
635
+        &.img{
636
+          display: flex;
637
+          .imgItem{
638
+            width: 82rpx;
639
+            height: 82rpx;
640
+            margin-right: 24rpx;
641
+            &:last-of-type{
642
+              margin-right: 0;
643
+            }
644
+          }
645
+					.resourceItem{
646
+						width: 150rpx;
647
+						height: 150rpx;
648
+						margin-right: 24rpx;
649
+						&:last-of-type{
650
+						  margin-right: 0;
651
+						}
652
+					}
653
+					.resourceItem-audio{
654
+						width: 300rpx;
655
+						height: 60rpx;
656
+					}
657
+        }
658
+      }
659
+    }
660
+
661
+    .summaryItem_bodyItem{
662
+      padding: 24rpx 24rpx 0;
663
+      font-size: 26rpx;
664
+      .summaryItem_bodyItem_top{
665
+        display: flex;
666
+        justify-content: space-between;
667
+        align-items: center;
668
+        .value{
669
+          padding-left: 48rpx;
670
+          flex-shrink: 0;
671
+        }
672
+      }
673
+      .summaryItem_bodyItem_bottom{
674
+        margin-top: 24rpx;
675
+        display: flex;
676
+        justify-content: space-between;
677
+        align-items: center;
678
+        .name{
679
+          text-align: right;
680
+          flex: 1;
681
+        }
682
+        .value{
683
+          width: 220rpx;
684
+          text-align: right;
685
+          flex-shrink: 0;
686
+        }
687
+      }
688
+    }
689
+
690
+    .summaryItem_bodyItem_total{
691
+      text-align: right;
692
+      padding: 24rpx;
693
+      font-size: 26rpx;
694
+    }
695
+
696
+    .summaryItem_total{
697
+      text-align: center;
698
+      padding-top: 24rpx;
699
+      font-size: 32rpx;
700
+      font-weight: bold;
701
+      color: $uni-primary;
702
+      border-top: 1rpx solid #D2D2D2;
703
+    }
704
+
705
+    .process_item_wrap{
706
+      padding: 38rpx;
707
+      .process_item{
708
+        &:last-of-type{
709
+          .process_item_bottom{
710
+            border-left: none;
711
+          }
712
+        }
713
+        .process_item_top{
714
+          padding-left: 30rpx;
715
+          display: flex;
716
+          align-items: center;
717
+          position: relative;
718
+          &:before{
719
+            content: '';
720
+            position: absolute;
721
+            left: -13rpx;
722
+            top: 50%;
723
+            width: 26rpx;
724
+            height: 26rpx;
725
+            border-radius: 50%;
726
+            background-color: $uni-primary;
727
+            transform: translateY(-50%);
728
+          }
729
+          .name{
730
+            font-size: 30rpx;
731
+          }
732
+          .value{
733
+            margin-left: 20rpx;
734
+            font-size: 22rpx;
735
+            color: #A1A1A1;
736
+						flex: 1;
737
+          }
738
+        }
739
+        .process_item_bottom{
740
+          min-height: 82rpx;
741
+          border-left: 1rpx solid #B7BDC6;
742
+          margin-top: 5rpx;
743
+          padding-left: 30rpx;
744
+          display: flex;
745
+          font-size: 24rpx;
746
+          color: #A1A1A1;
747
+          .value{
748
+            margin-left: 20rpx;
749
+          }
750
+        }
751
+      }
752
+    }
753
+
754
+    .appraise_detail{
755
+      padding: 24rpx 24rpx 24rpx 40rpx;
756
+      .appraise_detail_top{
757
+        display: flex;
758
+        align-items: center;
759
+        justify-content: space-between;
760
+        font-size: 26rpx;
761
+        .name{
762
+          color: #A1A1A1;
763
+        }
764
+        .value{}
765
+      }
766
+      .appraise_detail_bottom{
767
+        font-size: 30rpx;
768
+        margin-top: 24rpx;
769
+        word-break: break-all;
770
+      }
771
+    }
772
+  }
773
+}
774
+</style>

+ 58 - 30
pages/assign/assign.vue

@@ -237,7 +237,9 @@
237 237
 	const dutyList = ref(null)
238 238
 
239 239
 	const userTypes = ref(null)
240
-
240
+	
241
+	const shijianliebiao_supplement = ref(false)
242
+	
241 243
   // 数据
242 244
   const dataInfo = reactive({
243 245
     tabs: [
@@ -804,10 +806,14 @@
804 806
 			dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.id
805 807
 		}
806 808
     if(dataInfo.tabActiveValue === 'direct'){
809
+			delete dataInfo.incidentData.entranceType
810
+			delete dataInfo.incidentData.AttachmentId
807 811
       submitHandler();
808 812
     }else if(dataInfo.tabActiveValue === 'supplement'){
809 813
       submitSupplement();
810 814
     }else if(dataInfo.tabActiveValue === 'assign'){
815
+			delete dataInfo.incidentData.entranceType
816
+			delete dataInfo.incidentData.AttachmentId
811 817
       submitAssign();
812 818
     }
813 819
   }
@@ -834,7 +840,9 @@
834 840
     //   });
835 841
     //   return;
836 842
     // }
837
-    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
843
+		if(!postData.incident.repairIncidentType){
844
+			postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
845
+		}
838 846
 		postData.incident.place = {}
839 847
 		postData.incident.place.id = floorId.value
840 848
     postData.incident.handleDescription = dataInfo.handleDescription;
@@ -877,7 +885,9 @@
877 885
     // if(HandleData.simpleness==1){
878 886
     // 	dataInfo.closecode = '1'
879 887
     // }
880
-    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
888
+		if(!postData.incident.repairIncidentType){
889
+			postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
890
+		}
881 891
 		postData.incident.place = {}
882 892
 		postData.incident.place.id = floorId.value
883 893
     postData.incident.handleDescription = dataInfo.handleDescription;
@@ -934,7 +944,9 @@
934 944
     //   });
935 945
     //   return;
936 946
     // }
937
-    postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
947
+		if(!postData.incident.repairIncidentType){
948
+			postData.incident.repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
949
+		}
938 950
 		postData.incident.place = {}
939 951
 		postData.incident.place.id = floorId.value
940 952
 		postData.incident.candidateGroupId = dataInfo.groupId;
@@ -973,7 +985,6 @@
973 985
 
974 986
   // 处理提交
975 987
   function submitHandler(){
976
-    console.log(dataInfo);
977 988
     if(!dataInfo.handleDescription.trim() && HandleData.simpleness != 1){
978 989
       uni.showToast({
979 990
       	icon: 'none',
@@ -1279,23 +1290,21 @@
1279 1290
 
1280 1291
   // 菜单权限
1281 1292
   function menuAuthHandle(){
1282
-    let shijianliebiao_supplement = false;//故障处理权限
1283
-    for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
1284
-      if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
1285
-        let currentMenu = loginUserStore.loginUser.menu[i].childrens;
1286
-        for (let j = 0; j < currentMenu.length; j++) {
1287
-            if (currentMenu[j].link == "replenishment") {
1288
-              shijianliebiao_supplement = true
1289
-            }
1290
-        }
1291
-      }
1292
-    }
1293
-
1294
-    // 补单
1295
-    if(shijianliebiao_supplement){
1296
-      let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
1297
-      dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
1298
-    }
1293
+		let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
1294
+		menu.forEach((e) => {
1295
+		  if (e.title=='故障管理') {
1296
+		    e.childrens.forEach((el) => {
1297
+					if(el.link=='incidentManagement'){
1298
+						el.childrens.forEach(item =>{
1299
+							if (item.link == "replenishment") {
1300
+							  shijianliebiao_supplement.value = true
1301
+							}
1302
+						})
1303
+					}
1304
+		    });
1305
+		  }
1306
+		});
1307
+		console.log(dataInfo.incidentData)
1299 1308
   }
1300 1309
 
1301 1310
 	// 获取知识库数量
@@ -1357,6 +1366,7 @@
1357 1366
 			  }
1358 1367
 
1359 1368
 				let storeData = handlerStore.handler.data
1369
+				console.log(8888,dataInfo.incidentData )
1360 1370
 				if(storeData.type == 'rep'){
1361 1371
 					dataInfo.handleDescription = null;
1362 1372
 					if(storeData.handleDescription){
@@ -1370,7 +1380,16 @@
1370 1380
 						dataInfo.supplementFlag = false
1371 1381
 					}
1372 1382
 				}
1373
-
1383
+				// console.log(12233, dataInfo)
1384
+				// 补单
1385
+				if(shijianliebiao_supplement.value && !dataInfo.incidentData.entranceType){
1386
+				  let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
1387
+					let item = dataInfo.tabs.find(i=> i.value == 'supplement')
1388
+					if(!item){
1389
+						dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
1390
+					}
1391
+				}
1392
+				
1374 1393
 			  handlerStore.clearHandlerData();
1375 1394
 
1376 1395
 			  if(dataInfo.category){
@@ -1403,7 +1422,6 @@
1403 1422
 					getDuty()
1404 1423
 			  }
1405 1424
 			}else if(incidentBuildStore.incidentBuild.data){
1406
-				console.log(222)
1407 1425
 			  // 初始化
1408 1426
 			  Object.assign(dataInfo.incidentData, incidentBuildStore.incidentBuild.data);
1409 1427
 				if(dataInfo.incidentData.category){
@@ -1430,11 +1448,21 @@
1430 1448
 			    //   dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.id;
1431 1449
 			    // }
1432 1450
 			  }
1433
-				if(dataInfo.incidentData.place.floor){
1434
-					floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.floor.id))
1435
-				}else{
1436
-					floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.id))
1437
-				 }
1451
+				console.log(222, dataInfo.incidentData)
1452
+				if(shijianliebiao_supplement.value && !dataInfo.incidentData.entranceType){
1453
+				  let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
1454
+					let item = dataInfo.tabs.find(i=> i.value == 'supplement')
1455
+					if(!item){
1456
+						dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
1457
+					}
1458
+				}
1459
+				if(dataInfo.incidentData.place){
1460
+					if(dataInfo.incidentData.place.floor){
1461
+						floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.floor.id))
1462
+					}else{
1463
+						floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.id))
1464
+					}
1465
+				}
1438 1466
 				getDuty()
1439 1467
 			  if(dataInfo.incidentData.source){
1440 1468
 			    dataInfo.incidentData.source = { id: dataInfo.incidentData.source };
@@ -1463,7 +1491,7 @@
1463 1491
         dataInfo.incidentData.duty = dutyList.value.id;
1464 1492
       }
1465 1493
 			initForm()
1466
-			console.log(1111,dutyList.value)
1494
+			// console.log(1111,dutyList.value)
1467 1495
 		})
1468 1496
 	}
1469 1497
 

+ 82 - 21
pages/buildIncident/buildIncident.vue

@@ -15,13 +15,20 @@
15 15
 					loginUserStore.loginUser.user.currentHospital.hosName}}
16 16
 				</view> -->
17 17
 			</view>
18
-      <view class="form_item">
18
+      <view class="form_item" v-if="incidentData.repairIncidentType=='dept' || incidentData.repairIncidentType==undefined">
19 19
         <view class="title"><text class="required newicon newicon-bitian"></text>报修科室:</view>
20 20
         <view class="value category" @click="selectDepartment">
21 21
           <text class="categoryName ellipsis-multiline">{{incidentData.department ? incidentData.department.dept : ''}}</text>
22
-          <text class="newicon newicon-weibiaoti2010104"></text>
22
+          <text class="newicon newicon-weibiaoti2010104"></text> 
23 23
         </view>
24 24
       </view>
25
+			<view class="form_item" v-if="isRepair.valueconfig==1">
26
+			  <view class="title"><text class="required newicon newicon-bitian transparent"></text>资产:</view>
27
+			  <view class="value category" @click="selectAsset">
28
+			    <text class="categoryName ellipsis-multiline">{{incidentData.assetDTO ? incidentData.assetDTO.name : ''}}</text>
29
+			    <text class="newicon newicon-weibiaoti2010104"></text>
30
+			  </view>
31
+			</view>
25 32
       <view class="form_item">
26 33
         <view class="title"><text class="required newicon newicon-bitian transparent"></text>报修人:</view>
27 34
         <view class="value category" @click="selectRequester">
@@ -78,11 +85,14 @@
78 85
       <view class="form_item_column">
79 86
         <view class="form_item">
80 87
           <view class="title"><text class="required newicon newicon-bitian transparent"></text>报修图片:</view>
81
-          <view class="value">
88
+          <view class="value" v-if="!incidentData.reqAttachment">
82 89
             <uni-file-picker ref="handlerImgRef" v-model="incidentData.repairImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
83 90
           </view>
91
+					<view class="value" v-else>
92
+						<img v-for="item in incidentData.viewRepairImgList" :src="item.url" alt="" >
93
+					</view>
84 94
         </view>
85
-        <view class="form_item">
95
+        <view class="form_item" v-if="!incidentData.reqAttachment">
86 96
           <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>报修图片:</view>
87 97
           <view class="value">
88 98
             <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
@@ -101,7 +111,7 @@
101 111
 <script setup>
102 112
   import { ref, reactive } from 'vue'
103 113
   import { onLoad } from '@dcloudio/uni-app'
104
-  import { api_branch, api_getDictionary, getFetchDataList, api_incidentTask } from "@/http/api.js"
114
+  import { api_listAttachment, api_branch, api_getDictionary, getFetchDataList, api_incidentTask } from "@/http/api.js"
105 115
   import { defaultColor } from '@/static/js/theme.js'
106 116
   import { useSetTitle } from '@/share/useSetTitle.js'
107 117
   import { useGoBack } from '@/share/useGoBack.js'
@@ -116,7 +126,8 @@
116 126
   const handlerStore = useHandlerStore();
117 127
   const { uploadFile }  = useUploadFile();
118 128
   const { goBack }  = useGoBack();
119
-
129
+	const isRepair = ref({})
130
+	
120 131
   // 主题颜色
121 132
   const primaryColor = ref(defaultColor)
122 133
 
@@ -140,6 +151,7 @@
140 151
     "requester":undefined,
141 152
     "acceptUser": loginUserStore.loginUser.user,
142 153
     repairImgList: [],//报修图片列表
154
+		viewRepairImgList: []
143 155
   })
144 156
 
145 157
   // 报修图片
@@ -206,7 +218,15 @@
206 218
       url: `/pages/searchDept/searchDept`
207 219
     })
208 220
   }
209
-
221
+	
222
+	// 跳转到搜索资产
223
+	function selectAsset(){
224
+		incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident', 'asset');
225
+		uni.navigateTo({
226
+		  url: `/pages/searchAsset/searchAsset`
227
+		})
228
+	}
229
+	
210 230
   // 跳转到搜索报修人
211 231
   function selectRequester(){
212 232
     incidentBuildStore.setIncidentBuildData(incidentData, 'buildIncident', 'requester');
@@ -287,10 +307,12 @@
287 307
       if(sourceValue){
288 308
         incidentData.source = sourceValue;
289 309
       }else{
290
-        let discover = dataInfo.sourceList.find(v => v.key === 'leader');
291
-        if(discover){
292
-          incidentData.source = discover.value;
293
-        }
310
+				if(!incidentData.entranceType){
311
+					let discover = dataInfo.sourceList.find(v => v.key === 'leader');
312
+					if(discover){
313
+					  incidentData.source = discover.value;
314
+					}
315
+				}
294 316
       }
295 317
     })
296 318
   }
@@ -342,7 +364,28 @@
342 364
   function handlerOrderImg(imgObj){
343 365
     return uploadFile(imgObj, 'incident', dataInfo.incidentId)
344 366
   }
345
-
367
+	
368
+	// 获取报修图片
369
+	function getRepairImgs(AttachmentId){
370
+	  uni.showLoading({
371
+	    title: "加载中",
372
+	    mask: true,
373
+	  });
374
+	  api_listAttachment('wechatRequesterIncident', AttachmentId).then(res => {
375
+	    uni.hideLoading();
376
+	    res.data = res.data || [];
377
+	    res.data.forEach(v => {
378
+	      v.url = location.origin + "/file" + v.relativeFilePath;
379
+	      v.path = location.origin + "/file" + v.thumbFilePath;
380
+	    })
381
+			if(!incidentData.reqAttachment){
382
+				incidentData.repairImgList = res.data;
383
+			}else{
384
+				incidentData.viewRepairImgList = res.data;
385
+			}
386
+	  })
387
+	}
388
+	
346 389
 	// 获取优先级
347 390
 	function getPriorityData(){
348 391
 		let postData = {
@@ -371,14 +414,16 @@
371 414
       });
372 415
       return;
373 416
     }
374
-
375
-    if(!incidentData.department){
376
-      uni.showToast({
377
-      	icon: 'none',
378
-        title: '请选择报修科室'
379
-      });
380
-      return;
381
-    }
417
+		
418
+		if(incidentData.repairIncidentType=='dept' || incidentData.repairIncidentType==undefined){
419
+			if(!incidentData.department){
420
+			  uni.showToast({
421
+			  	icon: 'none',
422
+			    title: '请选择报修科室'
423
+			  });
424
+			  return;
425
+			}
426
+		}
382 427
 
383 428
     if(!incidentData.contactsInformation.trim()){
384 429
       uni.showToast({
@@ -445,9 +490,12 @@
445 490
   }
446 491
 
447 492
   onLoad((option) => {
493
+		if(uni.getStorageSync('sysData')){
494
+			let data = JSON.parse(uni.getStorageSync('sysData'))
495
+			isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
496
+		}
448 497
     handlerStore.clearHandlerData();
449 498
     if(option.type == 'inspection'){
450
-      console.log(incidentBuildStore.incidentBuild.data, 'incidentBuildStore.incidentBuild.data');
451 499
       Object.assign(
452 500
         incidentData,
453 501
         incidentBuildStore.incidentBuild.data,
@@ -456,6 +504,11 @@
456 504
           description: incidentBuildStore.incidentBuild.data.description || (incidentBuildStore.incidentBuild.data.category ? incidentBuildStore.incidentBuild.data.category.mutiCategory : undefined),
457 505
         },
458 506
       );
507
+			console.log(23232232, incidentData)
508
+			// 有附件就获取图片
509
+			if(incidentData.reqAttachment){
510
+				getRepairImgs(incidentData.AttachmentId)
511
+			}
459 512
     	if(incidentData.category && incidentData.category.id && !incidentBuildStore.incidentBuild.data.priority){
460 513
     		getPriorityData()
461 514
     	}
@@ -514,6 +567,10 @@
514 567
           margin-top: 10rpx;
515 568
           padding-left: 20rpx;
516 569
           box-sizing: border-box;
570
+					img{
571
+						width: 100%;
572
+						height: 100%;
573
+					}
517 574
         }
518 575
         .tips{
519 576
           padding: 24rpx;
@@ -536,6 +593,10 @@
536 593
       }
537 594
       .value{
538 595
         width: 100%;
596
+				img{
597
+					width: 150rpx;
598
+					height: 150rpx;
599
+				}
539 600
         &.category{
540 601
           width: 100%;
541 602
           display: flex;

+ 358 - 0
pages/callRecord/callRecord.vue

@@ -0,0 +1,358 @@
1
+<template>
2
+  <view class="incidentList">
3
+    <view class="head">
4
+<!--      <view class="tab" :class="{active: tab.id === dataInfo.tabActiveId}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.id)">
5
+        {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
6
+      </view> -->
7
+      <view class="filter" @click="filterClick">
8
+        <text class="newicon newicon-shaixuan"></text>
9
+      </view>
10
+    </view>
11
+    <view class="body" v-if="dataInfo.list.length">
12
+      <view class="body_item" v-for="data in dataInfo.list" :key="data.id">
13
+        <view class="body_item_head ellipsis-multiline" @click="attachmentClick(data)">
14
+					{{data.dTMFA}}
15
+					<uni-icons v-if="data.dTMFA && data.dTMFB" type="arrow-right" class="arrow-right" :size="18" :color="primaryColor"></uni-icons>
16
+					{{data.dTMFB}}
17
+					<uni-icons v-if="data.path" type="mic-filled" class="mic-filled" :size="18" :color="primaryColor"></uni-icons>
18
+        </view>
19
+				 
20
+        <view class="body_item_content">
21
+					<view class="body_item_content_p">
22
+						<text class="name ellipsis">开始时间:{{data.responseTime}}</text>
23
+					</view>
24
+					<view class="body_item_content_p">
25
+						<text class="name ellipsis">结束时间:{{data.overTime}}</text>
26
+					</view>
27
+					<view class="body_item_content_p">
28
+						<text class="name ellipsis">通话时长:{{data.longTime || 0}} 秒</text>
29
+						<view class="type">
30
+							{{data.callState == 1?'已接':'未接'}}/
31
+							{{data.callType == 1?'呼入':'呼出'}}
32
+						</view>
33
+					</view>
34
+        </view>
35
+      </view>
36
+    </view>
37
+    <view class="zanwu" v-else>
38
+      <text class="newicon newicon-zanwu"></text>
39
+    </view>
40
+    <callFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter"></callFilter>
41
+    <IncidentAttachment v-if="dataInfo.isAttachment" @knowEmit="knowAttachment" :incidentData="dataInfo.incidentData"></IncidentAttachment>
42
+    <RequireAttachment v-if="dataInfo.isRequireAttachment" @knowEmit="knowRequireAttachment" :incidentData="dataInfo.incidentData"></RequireAttachment>
43
+  </view>
44
+</template>
45
+
46
+<script setup>
47
+  import callFilter from '@/components/callFilter.vue';
48
+  import IncidentAttachment from '@/components/IncidentAttachment.vue';
49
+  import RequireAttachment from '@/components/RequireAttachment.vue';
50
+  import { subMonths, startOfMonth, endOfMonth, format, add, setDate } from 'date-fns'
51
+  import { ref, reactive, computed } from 'vue'
52
+  import { onLoad, onUnload, onHide, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
53
+  import { api_callLog, api_getDictionary, api_incident, api_incident_count, api_incidentTask } from "@/http/api.js"
54
+  import { filterFormatDate } from '@/filters/filterFormatDate.js'
55
+  import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
56
+  import { computedStateStyle } from '@/filters/computedStateStyle.js'
57
+  import { computedCurrentLogOverTime } from '@/filters/computedCurrentLogOverTime.js'
58
+  import { defaultColor } from '@/static/js/theme.js'
59
+  import { useSetTitle } from '@/share/useSetTitle.js'
60
+  import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
61
+  import { useSetTabbar } from '@/share/useSetTabbar.js'
62
+  import { useLoginUserStore } from '@/stores/loginUser'
63
+  import { useIncidentNumStore } from '@/stores/incidentNum'
64
+  import { useIncidentListSearchStore } from '@/stores/incidentListSearch'
65
+	import { useHandlerStore } from '@/stores/handler'
66
+
67
+  useSetTitle();
68
+  const loginUserStore = useLoginUserStore();
69
+  const incidentNumStore = useIncidentNumStore();
70
+  const incidentListSearchStore = useIncidentListSearchStore();
71
+  const { formatDate }  = filterFormatDate();
72
+  const { priorityStyle }  = computedPriorityStyle();
73
+  const { stateStyle }  = computedStateStyle();
74
+  const { currentLogOverTime }  = computedCurrentLogOverTime();
75
+  const { makePhoneCall }  = useMakePhoneCall();
76
+  const { setTabbar }  = useSetTabbar();
77
+	const handlerStore = useHandlerStore();
78
+
79
+  // 主题颜色
80
+  const primaryColor = ref(defaultColor)
81
+
82
+  // 数据
83
+  const dataInfo = reactive({
84
+    tabs: [{id: 0, name: '全部', value: 'all', num: ''}],
85
+    tabActiveId: 0,//当前选择的tab
86
+    list: [],//工单列表
87
+    idx: 0,//页码
88
+    hasMore: true,//是否有更多数据
89
+    isFilter: false,//筛选框开关
90
+    isAttachment: false,//图片和通话录音开关
91
+    isRequireAttachment: false,//报修录音开关
92
+    incidentId: undefined,
93
+    evtFilter: {
94
+      called: null,
95
+      dialing: null,
96
+      datetimerange:[],
97
+      selected1: 'all',
98
+      selected2: 'all'
99
+    },//筛选框数据
100
+  })
101
+	
102
+	// 设置默认时间
103
+	function setDefaultDate(){
104
+		// 获取当前日期
105
+		const today = new Date();
106
+		// 获取上个月的第一天
107
+		const startOfLastMonth = startOfMonth(subMonths(today, 1));
108
+		// 获取上个月的最后一天
109
+		const endOfLastMonth = endOfMonth(subMonths(today, 1));
110
+		
111
+		dataInfo.evtFilter.datetimerange = [format(startOfLastMonth, 'yyyy-MM-dd HH:mm:ss'),format(endOfLastMonth, 'yyyy-MM-dd HH:mm:ss')]
112
+	}
113
+	
114
+  // 点击筛选
115
+  function filterClick(){
116
+    dataInfo.isFilter = true;
117
+  }
118
+
119
+  // 确认筛选
120
+  function conformFilter(evtFilter){
121
+		console.log(444, evtFilter)
122
+    dataInfo.evtFilter = evtFilter;
123
+    dataInfo.isFilter = false;
124
+    getList(0);
125
+  }
126
+
127
+  // 关闭筛选
128
+  function cancelFilter(){
129
+    dataInfo.isFilter = false;
130
+  }
131
+
132
+  // 点击图片和录音
133
+  function attachmentClick(incidentData){
134
+    dataInfo.incidentData = incidentData;
135
+		dataInfo.incidentData.type = 'call'
136
+    dataInfo.isAttachment = true;
137
+  }
138
+
139
+  // 返回图片和录音
140
+  function knowAttachment(){
141
+    dataInfo.isAttachment = false;
142
+  }
143
+
144
+  // 点击报修录音
145
+  function attachmentRequireClick(incidentData){
146
+    dataInfo.incidentData = incidentData;
147
+    dataInfo.isRequireAttachment = true;
148
+  }
149
+
150
+  // 返回报修录音
151
+  function knowRequireAttachment(){
152
+    dataInfo.isRequireAttachment = false;
153
+  }
154
+
155
+  // 获取列表信息
156
+  function getList(idx){
157
+    uni.showLoading({
158
+      title: "加载中",
159
+      mask: true,
160
+    });
161
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
162
+    if(dataInfo.idx === 0){
163
+      dataInfo.list = [];
164
+    }
165
+    let postData = {
166
+        "idx": dataInfo.idx,
167
+        "sum": 10,
168
+        "callLog": {
169
+          dTMFA: dataInfo.evtFilter.dialing || undefined,
170
+					dTMFB: dataInfo.evtFilter.called || undefined,
171
+					callState: dataInfo.evtFilter.selected1 || undefined,
172
+					callType: dataInfo.evtFilter.selected2 || undefined,
173
+					startTime: dataInfo.evtFilter.datetimerange[0] || undefined,
174
+					endTime: dataInfo.evtFilter.datetimerange[1] || undefined,
175
+        }
176
+    }
177
+		if(dataInfo.evtFilter.selected1!='all'){
178
+			postData.callLog.callState = dataInfo.evtFilter.selected1
179
+		}else{
180
+			delete postData.callLog.callState
181
+		}
182
+		if(dataInfo.evtFilter.selected2!='all'){
183
+			postData.callLog.callType = dataInfo.evtFilter.selected2
184
+		}else{
185
+			delete postData.callLog.callType
186
+		}
187
+    api_callLog(postData).then(res => {
188
+      uni.hideLoading();
189
+      uni.stopPullDownRefresh();
190
+      if(res.status == 200){
191
+        let list = res.list || [];
192
+        if(list.length){
193
+          dataInfo.hasMore = true;
194
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
195
+        }else{
196
+          dataInfo.hasMore = false;
197
+        }
198
+      }else{
199
+        uni.showToast({
200
+          icon: 'none',
201
+          title: res.msg || '请求数据失败!'
202
+        });
203
+      }
204
+    })
205
+  }
206
+
207
+
208
+  onLoad((option) => {
209
+		setDefaultDate();
210
+    getList(0);
211
+  })
212
+
213
+	onUnload(() => {
214
+    dataInfo.isFilter = false;
215
+  })
216
+
217
+	onHide(() => {
218
+	  dataInfo.isFilter = false;
219
+	})
220
+
221
+  onTabItemTap(e => {
222
+    // onLoadFn();
223
+  })
224
+
225
+  onPullDownRefresh(() => {
226
+    getList(0)
227
+  })
228
+
229
+  onReachBottom(() => {
230
+    dataInfo.idx += 1;
231
+    if (dataInfo.hasMore) {
232
+      getList(); // 当触底时加载更多数据
233
+    }
234
+  })
235
+</script>
236
+
237
+<style lang="scss" scoped>
238
+page{
239
+  height: calc(100vh - var(--window-bottom));
240
+}
241
+.incidentList{
242
+  display: flex;
243
+  flex-direction: column;
244
+  justify-content: space-between;
245
+  .head{
246
+    height: 88rpx;
247
+    display: flex;
248
+    position: fixed;
249
+    z-index: 99;
250
+    width: 100%;
251
+    background-color: #fff;
252
+    font-size: 30rpx;
253
+    .tab{
254
+      flex: 1;
255
+      display: flex;
256
+      justify-content: center;
257
+      align-items: center;
258
+      border-bottom: 4rpx solid transparent;
259
+      &.active{
260
+        color: $uni-primary;
261
+        border-color: $uni-primary;
262
+      }
263
+    }
264
+    .filter{
265
+      width: 84rpx;
266
+      display: flex;
267
+      justify-content: center;
268
+      align-items: center;
269
+			position: absolute;
270
+			right: 0;
271
+			top: 30rpx;
272
+      .newicon-shaixuan{
273
+        font-size: 36rpx;
274
+        color: #2C2C2C;
275
+      }
276
+    }
277
+  }
278
+  .body{
279
+    margin-bottom: var(--window-bottom);
280
+    margin-top: 88rpx;
281
+    border-top: 6rpx solid #EBEBEB;
282
+    .body_item{
283
+      border-bottom: 8rpx solid #EBEBEB;
284
+      .body_item_head{
285
+        word-break: break-all;
286
+        text-align: justify;
287
+        text-align: left;
288
+        margin: 24rpx;
289
+        font-size: 30rpx;
290
+      }
291
+      .body_item_content{
292
+				// display: flex;
293
+        border-top: 1rpx solid #D8D8D8;
294
+        padding: 24rpx;
295
+				.type{
296
+					margin-left: 40rpx;
297
+				}
298
+        .body_item_content_p{
299
+          color: #6A6A6A;
300
+          font-size: 26rpx;
301
+          display: flex;
302
+          // justify-content: space-between;
303
+          align-items: center;
304
+          margin-bottom: 24rpx;
305
+          &:last-of-type{
306
+            margin-bottom: 0;
307
+          }
308
+          .name{
309
+            // flex: 1;
310
+          }
311
+          .status{
312
+            padding: 4rpx 10rpx;
313
+            border-radius: 20rpx;
314
+            background-color: #DBE8FE;
315
+            font-size: 22rpx;
316
+            color: #006CF9;
317
+          }
318
+          .icon_all{
319
+            .mic-filled,
320
+            .image-filled
321
+            {
322
+              margin-left: 16rpx;
323
+            }
324
+          }
325
+        }
326
+      }
327
+      .body_item_foot{
328
+        border-top: 1rpx solid #D8D8D8;
329
+        font-size: 26rpx;
330
+        padding: 24rpx;
331
+        .foot_info{
332
+          display: flex;
333
+          justify-content: space-between;
334
+          align-items: center;
335
+          .phone-filled{
336
+            margin-left: 5rpx;
337
+          }
338
+        }
339
+      }
340
+    }
341
+  }
342
+  .zanwu{
343
+    box-sizing: border-box;
344
+    margin-bottom: var(--window-bottom);
345
+    margin-top: 88rpx;
346
+    border-top: 6rpx solid #EBEBEB;
347
+    height: calc(100vh - var(--window-bottom) - 88rpx);
348
+    display: flex;
349
+    justify-content: center;
350
+    background-color: #F7F7F7;
351
+    .newicon-zanwu{
352
+      font-size: 256rpx;
353
+      color: #D6D6D6;
354
+      margin-top: 140rpx;
355
+    }
356
+  }
357
+}
358
+</style>

+ 18 - 13
pages/changeUser/changeUser.vue

@@ -198,19 +198,24 @@
198 198
 				}
199 199
         let transferFlag = false;//转派权限
200 200
         let assignFlag = false;//指派权限
201
-        for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
202
-          if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
203
-            let currentMenu = loginUserStore.loginUser.menu[i].childrens;
204
-            for (let j = 0; j < currentMenu.length; j++) {
205
-                if (currentMenu[j].link == "assign") {
206
-                    assignFlag = true
207
-                }
208
-                if (currentMenu[j].link == "transfer") {
209
-                    transferFlag = true
210
-                }
211
-            }
212
-          }
213
-        }
201
+				let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
202
+				menu.forEach((e) => {
203
+				  if (e.title=='故障管理') {
204
+				    e.childrens.forEach((el) => {
205
+							if(el.link=='incidentManagement'){
206
+								el.childrens.forEach(item =>{
207
+									if (item.link == "assign") {
208
+									    assignFlag = true
209
+									}
210
+									if (item.link == "transfer") {
211
+									    transferFlag = true
212
+									}
213
+
214
+								})
215
+							}
216
+				    });
217
+				  }
218
+				});
214 219
 
215 220
         // 转派
216 221
         if(dataInfo.incidentData.state.value == 'handler' && dataInfo.incidentData.handlingPersonnelUser && dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id && !assignFlag && transferFlag){

+ 15 - 11
pages/handler/handler.vue

@@ -583,17 +583,21 @@
583 583
           dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
584 584
           getIntroduceCount(dataInfo.category.id)
585 585
           let chuli = false;//故障处理权限
586
-          for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
587
-            if(loginUserStore.loginUser.menu[i].link === 'incidentManagement'){
588
-              let currentMenu = loginUserStore.loginUser.menu[i].childrens;
589
-              for (let j = 0; j < currentMenu.length; j++) {
590
-                if (currentMenu[j].link == "handle") {
591
-                  chuli = true
592
-                }
593
-              }
594
-            }
595
-          }
596
-
586
+					let menu = JSON.parse(uni.getStorageSync("menuList")) || []; //菜单
587
+					menu.forEach((e) => {
588
+					  if (e.title=='故障管理') {
589
+					    e.childrens.forEach((el) => {
590
+								if(el.link=='incidentManagement'){
591
+									el.childrens.forEach(item =>{
592
+										if (item.link == "handle") {
593
+										  chuli = true;
594
+										}
595
+									})
596
+								}
597
+					    });
598
+					  }
599
+					});
600
+					
597 601
           // 故障处理
598 602
           if(dataInfo.incidentData.state.value == 'handler' && dataInfo.incidentData.handlingPersonnelUser && dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id && chuli){
599 603
             let flag = dataInfo.tabs.some(v => v.value === 'doing');

+ 2 - 2
pages/homePage/homePage.vue

@@ -153,7 +153,7 @@
153 153
 			changeGroup();
154 154
       if (res.state == 200) {
155 155
         loginSuccess(res.data);
156
-				transform(res.data);
156
+				transform(res.data, 'menu');
157 157
       } else {
158 158
         uni.showToast({
159 159
           icon: 'none',
@@ -172,7 +172,7 @@
172 172
 			uni.setStorageSync('sysData',JSON.stringify(res.list))
173 173
 			setTimeout(_=>{
174 174
 				loginSuccess(data);
175
-				transform(data);
175
+				transform(data, 'menu');
176 176
 			},500)
177 177
 		})
178 178
 	}

+ 4 - 0
pages/incidentDetail/incidentDetail.vue

@@ -24,6 +24,10 @@
24 24
             <text class="name">报修类型:</text>
25 25
             <text class="value">{{dataInfo.incidentData.repairIncidentType.name || '无'}}</text>
26 26
           </view>
27
+					<view class="deital_item">
28
+					  <text class="name">关联资产:</text>
29
+					  <text class="value">{{dataInfo.incidentData.assetDTO ? dataInfo.incidentData.assetDTO.name : '无'}}</text>
30
+					</view>
27 31
           <view class="deital_item">
28 32
             <text class="name">故障现象:</text>
29 33
             <text class="value">{{dataInfo.incidentData.category ? dataInfo.incidentData.category.mutiCategory : '无'}}</text>

+ 51 - 6
pages/my/my.vue

@@ -51,14 +51,18 @@
51 51
     <view class="foot_common_btns">
52 52
 			<button @click="myRepair" type="default" class="primaryButton btn"><text class="icon-style newicon newicon-ziyuan-baoxiu1"></text>我的报修</button>
53 53
       <button @click="toBuildIncident" type="default" class="primaryButton btn"><text class="newicon newicon-xinjian2"></text>新建事件</button>
54
-    </view>
54
+		</view>
55
+		<view class="foot_common_btns">
56
+			<button @click="addrRepairs" type="default" class="primaryButton btn"><text class="icon-style newicon newicon-ziyuan-baoxiu1"></text>报修处理</button>
57
+			<button @click="callRecord" type="default" class="primaryButton btn"><text class="newicon newicon-xinjian2"></text>通话记录</button>
58
+		</view>
55 59
   </view>
56 60
 </template>
57 61
 
58 62
 <script setup>
59 63
   import { ref, reactive } from 'vue'
60 64
   import { onLoad, onTabItemTap } from '@dcloudio/uni-app'
61
-  import { api_incident_count } from "@/http/api.js"
65
+  import { api_getDictionary, api_incident_count, api_systemConfiguration } from "@/http/api.js"
62 66
   import { defaultColor } from '@/static/js/theme.js'
63 67
   import { useSetTitle } from '@/share/useSetTitle.js'
64 68
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
@@ -67,6 +71,7 @@
67 71
   import { repositoryListSearchStore } from '@/stores/repositorySearch'
68 72
   import { useSetTabbar } from '@/share/useSetTabbar.js'
69 73
 	import { useIncidentBuildStore } from '@/stores/incidentBuild'
74
+  import { transform } from '@/utils/index.js'
70 75
 	
71 76
   useSetTitle();
72 77
   const loginUserStore = useLoginUserStore();
@@ -161,6 +166,20 @@
161 166
     })
162 167
   }
163 168
   
169
+	// 报修处理
170
+	function addrRepairs(){
171
+		uni.navigateTo({
172
+		  url: '/pages/addrRepairs/addrRepairs'
173
+		})
174
+	}
175
+	
176
+	// 通话记录
177
+	function callRecord(){
178
+		uni.navigateTo({
179
+		  url: '/pages/callRecord/callRecord'
180
+		})
181
+	}
182
+	
164 183
   // 点击数量跳转
165 184
   function toIncident(queryTask, statusId){
166 185
     incidentNumStore.setIncidentNumData({
@@ -172,15 +191,41 @@
172 191
     })
173 192
   }
174 193
   
194
+	// 获取配置项
195
+	function getConfig(data){
196
+		api_systemConfiguration({
197
+			idx: 0,
198
+			sum: 9999,
199
+		}).then(res=>{
200
+			uni.setStorageSync('sysData',JSON.stringify(res.list))
201
+		})
202
+	}
203
+	
204
+	// 获取工作组
205
+	function changeGroup(){
206
+		let postData = {
207
+			"key": 'usertype',
208
+			"type": "list",
209
+		};
210
+		api_getDictionary(postData).then((data) => {
211
+			uni.setStorageSync('groupData',JSON.stringify(data))
212
+		});
213
+	}
214
+	
175 215
   // 初始化
176 216
   function onLoadFn(){
177 217
     getCount();
178 218
   }
179 219
   
180 220
   onLoad((option) => {
181
-		let menu = loginUserStore.loginUser.menu.find(v => v.link === 'wxPperation')
182
-		if(menu && menu.childrens && menu.childrens.length>0){
183
-			bindingPolling.value = menu.childrens.some(v => v.link === 'bindingPolling')
221
+		changeGroup()
222
+		getConfig()
223
+		let menu = loginUserStore.loginUser.menu
224
+		menu = menu.map(i=> ({...i, parentid: i.parentid}))
225
+		let arr = transform(menu, 'id', 'parentid')
226
+		let item = arr.find(v => v.link === 'wxPperation')
227
+		if(item && item.children && item.children.length>0){
228
+			bindingPolling.value = item.children.some(v => v.link === 'bindingPolling')
184 229
 		}
185 230
     for(let i = 0; i<7; i++){
186 231
     	setTabbar(i)
@@ -214,7 +259,7 @@ page{
214 259
   .body{
215 260
     width: 714rpx;
216 261
     height: 100%;
217
-    margin: 16rpx auto var(--window-bottom) auto;
262
+    margin: 16rpx auto ;
218 263
     box-sizing: border-box;
219 264
     border-radius: 8rpx;
220 265
     .top{

+ 10 - 5
pages/myRepair/myRepair.vue

@@ -42,11 +42,11 @@
42 42
 						</view>
43 43
 		      </view>
44 44
 					<div class="sign-style" v-if="deptRepair && publicRepair">
45
-						<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.name=='科室报修'">
45
+						<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.value=='dept'">
46 46
 							<view class="img-url1"></view>
47 47
 							<view class="img-name">科</view>
48 48
 						</view>
49
-						<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.name=='公共报修'">
49
+						<view class="img-box" v-if="data.repairIncidentType && data.repairIncidentType.value=='public'">
50 50
 							<view class="img-url2"></view>
51 51
 							<view class="img-name">公</view>
52 52
 						</view>
@@ -854,7 +854,7 @@
854 854
 					id:userId
855 855
 				},
856 856
 		    name: user.name,
857
-				userTypeIds: String(userTypes.value.map(v => v.id))
857
+				userTypeIds: userTypes.value ? String(userTypes.value.map(v => v.id)) : undefined
858 858
 		  }
859 859
 		}
860 860
 		api_user(postData).then(res => {
@@ -945,6 +945,7 @@
945 945
 			sum: 9999,
946 946
 		}).then(res=>{
947 947
 			let data = res.list
948
+			uni.setStorageSync('sysData',JSON.stringify(res.list))
948 949
 			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
949 950
 			isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
950 951
 			isPublic.value = data.find(i=>i.keyconfig=='publicRepair')
@@ -994,7 +995,9 @@
994 995
 	onLoad((option) => {
995 996
 		console.log(777,option)
996 997
 		getConfig(option)
997
-		userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
998
+		if(uni.getStorageSync('groupData')){
999
+			userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
1000
+		}
998 1001
 		dataConfigInfo.num = 1
999 1002
 		if(option && option.configType){
1000 1003
 			operationType.value = option.configType
@@ -1016,7 +1019,9 @@
1016 1019
 	})
1017 1020
 
1018 1021
 	onShow((option) => {
1019
-		userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
1022
+		if(uni.getStorageSync('groupData')){
1023
+			userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
1024
+		}
1020 1025
 		if(dataConfigInfo.num==0){
1021 1026
 			getUserInfo()
1022 1027
 		}

+ 11 - 5
pages/repair/config.vue

@@ -251,8 +251,10 @@
251 251
 	
252 252
   // 初始化
253 253
   function onLoadFn(){
254
-		let data = JSON.parse(uni.getStorageSync('sysData'))
255
-		deptRepair.value = data.find(i=>i.keyconfig=='deptRepair')
254
+		if(uni.getStorageSync('sysData')){
255
+			let data = JSON.parse(uni.getStorageSync('sysData'))
256
+			deptRepair.value = data.find(i=>i.keyconfig=='deptRepair')
257
+		}
256 258
 		getBranch()
257 259
   }
258 260
 	
@@ -272,7 +274,7 @@
272 274
 					id:userId
273 275
 				},
274 276
 		    name: user.name,
275
-				userTypeIds: String(userTypes.value.map(v => v.id))
277
+				userTypeIds: userTypes.value?String(userTypes.value.map(v => v.id)):undefined
276 278
 		  }
277 279
 		}
278 280
 		api_user(postData).then(res => {
@@ -362,7 +364,9 @@
362 364
 	})
363 365
 	
364 366
 	onShow((option) => {
365
-		userTypes.value = JSON.parse(uni.getStorageSync('groupData')) 
367
+		if(uni.getStorageSync('groupData')){
368
+			userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
369
+		}
366 370
 		onLoadFn()
367 371
 		if(dataInfo.num==0){
368 372
 			getUserInfo()
@@ -373,7 +377,9 @@
373 377
 	})
374 378
 			
375 379
   onLoad((option) => {
376
-		userTypes.value = JSON.parse(uni.getStorageSync('groupData')) 
380
+		if(uni.getStorageSync('groupData')){
381
+			userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
382
+		}
377 383
 		onLoadFn();
378 384
 		dataInfo.num = 1
379 385
 		if(option && option.configType){

+ 15 - 2
pages/repair/home.vue

@@ -60,7 +60,7 @@
60 60
 	import { SM } from "@/http/http.js"
61 61
 	import { ref, reactive } from 'vue'
62 62
 	import { onLoad,onShow,onPullDownRefresh } from '@dcloudio/uni-app'
63
-	import { api_systemConfiguration, api_repairScanCode, api_getNotice, api_getCount } from "@/http/api.js"
63
+	import { api_getDictionary, api_systemConfiguration, api_repairScanCode, api_getNotice, api_getCount } from "@/http/api.js"
64 64
 	import { useSetTitle } from '@/share/useSetTitle.js'
65 65
 	import { repositoryListSearchStore } from '@/stores/repositorySearch'
66 66
 	import { useSetTabbar } from '@/share/useSetTabbar.js'
@@ -176,6 +176,7 @@
176 176
 			idx: 0,
177 177
 			sum: 9999,
178 178
 		}).then(res=>{
179
+			uni.setStorageSync('sysData',JSON.stringify(res.list))
179 180
 			let data = res.list
180 181
 			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
181 182
 			isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
@@ -183,6 +184,17 @@
183 184
 		})
184 185
 	}
185 186
 	
187
+	// 获取工作组
188
+	function changeGroup(){
189
+		let postData = {
190
+			"key": 'usertype',
191
+			"type": "list",
192
+		};
193
+		api_getDictionary(postData).then((data) => {
194
+			uni.setStorageSync('groupData',JSON.stringify(data))
195
+		});
196
+	}
197
+	
186 198
 	onPullDownRefresh(_=>{
187 199
 		getCount();
188 200
 	})
@@ -193,12 +205,13 @@
193 205
 			setTabbar(i)
194 206
 		}
195 207
 		getCount()
208
+		changeGroup()
196 209
 		getConfig()
197 210
 	})
198 211
 	
199 212
 	onShow((option) => {
200 213
 		uni.setStorageSync('repairData','')
201
-		uni.setStorageSync('rapidRepNext','')
214
+		// uni.setStorageSync('rapidRepNext','')
202 215
 		getCount()
203 216
 	})
204 217
 	

+ 9 - 9
pages/repair/rapidRep.vue

@@ -8,7 +8,7 @@
8 8
 		<!-- 	<view class="candidate">
9 9
 				<view class="candidate-item" v-for="item in candidateData" :key="item" @click="itemCandidate(item)">{{item.name}}</view>
10 10
 			</view> -->
11
-			<view class="form_item" v-if="cmdbRepair.valueconfig==1">
11
+			<view class="form_item" v-if="cmdbRepair && cmdbRepair.valueconfig==1">
12 12
 				<view class="title select">关联资产:</view>
13 13
 				<input class="item-input" disabled placeholder="请扫描资产卡二维码" v-model="dataInfo.property"/>
14 14
 				<text class="newicon newicon-saoma icon" @click="scanCodes"></text>
@@ -64,6 +64,7 @@
64 64
   import { useGoBack } from '@/share/useGoBack.js'
65 65
   import { useLoginUserStore } from '@/stores/loginUser'
66 66
   import { useHandlerStore } from '@/stores/handler'
67
+	import { rapidRepNextStore } from '@/stores/rapidRepNext'
67 68
 	import { post } from "@/http/http.js"
68 69
 	import wx from 'weixin-jsapi'
69 70
 	// import Recorder from 'recorder-core';
@@ -73,6 +74,7 @@
73 74
  //  import 'recorder-core/src/extensions/waveview';
74 75
 			
75 76
   useSetTitle();
77
+	const rapidNextStore = rapidRepNextStore();
76 78
   const loginUserStore = useLoginUserStore();
77 79
   const handlerStore = useHandlerStore();
78 80
   const { makePhoneCall }  = useMakePhoneCall();
@@ -158,6 +160,7 @@
158 160
   function goBackOrToList(){
159 161
 		let repairsType = uni.getStorageSync('repairsType')
160 162
 		uni.setStorageSync('repairData','')
163
+		rapidNextStore.setRapidRepNext({})
161 164
 		if(repairsType=='subpage'){
162 165
 			uni.navigateTo({
163 166
 			  url: `/pages/myRepair/myRepair?type=1`
@@ -293,16 +296,10 @@
293 296
 	
294 297
 	// 扫码资产码
295 298
 	function scanCodes(){
296
-		uni.showLoading({
297
-		  title: "加载中",
298
-		  mask: true,
299
-		});
300
-
301 299
 		SM().then((res) => {
302 300
 			api_repairScanCode({
303 301
 				code:res
304 302
 			}).then((res2) => {
305
-			  uni.hideLoading();
306 303
 			  if (res2.state == 200) {
307 304
 			    dataInfo.property = res2.data.name
308 305
 					dataInfo.assetId = res2.data.id
@@ -470,8 +467,11 @@
470 467
   }
471 468
 	
472 469
   onLoad((option) => {
473
-		let data = JSON.parse(uni.getStorageSync('sysData'))
474
-		cmdbRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
470
+		if(uni.getStorageSync('sysData')){
471
+			let data = JSON.parse(uni.getStorageSync('sysData'))
472
+			cmdbRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
473
+			console.log(6666666, cmdbRepair.value)
474
+		}
475 475
 		if(option){
476 476
 			if(option.property && option.assetId){
477 477
 				dataInfo.property = option.property

+ 45 - 37
pages/repair/rapidRepNext.vue

@@ -115,10 +115,11 @@
115 115
   import { useGoBack } from '@/share/useGoBack.js'
116 116
   import { useLoginUserStore } from '@/stores/loginUser'
117 117
   import { useHandlerStore } from '@/stores/handler'
118
-
118
+	import { rapidRepNextStore } from '@/stores/rapidRepNext'
119
+	
119 120
   useSetTitle();
120 121
   const loginUserStore = useLoginUserStore();
121
-  const handlerStore = useHandlerStore();
122
+	const rapidNextStore = rapidRepNextStore();
122 123
   const { makePhoneCall }  = useMakePhoneCall();
123 124
   const { uploadFile }  = useUploadFile();
124 125
   const { goBack }  = useGoBack();
@@ -199,7 +200,8 @@
199 200
 
200 201
   // 上一步或者返回列表
201 202
   function goBackOrToList(){
202
-		uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
203
+		rapidNextStore.setRapidRepNext(dataInfo);
204
+		// uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
203 205
 		uni.navigateTo({
204 206
 		  url: `/pages/repair/rapidRep`
205 207
 		})
@@ -253,8 +255,9 @@
253 255
 		api_user(postData).then(res => {
254 256
 		  if(res.status == 200){
255 257
 				let user = loginUserStore.loginUser.user
256
-				if(uni.getStorageSync('rapidRepNext')){
257
-					let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
258
+				let rapidRepNext = rapidNextStore.rapidRepNext.data;
259
+				if(rapidRepNext.branch && rapidRepNext.department){
260
+					let data = rapidRepNext
258 261
 					if(data){
259 262
 						dataInfo.departmentName = data.departmentName
260 263
 						dataInfo.department = data.department
@@ -299,8 +302,10 @@
299 302
   // 获取事件详情
300 303
   function getIncidentDetail(){
301 304
 		let user = loginUserStore.loginUser.user
302
-    if(uni.getStorageSync('rapidRepNext')){
303
-    	let data = JSON.parse(uni.getStorageSync('rapidRepNext'))
305
+		let rapidRepNext = rapidNextStore.rapidRepNext.data;
306
+    if(rapidRepNext.branch && rapidRepNext.department){
307
+			console.log(456, rapidRepNext.branch)
308
+    	let data = rapidRepNext
304 309
     	if(data){
305 310
     		dataInfo.department = data.department//报修科室
306 311
 				dataInfo.departmentName = data.departmentName//报修科室
@@ -312,6 +317,7 @@
312 317
 				// getRepairTypes()
313 318
     	}
314 319
     }else if(user){
320
+			console.log(8799, user)
315 321
 			if(user.currentHospital.parent){
316 322
 				dataInfo.branch = user.currentHospital.parent.id
317 323
 			}else{
@@ -332,32 +338,32 @@
332 338
 				dataInfo.assetId = data.assetId
333 339
 			}
334 340
 		}
335
-
336
-		let data = JSON.parse(uni.getStorageSync('sysData'))
337
-		isDept.value = data.find(i=>i.keyconfig=='deptRepair')
338
-		isRepair.value = data.find(i=>i.keyconfig=='publicRepair')
339
-		hospitalModel.value = data.find(i=>i.keyconfig=='hospitalModel')
340
-    console.log('isDept', isDept.value, isDept.value.valueconfig == 1)
341
-    console.log('isRepair', isRepair.value, isRepair.value.valueconfig == 1)
342
-		if((isDept.value.valueconfig==1 && isRepair.value.valueconfig==1) || (isDept.value.valueconfig==0 && isRepair.value.valueconfig==0) || (!isDept.value.valueconfig && !isRepair.value.valueconfig)){
343
-			dataInfo.tabs = [
344
-				{id: 5, name: '科内报修', value: 'doing', num: ''},
345
-				{id: 6, name: '公共报修', value: 'overtime', num: ''},
346
-			]
347
-			dataInfo.tabActiveValue = 'doing'
348
-		}else if(isDept.value.valueconfig==1){
349
-			dataInfo.tabs = [
350
-				{id: 5, name: '科内报修', value: 'doing', num: ''},
351
-			]
352
-			dataInfo.tabActiveValue = 'doing'
353
-		}else if(isRepair.value.valueconfig==1){
354
-			dataInfo.tabs = [
355
-				{id: 6, name: '公共报修', value: 'overtime', num: ''},
356
-			]
357
-			dataInfo.tabActiveValue = 'overtime'
358
-			getbuildingList()
341
+		if(uni.getStorageSync('sysData')){
342
+			let data = JSON.parse(uni.getStorageSync('sysData'))
343
+			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
344
+			isRepair.value = data.find(i=>i.keyconfig=='publicRepair')
345
+			hospitalModel.value = data.find(i=>i.keyconfig=='hospitalModel')
346
+			console.log('isDept', isDept.value, isDept.value.valueconfig == 1)
347
+			console.log('isRepair', isRepair.value, isRepair.value.valueconfig == 1)
348
+			if((isDept.value.valueconfig==1 && isRepair.value.valueconfig==1) || (isDept.value.valueconfig==0 && isRepair.value.valueconfig==0) || (!isDept.value.valueconfig && !isRepair.value.valueconfig)){
349
+				dataInfo.tabs = [
350
+					{id: 5, name: '科内报修', value: 'doing', num: ''},
351
+					{id: 6, name: '公共报修', value: 'overtime', num: ''},
352
+				]
353
+				dataInfo.tabActiveValue = 'doing'
354
+			}else if(isDept.value.valueconfig==1){
355
+				dataInfo.tabs = [
356
+					{id: 5, name: '科内报修', value: 'doing', num: ''},
357
+				]
358
+				dataInfo.tabActiveValue = 'doing'
359
+			}else if(isRepair.value.valueconfig==1){
360
+				dataInfo.tabs = [
361
+					{id: 6, name: '公共报修', value: 'overtime', num: ''},
362
+				]
363
+				dataInfo.tabActiveValue = 'overtime'
364
+				getbuildingList()
365
+			}
359 366
 		}
360
-		
361 367
 
362 368
 		let postData = {
363 369
 		  "key": 'repair_incident_type',
@@ -393,7 +399,8 @@
393 399
 
394 400
 	// 跳转到搜索报修科室
395 401
 	function selectDepartment(){
396
-		uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
402
+		// uni.setStorageSync('rapidRepNext',JSON.stringify(dataInfo))
403
+		rapidNextStore.setRapidRepNext(dataInfo);
397 404
 	  uni.navigateTo({
398 405
 	    url: `/pages/searchDept/searchDept?type=repair&branchId=${dataInfo.branch}`
399 406
 	  })
@@ -572,7 +579,8 @@
572 579
 								      mask: true,
573 580
 								    });
574 581
 										setTimeout(() => {
575
-											uni.setStorageSync('rapidRepNext','')
582
+											rapidNextStore.setRapidRepNext('');
583
+											// uni.setStorageSync('rapidRepNext','')
576 584
 											uni.setStorageSync('repairData','')
577 585
 											if(repairsType=='home'){
578 586
 												uni.reLaunch({
@@ -598,7 +606,8 @@
598 606
 								  mask: true,
599 607
 								});
600 608
 								setTimeout(() => {
601
-									uni.setStorageSync('rapidRepNext','')
609
+									rapidNextStore.setRapidRepNext('');
610
+									// uni.setStorageSync('rapidRepNext','')
602 611
 									uni.setStorageSync('repairData','')
603 612
 									if(repairsType=='home'){
604 613
 										uni.reLaunch({
@@ -690,14 +699,13 @@
690 699
       return;
691 700
     }
692 701
 
693
-    if(dataInfo.contactsInformation==''){
702
+    if(dataInfo.contactsInformation=='' || dataInfo.contactsInformation==undefined){
694 703
       uni.showToast({
695 704
       	icon: 'none',
696 705
         title: '请输入联系电话'
697 706
       });
698 707
       return;
699 708
     }
700
-    console.log(dataInfo.handlerImgList)
701 709
     uni.showLoading({
702 710
       title: "加载中",
703 711
       mask: true,

+ 10 - 6
pages/repair/repairsDetail.vue

@@ -48,7 +48,7 @@
48 48
             <text class="value" v-else>无</text>
49 49
             <uni-icons v-if="dataInfo.incidentData.callID" @click="attachmentClick" type="mic-filled" class="mic-filled" :size="22" :color="primaryColor"></uni-icons>
50 50
           </view> -->
51
-          <view class="deital_item" v-if="isDept.valueconfig==1">
51
+          <view class="deital_item" v-if="isDept && isDept.valueconfig==1">
52 52
             <text class="name">报修科室:</text>
53 53
             <text class="value">{{dataInfo.incidentData.department ? dataInfo.incidentData.department.dept : '无'}}</text>
54 54
           </view>
@@ -70,7 +70,7 @@
70 70
         <view class="detail_head">
71 71
           <text class="title">处理信息</text>
72 72
         </view>
73
-        <view class="detail_item_wrap">
73
+        <view class="detail_item_wrap" v-if="dataInfo.incidentData && dataInfo.isLoading">
74 74
           <view class="deital_item">
75 75
             <text class="name">处理人:</text>
76 76
             <text class="value" v-if="dataInfo.incidentData.state.value == 'pending' && dataInfo.incidentData.currentLog">{{dataInfo.incidentData.currentLog.workerName}}<text @click="makePhoneCall(dataInfo.incidentData.currentLog.workerPhone)" v-if="dataInfo.incidentData.currentLog.workerPhone">({{dataInfo.incidentData.currentLog.workerPhone}})<uni-icons type="phone-filled" class="phone-filled" :size="18" :color="primaryColor"></uni-icons></text></text>
@@ -177,7 +177,7 @@
177 177
         </view>
178 178
       </template>
179 179
     </scroll-view>
180
-    <view class="foot_common_btns">
180
+    <view class="foot_common_btns" v-if="dataInfo.incidentData && dataInfo.isLoading">
181 181
       <button @click="goBack" type="default" class="primaryButton btn">返回</button>
182 182
 			<button v-if="dataInfo.incidentData.state.value=='accept'" @click="recall" type="default" class="primaryButton btn">撤销</button>
183 183
 		</view>
@@ -260,7 +260,8 @@
260 260
     resolveLogs: [],//评价
261 261
     callbackLogs: [],//回访
262 262
     isAttachment: false,//录音开关
263
-		summaryData: null
263
+		summaryData: null,
264
+		isLoading: false
264 265
   })
265 266
 
266 267
   // 点击录音
@@ -383,6 +384,7 @@
383 384
     api_incidentDetail(dataInfo.incidentId).then(res => {
384 385
       uni.hideLoading();
385 386
       if(res.status == 200){
387
+				dataInfo.isLoading = true
386 388
         dataInfo.incidentData = res.data || {};
387 389
 				stateId.value = res.data.state.id
388 390
         let logs = dataInfo.incidentData.logs || [];
@@ -499,8 +501,10 @@
499 501
 	}
500 502
 
501 503
 	onShow((option) =>{
502
-		let data = JSON.parse(uni.getStorageSync('sysData'))
503
-		isDept.value = data.find(i=>i.keyconfig=='deptRepair')
504
+		if(uni.getStorageSync('sysData')){
505
+			let data = JSON.parse(uni.getStorageSync('sysData'))
506
+			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
507
+		}
504 508
 		// 获取是否开启汇总单、简易处理
505 509
 		let postData = {
506 510
 			idx: 0,

+ 27 - 20
pages/repair/repairsList.vue

@@ -169,27 +169,34 @@
169 169
 
170 170
   // 获取tab选项
171 171
   function getTabs(){
172
-    uni.showLoading({
173
-      title: "加载中",
174
-      mask: true,
175
-    });
176
-		let data = JSON.parse(uni.getStorageSync('sysData'))
177
-		deptRepair.value = data.find(i=>i.keyconfig=='deptRepair')
178
-		publicRepair.value = data.find(i=>i.keyconfig=='publicRepair')
179
-		let postData = {
180
-		  "key": 'repair_incident_type',
181
-		  "type": "list",
182
-		};
183
-		if(deptRepair.value.valueconfig==1){
184
-			api_getDictionary(postData).then(res => {
185
-			  res = res || [];
186
-			  repairIncident.value = res.find(i=>i.value=='dept')
172
+		if(uni.getStorageSync('sysData')){
173
+			uni.showLoading({
174
+			  title: "加载中",
175
+			  mask: true,
176
+			});
177
+			let data = JSON.parse(uni.getStorageSync('sysData'))
178
+			deptRepair.value = data.find(i=>i.keyconfig=='deptRepair')
179
+			publicRepair.value = data.find(i=>i.keyconfig=='publicRepair')
180
+			let postData = {
181
+			  "key": 'repair_incident_type',
182
+			  "type": "list",
183
+			};
184
+			if(deptRepair.value.valueconfig==1){
185
+				api_getDictionary(postData).then(res => {
186
+				  res = res || [];
187
+				  repairIncident.value = res.find(i=>i.value=='dept')
188
+					getList(0);
189
+				})
190
+				 dataInfo.tabs = [
191
+					 {id: 0, name: '我的报修', value: 'all', num: ''},
192
+					 {id: 1, name: '科内报修', value: '2', num: ''}
193
+				 ]
194
+			}else{
187 195
 				getList(0);
188
-			})
189
-			 dataInfo.tabs = [
190
-				 {id: 0, name: '我的报修', value: 'all', num: ''},
191
-				 {id: 1, name: '科内报修', value: '2', num: ''}
192
-			 ]
196
+				dataInfo.tabs = [
197
+					{id: 0, name: '我的报修', value: 'all', num: ''},
198
+				]
199
+			}
193 200
 		}else{
194 201
 			getList(0);
195 202
 			dataInfo.tabs = [

+ 188 - 0
pages/searchAsset/searchAsset.vue

@@ -0,0 +1,188 @@
1
+<template>
2
+  <view class="consumableList">
3
+    <view class="head">
4
+      <uni-search-bar v-model="dataInfo.keyWord" :placeholder="placeHolder" bgColor="#F8F8F8" @input="search" cancelButton="none" focus :radius="18" />
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" v-for="data in dataInfo.list" :key="data.id" @click="clickItem(data)">
8
+        {{data.name}}<template v-if="data.account">({{data.account}})</template>
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { debounce } from 'lodash-es'
22
+  import { ref, reactive} from 'vue'
23
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
24
+  import { api_get_asset, api_getDictionary } from "@/http/api.js"
25
+  import { defaultColor } from '@/static/js/theme.js'
26
+  import { useSetTitle } from '@/share/useSetTitle.js'
27
+  import { useLoginUserStore } from '@/stores/loginUser'
28
+  import { useIncidentBuildStore } from '@/stores/incidentBuild'
29
+  import { useGoBack } from '@/share/useGoBack.js'
30
+  
31
+  useSetTitle();
32
+  const loginUserStore = useLoginUserStore();
33
+  const incidentBuildStore = useIncidentBuildStore();
34
+  const { goBack }  = useGoBack();
35
+  
36
+  // 主题颜色
37
+  const primaryColor = ref(defaultColor)
38
+  
39
+	const userTypes = ref([])
40
+	
41
+  // placeHolder
42
+  const placeHolder = ref('');
43
+  
44
+  // 数据
45
+  const dataInfo = reactive({
46
+    list: [],//工单列表
47
+    idx: 0,//页码
48
+    hasMore: true,//是否有更多数据
49
+    incidentData: {},//事件对象
50
+    keyWord: '',//搜索的关键词
51
+  })
52
+  
53
+  // 搜索
54
+  const search = debounce(getList.bind(null, 0), 500);
55
+  
56
+  // 获取列表信息
57
+  function getList(idx){
58
+    if(dataInfo.keyWord.trim() === ''){
59
+      dataInfo.list = [];
60
+      uni.stopPullDownRefresh();
61
+      return;
62
+    }
63
+    
64
+    uni.showLoading({
65
+      title: "加载中",
66
+      mask: true,
67
+    });
68
+    
69
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
70
+    if(dataInfo.idx === 0){
71
+      dataInfo.list = [];
72
+    }
73
+
74
+    let postData = {
75
+      idx: dataInfo.idx,
76
+      sum: 20,
77
+      asset: {
78
+				downHosId:'',
79
+        name: dataInfo.keyWord,
80
+      }
81
+    }
82
+		if(dataInfo.incidentData && dataInfo.incidentData.branch){
83
+			postData.asset.downHosId = dataInfo.incidentData.branch
84
+		}else{
85
+			if(loginUserStore.loginUser.user.currentHospital.parent){
86
+				postData.asset.downHosId = loginUserStore.loginUser.user.currentHospital.parent.id
87
+			}else{
88
+				postData.asset.downHosId = loginUserStore.loginUser.user.currentHospital.id
89
+			}
90
+		}
91
+    api_get_asset(postData).then(res => {
92
+      uni.hideLoading();
93
+      uni.stopPullDownRefresh();
94
+      if(res.status == 200){
95
+        let list = res.list || [];
96
+        if(list.length){
97
+          dataInfo.hasMore = true;
98
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
99
+        }else{
100
+          dataInfo.hasMore = false;
101
+        }
102
+      }else{
103
+        uni.showToast({
104
+          icon: 'none',
105
+          title: res.msg || '请求数据失败!'
106
+        });
107
+      }
108
+    })
109
+  }
110
+  
111
+  // 点击
112
+  function clickItem(data){
113
+    dataInfo.incidentData.assetDTO = data;
114
+		dataInfo.incidentData.assetId = data.id;
115
+    incidentBuildStore.setIncidentBuildData(dataInfo.incidentData, incidentBuildStore.incidentBuild.type, incidentBuildStore.incidentBuild.sign);
116
+    uni.navigateTo({
117
+      url: '/pages/buildIncident/buildIncident'
118
+    })
119
+  }
120
+  
121
+	
122
+  onLoad((option) => {
123
+    if(incidentBuildStore.incidentBuild.data){
124
+      dataInfo.incidentData = incidentBuildStore.incidentBuild.data;
125
+    }
126
+    if(incidentBuildStore.incidentBuild.type === 'buildIncident' && incidentBuildStore.incidentBuild.sign === 'asset'){
127
+      placeHolder.value = '请搜索资产'
128
+    }
129
+		getList(0);
130
+  })
131
+  
132
+  onPullDownRefresh(() => {
133
+    getList(0)
134
+  })
135
+  
136
+  onReachBottom(() => {
137
+    dataInfo.idx += 1;
138
+    if (dataInfo.hasMore) {
139
+      getList(); // 当触底时加载更多数据
140
+    }
141
+  })
142
+</script>
143
+
144
+<style lang="scss" scoped>
145
+.consumableList{
146
+  display: flex;
147
+  flex-direction: column;
148
+  justify-content: space-between;
149
+  .head{
150
+    height: 88rpx;
151
+    display: flex;
152
+    align-items: center;
153
+    justify-content: center;
154
+    padding: 0 24rpx;
155
+    position: fixed;
156
+    z-index: 99;
157
+    width: 100%;
158
+    box-sizing: border-box;
159
+    background: linear-gradient( 90deg, #58CF66 0%, #DDE9FC 100%);
160
+  }
161
+  .body{
162
+    margin-bottom: 140rpx;
163
+    margin-top: 88rpx;
164
+    font-size: 26rpx;
165
+    .body_item{
166
+      border-bottom: 1rpx solid #DEDEDE;
167
+      padding: 24rpx;
168
+    }
169
+  }
170
+  .zanwu{
171
+    margin-bottom: 140rpx;
172
+    margin-top: 88rpx;
173
+    display: flex;
174
+    justify-content: center;
175
+    .newicon-zanwu{
176
+      font-size: 256rpx;
177
+      color: #D6D6D6;
178
+      margin-top: 140rpx;
179
+    }
180
+  }
181
+  .foot_common_btns{
182
+    position: fixed;
183
+    left: 0;
184
+    bottom: 0;
185
+    background-color: #fff;
186
+  }
187
+}
188
+</style>

+ 11 - 6
pages/searchDept/searchDept.vue

@@ -27,8 +27,10 @@
27 27
   import { useLoginUserStore } from '@/stores/loginUser'
28 28
   import { useIncidentBuildStore } from '@/stores/incidentBuild'
29 29
   import { useGoBack } from '@/share/useGoBack.js'
30
-  
30
+  import { rapidRepNextStore } from '@/stores/rapidRepNext'
31
+		
31 32
   useSetTitle();
33
+	const rapidNextStore = rapidRepNextStore();
32 34
   const loginUserStore = useLoginUserStore();
33 35
   const incidentBuildStore = useIncidentBuildStore();
34 36
   const { goBack }  = useGoBack();
@@ -150,20 +152,23 @@
150 152
 				departmentName:null,
151 153
 				branch:branchId.value
152 154
 			}
153
-			let rapidRepNextData = uni.getStorageSync('rapidRepNext')
154
-			if(rapidRepNextData){
155
-				let parseData = JSON.parse(rapidRepNextData)
155
+			let rapidRepNextData = rapidNextStore.rapidRepNext.data;
156
+			// let rapidRepNextData = uni.getStorage('rapidRepNext')
157
+			if(rapidRepNextData.branch && rapidRepNextData.department){
158
+				let parseData = rapidRepNextData
156 159
 				query.department = data.id//报修科室
157 160
 				query.departmentName = data.dept//报修科室
158 161
 				let repairData = {
159 162
 					...parseData,
160 163
 					...query
161 164
 				}
162
-				uni.setStorageSync('rapidRepNext',JSON.stringify(repairData))
165
+				rapidNextStore.setRapidRepNext(repairData);
166
+				// uni.setStorage('rapidRepNext',JSON.stringify(repairData))
163 167
 			}else{
164 168
 				query.department = data.id//报修科室
165 169
 				query.departmentName = data.dept//报修科室
166
-				uni.setStorageSync('rapidRepNext',JSON.stringify(query))
170
+				rapidNextStore.setRapidRepNext(query);
171
+				// uni.setStorage('rapidRepNext',JSON.stringify(query))
167 172
 			}
168 173
 			uni.navigateTo({
169 174
 			  url: '/pages/repair/rapidRepNext'

+ 24 - 0
stores/rapidRepNext.js

@@ -0,0 +1,24 @@
1
+import { defineStore } from "pinia"
2
+import { reactive } from 'vue'
3
+
4
+export const rapidRepNextStore = defineStore(
5
+  "RapidRepNext",
6
+  () => {
7
+    const rapidRepNext = reactive({
8
+      data: {}
9
+    });
10
+		
11
+		// 设置当前数据
12
+		function setRapidRepNext(data) {
13
+		  rapidRepNext.data = data;
14
+		}
15
+		
16
+    return {
17
+      rapidRepNext,
18
+      setRapidRepNext
19
+    };
20
+  },
21
+  {
22
+    unistorage: true, // 开启后对 state 的数据读写都将持久化
23
+  },
24
+);

+ 10 - 4
uni_modules/sy-audio/components/sy-audio/sy-audio.vue

@@ -20,6 +20,9 @@
20 20
 			</view>
21 21
 			<view v-else>相关功能正在开发中~</view>
22 22
 		</view>
23
+	<!-- 	<view v-if="timeTxt">
24
+			{{timeTxt}}
25
+		</view> -->
23 26
 	</view>
24 27
 </template>
25 28
 <script>
@@ -30,7 +33,7 @@
30 33
 		data() {
31 34
 			return {
32 35
 				audio_status: false,
33
-
36
+				isLoad: false,
34 37
 				timeTxt: '00 : 00',
35 38
 				timeIndex: 0,
36 39
 
@@ -144,9 +147,10 @@
144 147
 
145 148
 			this.innerAudioContext.onCanplay((event) => {
146 149
 				this.$emit('audioCanplay');
147
-				// #ifdef MP
148 150
 				this.maxSliderIndex = parseFloat(this.innerAudioContext.duration).toFixed(2);
149
-				// #endif
151
+				this.isLoad = true;
152
+				console.log(888,this.innerAudioContext.duration)
153
+				console.log(999,this.maxSliderIndex)
150 154
 			});
151 155
 
152 156
 			this.innerAudioContext.onPlay(() => {
@@ -160,6 +164,8 @@
160 164
 					state: false
161 165
 				});
162 166
 			});
167
+			
168
+			// console.log(456456, this.innerAudioContext)
163 169
 		},
164 170
 		methods: {
165 171
 			//销毁innerAudioContext()实例
@@ -167,6 +173,7 @@
167 173
 				if (this.innerAudioContext) {
168 174
 					this.innerAudioContext.destroy();
169 175
 					this.audio_status = false;
176
+					this.isLoad = false;
170 177
 				}
171 178
 			},
172 179
 			//跳转到指定位置
@@ -192,7 +199,6 @@
192 199
 				}, 100)
193 200
 			},
194 201
 			clickAudio() {
195
-				console.log(888,this.innerAudioContext)
196 202
 				if (this.audio_status && !this.innerAudioContext.paused) {
197 203
 					this.innerAudioContext.pause();
198 204
 					clearInterval(timer);