Просмотр исходного кода

快捷开单下,选择跑腿配送方式,并且是现在呼叫时,新增重量与跑腿备注表单项。另外,实现监听这些变量,有变化就重新请求运费询价接口

shizhongqi 7 месяцев назад
Родитель
Сommit
1f9d032da6

+ 325 - 14
ghsApp/src/admin/billing/affirm.vue

@@ -331,7 +331,6 @@
                     <view class="distance-box">
                       <text v-if="showDistance > 100" class="blue-text">{{ (showDistance/1000).toFixed(1) }}公里</text>
                       <text v-else class="blue-text">{{ showDistance }} 米</text>
-                      <!-- <input type="digit" :value="showDistance/1000" placeholder-class="tui-placeholder" style="text-align:left;width:70upx;margin-right:10upx;"/>公里 -->
                     </view>
                   </tui-list-cell>
                   <tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -341,12 +340,6 @@
                   </tui-list-cell>
                   <tui-list-cell class="line-cell" :hover="false" :arrow="false">
                     <view class="tui-title">运费</view>
-                    <!-- <text v-if="form.reductionRule == 0" class="blue-text">¥{{ form.sendCost }}</text>
-                    <text v-if="form.reductionRule == 1" class="free-delivery-tag">
-                      <text v-if="isHcMapRule()"><text class="strike-through">¥{{ form.sendCost }}</text>【花材免跑腿费】</text>
-                      <text v-else>¥{{ form.sendCost }}</text>
-                    </text> -->
-                    
                     <view v-if="form.reductionRule == 1 && isHcMapRule()">
                       <input type="digit" placeholder="请填写运费" v-model="form.customSendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;"/>
                     </view>
@@ -366,6 +359,30 @@
                       <text class="iconfont iconxiangyou icon-arrow-right"></text>
                     </view>
                   </tui-list-cell>
+                  <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
+                    <view class="tui-title">重量</view>
+                    <view>
+                      <view class="weight-input-wrapper">
+                        <view class="weight-control">
+                          <view class="control-btn minus-btn" @click="decreaseWeight">
+                            <text>-</text>
+                          </view>
+                          <input type="number" v-model.number="form.weight" placeholder="请输入货物总重量" @blur="validateWeight" />
+                          <view class="control-btn plus-btn" @click="increaseWeight">
+                            <text>+</text>
+                          </view>
+                        </view>
+                        <text class="unit">公斤</text>
+                      </view>
+                    </view>
+                  </tui-list-cell>
+                  <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
+                    <view class="tui-title">跑腿备注</view>
+                    <view class="remark-action" @click="openRemarkModal">
+                      <text :class="{ placeholder: !form.deliveryRemark }">{{ form.deliveryRemark || '请填写配送备注' }}</text>
+                      <text class="iconfont iconxiangyou icon-arrow-right"></text>
+                    </view>
+                  </tui-list-cell>
                 </view>
                 <view v-else class="delivery-section">
                   <tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -581,6 +598,29 @@
 
       <!-- 取件时间选择器 -->
       <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
+
+      <!-- 备注输入弹窗 -->
+      <view class="remark-modal" v-if="showRemarkModal" @click="closeRemarkModal">
+        <view class="modal-content" @click.stop>
+          <view class="modal-header">
+            <text class="modal-title">填写备注信息</text>
+          </view>
+          <view class="modal-body">
+            <textarea 
+              v-model="tempRemark" 
+              placeholder="请输入备注信息" 
+              maxlength="200"
+              :auto-height="true"
+              class="remark-textarea"
+            />
+            <view class="char-count">{{ tempRemark.length }}/200</view>
+          </view>
+          <view class="modal-footer">
+            <button class="modal-btn cancel-btn" @click="closeRemarkModal">取消</button>
+            <button class="modal-btn confirm-btn" @click="confirmRemark">确认</button>
+          </view>
+        </view>
+      </view>
     </view>
   </view>
 </template>
@@ -665,7 +705,9 @@ export default {
         dealPrice: 0,
         wlName: '',
         reductionRule: 0,
-        callErrand: 0 //现在呼叫 0 晚点呼叫 1
+        callErrand: 0, //现在呼叫 0 晚点呼叫 1
+        weight: 1,
+        deliveryRemark: '',
       },
       showCustomer: false,
       customInfo: { discount: 1 },
@@ -683,7 +725,14 @@ export default {
       book: 0,
       selectStaff: { id: '', name: '' },
       showFinance: 0,
-      hasFinance: 0
+      hasFinance: 0,
+      // 备注弹窗相关
+      showRemarkModal: false,
+      tempRemark: '',
+      //-------------
+    
+      // 重量输入防抖定时器
+      weightDebounceTimer: null,
     };
   },
   onLoad(option) {
@@ -778,6 +827,12 @@ export default {
   onUnload() {
     uni.removeStorageSync('newClient');
     uni.$off('listenGetScanCode');
+
+    // 页面卸载时清除定时器
+    if (this.weightDebounceTimer) {
+      clearTimeout(this.weightDebounceTimer);
+      this.weightDebounceTimer = null;
+    }
   },
   computed: {
     ...mapGetters(['getMerchantInfo', 'getMyShopInfo', 'getLoginInfo']),
@@ -845,6 +900,50 @@ export default {
       return currentPrice;
     }
   },
+  watch: {
+    // 监听重量变化
+    'form.weight'(newVal, oldVal) {
+      // 清除之前的定时器
+      if (this.weightDebounceTimer) {
+        clearTimeout(this.weightDebounceTimer);
+        this.weightDebounceTimer = null;
+      }
+      
+      // 如果有运力列表且值变化了,清空运力列表
+      if (this.deliveryQuotes.length > 0) {
+        this.clearDeliveryList();
+      }
+      
+      // 设置新的定时器,1秒后自动加载运力
+      this.weightDebounceTimer = setTimeout(() => {
+        // 只有当重量值有效时才自动加载
+        if (newVal && Number(newVal) > 0 && this.form.sendType == 2) {
+          this.handleLoadDelivery();
+        }
+      }, 1000);
+    },
+    // 监听取件时间变化
+    pickupTime: {
+      handler(newVal, oldVal) {
+        if (this.deliveryQuotes.length > 0) {
+          this.clearDeliveryList();
+        }
+        if (this.form.sendType == 2) {
+          this.getDeliveryQuotes();
+        }
+      },
+      deep: true
+    },
+    // 监听备注变化
+    'form.deliveryRemark'(newVal, oldVal) {
+      if (this.deliveryQuotes.length > 0) {
+        this.clearDeliveryList();
+      }
+      if (this.form.sendType == 2) {
+        this.getDeliveryQuotes();
+      }
+    }
+  },
   methods: {
     init() {},
     ...mapActions(['initMerchantInfo']),
@@ -999,6 +1098,7 @@ export default {
         params.deliveryPrice = this.selectedDeliveryData.priceNumber; // 报价金额
         params.deliveryDistance = this.showDistance; // 配送距离
         params.deliveryBracketContent = this.selectedDeliveryData.bracketContent; // 配送平台括号里的内容
+        params.deliveryAllParams = this.selectedDeliveryData; // 配送平台所有参数
         if (this.form.callErrand == 1) {
           params.pickupTime = this.pickupTime.value;
         }
@@ -1118,7 +1218,8 @@ export default {
 
       quickOrderAllDeliveryQuotes({
         totalPrice: this.allPrice,
-        weight: 1, //this.allCount.weight
+        weight: this.form.weight,
+        remark: this.form.deliveryRemark,
         customId: this.option.customId,
         pickupTime: this.pickupTime.value
       })
@@ -1182,9 +1283,6 @@ export default {
     },
     handleTimeConfirm(time) {
       this.pickupTime = time;
-      if (this.form.sendType == 2) {
-        this.getDeliveryQuotes();
-      }
     },
     getCustomDetail() {
       let that = this;
@@ -1198,7 +1296,58 @@ export default {
     updateCustomAddress(){
       this.isUpdateAddress = true;
       this.$util.pageTo({ url: '/pagesClient/member/modify?id='+this.customInfo.id+'&name='+this.customInfo.name })
-    }
+    },
+    // 减少重量
+    decreaseWeight() {
+      if (this.form.weight > 1) {
+        this.form.weight = Number(this.form.weight) - 1;
+      }
+    },
+    // 增加重量
+    increaseWeight() {
+      this.form.weight = Number(this.form.weight) + 1;
+    },
+    // 验证重量输入
+    validateWeight() {
+      // 确保重量至少为1
+      if (!this.form.weight || Number(this.form.weight) < 1) {
+        this.form.weight = 1;
+      }
+      // 确保是整数
+      this.form.weight = Math.floor(Number(this.form.weight));
+    },
+    openRemarkModal() {
+      // 打开弹窗时,将当前备注内容赋值给临时变量
+      this.tempRemark = this.form.deliveryRemark;
+      this.showRemarkModal = true;
+    },
+    closeRemarkModal() {
+      this.showRemarkModal = false;
+      this.form.deliveryRemark = '';
+      this.tempRemark = '';
+    },
+    confirmRemark() {
+      // 更新备注
+      this.form.deliveryRemark = this.tempRemark;
+      // 关闭弹窗
+      this.showRemarkModal = false;
+      this.tempRemark = '';
+    },
+    handleLoadDelivery() {
+      // 校验重量是否填写
+      if (!this.form.weight || Number(this.form .weight) <= 0) {
+        this.$msg('请先填写货物重量');
+        return;
+      }
+      // 执行加载运力
+      this.getDeliveryQuotes();
+    },
+    // 清空运力列表
+    clearDeliveryList() {
+      this.deliveryQuotes = [];
+      this.selectedDeliveryIndex = -1;
+      this.selectedDeliveryData = null;
+    },
   }
 };
 </script>
@@ -1637,4 +1786,166 @@ export default {
         margin-top: 6upx;
     }
 }
+.weight-input-wrapper {
+  flex-shrink: 0;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  
+  .weight-control {
+    display: flex;
+    align-items: center;
+    border: 1upx solid #e0e0e0;
+    border-radius: 8upx;
+    overflow: hidden;
+    background-color: #f9f9f9;
+    
+    .control-btn {
+      width: 60rpx;
+      height: 60rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #f5f5f5;
+      color: #666666;
+      font-size: 36rpx;
+      font-weight: bold;
+      transition: all 0.2s;
+      user-select: none;
+      
+      &:active {
+        background-color: #e0e0e0;
+      }
+      
+      &.minus-btn {
+        border-right: 1rpx solid #e0e0e0;
+      }
+      
+      &.plus-btn {
+        border-left: 1rpx solid #e0e0e0;
+      }
+    }
+    
+    input {
+      flex: 1;
+      width: 100rpx;
+      height: 60rpx;
+      font-size: 28rpx;
+      color: #333333;
+      border: none;
+      background-color: #ffffff;
+      text-align: center;
+      padding: 0 10rpx;
+      
+      &::placeholder {
+        color: #999999;
+        font-size: 24rpx;
+      }
+    }
+  }
+  
+  .unit {
+    font-size: 28upx;
+    color: #666666;
+    margin-left: 20upx;
+    flex-shrink: 0;
+  }
+}
+.remark-action {
+  color: #3385FF;
+  display: flex;
+  align-items: center;
+  font-size: 28upx;
+  flex: 1;
+  justify-content: flex-end;
+  
+  text {
+    color: #333333;
+    margin-right: 8upx;
+    
+    &.placeholder {
+      color: #999999;
+    }
+  }
+}
+/* 备注输入弹窗 */
+.remark-modal {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background-color: rgba(0, 0, 0, 0.5);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 9999;
+
+  .modal-content {
+    width: 600upx;
+    background-color: white;
+    border-radius: 16upx;
+    overflow: hidden;
+  }
+
+  .modal-header {
+    padding: 30upx 30upx 20upx;
+    border-bottom: 1upx solid #f0f0f0;
+
+    .modal-title {
+      font-size: 32upx;
+      font-weight: bold;
+      color: #333333;
+    }
+  }
+
+  .modal-body {
+    padding: 30upx;
+
+    .remark-textarea {
+      width: 100%;
+      min-height: 200upx;
+      padding: 20upx;
+      font-size: 28upx;
+      color: #333333;
+      background-color: #f9f9f9;
+      border-radius: 8upx;
+      border: 1upx solid #e0e0e0;
+      box-sizing: border-box;
+    }
+
+    .char-count {
+      margin-top: 10upx;
+      font-size: 24upx;
+      color: #999999;
+      text-align: right;
+    }
+  }
+
+  .modal-footer {
+    display: flex;
+    border-top: 1upx solid #f0f0f0;
+
+    .modal-btn {
+      flex: 1;
+      height: 90upx;
+      line-height: 90upx;
+      font-size: 30upx;
+      border: none;
+      background-color: transparent;
+      margin: 0;
+      padding: 0;
+
+      &.cancel-btn {
+        color: #666666;
+        border-right: 1upx solid #f0f0f0;
+      }
+
+      &.confirm-btn {
+        color: #3385FF;
+        font-weight: 500;
+      }
+    }
+  }
+}
 </style>

+ 15 - 34
ghsApp/src/admin/delivery/allDelivery.vue

@@ -182,15 +182,6 @@ export default {
         // 备注弹窗相关
         showRemarkModal: false,
         tempRemark: '',
-        // 用于保存表单的旧值,用于判断是否变动
-        oldFormData: {
-          weight: 1,
-          pickupTime: {
-            label: '立即取件',
-            value: dayjs().format('YYYY-MM-DD HH:mm'),
-          },
-          remark: '',
-        },
         // 加载运力的loading状态
         isLoadingDelivery: false,
         // 是否已经尝试加载过运力
@@ -253,7 +244,7 @@ export default {
   },
   watch: {
     // 监听重量变化
-    weight(newVal, oldVal) {
+    weight(newVal) {
       // 清除之前的定时器
       if (this.weightDebounceTimer) {
         clearTimeout(this.weightDebounceTimer);
@@ -261,7 +252,7 @@ export default {
       }
       
       // 如果有运力列表且值变化了,清空运力列表
-      if (this.deliveryList.length > 0 && newVal !== this.oldFormData.weight) {
+      if (this.deliveryList.length > 0) {
         this.clearDeliveryList();
       }
       
@@ -275,18 +266,20 @@ export default {
     },
     // 监听取件时间变化
     pickupTime: {
-      handler(newVal, oldVal) {
-        if (this.deliveryList.length > 0 && newVal.value !== this.oldFormData.pickupTime.value) {
+      handler(newVal) {
+        if (this.deliveryList.length > 0) {
           this.clearDeliveryList();
         }
+        this.handleLoadDelivery();
       },
       deep: true
     },
     // 监听备注变化
-    remark(newVal, oldVal) {
-      if (this.deliveryList.length > 0 && newVal !== this.oldFormData.remark) {
+    remark(newVal) {
+      if (this.deliveryList.length > 0) {
         this.clearDeliveryList();
       }
+      this.handleLoadDelivery();
     }
   },
   methods: {
@@ -306,19 +299,9 @@ export default {
       this.selectedDelivery = null;
       this.hasAttemptedLoad = false;
     },
-
-    // 保存表单数据的当前值
-    saveFormData() {
-      this.oldFormData = {
-        weight: this.weight,
-        pickupTime: {
-          label: this.pickupTime.label,
-          value: this.pickupTime.value,
-        },
-        remark: this.remark,
-      };
-    },
-
+    /**
+     * 获取订单详情
+     */
     loadOrderData() {
       address({ orderId: this.orderId }).then(res => {
         if (res && res.code === 1) {
@@ -348,8 +331,6 @@ export default {
               if (!selectionExists) {
                   this.selectedDelivery = this.deliveryList[0].name;
               }
-              // 加载成功后保存当前表单数据
-              this.saveFormData();
             }
           }
         }
@@ -374,7 +355,7 @@ export default {
     handleTimeConfirm(time) {
       this.pickupTime = time;
       // 取件时间修改后自动加载运力
-      this.handleLoadDelivery();
+      // this.handleLoadDelivery();
     },
     openRemarkModal() {
       // 打开弹窗时,将当前备注内容赋值给临时变量
@@ -395,9 +376,9 @@ export default {
       this.tempRemark = '';
       
       // 如果有输入内容(不为空且不是纯空格),则自动执行加载运力
-      if (this.remark && this.remark.trim()) {
-        this.handleLoadDelivery();
-      }
+      // if (this.remark && this.remark.trim()) {
+      //   this.handleLoadDelivery();
+      // }
     },
     handleLoadDelivery() {
       // 校验重量是否填写

+ 49 - 0
ghsPad/src/pages/home/components/settlePop.vue

@@ -97,6 +97,32 @@
                         </view>
                     </view>
 
+                    <view class="select-item_box" v-if="form.callErrand == 1">
+                        <view class="title">重量</view>
+                        <view>
+                        <view class="weight-input-wrapper">
+                            <view class="weight-control">
+                                <view class="control-btn minus-btn" @click="decreaseWeight">
+                                <text>-</text>
+                                </view>
+                                <input type="number" v-model.number="form.weight" placeholder="请输入货物总重量" @blur="validateWeight" />
+                                <view class="control-btn plus-btn" @click="increaseWeight">
+                                <text>+</text>
+                                </view>
+                            </view>
+                            <text class="unit">公斤</text>
+                        </view>
+                    </view>
+                    </view>
+
+                    <view class="select-item_box" v-if="form.callErrand == 1">
+                        <view class="title">跑腿备注</view>
+                        <view class="remark-action" @click="openRemarkModal">
+                            <text :class="{ placeholder: !form.deliveryRemark }">{{ form.deliveryRemark || '请填写配送备注' }}</text>
+                            <text class="iconfont iconxiangyou icon-arrow-right"></text>
+                        </view>
+                    </view>
+
                 </view>
                 <view v-else class="delivery-section">
                     <view class="select-item_box">
@@ -216,6 +242,29 @@
 
         <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
 
+        <!-- 备注输入弹窗 -->
+        <view class="remark-modal" v-if="showRemarkModal" @click="closeRemarkModal">
+            <view class="modal-content" @click.stop>
+                <view class="modal-header">
+                <text class="modal-title">填写备注信息</text>
+                </view>
+                <view class="modal-body">
+                <textarea 
+                    v-model="tempRemark" 
+                    placeholder="请输入备注信息" 
+                    maxlength="200"
+                    :auto-height="true"
+                    class="remark-textarea"
+                />
+                <view class="char-count">{{ tempRemark.length }}/200</view>
+                </view>
+                <view class="modal-footer">
+                <button class="modal-btn cancel-btn" @click="closeRemarkModal">取消</button>
+                <button class="modal-btn confirm-btn" @click="confirmRemark">确认</button>
+                </view>
+            </view>
+        </view>
+
     </view>
 </template>
 <script>

+ 331 - 22
hdApp/src/admin/billing/affirm.vue

@@ -250,6 +250,30 @@
                   <text class="iconfont iconxiangyou icon-arrow-right"></text>
                 </view>
               </tui-list-cell>
+              <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
+                  <view class="tui-title">重量</view>
+                  <view>
+                    <view class="weight-input-wrapper">
+                      <view class="weight-control">
+                        <view class="control-btn minus-btn" @click="decreaseWeight">
+                          <text>-</text>
+                        </view>
+                        <input type="number" v-model.number="form.weight" placeholder="请输入货物总重量" @blur="validateWeight" />
+                        <view class="control-btn plus-btn" @click="increaseWeight">
+                          <text>+</text>
+                        </view>
+                      </view>
+                      <text class="unit">公斤</text>
+                    </view>
+                  </view>
+                </tui-list-cell>
+                <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
+                  <view class="tui-title">跑腿备注</view>
+                  <view class="remark-action" @click="openRemarkModal">
+                    <text :class="{ placeholder: !form.deliveryRemark }">{{ form.deliveryRemark || '请填写配送备注' }}</text>
+                    <text class="iconfont iconxiangyou icon-arrow-right"></text>
+                  </view>
+                </tui-list-cell>
             </view>
             <view v-else class="delivery-section">
               <tui-list-cell class="line-cell" :hover="false" :arrow="false">
@@ -497,6 +521,29 @@
     <!-- 取件时间选择器 -->
     <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
 
+    <!-- 备注输入弹窗 -->
+    <view class="remark-modal" v-if="showRemarkModal" @click="closeRemarkModal">
+      <view class="modal-content" @click.stop>
+        <view class="modal-header">
+          <text class="modal-title">填写备注信息</text>
+        </view>
+        <view class="modal-body">
+          <textarea 
+            v-model="tempRemark" 
+            placeholder="请输入备注信息" 
+            maxlength="200"
+            :auto-height="true"
+            class="remark-textarea"
+          />
+          <view class="char-count">{{ tempRemark.length }}/200</view>
+        </view>
+        <view class="modal-footer">
+          <button class="modal-btn cancel-btn" @click="closeRemarkModal">取消</button>
+          <button class="modal-btn confirm-btn" @click="confirmRemark">确认</button>
+        </view>
+      </view>
+    </view>
+
     </view>
   </view>
 </template>
@@ -566,7 +613,9 @@ export default {
         forwardStock:1,
         fromType:1,//门店来的订单
         reductionRule: 0,
-        callErrand: 0 //现在呼叫 0 晚点呼叫 1
+        callErrand: 0, //现在呼叫 0 晚点呼叫 1
+        weight: 1,
+        deliveryRemark: '',
       },
       showCustomer: false,
       customInfo:{discount:1,balance:0},
@@ -599,6 +648,12 @@ export default {
           label: '立即取件',
           value: dayjs().format('YYYY-MM-DD HH:mm'),
       },
+      // 备注弹窗相关
+      showRemarkModal: false,
+      tempRemark: '',
+      //-------------
+      // 重量输入防抖定时器
+      weightDebounceTimer: null,
     };
   },
   onLoad (option) {
@@ -626,12 +681,6 @@ export default {
 
     if(Number(option.customId) > 0){
       this.form.customId = option.customId
-      // let that = this
-      // getCustomInfo({ id: option.customId }).then(res => {
-      //   that.form.customName = res.data.custom.name
-      //   that.customInfo = res.data.custom
-      //   that.$forceUpdate()
-      // })
       this.getCustomDetail();
 
       //用于混入product的已选中花材!!!!!
@@ -680,9 +729,65 @@ export default {
     }
 	},
 	onUnload(){
-			uni.removeStorageSync('newClient')
-      uni.$off('listenGetScanCode')
+    uni.removeStorageSync('newClient')
+    uni.$off('listenGetScanCode')
+
+    // 页面卸载时清除定时器
+    if (this.weightDebounceTimer) {
+      clearTimeout(this.weightDebounceTimer);
+      this.weightDebounceTimer = null;
+    }
 	},
+  watch: {
+    // 监听重量变化
+    'form.weight'(newVal) {
+      // 清除之前的定时器
+      if (this.weightDebounceTimer) {
+        clearTimeout(this.weightDebounceTimer);
+        this.weightDebounceTimer = null;
+      }
+      
+      // 如果有运力列表且值变化了,清空运力列表
+      if (this.deliveryQuotes.length > 0) {
+        this.clearDeliveryList();
+      }
+      
+      // 设置新的定时器,1秒后自动加载运力
+      this.weightDebounceTimer = setTimeout(() => {
+        // 只有当重量值有效时才自动加载
+        if (newVal && Number(newVal) > 0 && this.form.sendType == 2) {
+          this.handleLoadDelivery();
+        }
+      }, 1000);
+    },
+    // 监听取件时间变化
+    pickupTime: {
+      handler() {
+        if (this.deliveryQuotes.length > 0) {
+          this.clearDeliveryList();
+        }
+        if (this.form.sendType == 2) {
+          this.getDeliveryQuotes();
+        }
+      },
+      deep: true
+    },
+    // 监听备注变化
+    'form.deliveryRemark'() {
+      if (this.deliveryQuotes.length > 0) {
+        this.clearDeliveryList();
+      }
+      if (this.form.sendType == 2) {
+        this.getDeliveryQuotes();
+      }
+    },
+    systemPrice: {
+      handler(val) {
+        this.modifyPrice = val
+      },
+      immediate: true
+    }
+  },
   computed: {
     ...mapGetters(["getMerchantInfo", "getMyShopInfo", "getLoginInfo"]),
     systemPrice(){
@@ -725,14 +830,6 @@ export default {
     //   return cost
     // }
   },
-  watch: {
-    systemPrice: {
-      handler(val) {
-        this.modifyPrice = val
-      },
-      immediate: true
-    }
-  },
   methods: {
     init () {},
     ...mapActions(["initMerchantInfo"]),
@@ -1006,6 +1103,7 @@ export default {
         params.deliveryPrice = this.selectedDeliveryData.priceNumber // 报价金额
         params.deliveryDistance = this.showDistance // 配送距离
         params.deliveryBracketContent = this.selectedDeliveryData.bracketContent // 配送平台括号里的内容
+        params.deliveryAllParams = this.selectedDeliveryData; // 配送平台所有参数
         if(this.form.callErrand == 1){
           params.pickupTime = this.pickupTime.value
         }
@@ -1080,7 +1178,8 @@ export default {
 
       quickOrderAllDeliveryQuotes({
         totalPrice: this.allPrice,
-        weight: 1, //this.allCount.weight
+        weight: this.form.weight,
+        remark: this.form.deliveryRemark,
         customId: this.option.customId,
         pickupTime: this.pickupTime.value,
       }).then(res=>{
@@ -1143,9 +1242,6 @@ export default {
     },
     handleTimeConfirm(time) {
       this.pickupTime = time;
-      if (this.form.sendType == 2) {
-          this.getDeliveryQuotes();
-      }
     },
     getCustomDetail(){
       let that = this
@@ -1158,7 +1254,58 @@ export default {
     updateCustomAddress(){
       this.isUpdateAddress = true;
       this.$util.pageTo({ url: '/admin/member/modify?id='+this.customInfo.id+'&name='+this.customInfo.name })
-    }
+    },
+    // 减少重量
+    decreaseWeight() {
+      if (this.form.weight > 1) {
+        this.form.weight = Number(this.form.weight) - 1;
+      }
+    },
+    // 增加重量
+    increaseWeight() {
+      this.form.weight = Number(this.form.weight) + 1;
+    },
+    // 验证重量输入
+    validateWeight() {
+      // 确保重量至少为1
+      if (!this.form.weight || Number(this.form.weight) < 1) {
+        this.form.weight = 1;
+      }
+      // 确保是整数
+      this.form.weight = Math.floor(Number(this.form.weight));
+    },
+    openRemarkModal() {
+      // 打开弹窗时,将当前备注内容赋值给临时变量
+      this.tempRemark = this.form.deliveryRemark;
+      this.showRemarkModal = true;
+    },
+    closeRemarkModal() {
+      this.showRemarkModal = false;
+      this.form.deliveryRemark = '';
+      this.tempRemark = '';
+    },
+    confirmRemark() {
+      // 更新备注
+      this.form.deliveryRemark = this.tempRemark;
+      // 关闭弹窗
+      this.showRemarkModal = false;
+      this.tempRemark = '';
+    },
+    handleLoadDelivery() {
+      // 校验重量是否填写
+      if (!this.form.weight || Number(this.form .weight) <= 0) {
+        this.$msg('请先填写货物重量');
+        return;
+      }
+      // 执行加载运力
+      this.getDeliveryQuotes();
+    },
+    // 清空运力列表
+    clearDeliveryList() {
+      this.deliveryQuotes = [];
+      this.selectedDeliveryIndex = -1;
+      this.selectedDeliveryData = null;
+    },
   }
 };
 </script>
@@ -1904,4 +2051,166 @@ export default {
         margin-top: 6upx;
     }
 }
+.weight-input-wrapper {
+  flex-shrink: 0;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  
+  .weight-control {
+    display: flex;
+    align-items: center;
+    border: 1upx solid #e0e0e0;
+    border-radius: 8upx;
+    overflow: hidden;
+    background-color: #f9f9f9;
+    
+    .control-btn {
+      width: 60rpx;
+      height: 60rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      background-color: #f5f5f5;
+      color: #666666;
+      font-size: 36rpx;
+      font-weight: bold;
+      transition: all 0.2s;
+      user-select: none;
+      
+      &:active {
+        background-color: #e0e0e0;
+      }
+      
+      &.minus-btn {
+        border-right: 1rpx solid #e0e0e0;
+      }
+      
+      &.plus-btn {
+        border-left: 1rpx solid #e0e0e0;
+      }
+    }
+    
+    input {
+      flex: 1;
+      width: 100rpx;
+      height: 60rpx;
+      font-size: 28rpx;
+      color: #333333;
+      border: none;
+      background-color: #ffffff;
+      text-align: center;
+      padding: 0 10rpx;
+      
+      &::placeholder {
+        color: #999999;
+        font-size: 24rpx;
+      }
+    }
+  }
+  
+  .unit {
+    font-size: 28upx;
+    color: #666666;
+    margin-left: 20upx;
+    flex-shrink: 0;
+  }
+}
+.remark-action {
+  color: #3385FF;
+  display: flex;
+  align-items: center;
+  font-size: 28upx;
+  flex: 1;
+  justify-content: flex-end;
+  
+  text {
+    color: #333333;
+    margin-right: 8upx;
+    
+    &.placeholder {
+      color: #999999;
+    }
+  }
+}
+/* 备注输入弹窗 */
+.remark-modal {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background-color: rgba(0, 0, 0, 0.5);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 9999;
+
+  .modal-content {
+    width: 600upx;
+    background-color: white;
+    border-radius: 16upx;
+    overflow: hidden;
+  }
+
+  .modal-header {
+    padding: 30upx 30upx 20upx;
+    border-bottom: 1upx solid #f0f0f0;
+
+    .modal-title {
+      font-size: 32upx;
+      font-weight: bold;
+      color: #333333;
+    }
+  }
+
+  .modal-body {
+    padding: 30upx;
+
+    .remark-textarea {
+      width: 100%;
+      min-height: 200upx;
+      padding: 20upx;
+      font-size: 28upx;
+      color: #333333;
+      background-color: #f9f9f9;
+      border-radius: 8upx;
+      border: 1upx solid #e0e0e0;
+      box-sizing: border-box;
+    }
+
+    .char-count {
+      margin-top: 10upx;
+      font-size: 24upx;
+      color: #999999;
+      text-align: right;
+    }
+  }
+
+  .modal-footer {
+    display: flex;
+    border-top: 1upx solid #f0f0f0;
+
+    .modal-btn {
+      flex: 1;
+      height: 90upx;
+      line-height: 90upx;
+      font-size: 30upx;
+      border: none;
+      background-color: transparent;
+      margin: 0;
+      padding: 0;
+
+      &.cancel-btn {
+        color: #666666;
+        border-right: 1upx solid #f0f0f0;
+      }
+
+      &.confirm-btn {
+        color: #3385FF;
+        font-weight: 500;
+      }
+    }
+  }
+}
 </style>

+ 9 - 39
hdApp/src/admin/delivery/allDelivery.vue

@@ -177,15 +177,6 @@ export default {
         // 备注弹窗相关
         showRemarkModal: false,
         tempRemark: '',
-        // 用于保存表单的旧值,用于判断是否变动
-        oldFormData: {
-          weight: 1,
-          pickupTime: {
-            label: '立即取件',
-            value: dayjs().format('YYYY-MM-DD HH:mm'),
-          },
-          remark: '',
-        },
         // 加载运力的loading状态
         isLoadingDelivery: false,
         // 重量输入防抖定时器
@@ -246,7 +237,7 @@ export default {
   },
   watch: {
     // 监听重量变化
-    weight(newVal, oldVal) {
+    weight(newVal) {
       // 清除之前的定时器
       if (this.weightDebounceTimer) {
         clearTimeout(this.weightDebounceTimer);
@@ -254,7 +245,7 @@ export default {
       }
       
       // 如果有运力列表且值变化了,清空运力列表
-      if (this.deliveryList.length > 0 && newVal !== this.oldFormData.weight) {
+      if (this.deliveryList.length > 0) {
         this.clearDeliveryList();
       }
       
@@ -268,18 +259,20 @@ export default {
     },
     // 监听取件时间变化
     pickupTime: {
-      handler(newVal, oldVal) {
-        if (this.deliveryList.length > 0 && newVal.value !== this.oldFormData.pickupTime.value) {
+      handler(newVal) {
+        if (this.deliveryList.length > 0) {
           this.clearDeliveryList();
         }
+        this.handleLoadDelivery();
       },
       deep: true
     },
     // 监听备注变化
-    remark(newVal, oldVal) {
-      if (this.deliveryList.length > 0 && newVal !== this.oldFormData.remark) {
+    remark(newVal) {
+      if (this.deliveryList.length > 0) {
         this.clearDeliveryList();
       }
+      this.handleLoadDelivery();
     }
   },
   methods: {
@@ -301,18 +294,6 @@ export default {
       this.selectedDelivery = null;
     },
 
-    // 保存表单数据的当前值
-    saveFormData() {
-      this.oldFormData = {
-        weight: this.weight,
-        pickupTime: {
-          label: this.pickupTime.label,
-          value: this.pickupTime.value,
-        },
-        remark: this.remark,
-      };
-    },
-
     loadOrderData() {
       address({ orderId: this.orderId }).then(res => {
         if (res && res.code === 1) {
@@ -339,11 +320,9 @@ export default {
             if (res.data.deliveryList && res.data.deliveryList.length > 0) {
               this.deliveryList = res.data.deliveryList.filter(item => item.isAble);
               const selectionExists = this.deliveryList.some(item => item.name === this.selectedDelivery);
-              if (!selectionExists) {
+              if (!selectionExists && this.deliveryList.length > 0) {
                   this.selectedDelivery = this.deliveryList[0].name;
               }
-              // 加载成功后保存当前表单数据
-              this.saveFormData();
             }
           }
         }
@@ -366,8 +345,6 @@ export default {
     },
     handleTimeConfirm(time) {
       this.pickupTime = time;
-      // 取件时间修改后自动加载运力
-      this.handleLoadDelivery();
     },
     openRemarkModal() {
       // 打开弹窗时,将当前备注内容赋值给临时变量
@@ -379,18 +356,11 @@ export default {
       this.tempRemark = '';
     },
     confirmRemark() {
-      // 保存旧的备注值
-      const oldRemark = this.remark;
       // 更新备注
       this.remark = this.tempRemark;
       // 关闭弹窗
       this.showRemarkModal = false;
       this.tempRemark = '';
-      
-      // 如果有输入内容(不为空且不是纯空格),则自动执行加载运力
-      if (this.remark && this.remark.trim()) {
-        this.handleLoadDelivery();
-      }
     },
     handleLoadDelivery() {
       // 校验重量是否填写