index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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" :width="180">
  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. <!--20241101 add status start-->
  27. <el-tooltip content="激活" effect="dark" placement="top-end" v-if="row.showActivate">
  28. <i :class="'激活' | optIcon" @click="handleActivate(row)"></i>
  29. </el-tooltip>
  30. <el-tooltip content="挂起" effect="dark" placement="top-end" v-if="row.showSuspend">
  31. <i :class="'挂起' | optIcon" @click="handleSuspend(row)"></i>
  32. </el-tooltip>
  33. <el-tooltip content="终止" effect="dark" placement="top-end" v-if="row.showStop">
  34. <i :class="'终止' | optIcon" @click="handleStop(row)"></i>
  35. </el-tooltip>
  36. <!--20241101 add status end-->
  37. <el-tooltip content="删除" effect="dark" placement="top-end" v-if="!row.showActivate">
  38. <i :class="'删除' | optIcon" @click="handleDelete(row)"></i>
  39. </el-tooltip>
  40. </div>
  41. </template>
  42. </dg-table-column>
  43. </new-table>
  44. </div>
  45. </template>
  46. <script>
  47. import newTable from '@/components/new-table';
  48. import { tableHeader } from './DataConfig';
  49. import { tableUrl, delApply, recallApply, suspendApply, activateApply, stopApply} from '@/api/permission-selfhelp-manage';
  50. import operateBar from '@/components/operate-bar';
  51. import searchBar from '@/components/search-bar';
  52. import { searchOpt } from '@/mixins/page-opt';
  53. export default {
  54. components: {
  55. newTable,
  56. operateBar,
  57. searchBar
  58. },
  59. mixins: [searchOpt],
  60. data() {
  61. return {
  62. tableUrl,
  63. tableHeader,
  64. conditionForm: [
  65. {
  66. label: '流程标题',
  67. name: 'flowTitle',
  68. op: 'like',
  69. value: '',
  70. component: 'ElInput',
  71. attr: {
  72. placeholder: '请输入流程标题'
  73. }
  74. },
  75. {
  76. label: '审批类型',
  77. name: 'applyType',
  78. op: '=',
  79. value: '',
  80. component: 'DgSelect',
  81. attr: {
  82. placeholder: '请选择审批类型',
  83. enum: 'SelfAuthApplyTypeEnum'
  84. }
  85. },
  86. {
  87. label: '创建时间',
  88. name: 'createTime',
  89. op: 'between',
  90. type: 'DATE',
  91. value: '',
  92. component: 'DgDatePicker'
  93. }
  94. ],
  95. pageOptList: ['权限变更申请']
  96. };
  97. },
  98. computed: {},
  99. methods: {
  100. receviceOpt(btn, row) {
  101. if (btn == '权限变更申请') {
  102. this.handleApplyPermission(null);
  103. }
  104. },
  105. /**
  106. * 权限申请
  107. */
  108. handleApplyPermission(applyOrdNo) {
  109. const vm = this;
  110. const layer = this.$dgLayer({
  111. title: applyOrdNo ? '编辑' : '权限变更申请',
  112. props: {
  113. applyOrdNo: applyOrdNo ? applyOrdNo : '',
  114. type: applyOrdNo ? 'edit' : 'add'
  115. },
  116. content: require('./component/basic-form.vue'),
  117. area: ['1100px', '800px'],
  118. on: {
  119. success(params) {
  120. vm.handleSearch();
  121. layer.close(layer.dialogIndex);
  122. },
  123. close() {
  124. layer.close(layer.dialogIndex);
  125. }
  126. }
  127. });
  128. },
  129. handleViewDetail(row) {
  130. const layer = this.$dgLayer({
  131. title: '详情',
  132. props: {
  133. applyOrdNo: row.applyOrdNo,
  134. type: 'detail',
  135. flowStatus: row.flowStatus
  136. },
  137. content: require('./component/detail.vue'),
  138. area: ['1280px', '900px'],
  139. on: {
  140. success(params) {
  141. layer.close(layer.dialogIndex);
  142. },
  143. close() {
  144. layer.close(layer.dialogIndex);
  145. }
  146. }
  147. });
  148. },
  149. handleDelete(row) {
  150. this.$dgConfirm(`是否确定删除这条数据!`, '提示', {}).then(() => {
  151. delApply({
  152. applyOrdNo: row.applyOrdNo
  153. }).then((res) => {
  154. const { result, msg } = res.data;
  155. if (result == '200') {
  156. this.$message.success('删除成功!');
  157. this.handleSearch();
  158. } else {
  159. this.$message.warning(msg);
  160. }
  161. });
  162. });
  163. },
  164. handleRecall(row) {
  165. this.$dgConfirm(`是否确定撤回这条数据!`, '提示', {}).then(() => {
  166. const params = {
  167. applyOrdNo: row.applyOrdNo
  168. };
  169. recallApply(params).then((res) => {
  170. this.$message.success('撤回成功!');
  171. this.handleSearch();
  172. });
  173. });
  174. },
  175. // 20241101 add status start
  176. handleActivate(row) {
  177. this.$dgConfirm(`是否确定激活这条数据!`, '提示', {}).then(() => {
  178. const params = {
  179. applyOrdNo: row.applyOrdNo
  180. };
  181. activateApply(params).then((res) => {
  182. this.$message.success('激活成功!');
  183. this.handleSearch();
  184. });
  185. });
  186. },
  187. handleSuspend(row) {
  188. this.$dgConfirm(`是否确定挂起这条数据!`, '提示', {}).then(() => {
  189. const params = {
  190. applyOrdNo: row.applyOrdNo
  191. };
  192. suspendApply(params).then((res) => {
  193. this.$message.success('挂起成功!');
  194. this.handleSearch();
  195. });
  196. });
  197. },
  198. handleStop(row) {
  199. this.$dgConfirm(`是否确定终止这条数据!`, '提示', {}).then(() => {
  200. const params = {
  201. applyOrdNo: row.applyOrdNo
  202. };
  203. stopApply(params).then((res) => {
  204. this.$message.success('终止成功!');
  205. this.handleSearch();
  206. });
  207. });
  208. }
  209. // 20241101 add status end
  210. },
  211. created() {},
  212. mounted() {}
  213. };
  214. </script>
  215. <style lang='scss'>
  216. </style>