瀏覽代碼

拉取最新代码

maotao 11 月之前
父節點
當前提交
3bf22277a4
共有 4 個文件被更改,包括 91 次插入63 次删除
  1. 18 17
      pages/assign/assign.vue
  2. 16 10
      pages/handler/handler.vue
  3. 30 23
      pages/repository/repository.vue
  4. 27 13
      pages/repositoryDetails/repositoryDetails.vue

+ 18 - 17
pages/assign/assign.vue

@@ -868,10 +868,11 @@
868 868
   
869 869
 	// 引入知识库
870 870
 	function importRep(type,tabType){
871
+		dataInfo.operateType = type
872
+		dataInfo.tabType = tabType
871 873
 		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
872 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 1218
         dataInfo.tabActiveValue = 'supplement';
1218 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 1236
       handlerStore.clearHandlerData();
1221 1237
       
1222 1238
       if(dataInfo.category){
@@ -1278,21 +1294,6 @@
1278 1294
     if(!dataInfo.tabActiveValue){
1279 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 1297
     initForm()
1297 1298
   })
1298 1299
 </script>

+ 16 - 10
pages/handler/handler.vue

@@ -312,8 +312,10 @@
312 312
   
313 313
 	// 引入知识库
314 314
 	function importRep(type){
315
+		dataInfo.operateType = type
316
+		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
315 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 462
     dataInfo.selectData = {};//选择的对象
461 463
     dataInfo.selectType = {};//选择的对象类型
462 464
     dataInfo.handleDescription = '';//解决方案
465
+		solutionId.value = null;//引用知识库id
466
+		dataInfo.introduceCount = 0;//引用知识库次数
463 467
     dataInfo.handleCategory = undefined;//处理方式
464 468
     dataInfo.handleCategoryList = [];//处理方式列表
465 469
     dataInfo.closecode = undefined;//处理结果
@@ -515,6 +519,9 @@
515 519
         // 跳转页面选择了选项并且工单ID一致
516 520
         if(handlerStore.handler.data && handlerStore.handler.data.incidentId == dataInfo.incidentId){
517 521
           Object.assign(dataInfo, handlerStore.handler.data);
522
+					if(dataInfo.handleDescription){
523
+						dataInfo.handleDescription = getHtml(dataInfo.handleDescription);
524
+					}
518 525
           console.log(dataInfo)
519 526
           handlerStore.clearHandlerData();
520 527
         }else{
@@ -850,16 +857,15 @@
850 857
 	}
851 858
 	
852 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 869
     getIncidentDetail();
864 870
   })
865 871
 </script>

+ 30 - 23
pages/repository/repository.vue

@@ -8,7 +8,7 @@
8 8
 						<view v-html="data.content"></view>
9 9
 					</view>
10 10
 					<view class="sign">
11
-						<view>引入次数:{{data.introduceCount}}</view>
11
+						<view>引入次数:{{data.introduceCount || 0}}</view>
12 12
 						<view>{{data.createtime}}</view>
13 13
 					</view>
14 14
 				</view>
@@ -29,15 +29,22 @@
29 29
   import { api_getSolution } from "@/http/api.js"
30 30
   import { useSetTitle } from '@/share/useSetTitle.js'
31 31
   import { useGoBack } from '@/share/useGoBack.js'
32
-  
32
+  import { useHandlerStore } from '@/stores/handler'
33
+	
33 34
   useSetTitle();
35
+	
36
+	const handlerStore = useHandlerStore();
37
+	
34 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 46
 	// tab类型
40
-	const tabType = ref(null)
47
+	// const tabType = ref(null)
41 48
 	
42 49
   // 数据
43 50
   const dataInfo = reactive({
@@ -51,29 +58,34 @@
51 58
   function toCategoryTwo(data){
52 59
     uni.navigateTo({
53 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 66
 	function importData(data){
61 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 77
 			url = '/pages/handler/handler'
64
-		}else if(operateType.value=='reissue'){ //补单
78
+		}else if(type=='reissue'){ //补单
65 79
 			url = '/pages/assign/assign'
66 80
 		}
67 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 87
   function getList(idx){
88
+		
77 89
     uni.showLoading({
78 90
       title: "加载中",
79 91
       mask: true,
@@ -83,19 +95,15 @@
83 95
     if(dataInfo.idx === 0){
84 96
       dataInfo.list = [];
85 97
     }
86
-
98
+		console.log(777,handlerStore.handler.data)
87 99
     let postData = {
88 100
       idx: dataInfo.idx,
89
-      sum: 20,
101
+      sum: 9999,
90 102
       solution: {
91
-        selectType:"",
92
-				keySearch:"",
93
-				keywords:"",
94
-				solutionType:{id:""},
103
+				category:{
104
+					id:handlerStore.handler.data.category.id,
105
+				},
95 106
 				status:{id:72},
96
-				createUser:{name:""},
97
-				dutyId:1,
98
-				tabType:"publish"
99 107
       }
100 108
     }
101 109
     
@@ -104,6 +112,7 @@
104 112
       uni.stopPullDownRefresh();
105 113
       if(res.status == 200){
106 114
         let list = res.list || [];
115
+				introduceCount.value = res.totalNum
107 116
         if(list.length){
108 117
           dataInfo.hasMore = true;
109 118
           dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
@@ -121,8 +130,6 @@
121 130
   
122 131
   onLoad((option) => {
123 132
     dataInfo.incidentId = option.incidentId;
124
-		operateType.value = option.operateType;
125
-		tabType.value = option.tabType
126 133
     getList(0);
127 134
   })
128 135
   

+ 27 - 13
pages/repositoryDetails/repositoryDetails.vue

@@ -2,7 +2,7 @@
2 2
   <view class="box">
3 3
     <view class="head">{{dataInfo.data.title}}</view>
4 4
     <view class="sign">
5
-			<text>引入次数:{{dataInfo.data.introduceCount}}</text>
5
+			<text>引入次数:{{dataInfo.data.introduceCount?dataInfo.data.introduceCount: 0}}</text>
6 6
 			<text>版本号:{{dataInfo.data.visionNumber}}</text>
7 7
 			<text>{{dataInfo.data.createtime}}</text>
8 8
 		</view>
@@ -22,18 +22,25 @@
22 22
   import { api_getSolution, api_listAttachment} from "@/http/api.js"
23 23
   import { useSetTitle } from '@/share/useSetTitle.js'
24 24
   import { useGoBack } from '@/share/useGoBack.js'
25
-  
25
+  import { useHandlerStore } from '@/stores/handler'
26
+	
26 27
   useSetTitle();
28
+	
29
+	const handlerStore = useHandlerStore();
30
+	
27 31
   const { goBack }  = useGoBack();
28 32
   
29 33
   // 故障类型
30 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 42
 	// tab类型
36
-	const tabType = ref(null)
43
+	const tabType = ref('null')
37 44
 	
38 45
   // 数据
39 46
   const dataInfo = reactive({
@@ -94,17 +101,21 @@
94 101
 	// 引入
95 102
 	function importData(){
96 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 113
 			url = '/pages/handler/handler'
99
-		}else if(operateType.value=='reissue'){ //补单
114
+		}else if(type=='reissue'){ //补单
100 115
 			url = '/pages/assign/assign'
101 116
 		}
102 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 150
       uni.hideLoading();
140 151
       if(res.status == 200){
141 152
         let list = res.list || [];
153
+				introduceCount.value = res.totalNum
142 154
         dataInfo.data = list[0]
143 155
 				mutiCategory.value = list[0].category.mutiCategory
144 156
 				getHandlerImgs('knowledge',list[0].id)
@@ -154,8 +166,10 @@
154 166
   onLoad((option) => {
155 167
     dataInfo.incidentId = option.incidentId;
156 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 173
     getList();
160 174
   })
161 175