area.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {template 'public/header'}
  2. {template 'public/comhead'}
  3. <style type="text/css">
  4. .nav-tabs{
  5. margin-top: 30px;
  6. }
  7. .nav-tabs>li>a:hover{
  8. color: #333;
  9. border-color: #31C2A5;
  10. background-color: white;
  11. }
  12. .nav-tabs > li.active > a,.nav-tabs > li.active > a:hover{
  13. background-color: #31C2A5;
  14. color: white;
  15. border-color: #31C2A5;
  16. }
  17. .nav.nav-tabs{border-color: #31C2A5;}
  18. .yg5_key>div{float: left;line-height: 34px;}
  19. .store_td1{height: 45px;}
  20. .store_list_img{width: 60px;height: 60px;}
  21. .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;}
  22. .yg5_tr2>td{padding: 15px;border: 1px solid #e5e5e5;text-align: center;}
  23. .yg5_tr1>td{
  24. border: 1px solid #e5e5e5;
  25. padding-left: 15px;
  26. background-color: #FAFAFA;
  27. font-weight: bold;
  28. text-align: center;
  29. }
  30. .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
  31. </style>
  32. <ul class="nav nav-tabs">
  33. <li class="active"><a href="{php echo $this->createWebUrl('area')}">门店区域管理</a></li>
  34. <li><a href="{php echo $this->createWebUrl('addarea')}">添加门店区域</a></li>
  35. </ul>
  36. <div class="main">
  37. <div class="panel panel-default">
  38. <div class="panel-body">
  39. <a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a>
  40. </div>
  41. </div>
  42. <!-- 门店列表部分开始 -->
  43. <div class="panel panel-default">
  44. <div class="panel-heading">
  45. 门店区域管理
  46. </div>
  47. <div class="panel-body" style="padding: 0px 15px;">
  48. <div class="row">
  49. <table class="yg5_tabel col-md-12">
  50. <tr class="yg5_tr1">
  51. <td class="store_td1 col-md-1">顺序</td>
  52. <td class="col-md-2">区域名称</td>
  53. <td class="col-md-3">操作</td>
  54. </tr>
  55. {loop $list $row}
  56. <tr class="yg5_tr2">
  57. <td class="num{$row['id']}">
  58. <span class="numspan{$row['id']}">{$row['num']}</span>
  59. <input style="display: none;width: 100%;" type="number" name="num{$row['id']}" class="numinp{$row['id']}" value="{$row['num']}" />
  60. <script type="text/javascript">
  61. $(function(){
  62. $(".num{$row['id']}").each(function(index){
  63. $(this).dblclick(function(){
  64. $(".numinp{$row['id']}").eq(index).show().focus();
  65. $(".numspan{$row['id']}").eq(index).hide();
  66. });
  67. });
  68. $(".numinp{$row['id']}").each(function(index){
  69. $(this).blur(function(){
  70. $(".numinp{$row['id']}").eq(index).hide();
  71. $(".numspan{$row['id']}").eq(index).show();
  72. var text = $(".numspan{$row['id']}").html();
  73. var inp = $(" input[ name='num{$row['id']}' ] ").val();
  74. $(".numspan{$row['id']}").html(inp);
  75. console.log(inp);
  76. id = {$row['id']};
  77. num = inp;
  78. $.ajax({
  79. type:"post",
  80. url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=UpdArea&m=zh_tcwq",
  81. dataType:"text",
  82. data:{id:id,num:num},
  83. success:function(data){
  84. console.log(data);
  85. }
  86. })
  87. });
  88. });
  89. })
  90. </script>
  91. </td>
  92. <td>{$row['area_name']}</td>
  93. <td><a class="btn btn-warning btn-sm" href="{php echo $this->createWebUrl('addarea', array('id' => $row['id']))}" title="编辑">改</a>&nbsp;&nbsp;
  94. <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModal{$row['id']}">删</button>
  95. </td>
  96. </tr>
  97. <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  98. <div class="modal-dialog" role="document">
  99. <div class="modal-content">
  100. <div class="modal-header">
  101. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  102. <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
  103. </div>
  104. <div class="modal-body" style="font-size: 20px">
  105. 确定删除么?
  106. </div>
  107. <div class="modal-footer">
  108. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  109. <a href="{php echo $this->createWebUrl('area', array('id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. {/loop}
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. {$pager}
  120. </div>
  121. <!-- {template 'common/footer'} -->{template 'common/footer'}