浏览代码

贺卡打印

Funny 2 年之前
父节点
当前提交
3f7abbdcf8

+ 8 - 0
src/components/orderComponents/orderDetail.vue

@@ -180,6 +180,7 @@
     
 <script>
 import { cloudPrint, printConfig } from "../../api/shop";
+import bus from "../../common/bus.js";
 export default {
   name: "OrderDetail",
   data() {
@@ -274,6 +275,11 @@ export default {
     },
     async showPrintCard() {
       let res = await printConfig({ shopId: this.orderDetail.shopId });
+      console.log(res);
+      if (res.code !== 200) {
+        this.$message.error(res.msg);
+        return;
+      }
       this.params = res.data;
       this.dialogVisible = true;
       this.printContent = this.initCardInfo(this.orderDetail.cardInfo);
@@ -303,6 +309,8 @@ export default {
             type: "success",
             message: `成功发送云盒打印任务!`,
           });
+          bus.$emit("refreshOrderDetail");
+          this.dialogVisible = false;
         } else {
           this.$message({
             type: "error",

+ 13 - 12
src/components/orderComponents/orderList.vue

@@ -18,16 +18,9 @@
           <div class="bottom-btns" v-show="showDetail || showTrack">
             <!-- 新订单 -->
             <div class="btns" v-if="buttonStatus === 0">
-              <div class="btn_bot">
-                <el-dropdown>
-                  <span class="el-dropdown-link">更多</span>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item @click.native="itemAddRemark(list[curIdx].id, list[curIdx])"><span style="color: #fc7200">添加备注</span></el-dropdown-item>
-                    <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)">补打小票</el-dropdown-item>
-                  </el-dropdown-menu>
-                </el-dropdown>
-              </div>
-              <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots">忽略订单</el-button>
+              <el-button size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
+              <el-button size="small" @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)" class="btn_bots">补打小票</el-button>
+              <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots btn">忽略订单</el-button>
               <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
             </div>
             <!-- 预约单 -->
@@ -37,7 +30,6 @@
                   <span class="el-dropdown-link">更多</span>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)"><span style="color: #fc7200">补打小票</span></el-dropdown-item>
-                    <el-dropdown-item @click.native="iGnoreOrder(list[curIdx].id)">忽略订单</el-dropdown-item>
                     <el-dropdown-item @click.native="itemAddRemark(list[curIdx].id, list[curIdx])">添加备注</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -47,6 +39,7 @@
                   list[curIdx].delayTime ? "修改定时" : "预约发单"
                 }}</el-button>
               <el-button v-else size="small" @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
+              <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots btn">忽略订单</el-button>
               <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
             </div>
             <!-- 待接单 -->
@@ -401,7 +394,15 @@ export default {
       immediate: true,
     },
   },
-  destroyed() {},
+  created() {
+    console.log("orderlist created");
+    bus.$on("refreshOrderDetail", () => {
+      this.getDetailOrder();
+    });
+  },
+  beforeDestroyed() {
+    bus.$off("refreshOrderDetail");
+  },
   computed: {
     ...mapState(["userInfo"]),
   },

+ 4 - 3
src/components/settingComponents/print/greetingCardPrinter.vue

@@ -583,10 +583,11 @@ export default {
       cloudConfigList({ deviceType: 28 }).then((res) => {
         if (res.code === 200) {
           this.configList = res.data;
-          let data = this.$tool.deepClone(res.data[0]);
-          data.shopIdList = [0];
+          let data = res.data.find((v) => {
+            return v.shopId === this.params.shopIdList[0];
+          });
+          data.shopIdList = [data.shopId];
           this.params = data;
-          console.log("params:", this.params);
         } else {
           this.$message({
             type: "error",