Yannay пре 2 месеци
родитељ
комит
f768b391d7

+ 10 - 8
pages/orderDetailNew/components/orderDetailNewView.vue

@@ -20,7 +20,8 @@
20 20
         </view>
21 21
 
22 22
         <ul class="page">
23
-            <li v-for="(tab, index) in tabs" :key="index" :class="{ 'active': activeIndex === index }">{{ tab }}</li>
23
+            <li @click="activeIndex = index" v-for="(tab, index) in tabs" :key="index"
24
+                :class="{ 'active': activeIndex === index }">{{ tab }}</li>
24 25
         </ul>
25 26
     </view>
26 27
 </template>
@@ -113,7 +114,6 @@ export default {
113 114
             console.log("all page data:", this.allFroms[nowPage])
114 115
             // 当点击到第三页时,更新第三页的图片列表
115 116
             if (nowPage === 'formTwo') {
116
-                console.log('品牌', this.detail.brand)
117 117
                 this.$refs.pageThreeComp.getList('2', '3', this.currentReceiptInner.id, this.detail.itemBrand);
118 118
             }
119 119
         },
@@ -142,7 +142,7 @@ export default {
142 142
                 "sendFormId": this.orderId, //接单中心的id,就是接单中心列表的id(发单id)
143 143
                 "clueId": this.detail.clueId,
144 144
                 "item": this.detail.item,
145
-                "brand": this.detail.brand,
145
+                // "brand": this.topInfo.brand,
146 146
                 // "needCheckCode": 1,   //先不传
147 147
                 // "code": null,         //先不传
148 148
                 // "paymentAmount": null, //支付总额page3 先不传
@@ -159,7 +159,7 @@ export default {
159 159
                 // "grossPerformance": "7443.00",   //毛利 performance*splitRatio
160 160
                 // "expressOrderNo": null,   //快递单号+后续加上一个键加上图url
161 161
                 "fileIds": this.fileIds,  //传第三部里面排序完成之后的id的数组,参考编辑收单里面的附件传的方法
162
-                "model": this.detail.model,
162
+                // "model": this.detail.model,
163 163
                 // "splitRatio": "25",   //分成比例,先不传
164 164
                 "customerServiceName": "1", //默认传1,判断入库的类型,回收类入库,销售类入库,维保类入库,第四步传,增加选项下拉
165 165
                 "deptId": this.detail.deptId,
@@ -195,7 +195,7 @@ export default {
195 195
                 })
196 196
                 uni.$u.toast(response.msg || '支付成功')
197 197
             } catch (error) {
198
-                uni.$u.toast(`支付失败:${response.msg}`)
198
+                uni.$u.toast(`支付失败:${error}`)
199 199
             }
200 200
         },
201 201
         //确认入库
@@ -213,7 +213,7 @@ export default {
213 213
                 "sendFormId": this.orderId, //接单中心的id,就是接单中心列表的id(发单id)
214 214
                 "clueId": this.detail.clueId,
215 215
                 "item": warehouseInfo.item || '',
216
-                "brand": this.detail.brand,
216
+                // "brand": this.detail.brand,
217 217
                 // "needCheckCode": 1,   //先不传
218 218
                 "code": warehouseInfo.codeStorage || '',         //先不传
219 219
                 // "paymentAmount": null, //支付总额page3 先不传
@@ -230,7 +230,7 @@ export default {
230 230
                 "grossPerformance": warehouseInfo.grossPerformance || '',   //毛利 performance*splitRatio
231 231
                 "expressOrderNo": warehouseInfo.expressOrderNo,   //快递单号+后续加上一个键加上图url
232 232
                 "fileIds": this.fileIds,  //传第三部里面排序完成之后的id的数组,参考编辑收单里面的附件传的方法
233
-                "model": this.detail.model,
233
+                // "model": this.detail.model,
234 234
                 // "splitRatio": "25",   //分成比例,先不传
235 235
                 "customerServiceName": "1", //默认传1,判断入库的类型,回收类入库,销售类入库,维保类入库,第四步传,增加选项下拉
236 236
                 "deptId": this.detail.deptId,
@@ -321,9 +321,11 @@ export default {
321 321
         height: 70rpx;
322 322
         line-height: 80rpx;
323 323
         text-align: center;
324
-        margin-bottom: 10rpx;
324
+        margin-bottom: 20rpx;
325 325
         transition: all 0.3s ease-in-out;
326 326
         font-weight: 800;
327
+        /* 阴影 */
328
+        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
327 329
     }
328 330
 
329 331
     li.active {

+ 85 - 30
pages/orderDetailNew/components/pageFour.vue

@@ -290,9 +290,7 @@ export default {
290 290
                         grossPerformance: data.grossPerformance || '',//毛业绩
291 291
                         remarks: data.receiptRemark?.split(';')[0] || '',//收单备注  截取备注第一部分
292 292
                     }
293
-                    this.$nextTick(() => {
294
-                        this.getShareList()
295
-                    })
293
+                    this.getShareList()
296 294
                 }
297 295
             },
298 296
         }
@@ -326,6 +324,7 @@ export default {
326 324
             showPersonPicker: false,
327 325
 
328 326
             columnsOrgList: [],
327
+            //传入的分成人名单
329 328
             columnsPersonList: [],
330 329
 
331 330
         };
@@ -362,21 +361,41 @@ export default {
362 361
                 deptId: '',
363 362
                 accountType: '1',
364 363
                 userId: '',
365
-                percentage: 0,
364
+                commissionRate: 0,
366 365
                 isCompanyPerformance: '2',
367 366
                 orgName: '',
368 367
                 userName: '',
369 368
                 id: '',
370 369
                 uuid: Math.random()//唯一标识,仅vfor使用
371 370
             });
372
-            // 重新计算所有行的比例
371
+            //重新计算全部行的分成比例
372
+            this.calculateTotalPercentage();
373
+        },
374
+        // 重新计算全部行的分成比例
375
+        calculateTotalPercentage() {
376
+            //获取选择前端的行的数量
377
+            const frontItems = this.profitSharingList.filter(item => item.accountType == '1');
378
+            const backItems = this.profitSharingList.filter(item => item.accountType == '2');
379
+            const totalFrontItems = frontItems.length;
380
+            const totalBackItems = backItems.length;
381
+            console.log('选择前端的行的数量====>', totalFrontItems)
382
+            console.log('选择后端的行的数量====>', totalBackItems)
383
+            //把profitSharingList中的前端行的分成比例按照 100/数量 重新计算
384
+            this.profitSharingList.map(item => {
385
+                if (item.accountType == '1') {
386
+                    item.commissionRate = (100 / totalFrontItems).toFixed()
387
+                }
388
+                if (item.accountType == '2') {
389
+                    item.commissionRate = (100 / totalBackItems).toFixed()
390
+                }
391
+            })
373 392
         },
374
-
375 393
 
376 394
         // 切换账户类型
377 395
         toggleAccountType(item) {
378 396
             item.accountType = item.accountType == '1' ? '2' : '1';
379 397
             // 重新计算分成比例
398
+            this.calculateTotalPercentage();
380 399
         },
381 400
         // 处理百分比输入
382 401
         handlePercentageInput(item) {
@@ -452,15 +471,18 @@ export default {
452 471
 
453 472
         //初始化分成比例
454 473
         async getShareList() {
474
+
475
+            console.log('当前收单信息', this.currentReceipt.id)
455 476
             const { rows, total } = await uni.$u.api.selectCommissionList({
456 477
                 pageSize: 9999,
457 478
                 pageNum: 1,
458 479
             }, { sendFormId: this.currentReceipt.sendFormId, });
459 480
             console.log('分成比例表格数据', rows)
460
-            rows.map(item => {
481
+            const newRows = rows.filter(item => item.receiptFormId == this.currentReceipt.id)
482
+            newRows.map(item => {
461 483
                 item.uuid = Math.random()//唯一标识
462 484
             })
463
-            this.profitSharingList = rows
485
+            this.profitSharingList = newRows
464 486
         },
465 487
 
466 488
 
@@ -481,6 +503,7 @@ export default {
481 503
                     sendFormId: this.currentReceipt.sendFormId,
482 504
                     userId: item.userId,
483 505
                     userName: item.userName,
506
+                    receiptFormId: this.currentReceipt.id,//关联的收单id
484 507
                 }
485 508
                 if (item.id) {
486 509
                     //更新
@@ -495,19 +518,34 @@ export default {
495 518
         //删除分成
496 519
         async deleteRow(id, uuid) {
497 520
             console.log(id, 'id', uuid, 'uuid')
498
-            //如果没有id说明是新增的,直接删除数组中的项
499
-            if (!id) {
500
-                this.profitSharingList = this.profitSharingList.filter(item => item.uuid != uuid)
501
-                uni.$u.toast('删除成功')
502
-                return
503
-            }
504
-            try {
505
-                await uni.$u.api.deleteClueCommissionForm(id)
506
-                uni.$u.toast('删除成功')
507
-                this.getShareList()
508
-            } catch (error) {
509
-                uni.$u.toast('删除失败,请稍后重试')
510
-            }
521
+            // 确认删除
522
+            uni.showModal({
523
+                title: '确认删除',
524
+                content: '是否确认删除当前行分成比例?',
525
+                success: async (res) => {
526
+                    if (res.confirm) {
527
+                        //如果没有id说明是新增的,直接删除数组中的项
528
+                        if (!id) {
529
+                            this.profitSharingList = this.profitSharingList.filter(item => item.uuid != uuid)
530
+                            uni.$u.toast('删除成功')
531
+                            this.calculateTotalPercentage();
532
+
533
+                            return
534
+                        }
535
+                        try {
536
+                            await uni.$u.api.deleteClueCommissionForm(id)
537
+                            uni.$u.toast('删除成功')
538
+                            this.getShareList()
539
+                        } catch (error) {
540
+                            uni.$u.toast('删除失败,请稍后重试')
541
+                        }
542
+                        //重新计算全部行的分成比例
543
+                        this.calculateTotalPercentage();
544
+                    } else {
545
+                        uni.$u.toast('已取消删除')
546
+                    }
547
+                }
548
+            })
511 549
         },
512 550
 
513 551
         //打开选择框
@@ -554,16 +592,33 @@ export default {
554 592
 
555 593
         //确认选择人
556 594
         handleConfirmPerson({ columnIndex, value, values },) {
557
-            console.log(value, '选择的人')
595
+            console.log(value[0], '选择的人')
596
+            console.log(value[0].isUser, '是否是用户')
558 597
             //把值赋值给当前行
559
-            this.profitSharingList.forEach(item => {
560
-                if (item.uuid == this.currentEditItem) {
561
-                    item.userName = value[0].label
562
-                    item.userId = value[0].id
563
-                }
564
-            })
565
-            this.columnsPersonList = []
566
-            this.showPersonPicker = false
598
+            if (value[0].isUser) {
599
+                //当前选择是用户
600
+                this.profitSharingList.forEach(item => {
601
+                    if (item.uuid == this.currentEditItem) {
602
+                        item.userName = value[0].label
603
+                        item.userId = value[0].id
604
+                    }
605
+                })
606
+                this.columnsPersonList = []
607
+                this.showPersonPicker = false
608
+            } else {
609
+                //当前选择是组织
610
+                // 把组织的label赋值给当前的行的关联
611
+                this.profitSharingList.forEach(item => {
612
+                    if (item.uuid == this.currentEditItem) {
613
+                        item.orgName = value[0].label
614
+                        item.deptId = value[0].id
615
+                    }
616
+                })
617
+                const childrens = value[0].children
618
+                console.log('当前分公司的内部分成人', childrens)
619
+
620
+                this.columnsPersonList = [childrens]
621
+            }
567 622
         },
568 623
         // 取消选择人
569 624
         handleCancelPerson() {

+ 5 - 8
pages/orderDetailNew/components/pageOne.vue

@@ -133,20 +133,17 @@ export default {
133 133
                 console.log('currentReceipt 变化了', newVal);
134 134
                 if (newVal) {
135 135
                     //刷新图片列表
136
-                    this.getList('2', '1', newVal.id, this.orderDetail.itemBrand);
137
-                    this.getList('2', '2', newVal.id, this.orderDetail.itemBrand);
136
+                    setTimeout(() => {
137
+                        this.getList('2', '1', newVal.id, this.orderDetail.itemBrand);
138
+                        this.getList('2', '2', newVal.id, this.orderDetail.itemBrand);
139
+                    }, 100)
140
+
138 141
                 }
139 142
             }
140 143
         },
141 144
     },
142 145
     methods: {
143 146
 
144
-
145
-
146
-
147
-
148
-
149
-
150 147
         // 电话卡片点击事件
151 148
         handlePhoneClick() {
152 149
             console.log('电话卡片被点击', '电话号码:', this.orderDetail.phone)

+ 18 - 4
pages/orderDetailNew/components/pageThree.vue

@@ -44,15 +44,15 @@
44 44
                         </view>
45 45
 
46 46
                         <!-- 图片列表 -->
47
-                        <view class="detail-image-item" v-for="(item, index) in detailImages" :key="'detail-' + index"
48
-                            :class="{
47
+                        <view class="detail-image-item" v-for="(item, index) in detailImages.slice(0, 6)"
48
+                            :key="'detail-' + index" :class="{
49 49
                                 'dragging': draggingIndex === index,
50 50
                                 'can-drop': canDropIndex === index
51 51
                             }" @touchstart.stop="onTouchStart($event, index)" @touchmove.stop="onTouchMove($event)"
52 52
                             @touchend.stop="onTouchEnd" @touchcancel.stop="onTouchEnd">
53 53
                             <pic-comp :src="item.fileUrl"></pic-comp>
54 54
                             <view class="image-type-tag">{{ getImageType(index) }}</view>
55
-                            <view class="detail-delete-btn" @click.stop="deleteImage(item)">×</view>
55
+                            <view class="detail-delete-btn" @click.stop="handleYinCang(item, index)">×</view>
56 56
                         </view>
57 57
 
58 58
                         <!-- 上传按钮 -->
@@ -130,6 +130,9 @@
130 130
                 <!-- 确认转账按钮 -->
131 131
                 <u-button type="primary" size="large" @click="confirmTransfer"
132 132
                     style="margin-top: 40rpx;">确认转账</u-button>
133
+                <u-button type="primary" :plain="true" @click="payNowModelShow = false" size="large"
134
+                    style="margin-top: 40rpx;">取消</u-button>
135
+
133 136
             </view>
134 137
         </u-modal>
135 138
     </view>
@@ -173,7 +176,9 @@ export default {
173 176
                 if (newVal) {
174 177
                     console.log('这里是page3的', newVal.tableFee)
175 178
                     this.paymentAmount = newVal.tableFee || '0.00'
176
-                    this.getList('2', '3', newVal.id, this.orderDetail.itemBrand);
179
+                    setTimeout(() => {
180
+                        this.getList('2', '3', newVal.id, this.orderDetail.itemBrand);
181
+                    }, 100);
177 182
                 }
178 183
             },
179 184
             deep: true,
@@ -419,6 +424,15 @@ export default {
419 424
                 uni.$u.toast('提交待跟进记录成功');
420 425
             }
421 426
         },
427
+        handleYinCang(item, index) {
428
+            console.log('删除图片:', item, '索引:', index);
429
+            // 从detailImages数组中移除当前项,后续图片会自动前移
430
+            const itemIndex = this.detailImages.findIndex(img => img.fileUrl === item.fileUrl);
431
+            if (itemIndex !== -1) {
432
+                this.detailImages.splice(itemIndex, 1);
433
+                uni.$u.toast('图片已隐藏');
434
+            }
435
+        }
422 436
     }
423 437
 }
424 438
 </script>

+ 3 - 1
pages/orderDetailNew/components/pageTwo.vue

@@ -173,7 +173,9 @@ export default {
173 173
             handler(newVal) {
174 174
                 if (newVal) {
175 175
                     this.approvedPrice = Number(newVal.sellingPrice) || 0;
176
-                    this.getList('2', '3', newVal.id, this.orderDetail.itemBrand);
176
+                    setTimeout(() => {
177
+                        this.getList('2', '3', newVal.id, this.orderDetail.itemBrand);
178
+                    }, 100)
177 179
                 }
178 180
             },
179 181
             deep: true,

+ 2 - 2
pages/orderDetailNew/mixin/imgUploadAndDownLoad.js

@@ -34,12 +34,12 @@ export default {
34 34
         },
35 35
         //获取文件列表
36 36
         async getList(type, orderFileType, receiptID, itemBrand) {
37
-            console.log('获取文件列表', type, receiptID)
37
+            console.log('获取文件列表', itemBrand, type, receiptID, orderFileType)
38 38
             // console.log('当前的订单id', this.orderDetail.id)
39 39
             // console.log('当前的收单id', this.currentReceipt.id)
40 40
             try {
41 41
                 const params = {
42
-                    clueId: this.orderDetail.clueId,
42
+                    clueId: this.currentReceipt.clueId,
43 43
                     sourceId: this.currentReceipt.id,//默认先用receiptID查,如果没有返回情况下用orderID查
44 44
                     type,
45 45
                     orderFileType,

+ 5 - 1
pages/pagereceivecenter/pagereceivecenter.vue

@@ -204,7 +204,11 @@ export default {
204 204
                             <view class="mainLindInfo">
205 205
                                 <view class="itemName">{{ item.item || '暂无项目' }}</view>
206 206
                                 <view>发单人:{{ item.createNickName || '未知' }}</view>
207
-                                <view>{{ item.sendDate || '暂无时间' }}</view>
207
+                                <view>机构:{{ item.orgName || '暂无机构' }}</view>
208
+                                <view>电话:{{ item.phone || '暂无电话' }}</view>
209
+                                <view>所属人:{{ item.clueOwnerName || '暂无所属人' }}</view>
210
+                                <view>运营人:{{ item.clueOperationName || '暂无运营人' }}</view>
211
+                                <view>发单日期:{{ item.sendDate || '暂无时间' }}</view>
208 212
                             </view>
209 213
                         </view>
210 214
 

+ 2 - 2
store/modules/user.js

@@ -28,8 +28,8 @@ export default {
28 28
 		netConfig: {
29 29
 			// http://59.42.9.166:9520/proxy
30 30
 			// http://10.0.7.100:9500
31
-			// ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
-			ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
31
+			ip: "https://crm.nanjingshiyu.com/prod-api", // ip
32
+			// ip: "https://crmtest.nanjingshiyu.com/prod-api", // 测试环境ip
33 33
 			// ip : "/api", // 测试环境ip
34 34
 			// ip : "http://47.113.184.101", // 测试环境ip
35 35
 			// ip: "http://172.16.7.200", // ip