Pārlūkot izejas kodu

拉取最新代码

maotao 1 gadu atpakaļ
vecāks
revīzija
3bf22277a4

+ 18 - 17
pages/assign/assign.vue

@@ -868,10 +868,11 @@
868
   
868
   
869
 	// 引入知识库
869
 	// 引入知识库
870
 	function importRep(type,tabType){
870
 	function importRep(type,tabType){
871
+		dataInfo.operateType = type
872
+		dataInfo.tabType = tabType
871
 		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
873
 		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
872
 		uni.navigateTo({
874
 		uni.navigateTo({
873
-		  url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}
874
-			&operateType=${type}&tabType=${tabType}`
875
+		  url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}`
875
 		})
876
 		})
876
 	}
877
 	}
877
 	
878
 	
@@ -1217,6 +1218,21 @@
1217
         dataInfo.tabActiveValue = 'supplement';
1218
         dataInfo.tabActiveValue = 'supplement';
1218
         next();
1219
         next();
1219
       }
1220
       }
1221
+			
1222
+			let storeData = handlerStore.handler.data
1223
+			if(storeData.type == 'rep'){
1224
+				if(storeData.handleDescription){
1225
+					dataInfo.handleDescription = getHtml(storeData.handleDescription);
1226
+					solutionId.value = storeData.solutionId
1227
+				}
1228
+				if(storeData.tabType == 'direct'){
1229
+					dataInfo.tabActiveValue = 'direct'
1230
+				}else{
1231
+					dataInfo.tabActiveValue = 'supplement'
1232
+					dataInfo.supplementFlag = false
1233
+				}
1234
+			}
1235
+			
1220
       handlerStore.clearHandlerData();
1236
       handlerStore.clearHandlerData();
1221
       
1237
       
1222
       if(dataInfo.category){
1238
       if(dataInfo.category){
@@ -1278,21 +1294,6 @@
1278
     if(!dataInfo.tabActiveValue){
1294
     if(!dataInfo.tabActiveValue){
1279
       dataInfo.tabActiveValue = dataInfo.tabs[0].value;
1295
       dataInfo.tabActiveValue = dataInfo.tabs[0].value;
1280
     }
1296
     }
1281
-		
1282
-		if(option.type&&decodeURIComponent(option.type=='rep')){
1283
-			let handleDescription = decodeURIComponent(option.handleDescription)
1284
-			solutionId.value = JSON.parse(decodeURIComponent(option.solutionId))
1285
-			dataInfo.introduceCount = decodeURIComponent(option.introduceCount!="undefined"?option.introduceCount:0)
1286
-			if(option.tabType&&decodeURIComponent(option.tabType)=='direct'){
1287
-				dataInfo.tabActiveValue = 'direct'
1288
-			}else{
1289
-				dataInfo.tabActiveValue = 'supplement'
1290
-				dataInfo.supplementFlag = false
1291
-			}
1292
-			if(handleDescription!='undefined'){
1293
-				dataInfo.handleDescription = getHtml(handleDescription);
1294
-			}
1295
-		}
1296
     initForm()
1297
     initForm()
1297
   })
1298
   })
1298
 </script>
1299
 </script>

+ 16 - 10
pages/handler/handler.vue

@@ -312,8 +312,10 @@
312
   
312
   
313
 	// 引入知识库
313
 	// 引入知识库
314
 	function importRep(type){
314
 	function importRep(type){
315
+		dataInfo.operateType = type
316
+		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
315
 		uni.navigateTo({
317
 		uni.navigateTo({
316
-		  url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}&operateType=${type}`
318
+		  url: `/pages/repository/repository`
317
 		})
319
 		})
318
 	}
320
 	}
319
 	
321
 	
@@ -460,6 +462,8 @@
460
     dataInfo.selectData = {};//选择的对象
462
     dataInfo.selectData = {};//选择的对象
461
     dataInfo.selectType = {};//选择的对象类型
463
     dataInfo.selectType = {};//选择的对象类型
462
     dataInfo.handleDescription = '';//解决方案
464
     dataInfo.handleDescription = '';//解决方案
465
+		solutionId.value = null;//引用知识库id
466
+		dataInfo.introduceCount = 0;//引用知识库次数
463
     dataInfo.handleCategory = undefined;//处理方式
467
     dataInfo.handleCategory = undefined;//处理方式
464
     dataInfo.handleCategoryList = [];//处理方式列表
468
     dataInfo.handleCategoryList = [];//处理方式列表
465
     dataInfo.closecode = undefined;//处理结果
469
     dataInfo.closecode = undefined;//处理结果
@@ -515,6 +519,9 @@
515
         // 跳转页面选择了选项并且工单ID一致
519
         // 跳转页面选择了选项并且工单ID一致
516
         if(handlerStore.handler.data && handlerStore.handler.data.incidentId == dataInfo.incidentId){
520
         if(handlerStore.handler.data && handlerStore.handler.data.incidentId == dataInfo.incidentId){
517
           Object.assign(dataInfo, handlerStore.handler.data);
521
           Object.assign(dataInfo, handlerStore.handler.data);
522
+					if(dataInfo.handleDescription){
523
+						dataInfo.handleDescription = getHtml(dataInfo.handleDescription);
524
+					}
518
           console.log(dataInfo)
525
           console.log(dataInfo)
519
           handlerStore.clearHandlerData();
526
           handlerStore.clearHandlerData();
520
         }else{
527
         }else{
@@ -850,16 +857,15 @@
850
 	}
857
 	}
851
 	
858
 	
852
   onLoad((option) => {
859
   onLoad((option) => {
853
-		if(option.type&&decodeURIComponent(option.type=='rep')){
854
-			let handleDescription = decodeURIComponent(option.handleDescription)
855
-			solutionId.value = JSON.parse(decodeURIComponent(option.solutionId))
856
-			dataInfo.introduceCount = decodeURIComponent(option.introduceCount!="undefined"?option.introduceCount:0)
857
-			if(handleDescription!='undefined'){
858
-				dataInfo.handleDescription = getHtml(handleDescription);
859
-			}
860
+		let storeData = handlerStore.handler.data
861
+		if(storeData && storeData.type=='rep'){
862
+			solutionId.value = storeData.solutionId
863
+			dataInfo.isSummaryNext = storeData.isSummaryNext
864
+			dataInfo.incidentId = storeData.incidentId;
865
+		}else{
866
+			dataInfo.incidentId = option.incidentId;
867
+			dataInfo.isSummaryNext = option.isSummaryNext == 1;
860
 		}
868
 		}
861
-    dataInfo.incidentId = JSON.parse(decodeURIComponent(option.incidentId))
862
-    dataInfo.isSummaryNext = option.isSummaryNext == 1;
863
     getIncidentDetail();
869
     getIncidentDetail();
864
   })
870
   })
865
 </script>
871
 </script>

+ 30 - 23
pages/repository/repository.vue

@@ -8,7 +8,7 @@
8
 						<view v-html="data.content"></view>
8
 						<view v-html="data.content"></view>
9
 					</view>
9
 					</view>
10
 					<view class="sign">
10
 					<view class="sign">
11
-						<view>引入次数:{{data.introduceCount}}</view>
11
+						<view>引入次数:{{data.introduceCount || 0}}</view>
12
 						<view>{{data.createtime}}</view>
12
 						<view>{{data.createtime}}</view>
13
 					</view>
13
 					</view>
14
 				</view>
14
 				</view>
@@ -29,15 +29,22 @@
29
   import { api_getSolution } from "@/http/api.js"
29
   import { api_getSolution } from "@/http/api.js"
30
   import { useSetTitle } from '@/share/useSetTitle.js'
30
   import { useSetTitle } from '@/share/useSetTitle.js'
31
   import { useGoBack } from '@/share/useGoBack.js'
31
   import { useGoBack } from '@/share/useGoBack.js'
32
-  
32
+  import { useHandlerStore } from '@/stores/handler'
33
+	
33
   useSetTitle();
34
   useSetTitle();
35
+	
36
+	const handlerStore = useHandlerStore();
37
+	
34
   const { goBack }  = useGoBack();
38
   const { goBack }  = useGoBack();
35
   
39
   
36
 	// 操作类型
40
 	// 操作类型
37
-	const operateType = ref(null)
41
+	// const operateType = ref(null)
42
+	
43
+	// 关联故障分类的知识库数量
44
+	const introduceCount = ref(0)
38
 	
45
 	
39
 	// tab类型
46
 	// tab类型
40
-	const tabType = ref(null)
47
+	// const tabType = ref(null)
41
 	
48
 	
42
   // 数据
49
   // 数据
43
   const dataInfo = reactive({
50
   const dataInfo = reactive({
@@ -51,29 +58,34 @@
51
   function toCategoryTwo(data){
58
   function toCategoryTwo(data){
52
     uni.navigateTo({
59
     uni.navigateTo({
53
       url: `/pages/repositoryDetails/repositoryDetails?incidentId=${dataInfo.incidentId}
60
       url: `/pages/repositoryDetails/repositoryDetails?incidentId=${dataInfo.incidentId}
54
-			&solutionnumber=${data.solutionnumber}&operateType=${operateType.value}
55
-			&tabType=${tabType.value}`
61
+			&solutionnumber=${data.solutionnumber}`
56
     })
62
     })
57
   }
63
   }
58
 	
64
 	
59
   // 引入
65
   // 引入
60
 	function importData(data){
66
 	function importData(data){
61
 		let url = null
67
 		let url = null
62
-		if(operateType.value=='malfunction'){ //故障处理
68
+		let type = handlerStore.handler.data.operateType
69
+		let storeInfo = handlerStore.handler.data
70
+		storeInfo.introduceCount = introduceCount.value
71
+		storeInfo.handleDescription = data.content
72
+		storeInfo.solutionId = data.id
73
+		storeInfo.type = 'rep'
74
+		storeInfo.isSummaryNext = 1
75
+		handlerStore.setHandlerData(storeInfo,'assign', 'assign')
76
+		if(type=='malfunction'){ //故障处理
63
 			url = '/pages/handler/handler'
77
 			url = '/pages/handler/handler'
64
-		}else if(operateType.value=='reissue'){ //补单
78
+		}else if(type=='reissue'){ //补单
65
 			url = '/pages/assign/assign'
79
 			url = '/pages/assign/assign'
66
 		}
80
 		}
67
 		uni.navigateTo({
81
 		uni.navigateTo({
68
-		  url: `${url}?incidentId=${encodeURIComponent(JSON.stringify(dataInfo.incidentId))}
69
-			&handleDescription=${encodeURIComponent(data.content)}&solutionId=${encodeURIComponent(JSON.stringify(data.id))}&isSummaryNext=1&type=${encodeURIComponent('rep')}
70
-			&introduceCount=${encodeURIComponent(data.introduceCount)}
71
-			&tabType=${encodeURIComponent(tabType.value)}`
82
+		  url: url
72
 		})
83
 		})
73
 	}
84
 	}
74
 	
85
 	
75
   // 获取列表信息
86
   // 获取列表信息
76
   function getList(idx){
87
   function getList(idx){
88
+		
77
     uni.showLoading({
89
     uni.showLoading({
78
       title: "加载中",
90
       title: "加载中",
79
       mask: true,
91
       mask: true,
@@ -83,19 +95,15 @@
83
     if(dataInfo.idx === 0){
95
     if(dataInfo.idx === 0){
84
       dataInfo.list = [];
96
       dataInfo.list = [];
85
     }
97
     }
86
-
98
+		console.log(777,handlerStore.handler.data)
87
     let postData = {
99
     let postData = {
88
       idx: dataInfo.idx,
100
       idx: dataInfo.idx,
89
-      sum: 20,
101
+      sum: 9999,
90
       solution: {
102
       solution: {
91
-        selectType:"",
92
-				keySearch:"",
93
-				keywords:"",
94
-				solutionType:{id:""},
103
+				category:{
104
+					id:handlerStore.handler.data.category.id,
105
+				},
95
 				status:{id:72},
106
 				status:{id:72},
96
-				createUser:{name:""},
97
-				dutyId:1,
98
-				tabType:"publish"
99
       }
107
       }
100
     }
108
     }
101
     
109
     
@@ -104,6 +112,7 @@
104
       uni.stopPullDownRefresh();
112
       uni.stopPullDownRefresh();
105
       if(res.status == 200){
113
       if(res.status == 200){
106
         let list = res.list || [];
114
         let list = res.list || [];
115
+				introduceCount.value = res.totalNum
107
         if(list.length){
116
         if(list.length){
108
           dataInfo.hasMore = true;
117
           dataInfo.hasMore = true;
109
           dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
118
           dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
@@ -121,8 +130,6 @@
121
   
130
   
122
   onLoad((option) => {
131
   onLoad((option) => {
123
     dataInfo.incidentId = option.incidentId;
132
     dataInfo.incidentId = option.incidentId;
124
-		operateType.value = option.operateType;
125
-		tabType.value = option.tabType
126
     getList(0);
133
     getList(0);
127
   })
134
   })
128
   
135
   

+ 27 - 13
pages/repositoryDetails/repositoryDetails.vue

@@ -2,7 +2,7 @@
2
   <view class="box">
2
   <view class="box">
3
     <view class="head">{{dataInfo.data.title}}</view>
3
     <view class="head">{{dataInfo.data.title}}</view>
4
     <view class="sign">
4
     <view class="sign">
5
-			<text>引入次数:{{dataInfo.data.introduceCount}}</text>
5
+			<text>引入次数:{{dataInfo.data.introduceCount?dataInfo.data.introduceCount: 0}}</text>
6
 			<text>版本号:{{dataInfo.data.visionNumber}}</text>
6
 			<text>版本号:{{dataInfo.data.visionNumber}}</text>
7
 			<text>{{dataInfo.data.createtime}}</text>
7
 			<text>{{dataInfo.data.createtime}}</text>
8
 		</view>
8
 		</view>
@@ -22,18 +22,25 @@
22
   import { api_getSolution, api_listAttachment} from "@/http/api.js"
22
   import { api_getSolution, api_listAttachment} from "@/http/api.js"
23
   import { useSetTitle } from '@/share/useSetTitle.js'
23
   import { useSetTitle } from '@/share/useSetTitle.js'
24
   import { useGoBack } from '@/share/useGoBack.js'
24
   import { useGoBack } from '@/share/useGoBack.js'
25
-  
25
+  import { useHandlerStore } from '@/stores/handler'
26
+	
26
   useSetTitle();
27
   useSetTitle();
28
+	
29
+	const handlerStore = useHandlerStore();
30
+	
27
   const { goBack }  = useGoBack();
31
   const { goBack }  = useGoBack();
28
   
32
   
29
   // 故障类型
33
   // 故障类型
30
   const mutiCategory = ref(null)
34
   const mutiCategory = ref(null)
31
   
35
   
32
 	// 操作类型
36
 	// 操作类型
33
-	const operateType = ref(null)
37
+	// const operateType = ref(null)
38
+	
39
+	// 关联故障分类的知识库数量
40
+	const introduceCount = ref(0)
34
 	
41
 	
35
 	// tab类型
42
 	// tab类型
36
-	const tabType = ref(null)
43
+	const tabType = ref('null')
37
 	
44
 	
38
   // 数据
45
   // 数据
39
   const dataInfo = reactive({
46
   const dataInfo = reactive({
@@ -94,17 +101,21 @@
94
 	// 引入
101
 	// 引入
95
 	function importData(){
102
 	function importData(){
96
 		let url = null
103
 		let url = null
97
-		if(operateType.value=='malfunction'){ //故障处理
104
+		let type = handlerStore.handler.data.operateType
105
+		let storeInfo = handlerStore.handler.data
106
+		storeInfo.introduceCount = introduceCount.value
107
+		storeInfo.handleDescription = dataInfo.data.content
108
+		storeInfo.solutionId = dataInfo.data.id
109
+		storeInfo.type = 'rep'
110
+		storeInfo.isSummaryNext = 1
111
+		handlerStore.setHandlerData(storeInfo,'assign', 'assign')
112
+		if(type=='malfunction'){ //故障处理
98
 			url = '/pages/handler/handler'
113
 			url = '/pages/handler/handler'
99
-		}else if(operateType.value=='reissue'){ //补单
114
+		}else if(type=='reissue'){ //补单
100
 			url = '/pages/assign/assign'
115
 			url = '/pages/assign/assign'
101
 		}
116
 		}
102
 		uni.navigateTo({
117
 		uni.navigateTo({
103
-		  url: `${url}?incidentId=${encodeURIComponent(JSON.stringify(dataInfo.incidentId))}
104
-			&handleDescription=${encodeURIComponent(dataInfo.data.content)}&solutionId=${encodeURIComponent(JSON.stringify(dataInfo.data.id))}
105
-			&isSummaryNext=1&type=${encodeURIComponent('rep')}
106
-			&introduceCount=${encodeURIComponent(dataInfo.data.introduceCount)}
107
-			&tabType=${encodeURIComponent(tabType.value)}`
118
+		  url: url
108
 		})
119
 		})
109
 	}
120
 	}
110
 	
121
 	
@@ -139,6 +150,7 @@
139
       uni.hideLoading();
150
       uni.hideLoading();
140
       if(res.status == 200){
151
       if(res.status == 200){
141
         let list = res.list || [];
152
         let list = res.list || [];
153
+				introduceCount.value = res.totalNum
142
         dataInfo.data = list[0]
154
         dataInfo.data = list[0]
143
 				mutiCategory.value = list[0].category.mutiCategory
155
 				mutiCategory.value = list[0].category.mutiCategory
144
 				getHandlerImgs('knowledge',list[0].id)
156
 				getHandlerImgs('knowledge',list[0].id)
@@ -154,8 +166,10 @@
154
   onLoad((option) => {
166
   onLoad((option) => {
155
     dataInfo.incidentId = option.incidentId;
167
     dataInfo.incidentId = option.incidentId;
156
 		dataInfo.solutionnumber = option.solutionnumber ;
168
 		dataInfo.solutionnumber = option.solutionnumber ;
157
-		operateType.value = option.operateType;
158
-		tabType.value = option.tabType;
169
+		// operateType.value = decodeURIComponent(option.operateType);
170
+		if(option.tabType){
171
+			tabType.value = option.tabType;
172
+		}
159
     getList();
173
     getList();
160
   })
174
   })
161
 
175