index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!--
  2. 权限自助管理
  3. @Author: linqian
  4. @Date: 2021-07-07
  5. -->
  6. <template>
  7. <div>
  8. <!-- 搜索项 -->
  9. <search-bar ref="searchbar" :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
  10. <!-- 操作栏 -->
  11. <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
  12. <!-- 表格 -->
  13. <new-table ref="table" :tableUrl="tableUrl" :tableHeader="tableHeader" :condition="condition">
  14. <dg-table-column label="操作" align="center">
  15. <template slot-scope="{ row }">
  16. <div class="u-table__operation">
  17. <el-tooltip content="详情" effect="dark" placement="top-end">
  18. <i :class="'详情' | optIcon" @click="handleViewDetail(row)"></i>
  19. </el-tooltip>
  20. <el-tooltip content="编辑" effect="dark" placement="top-end" v-if="row.showEdit">
  21. <i :class="'编辑' | optIcon" @click="handleApplyPermission(row.applyOrdNo)"></i>
  22. </el-tooltip>
  23. <el-tooltip content="撤回" effect="dark" placement="top-end" v-if="row.showRecall">
  24. <i :class="'撤回' | optIcon" @click="handleRecall(row)"></i>
  25. </el-tooltip>
  26. <el-tooltip content="删除" effect="dark" placement="top-end">
  27. <i :class="'删除' | optIcon" @click="handleDelete(row)"></i>
  28. </el-tooltip>
  29. </div>
  30. </template>
  31. </dg-table-column>
  32. </new-table>
  33. </div>
  34. </template>
  35. <script>
  36. import newTable from '@/pages/common/new-table';
  37. import { tableHeader } from './DataConfig';
  38. import { tableUrl, delApply, recallApply } from '@/api/permission-selfhelp-manage';
  39. import operateBar from '@/components/operate-bar';
  40. import searchBar from '@/components/search-bar';
  41. import { searchOpt } from '@/mixins/page-opt';
  42. export default {
  43. components: {
  44. newTable,
  45. operateBar,
  46. searchBar
  47. },
  48. mixins: [searchOpt],
  49. data() {
  50. return {
  51. tableUrl,
  52. tableHeader,
  53. conditionForm: [
  54. {
  55. label: '流程标题',
  56. name: 'flowTitle',
  57. op: 'like',
  58. value: '',
  59. component: 'ElInput',
  60. attr: {
  61. placeholder: '请输入流程标题'
  62. }
  63. },
  64. {
  65. label: '审批类型',
  66. name: 'applyType',
  67. op: '=',
  68. value: '',
  69. component: 'DgSelect',
  70. attr: {
  71. placeholder: '请选择审批类型',
  72. enum: 'SelfAuthApplyTypeEnum'
  73. }
  74. },
  75. {
  76. label: '创建时间',
  77. name: 'createTime',
  78. op: 'between',
  79. type: 'DATE',
  80. value: '',
  81. component: 'DgDatePicker'
  82. }
  83. ],
  84. pageOptList: ['权限变更申请']
  85. };
  86. },
  87. computed: {},
  88. methods: {
  89. receviceOpt(btn, row) {
  90. if (btn == '权限变更申请') {
  91. this.handleApplyPermission(null);
  92. }
  93. },
  94. /**
  95. * 权限申请
  96. */
  97. handleApplyPermission(applyOrdNo) {
  98. const vm = this;
  99. const layer = this.$dgLayer({
  100. title: applyOrdNo ? '编辑' : '权限变更申请',
  101. props: {
  102. applyOrdNo: applyOrdNo ? applyOrdNo : '',
  103. type: applyOrdNo ? 'edit' : 'add'
  104. },
  105. content: require('./component/basic-form.vue'),
  106. area: ['1100px', '800px'],
  107. on: {
  108. success(params) {
  109. vm.handleSearch();
  110. layer.close(layer.dialogIndex);
  111. },
  112. close() {
  113. layer.close(layer.dialogIndex);
  114. }
  115. }
  116. });
  117. },
  118. handleViewDetail(row) {
  119. const layer = this.$dgLayer({
  120. title: '详情',
  121. props: {
  122. applyOrdNo: row.applyOrdNo,
  123. type: 'detail'
  124. },
  125. content: require('./component/detail.vue'),
  126. area: ['1280px', '900px'],
  127. on: {
  128. success(params) {
  129. layer.close(layer.dialogIndex);
  130. },
  131. close() {
  132. layer.close(layer.dialogIndex);
  133. }
  134. }
  135. });
  136. },
  137. handleDelete(row) {
  138. this.$dgConfirm(`是否确定删除这条数据!`, '提示', {}).then(() => {
  139. delApply({
  140. applyOrdNo: row.applyOrdNo
  141. }).then((res) => {
  142. const { result, msg } = res.data;
  143. if (result == '200') {
  144. this.$message.success('删除成功!');
  145. this.handleSearch();
  146. } else {
  147. this.$message.warning(msg);
  148. }
  149. });
  150. });
  151. },
  152. handleRecall(row) {
  153. this.$dgConfirm(`是否确定撤回这条数据!`, '提示', {}).then(() => {
  154. const params = {
  155. applyOrdNo: row.applyOrdNo
  156. };
  157. recallApply(params).then((res) => {
  158. this.$message.success('撤回成功!');
  159. this.handleSearch();
  160. });
  161. });
  162. }
  163. },
  164. created() {},
  165. mounted() {}
  166. };
  167. </script>
  168. <style lang='scss'>
  169. </style>