index.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div>
  3. <div style="display:flex;justify-content: space-between;">
  4. <table-detail ref="tableRef" :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px" @rowClick="rowClick" >
  5. <template v-slot:customcol="scope">
  6. <div v-if="scope.column.columnname == 'status'">
  7. <div :style="tool.getStatusColor(scope.column.data[scope.column.columnname])">{{scope.column.data[scope.column.columnname]}}</div>
  8. </div>
  9. <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
  10. </template>
  11. </table-detail>
  12. <div style="width: 45%" id="gantt222">
  13. <ganttChart :data="list" style="margin-top: 10px" ref="chartRef" clickCan="可以点击" @taskDetail="taskDetail"></ganttChart>
  14. </div>
  15. </div>
  16. <div style="margin-top: 20px">
  17. <actionDetail v-if="detailShow" ref="actionRef" :data="selectData" :mainData="mainData" @recordSet="recordSet"></actionDetail>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import actionDetail from './actionDetail'
  23. import ganttChart from '../improvementPlan/ganttChart'
  24. export default {
  25. name: "index",
  26. components:{actionDetail,ganttChart},
  27. props:['mainData'],
  28. data(){
  29. return {
  30. param:{
  31. "id": 2026020210235502,
  32. "content": {
  33. "sa_service_improvementid": this.$route.query.id,
  34. "pageNumber": 1,
  35. "pageSize": 99
  36. },
  37. },
  38. tablecols:[],
  39. list:[],
  40. total:0,
  41. currentPage:0,
  42. userid:JSON.parse(sessionStorage.getItem('active_account')).userid,
  43. detailShow:false,
  44. selectData:'',
  45. nowIndex:''
  46. }
  47. },
  48. methods:{
  49. async listData(data){
  50. const res = await this.$api.requested(this.param)
  51. this.list = res.data
  52. console.log(res.data,'方案列表')
  53. this.$refs.chartRef.setList(this.list)
  54. if (data){
  55. this.list.forEach(item =>{
  56. if (item.sa_service_improvement_planid == data){
  57. this.selectData = item
  58. }
  59. })
  60. this.$refs.actionRef.listData()
  61. }
  62. },
  63. rowClick(data){
  64. this.selectData = data
  65. this.detailShow = true
  66. this.$nextTick(()=>{
  67. this.$refs.actionRef.listData()
  68. })
  69. },
  70. recordSet(data){
  71. this.listData(data)
  72. },
  73. taskDetail(data){
  74. this.detailShow = true
  75. this.list.forEach(item =>{
  76. if (item.sa_service_improvement_planid == data.id){
  77. this.selectData = item
  78. }
  79. })
  80. this.$nextTick(()=>{
  81. this.$refs.actionRef.listData()
  82. })
  83. }
  84. },
  85. created() {
  86. this.tablecols = this.tool.tabelCol(this.$route.name).improvementActionTable.tablecols
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. .el-table .success-row {
  92. background: #50c50f;
  93. }
  94. </style>