|
|
@@ -13,6 +13,10 @@ export default {
|
|
13
|
13
|
pageNum: 1,
|
|
14
|
14
|
total: 0
|
|
15
|
15
|
},
|
|
|
16
|
+ tagModalVisible: false,
|
|
|
17
|
+ tagList: [],
|
|
|
18
|
+ currentTags: [],
|
|
|
19
|
+ currentOrder: {}
|
|
16
|
20
|
}
|
|
17
|
21
|
},
|
|
18
|
22
|
onLoad() {
|
|
|
@@ -55,9 +59,20 @@ export default {
|
|
55
|
59
|
//去接单
|
|
56
|
60
|
console.log('去接单', order)
|
|
57
|
61
|
|
|
58
|
|
- //跳转接单form
|
|
59
|
|
- uni.navigateTo({
|
|
60
|
|
- url: `/pages/orderDetailNew/index?orderId=${order.id}&item=${order.item}&type=${this.type}&clueId=${order.clueId}`,
|
|
|
62
|
+ //打开模态窗二次确认,确认后跳转接单form
|
|
|
63
|
+ uni.showModal({
|
|
|
64
|
+ title: '确认接单',
|
|
|
65
|
+ content: `是否确认接单订单:${order.item}?`,
|
|
|
66
|
+ success: (res) => {
|
|
|
67
|
+ if (res.confirm) {
|
|
|
68
|
+ uni.navigateTo({
|
|
|
69
|
+ url: `/pages/orderDetailNew/index?orderId=${order.id}&item=${order.item}&type=${this.type}&clueId=${order.clueId}`,
|
|
|
70
|
+ })
|
|
|
71
|
+ } else if (res.cancel) {
|
|
|
72
|
+ // 用户点击了取消,不执行任何操作
|
|
|
73
|
+ uni.$u.toast('已取消接单');
|
|
|
74
|
+ }
|
|
|
75
|
+ }
|
|
61
|
76
|
})
|
|
62
|
77
|
} else if (btnType == 'isBusy') {
|
|
63
|
78
|
//在忙
|
|
|
@@ -74,6 +89,11 @@ export default {
|
|
74
|
89
|
} else if (btnType == 'tag') {
|
|
75
|
90
|
//打标签
|
|
76
|
91
|
console.log('打标签', order)
|
|
|
92
|
+ //打开模态窗
|
|
|
93
|
+ this.tagModalVisible = true;
|
|
|
94
|
+ this.getAllTags();
|
|
|
95
|
+ this.currentTags = order.tags.map(tag => tag.id);
|
|
|
96
|
+ this.currentOrder = order
|
|
77
|
97
|
} else if (btnType == 'share') {
|
|
78
|
98
|
//一键分享
|
|
79
|
99
|
console.log('一键分享', order)
|
|
|
@@ -84,11 +104,19 @@ export default {
|
|
84
|
104
|
},
|
|
85
|
105
|
// 跳转订单详情
|
|
86
|
106
|
toOrderDetail(order) {
|
|
|
107
|
+ //点卡片看详情
|
|
|
108
|
+ // if (order.status == '1' || order.status == '2') {
|
|
87
|
109
|
uni.navigateTo({
|
|
88
|
110
|
url: `/pages/orderDetailNew/index?orderId=${order.id}&item=${order.item}&type=${this.type}&clueId=${order.clueId}`,
|
|
89
|
111
|
})
|
|
|
112
|
+ // } else {
|
|
|
113
|
+ // uni.$u.toast('当前订单无法查看详情');
|
|
|
114
|
+ // return;
|
|
|
115
|
+ // }
|
|
|
116
|
+
|
|
|
117
|
+
|
|
90
|
118
|
},
|
|
91
|
|
-
|
|
|
119
|
+
|
|
92
|
120
|
//滑动加载
|
|
93
|
121
|
scrolltolower() {
|
|
94
|
122
|
console.log('到底了');
|
|
|
@@ -99,6 +127,26 @@ export default {
|
|
99
|
127
|
this.getOrderList();
|
|
100
|
128
|
},
|
|
101
|
129
|
|
|
|
130
|
+ //获取全部标签
|
|
|
131
|
+ async getAllTags() {
|
|
|
132
|
+ const res = await uni.$u.api.getClueTagGroupVoList({ tagGroupApplication: '2' })
|
|
|
133
|
+ console.log('全部标签', res.data[0].clueTagDataList)
|
|
|
134
|
+ this.tagList = res.data[0].clueTagDataList;
|
|
|
135
|
+ },
|
|
|
136
|
+ cancelTag() {
|
|
|
137
|
+ this.tagModalVisible = false;
|
|
|
138
|
+ },
|
|
|
139
|
+ async confirmTag() {
|
|
|
140
|
+ console.log('确认打标签', this.currentTags)
|
|
|
141
|
+ // 这里可以添加打标签的逻辑
|
|
|
142
|
+ const allTags = this.currentTags.map(tag => tag).join(',');
|
|
|
143
|
+ console.log('allTags', allTags)
|
|
|
144
|
+ await uni.$u.api.updateTags({
|
|
|
145
|
+ id: this.currentOrder.id,
|
|
|
146
|
+ allTags: allTags,
|
|
|
147
|
+ })
|
|
|
148
|
+ this.tagModalVisible = false;
|
|
|
149
|
+ },
|
|
102
|
150
|
}
|
|
103
|
151
|
}
|
|
104
|
152
|
</script>
|
|
|
@@ -113,7 +161,8 @@ export default {
|
|
113
|
161
|
<!-- <orderCard v-for="item in orderList" :key="item.receiptId + item.id" :order="item"
|
|
114
|
162
|
@handleBtnClick="handleBtnClick">
|
|
115
|
163
|
</orderCard> -->
|
|
116
|
|
- <view class="orderCard" v-for="item in orderList" :key="item.receiptId + item.id" @click.stop="toOrderDetail(item)">
|
|
|
164
|
+ <view class="orderCard" v-for="item in orderList" :key="item.receiptId + item.id"
|
|
|
165
|
+ @click.stop="toOrderDetail(item)">
|
|
117
|
166
|
<view class="bandAndPrice">
|
|
118
|
167
|
<view class="bandName">{{ item.itemBrand || '暂无品牌' }}</view>
|
|
119
|
168
|
<view class="price">¥{{ item.priceRange }}</view>
|
|
|
@@ -147,7 +196,8 @@ export default {
|
|
147
|
196
|
|
|
148
|
197
|
<view class="btnGroup"
|
|
149
|
198
|
v-if="item && (item.status == '2' || item.status == null || item.status === undefined)">
|
|
150
|
|
- <view class="card-button willFollow" @click.stop="handleBtnClick('willFollow', item)">待跟进
|
|
|
199
|
+ <view class="card-button willFollow" @click.stop="handleBtnClick('willFollow', item)">
|
|
|
200
|
+ 待跟进
|
|
151
|
201
|
</view>
|
|
152
|
202
|
<view class="card-button isBusy" @click.stop="handleBtnClick('tag', item)">打标签</view>
|
|
153
|
203
|
</view>
|
|
|
@@ -175,7 +225,16 @@ export default {
|
|
175
|
225
|
|
|
176
|
226
|
|
|
177
|
227
|
|
|
178
|
|
-
|
|
|
228
|
+ <!-- 打标签模态窗 -->
|
|
|
229
|
+ <u-modal :show="tagModalVisible" title="选择标签" @confirm="confirmTag" @cancel="cancelTag">
|
|
|
230
|
+ <view class="slot-content">
|
|
|
231
|
+ <u-checkbox-group v-model="currentTags" placement="column">
|
|
|
232
|
+ <u-checkbox :customStyle="{ marginBottom: '8px' }" v-for="(item, index) in tagList" :key="item.id"
|
|
|
233
|
+ :label="item.name" :name="item.id">
|
|
|
234
|
+ </u-checkbox>
|
|
|
235
|
+ </u-checkbox-group>
|
|
|
236
|
+ </view>
|
|
|
237
|
+ </u-modal>
|
|
179
|
238
|
</view>
|
|
180
|
239
|
</template>
|
|
181
|
240
|
|