add.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('add')}" class="form-horizontal">
  8. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  9. <div class="form-group">
  10. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  11. <div class="col-sm-6">
  12. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label">时间代码<span class="text-danger">*</span></label>
  17. <div class="col-sm-6">
  18. <select name="time_id" class="form-control">
  19. <option value="">请选择</option>
  20. {foreach $time as $k=>$v}
  21. <option {if isset($info) && $info['time_id']==$v.id} selected {/if} value="{$v.id}">{$v.title}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-2 control-label">运送对象<span class="text-danger">*</span></label>
  28. <div class="col-sm-6">
  29. <select name="cate" class="form-control">
  30. <option value="">请选择</option>
  31. {foreach $cate as $k=>$v}
  32. <option {if isset($info) && $info['cate']==$k} selected {/if} value="{$k}">{$v}</option>
  33. {/foreach}
  34. </select>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-2 control-label">运送积分<span class="text-danger">*</span></label>
  39. <div class="col-sm-6">
  40. <input type="number" class="form-control" name="score" value="{$info.score|default='1'}">
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-2 control-label">开始地点</label>
  45. <div class="col-sm-6">
  46. {:widget_view('common/multiselect',['name'=>'starts','lists' => $ends, 'val' => isset($info)?$info['starts']:[]])}
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="col-sm-2 control-label">结束地点</label>
  51. <div class="col-sm-6">
  52. {:widget_view('common/multiselect',['name'=>'ends','lists' => $ends, 'val' => isset($info)?$info['ends']:[]])}
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <label class="col-sm-2 control-label">任务优先级</label>
  57. <div class="col-sm-6">
  58. <select name="priority" class="form-control">
  59. {foreach $priority as $k=>$v}
  60. <option {if isset($info) && $info['priority']==$k} selected {/if} value="{$k}">{$v}</option>
  61. {/foreach}
  62. </select>
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label class="col-sm-2 control-label">排序</label>
  67. <div class="col-sm-6">
  68. <input type="number" class="form-control" name="sort" value="{$info.sort|default='50'}">
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label class="col-sm-2 control-label">状态</label>
  73. <div class="col-sm-6">
  74. <label class="cr-inline">
  75. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  76. </label>
  77. <label class="cr-inline">
  78. <input type="radio" value="0" name="enable">禁用
  79. </label>
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="col-sm-2 control-label">是否是手术室</label>
  84. <div class="col-sm-6">
  85. <label class="cr-inline">
  86. <input type="radio" value="1" name="is_sss" onclick="clickIssss(1)">是&nbsp;&nbsp;
  87. </label>
  88. <label class="cr-inline">
  89. <input type="radio" value="0" name="is_sss" onclick="clickIssss(0)">否
  90. </label>
  91. </div>
  92. </div>
  93. <div id="issss" style="display:none ">
  94. <div class="form-group">
  95. <label class="col-sm-2 control-label">类型</label>
  96. <div class="col-sm-6">
  97. <label class="cr-inline">
  98. <input type="radio" value="1" name="type" onclick="clickIssss(1)">外送&nbsp;&nbsp;
  99. </label>
  100. <label class="cr-inline">
  101. <input type="radio" value="0" name="type" onclick="clickIssss(0)">收取
  102. </label>
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <label class="col-sm-2 control-label">运送地点</label>
  107. <div class="col-sm-6">
  108. {:widget_view('common/select',['name'=>'addr_id','lists' => $ends, 'value' => isset($info)?$info['addr_id']:''])}
  109. </div>
  110. </div>
  111. </div>
  112. <div class="form-group">
  113. <label class="col-sm-2 control-label">颜色</label>
  114. <div class="col-sm-6">
  115. {:widget_view('common/color-picker',['name'=>'color', 'value' => isset($info)?$info['color']:''])}
  116. </div>
  117. </div>
  118. <div class="hr-line-dashed"></div>
  119. <div class="form-group">
  120. <div class="col-sm-6 col-sm-offset-2">
  121. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  122. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  123. </div>
  124. </div>
  125. </form>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. {/block}
  131. {block name="script"}
  132. <script>
  133. $(document).ready(function(){
  134. formSetValue("enable", {$info.enable|default=1});
  135. });
  136. $(document).ready(function(){
  137. formSetValue("type", {$info.type|default=0});
  138. });
  139. $(document).ready(function(){
  140. formSetValue("is_sss", {$info.is_sss|default=0});
  141. clickIssss({$info.is_sss|default=0});
  142. });
  143. function clickIssss(e){
  144. if(e === 1){
  145. $('#issss').css('display','block');
  146. }else{
  147. $('#issss').css('display','none');
  148. }
  149. }
  150. </script>
  151. {/block}