123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .rr{
- padding-right: 10px;
- }
- .layui-laydate-content>.layui-laydate-list {
- padding-bottom: 0px;
- overflow: hidden;
- }
- .layui-laydate-content>.layui-laydate-list>li{
- width:50%
- }
- </style>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>创建领用单</h5>
- <div class="ibox-tools">
- <a class="toback" href="{:url('index')}">
- 返回上一页
- </a>
- </div>
- </div>
- <div class="ibox-content">
- <form method="post" action="{:url('add')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$info['id']|default='0'}">
- <div class="form-group">
- <label class="col-sm-2 control-label">领用人员<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/user-group-select',['name'=>'receive_user_id','multi'=>1,'lists'=>$userList, 'val' => '','msg'=>'','send_user_num'=>1])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">存放地点</label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="address" value="{$info.address|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">资产用途</label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="used" value="{$info.used|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">备注</label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="remark" value="{$info.remark|default=''}">
- </div>
- </div>
- <div class="form-group" id="goods" >
- <label class="col-sm-2 control-label">领用物品<span class="text-danger">*</span></label>
- <div class="col-sm-8">
- <a url="{:url('selectGoods')}" id="gUrl" href="javascript:;" data-title="选择物品" onclick="layer_open(this,0)" class="btn btn-primary">选择物品</a>
- <table class="table table-striped table-bordered">
- <thead>
- <tr>
- <th>编号</th>
- <th>名称</th>
- <th>规格</th>
- <th>分类</th>
- <th>价格</th>
- <th>数量</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="layer-photos" id="layer-photos">
- </tbody>
- </table>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="hr-line-dashed">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确定</button>
- <a href="{:url('index')}" class="btn btn-default">取 消</a>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- function setGoods(id) {
- // if(id !=''){
- // $("#goods").css('display','block')
- // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id='+id);
- //
- // }else{
- // $("#goods").css('display','none')
- // $("#gUrl").attr('url','/admin/dispose/selectgoods.html?warehouse_id=0');
- //
- // }
- }
- $(function () {
- laydate.render({
- elem: '#delivery_time',
- trigger: 'click',
- theme: '#6eb7ff',
- type: 'date',
- format:'yyyy-MM-dd',
- });
- });
- var lists = [];
- function ddl(id) {
- var newArr = [];
- for (let o in lists){
- if(lists[o].id!=id){
- newArr.push(lists[o]);
- }
- }
- lists = newArr;
- formatList();
- }
- $(document).ready(function(){
- localStorage.removeItem("mateapply");
- localStorage.removeItem("mateapplyids");
- formatList();
- });
- function formatList() {
- var str = '';
- let ids = [];
- for (let o in lists){
- ids.push(lists[o].id);
- str += '<tr>';
- str += '<td>'+lists[o].sn+'</td>';
- str += '<td>'+lists[o].title+'</td>';
- str += '<td>'+lists[o].spec+'</td>';
- str += '<td>'+lists[o].cateName+'</td>';
- str += '<td>'+lists[o].price+'</td>';
- str += '<td>'+lists[o].nums+'</td>';
- str += '<input type="hidden" value="'+lists[o].id+'" class="form-control input-sm" name="items['+lists[o].id+'][id]"></td>';
- str += '<td><button onclick="ddl('+lists[o].id+')" type="button">删除</button></td>';
- str += '</tr>';
- }
- $('#layer-photos').html(str);
- if(ids.length > 0){
- localStorage.setItem("mateapply", JSON.stringify(lists));
- localStorage.setItem("mateapplyids", JSON.stringify(ids));
- }else{
- localStorage.removeItem("mateapply");
- localStorage.removeItem("mateapplyids");
- }
- }
- </script>
- {/block}
|