shish 4 лет назад
Родитель
Сommit
4e5db70ba4

+ 1 - 1
ghsApp/src/admin/home/workbench.vue

@@ -114,7 +114,7 @@ export default {
 			tabsData: [
 				{ name: "商城", img: 'ghs/home/shop.png', url: "/admin/home/mall" },
 				{ name: "改价", img: 'ghs/home/gj.png', url: "/admin/changePrice/list" },
-				{ name: "供应商", img: 'ghs/home/icon_ghs.png', url: "/pagesPurchase/supplier" },
+				{ name: "采购单", img: 'ghs/home/icon_caigou.png', url: "/pagesPurchase/order" },
 				{ name: "报损单", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
 				{ name: "预订单", img: 'ghs/home/kcyjs.png', url: "/admin/order/statBook" },
 				{ name: "花材", img: 'ghs/home/hcgl.png', url: "/admin/item/list" },

+ 1 - 1
ghsApp/src/admin/item/add.vue

@@ -211,7 +211,7 @@
       <div class="module-com input-line-wrap goods-wrap">
         <div class="module-tit">
           <span>花材图片</span>
-          <span class="app-color-3">(建议比例 600X600)</span>
+          <span class="app-color-3">(建议比例 1:1)</span>
         </div>
         <view class="module-det">
           <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers"

+ 2 - 1
ghsApp/src/admin/item/copy.vue

@@ -124,7 +124,7 @@
       <view class="module-com input-line-wrap goods-wrap">
         <view class="module-tit">
           <span>花材图片</span>
-          <span class="app-color-3">(建议比例 600X600)</span>
+          <span class="app-color-3">(建议比例 1:1)</span>
         </view>
         <view class="module-det">
           <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers"
@@ -317,6 +317,7 @@ export default {
           e => this.form.bigUnitId == e.id
         )[0];
         this.productData = res.data
+        this.productData.id = 0
       });
     },
     imgUploadSuccess(res) {

+ 1 - 1
ghsApp/src/admin/item/detail.vue

@@ -126,7 +126,7 @@
       <view class="module-com input-line-wrap goods-wrap">
         <view class="module-tit">
           <span>花材图片</span>
-          <span class="app-color-3">(建议比例 600X600)</span>
+          <span class="app-color-3">(建议比例 1:1)</span>
         </view>
         <view class="module-det">
           <htz-image-upload :max="1" :compress="true" v-model="currentImgData" :headers="headers"

+ 26 - 26
ghsApp/src/admin/item/list.vue

@@ -98,7 +98,6 @@ export default {
 		})
 	},
 	methods: {
-		
 		moreToDo(item){
 			//查询是否已经连接蓝牙
 			let that=this;
@@ -110,32 +109,33 @@ export default {
 					let index = respond.tapIndex
 					if (index == 0) {
 						that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
-					}
-					// #ifdef APP-PLUS
-					plug.state({},ret=>{
-						if(ret.code == 1){
-							that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
-								that.pageTo({url:'/admin/tools/blue'})
-							})
-						}else{
-							let currentNum = Number(doNum[index])
-							if(Number(currentNum)<0){
-								this.$msg('请选择打印数量')
-								return false
+					}else{
+						// #ifdef APP-PLUS
+						plug.state({},ret=>{
+							if(ret.code == 1){
+								that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+									that.pageTo({url:'/admin/tools/blue'})
+								})
+							}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)
+								})
 							}
-							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
+					}
 				}
 			})
 		},

+ 63 - 6
ghsApp/src/pagesPurchase/info.vue

@@ -88,7 +88,7 @@
 									</text>
 								</view>
 								<view class="info-line">
-									<text class="item-type">{{ s.property }}</text>
+									<text class="item-type" style="color:#3385FF;" @click.stop="printLabel(s)">打标签</text>
 									<text class="item-count">{{ parseFloat(s.itemNum) }}扎</text>
 								</view>
 							</view>
@@ -220,6 +220,34 @@ export default {
 
 	},
 	methods: {
+		printLabel(ele){
+			let that = this
+			// #ifdef APP-PLUS
+			plug.state({},ret=>{
+				if(ret.code == 1){
+					that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+						that.pageTo({url:'/admin/tools/blue'})
+					})
+				}else{
+					that.$util.confirmModal({content:'确定打印'+ele.name+'的标签?'},() => {
+							let data = []
+							if(ele.name && !that.$util.isEmpty(ele.name)){
+								let num = parseFloat(ele.itemNum)
+								let label = that.createLable(ele.name,ele.itemId,num)
+								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
+		},
 		printAllLabel(){
 			let that = this
 			// #ifdef APP-PLUS
@@ -232,11 +260,14 @@ export default {
 					that.$util.confirmModal({content:'确定打印全部标签?'},() => {
 						if(!that.$util.isEmpty(that.detailInfo.itemInfo)){
 							let data = []
-							for (const elem of that.detailInfo.itemInfo) {
-								if(elem.name && !that.$util.isEmpty(elem.name)){
-									let num = parseFloat(elem.itemNum)
-									let label = that.createLable(elem.name,elem.itemId,num)
+							for (const ele of that.detailInfo.itemInfo) {
+								if(ele.name && !that.$util.isEmpty(ele.name)){
+									let num = parseFloat(ele.itemNum)
+									num = 5
+									let label = that.createLable(ele.name,ele.itemId,num)
 									data.push(label)
+									let separateLabel = that.createSeparateLabel()
+									data.push(separateLabel)
 								}
 							}
 							//说明地址 https://ext.dcloud.net.cn/plugin?id=462
@@ -251,7 +282,33 @@ export default {
 			// #ifdef MP-WEIXIN
 			that.$msg('请在App上打印')
 			// #endif
-		},		
+		},
+		//分隔标签
+		createSeparateLabel(){
+			//制作标签格式, 
+			var data=[];  //定义一个数组
+			var line={};  //每添加一个,代表一行字
+
+			//设置标签纸大小
+			line={};
+			line.width=40; //mm
+			line.height=50; //mm
+			line.gap=2; //标签纸之间,间隙长度 mm
+			line.page=2; //打印几份
+			data.push(line); //每添加一个,代表一行字
+
+			//添加文字
+			line={};
+			line.text= '======';
+			line.rotation=0;
+			line.x=30;
+			line.y=15;
+			line.xscal=2;
+			line.yscal=2;
+			data.push(line); //每添加一个,代表一行字
+
+			return data;
+		},
 		createLable(itemName,itemId,num){
 			//制作标签格式, 
 			var data=[];  //定义一个数组