setting.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .minheight{
  5. min-height: 100px;
  6. }
  7. </style>
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-title">
  12. <h5>{$info['title']}[{$info['start']} ~ {$info['end']}]</h5>
  13. <div class="ibox-tools">
  14. <a class="toback" href="{:url('index')}">
  15. 返回上一页
  16. </a>
  17. </div>
  18. </div>
  19. <div class="ibox-content">
  20. <ul class="nav nav-tabs">
  21. {volist name="weeks" id="v"}
  22. <li {if condition="$v['day'] eq $day"}class="active"{/if}>
  23. <a href="{:url('setting',['id'=>$info['id'],'day'=>$v['day']])}">{$v.week}</a>
  24. </li>
  25. {/volist}
  26. </ul>
  27. <table class="table table-bordered">
  28. <thead>
  29. <tr>
  30. <th>餐次</th>
  31. <th>菜单</th>
  32. </tr>
  33. </thead>
  34. {volist name="typeList" id="v"}
  35. <tr>
  36. <td style="width: 150px">
  37. {$v.name}
  38. {if condition="$v['limit'] gt 0"}(最多选{$v['limit']}种){/if}
  39. {if condition="$v['limit'] eq 0"}(不限制){/if}
  40. <br>
  41. <a url="{:url('limits',['id'=>$info['id'],'day'=>$day,'typeId'=>$v['id']])}" href="javascript:;" data-title="{$v.name}设置" onclick="layer_open(this,2)" class="btn btn-xs btn-primary">设置</a>
  42. </td>
  43. <td>
  44. <div>
  45. <a url="{:url('items',['id'=>$info['id'],'day'=>$day,'typeId'=>$v['id']])}" href="javascript:;" data-title="{$v.name}-添加商品" onclick="layer_open(this,2)" class="btn btn-xs btn-primary">添加商品</a>
  46. </div>
  47. <div class="minheight">
  48. <table class="table table-bordered">
  49. <thead>
  50. <tr>
  51. <th>编号</th>
  52. <th>名称</th>
  53. <th>价格</th>
  54. <th>图片</th>
  55. <th>是否必选</th>
  56. <th>最大数量</th>
  57. <th>操作</th>
  58. </tr>
  59. </thead>
  60. {notempty name="v['items']"}
  61. {volist name="v['items']" id="vo"}
  62. <tr>
  63. <td>#{$vo.dinner_id}</td>
  64. <td>{$vo.name}</td>
  65. <td>
  66. <input type="text" class="form-control" oninput="clearNoNum(this)" data-id="{$vo['id']}" value="{$vo['money']}" onchange="changeMoney(this)">
  67. </td>
  68. <td>
  69. {notempty name="vo['img']"}
  70. <img src="{$vo.img}" style="width: 30px;height: 30px;" onclick="open_img(this)" alt="">
  71. {/notempty}
  72. </td>
  73. <td>
  74. {eq name="vo['required']" value="0"}
  75. <a href="{:url('itemrequired',['id'=>$vo['id']])}" class="btn btn-xs btn-primary confirm ajax-get data-reload" data-confirm="确定要标记为必选吗?">否</a>
  76. {else /}
  77. <a href="{:url('itemrequired',['id'=>$vo['id']])}" class="btn btn-xs btn-primary confirm ajax-get data-reload" data-confirm="确定要标记为非必选吗?">是</a>
  78. {/eq}
  79. </td>
  80. <td>
  81. <input type="text" class="form-control" oninput="clearNoNum1(this)" data-id="{$vo['id']}" value="{$vo['max']}" onchange="changeMax(this)">
  82. </td>
  83. <td>
  84. <a href="{:url('itemdel',['id'=>$vo['id']])}" class="btn btn-xs btn-danger confirm ajax-get data-reload" data-confirm="确定要删除此菜品吗?">删除</a>
  85. </td>
  86. </tr>
  87. {/volist}
  88. {else /}
  89. <tr>
  90. <td colspan="6">暂无数据</td>
  91. </tr>
  92. {/notempty}
  93. </table>
  94. </div>
  95. <div>
  96. <a url="{:url('combination',['groupId'=>$info['id'],'day'=>$day,'typeId'=>$v['id']])}" href="javascript:;" data-title="{$v.name}-添加组合" onclick="layer_open(this,2)" class="btn btn-xs btn-primary">添加组合</a>
  97. <span class="text-danger">注意:如果添加过组合,用户必选选择其中一种,不选无法下单</span>
  98. </div>
  99. <div>
  100. <table class="table table-bordered">
  101. <thead>
  102. <tr>
  103. <th>编号</th>
  104. <th>名称</th>
  105. <th>组合菜品</th>
  106. <th>操作</th>
  107. </tr>
  108. </thead>
  109. {notempty name="v['combination']"}
  110. {volist name="v['combination']" id="vo"}
  111. <tr>
  112. <td>{$vo.id}</td>
  113. <td>{$vo.title}</td>
  114. <td>{$vo.names}</td>
  115. <td>
  116. <a href="{:url('combinationdel',['id'=>$vo['id']])}" class="btn btn-xs btn-danger confirm ajax-get data-reload" data-confirm="确定要删除此组合吗?">删除</a>
  117. </td>
  118. </tr>
  119. {/volist}
  120. {else /}
  121. <tr>
  122. <td colspan="4">暂无数据</td>
  123. </tr>
  124. {/notempty}
  125. </table>
  126. </div>
  127. <div>
  128. <a url="{:url('combination2',['groupId'=>$info['id'],'day'=>$day,'typeId'=>$v['id']])}" href="javascript:;" data-title="{$v.name}-添加互斥组合" onclick="layer_open(this,2)" class="btn btn-xs btn-primary">添加互斥组合</a>
  129. <span class="text-danger">注意:同一餐次组合内的商品无法同时购买</span>
  130. </div>
  131. <div>
  132. <table class="table table-bordered">
  133. <thead>
  134. <tr>
  135. <th>编号</th>
  136. <th>组合菜品</th>
  137. <th>操作</th>
  138. </tr>
  139. </thead>
  140. {notempty name="v['combination2']"}
  141. {volist name="v['combination2']" id="vo"}
  142. <tr>
  143. <td>{$vo.id}</td>
  144. <td>{$vo.names}</td>
  145. <td>
  146. <a href="{:url('combination2del',['id'=>$vo['id']])}" class="btn btn-xs btn-danger confirm ajax-get data-reload" data-confirm="确定要删除此互斥组合吗?">删除</a>
  147. </td>
  148. </tr>
  149. {/volist}
  150. {else /}
  151. <tr>
  152. <td colspan="3">暂无数据</td>
  153. </tr>
  154. {/notempty}
  155. </table>
  156. </div>
  157. </td>
  158. </tr>
  159. {/volist}
  160. </table>
  161. <table class="table table-bordered" style="display: none;">
  162. <thead>
  163. <tr>
  164. <th>餐次</th>
  165. <th>星期一<br>2023-03-27</th>
  166. <th>星期二(2023-03-28)</th>
  167. <th>星期三(2023-03-29)</th>
  168. <th>星期四(2023-03-30)</th>
  169. <th>星期五(2023-03-31)</th>
  170. <th>星期六(2023-04-01)</th>
  171. <th>星期日(2023-04-02)</th>
  172. </tr>
  173. </thead>
  174. <tr>
  175. <th style="width: 50px">
  176. 早餐 <br>
  177. (6种) <br>
  178. <a url="{:url('')}" href="#">设置</a>
  179. </th>
  180. <th>
  181. <div class="minheight">
  182. <div>[#22]黄瓜红油金针磨金针磨</div>
  183. <div>[#23]星期一星期一</div>
  184. <div>[#24]星期一星期一</div>
  185. <div>[#22]黄瓜红油金针磨金针磨</div>
  186. <div>[#23]星期一星期一</div>
  187. <div>[#24]星期一星期一</div>
  188. </div>
  189. <div>
  190. <a href="#">添加商品</a>
  191. </div>
  192. </th>
  193. <th>
  194. <div class="minheight">
  195. <div>[#22]黄瓜红油金针磨金针磨</div>
  196. <div>[#23]星期一星期一</div>
  197. <div>[#24]星期一星期一</div>
  198. </div>
  199. </th>
  200. <th>
  201. <div class="minheight">
  202. <div>[#22]黄瓜红油金针磨金针磨</div>
  203. <div>[#23]星期一星期一</div>
  204. <div>[#24]星期一星期一</div>
  205. </div>
  206. </th>
  207. <th>
  208. <div class="minheight">
  209. <div>[#22]黄瓜红油金针磨金针磨</div>
  210. <div>[#23]星期一星期一</div>
  211. <div>[#24]星期一星期一</div>
  212. </div>
  213. </th>
  214. <th>
  215. <div class="minheight">
  216. <div>[#22]黄瓜红油金针磨金针磨</div>
  217. <div>[#23]星期一星期一</div>
  218. <div>[#24]星期一星期一</div>
  219. </div>
  220. </th>
  221. <th>
  222. <div class="minheight">
  223. <div>[#22]黄瓜红油金针磨金针磨</div>
  224. <div>[#23]星期一星期一</div>
  225. <div>[#24]星期一星期一</div>
  226. </div>
  227. </th>
  228. <th>
  229. <div class="minheight">
  230. <div>[#22]黄瓜红油金针磨金针磨</div>
  231. <div>[#23]星期一星期一</div>
  232. <div>[#24]星期一星期一</div>
  233. </div>
  234. </th>
  235. </tr>
  236. <tr>
  237. <th>
  238. 早餐 <br>
  239. (6种) <br>
  240. <a href="#">设置</a>
  241. </th>
  242. <th>
  243. <div class="minheight">
  244. 星期一
  245. </div>
  246. </th>
  247. <th>星期二</th>
  248. <th>星期三</th>
  249. <th>星期四</th>
  250. <th>星期五</th>
  251. <th>星期六</th>
  252. <th>星期日</th>
  253. </tr>
  254. <tr>
  255. <th>晚餐</th>
  256. <th>
  257. <div class="minheight">
  258. 星期一
  259. </div>
  260. </th>
  261. <th>星期二</th>
  262. <th>星期三</th>
  263. <th>星期四</th>
  264. <th>星期五</th>
  265. <th>星期六</th>
  266. <th>星期日</th>
  267. </tr>
  268. </table>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. {/block}
  274. {block name="script"}
  275. <script>
  276. function changeMax(_self) {
  277. var val = $(_self).val();
  278. var id = $(_self).attr('data-id');
  279. console.log('val',val);
  280. let url = "{:url('itemmax')}";
  281. $.post(url,{id:id,val:val},function (ret) {
  282. if(ret.code == 1){
  283. window.location.reload();
  284. }else{
  285. layer.msg('操作失败')
  286. }
  287. })
  288. }
  289. function changeMoney(_self) {
  290. var val = $(_self).val();
  291. var id = $(_self).attr('data-id');
  292. console.log('val',val);
  293. let url = "{:url('itemmoney')}";
  294. $.post(url,{id:id,val:val},function (ret) {
  295. if(ret.code == 1){
  296. window.location.reload();
  297. }else{
  298. layer.msg('操作失败')
  299. }
  300. })
  301. }
  302. </script>
  303. {/block}