Funny пре 2 година
родитељ
комит
570840d55d

+ 1 - 5
public/order-print-module/module0.html

@@ -14,13 +14,9 @@
       margin: 0 auto;
     }
 
-    .table table td {
-      line-height: 68px;
-    }
-
     .table table td,
     .table table th {
-      padding: 0 15px;
+      padding: 15px;
       font-size: 16px;
     }
 

+ 1 - 5
public/order-print-module/module1.html

@@ -14,13 +14,9 @@
       margin: 0 auto;
     }
 
-    .table table td {
-      line-height: 60px;
-    }
-
     .table table td,
     .table table th {
-      padding: 0 15px;
+      padding: 15px;
       font-size: 16px;
     }
 

+ 1 - 5
public/order-print-module/module2.html

@@ -14,13 +14,9 @@
       margin: 0 auto;
     }
 
-    .table table td {
-      line-height: 60px;
-    }
-
     .table table td,
     .table table th {
-      padding: 0 15px;
+      padding: 15px;
       font-size: 16px;
     }
 

+ 59 - 10
src/components/settingComponents/print/a4Printer.vue

@@ -42,7 +42,7 @@
               <div class="left-bot">设置的店铺电话会打印在A4纸张上</div>
             </div>
             <div class="right" @click="openSettingPhone">
-              <div class="right-name">{{picturePrintMobile}}</div>
+              <div class="right-name">{{picturePrintMobileType === 1 ? '统一设置' : '各店铺电话'}}</div>
               <i class="el-icon-arrow-right"></i>
             </div>
           </div>
@@ -84,12 +84,12 @@
       </div>
     </div>
     <!-- 设置联系电话 -->
-    <el-dialog title="电话设置" :visible.sync="showSettingPhone" width="500px">
+    <el-dialog title="电话设置" :visible.sync="showSettingPhone" width="500px" @close="getConfig">
       <el-select size="small" v-model="picturePrintMobileType" placeholder="请选择">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
         </el-option>
       </el-select>
-      <el-input class="unify-phone" size="small" v-if="picturePrintMobileType===1" v-model="unifyPhone" placeholder="请输入统一的电话号码"></el-input>
+      <el-input class="unify-phone" size="small" v-if="picturePrintMobileType===1" v-model="picturePrintMobile" placeholder="请输入统一的电话号码"></el-input>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" @click="showSettingPhone = false">取 消</el-button>
         <el-button size="small" type="primary" @click="confirmSettingPhone">确 定</el-button>
@@ -142,7 +142,13 @@
 </template>
 
 <script>
-import { getNewShopList, deviceAdd, shopDeviceList } from "../../../api/shop";
+import {
+  getNewShopList,
+  deviceAdd,
+  shopDeviceList,
+  deviceDelete,
+  getCloudDevice,
+} from "../../../api/shop";
 import { getConfig, updateConfig } from "../../../api/setting.js";
 import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
 
@@ -184,7 +190,6 @@ export default {
       ],
       showSettingPhone: false,
       picturePrintMobileType: 2,
-      unifyPhone: "",
       options: [
         {
           value: 2,
@@ -206,6 +211,7 @@ export default {
         deviceName: "",
         deviceType: 28,
         shopId: 0,
+        lkyPrintType: 1,
       },
       showModule: false,
       moduleSrc: "",
@@ -213,6 +219,7 @@ export default {
       cloudList: [],
       openModuleIndex: 0,
       showTitle: "选择默认模板",
+      memberType: 1,
     };
   },
   // 监听属性 类似于data概念
@@ -225,6 +232,16 @@ export default {
     this.getNewShopList();
     this.getCloudPrinterList();
     this.getConfig();
+    let userInfo = JSON.parse(localStorage.getItem("userInfo"));
+    this.memberType = userInfo.memberType;
+    if (this.memberType === 3) {
+      this.options = [
+        {
+          value: 2,
+          label: "各店铺联系电话",
+        },
+      ];
+    }
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},
@@ -258,7 +275,7 @@ export default {
         }
       });
     },
-    changePrinterShop() {
+    changePrinterShop(e) {
       if (e.at(-1)) {
         this.form.shopIdList = e.filter((v) => {
           return v;
@@ -296,19 +313,51 @@ export default {
     confirmSettingPhone() {
       if (
         this.picturePrintMobileType === 1 &&
-        !this.$tool.mobile(this.unifyPhone)
+        !this.$tool.mobile(this.picturePrintMobile)
       ) {
-        this.$message.error("请输入正确的电话号码!");
+        return this.$message.error("请输入正确的电话号码!");
       }
       this.updateConfig({
         picturePrintMobileType: this.picturePrintMobileType,
         picturePrintMobile: this.picturePrintMobile,
       });
     },
+    deletePrinter(v) {
+      this.$confirm("此操作将删除打印云盒, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          deviceDelete({ id: v.id }).then((res) => {
+            if (res.code === 200) {
+              this.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+              this.getCloudPrinterList();
+            } else {
+              this.$message({
+                type: "error",
+                message: res.msg,
+              });
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
     getNewShopList() {
       getNewShopList().then((res) => {
         if (res.code === 200) {
-          res.data.unshift({ id: 0, name: "全部门店" });
+          if (this.memberType === 2) {
+            res.data.unshift({ id: 0, name: "全部门店" });
+          }
           this.shopList = res.data;
         } else {
           this.$message({
@@ -404,7 +453,7 @@ export default {
       });
     },
     getCloudPrinterList() {
-      shopDeviceList({ deviceType: 28 }).then((res) => {
+      shopDeviceList({ deviceType: 28, lkyPrintType: 1 }).then((res) => {
         if (res.code === 200) {
           this.printerList = res.data;
         } else {