juRenPack.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <div class="label-container">
  3. <!-- 第一行信息 -->
  4. <div class="label-title">
  5. <div class="label-info-left">
  6. <div>{{ productName ? productName : ' ' }}</div>
  7. <div>{{ purchaseOrigins ? purchaseOrigins : ' ' }}</div>
  8. <div>{{ batchNo ? batchNo : ' ' }}</div>
  9. <div>{{ specification ? specification : ' ' }}</div>
  10. <div>{{ createDate ? createDate : ' ' }}</div>
  11. <div>{{ layBy ? layBy : ' ' }}</div>
  12. <div>{{ notice ? notice : ' ' }}</div>
  13. <div>{{ enforceStandards ? enforceStandards : ' ' }}</div>
  14. </div>
  15. <div class="label-info-right">
  16. <div class="right-box">{{ level ? level : ' ' }}</div>
  17. <div class="right-div"
  18. >{{ netWeight ? netWeight : ' '
  19. }}{{ weightUnit ? weightUnit : ' ' }}</div
  20. >
  21. <div class="right-div"
  22. >{{ warrantyPeriod ? warrantyPeriod : ' '
  23. }}{{ warrantyPeriodUnit ? warrantyPeriodUnit : ' ' }}</div
  24. >
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. // import JsBarcode from 'jsbarcode';
  31. export default {
  32. data() {
  33. return {
  34. productName: ''
  35. };
  36. },
  37. mounted() {
  38. const {
  39. batchNo,
  40. createDate,
  41. enforceStandards,
  42. layBy,
  43. level,
  44. netWeight,
  45. notice,
  46. productName,
  47. purchaseOrigins,
  48. specification,
  49. warrantyPeriod,
  50. warrantyPeriodUnit,
  51. weightUnit
  52. } = this.$route.query;
  53. this.productName = productName;
  54. this.batchNo = batchNo;
  55. this.createDate = createDate;
  56. this.enforceStandards = enforceStandards;
  57. this.layBy = layBy;
  58. this.level = level;
  59. this.netWeight = netWeight;
  60. this.notice = notice;
  61. this.purchaseOrigins = purchaseOrigins;
  62. this.specification = specification;
  63. this.warrantyPeriod = warrantyPeriod;
  64. this.warrantyPeriodUnit = warrantyPeriodUnit;
  65. this.weightUnit = weightUnit;
  66. if (this.warrantyPeriodUnit === '1') {
  67. this.warrantyPeriodUnit = '分钟';
  68. } else if (this.warrantyPeriodUnit === '2') {
  69. this.warrantyPeriodUnit = '小时';
  70. } else if (this.warrantyPeriodUnit === '3') {
  71. this.warrantyPeriodUnit = '日';
  72. } else if (this.warrantyPeriodUnit === '4') {
  73. this.warrantyPeriodUnit = '月';
  74. } else if (this.warrantyPeriodUnit === '5') {
  75. this.warrantyPeriodUnit = '年';
  76. }
  77. // const { id, name, price } = this.$route.query;
  78. // this.order = { id, name, price };
  79. // console.log('打印参数', this.$route.query);
  80. // console.log('打印参数', this.$route.query);
  81. // this.orderId = this.$route.query.orderId;
  82. // this.type = this.$route.query.type;
  83. // window.addEventListener('message', (event) => {
  84. // console.log('接收到的参数', event.data);
  85. // });
  86. // JsBarcode('#barCode', '123456789012', {
  87. // format: 'CODE128',
  88. // width: 4,
  89. // height: 40,
  90. // displayValue: true
  91. // });
  92. }
  93. };
  94. </script>
  95. <style scoped lang="scss">
  96. .label-container {
  97. // font-family: "Arial", "Helvetica", sans-serif;
  98. width: 90mm;
  99. height: 60mm;
  100. box-sizing: border-box;
  101. font-size: 10px;
  102. color: green;
  103. margin: 0 auto;
  104. }
  105. .label-title {
  106. display: flex;
  107. flex-direction: row;
  108. padding: 0 45px;
  109. box-sizing: border-box;
  110. }
  111. .label-info-left {
  112. display: flex;
  113. // flex: 1;
  114. flex-direction: column;
  115. flex-wrap: wrap;
  116. margin: 54px 0 0 62px;
  117. div {
  118. height: 17px;
  119. }
  120. }
  121. .label-info-right {
  122. display: flex;
  123. // flex: 1;
  124. flex-direction: column;
  125. justify-content: center;
  126. .right-box {
  127. margin: 34px 0 1px 18px;
  128. }
  129. .right-div {
  130. margin: 0 0 1px 18px;
  131. height: 17px;
  132. }
  133. }
  134. .row {
  135. display: flex;
  136. justify-content: space-between;
  137. margin-bottom: 4px;
  138. }
  139. .knife-table {
  140. border-collapse: collapse;
  141. width: 100%;
  142. margin: 8px 0;
  143. text-align: center;
  144. }
  145. .knife-table th,
  146. .knife-table td {
  147. border: 1px solid #000;
  148. padding: 4px;
  149. }
  150. .knife-table tbody {
  151. height: 30px;
  152. .knife-title {
  153. width: 60px;
  154. }
  155. }
  156. .knife-table img {
  157. height: 80px;
  158. }
  159. .info {
  160. display: flex;
  161. flex-direction: column;
  162. padding: 0 62px 0 45px;
  163. box-sizing: border-box;
  164. p {
  165. padding: 0;
  166. margin: 0;
  167. }
  168. }
  169. .phone-box {
  170. display: flex;
  171. flex-direction: row;
  172. padding: 0 62px 0 45px;
  173. align-items: center;
  174. justify-content: center;
  175. box-sizing: border-box;
  176. .phone-canvas-left-box {
  177. width: 220px;
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. canvas {
  182. width: 100px;
  183. height: 55px;
  184. }
  185. p {
  186. margin: 0;
  187. padding: 0;
  188. font-size: 9px;
  189. font-weight: normal;
  190. }
  191. }
  192. .phone-canvas-right-box {
  193. display: flex;
  194. width: 100%;
  195. justify-content: flex-end;
  196. flex-direction: column;
  197. align-items: center;
  198. canvas {
  199. width: 150px;
  200. height: 55px;
  201. }
  202. p {
  203. margin: 0;
  204. padding: 0;
  205. font-size: 10px;
  206. font-weight: normal;
  207. }
  208. }
  209. }
  210. .icons {
  211. display: flex;
  212. gap: 3px;
  213. padding: 0 62px 0 45px;
  214. margin-top: 10px;
  215. box-sizing: border-box;
  216. font-size: 8px;
  217. }
  218. .barcode {
  219. text-align: center;
  220. }
  221. .size {
  222. text-align: center;
  223. font-size: 8px;
  224. font-weight: normal;
  225. margin-top: 8px;
  226. }
  227. .expiry {
  228. display: flex;
  229. text-align: left;
  230. font-size: 14px;
  231. font-weight: normal;
  232. align-items: center;
  233. }
  234. </style>