Преглед на файлове

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

zhangxin преди 1 седмица
родител
ревизия
48a0d50511

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

@@ -49,12 +49,24 @@
49 49
 	.img_wrap{
50 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 62
 	.price{
53 63
 		.u-input__content__field-wrapper__field{
54 64
 			font-size: 34rpx !important;
55 65
 			color: red !important;
56 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 25
             </view>
26 26
             <u--input v-if="editOrAdd === 'edit'" class="price" placeholder="价格" border="bottom" v-model="info.price"
27 27
                 clearable></u--input>
28
+            <u--input v-if="editOrAdd === 'edit'" placeholder="备注" border="bottom" v-model="info.remark"
29
+                clearable></u--input>
28 30
             <qiun-data-charts v-if="isShowChart" type="column" :chartData="chartData" canvasId="priceChart" :opts="opts" :ontouch="true"
29 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 38
         </u-modal>
31 39
         <brandList ref="brandListRef" @selectedBrand="handleSelectedBrand"></brandList>
32 40
     </view>
@@ -73,6 +81,10 @@ export default {
73 81
         isShowChart: {
74 82
             type: Boolean,
75 83
             default: false
84
+        },
85
+        isShowHistory: {
86
+            type: Boolean,
87
+            default: false
76 88
         }
77 89
     },
78 90
     emits: ['submitSuccess'],
@@ -91,8 +103,10 @@ export default {
91 103
                 price: '',
92 104
                 dictLabel: '',
93 105
                 dictValue: '',
94
-                imgsUrl: []
106
+                imgsUrl: [],
107
+                remark: ''
95 108
             },
109
+            historyList: [],
96 110
             rules: {
97 111
                 brand: [
98 112
                     { required: true, message: '请输入品牌', trigger: 'blur' }
@@ -152,7 +166,6 @@ export default {
152 166
         initData() {
153 167
             this.$nextTick(() => {
154 168
                 this.info = JSON.parse(JSON.stringify(this.editInfo))
155
-                console.log(this.info)
156 169
                 if(this.isShowChart){
157 170
                     this.chartData = {
158 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 183
                 this.showModal = true;
168 184
             })
169 185
         },
@@ -212,13 +228,13 @@ export default {
212 228
                 })
213 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 238
             if (this.editOrAdd === 'edit' && !this.info.price) {
223 239
                 uni.showToast({
224 240
                     title: '请输入价格',
@@ -236,7 +252,8 @@ export default {
236 252
                 price: this.editOrAdd === 'edit' ? this.info.price : '',
237 253
                 imgsUrl: this.info.imgsUrl,
238 254
                 status: this.editOrAdd === 'edit' ? '2' : '1',
239
-                type: this.type
255
+                type: this.type,
256
+                remark: this.info.remark
240 257
             }
241 258
             uni.$u.api.addInquiry(data).then(res => {
242 259
                 uni.$u.toast('保存成功')

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

@@ -36,7 +36,7 @@
36 36
             </view>
37 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 40
     </view>
41 41
 </template>
42 42
 <script>

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

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

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

@@ -77,7 +77,7 @@
77 77
 				<view>发单</view>
78 78
 			</view>
79 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 82
 		<u-popup :show="followPopupVisible" mode="bottom" round="16" @close="onFollowPopupClose"
83 83
 			:closeOnClickOverlay="true" @open="loadFollowList">
@@ -136,7 +136,8 @@ export default {
136 136
 			followLoading: false,
137 137
 			followListError: '',
138 138
 			currentFollowClue: null,
139
-			closedFollowPopupAt: 0
139
+			closedFollowPopupAt: 0,
140
+			isShowChart: false
140 141
 		}
141 142
 	},
142 143
 	methods: {
@@ -210,7 +211,7 @@ export default {
210 211
 		// 询价
211 212
 		async handleInquiry(item) {
212 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 215
 				const data = {
215 216
 					clueId: item.id,
216 217
 					type:1
@@ -220,12 +221,19 @@ export default {
220 221
 					if(res.code === 200){
221 222
 						this.$nextTick(()=>{
222 223
 							this.editInfo = res.data
224
+							if(Number(item.count) === 0){
225
+								this.isShowChart = false
226
+							}else{
227
+								this.isShowChart = true
228
+							}
223 229
 							this.$refs.inquiryDialog.showDialog()
224 230
 						})
225 231
 					}
226 232
 				})
227
-			}else if(!item.count){
233
+			}
234
+			else if(!item.count){
228 235
 				this.editOrAdd = 'add'
236
+				this.isShowChart = false
229 237
 				this.$refs.inquiryDialog.showDialog()
230 238
 			}
231 239
 		},

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

@@ -1,27 +1,29 @@
1 1
 <template>
2 2
     <view class="person_cards_wrap">
3 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 7
             <view class="card_item today">
6 8
                 <view class="card_item_content">
7 9
                     <view class="card_header">
8
-                        <text class="card_title">抖音<br />今天消耗(元)</text>
10
+                        <text class="card_title">抖音<br />消耗(元)</text>
9 11
                     </view>
10 12
                     <view class="card_content">
11
-                        <text class="card_value">{{ formatMoney(cardData.todayConsumeDy) }}</text>
13
+                        <text class="card_value">{{ formatMoney(cardData.consumeDy) }}</text>
12 14
                     </view>
13 15
                 </view>
14 16
                 <view class="card_item_content">
15 17
                     <view class="card_header">
16
-                        <text class="card_title">广点通<br />今天消耗(元)</text>
18
+                        <text class="card_title">广点通<br />消耗(元)</text>
17 19
                     </view>
18 20
                     <view class="card_content">
19
-                        <text class="card_value">{{ formatMoney(cardData.todayConsumeGdt) }}</text>
21
+                        <text class="card_value">{{ formatMoney(cardData.consumeGdt) }}</text>
20 22
                     </view>
21 23
                 </view>
22 24
                 <view class="card_item_content">
23 25
                     <view class="card_header">
24
-                        <text class="card_title">今天业绩(元)</text>
26
+                        <text class="card_title">业绩(元)</text>
25 27
                     </view>
26 28
                     <view class="card_content">
27 29
                         <text class="card_value">{{ cardData.todayPerformance }}</text>
@@ -194,10 +196,25 @@ export default {
194 196
                 }
195 197
             },
196 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 213
     methods: {
214
+        changeTab(val) {
215
+            this.currentTab = val.index;
216
+            this.getCardData();
217
+        },
201 218
         formatMoney(val) {
202 219
             if (val === null || val === undefined || val === '' || val === '-') return '-';
203 220
             const num = Number(val);
@@ -205,7 +222,11 @@ export default {
205 222
             return num.toFixed(2);
206 223
         },
207 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 230
                 if (res.code === 200) {
210 231
                     this.cardData = res.data;
211 232
                 }

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

@@ -12,6 +12,11 @@
12 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 21
 .card_item {
17 22
   background-color: #ffffff;