request.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-flex-box hui-table">
  4. <el-table :data="tableData" row-key="id" border height="100%">
  5. <el-table-column label="序号" width="50">
  6. <template slot-scope="scope">
  7. <div style="text-align: center;">{{scope.$index + 1}}</div>
  8. </template>
  9. </el-table-column>
  10. <el-table-column prop="requestUserName" label="姓名"></el-table-column>
  11. <el-table-column label="使用类型">
  12. <template slot-scope="scope">
  13. <span>
  14. <span v-if="scope.row.documentId">文档</span>
  15. </span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="申请状态">
  19. <template slot-scope="scope">
  20. <div class="hui-table-tag">
  21. <div class="hui-tag hui-tag-info" v-if="scope.row.status == 0">待审核</div>
  22. <div class="hui-tag hui-tag-success" v-else>通过</div>
  23. </div>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="操作">
  27. <template slot-scope="scope">
  28. <div class="hui-table-operation">
  29. <span v-if="scope.row.documentId" class="table-operation"
  30. @click="showDocument(scope.row.documentId)">
  31. 查看文档
  32. </span>
  33. <span class="table-operation" @click="pass(scope.row)" v-if="scope.row.status == 0">
  34. 通过
  35. </span>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <template slot="empty">
  40. <empty description="暂无数据"></empty>
  41. </template>
  42. </el-table>
  43. </div>
  44. <div class="hui-content-pagination" style="padding:0 20px 10px 20px">
  45. <el-pagination :page-size="pageSize" :pager-count="9" layout="prev, pager, next" :total="totalCount"
  46. @current-change="currentChange">
  47. </el-pagination>
  48. </div>
  49. <el-dialog :close-on-click-modal="false" title="查看文档" :visible.sync="documentShow" class="document-dialog"
  50. width="80%" :append-to-body="true">
  51. <editor :documentId="documentId" v-if="documentShow" @close="documentShow = false" type="look">
  52. </editor>
  53. </el-dialog>
  54. </div>
  55. </template>
  56. <script>
  57. import {
  58. getSealRequestListByQuery,
  59. requestUseSeal
  60. } from '@/httpApi/organization'
  61. import editor from '@/components/document/editor'
  62. export default {
  63. props: ['detailId'],
  64. data() {
  65. return {
  66. tableData: [],
  67. currPage: 1,
  68. pageSize: 10,
  69. totalCount: 0,
  70. documentShow: false,
  71. documentId: ''
  72. }
  73. },
  74. created() {
  75. this.init();
  76. },
  77. components: {
  78. editor
  79. },
  80. methods: {
  81. init() {
  82. let postData = {
  83. currPage: this.currPage,
  84. pageSize: this.pageSize,
  85. sealId: this.detailId
  86. }
  87. getSealRequestListByQuery(postData).then(res => {
  88. if (res.state) {
  89. this.tableData = res.data.dataList;
  90. this.totalCount = res.data.totalCount;
  91. }
  92. })
  93. },
  94. currentChange(currPage) {
  95. this.currPage = currPage;
  96. this.init();
  97. },
  98. showDocument(id) {
  99. this.documentId = id;
  100. this.documentShow = true;
  101. },
  102. pass(item) {
  103. this.$confirm('确定通过该印章申请?', () => {
  104. this.$loading.open();
  105. requestUseSeal(item.id, {
  106. documentId: item.documentId,
  107. requestId: item.id,
  108. sealId: item.sealId,
  109. usageUserId: this.$store.getters.user.userId,
  110. usageUserName: this.$store.getters.user.name
  111. }).then(res => {
  112. if (res.state) {
  113. this.$message.success('操作成功');
  114. this.init();
  115. }
  116. this.$loading.close();
  117. });
  118. });
  119. },
  120. },
  121. }
  122. </script>
  123. <style>
  124. </style>