Sankunginfo.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="Sankunginfo-all">
  3. <div class="Sankunginfo-top">
  4. <div class="Sankunginfo-title">三公费用明细</div>
  5. </div>
  6. <div class="Sankunginfo-box">
  7. <!-- <div class="Sankunginfo-btn">
  8. <el-button @click="thislink" size="mini" type="primary">确认</el-button>
  9. </div> -->
  10. <!-- <iframe v-if="iframeft" style="border:none" :src='src' width="100%" :height="heights"></iframe> -->
  11. <!-- <msgChild :style="returnheights" :src='src' :height='heights'></msgChild> -->
  12. <div class="Sankunginfo-box-img">
  13. <img src="../assets/Pdf.png"/>
  14. <div class="Sankunginfo-img-title">{{fileName}}</div>
  15. </div>
  16. <div class="Sankunginfo-box-btn">
  17. <el-button @click="thislink" size="mini" type="primary">预览</el-button>
  18. <el-button @click="PostEnterExitCostIsConfirm" size="mini" type="primary">确认</el-button>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import msgChild from './sankunginfochild.vue'
  25. export default {
  26. components:{
  27. // 声明子组件名字
  28. msgChild
  29. },
  30. data () {
  31. return {
  32. input:'',
  33. heights:0,
  34. id:0,
  35. fileName:'',
  36. src:'',
  37. iframeft:false
  38. }
  39. },
  40. methods:{
  41. //预览
  42. thislink(){
  43. this.iframeft=true;
  44. // this.src="http://132.232.92.186:24/Office/Word/EnterExitCost/File/"+this.fileName
  45. window.open("http://132.232.92.186:24/Office/Word/EnterExitCost/File/"+this.fileName)
  46. // this.$router.push({path: "http://132.232.92.186:24/Office/Word/EnterExitCost/File/"+this.fileName});
  47. },
  48. //确认
  49. PostEnterExitCostIsConfirm(){
  50. var url = "/api/Groups/PostEnterExitCostIsConfirm"
  51. var that = this
  52. this.$axios({
  53. method: 'post',
  54. url: url,
  55. headers: {
  56. Authorization: 'Bearer ' + that.token
  57. },
  58. data:{
  59. type:1,
  60. id:that.id
  61. }
  62. }).then(function (res) {
  63. if(res.data.code==200){
  64. that.$message({
  65. message: res.data.msg,
  66. type: 'success',
  67. offset: 50
  68. });
  69. }else{
  70. that.$message({
  71. message: res.data.msg,
  72. type: 'warning'
  73. });
  74. }
  75. })
  76. },
  77. returnheights(){
  78. return 'height: '+ this.heights+' ;'
  79. }
  80. },
  81. created(){
  82. let clientHeight=document.documentElement.clientHeight || document.body.clientHeight;
  83. this.heights=clientHeight-95;
  84. this.fileName = this.$route.query.fileName;
  85. this.id = this.$route.query.sign;
  86. this.src="http://132.232.92.186:24/Office/Word/EnterExitCost/File/"+this.fileName;
  87. },
  88. mounted(){
  89. document.getElementsByClassName('Sankunginfo-box')[0].style.height=this.heights+'px';
  90. }
  91. }
  92. </script>
  93. <style>
  94. *{
  95. margin: 0;
  96. padding: 0;
  97. }
  98. .Sankunginfo-top{
  99. position: fixed;
  100. top: 0;
  101. background-color: #fff;
  102. width: 100%;
  103. text-align: center;
  104. border-bottom: 1px solid #ede8e8;
  105. }
  106. .Sankunginfo-title{
  107. margin: 10px;
  108. font-size: 17px;
  109. font-weight:600 ;
  110. }
  111. .Sankunginfo-search{
  112. padding: 8px;
  113. }
  114. .Sankunginfo-box{
  115. padding-top: 43px;
  116. }
  117. .Sankunginfo-btn{
  118. text-align: right;
  119. margin: 10px 0;
  120. }
  121. .Sankunginfo-box-img{
  122. text-align: center;
  123. display: flex;
  124. flex-direction: column;
  125. align-items: center;
  126. }
  127. .Sankunginfo-img-title{
  128. color: #555;
  129. margin-top: 10px;
  130. width: 60%;
  131. overflow:hidden;
  132. white-space: nowrap;
  133. text-overflow: ellipsis;
  134. -o-text-overflow:ellipsis;
  135. }
  136. .Sankunginfo-box-btn{
  137. margin-top: 10px;
  138. text-align: center;
  139. }
  140. .Sankunginfo-box{
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. justify-content: center;
  145. }
  146. </style>