shish 4 роки тому
батько
коміт
42518e41c4

+ 0 - 2
ghsApp/src/admin/home/me.vue

@@ -71,11 +71,9 @@
               <view class="tui-title">使用教程</view>
             </tui-list-cell>
 
-            <!-- #ifdef APP-PLUS -->
             <tui-list-cell @click="pageTo({ url: '/pagesStore/me/cashSet' })" class="line-cell" :hover="false" :arrow="true" >
               <view class="tui-title">提现账号</view>
             </tui-list-cell>
-            <!-- #endif -->
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/password' })" class="line-cell" :hover="false" :arrow="true">
               <view class="tui-title">密码修改</view>

+ 2 - 2
hdApp/src/admin/goods/cgNewPlantResult.vue

@@ -5,8 +5,8 @@
 			<view class="result-view">
 				<view class="iconfont iconchenggong"></view>
 				<view class="result-title">操作成功</view>
-				<button class="admin-button-com big blue" style="width:45vh;" @click="goDetail">打印条码</button>
-				<button class="admin-button-com big default" style="width:45vh;margin-top:30upx;" @click="goBackHome">返回</button>
+				<button class="admin-button-com big blue" style="width:45vw;" @click="goDetail">打印条码</button>
+				<button class="admin-button-com big default" style="width:45vw;margin-top:30upx;" @click="goBackHome">返回</button>
 			</view>
 		</view>
 	</view>

+ 90 - 7
hdApp/src/admin/goods/list.vue

@@ -41,6 +41,7 @@
                   </view>
                 </view>
                 <view class="goods-list-bottom flex-center-between">
+                  <text @click.stop="moreToDo(goodsItem)">更多</text>
                   <text @click.stop="getSaleRecord">销售记录</text>
                   <text @click.stop="getStockChange(goodsItem)">库存明细</text>
                   <text @click.stop="edit(goodsItem.id)">编辑</text>
@@ -70,12 +71,15 @@
   </view>
 </template>
 <script>
-import AppSearchModule from "@/components/module/app-search";
-import OperateModule from "@/admin/home/components/module/operate";
-import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import ModalModule from "@/components/plugin/modal";
-import {categoryListB,getCategoryGoodsB} from "@/api/goods";
-import { list } from "@/mixins";
+import AppSearchModule from "@/components/module/app-search"
+import OperateModule from "@/admin/home/components/module/operate"
+import AppWrapperEmpty from "@/components/app-wrapper-empty"
+import ModalModule from "@/components/plugin/modal"
+import {categoryListB,getCategoryGoodsB} from "@/api/goods"
+import { list } from "@/mixins"
+// #ifdef APP-PLUS
+const plug= uni.requireNativePlugin('Html5app-Gprinter')
+// #endif
 export default {
   name: "list",
   components: {
@@ -106,9 +110,88 @@ export default {
   computed: {
   },
   onLoad: function() {
-    this.getCategoryData();
+    this.getCategoryData()
   },
   methods: {
+		moreToDo(item){
+			//查询是否已经连接蓝牙
+			let that=this;
+			let doList = ['打1个条码', '打2个条码', '打10个条码','打20个条码']
+			let doNum = [1,2,10,20]
+			uni.showActionSheet({
+				itemList: doList,
+				success: function (respond) {
+					let index = respond.tapIndex
+          // #ifdef APP-PLUS
+          plug.state({},ret=>{
+            if(ret.code == 1){
+              that.$util.confirmModal({content:'您还没有连接条码机,请先连接'},() => {
+                // #ifdef APP-PLUS
+                plug.connectUSB({setBackgroundColor:"#2088d2"},ret=>{   
+                  //console.log(ret)
+                })
+                // #endif
+              })
+            }else{
+              let currentNum = Number(doNum[index])
+              if(Number(currentNum)<0){
+                this.$msg('请选择打印数量')
+                return false
+              }
+              let data = []
+              let label = that.createLable(item.name,item.sn,currentNum)
+              data.push(label)
+              //说明地址 https://ext.dcloud.net.cn/plugin?id=462
+              plug.printer({"TSC":data,isArray:true},result=>{
+                //console.log(result)
+              })
+            }
+          })
+          // #endif
+          // #ifdef MP-WEIXIN
+          that.$msg('请在App上打印')
+          // #endif
+				}
+			})
+		},
+		//大条码
+		createLable(itemName,itemId,num){
+			//制作条码格式,
+			var data=[];  //定义一个数组
+			var line={};  //每添加一个,代表一行字
+
+			//设置条码纸大小
+			line={};
+			line.width=40; //mm
+			line.height=50; //mm
+			line.gap=2; //条码纸之间,间隙长度 mm
+			line.page=num; //打印几份
+			data.push(line); //每添加一个,代表一行字
+
+			//添加文字
+			line={};
+			line.text= itemName;
+			line.rotation=0;
+			line.x=260;
+			line.y=15;
+			line.xscal=2;
+			line.yscal=2;
+			data.push(line); //每添加一个,代表一行字
+
+			//添加条型码
+			line={};
+			line.barcode=itemId;
+			line.x=260;
+			line.y=80;
+			line.type="CODE128";
+			line.width=2;//条型宽度,这里的宽指的是 条型码 竖条的宽度,不是整个条型码的宽度
+			line.height=90;
+			line.readable=true;
+			line.rotation=0;
+			data.push(line);
+
+			return data;
+		},
     searchFn(){
 
     },

+ 1 - 1
hdApp/src/admin/goods/plant.vue

@@ -7,7 +7,7 @@
       </view>
       <view style="float:right">
         <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="clearSelect()">清除已选</button>
-        <button class="admin-button-com middle blue" @click="newCg()">新品</button>
+        <button class="admin-button-com middle blue" @click="newCg()">新品</button>
       </view>
     </view>
 

+ 3 - 5
hdApp/src/admin/home/me.vue

@@ -65,11 +65,9 @@
               <view class="tui-title">充值记录</view>
             </tui-list-cell>
 
-            <!-- #ifdef APP-PLUS -->
             <tui-list-cell @click="pageTo({ url: '/pagesStore/me/cashSet' })" class="line-cell" :hover="false" :arrow="true" >
-              <view class="tui-title">提现号</view>
+              <view class="tui-title">提现号</view>
             </tui-list-cell>
-            <!-- #endif -->
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/password' })" class="line-cell" :hover="false" :arrow="true">
               <view class="tui-title">密码修改</view>
@@ -223,11 +221,11 @@ export default {
     },
     checkToApplyCash () {
       let self = this;
-      //没有设置提现号则提示
+      //没有设置提现号则提示
       if (self.shopInfo.cashAccount == "") {
         uni.showModal({
           title: "提示",
-          content: "您还没有设置提现号",
+          content: "您还没有设置提现号",
           confirmText: "去设置",
           success: function (res) {
             if (res.confirm) {

+ 2 - 2
hdApp/src/admin/item/list.vue

@@ -161,7 +161,7 @@ export default {
 			line={};
 			line.text= itemName;
 			line.rotation=0;
-			line.x=30;
+			line.x=260;
 			line.y=15;
 			line.xscal=2;
 			line.yscal=2;
@@ -170,7 +170,7 @@ export default {
 			//添加条型码
 			line={};
 			line.barcode=itemId;
-			line.x=30;
+			line.x=260;
 			line.y=80;
 			line.type="CODE128";
 			line.width=2;//条型宽度,这里的宽指的是 条型码 竖条的宽度,不是整个条型码的宽度

+ 1 - 1
hdApp/src/api/cash/index.js

@@ -1,6 +1,6 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-//提现号设置 shish 2021.3.27
+//提现号设置 shish 2021.3.27
 export const cashUpdate = data => {
 	return https.get('/shop/cash-update', data)
 }

+ 1 - 1
hdApp/src/pages.json

@@ -132,7 +132,7 @@
 				{"path": "me/expend","style": {"navigationBarTitleText": "支出记录"}},
 				{ "path": "me/recharge", "style": { "navigationBarTitleText": "充值" } },
 				{ "path": "me/rechargeList", "style": { "navigationBarTitleText": "充值记录" } },
-				{ "path": "me/cashSet", "style": { "navigationBarTitleText": "提现号" } },
+				{ "path": "me/cashSet", "style": { "navigationBarTitleText": "提现号" } },
 				{ "path": "me/expressSet", "style": { "navigationBarTitleText": "快递设置" } },
 				{ "path": "me/rechargeSuccess", "style": { "navigationBarTitleText": "充值成功" } }
 			]

+ 1 - 1
hdApp/src/pagesStore/me/cashSet.vue

@@ -86,7 +86,7 @@ export default {
   },
   onShow() {
     uni.setNavigationBarTitle({
-      title: `提现号设置`,
+      title: `提现号设置`,
     });
   },
   methods: {