juRenPackOne.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="label-container">
  3. <div class="ju_ren_one_level">
  4. <span>{{ productName ? productName : ' ' }}</span>
  5. <span class="ju_ren_one_level_two">{{ '' }}</span>
  6. </div>
  7. <div class="ju_ren_two_level">
  8. <span>{{ purchaseOrigins ? purchaseOrigins : ' ' }}</span>
  9. </div>
  10. <div class="ju_ren_two_level">
  11. <span>{{ specification ? specification : ' ' }}</span>
  12. <span class="ju_ren_one_level_two"
  13. >{{ netWeight ? netWeight : ' '
  14. }}{{ weightUnit ? weightUnit : ' ' }}</span
  15. >
  16. </div>
  17. <div class="ju_ren_Three_level">
  18. <span>{{ level ? level : ' ' }}</span>
  19. </div>
  20. <div class="ju_ren_four_level">
  21. <span>{{ batchNo ? batchNo : ' ' }}</span>
  22. <span class="ju_ren_two_level_two">{{
  23. createDate ? createDate : ' '
  24. }}</span>
  25. <span class="ju_ren_two_level_two"
  26. >{{ warrantyPeriod ? warrantyPeriod : ' '
  27. }}{{ warrantyPeriodUnit ? warrantyPeriodUnit : ' ' }}</span
  28. >
  29. </div>
  30. <div class="ju_ren_four_level">
  31. <span>{{ notice ? notice : ' ' }}</span>
  32. </div>
  33. <div class="ju_ren_four_level">
  34. <span>{{ layBy ? layBy : ' ' }}</span>
  35. </div>
  36. <div class="ju_ren_four_level">
  37. <span>{{ enforceStandards ? enforceStandards : ' ' }}</span>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. batchNo: '',
  46. createDate: '',
  47. enforceStandards: '',
  48. layBy: '',
  49. level: '',
  50. netWeight: '',
  51. notice: '',
  52. productName: '',
  53. purchaseOrigins: '',
  54. specification: '',
  55. warrantyPeriod: '',
  56. warrantyPeriodUnit: '',
  57. weightUnit: ''
  58. };
  59. },
  60. mounted() {
  61. const {
  62. batchNo,
  63. createDate,
  64. enforceStandards,
  65. layBy,
  66. level,
  67. netWeight,
  68. notice,
  69. productName,
  70. purchaseOrigins,
  71. specification,
  72. warrantyPeriod,
  73. warrantyPeriodUnit,
  74. weightUnit
  75. } = this.$route.query;
  76. this.productName = productName ? productName : '';
  77. this.batchNo = batchNo ? batchNo : '';
  78. this.createDate = createDate ? createDate : '';
  79. this.enforceStandards = enforceStandards ? enforceStandards : '';
  80. this.layBy = layBy ? layBy : '';
  81. this.level = level ? level : '';
  82. this.netWeight = netWeight ? netWeight : '';
  83. this.notice = notice ? notice : '';
  84. this.purchaseOrigins = purchaseOrigins ? purchaseOrigins : '';
  85. this.specification = specification ? specification : '';
  86. this.warrantyPeriod =
  87. warrantyPeriod && !warrantyPeriod ? warrantyPeriod : '';
  88. this.warrantyPeriodUnit = warrantyPeriodUnit ? warrantyPeriodUnit : '';
  89. this.weightUnit = weightUnit ? weightUnit : '';
  90. if (this.warrantyPeriodUnit === '1') {
  91. this.warrantyPeriodUnit = '分钟';
  92. } else if (this.warrantyPeriodUnit === '2') {
  93. this.warrantyPeriodUnit = '小时';
  94. } else if (this.warrantyPeriodUnit === '3') {
  95. this.warrantyPeriodUnit = '日';
  96. } else if (this.warrantyPeriodUnit === '4') {
  97. this.warrantyPeriodUnit = '月';
  98. } else if (this.warrantyPeriodUnit === '5') {
  99. this.warrantyPeriodUnit = '年';
  100. } else {
  101. this.warrantyPeriodUnit = '';
  102. }
  103. this.$nextTick(() => {
  104. window.print();
  105. });
  106. }
  107. };
  108. </script>
  109. <style scoped lang="scss">
  110. .label-container {
  111. width: 90mm;
  112. height: 70mm;
  113. box-sizing: border-box;
  114. font-size: 12px;
  115. color: green;
  116. margin: 0 auto;
  117. font-weight: 700;
  118. .ju_ren_one_level {
  119. display: flex;
  120. margin: 63px 0 0 64px;
  121. flex-direction: row;
  122. span {
  123. display: inline-block;
  124. width: 70px;
  125. height: 19px;
  126. }
  127. .ju_ren_one_level_two {
  128. margin-left: 35px;
  129. }
  130. }
  131. .ju_ren_two_level {
  132. margin-left: 64px;
  133. span {
  134. display: inline-block;
  135. width: 70px;
  136. height: 19px;
  137. }
  138. .ju_ren_one_level_two {
  139. margin-left: 35px;
  140. }
  141. .ju_ren_two_level_two {
  142. margin-left: 100px;
  143. }
  144. }
  145. .ju_ren_Three_level {
  146. margin: 2px 0 0 110px;
  147. span {
  148. display: inline-block;
  149. height: 19px;
  150. }
  151. }
  152. .ju_ren_four_level {
  153. margin: 3px 0 0 64px;
  154. span {
  155. display: inline-block;
  156. width: 60px;
  157. height: 19px;
  158. }
  159. .ju_ren_one_level_two {
  160. margin-left: 42px;
  161. }
  162. .ju_ren_two_level_two {
  163. margin-left: 42px;
  164. }
  165. }
  166. }
  167. </style>