receiptPrinting.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. const receiptPrinting = (data) => {
  2. let params = {
  3. "printList": [{
  4. "text": "访客单",
  5. "textSize": 38,
  6. "bold": true,
  7. "algin": "center"
  8. }, {
  9. "text": " ",
  10. "textSize": 35,
  11. "bold": false,
  12. "algin": "center"
  13. }, {
  14. "text": "欢迎光临",
  15. "textSize": 25,
  16. "bold": false,
  17. "algin": "center"
  18. }, {
  19. "text": "当日有效,离开时请交还门卫",
  20. "textSize": 25,
  21. "bold": false,
  22. "algin": "center"
  23. }, {
  24. "text": "来访时间:" + data.visitingTime,
  25. "textSize": 25,
  26. "bold": true,
  27. "algin": "center"
  28. }, {
  29. "text": "--------------------------------------",
  30. "textSize": 15,
  31. "bold": false,
  32. "algin": "center"
  33. }, {
  34. "text": " ",
  35. "textSize": 25,
  36. "bold": false,
  37. "algin": "left"
  38. }, {
  39. "text": "姓 名:" + (data.visitorName ? data.visitorName : ''),
  40. "textSize": 22,
  41. "bold": true,
  42. "algin": "left"
  43. }, {
  44. "text": "事 由:" + (data.causeMatterName ? data.causeMatterName : ''),
  45. "textSize": 22,
  46. "bold": true,
  47. "algin": "left"
  48. }, {
  49. "text": "电 话:" + (data.visitorPhone ? data.visitorPhone : ''),
  50. "textSize": 22,
  51. "bold": false,
  52. "algin": "left"
  53. }, {
  54. "text": "单 位:" + (data.visitorUnit ? data.visitorUnit : ''),
  55. "textSize": 22,
  56. "bold": false,
  57. "algin": "left"
  58. }, {
  59. "text": "车牌号: " + (data.carnum ? data.carnum : ''),
  60. "textSize": 22,
  61. "bold": false,
  62. "algin": "left"
  63. }, {
  64. "text": "人 数:" + (data.peopleNum ? data.peopleNum : ''),
  65. "textSize": 22,
  66. "bold": false,
  67. "algin": "left"
  68. }, {
  69. "text": " ",
  70. "textSize": 25,
  71. "bold": false,
  72. "algin": "left"
  73. }, {
  74. "text": "【 受访人 】",
  75. "textSize": 22,
  76. "bold": true,
  77. "algin": "left"
  78. }, {
  79. "text": "楼 层:" + (data.floor ? (data.floor + '楼') : ''),
  80. "textSize": 22,
  81. "bold": true,
  82. "algin": "left"
  83. }, {
  84. "text": "房间号: " + (data.room ? data.room : ''),
  85. "textSize": 22,
  86. "bold": true,
  87. "algin": "left"
  88. }, {
  89. "text": "姓 名:" + (data.name ? data.name : ''),
  90. "textSize": 22,
  91. "bold": false,
  92. "algin": "left"
  93. }, {
  94. "text": "电 话:" + (data.phone ? data.phone : ''),
  95. "textSize": 22,
  96. "bold": false,
  97. "algin": "left"
  98. }, {
  99. "text": "--------------------------------------",
  100. "textSize": 15,
  101. "bold": false,
  102. "algin": "center"
  103. },
  104. ]
  105. }
  106. return params
  107. }
  108. module.exports = {
  109. receiptPrinting
  110. }