瀏覽代碼

接单的中心和我的分成的post拆分成独立的组件

chenyidong 3 月之前
父節點
當前提交
4c20f5a6a3

+ 166 - 0
pages/order/components/commission/commissionItem.vue

@@ -0,0 +1,166 @@
1
+<template>
2
+	<view class="commission_item">
3
+		<view class="commission_top">
4
+			<view class="top_left">{{item.item}}</view>
5
+			<view class="top_right">
6
+				<text class="account_type">{{ item.accountType === '1' ? '前端' : '后端' }}</text>
7
+			</view>
8
+		</view>
9
+		<view class="commission_info">
10
+			<view class="info_row">
11
+				<view class="info_item">
12
+					<text class="label">电话: </text>
13
+					<show-real-text :real="item.phone" :type='type'></show-real-text>
14
+				</view>
15
+			</view>
16
+			<view class="info_row">
17
+				<view class="info_item">
18
+					<text class="label">收单时间: </text>
19
+					<text class="value">{{item.receiptDate || '-'}}</text>
20
+				</view>
21
+			</view>
22
+			<view class="info_row">
23
+				<view class="info_item">
24
+					<text class="label">收单人: </text>
25
+					<text class="value">{{item.receiptNickName || '-'}}</text>
26
+				</view>
27
+				<view class="info_item">
28
+					<text class="label">公司: </text>
29
+					<text class="value">{{item.orgName || '-'}}</text>
30
+				</view>
31
+			</view>
32
+			<view class="info_row">
33
+				<view class="info_item">
34
+					<text class="label">分成所属人: </text>
35
+					<text class="value">{{item.userName || '-'}}</text>
36
+				</view>
37
+				<view class="info_item">
38
+					<text class="label">分成比例: </text>
39
+					<text class="value">{{item.commissionRate || '-'}}%</text>
40
+				</view>
41
+			</view>
42
+		</view>
43
+		<view class="commission_amount">
44
+			<view class="amount_item">
45
+				<view class="amount_label">业绩</view>
46
+				<view class="amount_value primary">{{formatAmount(item.commissionAmount)}}</view>
47
+			</view>
48
+			<view class="amount_item">
49
+				<view class="amount_label">毛业绩</view>
50
+				<view class="amount_value">{{formatAmount(item.grossAmount)}}</view>
51
+			</view>
52
+		</view>
53
+	</view>
54
+</template>
55
+
56
+<script>
57
+export default {
58
+	props: {
59
+		item: {
60
+			type: Object,
61
+			required: true
62
+		},
63
+		type: {
64
+			type: String,
65
+			default: '2'
66
+		}
67
+	},
68
+	methods: {
69
+		formatAmount(amount) {
70
+			if (!amount) return '-';
71
+			return parseFloat(amount).toLocaleString();
72
+		}
73
+	}
74
+}
75
+</script>
76
+
77
+<style lang="scss" scoped>
78
+	.commission_item {
79
+		background: #fff;
80
+		border-radius: 20px;
81
+		padding: 20px;
82
+		margin-bottom: 20px;
83
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
84
+
85
+		.commission_top {
86
+			display: flex;
87
+			justify-content: space-between;
88
+			margin-bottom: 15px;
89
+
90
+			.top_left {
91
+				font-size: 18px;
92
+				font-weight: bold;
93
+				color: #202020;
94
+			}
95
+
96
+			.top_right {
97
+				.account_type {
98
+					background: #108cff;
99
+					color: #fff;
100
+					padding: 4px 8px;
101
+					border-radius: 10px;
102
+					font-size: 12px;
103
+				}
104
+			}
105
+		}
106
+
107
+		.commission_info {
108
+			margin-bottom: 15px;
109
+
110
+			.info_row {
111
+				display: flex;
112
+				margin-bottom: 8px;
113
+
114
+				&:last-child {
115
+					margin-bottom: 0;
116
+				}
117
+
118
+				.info_item {
119
+					flex: 1;
120
+					display: flex;
121
+					align-items: center;
122
+					font-size: 14px;
123
+
124
+					.label {
125
+						color: #9b9aa2;
126
+						margin-right: 8px;
127
+						min-width: 60px;
128
+					}
129
+
130
+					.value {
131
+						color: #202020;
132
+					}
133
+				}
134
+			}
135
+		}
136
+
137
+		.commission_amount {
138
+			display: flex;
139
+			justify-content: space-around;
140
+			padding: 15px 0;
141
+			border-top: 1px solid #f0f0f0;
142
+			background: #f8f9fb;
143
+			border-radius: 10px;
144
+
145
+			.amount_item {
146
+				text-align: center;
147
+
148
+				.amount_label {
149
+					font-size: 12px;
150
+					color: #9b9aa2;
151
+					margin-bottom: 5px;
152
+				}
153
+
154
+				.amount_value {
155
+					font-size: 16px;
156
+					font-weight: bold;
157
+					color: #202020;
158
+
159
+					&.primary {
160
+						color: #108cff;
161
+					}
162
+				}
163
+			}
164
+		}
165
+	}
166
+</style>

+ 3 - 145
pages/order/components/commission/myCommission.vue

@@ -13,58 +13,7 @@
13 13
 
14 14
 		<view class="commission_item_wrap">
15 15
 			<!-- 统计信息 -->
16
-			<view class="commission_item" v-for="item in listData" :key="item.id">
17
-				<view class="commission_top">
18
-					<view class="top_left">{{item.item}}</view>
19
-					<view class="top_right">
20
-						<text class="account_type">{{ item.accountType === '1' ? '前端' : '后端' }}</text>
21
-					</view>
22
-				</view>
23
-				<view class="commission_info">
24
-					<view class="info_row">
25
-						<view class="info_item">
26
-							<text class="label">电话: </text>
27
-							<show-real-text :real="item.phone" :type='type'></show-real-text>
28
-						</view>
29
-					</view>
30
-					<view class="info_row">
31
-						<view class="info_item">
32
-							<text class="label">收单时间: </text>
33
-							<text class="value">{{item.receiptDate || '-'}}</text>
34
-						</view>
35
-					</view>
36
-					<view class="info_row">
37
-						<view class="info_item">
38
-							<text class="label">收单人: </text>
39
-							<text class="value">{{item.receiptNickName || '-'}}</text>
40
-						</view>
41
-						<view class="info_item">
42
-							<text class="label">公司: </text>
43
-							<text class="value">{{item.orgName || '-'}}</text>
44
-						</view>
45
-					</view>
46
-					<view class="info_row">
47
-						<view class="info_item">
48
-							<text class="label">分成所属人: </text>
49
-							<text class="value">{{item.userName || '-'}}</text>
50
-						</view>
51
-						<view class="info_item">
52
-							<text class="label">分成比例: </text>
53
-							<text class="value">{{item.commissionRate || '-'}}%</text>
54
-						</view>
55
-					</view>
56
-				</view>
57
-				<view class="commission_amount">
58
-					<view class="amount_item">
59
-						<view class="amount_label">业绩</view>
60
-						<view class="amount_value primary">{{formatAmount(item.commissionAmount)}}</view>
61
-					</view>
62
-					<view class="amount_item">
63
-						<view class="amount_label">毛业绩</view>
64
-						<view class="amount_value">{{formatAmount(item.grossAmount)}}</view>
65
-					</view>
66
-				</view>
67
-			</view>
16
+			<commission-item v-for="item in listData" :key="item.id" :item="item" :type="type"></commission-item>
68 17
 		</view>
69 18
 
70 19
 		<filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"></filter-query>
@@ -79,11 +28,13 @@
79 28
 <script>
80 29
 	import pullUpRefresh from "@/utils/pullUpRefresh";
81 30
 	import filterQuery from "./filterQuery.vue";
31
+	import commissionItem from "./commissionItem.vue";
82 32
 	import dayjs from "dayjs";
83 33
 	export default {
84 34
 		mixins: [pullUpRefresh],
85 35
 		components: {
86 36
 			filterQuery,
37
+			commissionItem
87 38
 		},
88 39
 		props: {
89 40
 			type: {
@@ -122,10 +73,6 @@
122 73
 			handleshowFilter() {
123 74
 				this.$refs.filter.show();
124 75
 			},
125
-			formatAmount(amount) {
126
-				if (!amount) return '-';
127
-				return parseFloat(amount).toLocaleString();
128
-			},
129 76
 			async getList() {
130 77
 				const {
131 78
 					pageNum,
@@ -230,95 +177,6 @@
230 177
 		padding: 20px 20px;
231 178
 	}
232 179
 
233
-	.commission_item {
234
-		background: #fff;
235
-		border-radius: 20px;
236
-		padding: 20px;
237
-		margin-bottom: 20px;
238
-		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
239
-
240
-		.commission_top {
241
-			display: flex;
242
-			justify-content: space-between;
243
-			margin-bottom: 15px;
244
-
245
-			.top_left {
246
-				font-size: 18px;
247
-				font-weight: bold;
248
-				color: #202020;
249
-			}
250
-
251
-			.top_right {
252
-				.account_type {
253
-					background: #108cff;
254
-					color: #fff;
255
-					padding: 4px 8px;
256
-					border-radius: 10px;
257
-					font-size: 12px;
258
-				}
259
-			}
260
-		}
261
-
262
-		.commission_info {
263
-			margin-bottom: 15px;
264
-
265
-			.info_row {
266
-				display: flex;
267
-				margin-bottom: 8px;
268
-
269
-				&:last-child {
270
-					margin-bottom: 0;
271
-				}
272
-
273
-				.info_item {
274
-					flex: 1;
275
-					display: flex;
276
-					align-items: center;
277
-					font-size: 14px;
278
-
279
-					.label {
280
-						color: #9b9aa2;
281
-						margin-right: 8px;
282
-						min-width: 60px;
283
-					}
284
-
285
-					.value {
286
-						color: #202020;
287
-					}
288
-				}
289
-			}
290
-		}
291
-
292
-		.commission_amount {
293
-			display: flex;
294
-			justify-content: space-around;
295
-			padding: 15px 0;
296
-			border-top: 1px solid #f0f0f0;
297
-			background: #f8f9fb;
298
-			border-radius: 10px;
299
-
300
-			.amount_item {
301
-				text-align: center;
302
-
303
-				.amount_label {
304
-					font-size: 12px;
305
-					color: #9b9aa2;
306
-					margin-bottom: 5px;
307
-				}
308
-
309
-				.amount_value {
310
-					font-size: 16px;
311
-					font-weight: bold;
312
-					color: #202020;
313
-
314
-					&.primary {
315
-						color: #108cff;
316
-					}
317
-				}
318
-			}
319
-		}
320
-	}
321
-
322 180
 	.empty_wrap {
323 181
 		margin-top: 100px;
324 182
 	}

+ 3 - 174
pages/order/components/orderCenter/orderCenter.vue

@@ -14,54 +14,7 @@
14 14
 
15 15
 
16 16
 		<view class="order_item_wrap">
17
-			<view class="order_item" v-for="item in listData" :key="item.id" @click="handleToDetail(item)">
18
-				<view class="order_top">
19
-					<view class="top_left">{{item.item}}</view>
20
-					<view class="top_right">
21
-						<text :class="getStatusClass(item.status)">{{getStatusText(item.status)}}</text>
22
-					</view>
23
-				</view>
24
-				<view class="order_info">
25
-					<view class="telPhone">
26
-						<view class="phone">
27
-							<text>电话: </text>
28
-							<show-real-text :real="item.phone" :type='type'
29
-								:style="{ color : item.repetitionOperationName ? 'red' : 'black' }"></show-real-text>
30
-						</view>
31
-						<view class="copy_btn" @click.stop="handleCopy(item)" v-if="type != '1'">复制</view>
32
-					</view>
33
-					<view class="info">
34
-						<view class="createUser" style="margin-right: 20px;">发单人:
35
-							{{ item.createNickName ? item.createNickName : "-" }}
36
-						</view>
37
-						<view class="orgName">机构: {{ item.orgName ? item.orgName : "-" }}</view>
38
-					</view>
39
-					<view class="info">
40
-						<view class="sendDate" style="margin-right: 20px;">发单日期:
41
-							{{ item.sendDate ? item.sendDate : "-" }}
42
-						</view>
43
-					</view>
44
-					<view class="info">
45
-						<view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
46
-						<view class="operation" style="margin-right: 20px;">运营人
47
-							{{ item.clueOperationName ? item.clueOperationName : "-" }}
48
-						</view>
49
-					</view>
50
-				</view>
51
-				<view class="clue_state_wrap">
52
-					<view class="clue_state">
53
-						<view class="state_wrap">
54
-							<view class="label">阶段:</view>{{crm_form_state(item.state)}}
55
-						</view>
56
-						<view class="clueTag">
57
-							<view class="label">标签:</view>
58
-							<u-tag :text="tag.name" plain plainFill borderColor="#fff" size="mini"
59
-								v-for="(tag) in item.tags" :key="tag.id" style="margin-right: 10px;"
60
-								:bgColor="tag.color" color="#fff"></u-tag>
61
-						</view>
62
-					</view>
63
-				</view>
64
-			</view>
17
+			<order-item v-for="item in listData" :key="item.id" :item="item" :type="type" :dicts="dicts"></order-item>
65 18
 		</view>
66 19
 
67 20
 		<!-- 加载更多 -->
@@ -76,10 +29,8 @@
76 29
 
77 30
 <script>
78 31
 	import pullUpRefresh from "@/utils/pullUpRefresh";
79
-	import {
80
-		selectDictLabel
81
-	} from "@/utils/util";
82 32
 	import filterQuery from "./filterQuery.vue";
33
+	import orderItem from "./orderItem.vue";
83 34
 	export default {
84 35
 		mixins: [pullUpRefresh],
85 36
 		props: {
@@ -94,6 +45,7 @@
94 45
 		},
95 46
 		components: {
96 47
 			filterQuery,
48
+			orderItem
97 49
 		},
98 50
 		data() {
99 51
 			return {
@@ -118,16 +70,6 @@
118 70
 			}
119 71
 		},
120 72
 		methods: {
121
-			handleToDetail(row) {
122
-				const {
123
-					id,
124
-					item,
125
-					clueId
126
-				} = row;
127
-				uni.navigateTo({
128
-					url: `/pages/orderDetail/index?orderId=${id}&item=${item}&type=${this.queryParams.type}&clueId=${clueId}`,
129
-				});
130
-			},
131 73
 			handleKeyword() {
132 74
 				this.resetData();
133 75
 			},
@@ -139,36 +81,6 @@
139 81
 			handleshowFilter() {
140 82
 				this.$refs.filter.show();
141 83
 			},
142
-			// 字典翻译
143
-			crm_form_state(state) {
144
-				return selectDictLabel(this.dicts.crmFormStateDict, state);
145
-			},
146
-			getStatusText(status) {
147
-				const statusMap = {
148
-					'1': '发单',
149
-					'2': '接单',
150
-					'3': '收单',
151
-					'4': '未收'
152
-				};
153
-				return statusMap[status] || status;
154
-			},
155
-			getStatusClass(status) {
156
-				const classMap = {
157
-					'1': 'status_pending',
158
-					'2': 'status_received',
159
-					'3': 'status_confirmed',
160
-					'4': 'status_rejected'
161
-				};
162
-				return classMap[status] || 'status_default';
163
-			},
164
-			handleCopy(item) {
165
-				uni.setClipboardData({
166
-					data: item.phone,
167
-					success: function() {
168
-						uni.$u.toast("复制成功");
169
-					}
170
-				});
171
-			},
172 84
 			async getList() {
173 85
 				const {
174 86
 					pageNum,
@@ -245,90 +157,7 @@
245 157
 		padding: 20px 20px;
246 158
 	}
247 159
 
248
-	.order_item {
249
-		background: #fff;
250
-		border-radius: 20px;
251
-		padding: 20px;
252
-		margin-bottom: 20px;
253
-		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
254
-
255
-		.order_top {
256
-			display: flex;
257
-			justify-content: space-between;
258
-			margin-bottom: 15px;
259
-
260
-			.top_left {
261
-				font-size: 18px;
262
-				font-weight: bold;
263
-				color: #202020;
264
-			}
265
-
266
-			.top_right {
267
-				.status_pending {
268
-					color: #e65d6f;
269
-				}
270
-
271
-				.status_received {
272
-					color: #ff9900;
273
-				}
274
-
275
-				.status_confirmed {
276
-					color: #67c23a;
277
-				}
278
-
279
-				.status_rejected {
280
-					color: #909399;
281
-				}
282
-			}
283
-		}
284
-
285
-		.order_info {
286
-			font-size: 14px;
287
-			color: #666;
288
-
289
-			.telPhone {
290
-				display: flex;
291
-				margin-bottom: 10px;
292
-
293
-				.copy_btn {
294
-					color: #4fa5fe;
295
-					margin-left: 10px;
296
-				}
297
-			}
298
-
299
-			.info {
300
-				display: flex;
301
-				margin-bottom: 8px;
302
-
303
-				view {
304
-					flex: 1;
305
-				}
306
-			}
307
-		}
308
-	}
309
-
310 160
 	.empty_wrap {
311 161
 		margin-top: 100px;
312 162
 	}
313
-
314
-	.clue_state_wrap {
315
-		font-size: 14px;
316
-		background: #f8f9fb;
317
-		padding: 10px;
318
-		color: #9b9aa2;
319
-		overflow: hidden;
320
-
321
-		.state_wrap {
322
-			display: flex;
323
-			margin-bottom: 10px;
324
-		}
325
-
326
-		.label {
327
-			flex: 0 0 40px !important;
328
-		}
329
-
330
-		.clueTag {
331
-			display: flex;
332
-		}
333
-	}
334 163
 </style>

+ 193 - 0
pages/order/components/orderCenter/orderItem.vue

@@ -0,0 +1,193 @@
1
+<template>
2
+	<view class="order_item" @click="handleToDetail">
3
+		<view class="order_top">
4
+			<view class="top_left">{{item.item}}</view>
5
+			<view class="top_right">
6
+				<text :class="getStatusClass(item.status)">{{getStatusText(item.status)}}</text>
7
+			</view>
8
+		</view>
9
+		<view class="order_info">
10
+			<view class="telPhone">
11
+				<view class="phone">
12
+					<text>电话: </text>
13
+					<show-real-text :real="item.phone" :type='type'
14
+						:style="{ color : item.repetitionOperationName ? 'red' : 'black' }"></show-real-text>
15
+				</view>
16
+				<view class="copy_btn" @click.stop="handleCopy" v-if="type != '1'">复制</view>
17
+			</view>
18
+			<view class="info">
19
+				<view class="createUser" style="margin-right: 20px;">发单人:
20
+					{{ item.createNickName ? item.createNickName : "-" }}
21
+				</view>
22
+				<view class="orgName">机构: {{ item.orgName ? item.orgName : "-" }}</view>
23
+			</view>
24
+			<view class="info">
25
+				<view class="sendDate" style="margin-right: 20px;">发单日期:
26
+					{{ item.sendDate ? item.sendDate : "-" }}
27
+				</view>
28
+			</view>
29
+			<view class="info">
30
+				<view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
31
+				<view class="operation" style="margin-right: 20px;">运营人
32
+					{{ item.clueOperationName ? item.clueOperationName : "-" }}
33
+				</view>
34
+			</view>
35
+		</view>
36
+		<view class="clue_state_wrap">
37
+			<view class="clue_state">
38
+				<view class="state_wrap">
39
+					<view class="label">阶段:</view>{{crm_form_state(item.state)}}
40
+				</view>
41
+				<view class="clueTag">
42
+					<view class="label">标签:</view>
43
+					<u-tag :text="tag.name" plain plainFill borderColor="#fff" size="mini"
44
+						v-for="(tag) in item.tags" :key="tag.id" style="margin-right: 10px;"
45
+						:bgColor="tag.color" color="#fff"></u-tag>
46
+				</view>
47
+			</view>
48
+		</view>
49
+	</view>
50
+</template>
51
+
52
+<script>
53
+	import { selectDictLabel } from "@/utils/util";
54
+	export default {
55
+		props: {
56
+			item: {
57
+				type: Object,
58
+				required: true
59
+			},
60
+			type: {
61
+				type: String,
62
+				default: '2'
63
+			},
64
+			dicts: {
65
+				type: Object,
66
+				required: true
67
+			}
68
+		},
69
+		methods: {
70
+			handleToDetail() {
71
+				const { id, item: itemType, clueId } = this.item;
72
+				uni.navigateTo({
73
+					url: `/pages/orderDetail/index?orderId=${id}&item=${itemType}&type=${this.type}&clueId=${clueId}`,
74
+				});
75
+			},
76
+			// 字典翻译
77
+			crm_form_state(state) {
78
+				return selectDictLabel(this.dicts.crmFormStateDict, state);
79
+			},
80
+			getStatusText(status) {
81
+				const statusMap = {
82
+					'1': '发单',
83
+					'2': '接单',
84
+					'3': '收单',
85
+					'4': '未收'
86
+				};
87
+				return statusMap[status] || status;
88
+			},
89
+			getStatusClass(status) {
90
+				const classMap = {
91
+					'1': 'status_pending',
92
+					'2': 'status_received',
93
+					'3': 'status_confirmed',
94
+					'4': 'status_rejected'
95
+				};
96
+				return classMap[status] || 'status_default';
97
+			},
98
+			handleCopy() {
99
+				uni.setClipboardData({
100
+					data: this.item.phone,
101
+					success: function() {
102
+						uni.$u.toast("复制成功");
103
+					}
104
+				});
105
+			}
106
+		}
107
+	}
108
+</script>
109
+
110
+<style lang="scss" scoped>
111
+	.order_item {
112
+		background: #fff;
113
+		border-radius: 20px;
114
+		padding: 20px;
115
+		margin-bottom: 20px;
116
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
117
+
118
+		.order_top {
119
+			display: flex;
120
+			justify-content: space-between;
121
+			margin-bottom: 15px;
122
+
123
+			.top_left {
124
+				font-size: 18px;
125
+				font-weight: bold;
126
+				color: #202020;
127
+			}
128
+
129
+			.top_right {
130
+				.status_pending {
131
+					color: #e65d6f;
132
+				}
133
+
134
+				.status_received {
135
+					color: #ff9900;
136
+				}
137
+
138
+				.status_confirmed {
139
+					color: #67c23a;
140
+				}
141
+
142
+				.status_rejected {
143
+					color: #909399;
144
+				}
145
+			}
146
+		}
147
+
148
+		.order_info {
149
+			font-size: 14px;
150
+			color: #666;
151
+
152
+			.telPhone {
153
+				display: flex;
154
+				margin-bottom: 10px;
155
+
156
+				.copy_btn {
157
+					color: #4fa5fe;
158
+					margin-left: 10px;
159
+				}
160
+			}
161
+
162
+			.info {
163
+				display: flex;
164
+				margin-bottom: 8px;
165
+
166
+				view {
167
+					flex: 1;
168
+				}
169
+			}
170
+		}
171
+
172
+		.clue_state_wrap {
173
+			font-size: 14px;
174
+			background: #f8f9fb;
175
+			padding: 10px;
176
+			color: #9b9aa2;
177
+			overflow: hidden;
178
+
179
+			.state_wrap {
180
+				display: flex;
181
+				margin-bottom: 10px;
182
+			}
183
+
184
+			.label {
185
+				flex: 0 0 40px !important;
186
+			}
187
+
188
+			.clueTag {
189
+				display: flex;
190
+			}
191
+		}
192
+	}
193
+</style>