shish 4 年之前
父節點
當前提交
692b5197ba
共有 1 個文件被更改,包括 34 次插入31 次删除
  1. 34 31
      hdApp/src/admin/item/list.vue

+ 34 - 31
hdApp/src/admin/item/list.vue

@@ -98,48 +98,51 @@ export default {
 		})
 	},
 	methods: {
-		// #ifdef APP-PLUS
 		moreToDo(item){
 			//查询是否已经连接蓝牙
 			let that=this;
-			let doList = ['打1个标签', '打2个标签', '打5个标签','打10个标签','打20个标签']
-			let doNum = [1,2,5,10,20]
+			let doList = ['复制花材', '打1个标签', '打2个标签', '打10个标签','打20个标签']
+			let doNum = [0,1,2,10,20]
 			uni.showActionSheet({
 				itemList: doList,
 				success: function (respond) {
-					let index = respond.tapIndex			
-					// #ifdef APP-PLUS
-					plug.state({},ret=>{
-						if(ret.state == 1){
-							that.$util.confirmModal({content:'您还没有连接标签机,请先连接'},() => {
-								plug.connectUSB({setBackgroundColor:"#2088d2"},ret=>{
-									//console.log(ret)
+					let index = respond.tapIndex
+					if (index == 0) {
+						that.$msg('开发中')
+					}else{
+						// #ifdef APP-PLUS
+						plug.state({},ret=>{
+							if(ret.state == 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.itemId,currentNum)
+								data.push(label)
+								//说明地址 https://ext.dcloud.net.cn/plugin?id=462
+								plug.printer({"TSC":data,isArray:true},result=>{
+									//console.log(result)
 								})
-							})
-						}else{
-							let currentNum = Number(doNum[index])
-							if(Number(currentNum)<0){
-								that.$msg('请选择打印数量')
-								return false
 							}
-							let data = []
-							let label = that.createLable(item.name,item.itemId,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
+						})
+						// #endif
+						// #ifdef MP-WEIXIN
+						that.$msg('请在App上打印')
+						// #endif
+					}
 				}
 			})
-
 		},
-		// #endif
 		//大标签
 		createLable(itemName,itemId,num){
 			//制作标签格式,