PdfHtml.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div ref="printArea" style="font-family: ProximaNova-Semibold;">
  3. <table>
  4. <tr>
  5. <td>
  6. <img :src="comInfo.image" style="width: 300px;height: 300px;margin-right: 14px;">
  7. </td>
  8. <td style="vertical-align: top;">
  9. <p style="font-weight: bold;font-size: 22px;padding-bottom: 24px;color:#00213B">
  10. <span style="margin-right: 5px;">{{pageData.product_code}}</span>
  11. <span>{{pageData.product_name}}</span>
  12. </p>
  13. <p style="line-height: 20px;color:#00213B;font-size: 14px;">{{comInfo.description}}</p>
  14. </td>
  15. </tr>
  16. </table>
  17. <div>
  18. <p style="font-weight: bold;font-size: 17px;margin: 40px 0 10px;color:#00213B">Specifications</p>
  19. <table style="width:100%;border-collapse: collapse;font-size: 14px;table-layout: fixed;text-align:center;">
  20. <tr style="background-color: #F7F8FC;">
  21. <td v-for="(item,key) in tabColumns" :key="key" style="font-weight: bold;padding:15px 0;color:#00213B;width: 25%;font-size: 14px;border-bottom:1px solid #EFEFEF">{{item.label}}</td>
  22. </tr>
  23. <tr style="padding:10px 0;">
  24. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF">{{specificationsObj.time}}</td>
  25. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF">{{specificationsObj.model}}</td>
  26. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF">
  27. <div v-for="(item,idx) in specificationsObj.decorationArr" :key="idx" style="padding-bottom:4px;">{{item}}</div>
  28. </td>
  29. <td style="padding:14px 0;color:#00213B;border-bottom:1px solid #EFEFEF">
  30. <div v-for="(item,idx) in specificationsObj.addonArr" :key="idx" style="padding-bottom:4px;">{{item}}</div>
  31. </td>
  32. </tr>
  33. </table>
  34. </div>
  35. <div>
  36. <p style="font-weight: bold;font-size: 17px;margin: 40px 0 10px;color:#00213B">Quote</p>
  37. <table style="width:100%;border-collapse: collapse;font-size: 14px;table-layout: fixed;text-align:center;">
  38. <tr style="background-color: #F7F8FC;font-weight: bold;">
  39. <td v-for="(item,key) in tableColumns" :key="key" style="font-weight: bold;padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" :style="{width:width}">{{item.label}}</td>
  40. </tr>
  41. <tr style="padding:10px 0;" v-for="(items,key) in tableData" :key="key">
  42. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF;font-weight: bold;">{{items.project}}</td>
  43. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF">{{items.website_qty1}}</td>
  44. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty2==0 || items.website_qty2">{{items.website_qty2}}</td>
  45. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty3==0 || items.website_qty3">{{items.website_qty3}}</td>
  46. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty4==0 || items.website_qty4">{{items.website_qty4}}</td>
  47. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty5==0 || items.website_qty5">{{items.website_qty5}}</td>
  48. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty6==0 || items.website_qty6">{{items.website_qty6}}</td>
  49. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty7==0 || items.website_qty7">{{items.website_qty7}}</td>
  50. <td style="padding:15px 0;color:#00213B;border-bottom:1px solid #EFEFEF" v-if="items.website_qty8==0 || items.website_qty8">{{items.website_qty8}}</td>
  51. </tr>
  52. </table>
  53. </div>
  54. <div v-if="emailForm.Comments" style="color:#00213B">
  55. <p style="font-weight: bold;font-size: 17px;margin: 40px 0 2px;">Comment</p>
  56. <p style="text-indent:2em;">{{emailForm.Comments}}</p>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. props: {
  63. pageData: {
  64. type: Object,
  65. default: {},
  66. },
  67. specificationsObj: {
  68. type: Object,
  69. default: {},
  70. },
  71. tableData: {
  72. type: Array,
  73. default: [],
  74. },
  75. tableColumns: {
  76. type: Array,
  77. default: [],
  78. },
  79. emailForm:{
  80. type: Object,
  81. default: {},
  82. }
  83. },
  84. data(){
  85. return {
  86. tabColumns: [
  87. {
  88. label: "LeadTime",
  89. prop: "time",
  90. type: "pre" //去掉$符号
  91. },
  92. {
  93. label: "Model",
  94. prop: "model",
  95. type: "pre" //去掉$符号
  96. },
  97. {
  98. label: "Decoration",
  99. prop: "decoration",
  100. type: "pre" //去掉$符号
  101. },
  102. {
  103. label: "Addon",
  104. prop: "addon",
  105. type: "pre" //去掉$符号
  106. },
  107. ],
  108. }
  109. },
  110. computed:{
  111. comInfo(){
  112. return this.pageData?.main
  113. },
  114. width(){
  115. return 100/this.tableColumns.length + '%'
  116. }
  117. },
  118. mounted(){
  119. },
  120. methods: {
  121. },
  122. };
  123. </script>
  124. <style lang="scss" scoped>
  125. table {
  126. page-break-inside:avoid;
  127. position:relative;
  128. }
  129. </style>