shish 11 месяцев назад
Родитель
Сommit
c54f625ebf

+ 16 - 45
hdApp/src/admin/express/create.vue

@@ -181,49 +181,35 @@ export default {
         this.$msg('请输入重量')
         return
       }
-
       if (!this.expressForm.user_name) {
         this.$msg('收货人姓名不能为空')
         return
       }
-
       if (!this.expressForm.user_phone) {
         this.$msg('收货人手机号不能为空')
         return
       }
-
       if (!this.expressForm.user_address) {
         this.$msg('收货地址不能为空')
         return
       }
-
       this.isQuerying = true
-      try {
-        const data = {
-          orderId: this.orderId,
-          price: this.expressForm.price,
-          weight: Number(this.expressForm.weight),
-          packageNum: this.expressForm.packageNum,
-          user_name: this.expressForm.user_name,
-          user_phone: this.expressForm.user_phone,
-          user_address: this.expressForm.user_address,
-          user_lng: this.expressForm.user_lng,
-          user_lat: this.expressForm.user_lat
-        }
-
-        const res = await getStoreFee(data)
-        if (res.code === 1) {
-          const deliveryFee = res.data.est_fee || '0'
-          this.deliveryFee = deliveryFee/100.0
-          this.$msg('运费查询成功')
-        } else {
-          this.$msg(res.msg || '查询运费失败')
-        }
-      } catch (error) {
-        this.$msg('查询运费失败,请重试')
-        console.error('查询运费错误:', error)
-      } finally {
-        this.isQuerying = false
+      const data = {
+        orderId: this.orderId,
+        price: this.expressForm.price,
+        weight: Number(this.expressForm.weight),
+        packageNum: this.expressForm.packageNum,
+        user_name: this.expressForm.user_name,
+        user_phone: this.expressForm.user_phone,
+        user_address: this.expressForm.user_address,
+        user_lng: this.expressForm.user_lng,
+        user_lat: this.expressForm.user_lat
+      }
+      const res = await getStoreFee(data)
+      if (res.code === 1) {
+        const deliveryFee = res.data.est_fee || '0'
+        this.deliveryFee = deliveryFee/100.0
+        this.$msg('运费查询成功')
       }
     },
 
@@ -236,30 +222,24 @@ export default {
         this.$msg('请输入重量')
         return
       }
-
       if (!this.expressForm.user_name) {
         this.$msg('收货人姓名不能为空')
         return
       }
-
       if (!this.expressForm.user_phone) {
         this.$msg('收货人手机号不能为空')
         return
       }
-
       if (!this.expressForm.user_address) {
         this.$msg('收货地址不能为空')
         return
       }
-
       if (!this.deliveryFee) {
         this.$msg('请先查询运费')
         return
       }
-
       this.$util.confirmModal({content: '确认呼叫跑腿?'}, async () => {
         this.isSubmitting = true
-        try {
           const data = {
             orderId: this.orderId,
             weight: Number(this.expressForm.weight),
@@ -273,7 +253,6 @@ export default {
             note: this.expressForm.note,
             isNew: this.isNew
           }
-
           const res = await createExpressOrder(data)
           if (res.code === 1) {
             this.$msg('提交成功')
@@ -281,15 +260,7 @@ export default {
             setTimeout(() => {
               uni.navigateBack()
             }, 1500)
-          } else {
-            this.$msg(res.msg || '创建配送订单失败')
           }
-        } catch (error) {
-          this.$msg('创建配送订单失败,请重试')
-          console.error('创建配送订单错误:', error)
-        } finally {
-          this.isSubmitting = false
-        }
       })
     }
   }

+ 4 - 4
hdApp/src/admin/home/order.vue

@@ -87,10 +87,10 @@
                 <view class="admin-button-com middle default" @click.stop="">呼叫跑腿</view>
               </block>
               <block v-else>
-                <view class="admin-button-com middle" v-if="item.sendStatus == '0' && item.payStatus == 1" @click.stop="openExpressPage(item.id, true)">呼叫跑腿</view>
-                <view class="admin-button-com default" v-if="item.sendStatus == '1' && item.payStatus == 1">已发跑腿</view>
-                <view class="admin-button-com middle" v-if="item.sendStatus == '3' && item.payStatus == 1" @click.stop="openExpressPage(item.id, false)">重叫跑腿</view>
-                <view class="admin-button-com default" v-if="item.sendStatus == '2' && item.payStatus == 1">跑腿完成</view>
+                <view class="admin-button-com middle" v-if="item.sendStatus == '-1'" @click.stop="openExpressPage(item.id, true)">呼叫跑腿</view>
+                <view class="admin-button-com middle" v-else-if="item.sendStatus == '3'" @click.stop="openExpressPage(item.id, false)">重叫跑腿</view>
+                <view class="admin-button-com default" v-else-if="item.sendStatus == '2'">跑腿完成</view>
+                <view class="admin-button-com default" v-else="item.sendStatus == '1' && item.payStatus == 1">已发跑腿</view>
               </block>
 
             </view>

+ 7 - 5
hdApp/src/admin/order/detail.vue

@@ -370,7 +370,7 @@
           v-if="orderInfo.status == 1">
           扫码收款
         </button>
-        <button class="admin-button-com middle" v-if="orderInfo.sendStatus == '0' && orderInfo.payStatus == 1" @click.stop="openExpressPage(orderInfo.id, true)">呼叫跑腿</button>
+        <button class="admin-button-com middle" v-if="orderInfo.sendStatus == '-1' && orderInfo.payStatus == 1" @click.stop="openExpressPage(orderInfo.id, true)">呼叫跑腿</button>
         <button 
           class="admin-button-com middle" 
           @click.stop="printOrder(orderInfo)" 
@@ -583,10 +583,9 @@ export default {
     },
     
     init() {
-      this.getDetailInfo();
-      this.getExpressDetail();
+      this.getDetailInfo()
     },
-    
+
     getDetailInfo() {
       return getDetB({ id: this.option.id }).then(res => {
         this.orderInfo = res.data;
@@ -631,9 +630,12 @@ export default {
       this.showModal = false
     },
     confirmInput() {
+      let that = this
       this.hideGoodsModal()
       expressDetail({ orderId: this.option.id }).then(res => {
-        mockNotify({orderStatus:this.inputValue,wxOrderId:res.data.wxOrderId})
+        mockNotify({orderStatus:this.inputValue,wxOrderId:res.data.wxOrderId}).then(ret=>{
+          that.init()
+        })
       })
     }
   }