瀏覽代碼

feat: add unpaid benefit fee input and update handling in unpaid modal

Yannay 1 月之前
父節點
當前提交
b815c4bf93

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__DDAE2E0",
4 4
     "description" : "",
5
-    "versionName" : "1.3.6",
6
-    "versionCode" : 136,
5
+    "versionName" : "1.3.7",
6
+    "versionCode" : 137,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {
9 9
         "webView" : {

+ 1 - 0
pages/orderDetailRefactored/components/OrderDetailView.vue

@@ -40,6 +40,7 @@
40 40
         @save="handleNeedSave"
41 41
         @confirm-pay="handleConfirmPay"
42 42
         @update-file-ids="handleUpdateFileIds"
43
+        @price-updated="$emit('price-updated')"
43 44
         ref="pageThreeRef"
44 45
       />
45 46
     </view>

+ 69 - 1
pages/orderDetailRefactored/components/PageThree.vue

@@ -109,10 +109,15 @@
109 109
     </u-button>
110 110
 
111 111
     <!-- 未收评级模态窗 -->
112
-    <u-modal showCancelButton showConfirmButton @confirm="confirmUnpaid" @cancel="unpaidModalVisible = false"
112
+    <u-modal showCancelButton showConfirmButton @confirm="confirmUnpaid" @cancel="onUnpaidModalCancel"
113 113
       :show="unpaidModalVisible" title="未收评级">
114 114
       <view class="modal-content">
115 115
         <u-rate v-model="unpaidRating" :count="5" :size="50" active-color="#ff9500" />
116
+        <view class="unpaid-benefit-fee-wrap">
117
+          <view class="unpaid-benefit-fee-label">好处费</view>
118
+          <u-input v-model="unpaidBenefitFee" class="unpaid-benefit-fee-input" type="number" :decimal="2"
119
+            placeholder="请输入好处费(金额)" @input="handleUnpaidBenefitFeeInput" />
120
+        </view>
116 121
       </view>
117 122
     </u-modal>
118 123
 
@@ -217,6 +222,7 @@ export default {
217 222
       payNowModalVisible: false,
218 223
       riskWarningModalVisible: false,
219 224
       unpaidRating: 0,
225
+      unpaidBenefitFee: '',
220 226
       followUpNotes: '',
221 227
       // 核价相关
222 228
       pricingClueId: '',
@@ -557,10 +563,40 @@ export default {
557 563
      * 未收点击
558 564
      */
559 565
     handleUnpaidClick() {
566
+      this.unpaidBenefitFee = ''
560 567
       this.unpaidModalVisible = true
561 568
     },
562 569
 
563 570
     /**
571
+     * 未收弹窗取消 - 重置好处费
572
+     */
573
+    onUnpaidModalCancel() {
574
+      this.unpaidModalVisible = false
575
+      this.unpaidBenefitFee = ''
576
+    },
577
+
578
+    /**
579
+     * 好处费输入 - 限制仅可输入金额(数字、最多两位小数)
580
+     */
581
+    handleUnpaidBenefitFeeInput(e) {
582
+      const value = (e && e.detail && e.detail.value !== undefined) ? e.detail.value : e
583
+      let val = String(value ?? '').trim()
584
+      if (!val) {
585
+        this.unpaidBenefitFee = ''
586
+        return
587
+      }
588
+      // 只保留数字和第一个小数点,且小数点后最多两位
589
+      const parts = val.replace(/[^\d.]/g, '').split('.')
590
+      if (parts.length > 2) {
591
+        val = parts[0] + '.' + parts.slice(1).join('')
592
+      }
593
+      if (parts.length === 2 && parts[1].length > 2) {
594
+        val = parts[0] + '.' + parts[1].slice(0, 2)
595
+      }
596
+      this.unpaidBenefitFee = val
597
+    },
598
+
599
+    /**
564 600
      * 待跟进点击
565 601
      */
566 602
     handleFollowUpClick() {
@@ -656,6 +692,13 @@ export default {
656 692
      */
657 693
     async confirmUnpaid() {
658 694
       try {
695
+        // 若填写了好处费,先更新回单表
696
+        if (this.currentReceipt?.id && (this.unpaidBenefitFee !== '' && this.unpaidBenefitFee != null)) {
697
+          await uni.$u.api.updateReceiptForm({
698
+            id: this.currentReceipt.id,
699
+            benefitFee: this.unpaidBenefitFee
700
+          })
701
+        }
659 702
         await uni.$u.api.addOrderFollow({
660 703
           orderId: this.orderId,
661 704
           content: `未收评分_${this.unpaidRating}`
@@ -666,6 +709,9 @@ export default {
666 709
         })
667 710
         uni.$u.toast('提交未收评级成功')
668 711
         this.unpaidModalVisible = false
712
+        this.unpaidBenefitFee = ''
713
+        // 刷新当前收单数据,以便第四页好处费等字段同步
714
+        this.$emit('price-updated')
669 715
       } catch (error) {
670 716
         console.error('提交失败:', error)
671 717
         uni.$u.toast('提交失败')
@@ -1040,6 +1086,28 @@ export default {
1040 1086
   align-items: center;
1041 1087
 }
1042 1088
 
1089
+.unpaid-benefit-fee-wrap {
1090
+  width: 100%;
1091
+  margin-top: 32rpx;
1092
+  display: flex;
1093
+  flex-direction: column;
1094
+  align-items: flex-start;
1095
+}
1096
+
1097
+.unpaid-benefit-fee-label {
1098
+  font-size: 28rpx;
1099
+  color: #333;
1100
+  margin-bottom: 16rpx;
1101
+}
1102
+
1103
+.unpaid-benefit-fee-input {
1104
+  width: 100%;
1105
+  border: 2rpx solid #e5e7eb;
1106
+  border-radius: 12rpx;
1107
+  padding: 20rpx 24rpx;
1108
+  box-sizing: border-box;
1109
+}
1110
+
1043 1111
 .payment-amount-display {
1044 1112
   font-size: 64rpx;
1045 1113
   font-weight: bold;