edit.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <style type="text/css">
  2. .new_table {
  3. border-collapse: collapse;
  4. margin: 0 auto;
  5. text-align: center;
  6. width: 100%;
  7. font-size: 12px;
  8. }
  9. .new_table td,
  10. table th {
  11. border: 1px solid #cad9ea;
  12. color: #666;
  13. height: 2.5em;
  14. }
  15. .new_table thead th {
  16. background-color: #CCE8EB;
  17. width: 100px;
  18. }
  19. .span_show {
  20. float: left;
  21. margin-left: 15px;
  22. font-size: 11px;
  23. color: #0a84ff;
  24. cursor: pointer;
  25. }
  26. .span_hide {
  27. float: left;
  28. margin-left: 15px;
  29. font-size: 11px;
  30. color: #0a84ff;
  31. cursor: pointer;
  32. }
  33. </style>
  34. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
  35. <div class="row">
  36. <div class="form-group col-sm-6">
  37. <label class="control-label col-xs-12 col-sm-2 addRedStar">{:__('Sim_type')}:</label>
  38. <div class="col-xs-12 col-sm-8">
  39. <select id="c-sim_type" data-rule="required" class="form-control" name="row[sim_type]">
  40. <option value="">请选择</option>
  41. {foreach name="sim_sim_type" item="vo"}
  42. <option value="{$key}" {if $row.sim_type eq $key}selected{/if}>{$vo}</option>
  43. {/foreach}
  44. </select>
  45. </div>
  46. </div>
  47. <div class="form-group col-sm-6">
  48. <label class="control-label col-xs-12 col-sm-2 addRedStar">{:__('Name')}:</label>
  49. <div class="col-xs-12 col-sm-8">
  50. <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
  51. </div>
  52. </div>
  53. </div>
  54. <input class="form-control fault_ids" name="row[fault_id]" type="hidden" value="{$row.fault_id|htmlentities}" data-rule="required">
  55. <div class="col-lg-12" style="margin: 20px 10px 0 10px">
  56. <div class="tab-content">
  57. <div class="tab-pane tab_log1" style="display: block">
  58. <table class="new_table">
  59. <thead>
  60. <tr style="height: 3.5rem">
  61. <td style="width:25%">型号</td>
  62. <td style="width:30%">故障现象</td>
  63. <td style="width:30%">故障部位</td>
  64. <td style="width:15%">
  65. <!-- <input name="btSelectAll" type="checkbox" class="btAll">-->
  66. <a class="btn-xs btn-success btnselectall">选中全部</a>
  67. <a class="btn-xs btn-primary cancelselectall">取消选择</a>
  68. </td>
  69. </tr>
  70. </thead>
  71. <tbody class="task_list">
  72. <?php
  73. $fault_id_arr = $row['fault_id_arr'];
  74. if($row['sim_type']=='0001'){
  75. foreach($row['selectData'] as $key=>$vo){
  76. if($key == 0){
  77. echo '<tr><td rowspan="10">FZD04B型侦毒器</td>';
  78. }
  79. if($key < 4){
  80. echo '<td rowspan="2">'.$vo['name'].'</td>';
  81. }else{
  82. echo '<td rowspan="1">'.$vo['name'].'</td>';
  83. }
  84. foreach($vo['children'] as $k=>$v){
  85. $id = $v['fault_id'];
  86. if($k>0){
  87. echo '</tr><tr><td>'.$v['name'].'</td>';
  88. if(in_array($id,$fault_id_arr)){
  89. echo '<td><input type="checkbox" name="checkbox" checked value='.$id.'></td>';
  90. }else{
  91. echo '<td><input type="checkbox" name="checkbox" value='.$id.'></td>';
  92. }
  93. }else{
  94. echo '<td>'.$v['name'].'</td>';
  95. if(in_array($id,$fault_id_arr)){
  96. echo '<td><input type="checkbox" name="checkbox" checked value='.$id.'></td>';
  97. }else{
  98. echo '<td><input type="checkbox" name="checkbox" value='.$id.'></td>';
  99. }
  100. }
  101. }
  102. echo "</tr>";
  103. }
  104. }else if($row['sim_type']=='0002'){
  105. foreach($row['selectData'] as $key=>$vo){
  106. if($key == 0){
  107. echo '<tr><td rowspan="15">FZB006型毒剂报警器</td>';
  108. }
  109. if($key < 5){
  110. echo '<td rowspan="2">'.$vo['name'].'</td>';
  111. }else{
  112. echo '<td rowspan="1">'.$vo['name'].'</td>';
  113. }
  114. foreach($vo['children'] as $k=>$v){
  115. $id = $v['fault_id'];
  116. if($k>0){
  117. echo '</tr><tr><td>'.$v['name'].'</td>';
  118. if(in_array($id,$fault_id_arr)){
  119. echo '<td><input type="checkbox" name="checkbox" checked value='.$id.'></td>';
  120. }else{
  121. echo '<td><input type="checkbox" name="checkbox" value='.$id.'></td>';
  122. }
  123. }else{
  124. echo '<td>'.$v['name'].'</td>';
  125. if(in_array($id,$fault_id_arr)){
  126. echo '<td><input type="checkbox" name="checkbox" checked value='.$id.'></td>';
  127. }else{
  128. echo '<td><input type="checkbox" name="checkbox" value='.$id.'></td>';
  129. }
  130. }
  131. }
  132. echo "</tr>";
  133. }
  134. }
  135. ?>
  136. </tbody>
  137. </table>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="form-group layer-footer">
  142. <label class="control-label col-xs-12 col-sm-2"></label>
  143. <div class="col-xs-12 col-sm-8">
  144. <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
  145. </div>
  146. </div>
  147. </form>