mallvouchertemplateadd.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_voucher_price_manage}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <form id="add_form" method="post">
  13. <div class="ncap-form-default">
  14. <dl>
  15. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_title}{$Think.lang.ds_colon}</label></dt>
  16. <dd>
  17. <input class="w400 text" name="mallvouchertemplate_title" type="text" id="mallvouchertemplate_title" value="{$info.mallvouchertemplate_title|default=''}" />
  18. <span></span>
  19. </dd>
  20. </dl>
  21. <dl>
  22. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_goodsclass}{$Think.lang.ds_colon}</label></dt>
  23. <dd>
  24. <div id="gcategory" class="default_select">
  25. <input type="hidden" name="mallvouchertemplate_gcid" value="{$info.mallvouchertemplate_gcid}" class="mls_id" />
  26. <input type="hidden" name="mallvouchertemplate_gcname" value="{$spec.mallvouchertemplate_gcname|default=''}" class="mls_name" />
  27. {if $info.mallvouchertemplate_gcid}
  28. <span>{$info.mallvouchertemplate_gcname|default=''}</span>
  29. {/if}
  30. <select {if $info.mallvouchertemplate_gcid}style="display:none"{/if}>
  31. <option value="0">{$Think.lang.ds_please_choose}</option>
  32. {foreach name="gc_list" item="gc"}
  33. <option value="{$gc.gc_id}">{$gc.gc_name}</option>
  34. {/foreach}
  35. </select>
  36. </div>
  37. </dd>
  38. </dl>
  39. <dl>
  40. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_price}{$Think.lang.ds_colon}</label></dt>
  41. <dd>
  42. <input class="w400 text" name="mallvouchertemplate_price" type="text" id="mallvouchertemplate_price" value="{$info.mallvouchertemplate_price|default=''}" />
  43. <span></span>
  44. </dd>
  45. </dl>
  46. <dl>
  47. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_startdate}{$Think.lang.ds_colon}</label></dt>
  48. <dd>
  49. <input class="w400 text" name="mallvouchertemplate_startdate" type="text" id="mallvouchertemplate_startdate" value="{$info.mallvouchertemplate_startdate|date='Y-m-d H:i'}" />
  50. <span></span>
  51. </dd>
  52. </dl>
  53. <dl>
  54. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_enddate}{$Think.lang.ds_colon}</label></dt>
  55. <dd>
  56. <input class="w400 text" name="mallvouchertemplate_enddate" type="text" id="mallvouchertemplate_enddate" value="{$info.mallvouchertemplate_enddate|date='Y-m-d H:i'}" />
  57. <span></span>
  58. </dd>
  59. </dl>
  60. <dl>
  61. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_limit}{$Think.lang.ds_colon}</label></dt>
  62. <dd>
  63. <input class="w400 text" name="mallvouchertemplate_limit" type="text" id="mallvouchertemplate_limit" value="{$info.mallvouchertemplate_limit|default=''}" />
  64. <span></span>
  65. </dd>
  66. </dl>
  67. <dl>
  68. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_points}{$Think.lang.ds_colon}</label></dt>
  69. <dd>
  70. <input class="w400 text" name="mallvouchertemplate_points" type="text" id="mallvouchertemplate_points" value="{$info.mallvouchertemplate_points|default='0'}" />
  71. <span></span>
  72. </dd>
  73. </dl>
  74. <dl>
  75. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_quantity}{$Think.lang.ds_colon}</label></dt>
  76. <dd>
  77. <input class="w400 text" name="mallvouchertemplate_quantity" type="text" id="mallvouchertemplate_quantity" value="{$info.mallvouchertemplate_quantity}" />
  78. <span></span>
  79. </dd>
  80. </dl>
  81. <dl>
  82. <dt><label class="validation">{$Think.lang.admin_mallvouchertemplate_eachlimit}{$Think.lang.ds_colon}</label></dt>
  83. <dd>
  84. <input class="w400 text" name="mallvouchertemplate_eachlimit" placeholder="设置为0则表示没有限制" type="text" id="mallvouchertemplate_eachlimit" value="{$info.mallvouchertemplate_eachlimit}" />
  85. <span></span>
  86. </dd>
  87. </dl>
  88. {if $action eq 'add'}
  89. <dl>
  90. <dt></dt>
  91. <dd>
  92. <input type="submit" class="btn" value="{$Think.lang.ds_submit}">
  93. </dd>
  94. </dl>
  95. {/if}
  96. </div>
  97. </form>
  98. </div>
  99. <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.css">
  100. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.js"></script>
  101. <script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery-ui-timepicker/i18n/jquery-ui-timepicker-zh-CN.js"></script>
  102. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  103. <script>
  104. $(function() {
  105. gcategoryInit("gcategory");
  106. });
  107. </script>
  108. <script>
  109. //按钮先执行验证再提交表单
  110. $(function(){
  111. $('#mallvouchertemplate_startdate').datetimepicker({dateFormat: 'yy-mm-dd'});
  112. $('#mallvouchertemplate_enddate').datetimepicker({dateFormat: 'yy-mm-dd'});
  113. //页面输入内容验证
  114. $("#add_form").validate({
  115. errorPlacement: function(error, element){
  116. var error_td = element.parent('dd').children('span');
  117. error_td.append(error);
  118. },
  119. rules : {
  120. mallvouchertemplate_title: {
  121. required : true,
  122. maxlength : 255
  123. },
  124. mallvouchertemplate_price: {
  125. required : true,
  126. digits : true,
  127. min : 0
  128. },
  129. mallvouchertemplate_limit:{
  130. required : true,
  131. digits : true,
  132. min : 0
  133. },
  134. mallvouchertemplate_quantity:{
  135. required : true,
  136. digits : true,
  137. min : 0
  138. },
  139. mallvouchertemplate_eachlimit:{
  140. required : true,
  141. digits : true,
  142. min : 0
  143. }
  144. },
  145. messages : {
  146. mallvouchertemplate_title: {
  147. required : '{$Think.lang.admin_mallvouchertemplate_title_error}',
  148. maxlength : '{$Think.lang.admin_mallvouchertemplate_title_lengtherror}'
  149. },
  150. mallvouchertemplate_price: {
  151. required : '{$Think.lang.admin_mallvouchertemplate_price_error}',
  152. digits : '{$Think.lang.admin_mallvouchertemplate_price_error}',
  153. min : '{$Think.lang.admin_mallvouchertemplate_price_error}'
  154. },
  155. mallvouchertemplate_limit: {
  156. required : '{$Think.lang.admin_mallvouchertemplate_limit_error}',
  157. digits : '{$Think.lang.admin_mallvouchertemplate_limit_error}',
  158. min : '{$Think.lang.admin_mallvouchertemplate_limit_error}'
  159. },
  160. mallvouchertemplate_quantity: {
  161. required : '{$Think.lang.admin_mallvouchertemplate_quantity_error}',
  162. digits : '{$Think.lang.admin_mallvouchertemplate_quantity_error}',
  163. min : '{$Think.lang.admin_mallvouchertemplate_quantity_error}'
  164. },
  165. mallvouchertemplate_eachlimit: {
  166. required : '{$Think.lang.admin_mallvouchertemplate_quantity_error}',
  167. digits : '{$Think.lang.admin_mallvouchertemplate_quantity_error}',
  168. min : '{$Think.lang.admin_mallvouchertemplate_quantity_error}'
  169. }
  170. }
  171. });
  172. });
  173. </script>