_table.blade.php 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <table class="table table-striped table-bordered table-sm table-hover">
  2. <thead class="text-center">
  3. <tr class="align-text-bottom">
  4. <th rowspan="2">序号</th>
  5. <th rowspan="2">类型</th>
  6. <th rowspan="2">需求描述</th>
  7. <th rowspan="1">过程</th>
  8. <th rowspan="2">附件</th>
  9. <th rowspan="2">路由</th>
  10. <th rowspan="2">标题</th>
  11. <th rowspan="2">发起人</th>
  12. <th rowspan="2">处理人</th>
  13. <th rowspan="2">发起时间</th>
  14. <th rowspan="2">状态</th>
  15. <th rowspan="2">操作</th>
  16. </tr>
  17. <tr >
  18. <td class="p-0">
  19. <table class="table m-0 p-0">
  20. <td>说明</td>
  21. <td>经手人</td>
  22. <td>时间</td>
  23. </table>
  24. </td>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <template v-if="demands.length>0">
  29. <tr class="text-center" v-for="(demand,i) in demands" @click="selectTr===i+1?selectTr=0:selectTr=i+1"
  30. :class="selectTr===i+1?'focusing' : ''">
  31. <td>@{{ i+1 }}</td>
  32. <td>@{{ demand.type }}</td>
  33. <td class="">
  34. <textarea class="form-control" rows="2" cols="15" :value="demand.description" @change="updateDemand(demand,'description',$event)" :disabled="demand['status'] !== '未处理'"></textarea>
  35. </td>
  36. <td class="text-left p-0" @mouseenter="showAddBtn(demand)" @mouseleave="showAddBtn(demand)" >
  37. <button class="btn btn-primary position-absolute d-none" :id="'addBtn_'+demand['id']" style="margin-top: -35px;" @click="toggleAddDiv(demand,demand['id'])" v-if="demand['status'] !== '已处理'">新</button>
  38. <div>
  39. <div :id="'addDiv_'+demand['id']" class="form-inline float-right d-none">
  40. <input type="text" class="form-control" :id="'addProcess'+demand['id']" style="width: 300px">
  41. <button class="btn btn-sm btn-primary ml-1" @click="addProcess(demand)">添加</button>
  42. </div>
  43. <div>
  44. <template v-if="demand['processes'].length > 0 ">
  45. <table class="table p-0 m-0 table-striped">
  46. <template v-for="(process,process_i) in demand['processes']">
  47. <tr class="text-center" @mouseenter="toggleDelBtn(demand['id'],process)" @mouseleave="toggleDelBtn(demand['id'],process)" >
  48. <td>@{{ process.explain }}</td>
  49. <td>@{{ process.user ? process.user.name : '' }}</td>
  50. <td>@{{ process.created_at }}</td>
  51. <td class="p-0 m-0" style="width: 35px;max-width: 35px">
  52. <button :id="'demand-'+demand['id']+'process-'+process['id']" type="button" @click="deleteProcess(demand,process,process_i,i)" class="btn btn-sm btn-outline-danger d-none m-0" v-if="demand['status'] !== '已处理'">删</button>
  53. </td>
  54. </tr>
  55. </template>
  56. </table>
  57. </template>
  58. </div>
  59. </div>
  60. </td>
  61. <td>
  62. <div class="text-center" @mouseleave="removeCommonImg('imgBulky_'+demand.id)" @mouseenter="commonImg('img_'+demand.id,demand,i)">
  63. <img v-if="demand['upload_file']" :id="'img_'+demand.id" :data-src="demand['upload_file']['url']" src="{{url('icon/img404-thumbnail.jpg')}}" alt="">
  64. <button v-else type="button" class="btn btn-outline-secondary" @click="showUploadDiv(demand,i)">上传文件</button>
  65. </div>
  66. </td>
  67. <td>@{{ demand.route }}</td>
  68. <td>@{{ demand.title }}</td>
  69. <td>@{{ demand.initiator ? demand.initiator.name : '' }}</td>
  70. <td>@{{ demand.handle ? demand.handle.name : '' }}</td>
  71. <td>@{{ demand.created_at }}</td>
  72. <td>@{{ demand.status }}</td>
  73. <td>
  74. <button class="btn btn-outline-success" @click="finishDemand(demand,i)" v-if="demand['status'] === '处理中'">完结</button>
  75. <button class="btn btn-outline-success" @click="claimDemand(demand,i)" v-if="demand['status'] === '未处理'">认领</button>
  76. <button class="btn btn-outline-danger" @click="destroyDemand(demand,i)">删</button>
  77. </td>
  78. </tr>
  79. </template>
  80. <template v-else>
  81. <tr>
  82. <td colspan="11">
  83. <div class="alert alert-info text-center">
  84. 按条件查询的数据结果未空
  85. </div>
  86. </td>
  87. </tr>
  88. </template>
  89. </tbody>
  90. </table>
  91. {{ $demands->withQueryString()->links() }}