TaskItem.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class="task-item-container">
  3. <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
  4. <el-col :span="5" type="flex" align="middle" justify="center">
  5. <el-badge :value="taskTable.statusVO.text" class="item" :type="taskTable.statusVO.style">
  6. <img class="task-cover" src="@/assets/img/home_ban1.jpg">
  7. </el-badge>
  8. </el-col>
  9. <el-col :span="4" type="flex" align="middle" justify="center">{{taskTable.title}}</el-col>
  10. <!--<el-col :span="4">{{project.id}}</el-col>-->
  11. <el-col :span="4" type="flex" align="middle" justify="center">
  12. <div class="badge" type="flex" align="middle" justify="center">
  13. {{taskTable.serviceType}}
  14. </div>
  15. </el-col>
  16. <el-col :span="4" type="flex" align="middle" justify="center">¥{{taskTable.quotePrice==null?0:taskTable.quotePrice}}</el-col>
  17. <el-col :span="4" type="flex" align="middle" justify="center">
  18. {{taskTable.acceptedCount}} / {{ taskTable.participantCount}}
  19. </el-col>
  20. <el-col :span="3" type="flex" align="middle" justify="center"><span class="btn btn-medium btn-info"
  21. @click="goToTaskDetail(taskTable.projectId,taskTable.id)">查看详情</span>
  22. </el-col>
  23. </el-row>
  24. </div>
  25. </template>
  26. <script>
  27. import TaskStatus from '@/constants/enum/task-status'
  28. export default {
  29. name: 'Task-Item',
  30. props: {
  31. task: {}
  32. },
  33. data () {
  34. return {
  35. taskTable: this.task,
  36. taskStatus: TaskStatus,//TaskStatus[this.task.status],
  37. }
  38. },
  39. mounted () {
  40. let plats = []
  41. //console.log(this.platformType)
  42. }
  43. ,
  44. methods: {
  45. goToTaskDetail (projectId, id) {
  46. this.$router.push({name: 'Task', params: {projectId: projectId, taskId: id}})
  47. }
  48. },
  49. watch: {
  50. task () {
  51. this.taskTable = this.task
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="less" scoped>
  57. .task-item-container {
  58. padding-top: 10px;
  59. padding-bottom: 10px;
  60. border: 1px solid #eee;
  61. /*margin: 15px 5px;*/
  62. span {
  63. display: inline-block;
  64. }
  65. }
  66. .task-cover {
  67. width: 200px;
  68. height: 130px;
  69. vertical-align: middle;
  70. }
  71. .task-title {
  72. font-weight: 700;
  73. }
  74. .task-td {
  75. /*padding: 15px;*/
  76. }
  77. </style>