Funny 3 роки тому
батько
коміт
72b0bc0afb

+ 1 - 0
src/components/Home.vue

@@ -197,6 +197,7 @@ export default {
       getOrderList(this.params).then((res) => {
         this.isLoading = false;
         if (res.code == 200) {
+          this.orderList = []
           this.total = res.data.totalNums || 0;
           this.params.pageNum = res.data.pageNum;
           res.data.data.forEach((element) => {

+ 7 - 2
src/components/orderComponents/orderDetail.vue

@@ -60,16 +60,21 @@
       </div>
       <div class="detail_ine"></div>
       <div class="detail_title2">订单信息</div>
-      <div class="info2 info4">
+
+      <div class="info2 info4" v-if="orderDetail.waimaiOrderId">
         <div class="title">送达时间:</div>
         <div class="cont cont2">{{ buttonStatus !== 10 ? '立即送达' : orderDetail.exceptTime}}</div>
       </div>
+      <div class="info2 info4" v-if="!orderDetail.waimaiOrderId">
+        <div class="title">取件时间:</div>
+        <div class="cont cont2">{{ buttonStatus !== 10 ? '立即取件' : orderDetail.takeTime}}</div>
+      </div>
       <!-- <div class="info2 info4" v-if="orderDetail.takeTime && buttonStatus !== 0 && buttonStatus !== 10 ">
         <div class="title">发单时间:</div>
         <div class="cont">{{orderDetail.takeTime}}</div>
       </div> -->
       <div class="info2 info4" v-if="orderDetail.waimaiOrderId">
-        <div class="title">下单时间:</div>
+        <div class="title">外卖下单时间:</div>
         <div class="cont">{{orderDetail.orderTime}}</div>
       </div>
       <div class="info2 info4" v-if="orderDetail.createTime">

+ 9 - 18
src/components/orderComponents/orderList.vue

@@ -2,7 +2,7 @@
   <div>
     <el-row>
       <el-col :span="18">
-        <div v-loading="isLoading">
+        <div v-loading="isLoading" element-loading-text="正在计算中...">
           <div class="empty-data" v-if="list && list.length < 1">
             <img src="../../../static/image/empty-data.png" />
           </div>
@@ -16,11 +16,6 @@
                 <div class="sign_txt" v-if="item.waimaiOrderId && item.takeType==0">立即送达</div>
                 <!-- <div class="sign_d">预约 09/10 17:30自动发起配送</div> -->
               </div>
-              <!-- 订单查询 -->
-              <!-- <div class="order_item_header_r" v-if="tabNum === -1">
-                <span class="header_r">{{showDeliveryStatus(item)}}</span>
-                <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
-              </div> -->
               <!-- 新订单 -->
               <div class="order_item_header_r" v-if=" item.buttonStatus === 0">
                 <!-- <span class="header_r">已发单1分钟</span> -->
@@ -38,19 +33,19 @@
               <div class="order_item_header_r" v-if="item.buttonStatus === 1">
                 <span class="header_r">已发单{{item.takeTimeTxt}}</span>
                 <!-- <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button> -->
-                <el-button size='small' @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
+                <el-button size='small' @click.stop="orderPrinter(item.waimaiOrderId)" v-if="item.waimaiOrderId">补打发票</el-button>
                 <!-- <el-button size='small' class="btn" @click.stop="addTip(item.id)">加&nbsp;小&nbsp;费</el-button> -->
               </div>
               <!-- 取货中 -->
               <div class="order_item_header_r" v-if="item.buttonStatus === 2">
                 <span v-show="Number(item.riderArriveMinute)" class="header_r">预计{{Number(item.riderArriveMinute)}}分钟取件</span>
                 <el-button size='small' @click.stop="cancelOrder(item.id)">取消订单</el-button>
-                <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
+                <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)" v-if="item.waimaiOrderId">补打发票</el-button>
               </div>
               <!-- 配送中 -->
               <div class="order_item_header_r" v-if="item.buttonStatus === 3">
                 <span class="header_r" v-if="item.exceptTime">预计{{item.exceptTime}}送达</span>
-                <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)">补打发票</el-button>
+                <el-button size='small' class="btn" @click.stop="orderPrinter(item.waimaiOrderId)" v-if="item.waimaiOrderId">补打发票</el-button>
               </div>
               <!-- 异常单 -->
               <div class="order_item_header_r" v-if="item.buttonStatus === -2">
@@ -110,7 +105,7 @@
                 <el-dropdown>
                   <span class="el-dropdown-link">更多</span>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId)"><span style="color:#FC7200;">补打发票</span></el-dropdown-item>
+                    <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId"><span style="color:#FC7200;">补打发票</span></el-dropdown-item>
                     <el-dropdown-item @click.native="iGnoreOrder(list[curIdx].id)">忽略订单</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -119,28 +114,24 @@
               <el-button size='small' @click.native="settingTime(list[curIdx])" class="btn_bots btn">定时发单</el-button>
               <el-button size='small' @click.native="deleteItem(list[curIdx])" class="btn_bots btn">发起配送</el-button>
             </div>
-            <!-- 订单查询 -->
-            <!-- <div class="btns" v-if="tabNum === -1">
-              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">补打发票</el-button>
-            </div> -->
             <!-- 待接单 -->
             <div class="btns" v-if="buttonStatus ===1">
               <el-button size='small' @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
-              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots">补打发票</el-button>
+              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId" class="btn_bots">补打发票</el-button>
               <el-button size='small' @click.native="addTip(list[curIdx].id)" class="btn_bots btn">加小费</el-button>
             </div>
             <!-- 取货中 -->
             <div class="btns" v-if="buttonStatus === 2">
               <el-button size='small' @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
-              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">补打发票</el-button>
+              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId" class="btn_bots btn">补打发票</el-button>
             </div>
             <!-- 配送中 -->
             <div class="btns" v-if="buttonStatus === 3">
-              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots btn">补打发票</el-button>
+              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId" class="btn_bots btn">补打发票</el-button>
             </div>
             <!-- 异常单 -->
             <div class="btns" v-if="buttonStatus === -2">
-              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" class="btn_bots">补打发票</el-button>
+              <el-button size='small' @click.native="orderPrinter(list[curIdx].waimaiOrderId)" v-if="list[curIdx].waimaiOrderId" class="btn_bots">补打发票</el-button>
               <el-button size='small' @click.native="orderBack(list[curIdx].id)" class="btn_bots btn">撤回订单</el-button>
             </div>
             <!-- 已取消 -->

+ 1 - 1
src/components/orderComponents/orderTrack.vue

@@ -54,7 +54,7 @@
             <span>¥{{trackOrder.payAmount}}</span>
           </div>
         </div>
-        <div class="label">
+        <div class="label" >
           <div class="label-tlt">发单时间:</div>
           <div class="label-right">
             <span>{{trackOrder.sendTime}}</span>

+ 14 - 12
src/components/orderComponents/sendOrderPopup.vue

@@ -22,7 +22,7 @@
               <span v-if="deliveryList && deliveryList.length < 1">--</span>
               &nbsp;元
             </div>
-            <!-- <div class="youhui">优惠合计2元</div> -->
+            <div class="youhui" v-if="deliveryList.length >= 1">优惠合计{{discount(deliveryList.length > 1 ? computedAmountMax : computedAmountOther, tipAmount, couponPrice, order.firstCoupon || 0, 0)}}元</div>
           </div>
           <img v-if="deliveryType == 1" src="../../../static/image/choose-icon.png" class="choose-icon" />
         </div>
@@ -46,7 +46,7 @@
               <div class="item-right">
                 <div>
                   <div class="item-price">预估&nbsp;<span>{{ computePrice(item.deliveryAmount, tipAmount, couponPrice, order.firstCoupon || 0, item.isMine) }}</span>&nbsp;元</div>
-                  <div v-if="!item.isMine && item.deliveryAmount.toFixed(2) > couponParams.limitFee" class="item-coupon">优惠合计{{discount(item.deliveryAmount, tipAmount, couponPrice, order.firstCoupon || 0, item.isMine)}}元</div>
+                  <div v-if="!item.isMine && item.deliveryAmount.toFixed(2) > couponParams.limitFee" class="item-coupon">{{order.firstCoupon ? `新人首单立减${order.firstCoupon}元 ` : ''}}优惠合计{{discount(item.deliveryAmount, tipAmount, couponPrice, order.firstCoupon || 0, item.isMine)}}元</div>
                   <div v-if="item.isMine" class="item-coupon">绑定的自运力</div>
                 </div>
                 <div class="item-choose">
@@ -359,7 +359,6 @@ export default {
         let arr = this.deliveryList.filter((item) => {
           return item.isChoose;
         });
-        console.log("object", arr);
         if (arr && arr.length < 1) {
           return this.$message({
             message: "请选择运力",
@@ -374,7 +373,7 @@ export default {
           this.deliveryType == 1
             ? this.deliveryList
             : this.deliveryList.filter((v) => {
-                return v.isChoose == true;
+                return v.isChoose;
               }),
         paymentType: this.payId,
       };
@@ -382,7 +381,6 @@ export default {
         params.couponId = this.couponParams.id;
       }
       sendOrder(params).then((res) => {
-        console.log(res, "查看下单结果");
         if (res.code == 200) {
           if (this.payId == 4) {
             this.dialogTableVisible = false;
@@ -404,6 +402,16 @@ export default {
               type: "error",
             });
           }
+        } else if (res.code === 250) {
+          this.$confirm("当前账户余额不足, 是否前去充值?", "提示", {
+            confirmButtonText: "立即充值",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.$router.push({
+              path: "/shopInfo/shopAccount",
+            });
+          });
         } else {
           this.$message({
             message: res.msg,
@@ -534,6 +542,7 @@ export default {
       this.deliveryList.forEach((item) => {
         if (item.preferredDelivery) {
           item.isChoose = true;
+          this.deliveryType = 2;
         } else {
           item.isChoose = false;
         }
@@ -551,17 +560,10 @@ export default {
             this.maxPrice <= item.deliveryAmount
               ? item.deliveryAmount
               : this.maxPrice;
-          // if (item.preferredDelivery) {
-          // 	this.deliveryType = 2;
-          // 	this.$set(item, 'select', true);
-          // } else {
-          // 	this.$set(item, 'select', false);
-          // }
         }
       }
       this.dialogTableVisible = true;
       this.getCouponList();
-      // this.getPayInfo(data);
     },
     getCouponList() {
       let params = {

+ 51 - 16
src/components/shopCompoents/bindDelivery.vue

@@ -24,13 +24,15 @@
           </div>
           <!-- 1->绑定,0:未绑定,2-> 审核中,3->拒绝,4->待完善资料 -->
           <div class="right">
-            <el-button v-if="v.bindStatus === 0" @click="goBind(v)" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="关闭窗口后再操作!" type="primary" size="small" class="right-btn">去绑定</el-button>
+            <span class="reason">{{v.bindStatus === 2 ? '审核中' : v.bindStatus === 3 ? `已拒绝` : ''}}</span>
+            <el-button v-if="[0,3].includes(v.bindStatus)" @click="goBind(v)" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="关闭窗口后再操作!" type="primary" size="small" class="right-btn">去绑定</el-button>
             <el-button v-if="[1].includes(v.bindStatus)" @click="release(v)" size="small">解&nbsp;&nbsp;&nbsp;绑</el-button>
             <!-- <el-button v-if="v.bindStatus === 2" @click="release(v)" type="info" size="small">审核中</el-button> -->
             <!-- <el-button v-if="v.bindStatus === 3" @click="release(v)" type="danger" size="small">已拒绝</el-button> -->
             <el-button v-if="[1,4].includes(v.bindStatus)&&[1,9].includes(v.type)" @click="perfectData(v)" type="primary" size="small" class="right-btn">完善资料</el-button>
           </div>
         </div>
+        <div class="respect">{{v.authMsg}}</div>
       </div>
     </div>
     <!-- UU跑腿 -->
@@ -210,26 +212,50 @@ export default {
       });
     },
     goBind(v) {
+      let params = {
+        deliveryId: v.deliveryId,
+      };
       // 显示U跑腿绑定弹框
       if (v.type === 7) {
         this.title = "UU跑腿绑定";
         this.centerDialogVisible = true;
         return;
       }
-      let name = [1, 9];
-      let dadaName = name.includes(v.type) ? v.name : "";
-      let name2 = [1, 5];
-      let sfId = name2.includes(v.type) ? v.thirdShopId : "";
-      let params = {
-        deliveryId: v.deliveryId,
-        dadaName,
-        sfId,
-      };
-      bindDelivery(params).then((res) => {
-        if (res.code === 200) {
-          this.jumpUrl = res.data;
-        }
-      });
+      // 绑定顺丰同城
+      if (v.type === 5) {
+        this.$prompt("请输入顺丰同城ID", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          center: true,
+        })
+          .then(({ value }) => {
+            params.sfId = value;
+            bindDelivery(params).then((res) => {
+              if (res.code === 200) {
+                this.jumpUrl = res.data;
+              } else {
+                this.$message({
+                  type: "error",
+                  message: res.msg,
+                });
+              }
+            });
+          })
+          .catch(() => {
+            return;
+          });
+      } else {
+        bindDelivery(params).then((res) => {
+          if (res.code === 200) {
+            this.jumpUrl = res.data;
+          } else {
+            this.$message({
+              type: "error",
+              message: res.msg,
+            });
+          }
+        });
+      }
     },
     bindUU() {
       if (!this.UUData.cityName.trim()) {
@@ -450,6 +476,7 @@ export default {
     background-color: #fff;
     margin-bottom: 10px;
     border-radius: 5px;
+    padding-bottom: 10px;
     .item-top {
       display: flex;
       justify-content: space-between;
@@ -488,7 +515,7 @@ export default {
       display: flex;
       justify-content: space-between;
       box-sizing: border-box;
-      padding: 25px 18px;
+      padding: 25px 18px 0;
       align-items: center;
       .left {
         display: flex;
@@ -514,12 +541,20 @@ export default {
         }
       }
       .right {
+        .reason {
+          margin-right: 10px;
+          color: red;
+        }
         .right-btn {
           background-color: #fc7200;
           border: none;
         }
       }
     }
+    .respect {
+      margin: 20px 20px 0;
+      color: red;
+    }
   }
 }
 .code {

+ 2 - 2
src/components/shopCompoents/bindTakeOut.vue

@@ -20,9 +20,9 @@
             <div class="l-l">
               <img :src="v.pcLogo" class="l-l-img" />
             </div>
-            <div class="take-out-name">
+            <div class="take-out-name" v-if="v.bindStatus">
               <div>店铺名称:{{v.shopName}}</div>
-              <div>店铺ID:{{v.waimaiId}}</div>
+              <div>店铺ID:{{v.thirdShopId}}</div>
               <div>配送门店:{{v.thirdShopName}}</div>
             </div>
           </div>

+ 45 - 13
src/components/shopCompoents/printerAdd.vue

@@ -3,32 +3,32 @@
     <!-- 打印机新增、编辑 -->
     <el-dialog width="40%" :title="title" destroy-on-close center :visible.sync="showVisible">
       <el-form :model="form" ref="form" label-width="120px">
-        <el-form-item label="选择打印机"  prop="deviceType">
+        <el-form-item label="选择打印机" prop="deviceType">
           <div class="category_box">
             <div class="item" :class="form.deviceType == item.type ? 'active':''" v-for="(item,i) in devices" :key="i" @click="changeType(item)">
               {{item.name}}
             </div>
           </div>
         </el-form-item>
-        <el-form-item label="打印机名称"  prop="name">
+        <el-form-item label="打印机名称" prop="name">
           <el-input v-model="form.name" placeholder="给这台打印机取个名字吧" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
-        <el-form-item label="打印机编号"  prop="deviceSn">
+        <el-form-item label="打印机编号" prop="deviceSn">
           <el-input v-model="form.deviceSn" placeholder="查看打印机底部标签" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
-        <el-form-item label="打印机KEY"  prop="deviceSecret">
+        <el-form-item label="打印机KEY" prop="deviceSecret">
           <el-input v-model="form.deviceSecret" placeholder="查看打印机底部标签" autocomplete="off" style="width: 100%">
           </el-input>
         </el-form-item>
-        <el-form-item label="自动打印接单"  prop="deviceSecret">
+        <el-form-item label="自动打印接单" prop="deviceSecret">
           <el-switch v-model="form.openOrderPrint" :active-value="1" :inactive-value="0" />
         </el-form-item>
-        <el-form-item label="自动打印取消单"  prop="deviceSecret">
+        <el-form-item label="自动打印取消单" prop="deviceSecret">
           <el-switch v-model="form.openOrderCancelPrint" :active-value="1" :inactive-value="0" />
         </el-form-item>
-        <el-form-item label="打印份数" >
+        <el-form-item label="打印份数">
           <div class="printer-num">
             <img @click="reduce(1)" src="../../../static/image/icon_reduce.png" class="reduce" alt="" srcset="">
             <div class="num">{{form.printCustomerCount}} 份</div>
@@ -50,7 +50,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button size="medium" class="btn" @click="save">保存</el-button>
+        <el-button :loading="loading" size="medium" class="btn" @click="save">保存</el-button>
       </div>
     </el-dialog>
   </div>
@@ -73,14 +73,15 @@ export default {
       showVisible: false,
       form: {},
       revieweds: [],
+      loading: false,
     };
   },
   methods: {
-    changeType(v){
-      this.$set(this.form,'deviceType',v.type)
-      this.form.deviceId = v.id
+    changeType(v) {
+      this.$set(this.form, "deviceType", v.type);
+      this.form.deviceId = v.id;
     },
-    init(e,shopId) {
+    init(e, shopId) {
       if (e) {
         console.log(e);
         this.title = "编辑打印机";
@@ -88,21 +89,51 @@ export default {
       } else {
         this.title = "添加打印机";
         this.form = {
+          name: "",
+          deviceSn: "",
+          deviceSecret: "",
+          deviceId: "",
           printCustomerCount: 0,
           printMerchantCount: 0,
           printKitchenCount: 0,
-          shopId
+          shopId,
         };
       }
       this.showVisible = true;
     },
     save() {
+      if (!String(this.form.deviceId).trim()) {
+        return this.$message({
+          type: "error",
+          message: "请选择打印机!",
+        });
+      }
+      if (!this.form.name.trim()) {
+        return this.$message({
+          type: "error",
+          message: "请填写打印机名称!",
+        });
+      }
+      if (!this.form.deviceSn.trim()) {
+        return this.$message({
+          type: "error",
+          message: "请填写打印机编号!",
+        });
+      }
+      if (!this.form.deviceSecret.trim()) {
+        return this.$message({
+          type: "error",
+          message: "请填写打印机Key!",
+        });
+      }
+      this.loading = true;
       deviceAdd(this.form).then((res) => {
         if (res.code === 200) {
           this.$message({
             type: "success",
             message: `${this.form.id ? "保存" : "新增"}成功!`,
           });
+          this.showVisible = false;
           this.$emit("shopDeviceList");
         } else {
           this.$message({
@@ -110,6 +141,7 @@ export default {
             message: res.msg,
           });
         }
+        this.loading = false;
       });
     },
     add(type) {