edit.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. <input type="hidden" class="form-control" name="nums" value="{$info.nums|default=''}">
  65. <div class="form-group">
  66. <label class="col-sm-2 control-label">单位<span class="text-danger">*</span></label>
  67. <div class="col-sm-6">
  68. <select name="unit_id" class="form-control">
  69. <option value="">选择单位</option>
  70. {volist name="unit" id="v"}
  71. <option value="{$v.id}">{$v.title}</option>
  72. {/volist}
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="col-sm-2 control-label">原值<span class="text-danger">*</span></label>
  78. <div class="col-sm-6">
  79. <input type="number" class="form-control" name="price" value="{$info.price|default=''}">
  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. <input type="text" class="form-control" name="brand" value="{$info.brand|default=''}">
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <label class="col-sm-2 control-label">购买日期<span class="text-danger">*</span></label>
  90. <div class="col-sm-6">
  91. <input class="form-control" id="buyTime" readonly placeholder="开始时间" name="buy_time" value="{$info['buy_time']|default=''}" >
  92. </div>
  93. </div>
  94. <div class="form-group">
  95. <label class="col-sm-2 control-label">存放地点</label>
  96. <div class="col-sm-6">
  97. <input type="text" class="form-control" name="address" value="{$info.address|default=''}">
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-sm-2 control-label">资产用途</label>
  102. <div class="col-sm-6">
  103. <input type="text" class="form-control" name="used" value="{$info.used|default=''}">
  104. </div>
  105. </div>
  106. <div class="form-group">
  107. <label class="col-sm-2 control-label">是否打印标签</label>
  108. <div class="col-sm-6">
  109. <label class="cr-inline">
  110. <input type="radio" value="1" name="print">是&nbsp;&nbsp;
  111. </label>
  112. <label class="cr-inline">
  113. <input type="radio" value="0" name="print">否
  114. </label>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <label class="col-sm-2 control-label">备注1</label>
  119. <div class="col-sm-6">
  120. <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
  121. </div>
  122. </div>
  123. <div class="form-group">
  124. <label class="col-sm-2 control-label">备注2</label>
  125. <div class="col-sm-6">
  126. <input type="text" class="form-control" name="remark2" value="{$info.remark2|default=''}">
  127. </div>
  128. </div>
  129. <div class="form-group">
  130. <label class="col-sm-2 control-label">备注3</label>
  131. <div class="col-sm-6">
  132. <input type="text" class="form-control" name="remark3" value="{$info.remark3|default=''}">
  133. </div>
  134. </div>
  135. <div class="form-group">
  136. <label class="col-sm-2 control-label">备注4</label>
  137. <div class="col-sm-6">
  138. <input type="text" class="form-control" name="remark4" value="{$info.remark4|default=''}">
  139. </div>
  140. </div>
  141. <div class="form-group">
  142. <label class="col-sm-2 control-label">备注5</label>
  143. <div class="col-sm-6">
  144. <input type="text" class="form-control" name="remark5" value="{$info.remark5|default=''}">
  145. </div>
  146. </div>
  147. <div class="hr-line-dashed"></div>
  148. <div class="form-group">
  149. <div class="col-sm-6 col-sm-offset-2">
  150. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确 定</button>
  151. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  152. </div>
  153. </div>
  154. </form>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. {/block}
  160. {block name="script"}
  161. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  162. <script>
  163. laydate.render({
  164. elem: '#buyTime',
  165. trigger: 'click' ,
  166. theme: '#f99c34'
  167. });
  168. $(document).ready(function(){
  169. formSetValue("print", {$info.print|default=0});
  170. formSetValue("class_id", {$info.class_id|default=''});
  171. formSetValue("add_id", {$info.add_id|default=''});
  172. formSetValue("unit_id", {$info.unit_id|default=''});
  173. });
  174. var tree = {:json_encode($tree)};
  175. var info = {:json_encode($info)};
  176. new Vue({
  177. el: '#vueapp',
  178. data: function() {
  179. return {
  180. list :tree,
  181. cateId :info.cate_id,
  182. }
  183. },
  184. watch: {
  185. cateId: function (newtype, oldtype) {
  186. $('#cateId').val(newtype);
  187. },
  188. }
  189. })
  190. </script>
  191. {/block}