printTag.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="printTag">
  3. <view class="print-nums flex flex_column align_center justify_center">
  4. <view>打印数量</view>
  5. <view class="u-ninput">
  6. <u-number-box :min="1" color="#000" bg-color="#fff" size="30" :input-height="70" :input-width="100"></u-number-box>
  7. </view>
  8. </view>
  9. <view class="shelf-info">
  10. <view class="shelf-info-title">
  11. <view>西安车领主常青二路数字货架</view>
  12. <view><text class="pno">A02</text></view>
  13. </view>
  14. <view>产品编码:JO-21026E</view>
  15. <view>产品名称:箭牌机油滤清器 10款进口大众途锐...</view>
  16. <view>库存数量:3</view>
  17. </view>
  18. <view class="buttons flex align_center justify_center">
  19. <view v-if="fromPage == 'bdtq'"><u-button @click="cansel" shape="circle" plain>返回列表</u-button></view>
  20. <view v-if="fromPage == 'smdy'"><u-button @click="cansel" shape="circle" plain>重新扫描</u-button></view>
  21. <view>
  22. <kk-printer ref="kkprinter" :bufferData="bufferData" @onPrintSuccess="onPrintSuccess"></kk-printer>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import kkPrinter from '@/components/kk-printer/index.vue';
  29. export default {
  30. components:{
  31. kkPrinter
  32. },
  33. data() {
  34. return {
  35. part: null,
  36. fromPage: '',
  37. bufferData:''
  38. }
  39. },
  40. onLoad(opts) {
  41. this.fromPage = opts.from
  42. },
  43. onUnload() {
  44. this.$refs.kkprinter.closeConnect()
  45. },
  46. methods: {
  47. cansel(){
  48. uni.navigateBack()
  49. },
  50. // 打印
  51. onPrint(opt){
  52. this.bufferData = strCmd;
  53. },
  54. // 打印成功
  55. onPrintSuccess(){
  56. uni.navigateBack()
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="less">
  62. .printTag{
  63. background-color: #fff;
  64. width: 100vh;
  65. padding: 50rpx 30rpx;
  66. .print-nums{
  67. padding: 50rpx 30rpx;
  68. color: #999;
  69. font-size: 32rpx;
  70. > view{
  71. padding: 20rpx 0;
  72. }
  73. .u-ninput{
  74. border: 2rpx solid #eee;
  75. border-radius: 50rpx;
  76. padding: 0 12rpx;
  77. }
  78. /deep/ .u-icon-disabled{
  79. background: #fff!important;
  80. }
  81. /deep/ .u-number-input{
  82. margin: 0 2rpx;
  83. border: 2rpx solid #eee;
  84. border-top: 0;
  85. border-bottom: 0;
  86. }
  87. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  88. border-radius: 50rpx;
  89. }
  90. }
  91. .shelf-info{
  92. background-color: #f8f8f8;
  93. padding: 30rpx;
  94. border-radius: 12rpx;
  95. color: #707070;
  96. .shelf-info-title{
  97. font-size: 32rpx;
  98. color: #222222;
  99. display: flex;
  100. justify-content: space-between;
  101. margin-bottom: 10rpx;
  102. .pno{
  103. background: rgba(3, 54, 146, 0.15);
  104. border-radius: 100rpx;
  105. padding: 6rpx 20rpx;
  106. color: #033692;
  107. font-size: 24rpx;
  108. }
  109. }
  110. }
  111. .buttons{
  112. padding: 50rpx 0;
  113. > view{
  114. width: 36%;
  115. margin: 0 2%;
  116. }
  117. }
  118. }
  119. </style>