add.html 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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('index')}">-->
  10. <!--返回上一页-->
  11. <!--</a>-->
  12. <!--</div>-->
  13. <!--</div>-->
  14. <div class="ibox-content">
  15. <form method="post" action="{:url('add')}" class="form-horizontal">
  16. <div class="form-group">
  17. <label class="col-sm-2 control-label">备注</label>
  18. <div class="col-sm-8">
  19. <textarea name="remark" class="form-control" id="remark" cols="30" rows="5">{$info.remark|default=''}</textarea>
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-sm-2 control-label">选择盘库物品<span class="text-danger">*</span></label>
  24. <div class="col-sm-8">
  25. <a url="{:url('CompanyGoods/selectGoods')}" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
  26. <table class="table table-striped table-bordered">
  27. <thead>
  28. <tr>
  29. <th>名称</th>
  30. <th>品牌</th>
  31. <th>规格</th>
  32. <th>类型</th>
  33. <th>单价</th>
  34. <th>数量</th>
  35. </tr>
  36. </thead>
  37. <tbody class="layer-photos" id="layer-photos">
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <div class="hr-line-dashed"></div>
  43. <div class="form-group">
  44. <div class="col-sm-6 col-sm-offset-2">
  45. <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
  46. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. {/block}
  55. {block name="script"}
  56. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  57. <script>
  58. laydate.render({
  59. elem: '#buy_time',
  60. trigger: 'click' ,
  61. theme:'#284a94'
  62. });
  63. $(document).ready(function(){
  64. localStorage.removeItem("mateapply");
  65. localStorage.removeItem("mateapplyids");
  66. });
  67. var lists = [];
  68. function formatList() {
  69. var str = '';
  70. let ids = [];
  71. for (let o in lists){
  72. ids.push(lists[o].id);
  73. str += '<tr>';
  74. str += '<td><input type="hidden" name="goods[]" value="'+lists[o].id+'">'+lists[o].title+'</td>';
  75. str += '<td>'+lists[o].brand+'</td>';
  76. str += '<td>'+lists[o].spec+'</td>';
  77. str += '<td>'+lists[o].type+'</td>';
  78. str += '<td>'+lists[o].price+'</td>';
  79. str += '<td>'+lists[o].nums+'</td>';
  80. str += '</tr>';
  81. }
  82. $('#layer-photos').html(str);
  83. if(ids.length > 0){
  84. localStorage.setItem("mateapply", JSON.stringify(lists));
  85. localStorage.setItem("mateapplyids", JSON.stringify(ids));
  86. }else{
  87. localStorage.removeItem("mateapply");
  88. localStorage.removeItem("mateapplyids");
  89. }
  90. console.log(keyword);
  91. }
  92. </script>
  93. {/block}