seal.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-content-title">
  4. <div class="hui-title-item active">印章列表</div>
  5. </div>
  6. <div class="hui-flex-box hui-flex hui-table">
  7. <div class="hui-content-insert">
  8. <el-button v-permission="'/work/organization/seal/add'" type="primary" size="medium" @click="insertSeal">新增印章</el-button>
  9. </div>
  10. <div class="hui-flex-box">
  11. <el-table :data="tableData" row-key="id" border height="100%">
  12. <el-table-column label="序号" width="50">
  13. <template slot-scope="scope">
  14. <div style="text-align: center;">{{scope.$index + 1}}</div>
  15. </template>
  16. </el-table-column>
  17. <el-table-column label="印章名称" prop="name"></el-table-column>
  18. <el-table-column label="印章类型" prop="name">
  19. <template slot-scope="scope">
  20. <span>{{$field.findTypeName('sealType',scope.row.type)}}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="印章描述" prop="comment"></el-table-column>
  24. <el-table-column label="申请印章" width="150">
  25. <template slot-scope="scope">
  26. <div class="hui-table-operation">
  27. <span v-permission="'/work/organization/seal/approve'" class="table-operation" @click="requestSeal(scope.row)">查看</span>
  28. </div>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="操作" width="150">
  32. <template slot-scope="scope">
  33. <div class="hui-table-operation">
  34. <span class="table-operation" v-permission="'/work/organization/seal/detail'" @click="lookSeal(scope.row)">详情</span>
  35. <span class="table-operation" v-permission="'/work/organization/seal/update'" @click="updateSeal(scope.row)">编辑</span>
  36. <span class="table-operation" v-permission="'/work/organization/seal/delete'" @click="deleteSeal(scope.row)">删除</span>
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <template slot="empty">
  41. <empty description="暂无数据"></empty>
  42. </template>
  43. </el-table>
  44. </div>
  45. </div>
  46. <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
  47. :append-to-body="true">
  48. <edit v-if="visible" @callback="callback" :isUpdate="isUpdate" :detailId="detailId"></edit>
  49. </el-dialog>
  50. <el-dialog :close-on-click-modal="false" title="印章申请列表" :visible.sync="requestVisible" width="1000px"
  51. :append-to-body="true">
  52. <request v-if="requestVisible" :detailId="detailId"></request>
  53. </el-dialog>
  54. <el-drawer title="项目详情" :visible.sync="drawer" :size="400" :append-to-body="true">
  55. <detail v-if="drawer" :detailId="detailId"></detail>
  56. </el-drawer>
  57. </div>
  58. </template>
  59. <script>
  60. import {
  61. getSealList,
  62. deleteSeal
  63. } from '@/httpApi/organization'
  64. import edit from '@/components/work/organization/seal/edit'
  65. import detail from '@/components/work/organization/seal/detail'
  66. import request from '@/components/work/organization/seal/request'
  67. export default {
  68. data() {
  69. return {
  70. tableData: [],
  71. visible: false,
  72. detailId: '',
  73. isUpdate: false,
  74. drawer: false,
  75. requestVisible: false
  76. }
  77. },
  78. created() {
  79. this.init();
  80. },
  81. methods: {
  82. init() {
  83. if (!this.auth('/work/organization/seal/list')) return;
  84. getSealList(this.$store.getters.organization.id).then(res => {
  85. if (res.state) {
  86. this.tableData = res.data;
  87. }
  88. })
  89. },
  90. insertSeal() {
  91. this.isUpdate = false;
  92. this.visible = true;
  93. },
  94. requestSeal(item) {
  95. this.detailId = item.id;
  96. this.requestVisible = true;
  97. },
  98. updateSeal(item) {
  99. this.detailId = item.id;
  100. this.isUpdate = true;
  101. this.visible = true;
  102. },
  103. lookSeal(item) {
  104. this.detailId = item.id;
  105. this.drawer = true;
  106. },
  107. deleteSeal(item) {
  108. this.$confirm('确定要删除该印章?', () => {
  109. deleteSeal(item.id).then(res => {
  110. if (res.state) {
  111. this.init();
  112. this.$message.success('操作成功');
  113. }
  114. })
  115. });
  116. },
  117. callback(type) {
  118. if (type === 'init') this.init();
  119. this.visible = false;
  120. }
  121. },
  122. components: {
  123. edit,
  124. detail,
  125. request
  126. },
  127. }
  128. </script>
  129. <style lang="scss"></style>