add.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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">送修单位</label>
  37. <div class="col-sm-6">
  38. <input type="text" class="form-control" name="company" value="{$info.company|default=''}">
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <label class="col-sm-2 control-label">维修费用</label>
  43. <div class="col-sm-6">
  44. <input type="number" class="form-control" name="money" value="{$info.money|default=''}">
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <label class="col-sm-2 control-label">单位联系人</label>
  49. <div class="col-sm-6">
  50. <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">单位联系电话</label>
  55. <div class="col-sm-6">
  56. <input type="number" class="form-control" name="phone" value="{$info.phone|default=''}">
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-sm-2 control-label">单位地址</label>
  61. <div class="col-sm-6">
  62. <input type="text" class="form-control" name="address" value="{$info.address|default=''}">
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label class="col-sm-2 control-label">故障原因</label>
  67. <div class="col-sm-6">
  68. <input type="text" class="form-control" name="reason" value="{$info.reason|default=''}">
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label class="col-sm-2 control-label">维修方法</label>
  73. <div class="col-sm-6">
  74. <input type="text" class="form-control" name="method" value="{$info.method|default=''}">
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <label class="col-sm-2 control-label">更换配件</label>
  79. <div class="col-sm-6">
  80. <input type="text" class="form-control" name="accessories" value="{$info.accessories|default=''}">
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <label class="col-sm-2 control-label">备注</label>
  85. <div class="col-sm-6">
  86. <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
  87. </div>
  88. </div>
  89. <div class="form-group" id="goods" >
  90. <label class="col-sm-2 control-label">维修物品<span class="text-danger">*</span></label>
  91. <div class="col-sm-8">
  92. <a url="{:url('selectGoods')}" id="gUrl" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
  93. <table class="table table-striped table-bordered">
  94. <thead>
  95. <tr>
  96. <th>编号</th>
  97. <th>名称</th>
  98. <th>规格</th>
  99. <th>分类</th>
  100. <th>价格</th>
  101. <th>数量</th>
  102. <th>操作</th>
  103. </tr>
  104. </thead>
  105. <tbody class="layer-photos" id="layer-photos">
  106. </tbody>
  107. </table>
  108. </div>
  109. </div>
  110. <div class="col-sm-12">
  111. <div class="hr-line-dashed">
  112. </div>
  113. </div>
  114. <div class="form-group">
  115. <div class="col-sm-6 col-sm-offset-2">
  116. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确定</button>
  117. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  118. </div>
  119. </div>
  120. </form>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. {/block}
  126. {block name="script"}
  127. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  128. <script>
  129. function setGoods(id) {
  130. // if(id !=''){
  131. // $("#goods").css('display','block')
  132. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id='+id);
  133. //
  134. // }else{
  135. // $("#goods").css('display','none')
  136. // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id=0');
  137. //
  138. // }
  139. }
  140. $(function () {
  141. laydate.render({
  142. elem: '#delivery_time',
  143. trigger: 'click',
  144. theme: '#6eb7ff',
  145. type: 'date',
  146. format:'yyyy-MM-dd',
  147. });
  148. });
  149. var lists = [];
  150. function ddl(id) {
  151. var newArr = [];
  152. for (let o in lists){
  153. if(lists[o].id!=id){
  154. newArr.push(lists[o]);
  155. }
  156. }
  157. lists = newArr;
  158. formatList();
  159. }
  160. $(document).ready(function(){
  161. localStorage.removeItem("mateapply");
  162. localStorage.removeItem("mateapplyids");
  163. formatList();
  164. });
  165. function formatList() {
  166. var str = '';
  167. let ids = [];
  168. for (let o in lists){
  169. ids.push(lists[o].id);
  170. str += '<tr>';
  171. str += '<td>'+lists[o].sn+'</td>';
  172. str += '<td>'+lists[o].title+'</td>';
  173. str += '<td>'+lists[o].spec+'</td>';
  174. str += '<td>'+lists[o].cateName+'</td>';
  175. str += '<td>'+lists[o].price+'</td>';
  176. str += '<td>'+lists[o].nums+'</td>';
  177. str += '<input type="hidden" value="'+lists[o].id+'" class="form-control input-sm" name="items['+lists[o].id+'][id]"></td>';
  178. str += '<td><button onclick="ddl('+lists[o].id+')" type="button">删除</button></td>';
  179. str += '</tr>';
  180. }
  181. $('#layer-photos').html(str);
  182. if(ids.length > 0){
  183. localStorage.setItem("mateapply", JSON.stringify(lists));
  184. localStorage.setItem("mateapplyids", JSON.stringify(ids));
  185. }else{
  186. localStorage.removeItem("mateapply");
  187. localStorage.removeItem("mateapplyids");
  188. }
  189. }
  190. </script>
  191. {/block}