maotao пре 10 месеци
родитељ
комит
3778ddb753

+ 69 - 5
pages/assign/assign.vue

@@ -10,8 +10,14 @@
10 10
       <!-- 故障处理 -->
11 11
       <template v-if="dataInfo.tabActiveValue === 'direct'">
12 12
         <view class="form_item column" v-if="dataInfo.category.hasSimple != 1">
13
-          <view class="title"><text class="required newicon newicon-bitian"></text>解决方案:</view>
14
-          <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
13
+          <view class="title title-width">
14
+						<text class="required newicon newicon-bitian"></text>
15
+						<view class="title-fl-sb">
16
+							解决方案:
17
+							<view @click="importRep('reissue','direct')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
18
+						</view>	
19
+					</view>
20
+					<uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
15 21
         </view>
16 22
         <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
17 23
           <view class="title"><text class="required newicon newicon-bitian"></text>故障现象:</view>
@@ -83,7 +89,13 @@
83 89
       <!-- 补单-下一步 -->
84 90
       <template v-if="dataInfo.tabActiveValue === 'supplement' && !dataInfo.supplementFlag">
85 91
         <view class="form_item column" v-if="dataInfo.category.hasSimple != 1">
86
-          <view class="title"><text class="required newicon newicon-bitian"></text>解决方案:</view>
92
+					<view class="title title-width">
93
+						<text class="required newicon newicon-bitian"></text>
94
+						<view class="title-fl-sb">
95
+							解决方案:
96
+							<view @click="importRep('reissue','reissue')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
97
+						</view>	
98
+					</view>
87 99
           <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
88 100
         </view>
89 101
         <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
@@ -206,6 +218,9 @@
206 218
   // 主题颜色
207 219
   const primaryColor = ref(defaultColor)
208 220
   
221
+	// 知识库id
222
+	const solutionId = ref(null)
223
+	
209 224
   // 数据
210 225
   const dataInfo = reactive({
211 226
     tabs: [
@@ -248,6 +263,7 @@
248 263
     responseHandleTime: undefined,//补单-接单时间
249 264
     handleTime: undefined,//补单-解决时间
250 265
     handlingPersonnelUserId: undefined,//补单-处理人
266
+		introduceCount :0 //引入次数
251 267
   })
252 268
   
253 269
   // 是否提交
@@ -492,6 +508,8 @@
492 508
     dataInfo.selectData = {};//选择的对象
493 509
     dataInfo.selectType = {};//选择的对象类型
494 510
     dataInfo.handleDescription = '';//解决方案
511
+		solutionId.value = null;//引用知识库id
512
+		dataInfo.introduceCount = 0;//引用知识库次数
495 513
     dataInfo.handleCategory = undefined;//处理方式
496 514
     dataInfo.handleCategoryList = [];//处理方式列表
497 515
     dataInfo.closecode = undefined;//处理结果
@@ -737,8 +755,8 @@
737 755
   async function handlerOrder(){
738 756
     let postData = {
739 757
       incident: dataInfo.incidentData,
758
+			solutionId: solutionId.value
740 759
     }
741
-    
742 760
     let result = await beforeBuild();
743 761
     if(result[0].status == 200 && result[1].status == 200){
744 762
       postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
@@ -757,7 +775,6 @@
757 775
     postData.incident.category = dataInfo.category;
758 776
     postData.incident.synergetic = dataInfo.synergetic;
759 777
     postData.incident.directProcess = 1;//直接解决
760
-    
761 778
     return api_incidentTask('accept', postData);
762 779
   }
763 780
   
@@ -765,6 +782,7 @@
765 782
   async function supplementOrder(){
766 783
     let postData = {
767 784
       incident: dataInfo.incidentData,
785
+			solutionId: solutionId.value
768 786
     }
769 787
     
770 788
     let result = await beforeBuild();
@@ -848,6 +866,15 @@
848 866
     return uploadFile(imgObj, 'wechatRequesterIncident', dataInfo.incidentId)
849 867
   }
850 868
   
869
+	// 引入知识库
870
+	function importRep(type,tabType){
871
+		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
872
+		uni.navigateTo({
873
+		  url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}
874
+			&operateType=${type}&tabType=${tabType}`
875
+		})
876
+	}
877
+	
851 878
   // 处理提交
852 879
   function submitHandler(){
853 880
     console.log(dataInfo);
@@ -1171,6 +1198,13 @@
1171 1198
     }
1172 1199
   }
1173 1200
   
1201
+	// 获取文本内容
1202
+	function getHtml(html) {
1203
+	  const tempDiv = document.createElement('div');
1204
+	  tempDiv.innerHTML = html;
1205
+	  return tempDiv.textContent || tempDiv.innerText || '';
1206
+	}
1207
+	
1174 1208
   onLoad((option) => {
1175 1209
     menuAuthHandle()
1176 1210
     // 跳转页面选择了选项
@@ -1244,6 +1278,21 @@
1244 1278
     if(!dataInfo.tabActiveValue){
1245 1279
       dataInfo.tabActiveValue = dataInfo.tabs[0].value;
1246 1280
     }
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
+		}
1247 1296
     initForm()
1248 1297
   })
1249 1298
 </script>
@@ -1374,9 +1423,24 @@
1374 1423
         height: auto;
1375 1424
         flex-direction: column;
1376 1425
         align-items: flex-start;
1426
+				.import-rep{
1427
+					padding: 5rpx 10rpx;
1428
+					border-radius: 50rpx;
1429
+					background: #d1fcd5;
1430
+					color: #49b856;
1431
+					font-size: 24rpx;
1432
+				}
1377 1433
         .title{
1378 1434
           margin-right: 0;
1379 1435
         }
1436
+				.title-width{
1437
+					width: 100%;
1438
+				}
1439
+				.title-fl-sb{
1440
+					display: flex;
1441
+					justify-content: space-between;
1442
+					width: 100%;
1443
+				}
1380 1444
         .value{
1381 1445
           margin-top: 10rpx;
1382 1446
           padding-left: 20rpx;

+ 1 - 1
pages/handler/handler.vue

@@ -218,7 +218,7 @@
218 218
     category: {},//故障现象
219 219
     synergetic: [],//协同人员
220 220
     isSummaryNext: false,//汇总单-下一步
221
-		introduceCount :0
221
+		introduceCount :0 //引入次数
222 222
   })
223 223
   
224 224
 	// 知识库id

+ 9 - 3
pages/repository/repository.vue

@@ -36,6 +36,9 @@
36 36
 	// 操作类型
37 37
 	const operateType = ref(null)
38 38
 	
39
+	// tab类型
40
+	const tabType = ref(null)
41
+	
39 42
   // 数据
40 43
   const dataInfo = reactive({
41 44
     list: [],//工单列表
@@ -48,7 +51,8 @@
48 51
   function toCategoryTwo(data){
49 52
     uni.navigateTo({
50 53
       url: `/pages/repositoryDetails/repositoryDetails?incidentId=${dataInfo.incidentId}
51
-			&solutionnumber=${data.solutionnumber}&operateType=${operateType.value}`
54
+			&solutionnumber=${data.solutionnumber}&operateType=${operateType.value}
55
+			&tabType=${tabType.value}`
52 56
     })
53 57
   }
54 58
 	
@@ -58,12 +62,13 @@
58 62
 		if(operateType.value=='malfunction'){ //故障处理
59 63
 			url = '/pages/handler/handler'
60 64
 		}else if(operateType.value=='reissue'){ //补单
61
-			url = '/pages/handler/handler'
65
+			url = '/pages/assign/assign'
62 66
 		}
63 67
 		uni.navigateTo({
64 68
 		  url: `${url}?incidentId=${encodeURIComponent(JSON.stringify(dataInfo.incidentId))}
65 69
 			&handleDescription=${encodeURIComponent(data.content)}&solutionId=${encodeURIComponent(JSON.stringify(data.id))}&isSummaryNext=1&type=${encodeURIComponent('rep')}
66
-			&introduceCount=${encodeURIComponent(data.introduceCount)}`
70
+			&introduceCount=${encodeURIComponent(data.introduceCount)}
71
+			&tabType=${encodeURIComponent(tabType.value)}`
67 72
 		})
68 73
 	}
69 74
 	
@@ -117,6 +122,7 @@
117 122
   onLoad((option) => {
118 123
     dataInfo.incidentId = option.incidentId;
119 124
 		operateType.value = option.operateType;
125
+		tabType.value = option.tabType
120 126
     getList(0);
121 127
   })
122 128
   

+ 9 - 3
pages/repositoryDetails/repositoryDetails.vue

@@ -32,6 +32,9 @@
32 32
 	// 操作类型
33 33
 	const operateType = ref(null)
34 34
 	
35
+	// tab类型
36
+	const tabType = ref(null)
37
+	
35 38
   // 数据
36 39
   const dataInfo = reactive({
37 40
     data: [],//数据
@@ -94,12 +97,14 @@
94 97
 		if(operateType.value=='malfunction'){ //故障处理
95 98
 			url = '/pages/handler/handler'
96 99
 		}else if(operateType.value=='reissue'){ //补单
97
-			url = '/pages/handler/handler'
100
+			url = '/pages/assign/assign'
98 101
 		}
99 102
 		uni.navigateTo({
100 103
 		  url: `${url}?incidentId=${encodeURIComponent(JSON.stringify(dataInfo.incidentId))}
101 104
 			&handleDescription=${encodeURIComponent(dataInfo.data.content)}&solutionId=${encodeURIComponent(JSON.stringify(dataInfo.data.id))}
102
-			&isSummaryNext=1&type=${encodeURIComponent('rep')}&introduceCount=${encodeURIComponent(dataInfo.data.introduceCount)}`
105
+			&isSummaryNext=1&type=${encodeURIComponent('rep')}
106
+			&introduceCount=${encodeURIComponent(dataInfo.data.introduceCount)}
107
+			&tabType=${encodeURIComponent(tabType.value)}`
103 108
 		})
104 109
 	}
105 110
 	
@@ -148,8 +153,9 @@
148 153
   
149 154
   onLoad((option) => {
150 155
     dataInfo.incidentId = option.incidentId;
151
-		dataInfo.solutionnumber = option.solutionnumber 
156
+		dataInfo.solutionnumber = option.solutionnumber ;
152 157
 		operateType.value = option.operateType;
158
+		tabType.value = option.tabType;
153 159
     getList();
154 160
   })
155 161