如何自己调标签样式-代码版本
2024-07-24 10:53
标签样式如下
代码模块-这个就是标签模板配置
也就是打印模板配置,可以调整
对应代码如下,可以调整:
999148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
WPServer.initPage({ left: 10, top:0, width: 60, height: 40 });//标签画布}});//使用人下方横线items.push({type: 'line',x: OFF_X,y: 11 * 7 - 6,length: 180});items.push({type: 'text',text: '编码:' + label.assetBarcode,//位置调整x: OFF_X + 4,y: 11 * 7 - 2,width: 170,height: 11,style: {//文本调整textAlign: 'left',fontWeight: 'bold',fontSize:18}});WPServer.addPage(items);});WPServer.preview();
参数对应
其实就是取的这里面的值↑↑
99123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
//价格amount: 1000//位置代码areaCode: "GZAQ01"//位置名称areaName: "广州a区"//资产条码assetBarcode: "IP16002"// 类别名称assetClasses: "电子产品及通信设备"//分类代码assetClassesCode: "06"//资产名称assetName: " iPhone 16"//规格型号assetSpecifications: "1T"//购入日期buyTime: "2022-09-15"//使用位置编码(领用后位置)receiveAreaCode: "GZAQ01"//使用位置名称(领用后位置)receiveAreaName: "广州a区"//领用地点(手动输入)receiveStoragePlace: "随身携带"//序列号snCode: ""//单位unit: "个"//使用部门名称useDepartmentName: "外来人员"//使用期限usePeriod: "60"//使用人userName: "林志"//使用人编号userNo: "yg002"
标签样式2-编码在上
Plain Text
复制代码
999828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
WPServer.initPage({ left: 4, top: 0, width: 60, height: 40 }); textAlign: 'left', fontWeight: 'bold', fontSize:28, fontFamily:'黑体' } }); items.push({ type: 'line', x: OFF_X, y: 58.2+ OFF_Y, length: 179.5, style: { width: '3' } }); items.push({ type: 'barcode', codeType: 'QRCode', codeData: label.assetBarcode, x: OFF_X + 4.5, y: OFF_Y + ROW_Y + 63, width:55, height: 55, config: { QRCodeVersion: 2 } }); items.push({ type: 'line', x: 54, y: OFF_Y + ROW_Y + 56.5, height: 61.1, style: { width: '3' } }); items.push({ type: 'text', text: '使用部门:' + label.useDepartmentName, x: 57, y: 14 * 3 -3+33, width: 109, height: 20.4, style: { textAlign: 'left', fontWeight: 'bold', fontSize:25, fontFamily:'黑体' } }); items.push({ type: 'text', text: '使用地点:', x: 57, y: 16* 4 - 3+38, width: 60, height: 20.4, style: { textAlign: 'left', fontWeight: 'bold', fontSize:25, fontFamily:'黑体' } }); items.push({ type: 'text', text: label.receiveStoragePlace, x: 57 + 46, y: 16* 4 - 3+38, width: 62, height: 20.4, style: { textAlign: 'left', fontWeight: 'bold', fontSize:25, fontFamily:'黑体' } }); WPServer.addPage(items);});WPServer.preview();
常用调整参数
注意中英文
● //text:label.$xdata[402].__str01__, 此抬头有问题
● text: 'XX公司名称',