index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="group-box" :style="{height:height}">
  3. <div class="group-title">
  4. 工作任务
  5. <el-link @click="linkTo">更多 <i class="el-icon-caret-right" /></el-link>
  6. </div>
  7. <vuescroll v-if="data" :ops="ops" style="height: calc(100% - 40px)">
  8. <div class="task-management">
  9. <div
  10. v-for="(item, index) in dataList"
  11. :key="index"
  12. class="item"
  13. @click="linkTo"
  14. >
  15. <div class="icon">
  16. <i class="el-icon-tickets" />
  17. </div>
  18. <div class="info">
  19. <div class="lf">
  20. <h4 class="taskTitle">{{ item.taskTitle }}</h4>
  21. <span v-if="item.handleAccountId" style="font-size: 8px;color:#c4c1c1;">
  22. <i class="el-icon-user" />
  23. <span style="padding:0 6px;">{{ item.status===0?item.curAccountName:item.handleAccountName }}</span>
  24. </span>
  25. </div>
  26. <div class="rt">
  27. <div class="el-tag-taskCat">
  28. <el-tag size="mini" class="custom-tag" :class="'tag-'+item.taskCatId">{{ item.taskCatTitle }}</el-tag>
  29. </div>
  30. <template v-if="item.taskStatus===0">
  31. <vac :end-time="item.expectedEndTime">
  32. <p
  33. slot="process"
  34. slot-scope="{ timeObj }"
  35. >
  36. <i class="el-icon-time" />
  37. <span style="padding-left:6px;">{{ `${timeObj.d}天${timeObj.h}:${timeObj.m}:${timeObj.s}` }}</span>
  38. </p>
  39. <p slot="finish">过期</p>
  40. </vac>
  41. </template>
  42. <template v-else>
  43. <span style="font-size: 8px;color:#868282;">{{ item.status | taskStatusFilter }}</span>
  44. </template>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </vuescroll>
  50. </div>
  51. </template>
  52. <script>
  53. import commonMixin from '@/mixin/commonMethodMixin'
  54. import vuescroll from 'vuescroll'
  55. import { getTaskByList } from '@/api/system/taskApi'
  56. export default {
  57. name: 'WorkTask',
  58. components: {
  59. vuescroll
  60. },
  61. mixins: [commonMixin],
  62. props: {
  63. more: {
  64. type: String,
  65. default: undefined
  66. },
  67. height: {
  68. type: [String],
  69. default: 'calc(100vh - 85px)'
  70. }
  71. },
  72. data() {
  73. return {
  74. ops: {
  75. bar: {
  76. keepShow: false,
  77. background: 'rgba(144, 147, 153, 0.4)',
  78. onlyShowBarOnScroll: false
  79. }
  80. },
  81. dataList: [],
  82. conditions: {}
  83. }
  84. },
  85. mounted() {
  86. this.getData()
  87. },
  88. methods: {
  89. linkTo() {
  90. if (this.more) {
  91. this.$router.push({
  92. path: this.more
  93. })
  94. }
  95. },
  96. // Fetch Data
  97. getData() {
  98. this.listLoading = true
  99. getTaskByList(this.conditions).then((resp) => {
  100. const { code, data, total, msg } = resp
  101. this.listLoading = false
  102. if (code === 200) {
  103. this.total = total
  104. this.dataList = data
  105. } else {
  106. this.$message.error(msg)
  107. }
  108. }).catch((error) => {
  109. console.log(error)
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .group-box {
  117. width: calc(100% - 15px);
  118. background-color: #0C3242;
  119. border-top: 4px solid #1F3C51;
  120. border-radius: 5px 5px 0 0;
  121. padding: 15px;
  122. .group-title {
  123. font-size: 16px;
  124. color: #FFF;
  125. margin-bottom: 15px;
  126. font-weight: bold;
  127. .el-link {
  128. float: right;
  129. font-size: 14px;
  130. color: #C1C6C8;
  131. -webkit-text-fill-color: #C1C6C8;
  132. }
  133. }
  134. .group-content{
  135. height: 80%;
  136. overflow: auto;
  137. }
  138. }
  139. .task-management{
  140. margin-top: 20px;
  141. .item{
  142. display: flex;
  143. justify-content: flex-start;
  144. line-height: 1;
  145. margin-bottom: 20px;
  146. position: relative;
  147. cursor: pointer;
  148. .info{
  149. flex: 1;
  150. &::after{
  151. display: block;
  152. content: "";
  153. clear: both;
  154. }
  155. .lf{
  156. float: left;
  157. }
  158. .rt{
  159. float: right;
  160. .el-tag-taskCat{
  161. text-align: right;
  162. margin-top: 5px;
  163. .custom-tag{
  164. color:#fff;
  165. border-color:#eaeaea;
  166. background-color:transparent;
  167. &.tag-2{color: #b97741;border-color:#b97741;}
  168. &.tag-3{color: #97cd38;border-color:#97cd38;}
  169. &.tag-4{color: #dc5a2c;border-color:#dc5a2c;}
  170. &.tag-5{color: #414ab9;border-color:#414ab9;}
  171. &.tag-6{color: #c13ac9;border-color:#c13ac9;}
  172. &.tag-7{color: #29c761;border-color:#29c761;}
  173. }
  174. }
  175. }
  176. }
  177. .tag{
  178. height: 22px;
  179. display: inline-block;
  180. position: absolute;
  181. right: 0;
  182. padding: 0 5px;
  183. line-height: 20px;
  184. font-size: 12px;
  185. color: #fff;
  186. border-radius: 4px;
  187. box-sizing: border-box;
  188. white-space: nowrap;
  189. // background-color: #c78148;
  190. border: 1px solid #868282;
  191. &.none{
  192. background-color: transparent;
  193. border-color: transparent;
  194. }
  195. }
  196. p,h4{
  197. margin: 0;
  198. font-size: 14px;
  199. }
  200. p{
  201. padding-top: 6px;
  202. font-size: 8px;
  203. color: #f5f5f5;
  204. }
  205. h4{
  206. .status{
  207. font-size: 12px;
  208. }
  209. &.taskTitle{
  210. padding-bottom: 6px;
  211. }
  212. }
  213. .icon{
  214. width: 36px;
  215. height: 36px;
  216. font-size: 20px;
  217. }
  218. }
  219. }
  220. </style>