add.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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>{$meta_title}</h5>-->
  8. <!--<div class="ibox-tools">-->
  9. <!--<a class="toback" href="{:url('back')}">-->
  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="type" value="2">
  17. <div class="form-group">
  18. <label class="col-sm-2 control-label">出库人<span class="text-danger">*</span></label>
  19. <div class="col-sm-8">
  20. <input type="text" class="form-control" name="name" value="{$info.title|default=''}">
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-2 control-label">联系电话<span class="text-danger">*</span></label>
  25. <div class="col-sm-8">
  26. <input type="text" class="form-control" name="phone" value="{$info.unit|default=''}">
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">备注</label>
  31. <div class="col-sm-8">
  32. <textarea name="remark" class="form-control" id="remark" cols="30" rows="5">{$info.remark|default=''}</textarea>
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label">选择物品<span class="text-danger">*</span></label>
  37. <div class="col-sm-8">
  38. <a url="{:url('CompanyGoods/selectGoods')}" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
  39. <table class="table table-striped table-bordered">
  40. <thead>
  41. <tr>
  42. <th style="width: 120px">数量</th>
  43. <th>名称</th>
  44. <th>剩余数量</th>
  45. <th>品牌</th>
  46. <th>规格</th>
  47. <th>类型</th>
  48. <th>购买时间</th>
  49. </tr>
  50. </thead>
  51. <tbody class="layer-photos" id="layer-photos">
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <div class="hr-line-dashed"></div>
  57. <div class="form-group">
  58. <div class="col-sm-6 col-sm-offset-2">
  59. <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
  60. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  61. </div>
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. {/block}
  69. {block name="script"}
  70. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  71. <script>
  72. laydate.render({
  73. elem: '#buy_time',
  74. trigger: 'click' ,
  75. theme:'#284a94'
  76. });
  77. $(document).ready(function(){
  78. formSetValue("enable", {$info.enable|default=1});
  79. localStorage.removeItem("mateapply");
  80. localStorage.removeItem("mateapplyids");
  81. });
  82. var lists = [];
  83. function formatList() {
  84. var str = '';
  85. let ids = [];
  86. for (let o in lists){
  87. ids.push(lists[o].id);
  88. str += '<tr>';
  89. str += '<td><input type="number" class="form-control input-sm" name="goods['+lists[o].id+'][nums]"></td>';
  90. str += '<td>'+lists[o].title+'</td>';
  91. str += '<td>'+lists[o].nums+'</td>';
  92. str += '<td>'+lists[o].brand+'</td>';
  93. str += '<td>'+lists[o].spec+'</td>';
  94. str += '<td>'+lists[o].type+'</td>';
  95. str += '<td>'+lists[o].buy_time+'</td>';
  96. str += '</tr>';
  97. }
  98. $('#layer-photos').html(str);
  99. if(ids.length > 0){
  100. localStorage.setItem("mateapply", JSON.stringify(lists));
  101. localStorage.setItem("mateapplyids", JSON.stringify(ids));
  102. }else{
  103. localStorage.removeItem("mateapply");
  104. localStorage.removeItem("mateapplyids");
  105. }
  106. console.log(keyword);
  107. }
  108. </script>
  109. {/block}