Sfoglia il codice sorgente

feat:询价历史、备注、我的个人中心卡片

zhangxin 1 settimana fa
parent
commit
48a0d50511

+ 13 - 1
components/add-inquiry-dialog/index.scss

@@ -49,12 +49,24 @@
49
 	.img_wrap{
49
 	.img_wrap{
50
 		display: flex;
50
 		display: flex;
51
 	}
51
 	}
52
+	.history_wrap{
53
+		max-height: 300rpx;
54
+		overflow: auto;
55
+		.title{
56
+			font-size: 26rpx;
57
+			color: #333;
58
+			white-space: nowrap;
59
+			flex-shrink: 0;
60
+		}
61
+	}
52
 	.price{
62
 	.price{
53
 		.u-input__content__field-wrapper__field{
63
 		.u-input__content__field-wrapper__field{
54
 			font-size: 34rpx !important;
64
 			font-size: 34rpx !important;
55
 			color: red !important;
65
 			color: red !important;
56
 			font-weight: 600;
66
 			font-weight: 600;
57
 		}
67
 		}
58
-		
59
 	}
68
 	}
69
+}
70
+::v-deep .u-cell__title-text{
71
+	width:max-content !important;
60
 }
72
 }

+ 27 - 10
components/add-inquiry-dialog/index.vue

@@ -25,8 +25,16 @@
25
             </view>
25
             </view>
26
             <u--input v-if="editOrAdd === 'edit'" class="price" placeholder="价格" border="bottom" v-model="info.price"
26
             <u--input v-if="editOrAdd === 'edit'" class="price" placeholder="价格" border="bottom" v-model="info.price"
27
                 clearable></u--input>
27
                 clearable></u--input>
28
+            <u--input v-if="editOrAdd === 'edit'" placeholder="备注" border="bottom" v-model="info.remark"
29
+                clearable></u--input>
28
             <qiun-data-charts v-if="isShowChart" type="column" :chartData="chartData" canvasId="priceChart" :opts="opts" :ontouch="true"
30
             <qiun-data-charts v-if="isShowChart" type="column" :chartData="chartData" canvasId="priceChart" :opts="opts" :ontouch="true"
29
                 width="700rpx" height="600rpx" backgroundColor="#fff" />
31
                 width="700rpx" height="600rpx" backgroundColor="#fff" />
32
+            <view v-if="isShowHistory" class="history_wrap">
33
+                <view class="title">
34
+                    询价历史
35
+                </view>
36
+                <u-cell v-for="(item, index) in historyList" :key="index" :title="(index+1)+'. ¥'+item.price" :value="'备注:'+ (item.remark || '无') "></u-cell>
37
+            </view>
30
         </u-modal>
38
         </u-modal>
31
         <brandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></brandList>
39
         <brandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></brandList>
32
     </view>
40
     </view>
@@ -73,6 +81,10 @@ export default {
73
         isShowChart: {
81
         isShowChart: {
74
             type: Boolean,
82
             type: Boolean,
75
             default: false
83
             default: false
84
+        },
85
+        isShowHistory: {
86
+            type: Boolean,
87
+            default: false
76
         }
88
         }
77
     },
89
     },
78
     emits: ['submitSuccess'],
90
     emits: ['submitSuccess'],
@@ -91,8 +103,10 @@ export default {
91
                 price: '',
103
                 price: '',
92
                 dictLabel: '',
104
                 dictLabel: '',
93
                 dictValue: '',
105
                 dictValue: '',
94
-                imgsUrl: []
106
+                imgsUrl: [],
107
+                remark: ''
95
             },
108
             },
109
+            historyList: [],
96
             rules: {
110
             rules: {
97
                 brand: [
111
                 brand: [
98
                     { required: true, message: '请输入品牌', trigger: 'blur' }
112
                     { required: true, message: '请输入品牌', trigger: 'blur' }
@@ -152,7 +166,6 @@ export default {
152
         initData() {
166
         initData() {
153
             this.$nextTick(() => {
167
             this.$nextTick(() => {
154
                 this.info = JSON.parse(JSON.stringify(this.editInfo))
168
                 this.info = JSON.parse(JSON.stringify(this.editInfo))
155
-                console.log(this.info)
156
                 if(this.isShowChart){
169
                 if(this.isShowChart){
157
                     this.chartData = {
170
                     this.chartData = {
158
                         categories: this.info.priceChart.map((item, index) => item.userName),
171
                         categories: this.info.priceChart.map((item, index) => item.userName),
@@ -164,6 +177,9 @@ export default {
164
                         ]
177
                         ]
165
                     };
178
                     };
166
                 }
179
                 }
180
+                if(this.isShowHistory){
181
+                    this.historyList = JSON.parse(this.info.myPriceHistory)
182
+                }
167
                 this.showModal = true;
183
                 this.showModal = true;
168
             })
184
             })
169
         },
185
         },
@@ -212,13 +228,13 @@ export default {
212
                 })
228
                 })
213
                 return
229
                 return
214
             }
230
             }
215
-            if (this.info.imgsUrl.length == 0) {
216
-                uni.showToast({
217
-                    title: '请上传图片',
218
-                    icon: 'none'
219
-                })
220
-                return
221
-            }
231
+            // if (this.info.imgsUrl.length == 0) {
232
+            //     uni.showToast({
233
+            //         title: '请上传图片',
234
+            //         icon: 'none'
235
+            //     })
236
+            //     return
237
+            // }
222
             if (this.editOrAdd === 'edit' && !this.info.price) {
238
             if (this.editOrAdd === 'edit' && !this.info.price) {
223
                 uni.showToast({
239
                 uni.showToast({
224
                     title: '请输入价格',
240
                     title: '请输入价格',
@@ -236,7 +252,8 @@ export default {
236
                 price: this.editOrAdd === 'edit' ? this.info.price : '',
252
                 price: this.editOrAdd === 'edit' ? this.info.price : '',
237
                 imgsUrl: this.info.imgsUrl,
253
                 imgsUrl: this.info.imgsUrl,
238
                 status: this.editOrAdd === 'edit' ? '2' : '1',
254
                 status: this.editOrAdd === 'edit' ? '2' : '1',
239
-                type: this.type
255
+                type: this.type,
256
+                remark: this.info.remark
240
             }
257
             }
241
             uni.$u.api.addInquiry(data).then(res => {
258
             uni.$u.api.addInquiry(data).then(res => {
242
                 uni.$u.toast('保存成功')
259
                 uni.$u.toast('保存成功')

+ 1 - 1
components/inquiry-verification-list/index.vue

@@ -36,7 +36,7 @@
36
             </view>
36
             </view>
37
         </scroll-view>
37
         </scroll-view>
38
 
38
 
39
-        <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :type="type" :title="type == '1' ? '询价' : '核价'" @submitSuccess="onRefresh" />
39
+        <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :isShowHistory="true" :type="type" :title="type == '1' ? '询价' : '核价'" @submitSuccess="onRefresh" />
40
     </view>
40
     </view>
41
 </template>
41
 </template>
42
 <script>
42
 <script>

+ 1 - 0
components/inquiry-verification-list/mixins/inquiryVerificationList.js

@@ -52,6 +52,7 @@ export default {
52
         handleClick(item) {
52
         handleClick(item) {
53
             this.editInfo = item;
53
             this.editInfo = item;
54
             this.editInfo.price = item.myPrice
54
             this.editInfo.price = item.myPrice
55
+            this.editInfo.remark = item.myRemark
55
             this.$nextTick(() => {
56
             this.$nextTick(() => {
56
                 this.$refs.addInquiryDialog.showDialog();
57
                 this.$refs.addInquiryDialog.showDialog();
57
             })
58
             })

+ 12 - 4
pages/clue/post/index.vue

@@ -77,7 +77,7 @@
77
 				<view>发单</view>
77
 				<view>发单</view>
78
 			</view>
78
 			</view>
79
 		</view>
79
 		</view>
80
-		<add-inquiry-dialog ref="inquiryDialog" :clueId="clueId" :isShowChart="true" :isClue="true" :editOrAdd="editOrAdd" :editInfo="editInfo" title="询价" @cancel="handleInquiryCancel" :type="1"/>
80
+		<add-inquiry-dialog ref="inquiryDialog" :clueId="clueId" :isShowChart="isShowChart" :isClue="true" :editOrAdd="editOrAdd" :editInfo="editInfo" title="询价" @cancel="handleInquiryCancel" :type="1"/>
81
 		<!-- 最新跟进记录详情弹窗;关闭时记时间戳,避免蒙层点击冒泡触发详情跳转 -->
81
 		<!-- 最新跟进记录详情弹窗;关闭时记时间戳,避免蒙层点击冒泡触发详情跳转 -->
82
 		<u-popup :show="followPopupVisible" mode="bottom" round="16" @close="onFollowPopupClose"
82
 		<u-popup :show="followPopupVisible" mode="bottom" round="16" @close="onFollowPopupClose"
83
 			:closeOnClickOverlay="true" @open="loadFollowList">
83
 			:closeOnClickOverlay="true" @open="loadFollowList">
@@ -136,7 +136,8 @@ export default {
136
 			followLoading: false,
136
 			followLoading: false,
137
 			followListError: '',
137
 			followListError: '',
138
 			currentFollowClue: null,
138
 			currentFollowClue: null,
139
-			closedFollowPopupAt: 0
139
+			closedFollowPopupAt: 0,
140
+			isShowChart: false
140
 		}
141
 		}
141
 	},
142
 	},
142
 	methods: {
143
 	methods: {
@@ -210,7 +211,7 @@ export default {
210
 		// 询价
211
 		// 询价
211
 		async handleInquiry(item) {
212
 		async handleInquiry(item) {
212
 			this.clueId = item.id
213
 			this.clueId = item.id
213
-			if(Number(item.count) > 0){//count 默认是0,新增之后变为1,之后每编辑一次就会+1
214
+			if(Number(item.count) > 0 || Number(item.count) === 0){//null:未生成询价数据 0:已生成询价数据但是没有询过价 >0:询过价人数
214
 				const data = {
215
 				const data = {
215
 					clueId: item.id,
216
 					clueId: item.id,
216
 					type:1
217
 					type:1
@@ -220,12 +221,19 @@ export default {
220
 					if(res.code === 200){
221
 					if(res.code === 200){
221
 						this.$nextTick(()=>{
222
 						this.$nextTick(()=>{
222
 							this.editInfo = res.data
223
 							this.editInfo = res.data
224
+							if(Number(item.count) === 0){
225
+								this.isShowChart = false
226
+							}else{
227
+								this.isShowChart = true
228
+							}
223
 							this.$refs.inquiryDialog.showDialog()
229
 							this.$refs.inquiryDialog.showDialog()
224
 						})
230
 						})
225
 					}
231
 					}
226
 				})
232
 				})
227
-			}else if(!item.count){
233
+			}
234
+			else if(!item.count){
228
 				this.editOrAdd = 'add'
235
 				this.editOrAdd = 'add'
236
+				this.isShowChart = false
229
 				this.$refs.inquiryDialog.showDialog()
237
 				this.$refs.inquiryDialog.showDialog()
230
 			}
238
 			}
231
 		},
239
 		},

+ 28 - 7
pages/person/cards/index.vue

@@ -1,27 +1,29 @@
1
 <template>
1
 <template>
2
     <view class="person_cards_wrap">
2
     <view class="person_cards_wrap">
3
         <view class="cards_container">
3
         <view class="cards_container">
4
-            <!-- 今天消耗 -->
4
+            <view class="tab_container">
5
+                 <u-tabs :list="tabList" :current="currentTab" @change="changeTab" active-color="#2563eb" :is-scroll="false"></u-tabs>
6
+            </view>
5
             <view class="card_item today">
7
             <view class="card_item today">
6
                 <view class="card_item_content">
8
                 <view class="card_item_content">
7
                     <view class="card_header">
9
                     <view class="card_header">
8
-                        <text class="card_title">抖音<br />今天消耗(元)</text>
10
+                        <text class="card_title">抖音<br />消耗(元)</text>
9
                     </view>
11
                     </view>
10
                     <view class="card_content">
12
                     <view class="card_content">
11
-                        <text class="card_value">{{ formatMoney(cardData.todayConsumeDy) }}</text>
13
+                        <text class="card_value">{{ formatMoney(cardData.consumeDy) }}</text>
12
                     </view>
14
                     </view>
13
                 </view>
15
                 </view>
14
                 <view class="card_item_content">
16
                 <view class="card_item_content">
15
                     <view class="card_header">
17
                     <view class="card_header">
16
-                        <text class="card_title">广点通<br />今天消耗(元)</text>
18
+                        <text class="card_title">广点通<br />消耗(元)</text>
17
                     </view>
19
                     </view>
18
                     <view class="card_content">
20
                     <view class="card_content">
19
-                        <text class="card_value">{{ formatMoney(cardData.todayConsumeGdt) }}</text>
21
+                        <text class="card_value">{{ formatMoney(cardData.consumeGdt) }}</text>
20
                     </view>
22
                     </view>
21
                 </view>
23
                 </view>
22
                 <view class="card_item_content">
24
                 <view class="card_item_content">
23
                     <view class="card_header">
25
                     <view class="card_header">
24
-                        <text class="card_title">今天业绩(元)</text>
26
+                        <text class="card_title">业绩(元)</text>
25
                     </view>
27
                     </view>
26
                     <view class="card_content">
28
                     <view class="card_content">
27
                         <text class="card_value">{{ cardData.todayPerformance }}</text>
29
                         <text class="card_value">{{ cardData.todayPerformance }}</text>
@@ -194,10 +196,25 @@ export default {
194
                 }
196
                 }
195
             },
197
             },
196
             clueList: [],
198
             clueList: [],
199
+            currentTab: 0,
200
+            tabList: [{
201
+                name: '当日',
202
+                value: 'today'
203
+            }, {
204
+                name: '当周',
205
+                value: 'week'
206
+            }, {
207
+                name: '当月',
208
+                value: 'month'
209
+            }],
197
         };
210
         };
198
     },
211
     },
199
 
212
 
200
     methods: {
213
     methods: {
214
+        changeTab(val) {
215
+            this.currentTab = val.index;
216
+            this.getCardData();
217
+        },
201
         formatMoney(val) {
218
         formatMoney(val) {
202
             if (val === null || val === undefined || val === '' || val === '-') return '-';
219
             if (val === null || val === undefined || val === '' || val === '-') return '-';
203
             const num = Number(val);
220
             const num = Number(val);
@@ -205,7 +222,11 @@ export default {
205
             return num.toFixed(2);
222
             return num.toFixed(2);
206
         },
223
         },
207
         getCardData() {
224
         getCardData() {
208
-            uni.$u.api.getPersonCards({ userId: this.$store.state.user.userInfo.userId }).then(res => {
225
+            const time = this.tabList[this.currentTab].value;
226
+            uni.$u.api.getPersonCards({
227
+                userId: this.$store.state.user.userInfo.userId,
228
+                time: time
229
+            }).then(res => {
209
                 if (res.code === 200) {
230
                 if (res.code === 200) {
210
                     this.cardData = res.data;
231
                     this.cardData = res.data;
211
                 }
232
                 }

+ 5 - 0
pages/person/cards/styles/index.scss

@@ -12,6 +12,11 @@
12
   flex-direction: column;
12
   flex-direction: column;
13
 }
13
 }
14
 
14
 
15
+.tab_container{
16
+  width: 100%;
17
+  display: flex;
18
+  justify-content: right;
19
+}
15
 // 卡片基础样式
20
 // 卡片基础样式
16
 .card_item {
21
 .card_item {
17
   background-color: #ffffff;
22
   background-color: #ffffff;