Funny преди 2 години
родител
ревизия
74d36c6d5b

+ 5 - 0
src/api/shop.js

@@ -230,4 +230,9 @@ export const modifyPlatformAccount = (params) => {
 // 获取云盒打印机信息
 export const getCloudDevice = (params) => {
   return get('app/shop/device/getCloudDevice', params)
+}
+
+// 云盒打印
+export const cloudPrint = (params) => {
+  return post('app/order/print/card', params)
 }

BIN
src/assets/font/FangZhengKaiTi.woff2


BIN
src/assets/font/HongLeiBanShu.woff2


BIN
src/assets/font/KaTongTi.woff2


BIN
src/assets/font/PinRu.woff2


BIN
src/assets/font/QianTuBiFengShouXieTi.woff2


BIN
src/assets/font/YaoSuiXinShouXieTi.woff2


BIN
src/assets/font/ZhongQiZhiXingShu.woff


+ 8 - 8
src/assets/font/font.css

@@ -1,52 +1,52 @@
 @font-face {
   font-family: "FangZhengKaiTi";
-  src: url('FangZhengKaiTi.woff2');
+  src: url('https://h5.liebaoai.cn/font/FangZhengKaiTi.woff2');
   font-weight: normal;
   font-style: normal;
 }
 
 @font-face {
   font-family: "HongLeiBanShu";
-  src: url('HongLeiBanShu.woff2');
+  src: url('https://h5.liebaoai.cn/font/HongLeiBanShu.woff2');
   font-weight: normal;
   font-style: normal;
 }
 @font-face {
   font-family: "KaTongTi";
-  src: url('KaTongTi.woff2');
+  src: url('https://h5.liebaoai.cn/font/KaTongTi.woff2');
   font-weight: normal;
   font-style: normal;
 }
 @font-face {
   font-family: "PinRu";
-  src: url('PinRu.woff2');
+  src: url('https://h5.liebaoai.cn/font/PinRu.woff2');
   font-weight: normal;
   font-style: normal;
 }
 @font-face {
   font-family: "QianTuBiFengShouXieTi";
-  src: url('QianTuBiFengShouXieTi.woff2');
+  src: url('https://h5.liebaoai.cn/font/QianTuBiFengShouXieTi.woff2');
   font-weight: normal;
   font-style: normal;
 }
 
 @font-face {
   font-family: "slideyouran";
-  src: url('slideyouran.woff2');
+  src: url('https://h5.liebaoai.cn/font/slideyouran.woff2');
   font-weight: normal;
   font-style: normal;
 }
 
 @font-face {
   font-family: "YaoSuiXinShouXieTi";
-  src: url('YaoSuiXinShouXieTi.woff2');
+  src: url('https://h5.liebaoai.cn/font/YaoSuiXinShouXieTi.woff2');
   font-weight: normal;
   font-style: normal;
 }
 
 @font-face {
   font-family: "ZhongQiZhiXingShu";
-  src: url('ZhongQiZhiXingShu.woff');
+  src: url('https://h5.liebaoai.cn/font/ZhongQiZhiXingShu.woff');
   font-weight: normal;
   font-style: normal;
 }

BIN
src/assets/font/slideyouran.woff2


+ 16 - 6
src/components/orderComponents/orderList.vue

@@ -18,9 +18,20 @@
           <div class="bottom-btns" v-show="showDetail || showTrack">
             <!-- 新订单 -->
             <div class="btns" v-if="buttonStatus === 0">
-              <el-button size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
-              <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots">忽略订单</el-button>
+              <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-item @click.native="cardPrint(list[curIdx])">贺卡打印</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </div>
+              <!-- <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="cardPrint(list[curIdx])" class="btn_bots btn">贺卡打印</el-button> -->
+              <el-button size="small" @click.native="iGnoreOrder(list[curIdx].id)" class="btn_bots">忽略订单</el-button>
               <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
             </div>
             <!-- 预约单 -->
@@ -30,19 +41,18 @@
                   <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="cardPrint(list[curIdx])">贺卡打印</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>
               </div>
-              <el-button size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
+              <el-button v-else size="small" @click.native="itemAddRemark(list[curIdx].id, list[curIdx])" class="btn_bots">添加备注</el-button>
               <el-button v-if="list[curIdx].waimaiOrderId" size="small" @click.native="settingTime(list[curIdx])" class="btn_bots btn">{{
                   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="settingTime(list[curIdx])" class="btn_bots ">预约发单</el-button> -->
               <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
-              <!-- <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId,list[curIdx].id)"><span style="color: #fc7200">补打小票</span></el-dropdown-item> -->
-
             </div>
             <!-- 待接单 -->
             <div class="btns" v-if="buttonStatus === 1">

+ 119 - 16
src/components/settingComponents/print/greetingCardPrinter.vue

@@ -6,11 +6,11 @@
       </div>
       <div class="printer-list">
         <div class="item" v-for="(v,i) in printerList" :key="i">
-          <img class="img" :src="require(`../../../../static/image/printer-online-${v.onlineStatus}.png`)" alt="">
+          <img class="img" :src="require(`../../../../static/image/printer-online-1.png`)" alt="">
           <div class="name">{{v.name}}</div>
           <div class="shop-name">{{v.shopName}}</div>
           <div class="btns">
-            <img @click.stop="printTest(v)" src="../../../../static/image/print-icon.png" alt="">
+            <!-- <img @click.stop="printTest(v)" src="../../../../static/image/print-icon.png" alt=""> -->
             <img @click.stop="addPrinter(v)" src="../../../../static/image/edit-icon.png" alt="">
             <img @click.stop="deletePrinter(v)" src="../../../../static/image/delete-icon.png" alt="">
           </div>
@@ -55,7 +55,8 @@
             </div>
             <div class="card-right">
               <div class="setting-params">
-                <div class="card-title">所属门店</div>
+                <div class="card-title">所属门店<div class="card-tip">&emsp;(设置门店专属贺卡样式)</div>
+                </div>
                 <el-select v-model="params.shopId" multiple @change="changeShop">
                   <el-option v-for="item in shopList" :key="item.id" :value="item.id" :label="item.name">
                     <div>{{ item.name }}</div>
@@ -118,7 +119,7 @@
               </div>
               <div class="btns">
                 <el-button size="small" type="warning">保存贺卡</el-button>
-                <el-button size="small">打印测试页</el-button>
+                <el-button size="small" @click="printTest">打印测试页</el-button>
               </div>
             </div>
           </div>
@@ -129,40 +130,47 @@
     <el-dialog title="云盒管理" :visible.sync="dialogVisible" width="600px">
       <el-form ref="form" :model="form" label-width="120px">
         <el-form-item label="云盒名称">
-          <el-input v-model="form.name"></el-input>
+          <el-input v-model="form.name" clearable placeholder="请自定义云盒名称"></el-input>
         </el-form-item>
         <el-form-item label="云盒序列号">
-          <el-input v-model="form.deviceSn"></el-input>
+          <el-input v-model="form.deviceSn" clearable placeholder="请填写云盒序列号"></el-input>
         </el-form-item>
         <el-form-item label="云盒秘钥">
-          <el-input v-model="form.deviceSecret"></el-input>
+          <el-input v-model="form.deviceSecret" clearable placeholder="请填写云盒秘钥"></el-input>
         </el-form-item>
         <el-form-item label="关联门店">
-          <el-select v-model="form.shopId" multiple @change="changePrinterShop" :span="24">
+          <el-select style="width:300px;" clearable v-model="form.shopIdList" multiple @change="changePrinterShop" max-width="300px">
             <el-option v-for="item in shopList" :key="item.id" :value="item.id" :label="item.name">
               <div>{{ item.name }}</div>
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="选择打印机">
-          <el-select v-model="form.deviceName" placeholder="请选择活动区域">
+          <el-select style="width:300px;" v-model="form.deviceName" placeholder="请选择打印机">
             <el-option v-for="item in cloudList" :key="item.id" :value="`${ item.printerName }(USB${item.port})`">
               <div>{{ item.printerName }}(USB{{item.port}})</div>
             </el-option>
           </el-select>
-          <el-button type="success"  @click="getCloudPrinterInfo">获取打印机信息</el-button>
+          <el-button type="success" @click="getCloudPrinterInfo">获取打印机信息</el-button>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        <el-button type="primary" @click="cloudPrinterManager">确 定</el-button>
       </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import { getNewShopList, getCloudDevice } from "../../../api/shop";
+import {
+  getNewShopList,
+  getCloudDevice,
+  deviceAdd,
+  cloudPrint,
+  shopDeviceList,
+  deviceDelete,
+} from "../../../api/shop";
 export default {
   name: "greetingCardPrinter",
   components: {},
@@ -180,8 +188,10 @@ export default {
         name: "",
         deviceSn: "lk10gy13861829",
         deviceSecret: "2Vy7D5sDDjUI2DZs",
-        shopId: "",
+        shopIdList: [0],
         deviceName: "",
+        deviceType: 28,
+        shopId: 0,
       },
       cloudList: [],
       params: {
@@ -265,6 +275,43 @@ export default {
   watch: {},
   // 方法集合
   methods: {
+    printTest() {
+      cloudPrint().then(() => {
+        console.log("添加云盒信息", res);
+        if (!res.code) {
+          this.cloudList = res.data;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
+    cloudPrinterManager() {
+      if (!this.form.name) {
+        return this.$message.warning(`请输入云盒名称!`);
+      }
+      if (!this.form.deviceSn) {
+        return this.$message.warning(`请输入云盒序列号!`);
+      }
+      if (!this.form.deviceSecret) {
+        return this.$message.warning(`请输入云盒秘钥!`);
+      }
+      deviceAdd(this.form).then((res) => {
+        console.log("添加云盒信息", res);
+        if (res.code === 200) {
+          this.$message.success(`成功添加云盒!`);
+          this.dialogVisible = false;
+          this.getCloudPrinterList();
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
     getCloudPrinterInfo() {
       let params = {
         deviceId: this.form.deviceSn,
@@ -275,6 +322,9 @@ export default {
         console.log("云盒信息", res);
         if (!res.code) {
           this.cloudList = res.data;
+          let cloud = this.cloudList[0];
+          if (!cloud) return;
+          this.form.deviceName = `${cloud.printerName}(USB${cloud.port})`;
         } else {
           this.$message({
             type: "error",
@@ -283,8 +333,11 @@ export default {
         }
       });
     },
-    addPrinter() {
+    addPrinter(v) {
       this.dialogVisible = true;
+      if (v) this.form = v;
+      if (this.form.id) return;
+      this.form.name = `贺卡打印云盒${new Date().getTime()}`;
     },
     changeShop(e) {
       if (e.at(-1)) {
@@ -297,11 +350,11 @@ export default {
     },
     changePrinterShop(e) {
       if (e.at(-1)) {
-        this.form.shopId = e.filter((v) => {
+        this.form.shopIdList = e.filter((v) => {
           return v;
         });
       } else {
-        this.form.shopId = [0];
+        this.form.shopIdList = [0];
       }
     },
     changeDmPaperSize(e) {
@@ -318,6 +371,36 @@ export default {
         this.params.dmPaperLength = 145;
       }
     },
+    deletePrinter(v) {
+      this.$confirm("此操作将删除打印云盒, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          deviceDelete({ id: v.id }).then((res) => {
+            if (res.code === 200) {
+              this.$message({
+                type: "error",
+                message: "删除成功!",
+              });
+              this.refreshData();
+            } else {
+              this.$message({
+                type: "error",
+                message: res.msg,
+              });
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
     getNewShopList() {
       getNewShopList().then((res) => {
         if (res.code === 200) {
@@ -331,10 +414,23 @@ export default {
         }
       });
     },
+    getCloudPrinterList() {
+      shopDeviceList({ deviceType: 28 }).then((res) => {
+        if (res.code === 200) {
+          this.printerList = res.data;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.getNewShopList();
+    this.getCloudPrinterList();
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},
@@ -477,10 +573,17 @@ export default {
         display: flex;
         margin-top: 10px;
         .card-title {
+          display: flex;
+          align-items: center;
           font-weight: bold;
           font-size: 14px;
           margin: 10px 0;
+          .card-tip {
+            font-size: 12px;
+            color: #fc7200;
+          }
         }
+
         .card-right {
           width: 230px;
           flex-shrink: 0;