printWarranty.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="tableAllDate">
  3. <!-- <div>
  4. <el-table
  5. v-loading="loading"
  6. style="width: 100%">
  7. </el-table>
  8. </div> -->
  9. <div class="loading" v-if="urls.length==0"></div>
  10. <div id="pdfDom">
  11. <div class="blank">
  12. </div>
  13. <div class="demo-image__lazy" v-for="(img,index) in urls" :key="index">
  14. <!-- <el-image v-for="(img,index) in urls" :key="index" :src="img" lazy></el-image> -->
  15. <el-image style='width: 100%; height: 100%; justify-content: center;
  16. align-items: center;' :src='img'></el-image>
  17. </div>
  18. </div>
  19. <!-- <el-button style="margin-left: 45%;" type="primary" @click="getPdf()">
  20. <i class="el-icon-download"></i>导出(pdf)
  21. </el-button> -->
  22. <el-button style="margin-left: 45%;margin-top: 0.2%;" type="primary" v-print="'#pdfDom'" @click="backScan()">
  23. <i class="el-icon-printer"></i>打印
  24. </el-button>
  25. </div>
  26. </template>
  27. <script>
  28. import table from '@/components/DilCommonUI/packages/table/src/table.vue';
  29. export default {
  30. components: { table },
  31. name: "Login",
  32. data() {
  33. return {
  34. urls:[],
  35. name: 'Loading'
  36. };
  37. },
  38. mounted() {
  39. this.information();
  40. },
  41. methods: {
  42. information() {
  43. //编辑
  44. console.log("this.$route.query.orderNumber",this.$route.query.orderNumber)
  45. this.axios
  46. .post(
  47. "/api/v1/uc/getWarranty?orderNumber="+this.$route.query.orderNumber
  48. )
  49. .then((res) => {
  50. console.log("res.data.data",res.data.data)
  51. if(res.data.code==201){
  52. this.$message("质保书正在紧张制作中,请耐心等待!")
  53. }else{
  54. res.data.data.forEach((e) => {
  55. console.log(e)
  56. this.urls.push(e)
  57. })
  58. }
  59. });
  60. },
  61. backScan(){
  62. this.$router.go(-2);
  63. },
  64. },
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .demo-image__lazy{
  69. position: relative;
  70. }
  71. .title{
  72. font-size:25px;
  73. }
  74. .tableBody{
  75. table, th, td
  76. {
  77. border: 1px solid black;
  78. font-size:20px;
  79. margin: auto;
  80. }
  81. .tablePart1 th{
  82. border-top: 1px solid black;
  83. }
  84. .tablePart2 td,th{
  85. border-top: 0px
  86. }
  87. .tablePart3 td,th{
  88. border-top: 0px
  89. }
  90. .tablePart4 td,th{
  91. border-top: 0px
  92. }
  93. .tablePart5 td,th{
  94. border-top: 0px
  95. }
  96. }
  97. .blank{
  98. width: 100%;
  99. height: 50px;
  100. }
  101. .loading {
  102. position: fixed;
  103. left: 0;
  104. top: 0;
  105. background: url('~@/assets/loading_images/loading.gif') center center no-repeat #fff;
  106. width: 100vw;
  107. height: 100vh;
  108. z-index: 1000;
  109. }
  110. </style>