|
|
@@ -52,12 +52,26 @@
|
|
52
|
52
|
props: {
|
|
53
|
53
|
clueId: {
|
|
54
|
54
|
required: true
|
|
|
55
|
+ },
|
|
|
56
|
+ orderId: {
|
|
|
57
|
+ type: String | Number,
|
|
|
58
|
+ required: false
|
|
|
59
|
+ },
|
|
|
60
|
+ type: {
|
|
|
61
|
+ type: String,
|
|
|
62
|
+ required: true
|
|
|
63
|
+ // '1' : 线索跟进
|
|
|
64
|
+ // '2' : 订单跟进(通过orderId)
|
|
|
65
|
+ // '3' : 订单跟进(通过clueId)
|
|
|
66
|
+ // '4' : 重复线索跟进
|
|
|
67
|
+ // 其他 : 重复订单跟进
|
|
55
|
68
|
}
|
|
56
|
69
|
},
|
|
57
|
70
|
data() {
|
|
58
|
71
|
return {
|
|
59
|
72
|
list: [0, 1],
|
|
60
|
73
|
dataList: {},
|
|
|
74
|
+ loading: false,
|
|
61
|
75
|
|
|
62
|
76
|
showModal: false,
|
|
63
|
77
|
currentDeleteFollowId : undefined
|
|
|
@@ -71,18 +85,60 @@
|
|
71
|
85
|
},
|
|
72
|
86
|
isEmpty,
|
|
73
|
87
|
async getData() {
|
|
74
|
|
- const {
|
|
75
|
|
- data
|
|
76
|
|
- } = await uni.$u.api.getClueFollowList({
|
|
77
|
|
- clueId: this.clueId
|
|
78
|
|
- });
|
|
79
|
|
- this.dataList = data;
|
|
|
88
|
+ this.loading = true;
|
|
|
89
|
+ let data;
|
|
|
90
|
+
|
|
|
91
|
+ // 根据type类型调用不同接口
|
|
|
92
|
+ if (this.type === '1') {
|
|
|
93
|
+ // 线索跟进
|
|
|
94
|
+ data = await uni.$u.api.getClueFollowList({
|
|
|
95
|
+ clueId: this.clueId
|
|
|
96
|
+ });
|
|
|
97
|
+ } else if (this.type === '2') {
|
|
|
98
|
+ // 订单跟进(通过orderId)
|
|
|
99
|
+ data = await uni.$u.api.getOrderFollowList({
|
|
|
100
|
+ orderId: this.orderId
|
|
|
101
|
+ });
|
|
|
102
|
+ } else if (this.type === '3') {
|
|
|
103
|
+ // 订单跟进(通过clueId)
|
|
|
104
|
+ data = await uni.$u.api.getOrderFollowListByClueId({
|
|
|
105
|
+ clueId: this.clueId
|
|
|
106
|
+ });
|
|
|
107
|
+ } else if (this.type === '4') {
|
|
|
108
|
+ // 重复线索跟进
|
|
|
109
|
+ data = await uni.$u.api.getDuplicateClueFollowByClueId({
|
|
|
110
|
+ clueId: this.clueId
|
|
|
111
|
+ });
|
|
|
112
|
+ } else {
|
|
|
113
|
+ // 重复订单跟进
|
|
|
114
|
+ data = await uni.$u.api.getDuplicateOrderFollowListByClueId({
|
|
|
115
|
+ clueId: this.clueId
|
|
|
116
|
+ });
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+ this.dataList = data.data;
|
|
|
120
|
+ this.loading = false;
|
|
80
|
121
|
},
|
|
81
|
122
|
async confirm() {
|
|
82
|
|
- await uni.$u.api.deleteClueFollow([this.currentDeleteFollowId]);
|
|
83
|
|
- uni.$u.toast("删除成功");
|
|
84
|
|
- this.getData();
|
|
85
|
|
- this.showModal = false;
|
|
|
123
|
+ try {
|
|
|
124
|
+ // 根据type类型调用不同删除接口
|
|
|
125
|
+ if (this.type === '1' || this.type === '4') {
|
|
|
126
|
+ // 线索跟进和重复线索跟进使用deleteClueFollow
|
|
|
127
|
+ await uni.$u.api.deleteClueFollow([this.currentDeleteFollowId]);
|
|
|
128
|
+ } else {
|
|
|
129
|
+ // 订单跟进(通过orderId)、订单跟进(通过clueId)、重复订单跟进使用deleteOrderFollow
|
|
|
130
|
+ await uni.$u.api.deleteOrderFollow([this.currentDeleteFollowId]);
|
|
|
131
|
+ }
|
|
|
132
|
+
|
|
|
133
|
+ uni.$u.toast("删除成功");
|
|
|
134
|
+ this.getData();
|
|
|
135
|
+ } catch (error) {
|
|
|
136
|
+ console.error('删除跟进记录失败:', error);
|
|
|
137
|
+ uni.$u.toast("删除失败");
|
|
|
138
|
+ } finally {
|
|
|
139
|
+ this.showModal = false;
|
|
|
140
|
+ this.currentDeleteFollowId = undefined;
|
|
|
141
|
+ }
|
|
86
|
142
|
},
|
|
87
|
143
|
},
|
|
88
|
144
|
mounted() {
|