Funny пре 3 година
родитељ
комит
f26853f7ef

+ 0 - 6
src/components/Home.vue

@@ -115,12 +115,6 @@ export default {
       this.getMarker();
       this.getRefreshOrder();
     }, 5000);
-    // this.timer2 = setInterval(() => {
-    //   this.getMarker();
-    //   if (this.tabNum >= 2) {
-    //     this.getOrder();
-    //   }
-    // }, 60000);
   },
   mounted() {},
   beforeDestroy() {

+ 3 - 3
src/components/accountCompoents/consumption.vue

@@ -107,7 +107,7 @@ export default {
   },
   created() {
     this.init();
-    this.getAccountFlow();
+    this.search();
     if (this.memberType !== 1) {
       this.getShopList();
     }
@@ -115,8 +115,8 @@ export default {
   methods: {
     init() {
       const start = new Date().getTime() - 3600 * 1000 * 24 * 7;
-      this.params.startTime = this.$tool.formatDateTime(start, "yyyy-MM-dd");
-      this.params.endTime = this.$tool.formatDateTime(new Date(), "yyyy-MM-dd");
+      this.params.startTime = start;
+      this.params.endTime = new Date();
       this.value1 = [this.params.startTime, this.params.endTime];
     },
     search() {

+ 52 - 29
src/components/manualCreate.vue

@@ -4,7 +4,7 @@
       <div class="moudle-list">
         <div class="moudle">
           <div class="title-list">
-            <div @click="sendType = 1" :class=" sendType ? 'title' : 'normal-title'">
+            <div v-if="memberType !== 1" @click="sendType = 1" :class=" sendType ? 'title' : 'normal-title'">
               商家发件
             </div>
             <div @click="sendType = 0" :class=" !sendType ? 'title' : 'normal-title'">
@@ -19,13 +19,13 @@
             <el-button v-show="!sendType" @click="showShop(1)" class="but1 active" type="info">常用地址</el-button>
           </el-form-item>
           <el-form-item label="发件人电话" required>
-            <el-input size="small" class="phone-before" v-model="form.sendAddress.phone" placeholder="请填写发件人电话" :disabled="!!sendType"></el-input>
+            <el-input size="small" class="phone-before" v-model="form.sendAddress.phone" placeholder="请填写发件人电话"></el-input>
             <div class="phone-center">~</div>
-            <el-input size="small" class="phone-after" v-model="form.sendAddress.extension" placeholder="分机号" :disabled="!!sendType"></el-input>
+            <el-input size="small" class="phone-after" v-model="form.sendAddress.extension" placeholder="分机号"></el-input>
           </el-form-item>
           <el-form-item label="发件人地址" required>
             <el-input size="small" v-model="form.sendAddress.address" placeholder="请填写/选择发件人地址" disabled>
-              <el-image @click="showMap" slot="append" class="map" src="../../static/image/icon_map.png"></el-image>
+              <el-image @click="showMap(1)" slot="append" class="map" src="../../static/image/icon_map.png"></el-image>
             </el-input>
           </el-form-item>
           <el-form-item label="楼号/门牌号">
@@ -49,7 +49,7 @@
           </el-form-item>
           <el-form-item label="收件人地址" required>
             <el-input size="small" v-model="form.receiptAddress.address" placeholder="请填写/选择收件人地址">
-              <el-image @click="showMap" slot="append" class="map" src="../../static/image/icon_map.png"></el-image>
+              <el-image @click="showMap(2)" slot="append" class="map" src="../../static/image/icon_map.png"></el-image>
             </el-input>
           </el-form-item>
           <el-form-item label="楼号/门牌号">
@@ -71,7 +71,7 @@
               <el-radio class="item" v-for="(item,i) in products" :key="i" :label="item.id">{{item.name}}</el-radio>
             </el-radio-group>
           </el-form-item>
-          <el-form-item label="物品重量">
+          <el-form-item label="物品重量" required>
             <div class="printer-num">
               <img @click="reduce()" src="../../static/image/icon_reduce.png" class="reduce" alt="" srcset="" />
               <!-- <div class="num">{{ form.weight }} KG</div> -->
@@ -149,7 +149,7 @@ export default {
   data() {
     return {
       products: [],
-      sendType: 1,
+      sendType: this.$store.state.userInfo.memberType === 1 ? 0 : 1,
       addressType: 1,
       form: {
         name: "",
@@ -183,6 +183,7 @@ export default {
         createType: 1,
         shopId: this.$store.state.userInfo.shopId,
         productAmount: "",
+        chooseAddressType: 1,
       },
       showChooseShop: false,
       showChooseAddress: false,
@@ -201,6 +202,7 @@ export default {
           );
         },
       },
+      memberType: this.$store.state.userInfo.memberType,
     };
   },
   components: {
@@ -256,13 +258,17 @@ export default {
     chooseShop() {
       this.showChooseShop = false;
       let sendAddress = this.addressList[this.curIdx];
-      Object.keys(this.form.sendAddress).map((v) => {
-        this.form.sendAddress[v] = sendAddress[v];
-      });
-      if (!this.sendType) {
-        this.shopId = "";
+      if (this.addressType === 1) {
+        Object.keys(this.form.sendAddress).map((v) => {
+          this.form.sendAddress[v] = sendAddress[v];
+        });
+        if (!this.sendType) {
+          this.shopId = "";
+        } else {
+          this.form.shopId = sendAddress.id;
+        }
       } else {
-        this.form.shopId = sendAddress.id;
+        this.form.receiptAddress = sendAddress;
       }
     },
     showShop(addressType) {
@@ -281,12 +287,11 @@ export default {
       this.loading = true;
       getAddressList({
         searchKey: this.searchKey,
-        searchType: this.sendType,
-        addressType: this.addressType,
       }).then((res) => {
         this.loading = false;
         if (res.code === 200) {
-          if (this.sendType) {
+          if (this.sendType && this.addressType !== 2) {
+            console.log(1111);
             this.addressList = res.data.shop;
             let sendAddress = this.addressList.filter((v) => {
               return v.id === this.form.shopId;
@@ -294,11 +299,15 @@ export default {
             Object.keys(this.form.sendAddress).map((v) => {
               this.form.sendAddress[v] = sendAddress[v];
             });
-          } else {
+          }
+          if (!this.sendType || this.addressType === 2) {
+            console.log(2222);
             this.addressList = res.data.personal;
-            Object.keys(this.form.sendAddress).map((v) => {
-              this.form.sendAddress[v] = "";
-            });
+            if (!this.sendType) {
+              Object.keys(this.form.sendAddress).map((v) => {
+                this.form.sendAddress[v] = "";
+              });
+            }
           }
         } else {
           this.$message({
@@ -354,7 +363,12 @@ export default {
       }
       // 预约发单
       if (this.form.takeType) {
-        this.form.takeTime = this.$tool.getFormatDate(this.form.takeTime);
+        if (!this.form.takeTime.trim()) {
+          return this.$message({
+            type: "error",
+            message: "请先选择预约发单时间!",
+          });
+        }
         this.form.saveFlag = 1;
         this.saveOrder();
       } else {
@@ -400,17 +414,26 @@ export default {
         }
       });
     },
-    showMap() {
+    showMap(type) {
+      this.searchKey = "";
+      if (this.sendType === 1) return;
+      this.chooseAddressType = type;
       this.$refs.orderMap.chooseLocation();
     },
     getAddressDetail(v, lng, lat) {
-      this.form.receiptAddress.address = v.address;
-      this.form.receiptAddress.provinceName = v.province;
-      this.form.receiptAddress.cityName = v.city;
-      this.form.receiptAddress.cityCode = v.citycode;
-      this.form.receiptAddress.districtName = v.district;
-      this.form.receiptAddress.lng = lng;
-      this.form.receiptAddress.lat = lat;
+      let type = "sendAddress";
+      if (this.chooseAddressType === 1) {
+        type = "sendAddress";
+      } else {
+        type = "receiptAddress";
+      }
+      this.form[type].address = v.address;
+      this.form[type].provinceName = v.province;
+      this.form[type].cityName = v.city;
+      this.form[type].cityCode = v.citycode;
+      this.form[type].districtName = v.district;
+      this.form[type].lng = lng;
+      this.form[type].lat = lat;
     },
     reduce() {
       this.form.weight = this.form.weight === 1 ? 1 : --this.form.weight;

+ 5 - 5
src/components/orderComponents/orderDetail.vue

@@ -77,14 +77,14 @@
         <div class="title">送达时间:</div>
         <div class="cont cont2">{{ !orderDetail.exceptTime ? '立即送达' : orderDetail.exceptTime}}</div>
       </div>
-      <div class="info2 info4" v-if="!orderDetail.waimaiOrderId">
+      <div class="info2 info4" v-if="orderDetail.deliveryTime && buttonStatus === 10">
+        <div class="title">预约发单时间:</div>
+        <div class="cont cont2">{{ orderDetail.deliveryTime}}</div>
+      </div>
+      <div class="info2 info4" v-if="!orderDetail.waimaiOrderId && buttonStatus !== 10">
         <div class="title">取件时间:</div>
         <div class="cont cont2">{{ !orderDetail.takeType ? '立即取件' : 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="cont">{{orderDetail.orderTime}}</div>

+ 6 - 0
src/components/orderComponents/sendOrderPopup.vue

@@ -451,6 +451,12 @@ export default {
               return;
             }
             bus.$emit("pullData", 2);
+            if(this.$route.name === 'manualCreate'){
+              this.$route.push({
+                path:'/'
+              })
+            }
+            console.log('path',this.$route);
           } else if (
             (this.payId == 1 || this.payId == 2) &&
             res.data.status == 1

+ 13 - 7
src/components/orderSearch.vue

@@ -181,7 +181,7 @@ export default {
     if (this.memberType !== 1) {
       this.getShopList();
     }
-    this.getOrder();
+    this.search();
   },
   mounted() {},
   destroyed() {
@@ -196,21 +196,27 @@ export default {
     },
     init() {
       const start = new Date().getTime() - 3600 * 1000 * 24 * 7;
-      this.params.startDate = this.$tool.formatDateTime(start, "yyyy-MM-dd");
-      this.params.endDate = this.$tool.formatDateTime(new Date(), "yyyy-MM-dd");
+      this.params.startDate = start;
+      this.params.endDate = new Date();
       this.value1 = [this.params.startDate, this.params.endDate];
 
       bus.$on("refreshData2", () => {
         console.log("执行refreshData2");
-        this.params.pageNum = 1
+        this.params.pageNum = 1;
         this.orderList = [];
         this.getOrder();
       });
     },
     search() {
       if (this.value1 && this.value1.length) {
-        this.params.startDate = this.$tool.formatDateTime(this.value1[0]);
-        this.params.endDate = this.$tool.formatDateTime(this.value1[1]);
+        this.params.startDate = this.$tool.getFormatDate(
+          this.value1[0],
+          "yyyy-MM-dd"
+        );
+        this.params.endDate = this.$tool.getFormatDate(
+          this.value1[1],
+          "yyyy-MM-dd"
+        );
       } else {
         this.params.startDate = "";
         this.params.endDate = "";
@@ -343,7 +349,7 @@ export default {
         height: 222px;
       }
       .no-data {
-        color: #9EA7B7;
+        color: #9ea7b7;
       }
     }
   }

+ 50 - 23
src/components/settingComponents/voiceSetting.vue

@@ -57,14 +57,21 @@
     </div>
     <!-- // 选择自动配送运力 -->
     <el-dialog title="自动配送设置" @close="cancel" :visible.sync="centerDialogVisible" width="800px" center>
-      <el-input placeholder="请输入自动配送时长" v-model="autodeliveryOrderTime" clearable>
-        <template slot="append">分钟</template>
-      </el-input>
-      <div class="delivery-list">
-        <div @click="chooseDelivery(v.deliveryId)" :class="autodeliveryIds.includes(String(v.deliveryId)) ? 'delivery active' : 'delivery'" v-for="(v,i) in deliveryList" :key="i">{{v.name}}</div>
-      </div>
+      <el-form label-width="120px">
+        <el-form-item label="自动接单时间">
+          <el-input size="small" class="auto-time" v-model="autodeliveryOrderTime">
+            <template slot="append">分钟</template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="自动接单商家">
+          <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
+          <el-checkbox-group v-model="autodeliveryIds" @change="handleCheckedCitiesChange">
+            <el-checkbox :label="String(v.deliveryId)" name="type" v-for="(v,i) in deliveryList" :key="i">{{v.name}}</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+      </el-form>
       <span slot="footer" class="dialog-footer">
-        <el-button size="medium" @click="cancel">取 消</el-button>
+        <el-button size="medium" @click="getConfig">取 消</el-button>
         <el-button size='medium' type="primary" @click="confirm">确 定</el-button>
       </span>
     </el-dialog>
@@ -91,7 +98,10 @@ export default {
       centerDialogVisible: false,
       autodeliveryIds: [],
       deliveryList: [], // 运力列表
+      deliveryIdList: [],
       memberType: this.$store.state.userInfo.memberType,
+      checkAll: false,
+      isIndeterminate: true,
     };
   },
   created() {
@@ -100,6 +110,16 @@ export default {
     this.floorListDelivery();
   },
   methods: {
+    handleCheckAllChange(val) {
+      this.autodeliveryIds = val ? this.deliveryIdList : [];
+      this.isIndeterminate = false;
+    },
+    handleCheckedCitiesChange(value) {
+      let checkedCount = value.length;
+      this.checkAll = checkedCount === this.deliveryList.length;
+      this.isIndeterminate =
+        checkedCount > 0 && checkedCount < this.deliveryList.length;
+    },
     play(index) {
       let src = "../../../static/audio/alone.mp3";
       switch (index) {
@@ -151,20 +171,13 @@ export default {
       this.centerDialogVisible = true;
       this.updateConfig();
     },
-    chooseDelivery(deliveryId) {
-      let id = String(deliveryId);
-      if (this.autodeliveryIds.includes(id)) {
-        this.autodeliveryIds = this.autodeliveryIds.filter((v) => {
-          return v !== id;
-        });
-      } else {
-        this.autodeliveryIds.push(id);
-      }
-    },
     floorListDelivery() {
       floorListDelivery().then((res) => {
         if (res.code === 200) {
           this.deliveryList = res.data;
+          this.deliveryIdList = this.deliveryList.map((v) => {
+            return String(v.deliveryId);
+          });
         } else {
           this.$message({
             type: "error",
@@ -203,12 +216,6 @@ export default {
       queryPushMessageStatus().then((res) => {
         if (res.code === 200) {
           this.voiceList = res.data;
-          let msasterSwitchList = res.data.map((v) => {
-            return v.msasterSwitch;
-          });
-          // let msasterSwitch = [...new Set(msasterSwitchList)];
-          // this.msasterSwitch =
-          //   msasterSwitch.length === 1 && msasterSwitch[0] === 1 ? 1 : 0;
         } else {
           this.$message({
             type: "error",
@@ -273,6 +280,23 @@ export default {
 
 <style lang="scss" scoped>
 .voice {
+  /deep/ .el-switch.is-checked .el-switch__core {
+    border-color: #fc7200;
+    background-color: #fc7200;
+  }
+  /deep/ .el-checkbox__input.is-checked .el-checkbox__inner,
+  /deep/ .el-checkbox__input.is-indeterminate .el-checkbox__inner {
+    background-color: #fc7200;
+    border-color: #fc7200;
+  }
+  /deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
+    color: #fc7200;
+  }
+  /deep/ .el-button--primary {
+    color: #fff;
+    background-color: #fc7200;
+    border-color: #fc7200;
+  }
   .top-set {
     display: flex;
     justify-content: space-between;
@@ -349,5 +373,8 @@ export default {
       background: #fc7200;
     }
   }
+  .auto-time {
+    width: 150px;
+  }
 }
 </style>