chenyidong месяцев назад: 3
Родитель
Сommit
8e1df276f7

+ 28 - 4
pages/addFollow/index.vue

@@ -31,17 +31,33 @@
31 31
 				},
32 32
 				form: {
33 33
 					clueId : undefined,
34
-					content: ''
34
+					orderId: undefined,
35
+					content: '',
36
+					type: 'clue' // 标识当前模式:clue 或 order
35 37
 				},
36 38
 			}
37 39
 		},
38 40
 		methods: {
39 41
 			handleNavSaveClick() {
40 42
 				this.$refs.form.validate().then(async () => {
41
-					await uni.$u.api.addClueFollow(this.form);
43
+					if (this.form.type === 'order') {
44
+						// 订单跟进,调用 addOrderFollow 接口
45
+						const orderFormData = {
46
+							orderId: this.form.orderId,
47
+							content: this.form.content
48
+						};
49
+						await uni.$u.api.addOrderFollow(orderFormData);
50
+					} else {
51
+						// 线索跟进,调用 addClueFollow 接口
52
+						const clueFormData = {
53
+							clueId: this.form.clueId,
54
+							content: this.form.content
55
+						};
56
+						await uni.$u.api.addClueFollow(clueFormData);
57
+					}
42 58
 					uni.$u.toast("保存成功");
43 59
 					this.timer = setTimeout(()=>{
44
-						uni.$emit('addFollowSuccess');
60
+						uni.$emit('addFollowSuccess', this.form.type);
45 61
 						uni.navigateBack();
46 62
 						clearTimeout(this.timer);
47 63
 					},1000)
@@ -49,7 +65,15 @@
49 65
 			},
50 66
 		},
51 67
 		onLoad(option) {
52
-			this.form.clueId = option.clueId;
68
+			if (option.orderId) {
69
+				// 订单跟进模式
70
+				this.form.orderId = option.orderId;
71
+				this.form.type = 'order';
72
+			} else if (option.clueId) {
73
+				// 线索跟进模式
74
+				this.form.clueId = option.clueId;
75
+				this.form.type = 'clue';
76
+			}
53 77
 		}
54 78
 	}
55 79
 </script>

+ 1 - 1
pages/clueDetail/page/clueDetail.vue

@@ -332,7 +332,7 @@
332 332
 					})
333 333
 				}
334 334
 			},
335
-			// 添加催记
335
+			// 添加跟进记录
336 336
 			handleAddFollow() {
337 337
 				uni.navigateTo({
338 338
 					url: `/pages/addFollow/index?clueId=${this.clueId}`

+ 7 - 2
pages/orderDetail/page/detail.vue

@@ -219,6 +219,11 @@
219 219
         icon="../../static/orderDetail/cx.png"
220 220
         @click="handleDelete"
221 221
       ></u-tabbar-item>
222
+      <u-tabbar-item
223
+        text="添加跟进"
224
+        icon="../../static/caseDetail/icon-follow.png"
225
+        @click="handleAddFollow"
226
+      ></u-tabbar-item>
222 227
     </u-tabbar>
223 228
 
224 229
     <group-select
@@ -392,10 +397,10 @@ export default {
392 397
         },
393 398
       });
394 399
     },
395
-    // 添加催记
400
+    // 添加跟进记录
396 401
     handleAddFollow() {
397 402
       uni.navigateTo({
398
-        url: `/pages/addFollow/index?clueId=${this.orderId}`,
403
+        url: `/pages/addFollow/index?orderId=${this.orderId}`,
399 404
       });
400 405
     },
401 406
     handleUploadRecord() {