index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="pdf" v-show="fileType === 'pdf'">
  3. <el-row :gutter="10" class="mb8">
  4. <el-col :span="1.5">
  5. <el-button
  6. type="primary"
  7. plain
  8. size="mini"
  9. @click="handleAdd"
  10. v-hasPermi="['system:menu:add']"
  11. >转收文</el-button>
  12. </el-col>
  13. <el-col :span="1.5">
  14. <el-button
  15. type="primary"
  16. plain
  17. size="mini"
  18. @click="handleAdd"
  19. v-hasPermi="['system:menu:add']"
  20. >转本部门</el-button>
  21. </el-col>
  22. <el-col :span="1.5">
  23. <el-button
  24. type="primary"
  25. plain
  26. size="mini"
  27. @click="handleAdd"
  28. v-hasPermi="['system:menu:add']"
  29. >分发范围</el-button>
  30. </el-col>
  31. <el-col :span="1.5">
  32. <el-button
  33. type="primary"
  34. plain
  35. size="mini"
  36. @click="handleAdd"
  37. v-hasPermi="['system:menu:add']"
  38. >阅读情况</el-button>
  39. </el-col>
  40. <el-col :span="1.5">
  41. <el-button
  42. type="primary"
  43. plain
  44. size="mini"
  45. @click="handleAdd"
  46. v-hasPermi="['system:menu:add']"
  47. >收藏公文</el-button>
  48. </el-col>
  49. <el-col :span="1.5">
  50. <el-button
  51. type="primary"
  52. plain
  53. size="mini"
  54. @click="pdfdele"
  55. v-hasPermi="['system:menu:add']"
  56. >退回</el-button>
  57. </el-col>
  58. <el-col :span="1.5">
  59. <el-button
  60. type="primary"
  61. plain
  62. size="mini"
  63. @click="handleAdd"
  64. v-hasPermi="['system:menu:add']"
  65. >收文签收</el-button>
  66. </el-col>
  67. </el-row>
  68. <div>
  69. <p style="font-size: 28px; font-weight: 700;">正文:</p>
  70. <a v-if="shouwe" :href="src" download="测试">{{name}}</a>
  71. <span v-if="!shouwe" @click="down">{{name}}</span>
  72. </div>
  73. <p style="font-size: 28px; font-weight: 700;">附件:</p>
  74. <p style="text-align: right; font-size: 20px; color: #1890FF;"><a :href="src" target="_blank" >全屏</a></p>
  75. <iframe :src="src" frameborder="0" style="width: 100%; height: 100vh;"></iframe>
  76. </div>
  77. </template>
  78. <script>
  79. import Pdf from 'vue-pdf'
  80. import { listRoles,pdfDwon,timeu,weit} from "@/api/system/isses";
  81. export default {
  82. components: {
  83. Pdf
  84. },
  85. data() {
  86. return {
  87. dialogVisible: true,
  88. // src: `${window.location.origin}/ceshi.pdf`,
  89. src:'',
  90. fileType:'pdf',
  91. name:'',
  92. forew:{
  93. table:'',
  94. fixedData:{
  95. id:-1
  96. }
  97. },
  98. juegh:{
  99. preview:false,
  100. absolutePath:''
  101. },
  102. shouwe:true,
  103. wfor:{
  104. "table": "",
  105. objId:0,
  106. fixedData:{
  107. status:'Y'
  108. }
  109. }
  110. }
  111. },
  112. created() {
  113. console.log(this.$route.query.tables)
  114. this.forew.table = this.$route.query.tables;
  115. this.forew.fixedData.id = this.$route.query.id - 0;
  116. this.wfor.table = this.$route.query.tables;
  117. this.wfor.objId = this.$route.query.id - 0;
  118. if(this.$route.query.teiwog == 'weidu'){
  119. this.weideu()
  120. }
  121. this.getList()
  122. this.timeta()
  123. },
  124. methods: {
  125. handleAdd(){},
  126. // 路径
  127. getList() {
  128. this.loading = true;
  129. console.log(this.forew)
  130. listRoles(this.forew).then(
  131. res => {
  132. console.log(34)
  133. console.log(res)
  134. let pdflis = []
  135. if(res.data !== undefined){
  136. if(res.data.message_upload !== null && res.data.message_upload !==''){
  137. pdflis = JSON.parse(res.data.message_upload)
  138. this.src = pdflis[0].url
  139. this.name = res.data.message_title
  140. this.juegh.absolutePath = pdflis[0].absolutePath
  141. }
  142. console.log(this.src)
  143. }
  144. }
  145. );
  146. },
  147. pdfdele(){
  148. this.$router.go(-1)
  149. },
  150. // 下载
  151. down(){
  152. pdfDwon(this.juegh).then(response => {
  153. if (response.resultCode == 0) {
  154. this.msgSuccess('提交成功');
  155. }
  156. this.$store.dispatch('tagsView/delView', this.$route);
  157. // this.reload();
  158. });
  159. },
  160. // 判断时间是否在30分钟以内
  161. timeta(){
  162. timeu(this.forew.fixedData.id).then(response => {
  163. console.log(response)
  164. if(response.code == 200){
  165. this.shouwe = true
  166. }else{
  167. this.shouwe = false
  168. }
  169. // if (response.resultCode == 0) {
  170. // this.msgSuccess('提交成功');
  171. // }
  172. // this.$store.dispatch('tagsView/delView', this.$route);
  173. // this.reload();
  174. });
  175. },
  176. // 未读变已读
  177. weideu(){
  178. weit(this.wfor).then(response => {
  179. console.log(response)
  180. if(response.code == 200){
  181. this.msgSuccess('已读成功');
  182. // this.shouwe = true
  183. }else{
  184. // this.shouwe = false
  185. }
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style>
  192. .pdf{
  193. padding: 30px;
  194. }
  195. </style>