Parcourir la source

Merge branch 'zhongqi-delivery'

shish il y a 7 mois
Parent
commit
dda7df7b91

+ 1 - 1
ghsApp/src/admin/home/components/OrderItem.vue

@@ -134,7 +134,7 @@
         <block v-else-if="[0, 1, 2, 3, 4, 10, 20, 30].includes(Number(item.sendStatus))">
         <block v-else-if="[0, 1, 2, 3, 4, 10, 20, 30].includes(Number(item.sendStatus))">
           <view class="text-center"><button class="admin-button-com" @click="cancelExpressOrder(item)">取消跑腿</button></view>
           <view class="text-center"><button class="admin-button-com" @click="cancelExpressOrder(item)">取消跑腿</button></view>
         </block>
         </block>
-        <block v-else-if="[-1, -2].includes(Number(item.sendStatus)) && item.status == 2">
+        <block v-else-if="[-1, -2].includes(Number(item.sendStatus)) && [2, 3].includes(Number(item.status))">
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">重叫跑腿</button></view>
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">重叫跑腿</button></view>
         </block>
         </block>
         <!--
         <!--

+ 121 - 11
ghsApp/src/admin/shop/sk.vue

@@ -61,7 +61,58 @@
             </radio-group>
             </radio-group>
           </tui-list-cell>
           </tui-list-cell>
 
 
-          <!-- 花材批发和零售 -->
+
+          <!-- 批发花材 -->
+          <view class="action-btn" style="border-top:2upx solid #2bb931;margin-top:20upx;">
+            <text style="font-size: 30upx;font-weight: bold;">【批发-花材】跑腿费计算方式</text>
+          </view>
+          <view style="display: flex; align-items: center; margin-left:30upx;">
+            <input class="input-field" type="number" v-model="pfHcFreeKm" placeholder="0" style="width:100upx;" @focus="pfHcFreeKm = ''" />
+            <text style="margin-left: 20upx;font-size:30upx;">公里内免费配送</text>
+          </view>
+          <view class="action-btn">
+            <button class="btn-add" style="background-color: #3385FF;" @click="addPfFlowerMaterial">添加</button>
+          </view>
+          <view class="material-list">
+            <view v-for="(item, index) in pfFlowerMaterials" :key="index" class="material-item">
+              <view class="material-info">
+                <view class="info-row">
+                  <text>满</text>
+                  <input class="input-field" v-model="item.num" type="number" placeholder="0" @focus="clearItemField(item, 'num')" />
+                  <text>扎,</text>
+                  <input class="input-field" v-model="item.price" type="digit" placeholder="0" @focus="clearItemField(item, 'price')" />
+                  <text>元,</text>
+                  <input class="input-field" v-model="item.distance" type="digit" placeholder="0" @focus="clearItemField(item, 'distance')" />
+                  <text>公里内免费配送</text>
+                </view>
+              </view>
+              <button class="btn-delete" style="background-color: #3385FF;" @click="deletePfFlowerMaterial(index)">删除</button>
+            </view>
+          </view>
+
+          <view class="warning-text">如不符合以上情况的,按实际跑腿费计算</view>
+
+          <!-- 批发花束 -->
+          <view class="section-title" style="border-top:2upx solid #2bb931;">【批发-花束】跑腿费计算方式</view>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">包运费的</view>
+            <input class="input-field" v-model="pfHsFreeKm" type="number" placeholder="0" @focus="pfHsFreeKm = ''" />
+            <view>公里内免费配送</view>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">{{pfHsFreeKm}}公里以上</view>
+            <view class="input-row">
+              <text>每公里加收</text>
+              <input class="input-field" v-model="pfHsAddFee" type="digit" placeholder="0" @focus="pfHsAddFee = ''" />
+              <text>元</text>
+            </view>
+          </tui-list-cell>
+
+          <view class="warning-text">没有包运费的花束,按实际跑腿费计算</view>
+
+          <!-- 零售花材 -->
           <view class="action-btn" style="border-top:2upx solid #2bb931;margin-top:20upx;">
           <view class="action-btn" style="border-top:2upx solid #2bb931;margin-top:20upx;">
             <text style="font-size: 30upx;font-weight: bold;">【零售-花材】跑腿费计算方式</text>
             <text style="font-size: 30upx;font-weight: bold;">【零售-花材】跑腿费计算方式</text>
           </view>
           </view>
@@ -91,7 +142,7 @@
 
 
           <view class="warning-text">如不符合以上情况的,按实际跑腿费计算</view>
           <view class="warning-text">如不符合以上情况的,按实际跑腿费计算</view>
 
 
-          <!-- 花束 -->
+          <!-- 花材花束 -->
           <view class="section-title" style="border-top:2upx solid #2bb931;">【零售-绿植花束】跑腿费计算方式</view>
           <view class="section-title" style="border-top:2upx solid #2bb931;">【零售-绿植花束】跑腿费计算方式</view>
 
 
           <tui-list-cell class="line-cell" :hover="false">
           <tui-list-cell class="line-cell" :hover="false">
@@ -110,7 +161,6 @@
           </tui-list-cell>
           </tui-list-cell>
 
 
           <view class="warning-text">没有包运费的花束,按实际跑腿费计算</view>
           <view class="warning-text">没有包运费的花束,按实际跑腿费计算</view>
-
         </view>
         </view>
 
 
         <view class="confirm-btn">
         <view class="confirm-btn">
@@ -142,12 +192,18 @@ export default {
       zjGatheringItem:0,
       zjGatheringItem:0,
       zjGatheringItemName:'',
       zjGatheringItemName:'',
       selectItemOk:0,
       selectItemOk:0,
-      // 花材批发和零售配置
+      // 零售花材配置
       flowerMaterials: [{num:0,price:0,distance:0}],
       flowerMaterials: [{num:0,price:0,distance:0}],
-      // 花束配置
+      // 零售花束配置
       hsFreeKm: 0,
       hsFreeKm: 0,
       hsAddFee: 0,
       hsAddFee: 0,
-      hcFreeKm:0
+      hcFreeKm:0,
+      // 批发花材配置
+      pfFlowerMaterials: [{num:0,price:0,distance:0}],
+      pfHcFreeKm:0,
+      // 批发花束配置
+      pfHsFreeKm:0,
+      pfHsAddFee:0,
     };
     };
   },
   },
   onLoad() {
   onLoad() {
@@ -186,7 +242,11 @@ export default {
       this.changeExt()
       this.changeExt()
     },
     },
     changeExt(){
     changeExt(){
-      modifyExt({orderFlow:this.orderFlow,thirdSend:this.thirdSend,thirdSendFee:this.thirdSendFee}).then(res=>{
+      modifyExt({
+        orderFlow:this.orderFlow,
+        thirdSend:this.thirdSend,
+        thirdSendFee:this.thirdSendFee
+      }).then(res=>{
         if(res.code == 1){
         if(res.code == 1){
           this.$msg(res.msg)
           this.$msg(res.msg)
         }
         }
@@ -207,10 +267,18 @@ export default {
     commitSave(){
     commitSave(){
       let that = this
       let that = this
       modifyExt({
       modifyExt({
+        // 零售-花材
+        hcFreeKm: this.hcFreeKm,
         hcMap: JSON.stringify(this.flowerMaterials),
         hcMap: JSON.stringify(this.flowerMaterials),
+        // 零售-花束
         hsFreeKm: this.hsFreeKm,
         hsFreeKm: this.hsFreeKm,
         hsAddFee: this.hsAddFee,
         hsAddFee: this.hsAddFee,
-        hcFreeKm: this.hcFreeKm
+        // 批发-花材
+        pfHcFreeKm: this.pfHcFreeKm,
+        pfHcMap: JSON.stringify(this.pfFlowerMaterials),
+        // 批发-花束
+        pfHsFreeKm: this.pfHsFreeKm,
+        pfHsAddFee: this.pfHsAddFee,
       }).then(res=>{
       }).then(res=>{
         if(res.code == 1){
         if(res.code == 1){
           this.$msg(res.msg)
           this.$msg(res.msg)
@@ -241,11 +309,17 @@ export default {
           this.orderFlow = res.data.orderFlow
           this.orderFlow = res.data.orderFlow
           this.thirdSend = res.data.thirdSend
           this.thirdSend = res.data.thirdSend
           this.thirdSendFee = res.data.thirdSendFee
           this.thirdSendFee = res.data.thirdSendFee
-          // 加载花材批发和零售配置
+          // 加载零售配置
           this.flowerMaterials = res.data.hcMap ? JSON.parse(res.data.hcMap) : [{num:0,price:0,distance:0}]
           this.flowerMaterials = res.data.hcMap ? JSON.parse(res.data.hcMap) : [{num:0,price:0,distance:0}]
           this.hcFreeKm = res.data.hcFreeKm ? res.data.hcFreeKm : 0
           this.hcFreeKm = res.data.hcFreeKm ? res.data.hcFreeKm : 0
           this.hsFreeKm = res.data.hsFreeKm ? res.data.hsFreeKm : 0
           this.hsFreeKm = res.data.hsFreeKm ? res.data.hsFreeKm : 0
           this.hsAddFee = res.data.hsAddFee ? res.data.hsAddFee : 0
           this.hsAddFee = res.data.hsAddFee ? res.data.hsAddFee : 0
+          
+          // 加载批发配置
+          this.pfFlowerMaterials = res.data.pfHcMap ? JSON.parse(res.data.pfHcMap) : [{num:0,price:0,distance:0}]
+          this.pfHcFreeKm = res.data.pfHcFreeKm ? res.data.pfHcFreeKm : 0
+          this.pfHsFreeKm = res.data.pfHsFreeKm ? res.data.pfHsFreeKm : 0
+          this.pfHsAddFee = res.data.pfHsAddFee ? res.data.pfHsAddFee : 0
         }
         }
       })
       })
     },
     },
@@ -304,6 +378,42 @@ export default {
     // 清空循环中的item字段
     // 清空循环中的item字段
     clearItemField(item, fieldName) {
     clearItemField(item, fieldName) {
       this.$set(item, fieldName, '')
       this.$set(item, fieldName, '')
+    },
+    // 批发花材 - 添加
+    addPfFlowerMaterial() {
+      this.pfFlowerMaterials.push({
+        num: '',
+        price: '',
+        distance: ''
+      })
+    },
+    // 批发花材 - 删除
+    deletePfFlowerMaterial(index) {
+      uni.showModal({
+        title: '确认删除',
+        content: '确认删除该配置吗?',
+        success: (res) => {
+          if (res.confirm) {
+            this.pfFlowerMaterials.splice(index, 1)
+            this.savePfFlowerMaterials()
+          }
+        }
+      })
+    },
+    // 保存批发花材配置
+    savePfFlowerMaterials() {
+      if (this.pfFlowerMaterials.length === 0) {
+        return
+      }
+      modifyExt({
+        pfHcMap: JSON.stringify(this.pfFlowerMaterials)
+      }).then(res => {
+        if (res.code === 1) {
+          this.$msg('批发花材配置保存成功')
+        } else {
+          this.$msg(res.msg || '保存失败')
+        }
+      })
     }
     }
   },
   },
 };
 };
@@ -368,7 +478,7 @@ export default {
 .action-btn {
 .action-btn {
   padding: 20upx 30upx;
   padding: 20upx 30upx;
   .btn-add {
   .btn-add {
-    background-color: #3385FF;
+    background-color: #09C567;//#3385FF;
     color: white;
     color: white;
     padding: 10upx 20upx;
     padding: 10upx 20upx;
     border-radius: 4upx;
     border-radius: 4upx;
@@ -410,7 +520,7 @@ export default {
     }
     }
     
     
     .btn-delete {
     .btn-delete {
-      background-color: #3385FF;
+      background-color: #09C567;
       color: white;
       color: white;
       padding: 8upx 16upx;
       padding: 8upx 16upx;
       border-radius: 4upx;
       border-radius: 4upx;

+ 2 - 2
ghsApp/src/pagesOrder/detail.vue

@@ -40,7 +40,7 @@
 						</view>
 						</view>
 						<view class="express-actions">
 						<view class="express-actions">
 							<button class="admin-button-com mini-btn btn-danger" v-if="canCancelExpress(detailInfo.sendStatus)" @click.stop="cancelMyExpress(detailInfo.id, detailInfo.deliveryId)">取消跑腿</button>
 							<button class="admin-button-com mini-btn btn-danger" v-if="canCancelExpress(detailInfo.sendStatus)" @click.stop="cancelMyExpress(detailInfo.id, detailInfo.deliveryId)">取消跑腿</button>
-							<button class="admin-button-com mini-btn" v-if="[-1, -2].includes(Number(detailInfo.sendStatus)) && detailInfo.status == 2" @click.stop="openExpressPage()">重叫跑腿</button>
+							<button class="admin-button-com mini-btn" v-if="[-1, -2].includes(Number(detailInfo.sendStatus)) && [2].includes(Number(detailInfo.status))" @click.stop="openExpressPage()">重叫跑腿</button>
 						</view>
 						</view>
 					</view>
 					</view>
 <!--
 <!--
@@ -455,7 +455,7 @@
 			<button class="admin-button-com middle blue" @click="shareOrder()">分享</button>
 			<button class="admin-button-com middle blue" @click="shareOrder()">分享</button>
 			<!-- #endif -->
 			<!-- #endif -->
 			<button class="admin-button-com middle blue" v-if="detailInfo.sendStatus == -4 && detailInfo.status== 2 && detailInfo.payStatus == 1" @click.stop="openExpressPage()">呼叫跑腿</button>
 			<button class="admin-button-com middle blue" v-if="detailInfo.sendStatus == -4 && detailInfo.status== 2 && detailInfo.payStatus == 1" @click.stop="openExpressPage()">呼叫跑腿</button>
-			<button class="admin-button-com middle blue" v-if="[-1, -2].includes(Number(detailInfo.sendStatus)) && detailInfo.status== 2" @click.stop="openExpressPage()">重叫跑腿</button>
+			<button class="admin-button-com middle blue" v-if="[-1, -2].includes(Number(detailInfo.sendStatus)) && [2].includes(Number(detailInfo.status))" @click.stop="openExpressPage()">重叫跑腿</button>
 			<button class="admin-button-com middle blue" style="background-color: green;border-color: green;" v-if="detailInfo.status != 1 && detailInfo.status != 5" @click="printOrder(detailInfo)">打印(无价格)</button>
 			<button class="admin-button-com middle blue" style="background-color: green;border-color: green;" v-if="detailInfo.status != 1 && detailInfo.status != 5" @click="printOrder(detailInfo)">打印(无价格)</button>
 
 
 			<template v-for="s in detailInfo.buttonList">
 			<template v-for="s in detailInfo.buttonList">