add.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .rr{
  5. padding-right: 10px;
  6. }
  7. .layui-laydate-content>.layui-laydate-list {
  8. padding-bottom: 0px;
  9. overflow: hidden;
  10. }
  11. .layui-laydate-content>.layui-laydate-list>li{
  12. width:50%
  13. }
  14. </style>
  15. <div class="row">
  16. <div class="col-sm-12">
  17. <div class="ibox float-e-margins">
  18. <div class="ibox-title">
  19. <h5>创建退库单</h5>
  20. <div class="ibox-tools">
  21. <a class="toback" href="{:url('index')}">
  22. 返回上一页
  23. </a>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <form method="post" action="{:url('add')}" class="form-horizontal">
  28. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">经办人<span class="text-danger">*</span></label>
  31. <div class="col-sm-6">
  32. {:widget_view('common/user-group-select',['name'=>'agent_user_id','multi'=>1,'lists'=>$userList, 'val' => '','msg'=>'','send_user_num'=>1])}
  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-6">
  38. <select name="with_dep_id" class="form-control">
  39. <option value="">选择部门</option>
  40. {volist name="$depList" id="v"}
  41. <option value="{$v.id}">{$v.title}</option>
  42. {/volist}
  43. </select>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label">存放地点</label>
  48. <div class="col-sm-6">
  49. <input type="text" class="form-control" name="address" value="{$info.address|default=''}">
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-2 control-label">备注</label>
  54. <div class="col-sm-6">
  55. <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
  56. </div>
  57. </div>
  58. <div class="form-group" id="goods" >
  59. <label class="col-sm-2 control-label">退库物品<span class="text-danger">*</span></label>
  60. <div class="col-sm-8">
  61. <a url="{:url('selectGoods')}" id="gUrl" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
  62. <table class="table table-striped table-bordered">
  63. <thead>
  64. <tr>
  65. <th>编号</th>
  66. <th>名称</th>
  67. <th>规格</th>
  68. <th>分类</th>
  69. <th>价格</th>
  70. <th>数量</th>
  71. <th>操作</th>
  72. </tr>
  73. </thead>
  74. <tbody class="layer-photos" id="layer-photos">
  75. </tbody>
  76. </table>
  77. </div>
  78. </div>
  79. <div class="col-sm-12">
  80. <div class="hr-line-dashed">
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <div class="col-sm-6 col-sm-offset-2">
  85. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确定</button>
  86. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  87. </div>
  88. </div>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. {/block}
  95. {block name="script"}
  96. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  97. <script>
  98. function setGoods(id) {
  99. // if(id !=''){
  100. // $("#goods").css('display','block')
  101. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id='+id);
  102. //
  103. // }else{
  104. // $("#goods").css('display','none')
  105. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id=0');
  106. //
  107. // }
  108. }
  109. $(function () {
  110. laydate.render({
  111. elem: '#delivery_time',
  112. trigger: 'click',
  113. theme: '#6eb7ff',
  114. type: 'date',
  115. format:'yyyy-MM-dd',
  116. });
  117. });
  118. var lists = [];
  119. function ddl(id) {
  120. var newArr = [];
  121. for (let o in lists){
  122. if(lists[o].id!=id){
  123. newArr.push(lists[o]);
  124. }
  125. }
  126. lists = newArr;
  127. formatList();
  128. }
  129. $(document).ready(function(){
  130. localStorage.removeItem("mateapply");
  131. localStorage.removeItem("mateapplyids");
  132. formatList();
  133. });
  134. function formatList() {
  135. var str = '';
  136. let ids = [];
  137. for (let o in lists){
  138. ids.push(lists[o].id);
  139. str += '<tr>';
  140. str += '<td>'+lists[o].sn+'</td>';
  141. str += '<td>'+lists[o].title+'</td>';
  142. str += '<td>'+lists[o].spec+'</td>';
  143. str += '<td>'+lists[o].cateName+'</td>';
  144. str += '<td>'+lists[o].price+'</td>';
  145. str += '<td>'+lists[o].nums+'</td>';
  146. str += '<input type="hidden" value="'+lists[o].id+'" class="form-control input-sm" name="items['+lists[o].id+'][id]"></td>';
  147. str += '<td><button onclick="ddl('+lists[o].id+')" type="button">删除</button></td>';
  148. str += '</tr>';
  149. }
  150. $('#layer-photos').html(str);
  151. if(ids.length > 0){
  152. localStorage.setItem("mateapply", JSON.stringify(lists));
  153. localStorage.setItem("mateapplyids", JSON.stringify(ids));
  154. }else{
  155. localStorage.removeItem("mateapply");
  156. localStorage.removeItem("mateapplyids");
  157. }
  158. }
  159. </script>
  160. {/block}