index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div class="normal-panel mt-10">
  3. <div class="flex-align-center flex-between " style="border-bottom:1px solid #f1f2f3;padding:0 10px">
  4. <div>
  5. <slot name="collapse"></slot>
  6. 任务事项
  7. </div>
  8. <addTask :ownertable="ownertable" @onSuccess="listData" :status="status" :typeTask="typeTask"></addTask>
  9. </div>
  10. <div v-if="list.length === 0">
  11. <el-empty description="暂无记录" :image-size="40"></el-empty>
  12. </div>
  13. <div class="task_list__panel" v-for="item in list" :key="item.sys_taskid">
  14. <div class="flex-align-center flex-between">
  15. <el-tooltip class="item" effect="dark" :content="item.title" placement="top-start">
  16. <p class="task_title" @click="taskDetail(item)"><b>{{item.title}}</b></p>
  17. </el-tooltip>
  18. <small>{{item.status}}</small>
  19. <small>{{item.starttime.split(' ')[0]}}</small>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import addTask from './addTask.vue'
  26. export default {
  27. props:['ownertable','status','typeTask'],
  28. components:{
  29. addTask
  30. },
  31. data () {
  32. return {
  33. list:[],
  34. oldRoute:{}
  35. }
  36. },
  37. methods:{
  38. async listData () {
  39. const res = await this.$api.requested({
  40. "id":20220902085001,
  41. "content": {
  42. "ownertable":this.ownertable,
  43. "ownerid":this.$route.query.id
  44. }
  45. })
  46. this.list = res.data
  47. },
  48. taskDetail (item) {
  49. let route = this.$route
  50. if (route.path !== '/taskDetails') {
  51. this.oldRoute = {path:route.path,query:route.query}
  52. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  53. }
  54. this.$router.replace({path:'/taskDetails',query:{id:item.sys_taskid,rowindex:item.rowindex}})
  55. }
  56. },
  57. mounted () {
  58. this.listData()
  59. }
  60. }
  61. </script>
  62. <style>
  63. </style>
  64. <style scoped>
  65. .normal-panel{
  66. border-radius: 5px;
  67. padding-bottom: 10px;
  68. }
  69. .task_list__panel{
  70. padding:0 10px;
  71. margin:10px 0;
  72. }
  73. .task_list__panel:last-child{
  74. margin-bottom: 0 !important;
  75. }
  76. .task_title{
  77. width: 160px;
  78. overflow: hidden;
  79. text-overflow:ellipsis;
  80. white-space: nowrap;
  81. color:#3874F6;
  82. text-decoration: underline;
  83. cursor: pointer;
  84. }
  85. .task_title + small{
  86. color:#999
  87. }
  88. </style>