Преглед изворни кода

接种中心可添加跟进

chenyidong пре 3 месеци
родитељ
комит
8e1df276f7
3 измењених фајлова са 36 додато и 7 уклоњено
  1. 28 4
      pages/addFollow/index.vue
  2. 1 1
      pages/clueDetail/page/clueDetail.vue
  3. 7 2
      pages/orderDetail/page/detail.vue

+ 28 - 4
pages/addFollow/index.vue

@@ -31,17 +31,33 @@
31
 				},
31
 				},
32
 				form: {
32
 				form: {
33
 					clueId : undefined,
33
 					clueId : undefined,
34
-					content: ''
34
+					orderId: undefined,
35
+					content: '',
36
+					type: 'clue' // 标识当前模式:clue 或 order
35
 				},
37
 				},
36
 			}
38
 			}
37
 		},
39
 		},
38
 		methods: {
40
 		methods: {
39
 			handleNavSaveClick() {
41
 			handleNavSaveClick() {
40
 				this.$refs.form.validate().then(async () => {
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
 					uni.$u.toast("保存成功");
58
 					uni.$u.toast("保存成功");
43
 					this.timer = setTimeout(()=>{
59
 					this.timer = setTimeout(()=>{
44
-						uni.$emit('addFollowSuccess');
60
+						uni.$emit('addFollowSuccess', this.form.type);
45
 						uni.navigateBack();
61
 						uni.navigateBack();
46
 						clearTimeout(this.timer);
62
 						clearTimeout(this.timer);
47
 					},1000)
63
 					},1000)
@@ -49,7 +65,15 @@
49
 			},
65
 			},
50
 		},
66
 		},
51
 		onLoad(option) {
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
 </script>
79
 </script>

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

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

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

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