add.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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-title">
  7. <h5>添加</h5>
  8. <div class="ibox-tools">
  9. <a class="toback" href="{:url('index')}">
  10. 返回上一页
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <form method="post" action="{:url('add')}" class="form-horizontal">
  16. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  17. <div class="form-group">
  18. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  19. <div class="col-sm-6">
  20. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-2 control-label">规格</label>
  25. <div class="col-sm-6">
  26. <input type="text" class="form-control" name="spec" value="{$info.spec|default=''}">
  27. </div>
  28. </div>
  29. <div class="form-group" id="vueapp">
  30. <label class="col-sm-2 control-label">分类<span class="text-danger">*</span></label>
  31. <div class="col-sm-6">
  32. <input type="hidden" name="cate_id" id="cateId" value="{$info['cate_id']|default=''}">
  33. <el-cascader
  34. style="width: 100%"
  35. v-model="cateId"
  36. :options="list"
  37. :props="{ checkStrictly: true }"
  38. clearable>
  39. </el-cascader>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="col-sm-2 control-label">类别<span class="text-danger">*</span></label>
  44. <div class="col-sm-6">
  45. <select name="class_id" class="form-control">
  46. <option value="">选择类别</option>
  47. {volist name="class" id="v"}
  48. <option value="{$v.id}">{$v.title}</option>
  49. {/volist}
  50. </select>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">增加方式<span class="text-danger">*</span></label>
  55. <div class="col-sm-6">
  56. <select name="add_id" class="form-control">
  57. <option value="">选择增加方式</option>
  58. {volist name="add" id="v"}
  59. <option value="{$v.id}">{$v.title}</option>
  60. {/volist}
  61. </select>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label">数量<span class="text-danger">*</span></label>
  66. <div class="col-sm-6">
  67. <input type="number" class="form-control" name="nums" value="{$info.nums|default=''}">
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <label class="col-sm-2 control-label">单位<span class="text-danger">*</span></label>
  72. <div class="col-sm-6">
  73. <select name="unit_id" class="form-control">
  74. <option value="">选择单位</option>
  75. {volist name="unit" id="v"}
  76. <option value="{$v.id}">{$v.title}</option>
  77. {/volist}
  78. </select>
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <label class="col-sm-2 control-label">原值<span class="text-danger">*</span></label>
  83. <div class="col-sm-6">
  84. <input type="number" class="form-control" name="price" value="{$info.price|default=''}">
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label class="col-sm-2 control-label">品牌</label>
  89. <div class="col-sm-6">
  90. <input type="text" class="form-control" name="brand" value="{$info.brand|default=''}">
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label class="col-sm-2 control-label">购买日期<span class="text-danger">*</span></label>
  95. <div class="col-sm-6">
  96. <input class="form-control" id="buyTime" readonly placeholder="开始时间" name="buy_time" value="{$info['buy_time']|default=''}" >
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <label class="col-sm-2 control-label">存放地点</label>
  101. <div class="col-sm-6">
  102. <input type="text" class="form-control" name="address" value="{$info.address|default=''}">
  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. <input type="text" class="form-control" name="used" value="{$info.used|default=''}">
  109. </div>
  110. </div>
  111. <div class="form-group">
  112. <label class="col-sm-2 control-label">是否打印标签</label>
  113. <div class="col-sm-6">
  114. <label class="cr-inline">
  115. <input type="radio" value="1" name="print">是&nbsp;&nbsp;
  116. </label>
  117. <label class="cr-inline">
  118. <input type="radio" value="0" name="print">否
  119. </label>
  120. </div>
  121. </div>
  122. <div class="form-group">
  123. <label class="col-sm-2 control-label">备注1</label>
  124. <div class="col-sm-6">
  125. <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
  126. </div>
  127. </div>
  128. <div class="form-group">
  129. <label class="col-sm-2 control-label">备注2</label>
  130. <div class="col-sm-6">
  131. <input type="text" class="form-control" name="remark2" value="{$info.remark2|default=''}">
  132. </div>
  133. </div>
  134. <div class="form-group">
  135. <label class="col-sm-2 control-label">备注3</label>
  136. <div class="col-sm-6">
  137. <input type="text" class="form-control" name="remark3" value="{$info.remark3|default=''}">
  138. </div>
  139. </div>
  140. <div class="form-group">
  141. <label class="col-sm-2 control-label">备注4</label>
  142. <div class="col-sm-6">
  143. <input type="text" class="form-control" name="remark4" value="{$info.remark4|default=''}">
  144. </div>
  145. </div>
  146. <div class="form-group">
  147. <label class="col-sm-2 control-label">备注5</label>
  148. <div class="col-sm-6">
  149. <input type="text" class="form-control" name="remark5" value="{$info.remark5|default=''}">
  150. </div>
  151. </div>
  152. <div class="hr-line-dashed"></div>
  153. <div class="form-group">
  154. <div class="col-sm-6 col-sm-offset-2">
  155. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确 定</button>
  156. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  157. </div>
  158. </div>
  159. </form>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. {/block}
  165. {block name="script"}
  166. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  167. <script>
  168. laydate.render({
  169. elem: '#buyTime',
  170. trigger: 'click' ,
  171. theme: '#f99c34'
  172. });
  173. $(document).ready(function(){
  174. formSetValue("print", {$info.print|default=0});
  175. formSetValue("class_id", {$info.class_id|default=''});
  176. formSetValue("add_id", {$info.add_id|default=''});
  177. formSetValue("unit_id", {$info.unit_id|default=''});
  178. });
  179. var tree = {:json_encode($tree)};
  180. new Vue({
  181. el: '#vueapp',
  182. data: function() {
  183. return {
  184. list :tree,
  185. cateId :'',
  186. }
  187. },
  188. watch: {
  189. cateId: function (newtype, oldtype) {
  190. $('#cateId').val(newtype);
  191. },
  192. }
  193. })
  194. </script>
  195. {/block}