_table.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. </tr>
  15. <tr >
  16. <td class="p-0">
  17. <table class="table m-0 p-0">
  18. <td>说明</td>
  19. <td>经手人</td>
  20. <td>时间</td>
  21. </table>
  22. </td>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. <template v-if="demands.length>0">
  27. <tr class="text-center" v-for="(demand,i) in demands" @click="selectTr===i+1?selectTr=0:selectTr=i+1"
  28. :class="selectTr===i+1?'focusing' : ''">
  29. <td>@{{ i+1 }}</td>
  30. <td>@{{ demand.type }}</td>
  31. <td class="">
  32. <textarea class="form-control" rows="2" cols="15" :value="demand.description" @change="updateDemand(demand,'description',$event)" :disabled="demand['status'] !== '未处理'"></textarea>
  33. </td>
  34. <td class="text-left p-0" @mouseenter="showAddBtn(demand)" @mouseleave="showAddBtn(demand)" >
  35. <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>
  36. <div>
  37. <div :id="'addDiv_'+demand['id']" class="form-inline float-right d-none">
  38. <input type="text" class="form-control" :id="'addProcess'+demand['id']" style="width: 300px">
  39. <button class="btn btn-sm btn-primary ml-1" @click="addProcess(demand)">添加</button>
  40. </div>
  41. <div>
  42. <template v-if="demand['processes'].length > 0 ">
  43. <table class="table p-0 m-0 table-striped">
  44. <template v-for="(process,process_i) in demand['processes']">
  45. <tr class="text-center" @mouseenter="toggleDelBtn(demand['id'],process)" @mouseleave="toggleDelBtn(demand['id'],process)" >
  46. <td>@{{ process.explain }}</td>
  47. <td>@{{ process.user ? process.user.name : '' }}</td>
  48. <td>@{{ process.created_at }}</td>
  49. <td class="p-0 m-0" style="width: 35px;max-width: 35px">
  50. <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>
  51. </td>
  52. </tr>
  53. </template>
  54. </table>
  55. </template>
  56. </div>
  57. </div>
  58. </td>
  59. <td>
  60. <div class="text-center" @mouseleave="removeCommonImg('imgBulky_'+demand.id)" @mouseenter="commonImg('img_'+demand.id,demand,i)">
  61. <img v-if="demand['upload_file']" :id="'img_'+demand.id" :data-src="demand['upload_file']['url']" src="{{url('icon/img404-thumbnail.jpg')}}" alt="">
  62. <button v-else type="button" class="btn btn-outline-secondary" @click="showUploadDiv(demand,i)">上传文件</button>
  63. </div>
  64. </td>
  65. <td>@{{ demand.initiator ? demand.initiator.name : '' }}</td>
  66. <td>@{{ demand.handle ? demand.handle.name : '' }}</td>
  67. <td>@{{ demand.created_at }}</td>
  68. <td>@{{ demand.status }}</td>
  69. <td>
  70. <button class="btn btn-outline-success" @click="finishDemand(demand,i)" v-if="demand['status'] === '处理中'">完结</button>
  71. <button class="btn btn-outline-success" @click="claimDemand(demand,i)" v-if="demand['status'] === '未处理'">认领</button>
  72. <button class="btn btn-outline-danger" @click="destroyDemand(demand,i)">删</button>
  73. </td>
  74. </tr>
  75. </template>
  76. <template v-else>
  77. <tr>
  78. <td colspan="11">
  79. <div class="alert alert-info text-center">
  80. 按条件查询的数据结果未空
  81. </div>
  82. </td>
  83. </tr>
  84. </template>
  85. </tbody>
  86. </table>
  87. {{ $demands->withQueryString()->links() }}