maotao hace 6 meses
padre
commit
9684365b1b

+ 2 - 0
App.vue

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

+ 11 - 24
interceptor/routeInterceptor.js

@@ -17,31 +17,18 @@ let repaireRouterList = [
17 17
         // 调用前拦截
18 18
         const url = e.url.split('?')[0];
19 19
         // 报修人不可以访问除了登录页,绑定工号页,报修入口页的其他页面
20
-        if (!repaireRouterList.includes(url) && !url.includes("repair") && loginUserStore.loginUser.user) {
21
-						if(loginUserStore.loginUser.user.engineer == 0){
22
-							if(loginType==1){
23
-								uni.reLaunch({
24
-								  url: "/pages/repairEntrance/repairEntrance"
25
-								})
26
-							}else if(loginType==2){
27
-								uni.reLaunch({
28
-								  url: "/pages/repair/home"
29
-								})
30
-							}
31
-							return false
32
-						}else{
33
-							if(loginType==1){
34
-								uni.reLaunch({
35
-								  url: "/pages/incidentList/incidentList"
36
-								})
37
-							}else if(loginType==2){
38
-								uni.reLaunch({
39
-								  url: "/pages/repair/home"
40
-								})
41
-							}
42
-							return false
20
+        if (!repaireRouterList.includes(url) && !url.includes("repair") && loginUserStore.loginUser.user && loginUserStore.loginUser.user
21
+          .engineer !== 1) {
22
+						if(loginType==1){
23
+							uni.reLaunch({
24
+								url: "/pages/repairEntrance/repairEntrance"
25
+							})
26
+						}else if(loginType==2){
27
+							uni.reLaunch({
28
+								url: "/pages/repair/home"
29
+							})
43 30
 						}
44
-						
31
+					return false
45 32
         }
46 33
         return true
47 34
       },

+ 6 - 1
main.js

@@ -8,7 +8,12 @@ console.info(`%c%c v3.5.0 %c 武汉大势恒通科技有限责任公司 `,
8 8
   'background: #35495e; padding: 4px; border-radius: 3px 0 0 3px; color: #fff',
9 9
   'background: #41b883; padding: 4px; border-radius: 0 3px 3px 0; color: #fff',
10 10
 );
11
-
11
+let query = window.location.search
12
+let data = null
13
+if(query.indexOf('?loginType=')!=-1){
14
+	data = query.split('?loginType=')
15
+	uni.setStorageSync('loginType',data[1])
16
+}
12 17
 export function createApp() {
13 18
   const app = createSSRApp(App)
14 19
   const store = Pinia.createPinia();

+ 25 - 0
pages.json

@@ -263,6 +263,24 @@
263 263
 	     },
264 264
 	     "enablePullDownRefresh": true
265 265
 	   }
266
+	 },
267
+	 {
268
+	   "path": "pages/newRepository/newRepository",
269
+	   "style": {
270
+	     "h5": {
271
+	       "titleNView": false
272
+	     },
273
+	     "enablePullDownRefresh": true
274
+	   }
275
+	 },
276
+	 {
277
+	   "path": "pages/myRepair/myRepair",
278
+	   "style": {
279
+	     "h5": {
280
+	       "titleNView": false
281
+	     },
282
+	     "enablePullDownRefresh": true
283
+	   }
266 284
 	 }
267 285
   ],
268 286
   "globalStyle": {
@@ -291,6 +309,13 @@
291 309
       "text": "巡检"
292 310
 			}, 
293 311
 			{
312
+			"pagePath": "pages/newRepository/newRepository",
313
+			"iconPath": "static/img/icon_zsk.png",
314
+			"selectedIconPath": "static/img/icon_zsk_active.png",
315
+			"text": "知识库",
316
+			"visible": false
317
+			},
318
+			{
294 319
 			"pagePath": "pages/repair/home",
295 320
 			"iconPath": "static/img/icon_inspectionExecute.png",
296 321
 			"selectedIconPath": "static/img/icon_inspectionExecute_active.png",

+ 6 - 2
pages/assign/assign.vue

@@ -858,7 +858,9 @@
858 858
     //   });
859 859
     //   return;
860 860
     // }
861
-    
861
+    if(HandleData.simpleness==1){
862
+    	dataInfo.closecode = '20401'
863
+    }
862 864
 		postData.incident.place = {}
863 865
 		postData.incident.place.id = floorId.value
864 866
     postData.incident.handleDescription = dataInfo.handleDescription;
@@ -990,7 +992,9 @@
990 992
       title: "加载中",
991 993
       mask: true,
992 994
     });
993
-    
995
+    if(HandleData.simpleness==1){
996
+    	dataInfo.closecode = '20401'
997
+    }
994 998
     if(dataInfo.handlerImgList.length){
995 999
       // 有处理图片
996 1000
       let handlerOrder$ = handlerOrder();

+ 3 - 1
pages/handler/handler.vue

@@ -803,7 +803,9 @@
803 803
       return;
804 804
     }
805 805
     console.log(dataInfo.handlerImgList)
806
-    
806
+    if(HandleData.simpleness==1){
807
+    	dataInfo.closecode = '20401'
808
+    }
807 809
     uni.showLoading({
808 810
       title: "加载中",
809 811
       mask: true,

+ 11 - 9
pages/homePage/homePage.vue

@@ -28,7 +28,6 @@
28 28
 		let codeStr = wenhaohoumian[1]; //地址数组赋值
29 29
 		let loginType = url[1].split("#/")
30 30
 		let str = loginType[0].split("=")
31
-		console.log(777878,str)
32 31
 		if(str[0]=='loginType'){
33 32
 			uni.setStorageSync('loginType',str[1])
34 33
 			if (!url[2]) {
@@ -45,8 +44,7 @@
45 44
 				}).then(res => {
46 45
 			    uni.hideLoading();
47 46
 			    if (res.status == 200) {
48
-			      loginSuccess(res.user);
49
-						getConfig();
47
+						getConfig(res.user);
50 48
 						changeGroup();
51 49
 			    } else if (res.status == 501) {
52 50
 			      uni.showModal({
@@ -69,7 +67,7 @@
69 67
 			  });
70 68
 			}
71 69
 		}else{
72
-			uni.setStorageSync('loginType','2')
70
+			// uni.setStorageSync('loginType','2')
73 71
 			if (!url[1]) {
74 72
 			  wechatAuth();
75 73
 			} else {
@@ -84,8 +82,7 @@
84 82
 				}).then(res => {
85 83
 			    uni.hideLoading();
86 84
 			    if (res.status == 200) {
87
-			      loginSuccess(res.user);
88
-						getConfig();
85
+						getConfig(res.user);
89 86
 						changeGroup();
90 87
 			    } else if (res.status == 501) {
91 88
 			      uni.showModal({
@@ -124,7 +121,7 @@
124 121
     };
125 122
     api_loginEncrypt(postData).then(res => {
126 123
       uni.hideLoading();
127
-			getConfig();
124
+			getConfig(res.data);
128 125
 			changeGroup();
129 126
       if (res.state == 200) {
130 127
         loginSuccess(res.data);
@@ -138,12 +135,15 @@
138 135
   }
139 136
 	
140 137
 	// 获取配置项
141
-	function getConfig(){
138
+	function getConfig(data){
142 139
 		api_systemConfiguration({
143 140
 			idx: 0,
144 141
 			sum: 9999,
145 142
 		}).then(res=>{
146 143
 			uni.setStorageSync('sysData',JSON.stringify(res.list))
144
+			setTimeout(_=>{
145
+				loginSuccess(data);
146
+			},500)
147 147
 		})
148 148
 	}
149 149
 	
@@ -159,7 +159,9 @@
159 159
 	}
160 160
 	
161 161
   onLoad((option) => {
162
-    uni.clearStorageSync();
162
+    uni.removeStorageSync('sysData');
163
+		uni.removeStorageSync('groupData');
164
+		uni.removeStorageSync('loginUser');
163 165
     // 获取当前页面的实例
164 166
     const pages = getCurrentPages();
165 167
     const currentPage = pages[pages.length - 1];

+ 1 - 1
pages/incidentList/incidentList.vue

@@ -390,7 +390,7 @@
390 390
   }
391 391
 
392 392
   onLoad((option) => {
393
-    for(let i = 0; i<5; i++){
393
+    for(let i = 0; i<6; i++){
394 394
     	setTabbar(i)
395 395
     }
396 396
     onLoadFn();

+ 1 - 1
pages/inspection/inspectionExecute/inspectionExecute.vue

@@ -273,7 +273,7 @@
273 273
   }
274 274
 
275 275
   onLoad((option) => {
276
-    for(let i = 0; i<5; i++){
276
+    for(let i = 0; i<6; i++){
277 277
     	setTabbar(i)
278 278
     }
279 279
     onLoadFn();

+ 9 - 5
pages/my/my.vue

@@ -46,7 +46,7 @@
46 46
       </view>
47 47
     </scroll-view>
48 48
     <view class="foot_common_btns">
49
-			<button @click="repository" type="default" class="primaryButton btn"><text class="newicon newicon-zhishiku"></text>知识库</button>
49
+			<button @click="myRepair" type="default" class="primaryButton btn"><text class="icon-style newicon newicon-ziyuan-baoxiu1"></text>我的报修</button>
50 50
       <button @click="toBuildIncident" type="default" class="primaryButton btn"><text class="newicon newicon-xinjian2"></text>新建事件</button>
51 51
     </view>
52 52
   </view>
@@ -131,10 +131,10 @@
131 131
   }
132 132
   
133 133
 	// 知识库
134
-	function repository(){
135
-		repositorySearchStore.clearRepositoryListSearchData()
134
+	function myRepair(){
135
+		// repositorySearchStore.clearRepositoryListSearchData()
136 136
 		uni.navigateTo({
137
-		  url: `/pages/repository/repository?type=view`
137
+		  url: `/pages/myRepair/myRepair`
138 138
 		})
139 139
 	}
140 140
 	
@@ -162,7 +162,7 @@
162 162
   }
163 163
   
164 164
   onLoad((option) => {
165
-    for(let i = 0; i<5; i++){
165
+    for(let i = 0; i<6; i++){
166 166
     	setTabbar(i)
167 167
     }
168 168
     onLoadFn();
@@ -250,5 +250,9 @@ page{
250 250
       }
251 251
     }
252 252
   }
253
+	.icon-style{
254
+		position: relative;
255
+		left: -6rpx;
256
+	}
253 257
 }
254 258
 </style>

+ 775 - 0
pages/myRepair/myRepair.vue

@@ -0,0 +1,775 @@
1
+<template>
2
+	<view class="home">
3
+		<view v-if="tabsIndex1==1">
4
+			<view class="home_item" v-if="isDept.valueconfig==1">
5
+				<view class="title">科室报修</view>
6
+				<view class="content">
7
+					<view @click="repairsView(1,'pending,handler,reassign')">
8
+						<view class="con-title">处理中</view>
9
+						<view class="con-value">{{repairData.deptHandlerCount}}</view>
10
+					</view>
11
+					<view @click="repairsView(1,'close0')">
12
+						<view class="con-title">待评价</view>
13
+						<view class="con-value">{{repairData.deptCloseCount}}</view>
14
+					</view>
15
+					<view>
16
+						<view class="con-title">本月维修费用(元)</view>
17
+						<view class="con-value-gr">{{repairData.deptCurrentMonthPrice || 0}}</view>
18
+					</view>
19
+				</view>
20
+			</view>
21
+			<view class="home_item">
22
+				<view class="title">我的报修</view>
23
+				<view class="content">
24
+					<view @click="repairsView(0,'pending,handler,reassign')">
25
+						<view class="con-title">处理中</view>
26
+						<view class="con-value">{{repairData.userHandlerCount}}</view>
27
+					</view>
28
+					<view @click="repairsView(0,'close0')">
29
+						<view class="con-title">待评价</view>
30
+						<view class="con-value">{{repairData.userCloseCount}}</view>
31
+					</view>
32
+				</view>
33
+			</view>
34
+	<!-- 		<view class="home_item">
35
+				<uni-notice-bar show-icon scrollable background-color="#ffffff" color="#000"
36
+				:text="noticeData" />
37
+			</view> -->
38
+			<view class="home_item home-disp">
39
+				<view class="bottom-left" @click="addRepairs">
40
+					<view class="bottom-left-box">
41
+						<text class="newicon newicon-kuaisubaoxiu icon"></text>
42
+						<view>快速报修</view>
43
+					</view>
44
+				</view>
45
+				<view class="bottom-right mar-t-20">
46
+					<view class="bottom-right-item" v-if="isRepair.valueconfig==1" @click="scanCodes">
47
+						<text class="newicon newicon-saoma icon"></text>
48
+						<view class="name1">扫资产报修</view>
49
+					</view>
50
+					<view class="bottom-right-item" @click="repository">
51
+						<text class="newicon newicon-zhishiku1 icon"></text>
52
+						<view class="name2">知识库</view>
53
+					</view>
54
+				</view>
55
+			</view>
56
+		</view>
57
+		<view v-if="tabsIndex2==1" class="mine">
58
+			<view class="body">
59
+			  <view class="bottom">
60
+			    <view class="bottom_name">个人信息</view>
61
+			    <view class="bottom_list">
62
+			      <view class="bottom_list_item">
63
+			        <view class="name"><text class="required newicon newicon-bitian"></text>工号</view>
64
+			        <view class="value no-mar">{{loginUserStore.loginUser.user.account}}</view>
65
+			      </view>
66
+						<view class="bottom_list_item">
67
+						  <view class="name"><text class="required newicon newicon-bitian"></text>姓名</view>
68
+						  <view class="value no-mar">{{loginUserStore.loginUser.user.name}}</view>
69
+						</view>
70
+						<view class="bottom_list_item">
71
+						  <view class="name"><text class="required newicon newicon-bitian"></text>院区名称</view>
72
+							<uni-data-picker class="value" placeholder="请选择院区名称"
73
+								v-model="dataForm.branch" :localdata="branchData" @change="branchChange"
74
+								:clear-icon="false" :class="{formRed: isSubmit && !dataForm.branch}">
75
+							</uni-data-picker>
76
+							<text class="newicon newicon-youjiantou icon"></text>
77
+						</view>
78
+						<view class="bottom_list_item" v-if="deptRepair.valueconfig==1">
79
+						  <view class="name"><text class="required newicon newicon-bitian"></text>科室名称</view>
80
+							<uni-data-picker class="value" placeholder="请选择报修科室"
81
+								v-model="dataForm.dept" :localdata="deptData" 
82
+								:clear-icon="false" :class="{formRed: isSubmit && !dataForm.dept}">
83
+							</uni-data-picker>
84
+							<text class="newicon newicon-youjiantou icon"></text>
85
+						</view>
86
+						<view class="bottom_list_item" v-if="deptRepair.valueconfig==1" @click="deptSelect">
87
+						  <view class="name">常用科室</view>
88
+						  <view class="value">{{commonDeptName}}</view>
89
+							<text class="newicon newicon-youjiantou icon"></text>
90
+						</view>
91
+			      <view class="bottom_list_item">
92
+			        <view class="name"><text class="required newicon newicon-bitian"></text>联系电话</view>
93
+			        <view class="value no-mar" @click="makePhoneCall(loginUserStore.loginUser.user.phone)">{{loginUserStore.loginUser.user.phone}}</view>
94
+			      </view>
95
+			    </view>
96
+			  </view>
97
+			</view>
98
+			<view class="foot_common_btns fixed-btn">
99
+				<button @click="addInfo" type="default" class="primaryButton btn">保存</button>
100
+			</view>
101
+		</view>
102
+		<view class="bottom-tabs">
103
+			<view class="tabs-list" @click="tabsClick1">
104
+				<img src="/static/img/icon_incidentList.png" v-if="tabsIndex1==0" alt="">
105
+				<img src="/static/img/icon_incidentList_active.png" v-if="tabsIndex1==1" alt="">
106
+				<view class="tabs-title" :class="tabsIndex1==1?'active-class':''">我的报修</view>
107
+			</view>
108
+			<view class="tabs-list" @click="tabsClick2">
109
+				<img src="/static/img/icon_my.png" v-if="tabsIndex2==0" alt="">
110
+				<img src="/static/img/icon_my_active.png" v-if="tabsIndex2==1" alt="">
111
+				<view class="tabs-title" :class="tabsIndex2==1?'active-class':''">设置</view>
112
+			</view>
113
+		</view>
114
+	</view>
115
+</template>
116
+
117
+<script setup>
118
+	import { SM } from "@/http/http.js"
119
+	import { ref, reactive } from 'vue'
120
+	import { onLoad ,onShow, onHide, onPullDownRefresh} from '@dcloudio/uni-app'
121
+	import { api_systemConfiguration, api_userSave, api_user, api_department, api_repairScanCode, api_getNotice, api_getCount } from "@/http/api.js"
122
+	import { useSetTitle } from '@/share/useSetTitle.js'
123
+	import { repositoryListSearchStore } from '@/stores/repositorySearch'
124
+	import { useLoginUserStore } from '@/stores/loginUser'
125
+	import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
126
+	import { useIncidentNumStore } from '@/stores/incidentNum'
127
+	useSetTitle();
128
+	
129
+	// 数据
130
+	const isDept = ref({})
131
+	const isRepair = ref({})
132
+	const isPublic = ref({})
133
+	const noticeData = ref('')
134
+	const repairData = ref({})
135
+	const tabsIndex1 = ref(1)
136
+	const tabsIndex2 = ref(0)
137
+	const repositorySearchStore = repositoryListSearchStore();
138
+	
139
+	
140
+	const loginUserStore = useLoginUserStore();
141
+	const incidentNumStore = useIncidentNumStore();
142
+	const { makePhoneCall }  = useMakePhoneCall();
143
+
144
+	const deptRepair = ref(null)
145
+	
146
+	const deptData = ref([])
147
+	
148
+	const branchData = ref([])
149
+	
150
+	const commonDeptName = ref(null)
151
+	
152
+	const commonDeptData = ref(null)
153
+	
154
+	const dataForm = reactive({
155
+	  dept: '',
156
+		branch:''
157
+	})
158
+	
159
+	const userTypes = ref(null)
160
+	
161
+	const userData = reactive(loginUserStore.loginUser.user)
162
+	
163
+	const commonDeptDTO = ref([])
164
+	
165
+	// 是否提交
166
+	const isSubmit = ref(false)
167
+	
168
+	// 数据
169
+	const dataInfo = reactive({
170
+	  num: 0,
171
+	})
172
+	
173
+	function tabsClick1(){
174
+		tabsIndex1.value=1
175
+		tabsIndex2.value=0
176
+		getCount()
177
+		setTimeout(_=>{
178
+			let data = JSON.parse(uni.getStorageSync('sysData'))
179
+			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
180
+			isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
181
+			isPublic.value = data.find(i=>i.keyconfig=='publicRepair')
182
+		},0)
183
+	}
184
+	
185
+	function tabsClick2(){
186
+		tabsIndex2.value=1
187
+		tabsIndex1.value=0
188
+		getUserInfo()
189
+	}
190
+	
191
+	// 知识库
192
+	function repository(){
193
+		repositorySearchStore.clearRepositoryListSearchData()
194
+		uni.navigateTo({
195
+		  url: `/pages/repository/repository?type=view&entranceType=repairs`
196
+		})
197
+	}
198
+	
199
+	// 报修列表
200
+	function repairsView(type,value){
201
+	  uni.navigateTo({
202
+	    url: `/pages/repair/repairsList?type=${type}&value=${value}`
203
+	  })
204
+	}
205
+	
206
+	// 获取报修数量
207
+	function getCount(){
208
+		uni.showLoading({
209
+		  title: "加载中",
210
+		  mask: true,
211
+		});
212
+		api_getCount({}).then(res=>{
213
+			uni.hideLoading();
214
+			repairData.value = res.data
215
+		})
216
+	}
217
+	
218
+	// 快速报修
219
+	function addRepairs(){
220
+		if(isDept.value.valueconfig==0 && isPublic.value.valueconfig==0){
221
+			uni.showToast({
222
+				icon: 'none',
223
+			  title: '请先开启科室报修或公共报修'
224
+			});
225
+			return
226
+		}
227
+		uni.setStorageSync('repairsType','subpage')
228
+		uni.navigateTo({
229
+		  url: '/pages/repair/rapidRep'
230
+		})
231
+	}
232
+	
233
+	// 扫资产报修
234
+	function scanCodes(){
235
+		uni.showLoading({
236
+		  title: "加载中",
237
+		  mask: true,
238
+		});
239
+		SM().then((res) => {
240
+			api_repairScanCode({
241
+				code:res
242
+			}).then((res2) => {
243
+			  uni.hideLoading();
244
+			  if (res2.state == 200) {
245
+					uni.navigateTo({
246
+					  url: `/pages/repair/rapidRep?property=${res2.data.name}&assetId=${res2.data.id}`
247
+					})
248
+			  } else {
249
+			    uni.showToast({
250
+			      icon: 'none',
251
+			      title: res2.msg || '请求数据失败!'
252
+			    });
253
+			  }
254
+			});
255
+		})
256
+	}
257
+	
258
+	// 获取文本内容
259
+	function getHtml(data) {
260
+	  const tempDiv = document.createElement('div');
261
+	  tempDiv.innerHTML = data.content;
262
+		noticeData.value = tempDiv.textContent || tempDiv.innerText || '';
263
+	}
264
+	
265
+	
266
+	// 保存
267
+	function addInfo(){
268
+		if(!dataForm.branch){
269
+			uni.showToast({
270
+			  icon: 'none',
271
+			  title: '院区不能为空'
272
+			});
273
+			return
274
+		}
275
+		
276
+		if(!dataForm.dept){
277
+			uni.showToast({
278
+			  icon: 'none',
279
+			  title: '报修科室不能为空'
280
+			});
281
+			return
282
+		}
283
+		
284
+		uni.showLoading({
285
+		  title: "加载中",
286
+		  mask: true,
287
+		});
288
+	  isSubmit.value = true
289
+		userData.currentHospital.id = dataForm.branch
290
+		userData.commonDeptName = commonDeptName.value
291
+		userData.dept={
292
+			id:dataForm.dept
293
+		}
294
+		let arr = []
295
+		for(let i of commonDeptDTO.value){
296
+			arr.push({
297
+				dept:i
298
+			})
299
+		}
300
+		let postData = {
301
+			...loginUserStore.loginUser.user,
302
+			// ...userData,
303
+			hospital:{
304
+				id:dataForm.branch
305
+			},
306
+			dept:{
307
+				id:dataForm.dept
308
+			},
309
+			commonDept:commonDeptData.value,
310
+			commonDeptDTO:arr
311
+		}
312
+		api_userSave({
313
+		  user: postData,
314
+		}).then(res => {
315
+		  uni.hideLoading();
316
+			if(res.status == 200){
317
+				loginUserStore.setLoginUser(postData);
318
+				uni.showToast({
319
+				  icon: 'none',
320
+				  title: '保存成功'
321
+				});
322
+			}else{
323
+				uni.showToast({
324
+				  icon: 'none',
325
+				  title: res.msg || '请求数据失败!'
326
+				});
327
+			}
328
+		})
329
+	}
330
+	
331
+	// 选择院区
332
+	function branchChange(){
333
+		dataForm.dept = null
334
+		commonDeptName.value = null
335
+		commonDeptData.value = null
336
+		getRepairTypes()
337
+	}
338
+	
339
+	// 获取科室列表
340
+	function getRepairTypes(){
341
+	  uni.showLoading({
342
+	    title: "加载中",
343
+	    mask: true,
344
+	  });
345
+	  let postData = {
346
+			department: {
347
+			  hospital: dataForm.branch?dataForm.branch:loginUserStore.loginUser.user.currentHospital.id,
348
+			},
349
+			idx:0,
350
+			sum:9999
351
+		}
352
+	  api_department(postData).then(res => {
353
+	    uni.hideLoading();
354
+	    res = res.list || [];
355
+	    deptData.value = res.map(v => ({
356
+	      text: v.dept,
357
+	      value: v.id,
358
+	    }));
359
+	  })
360
+	}
361
+	
362
+	// 获取院区列表
363
+	function getBranch(){
364
+		let arr = loginUserStore.loginUser.hospital.filter(i=>i.parent==undefined)
365
+		branchData.value = arr.map(v => ({
366
+		  text: v.hosName,
367
+		  value: v.id,
368
+		}));
369
+	}
370
+	
371
+	// 选择常用科室
372
+	function deptSelect(){
373
+		uni.setStorageSync('configData',JSON.stringify(dataForm))
374
+		let data = commonDeptData.value ? 
375
+		commonDeptData.value : loginUserStore.loginUser.user.commonDept
376
+		if(!data){
377
+			data = 'none'
378
+		}
379
+		let deptId = dataForm.branch?dataForm.branch:loginUserStore.loginUser.user.currentHospital.id
380
+		uni.navigateTo({
381
+		  url: `/pages/repair/deptSelect?data=${JSON.stringify(data)}&commonDeptName=${commonDeptName.value}&deptId=${deptId}&type=subpage`
382
+		})
383
+	}
384
+	
385
+	// 初始化
386
+	function onLoadFn(){
387
+		let data = JSON.parse(uni.getStorageSync('sysData'))
388
+		deptRepair.value = data.find(i=>i.keyconfig=='deptRepair')
389
+		getBranch()
390
+	}
391
+	
392
+	function getUserInfo(){
393
+		let user = loginUserStore.loginUser.user
394
+		let userId = null
395
+		if(user.currentHospital.parent){
396
+			userId = user.currentHospital.parent.id
397
+		}else{
398
+			userId = user.currentHospital.id
399
+		}
400
+		let postData = {
401
+		  idx: 0,
402
+		  sum: 999,
403
+		  user: {
404
+				hospital:{
405
+					id:userId
406
+				},
407
+		    name: user.name,
408
+				userTypeIds: String(userTypes.value.map(v => v.id))
409
+		  }
410
+		}
411
+		api_user(postData).then(res => {
412
+		  if(res.status == 200){
413
+		    let item = res.list.find(i=>i.id==user.id)
414
+		    if(item){
415
+					if(item.hospital.parent){
416
+						dataForm.branch = item.hospital.parent.id
417
+					}else{
418
+						dataForm.branch = item.hospital.id
419
+					}
420
+					if(item.dept){
421
+						dataForm.dept = item.dept.id
422
+					}
423
+					getRepairTypes()
424
+					let id = []
425
+					let name = []
426
+					if(item.commonDeptDTO){
427
+						for(let i of item.commonDeptDTO){
428
+							id.push(i.id)
429
+							name.push(i.dept)
430
+						}
431
+						commonDeptData.value = id.join(',')
432
+						commonDeptName.value = name.join('/')
433
+					}
434
+		    }else{
435
+					// let data = uni.getStorageSync('configData')
436
+					// if(data){
437
+					// 	data = JSON.parse(data)
438
+					// 	dataForm.dept = data.dept
439
+					// 	dataForm.branch = data.branch
440
+					// }else{
441
+						if(user.currentHospital.parent){
442
+							dataForm.branch = user.currentHospital.parent.id
443
+						}else{
444
+							dataForm.branch = user.currentHospital.id
445
+						}
446
+						if(user.dept){
447
+							dataForm.dept = user.dept.id
448
+						}
449
+					// }
450
+					if(user.commonDeptDTO){
451
+						let name = []
452
+						for(let i of user.commonDeptDTO){
453
+							name.push(i.dept)
454
+						}
455
+						commonDeptData.value = user.commonDept
456
+						commonDeptName.value = name.join('/')
457
+					}
458
+					getRepairTypes()
459
+				}
460
+		  }else{
461
+		    uni.showToast({
462
+		      icon: 'none',
463
+		      title: res.msg || '请求数据失败!'
464
+		    });
465
+		  }
466
+		})
467
+	}
468
+	
469
+	onHide(opt=>{
470
+		dataInfo.num = 0
471
+		dataForm.branch = null
472
+	})
473
+	
474
+	onLoad((option) => {
475
+		userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
476
+		onLoadFn();
477
+		dataInfo.num = 1
478
+		if(option.type==2){
479
+			if(option.data){
480
+			  tabsIndex1.value = 0
481
+			  tabsIndex2.value = 1
482
+				let data = JSON.parse(option.data)
483
+				commonDeptData.value = data.data.join(',')
484
+				commonDeptName.value = data.name.join('/')
485
+				commonDeptDTO.value = data.name
486
+				let data2 = uni.getStorageSync('configData')
487
+				if(data2){
488
+					data2 = JSON.parse(data2)
489
+					dataForm.dept = data2.dept
490
+					dataForm.branch = data2.branch
491
+				}
492
+				getRepairTypes()
493
+			}else{
494
+				getUserInfo()
495
+			}
496
+		}else{
497
+			tabsIndex1.value = 1
498
+			tabsIndex2.value = 0
499
+			getCount()
500
+			setTimeout(_=>{
501
+				let data = JSON.parse(uni.getStorageSync('sysData'))
502
+				isDept.value = data.find(i=>i.keyconfig=='deptRepair')
503
+				isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
504
+				isPublic.value = data.find(i=>i.keyconfig=='publicRepair')
505
+			},0)
506
+		}
507
+		
508
+	})
509
+	
510
+	onPullDownRefresh(_=>{
511
+		uni.stopPullDownRefresh();
512
+	})
513
+	
514
+	onShow((option) => {
515
+		userTypes.value = JSON.parse(uni.getStorageSync('groupData'))
516
+		onLoadFn()
517
+		if(dataInfo.num==0){
518
+			getUserInfo()
519
+		}
520
+	})
521
+	
522
+
523
+</script>
524
+
525
+<style scoped>
526
+	>>> .uni-data-tree-input{
527
+		width: 100% !important;
528
+	}
529
+	>>> .input-value-border{
530
+		border: none !important;
531
+	}
532
+	>>> .input-value{
533
+		padding:0 !important;
534
+		flex-direction: row-reverse !important;
535
+	}
536
+	>>> .selected-list{
537
+		flex-direction: row-reverse !important;
538
+	}
539
+	>>> .arrow-area{
540
+		display: none !important;
541
+	}
542
+	>>>.uni-data-tree-dialog{
543
+		z-index: 9999;
544
+	}
545
+</style>
546
+<style lang="scss" scoped>
547
+	.home{
548
+		// height: 100vh;
549
+		padding: 20rpx;
550
+		background: #fff;
551
+		.home_item{
552
+			padding: 20rpx;
553
+			box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
554
+			border-radius: 10rpx;
555
+			margin-bottom: 30rpx;
556
+			.title{
557
+			  font-size: 26rpx;
558
+			  color: $uni-primary;
559
+			  padding-left: 18rpx;
560
+			  position: relative;
561
+				margin-bottom: 20rpx;
562
+			  &:before{
563
+			    content: '';
564
+			    width: 8rpx;
565
+			    height: 25rpx;
566
+			    background-color: $uni-primary;
567
+			    position: absolute;
568
+			    left: 0;
569
+			    top: 50%;
570
+			    transform: translateY(-50%);
571
+			  }
572
+			}
573
+			.content{
574
+				display: flex;
575
+				align-items: center;
576
+				justify-content: space-around;
577
+				text-align: center;
578
+				.con-title{
579
+					color: #949494;
580
+					font-size: 24rpx;
581
+					margin-bottom: 15rpx;
582
+				}
583
+				.con-value{
584
+					color: #000;
585
+					font-size: 50rpx;
586
+				}
587
+				.con-value-gr{
588
+					color: #49B856;
589
+					font-size: 50rpx;
590
+				}
591
+			}
592
+			.uni-noticebar{
593
+				margin: 0 !important;
594
+				padding: 0 !important;
595
+			}
596
+		}
597
+		.home-disp{
598
+			display: flex;
599
+			justify-content: space-around;
600
+			.bottom-left{
601
+				height: 380rpx;
602
+				background: linear-gradient( 269deg, #54B99C 0%, #7AC481 100%);
603
+				border-radius: 10rpx;
604
+				flex: 1.5;
605
+				margin-right: 20rpx;
606
+				display: flex;
607
+				align-items: center;
608
+				justify-content: center;
609
+				color: #FFFFFF;
610
+				margin-top: 20rpx;
611
+				.bottom-left-box{
612
+					text-align: center;
613
+					.icon{
614
+						font-size: 100rpx;
615
+						position: relative;
616
+						top: -20rpx;
617
+					}
618
+				}
619
+			}
620
+			.mar-t-20{
621
+				margin-top: 20rpx;
622
+			}
623
+			.bottom-right{
624
+				flex: 2;
625
+				.bottom-right-item{
626
+					height: 175rpx;
627
+					background: #FFFFFF;
628
+					border-radius: 10rpx;
629
+					border: 2rpx solid #6FC073;
630
+					margin-bottom: 20rpx;
631
+					display: flex;
632
+					align-items: center;
633
+					justify-content: center;
634
+					position: relative;
635
+					.icon{
636
+						font-size: 50rpx;
637
+						color: #6FC073;
638
+						position: absolute;
639
+						left: 60rpx;
640
+					}
641
+					.name1{
642
+						font-size: 32rpx;
643
+						position: absolute;
644
+						right: 50rpx;
645
+					}
646
+					.name2{
647
+						font-size: 32rpx;
648
+						position: absolute;
649
+						right: 80rpx;
650
+					}
651
+				}
652
+			}
653
+		}
654
+		.bottom-tabs{
655
+			border-top:1px solid rgba(0, 0, 0, 0.33);
656
+			background: #fff;
657
+			position: fixed;
658
+			width: 100%;
659
+			left: var(--window-left);
660
+			right: var(--window-right);
661
+			display: flex;
662
+			bottom: 0;
663
+			.tabs-list{
664
+				height: 90rpx;
665
+				display: flex;
666
+				justify-content: center;
667
+				align-items: center;
668
+				flex-direction: column;
669
+				flex: 1;
670
+				font-size: 0;
671
+				text-align: center;
672
+				-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
673
+				img{
674
+					width: 48rpx;
675
+					height: 48rpx;
676
+				}
677
+				.tabs-title{
678
+					color: rgb(136, 136, 136);
679
+					font-size: 20rpx;
680
+					line-height: normal;
681
+				}
682
+				.active-class{
683
+					color: #49B856;
684
+				}
685
+			}
686
+		}
687
+	}
688
+	.mine{
689
+	  height: 100%;
690
+	  display: flex;
691
+	  flex-direction: column;
692
+	  justify-content: space-between;
693
+	  .phone-filled{
694
+	    margin-right: 5rpx;
695
+	  }
696
+	  .newicon-xinjian2,
697
+		.newicon-zhishiku{
698
+	    margin-right: 10rpx;
699
+	  }
700
+	  .body{
701
+	    width: 714rpx;
702
+	    height: 100%;
703
+	    margin: 16rpx auto var(--window-bottom) auto;
704
+	    box-sizing: border-box;
705
+	    border-radius: 8rpx;
706
+	    .top{
707
+	      padding: 30rpx;
708
+	      background-color: #fff;
709
+	      .top_name{
710
+	        font-size: 28rpx;
711
+	        font-weight: bold;
712
+	      }
713
+	      .top_count{
714
+	        margin-top: 45rpx;
715
+	        display: flex;
716
+	        align-items: center;
717
+	        justify-content: space-between;
718
+	        .top_count_item{
719
+	          text-align: center;
720
+	          .name{
721
+	            color: #949494;
722
+	            font-size: 22rpx;
723
+	          }
724
+	          .value{
725
+	            font-size: 50rpx;
726
+	            font-weight: bold;
727
+	            margin-top: 15rpx;
728
+	          }
729
+	        }
730
+	      }
731
+	    }
732
+	    
733
+	    .bottom{
734
+	      background-color: #fff;
735
+	      margin-top: 15rpx;
736
+	      .bottom_name{
737
+	        font-size: 26rpx;
738
+	        color: $uni-primary;
739
+	        padding: 21rpx 24rpx;
740
+	      }
741
+	      .bottom_list{
742
+	        .bottom_list_item{
743
+	          border-top: 1rpx solid #DEDEDE;
744
+	          padding: 30rpx 30rpx 30rpx 30rpx;
745
+	          display: flex;
746
+	          justify-content: space-between;
747
+	          align-items: center;
748
+	          font-size: 24rpx;
749
+						position: relative;
750
+	          .value{
751
+	            max-width: 380rpx;
752
+	            color: #333;
753
+	            display: flex;
754
+	            align-items: center;
755
+	            text-align: justify;
756
+							margin-right: 30rpx;
757
+	          }
758
+						.no-mar{
759
+							margin-right:0 !important;
760
+						}
761
+						.icon{
762
+							position: absolute;
763
+							right: 20rpx;
764
+						}
765
+	        }
766
+	      }
767
+	    }
768
+	  }
769
+		.fixed-btn{
770
+			position: fixed;
771
+			bottom: 100rpx;
772
+			left: 0;
773
+		}
774
+	}
775
+</style>

+ 345 - 0
pages/newRepository/newRepository.vue

@@ -0,0 +1,345 @@
1
+<template>
2
+  <view class="categoryOne">
3
+		<view class="filter" @click="filterClick" v-if="entrance == 'view'">
4
+		  <text class="newicon newicon-shaixuan"></text>
5
+		</view>
6
+    <view class="body" v-if="dataInfo.list.length" :class="entrance == 'view' ? 'mar-t40' : ''">
7
+      <view class="body_item" v-for="data in dataInfo.list" :key="data.id">
8
+				<view @click="toCategoryTwo(data)">
9
+					<view class="title">{{data.title}}</view>
10
+					<view class="content">
11
+						<view v-html="data.content"></view>
12
+					</view>
13
+					<view class="sign">
14
+						<view>引入次数:{{data.introduceCount || 0}}</view>
15
+						<view>{{formatDate(data.createTime, 'yyyy-MM-dd HH:mm:ss')}}</view>
16
+					</view>
17
+				</view>
18
+<!-- 				<view class="btn-style">
19
+					<button v-if="entrance!='view'" @click.stop="importData(data)" type="default" class="primaryButton btn">引入</button>
20
+				</view> -->
21
+      </view>
22
+<!-- 			<view class="back-style" @click="goBack">
23
+				<text class="newicon newicon-fanhui1"></text>
24
+			</view> -->
25
+    </view>
26
+    <view class="zanwu" v-else>
27
+      <text class="newicon newicon-zanwu"></text>
28
+    </view>
29
+<!-- 		<view class="back-style" @click="goBack" v-if="entrance == 'view'">
30
+			<text class="newicon newicon-fanhui1"></text>
31
+		</view> -->
32
+<!-- 		<view v-if="dataInfo.list.length==0 && entrance!='view'" class="foot_common_btns">
33
+			<button @click="goBack" type="default" class="primaryButton btn">返回</button>
34
+		</view> -->
35
+		<repositoryFilter v-if="isFilter" @cancelEmit="cancelFilter" 
36
+		@confirmEmit="conformFilter" :viewType="entranceType"></repositoryFilter>
37
+  </view>
38
+</template>
39
+
40
+<script setup>
41
+  import { ref, reactive} from 'vue'
42
+  import { onLoad, onShow, onHide, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
43
+  import { api_getSolution,api_getDictionary } from "@/http/api.js"
44
+  import { useSetTitle } from '@/share/useSetTitle.js'
45
+  import { useGoBack } from '@/share/useGoBack.js'
46
+  import { useHandlerStore } from '@/stores/handler'
47
+	import repositoryFilter from '@/components/repositoryFilter.vue';
48
+	import { useLoginUserStore } from '@/stores/loginUser'
49
+	import { filterFormatDate } from '@/filters/filterFormatDate.js'
50
+	import { useSetTabbar } from '@/share/useSetTabbar.js'
51
+	import { repositoryListSearchStore } from '@/stores/repositorySearch'
52
+	
53
+  useSetTitle();
54
+	const repositorySearchStore = repositoryListSearchStore();
55
+	const { formatDate }  = filterFormatDate();
56
+	const loginUserStore = useLoginUserStore();
57
+	const handlerStore = useHandlerStore();
58
+	const { setTabbar }  = useSetTabbar();
59
+  const { goBack }  = useGoBack();
60
+  
61
+	// 操作类型
62
+	// const operateType = ref(null)
63
+	
64
+	// 关联故障分类的知识库数量
65
+	const introduceCount = ref(0)
66
+	
67
+	// 入口类型
68
+	const entrance = ref('view')
69
+	
70
+	const entranceType = ref(null)
71
+	
72
+	// 筛选数据
73
+	const evtFilter = ref({})
74
+	
75
+	// 筛选状态
76
+	const isFilter = ref(null)
77
+	
78
+	// 字典
79
+	const dicData = ref(null)
80
+	
81
+  // 数据
82
+  const dataInfo = reactive({
83
+    list: [],//工单列表
84
+    idx: 0,//页码
85
+    hasMore: true,//是否有更多数据
86
+    incidentId: undefined,//事件ID
87
+  })
88
+  
89
+  // 跳转知识库详情
90
+  function toCategoryTwo(data){
91
+    uni.navigateTo({
92
+      url: `/pages/repositoryDetails/repositoryDetails?incidentId=${dataInfo.incidentId}
93
+			&solutionnumber=${data.solutionNumber}&editType=${entrance.value}&entranceType=${entranceType.value}`
94
+    })
95
+  }
96
+	
97
+  // 引入
98
+	function importData(data){
99
+		let url = null
100
+		let type = handlerStore.handler.data.operateType
101
+		let storeInfo = handlerStore.handler.data
102
+		storeInfo.introduceCount = introduceCount.value
103
+		storeInfo.handleDescription = '引用知识库解决,知识库编号' + data.solutionNumber
104
+		storeInfo.solutionId = data.id
105
+		storeInfo.type = 'rep'
106
+		storeInfo.isSummaryNext = 1
107
+		handlerStore.setHandlerData(storeInfo,'assign', 'assign')
108
+		if(type=='malfunction'){ //故障处理
109
+			url = '/pages/handler/handler'
110
+		}else if(type=='reissue'){ //补单
111
+			url = '/pages/assign/assign'
112
+		}
113
+		uni.navigateTo({
114
+		  url: url
115
+		})
116
+	}
117
+	
118
+	// 点击筛选
119
+	function filterClick(){
120
+	  isFilter.value = true;
121
+	}
122
+	
123
+	// 确认筛选
124
+	function conformFilter(evtFilter){
125
+	  evtFilter.value = evtFilter;
126
+	  isFilter.value = false;
127
+	  getList(evtFilter);
128
+	}
129
+	
130
+	// 关闭筛选
131
+	function cancelFilter(){
132
+	  isFilter.value = false;
133
+	}
134
+	
135
+  // 获取列表信息
136
+  function getList(data){
137
+    uni.showLoading({
138
+      title: "加载中",
139
+      mask: true,
140
+    });
141
+    
142
+    if(dataInfo.idx === 0){
143
+      dataInfo.list = [];
144
+    }
145
+		let categoryId = entrance.value=='view' ? data && data.category : handlerStore.handler.data.category.id
146
+    let postData = {
147
+      idx: 0,
148
+      sum: 9999,
149
+      solution: {
150
+				deleteFlag:0,
151
+				hosId: loginUserStore.loginUser.user.currentHospital.id,
152
+				// category:{
153
+				// 	id:'',
154
+				// },
155
+				categoryId:null,
156
+				title:'',
157
+				status:{id:dicData.value.id},
158
+      }
159
+    }
160
+		if(entranceType.value=='repairs'){
161
+			delete postData.solution.hosId
162
+		}
163
+    if(typeof(categoryId)=='number' || typeof(categoryId)=='string'){
164
+			postData.solution.categoryId = categoryId
165
+		}else{
166
+			delete postData.solution.categoryId
167
+		}
168
+		if(data && data.title){
169
+			postData.solution.title = data.title
170
+		}else{
171
+			delete postData.solution.title
172
+		}
173
+		if(loginUserStore.loginUser.user.duty){
174
+		  postData.solution.dutyId = loginUserStore.loginUser.user.duty.id;
175
+		}else if(loginUserStore.loginUser.user.branch){
176
+		  postData.solution.branch = loginUserStore.loginUser.user.branch.id;
177
+		}
178
+    api_getSolution(postData).then(res => {
179
+      uni.hideLoading();
180
+			uni.stopPullDownRefresh();
181
+      if(res.status == 200){
182
+        let list = res.list || [];
183
+				introduceCount.value = res.totalNum
184
+				dataInfo.list = list
185
+				if(entranceType.value=='repairs'){
186
+					dataInfo.list = list.filter(i=>i.repairVisible==1)
187
+				}else{
188
+					dataInfo.list = list
189
+				}
190
+      }else{
191
+        uni.showToast({
192
+          icon: 'none',
193
+          title: res.msg || '请求数据失败!'
194
+        });
195
+      }
196
+    })
197
+  }
198
+  
199
+	// 获取字典
200
+	function getDic(){
201
+		let postData = {
202
+		  "key": 'solution_status',
203
+		  "type": "list",
204
+		};
205
+		api_getDictionary(postData).then(res => {
206
+		  dicData.value = res.find(v => v.value == '3');
207
+		  getList();
208
+		})
209
+	}
210
+	
211
+	onPullDownRefresh(_=>{
212
+		getList();
213
+	})
214
+	
215
+  onLoad((option) => {
216
+		for(let i = 0; i<6; i++){
217
+			setTabbar(i)
218
+		}
219
+    getDic()
220
+  })
221
+	
222
+  onShow(()=>{
223
+		getDic()
224
+	})
225
+	
226
+	onHide(_=>{
227
+		repositorySearchStore.clearRepositoryListSearchData()
228
+	})
229
+</script>
230
+
231
+<style lang="scss" scoped>
232
+page{
233
+	height: calc(100vh - var(--window-bottom));
234
+}
235
+.categoryOne{
236
+  display: flex;
237
+  flex-direction: column;
238
+  justify-content: space-between;
239
+	.filter{
240
+		width: 100%;
241
+	  display: flex;
242
+	  justify-content: flex-end;
243
+		align-items: center;
244
+		position: fixed;
245
+		height: 80rpx;
246
+		background: #fff;
247
+		border-bottom: 0.25rem solid #DEDEDE;
248
+	  .newicon-shaixuan{
249
+			margin-right: 40rpx;
250
+	    font-size: 36rpx;
251
+	    color: #2C2C2C;
252
+	  }
253
+	}
254
+	.mar-t40{
255
+		margin-top: 80rpx;
256
+	}
257
+  .head{
258
+    height: 88rpx;
259
+    display: flex;
260
+    align-items: center;
261
+    padding: 0 24rpx;
262
+    position: fixed;
263
+    z-index: 99;
264
+    width: 100%;
265
+    box-sizing: border-box;
266
+    background: #fff;
267
+    font-size: 26rpx;
268
+    color: $uni-primary;
269
+  }
270
+  .body{
271
+    font-size: 30rpx;
272
+		// padding-bottom: 140rpx;
273
+		margin-bottom: var(--window-bottom);
274
+    .body_item{
275
+      border-bottom: 8rpx solid #DEDEDE;
276
+			.title{
277
+				font-weight: 600;
278
+				padding: 24rpx;
279
+				border-bottom: 1rpx solid #DEDEDE;
280
+			}
281
+			.content{
282
+				color: #6A6A6A;
283
+				font-size: 24rpx;
284
+				padding: 24rpx;
285
+				height: 120rpx;
286
+				overflow: hidden;
287
+				border-bottom: 1rpx solid #DEDEDE;
288
+				view{
289
+					display: -webkit-box;
290
+					overflow: hidden;
291
+					-webkit-box-orient: vertical;
292
+					-webkit-line-clamp: 3;
293
+					text-overflow: ellipsis;
294
+					white-space: initial;
295
+				}
296
+			}
297
+			.sign{
298
+				display: flex;
299
+				justify-content: space-between;
300
+				padding: 24rpx 24rpx 0 24rpx;
301
+				font-size: 26rpx;
302
+			}
303
+			.btn-style{
304
+				padding: 24rpx;
305
+			}
306
+    }
307
+		.body_item:last-child{
308
+			border-bottom: none;
309
+		}
310
+  }
311
+  .zanwu{
312
+    margin-bottom: 140rpx;
313
+    margin-top: 88rpx;
314
+    display: flex;
315
+    justify-content: center;
316
+    .newicon-zanwu{
317
+      font-size: 256rpx;
318
+      color: #D6D6D6;
319
+      margin-top: 140rpx;
320
+    }
321
+  }
322
+  .foot_common_btns{
323
+    position: fixed;
324
+    left: 0;
325
+    bottom: 0;
326
+    background-color: #fff;
327
+  }
328
+	.back-style{
329
+		background: #D6D6D6;
330
+		width: 100rpx;
331
+		height: 100rpx;
332
+		border-radius: 50%;
333
+		display: flex;
334
+		justify-content: center;
335
+		align-items: center;
336
+		position: fixed;
337
+		right: 30rpx;
338
+		bottom: 30rpx;
339
+		text{
340
+			font-size: 50rpx;
341
+			color: #fff;
342
+		}
343
+	}
344
+}
345
+</style>

+ 1 - 1
pages/repair/config.vue

@@ -212,7 +212,7 @@
212 212
 		}
213 213
 		let deptId = dataForm.branch?dataForm.branch:loginUserStore.loginUser.user.currentHospital.id
214 214
 		uni.navigateTo({
215
-		  url: `/pages/repair/deptSelect?data=${JSON.stringify(data)}&commonDeptName=${commonDeptName.value}&deptId=${deptId}`
215
+		  url: `/pages/repair/deptSelect?data=${JSON.stringify(data)}&commonDeptName=${commonDeptName.value}&deptId=${deptId}&type=home`
216 216
 		})
217 217
 	}
218 218
 	

+ 13 - 3
pages/repair/deptSelect.vue

@@ -53,6 +53,8 @@
53 53
 	// 是否提交
54 54
 	const isSubmit = ref(false)
55 55
   
56
+	const entranceType = ref(null)
57
+	
56 58
 	// 上一步或者返回列表
57 59
 	function goBackOrToList(){
58 60
 	  goBack();
@@ -134,9 +136,16 @@
134 136
 			data:id,
135 137
 			name:name
136 138
 		}
137
-		uni.reLaunch({
138
-		  url: '/pages/repair/config?data='+JSON.stringify(data)
139
-		})
139
+		console.log(888,entranceType.value)
140
+		if(entranceType.value=='home'){
141
+			uni.reLaunch({
142
+			  url: '/pages/repair/config?data='+JSON.stringify(data)
143
+			})
144
+		}else{
145
+			uni.navigateTo({
146
+			  url: `/pages/myRepair/myRepair?data=${JSON.stringify(data)}&type=2`
147
+			})
148
+		}
140 149
 	}
141 150
 	
142 151
   // 初始化
@@ -159,6 +168,7 @@
159 168
 			}
160 169
 		}
161 170
 		deptId.value = option.deptId
171
+		entranceType.value = option.type
162 172
     getRepairTypes();
163 173
   })
164 174
   

+ 24 - 7
pages/repair/home.vue

@@ -59,7 +59,7 @@
59 59
 <script setup>
60 60
 	import { SM } from "@/http/http.js"
61 61
 	import { ref, reactive } from 'vue'
62
-	import { onLoad,onShow } from '@dcloudio/uni-app'
62
+	import { onLoad,onShow,onPullDownRefresh } from '@dcloudio/uni-app'
63 63
 	import { 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'
@@ -112,6 +112,7 @@
112 112
 		});
113 113
 		api_getCount({}).then(res=>{
114 114
 			uni.hideLoading();
115
+			uni.stopPullDownRefresh();
115 116
 			repairData.value = res.data
116 117
 			// getNotice()
117 118
 		})
@@ -126,6 +127,7 @@
126 127
 			});
127 128
 			return
128 129
 		}
130
+		uni.setStorageSync('repairsType','home')
129 131
 		uni.navigateTo({
130 132
 		  url: '/pages/repair/rapidRep'
131 133
 		})
@@ -163,19 +165,34 @@
163 165
 		noticeData.value = tempDiv.textContent || tempDiv.innerText || '';
164 166
 	}
165 167
 	
168
+	// 获取配置项
169
+	function getConfig(){
170
+		api_systemConfiguration({
171
+			idx: 0,
172
+			sum: 9999,
173
+		}).then(res=>{
174
+			let data = res.list
175
+			isDept.value = data.find(i=>i.keyconfig=='deptRepair')
176
+			isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
177
+			isPublic.value = data.find(i=>i.keyconfig=='publicRepair')
178
+		})
179
+	}
180
+	
181
+	onPullDownRefresh(_=>{
182
+		getCount();
183
+	})
184
+	
166 185
 	onLoad((option) => {
167 186
 		// 巡检tabbar
168
-		for(let i = 0; i<5; i++){
187
+		for(let i = 0; i<6; i++){
169 188
 			setTabbar(i)
170 189
 		}
190
+		getCount()
191
+		getConfig()
171 192
 	})
172 193
 	
173 194
 	onShow((option) => {
174 195
 		getCount()
175
-		let data = JSON.parse(uni.getStorageSync('sysData'))
176
-		isDept.value = data.find(i=>i.keyconfig=='deptRepair')
177
-		isRepair.value = data.find(i=>i.keyconfig=='cmdbRepair')
178
-		isPublic.value = data.find(i=>i.keyconfig=='publicRepair')
179 196
 	})
180 197
 	
181 198
 
@@ -183,7 +200,7 @@
183 200
 
184 201
 <style lang="scss" scoped>
185 202
 	.home{
186
-		height: 100vh;
203
+		// height: calc(100vh - 180rpx);
187 204
 		padding: 20rpx;
188 205
 		background: #fff;
189 206
 		.home_item{

+ 1 - 1
pages/repair/rapidRep.vue

@@ -44,7 +44,7 @@
44 44
 				<image class="mask-img" src="../../static/img/audio_play.gif" mode=""></image>
45 45
 			</view>
46 46
 			<view class="mask-bottom">
47
-				<view class="mask-bottom-txt" @touchend.stop="recStop($event)">结束录音</view>
47
+				<view class="mask-bottom-txt" @click.stop="recStop($event)">结束录音</view>
48 48
 			</view>
49 49
 		</view>
50 50
 	</view>

+ 19 - 7
pages/repair/rapidRepNext.vue

@@ -476,7 +476,7 @@
476 476
 		postData.incident.contacts = dataInfo.contacts;
477 477
 		postData.incident.contactsInformation = dataInfo.contactsInformation;
478 478
 		postData.incident.hosId = dataInfo.branch;
479
-
479
+		let repairsType = uni.getStorageSync('repairsType')
480 480
 		// postData.incident.buildId = dataInfo.areaId; //areaId:楼栋   
481 481
   //   postData.incident.floorId = dataInfo.placeId;//placeId:楼层
482 482
 		// buildId
@@ -517,9 +517,15 @@
517 517
 										setTimeout(() => {
518 518
 											uni.setStorageSync('rapidRepNext','')
519 519
 											uni.setStorageSync('repairData','')
520
-										  uni.reLaunch({
521
-										    url: '/pages/repair/home',
522
-										  })
520
+											if(repairsType=='home'){
521
+												uni.reLaunch({
522
+												  url: '/pages/repair/home',
523
+												})
524
+											}else{
525
+												uni.navigateTo({
526
+												  url: `/pages/myRepair/myRepair`
527
+												})
528
+											}
523 529
 										}, 1500)
524 530
 								  // }else{
525 531
 								  //   uni.showToast({
@@ -537,9 +543,15 @@
537 543
 								setTimeout(() => {
538 544
 									uni.setStorageSync('rapidRepNext','')
539 545
 									uni.setStorageSync('repairData','')
540
-								  uni.reLaunch({
541
-								    url: '/pages/repair/home',
542
-								  })
546
+									if(repairsType=='home'){
547
+										uni.reLaunch({
548
+										  url: '/pages/repair/home',
549
+										})
550
+									}else{
551
+										uni.navigateTo({
552
+										  url: `/pages/myRepair/myRepair`
553
+										})
554
+									}
543 555
 								}, 1500)
544 556
 							}
545 557
 						}else{

+ 5 - 1
pages/repair/repairsList.vue

@@ -80,7 +80,7 @@
80 80
   import IncidentAttachment from '@/components/IncidentAttachment.vue';
81 81
   import { startOfDay, endOfDay, format, add } from 'date-fns'
82 82
   import { ref, reactive, computed } from 'vue'
83
-  import { onLoad, onShow, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
83
+  import { onLoad, onShow, onHide, onPullDownRefresh, onReachBottom, onTabItemTap } from '@dcloudio/uni-app'
84 84
   import { api_getDictionary, api_incident, api_incident_count, api_incidentTask, api_taskresolve } from "@/http/api.js"
85 85
   import { filterFormatDate } from '@/filters/filterFormatDate.js'
86 86
   import { computedPriorityStyle } from '@/filters/computedPriorityStyle.js'
@@ -397,6 +397,10 @@
397 397
 		
398 398
 	})
399 399
 	
400
+	onHide(_=>{
401
+		repositorySearchStore.clearRepositoryListSearchData()
402
+	})
403
+	
400 404
   onTabItemTap(e => {
401 405
     // onLoadFn();
402 406
   })

+ 15 - 12
pages/repository/repository.vue

@@ -39,7 +39,7 @@
39 39
 
40 40
 <script setup>
41 41
   import { ref, reactive} from 'vue'
42
-  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
42
+  import { onLoad, onHide, onReachBottom } from '@dcloudio/uni-app'
43 43
   import { api_getSolution,api_getDictionary } from "@/http/api.js"
44 44
   import { useSetTitle } from '@/share/useSetTitle.js'
45 45
   import { useGoBack } from '@/share/useGoBack.js'
@@ -47,12 +47,13 @@
47 47
 	import repositoryFilter from '@/components/repositoryFilter.vue';
48 48
 	import { useLoginUserStore } from '@/stores/loginUser'
49 49
 	import { filterFormatDate } from '@/filters/filterFormatDate.js'
50
+	import { repositoryListSearchStore } from '@/stores/repositorySearch'
50 51
 	
51 52
   useSetTitle();
52 53
 	const { formatDate }  = filterFormatDate();
53 54
 	const loginUserStore = useLoginUserStore();
54 55
 	const handlerStore = useHandlerStore();
55
-	
56
+	const repositorySearchStore = repositoryListSearchStore();
56 57
   const { goBack }  = useGoBack();
57 58
   
58 59
 	// 操作类型
@@ -211,19 +212,16 @@
211 212
     getDic()
212 213
   })
213 214
   
214
-  onPullDownRefresh(() => {
215
-    // getList(0)
216
-  })
217
-  
218
-  onReachBottom(() => {
219
-    // dataInfo.idx += 1;
220
-    // if (dataInfo.hasMore) {
221
-    //   getList(); // 当触底时加载更多数据
222
-    // }
223
-  })
215
+	onHide(_=>{
216
+		repositorySearchStore.clearRepositoryListSearchData()
217
+	})
218
+	
224 219
 </script>
225 220
 
226 221
 <style lang="scss" scoped>
222
+page{
223
+	height: calc(100vh - var(--window-bottom));
224
+}
227 225
 .categoryOne{
228 226
   display: flex;
229 227
   flex-direction: column;
@@ -261,6 +259,9 @@
261 259
   }
262 260
   .body{
263 261
     font-size: 30rpx;
262
+		margin-bottom: var(--window-bottom);
263
+		// padding-bottom: 140rpx;
264
+		// padding-bottom: calc(0rpx + env(safe-area-inset-bottom));
264 265
     .body_item{
265 266
       border-bottom: 8rpx solid #DEDEDE;
266 267
 			.title{
@@ -272,6 +273,8 @@
272 273
 				color: #6A6A6A;
273 274
 				font-size: 24rpx;
274 275
 				padding: 24rpx;
276
+				height: 120rpx;
277
+				overflow: hidden;
275 278
 				border-bottom: 1rpx solid #DEDEDE;
276 279
 				view{
277 280
 					display: -webkit-box;

+ 1 - 0
pages/workHourManagementOne/workHourManagementOne.vue

@@ -68,6 +68,7 @@
68 68
       workHourManagement: {
69 69
         treeLevel: 1,
70 70
 				hosId:dataInfo.hosId,
71
+				showSecond:1
71 72
       }
72 73
     }
73 74
     getFetchDataList("simple/data", "workHourManagement", postData).then(res => {

+ 41 - 9
share/useSetTabbar.js

@@ -6,12 +6,16 @@ export function useSetTabbar() {
6 6
    */
7 7
   const setTabbar = (index) => {
8 8
     let flag = false;
9
-    
9
+    let loginType = uni.getStorageSync('loginType'); //1:处理 2:报修
10 10
     switch(index){
11 11
 			case 0:
12 12
 			  // 故障
13 13
 			  if(loginUserStore.loginUser.user.engineer == 1){
14
-			    flag = true;
14
+					if(loginType==1){
15
+						flag = true;
16
+					}else{
17
+						flag = false;
18
+					}
15 19
 			  }
16 20
 			  break;
17 21
       case 1:
@@ -19,31 +23,59 @@ export function useSetTabbar() {
19 23
 				if(loginUserStore.loginUser.user.engineer == 0){
20 24
 					flag = false;
21 25
 				}else if(loginUserStore.loginUser.menu.some(v => v.link === 'inspectionExecute')){
22
-          flag = true;
26
+					if(loginType==1){
27
+						flag = true;
28
+					}else{
29
+						flag = false;
30
+					}
23 31
         }
24 32
         break;
25 33
 			case 2:
34
+				// 知识库
35
+				if(loginUserStore.loginUser.user.engineer == 1){
36
+					if(loginType==1){
37
+						flag = true;
38
+					}else{
39
+						flag = false;
40
+					}
41
+				}else{
42
+					flag = false;
43
+				}
44
+				break;
45
+			case 3:
26 46
 			  // 我的报修
27 47
 			  if(loginUserStore.loginUser.user.engineer == 0){
28
-			    flag = true;
29
-			  }else{
30 48
 					flag = true;
49
+			  }else{
50
+					if(loginType==1){
51
+						flag = false;
52
+					}else{
53
+						flag = true;
54
+					}
31 55
 				}
32 56
 			  break;
33
-			case 3:
57
+			case 4:
34 58
 			  // 我的
35 59
 			  if(loginUserStore.loginUser.user.engineer == 1){
36
-			    flag = true;
60
+					if(loginType==1){
61
+						flag = true;
62
+					}else{
63
+						flag = false;
64
+					}
37 65
 			  }else{
38 66
 					flag = false;
39 67
 				}
40 68
 			  break;
41
-			case 4:
69
+			case 5:
42 70
 				// 设置
43 71
 				if(loginUserStore.loginUser.user.engineer == 0){
44 72
 				  flag = true;
45 73
 				}else{
46
-					flag = false;
74
+					if(loginType==1){
75
+						flag = false;
76
+					}else{
77
+						flag = true;
78
+					}
47 79
 				}
48 80
 				break;
49 81
     }

BIN
static/img/icon_zsk.png


BIN
static/img/icon_zsk_active.png