Bladeren bron

贺卡打印

Funny 2 jaren geleden
bovenliggende
commit
c604f678d3

+ 1 - 1
src/common/sider.vue

@@ -236,7 +236,7 @@ export default {
   position: absolute;
   top: 0;
   left: 0;
-  z-index: 400;
+  z-index: 2;
   background-color: #fff;
   font-size: 0;
   padding-left: 32px;

+ 74 - 60
src/components/orderComponents/orderDetail.vue

@@ -141,8 +141,8 @@
       </div>
     </div>
     <!-- 打印贺卡 -->
-    <div title="打印贺卡">
-      <div class="print-con">
+    <div class="wrap-card" @click="dialogVisible=false" v-show="dialogVisible">
+      <div @click.stop="" class="print-con" :style="`width:${this.params.cardWidth+10}mm;`">
         <div class="print-head">
           <div class="but-item" :class="[fontSize===50?'disabled':'']" @click="fontEnlarge">
             <img class="img" src="../../../static/image/icon-big.png" alt="">
@@ -174,11 +174,11 @@
           </div>
         </div>
         <div class="print-html">
-          <i v-if="params.paddingTop&&params.paddingLeft" class="el-icon-arrow-down icon1" :style="`top:${params.paddingTop}mm;left:${params.paddingLeft}mm;`"></i>
-          <i v-if="params.paddingTop&&params.paddingRight" class="el-icon-arrow-down icon2" :style="`top:${params.paddingTop}mm;right:${params.paddingRight}mm;`"></i>
-          <i v-if="params.paddingBottom&&params.paddingLeft" class="el-icon-arrow-down icon3" :style="`bottom:${params.paddingBottom}mm;left:${params.paddingLeft}mm;`"></i>
-          <i v-if="params.paddingBottom&&params.paddingRight" class="el-icon-arrow-down icon4" :style="`bottom:${params.paddingBottom}mm;right:${params.paddingRight}mm;`"></i>
-          <div class="html" ref="html" v-html="printHtml"></div>
+          <i class="el-icon-arrow-down icon1" :style="`top:${params.paddingTop}mm;left:${params.paddingLeft}mm;`"></i>
+          <i class="el-icon-arrow-down icon2" :style="`top:${params.paddingTop}mm;right:${params.paddingRight}mm;`"></i>
+          <i class="el-icon-arrow-down icon3" :style="`bottom:${params.paddingBottom}mm;left:${params.paddingLeft}mm;`"></i>
+          <i class="el-icon-arrow-down icon4" :style="`bottom:${params.paddingBottom}mm;right:${params.paddingRight}mm;`"></i>
+          <div ref="html" v-html="printHtml"></div>
         </div>
       </div>
     </div>
@@ -543,64 +543,78 @@ export default {
     justify-content: space-between;
   }
 }
-.print-con {
-  border: 1px solid #ebe7e7;
-  .print-head {
-    display: flex;
-    align-items: center;
-    justify-content: space-around;
-    background: #ebe7e7;
-    padding: 10px 0;
-    .disabled {
-      opacity: 0.5;
-      cursor: not-allowed !important;
-    }
-    .but-item {
+
+.wrap-card {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  overflow: auto;
+  background: rgba($color: #000000, $alpha: 0.5);
+  z-index: 2004;
+  .print-con {
+    border: 1px solid #ebe7e7;
+    background: #fff;
+    margin: 15vh auto 0;
+    .print-head {
       display: flex;
-      flex-direction: column;
       align-items: center;
-      cursor: pointer;
-      flex: 1;
-      .img {
-        width: 25px;
-        height: 25px;
+      justify-content: space-around;
+      background: #ebe7e7;
+      padding: 10px 0;
+      .disabled {
+        opacity: 0.5;
+        cursor: not-allowed !important;
       }
-      .name {
-        font-size: 13px;
-        font-weight: bold;
-        color: #333333;
-        margin-top: 5px;
-      }
-      .name1 {
-        color: #fc7200;
+      .but-item {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        cursor: pointer;
+        flex: 1;
+        .img {
+          width: 25px;
+          height: 25px;
+        }
+        .name {
+          font-size: 13px;
+          font-weight: bold;
+          color: #333333;
+          margin-top: 5px;
+        }
+        .name1 {
+          color: #fc7200;
+        }
       }
     }
-  }
-  .print-html {
-    position: relative;
-    /deep/ .el-icon-arrow-down {
-      position: absolute;
-      font-size: 30px;
-    }
-    .icon1 {
-      top: 10mm;
-      left: 10mm;
-      transform: rotate(-45deg);
-    }
-    .icon2 {
-      top: 10mm;
-      right: 10mm;
-      transform: rotate(45deg);
-    }
-    .icon3 {
-      bottom: 10mm;
-      left: 10mm;
-      transform: rotate(-135deg);
-    }
-    .icon4 {
-      bottom: 10mm;
-      right: 10mm;
-      transform: rotate(135deg);
+    .print-html {
+      position: relative;
+      padding: 5mm;
+      /deep/ .el-icon-arrow-down {
+        position: absolute;
+        font-size: 30px;
+      }
+      .icon1 {
+        top: 10mm;
+        left: 10mm;
+        transform: rotate(-45deg);
+      }
+      .icon2 {
+        top: 10mm;
+        right: 10mm;
+        transform: rotate(45deg);
+      }
+      .icon3 {
+        bottom: 10mm;
+        left: 10mm;
+        transform: rotate(-135deg);
+      }
+      .icon4 {
+        bottom: 10mm;
+        right: 10mm;
+        transform: rotate(135deg);
+      }
     }
   }
 }

+ 19 - 1
src/components/settingComponents/print/greetingCardPrinter.vue

@@ -132,7 +132,7 @@
       </div>
     </div>
     <!-- 新增、编辑云盒 -->
-    <el-dialog title="云盒管理" :visible.sync="dialogVisible" width="600px">
+    <el-dialog title="云盒管理" :visible.sync="dialogVisible" @close="resetData" width="600px">
       <el-form ref="form" :model="form" label-width="120px">
         <el-form-item label="云盒名称">
           <el-input v-model="form.name" clearable placeholder="请自定义云盒名称"></el-input>
@@ -469,6 +469,7 @@ export default {
           this.$message.success(`成功添加云盒!`);
           this.dialogVisible = false;
           this.getCloudPrinterList();
+          this.resetData();
         } else {
           this.$message({
             type: "error",
@@ -477,7 +478,24 @@ export default {
         }
       });
     },
+    resetData() {
+      this.form = {
+        name: "",
+        deviceSn: "",
+        deviceSecret: "",
+        shopIdList: [0],
+        deviceName: "",
+        deviceType: 28,
+        shopId: 0,
+      };
+    },
     getCloudPrinterInfo() {
+      if (!this.form.deviceSn) {
+        return this.$message.warning(`请输入云盒序列号!`);
+      }
+      if (!this.form.deviceSecret) {
+        return this.$message.warning(`请输入云盒秘钥!`);
+      }
       let params = {
         deviceId: this.form.deviceSn,
         deviceKey: this.form.deviceSecret,