add.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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="way_id" class="form-control">
  39. <option value="">选择处置方式</option>
  40. {volist name="$wayList" 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="result" value="{$info.result|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="reason" value="{$info.reason|default=''}">
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-sm-2 control-label">备注</label>
  60. <div class="col-sm-6">
  61. <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
  62. </div>
  63. </div>
  64. <div class="form-group" id="goods" >
  65. <label class="col-sm-2 control-label">处置物品<span class="text-danger">*</span></label>
  66. <div class="col-sm-8">
  67. <a url="{:url('selectGoods')}" id="gUrl" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
  68. <table class="table table-striped table-bordered">
  69. <thead>
  70. <tr>
  71. <th>编号</th>
  72. <th>名称</th>
  73. <th>规格</th>
  74. <th>分类</th>
  75. <th>价格</th>
  76. <th>数量</th>
  77. <th>操作</th>
  78. </tr>
  79. </thead>
  80. <tbody class="layer-photos" id="layer-photos">
  81. </tbody>
  82. </table>
  83. </div>
  84. </div>
  85. <div class="col-sm-12">
  86. <div class="hr-line-dashed">
  87. </div>
  88. </div>
  89. <div class="form-group">
  90. <div class="col-sm-6 col-sm-offset-2">
  91. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确定</button>
  92. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  93. </div>
  94. </div>
  95. </form>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. {/block}
  101. {block name="script"}
  102. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  103. <script>
  104. function setGoods(id) {
  105. // if(id !=''){
  106. // $("#goods").css('display','block')
  107. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id='+id);
  108. //
  109. // }else{
  110. // $("#goods").css('display','none')
  111. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id=0');
  112. //
  113. // }
  114. }
  115. $(function () {
  116. laydate.render({
  117. elem: '#delivery_time',
  118. trigger: 'click',
  119. theme: '#6eb7ff',
  120. type: 'date',
  121. format:'yyyy-MM-dd',
  122. });
  123. });
  124. var lists = [];
  125. function ddl(id) {
  126. var newArr = [];
  127. for (let o in lists){
  128. if(lists[o].id!=id){
  129. newArr.push(lists[o]);
  130. }
  131. }
  132. lists = newArr;
  133. formatList();
  134. }
  135. $(document).ready(function(){
  136. localStorage.removeItem("mateapply");
  137. localStorage.removeItem("mateapplyids");
  138. formatList();
  139. });
  140. function formatList() {
  141. var str = '';
  142. let ids = [];
  143. for (let o in lists){
  144. ids.push(lists[o].id);
  145. str += '<tr>';
  146. str += '<td>'+lists[o].sn+'</td>';
  147. str += '<td>'+lists[o].title+'</td>';
  148. str += '<td>'+lists[o].spec+'</td>';
  149. str += '<td>'+lists[o].cateName+'</td>';
  150. str += '<td>'+lists[o].price+'</td>';
  151. str += '<td>'+lists[o].nums+'</td>';
  152. str += '<input type="hidden" value="'+lists[o].id+'" class="form-control input-sm" name="items['+lists[o].id+'][id]"></td>';
  153. str += '<td><button onclick="ddl('+lists[o].id+')" type="button">删除</button></td>';
  154. str += '</tr>';
  155. }
  156. $('#layer-photos').html(str);
  157. if(ids.length > 0){
  158. localStorage.setItem("mateapply", JSON.stringify(lists));
  159. localStorage.setItem("mateapplyids", JSON.stringify(ids));
  160. }else{
  161. localStorage.removeItem("mateapply");
  162. localStorage.removeItem("mateapplyids");
  163. }
  164. }
  165. </script>
  166. {/block}