MyoaTabs.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div id="MyoaTbas">
  3. <a-tabs default-active-key="1" @change="callback" style="background:white;;padding:8px;">
  4. <a-tab-pane key="1" tab="待办事项" style="margin:10px;">
  5. <div class="dataV">
  6. <dv-scroll-board
  7. class="board"
  8. :config="todoConfig"
  9. style="width:100%;height:160px;color:#333;"
  10. @click="todoClick"
  11. />
  12. </div>
  13. </a-tab-pane>
  14. <a-tab-pane key="2" tab="已发事项" force-render>
  15. <div class="dataV">
  16. <dv-scroll-board
  17. class="board"
  18. :config="applyConfig"
  19. style="width:100%;height:180px;color:#333;"
  20. @click="applyClick"
  21. />
  22. </div>
  23. </a-tab-pane>
  24. <a-tab-pane key="3" tab="已办事项">
  25. <div class="dataV">
  26. <dv-scroll-board
  27. class="board"
  28. :config="doneConfig"
  29. style="width:100%;height:180px;color:#333;"
  30. @click="doneClick"
  31. />
  32. </div>
  33. </a-tab-pane>
  34. </a-tabs>
  35. </div>
  36. </template>
  37. <script>
  38. import { getAction } from '@/api/manage'
  39. export default {
  40. name: 'MyoaTabs',
  41. data () {
  42. return {
  43. header: ['列1', '列2', '列3'],
  44. todoConfig: {},
  45. applyConfig: {},
  46. doneConfig: {},
  47. todoList: {},
  48. url: {
  49. list: '/actBusiness/listData',
  50. doneList: '/actTask/doneList'
  51. }
  52. }
  53. },
  54. created () {
  55. this.getTodoList()
  56. this.getApplyList()
  57. this.getDoneList()
  58. },
  59. methods: {
  60. // 待办tbas
  61. getTodoList () {
  62. this.postFormAction('/actTask/todoList', {}).then(res => {
  63. if (res.success) {
  64. console.log('待办列表-->', res.result)
  65. this.todoList = res.result
  66. let scrollData = [] // 轮播表数据
  67. this.todoList.map(item => {
  68. var priorityCode = ''
  69. if (item.priority == '0') {
  70. priorityCode = '<span style="color:green;">普通</span>'
  71. }
  72. if (item.priority == '1') {
  73. priorityCode = '<span style="color:orange;">重要</span>'
  74. }
  75. if (item.priority == '2') {
  76. priorityCode = '<span style="color:red;">紧急</span>'
  77. }
  78. var list = [item.id, item.name, item.processName, item.applyer, priorityCode, item.createTime]
  79. scrollData.push(list)
  80. })
  81. this.todoConfig = {
  82. oddRowBGC: 'white',
  83. evenRowBGC: 'white',
  84. columnWidth: [150, 200, 200, 200, 200, 300],
  85. align: ['center'],
  86. rowNum: 5,
  87. waitTime: 9000,
  88. data: scrollData // 双向绑定(轮播表数据 绑定到配置的 data数据中)
  89. }
  90. }
  91. })
  92. },
  93. // 申请tbas
  94. getApplyList () {
  95. getAction(this.url.list, {}).then(res => {
  96. if (res.success) {
  97. console.log('申请列表-->', res.result)
  98. this.applyList = res.result
  99. let scrollData = [] // 轮播表数据
  100. this.applyList.map(item => {
  101. var resultCode = ''
  102. if (item.result == '0') {
  103. resultCode = '<span style="color:#37a2da;">未提交</span>'
  104. }
  105. if (item.result == '1') {
  106. resultCode = '<span style="color:orange;">处理中</span>'
  107. }
  108. if (item.result == '2') {
  109. resultCode = '<span style="color:green;">通过</span>'
  110. }
  111. if (item.result == '3') {
  112. resultCode = '<span style="color:red;">驳回</span>'
  113. }
  114. var list = [item.id, item.title, item.processName, item.currTaskName, resultCode, item.applyTime]
  115. scrollData.push(list)
  116. })
  117. this.applyConfig = {
  118. oddRowBGC: 'white',
  119. evenRowBGC: 'white',
  120. columnWidth: [150, 200, 200, 200, 150, 300],
  121. align: ['center'],
  122. rowNum: 5,
  123. waitTime: 2000,
  124. data: scrollData
  125. }
  126. }
  127. })
  128. },
  129. // 已办tbas
  130. getDoneList () {
  131. getAction(this.url.doneList, {}).then(res => {
  132. if (res.success) {
  133. console.log('已办列表-->', res.result)
  134. this.doneList = res.result
  135. let scrollData = [] // 轮播表数据
  136. this.doneList.map(item => {
  137. var list = [item.id, item.name, item.processName, item.applyer, item.deleteReason, item.createTime]
  138. scrollData.push(list)
  139. })
  140. this.doneConfig = {
  141. oddRowBGC: 'white',
  142. evenRowBGC: 'white',
  143. columnWidth: [150, 200, 200, 200, 150, 300],
  144. align: ['center'],
  145. rowNum: 5,
  146. waitTime: 2000,
  147. data: scrollData
  148. }
  149. }
  150. })
  151. },
  152. // 轮播图 点击事件
  153. todoClick (item) {
  154. console.log(item)
  155. this.$router.push('/activiti/todoManage')
  156. },
  157. applyClick (item) {
  158. this.$router.push('/activiti/applyList')
  159. },
  160. doneClick (item) {
  161. this.$router.push('/activiti/doneManage')
  162. },
  163. // 我的待办 tabs
  164. callback (key) {
  165. console.log(key)
  166. if (key == '1') {
  167. this.getTodoList()
  168. }
  169. if (key == '2') {
  170. this.getApplyList()
  171. }
  172. if (key == '3') {
  173. this.getDoneList()
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="less" scoped>
  180. // 单独创建页面写样式 如下
  181. @import '~@assets/less/mytodo.less';
  182. @import '~@assets/less/common.less';
  183. /deep/ .ant-tabs-nav .ant-tabs-tab {
  184. font-size: 16px;
  185. }
  186. /deep/ .ant-tabs-tab-active {
  187. // color: #1890ff !important;
  188. font-size: 16px;
  189. }
  190. </style>