|
|
@@ -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>
|