MyoaTabs.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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:148px;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:166px;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:166px;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. // 待办事项
  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. // 优先级
  69. var priorityCode = ''
  70. if (item.priority == '0') {
  71. priorityCode = '<span style="color:green;">普通</span>'
  72. }
  73. if (item.priority == '1') {
  74. priorityCode = '<span style="color:orange;">重要</span>'
  75. }
  76. if (item.priority == '2') {
  77. priorityCode = '<span style="color:red;">紧急</span>'
  78. }
  79. var list = [item.id, item.name, item.processName, item.applyer, priorityCode, item.createTime]
  80. scrollData.push(list)
  81. })
  82. this.todoConfig = {
  83. oddRowBGC: 'white',
  84. evenRowBGC: 'white',
  85. columnWidth: [150, 200, 200, 200, 200, 300],
  86. align: ['center'],
  87. rowNum: 5,
  88. waitTime: 9000,
  89. data: scrollData // 双向绑定(轮播表数据 绑定到配置的 data数据中)
  90. }
  91. }
  92. })
  93. },
  94. // 已发事项
  95. getApplyList () {
  96. getAction(this.url.list, {}).then(res => {
  97. if (res.success) {
  98. console.log('申请列表-->', res.result)
  99. this.applyList = res.result
  100. let scrollData = [] // 轮播表数据
  101. // 结果
  102. this.applyList.map(item => {
  103. var resultCode = ''
  104. if (item.result == '0') {
  105. resultCode = '<span style="color:orange;">未提交</span>'
  106. }
  107. if (item.result == '1') {
  108. resultCode = '<span style="color:#37a2da;">处理中</span>'
  109. }
  110. if (item.result == '2') {
  111. resultCode = '<span style="color:green;">通过</span>'
  112. }
  113. if (item.result == '3') {
  114. resultCode = '<span style="color:red;">驳回</span>'
  115. }
  116. var list = [item.id, item.title, item.processName, item.currTaskName, resultCode, item.applyTime]
  117. scrollData.push(list)
  118. })
  119. this.applyConfig = {
  120. oddRowBGC: 'white',
  121. evenRowBGC: 'white',
  122. columnWidth: [150, 200, 200, 200, 150, 300],
  123. align: ['center'],
  124. rowNum: 5,
  125. waitTime: 2000,
  126. data: scrollData
  127. }
  128. }
  129. })
  130. },
  131. // 已办事项
  132. getDoneList () {
  133. getAction(this.url.doneList, {}).then(res => {
  134. if (res.success) {
  135. console.log('已办列表-->', res.result)
  136. this.doneList = res.result
  137. let scrollData = [] // 轮播表数据
  138. this.doneList.map(item => {
  139. var reallyResult = ''
  140. if (item.deleteReason == '审批通过') {
  141. reallyResult = '<span style="color:green">审批通过</span>'
  142. } else {
  143. reallyResult = '<span style="color:red">审批驳回</span>'
  144. }
  145. var list = [item.id, item.name, item.processName, item.applyer, reallyResult, item.createTime]
  146. scrollData.push(list)
  147. })
  148. this.doneConfig = {
  149. oddRowBGC: 'white',
  150. evenRowBGC: 'white',
  151. columnWidth: [150, 200, 200, 200, 300, 300],
  152. align: ['center'],
  153. rowNum: 5,
  154. waitTime: 2000,
  155. data: scrollData
  156. }
  157. }
  158. })
  159. },
  160. // 轮播图 点击事件
  161. todoClick (item) {
  162. console.log(item)
  163. this.$router.push('/activiti/todoManage')
  164. },
  165. applyClick (item) {
  166. this.$router.push('/activiti/applyList')
  167. },
  168. doneClick (item) {
  169. this.$router.push('/activiti/doneManage')
  170. },
  171. // 我的待办 tabs
  172. callback (key) {
  173. // console.log(key)
  174. if (key == '1') {
  175. this.getTodoList()
  176. }
  177. if (key == '2') {
  178. this.getApplyList()
  179. }
  180. if (key == '3') {
  181. this.getDoneList()
  182. }
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="less" scoped>
  188. // 单独创建页面写样式 如下
  189. @import '~@assets/less/mytodo.less';
  190. @import '~@assets/less/common.less';
  191. /deep/ .ant-tabs-nav .ant-tabs-tab {
  192. font-size: 16px;
  193. }
  194. /deep/ .ant-tabs-tab-active {
  195. // color: #1890ff !important;
  196. font-size: 16px;
  197. }
  198. </style>