<!--{include file="<!--{$salepath}-->public/header.tpl"}-->
	<body>
		<form class="layui-form column-content-detail">
					<div class="layui-tab">
						<div class="layui-tab-content">
							<div class="layui-tab-item layui-show">
                            	<div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label"><span style="color: red;">*</span>编号：</label>
                                                    <div class="layui-input-inline">
                                            <input type="text" name="purchase_name" required lay-verify="required" placeholder="请输入编号" autocomplete="off" class="layui-input" value="<!--{$number}-->">
                                                    </div>
                                                  </div>
                                    <div class="layui-inline">
                                            <label class="layui-form-label"><span style="color: red;">*</span>供应商：</label>
                                            <div class="layui-input-inline">
                                                <select name="supplier_id" lay-verify="required">
                                                    <option value="">请选择供应商</option>
                                                    <!--{foreach $gys as $parent}-->
                                                    <option value="<!--{$parent.id}-->"><!--{$parent.supplier_name}--></option>
                                                    <!--{/foreach}-->
                                                </select>
                                            </div>
                                    </div>    
                                    <div class="layui-inline">
                                        <label class="layui-form-label"><span style="color: red;">*</span>交货日期</label>
                                        <div class="layui-input-inline">
                                          <input type="text" name="delivery_time" class="layui-input" id="test1" placeholder="yyyy-MM-dd">
                                        </div>
                                    </div>
								</div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
            							<label class="layui-form-label">产品录入：</label>
            							<div class="layui-input-inline">
                                            <select name="product_id"  lay-verify="required">
                                                <option value="">请选择</option>
                                                <!--{foreach $product as $parent}-->
                                                <option value="<!--{$parent.productid}-->"><!--{$parent.productname}--></option>
                                                <!--{/foreach}-->
                                            </select>
            							</div>
                                    </div>
                                    <div class="layui-inline">
                                                    <label class="layui-form-label"><span style="color: red;">*</span>数量：</label>
                                                    <div class="layui-input-inline">
                                            <input type="text" name="pruchase_number" required lay-verify="required" placeholder="请输入数量" autocomplete="off" class="layui-input" >
                                                    </div>
                                                  </div>

								</div>  
                                <input type="hidden" name="opmode" value="add">

                                <div class="layui-form-item">
									
									<div class="layui-input-block" style="overflow: auto;padding: 0px;">
                        				<table class="layui-table" lay-even lay-skin="nob" style='margin: 0; '>
                                			<thead class="table_new">
                                				<tr>
                                				
                                					<th>产品编号</th>
                                					<th>产品名称</th>
                                					<th>现有库存</th>
                                					<th>采购数量</th>
                                					<th>商品价/采购价</th>
                                				</tr>
                                			</thead>
                                			<tbody>
                                				<tr>

                                				<!-- 	<td>BQ201901170001</td>
                                					<td>采购入库单</td>
                                					<td>配件公司</td>
                                					<td>￥ 0.0000</td>
                                                    <td>管理员</td> -->
                                				</tr>
                                			</tbody>
                                		</table>
  									</div>
								</div>                                                                                      
                                <div class="layui-form-item">
									<label class="layui-form-label">备注：</label>
									<div class="layui-input-block">
										<textarea placeholder="请输入备注" class="layui-textarea" name="remarks"><!--{$vo.kehu_desc}--></textarea>
									</div>
								</div>                                  
							</div>
						</div>
					</div>
					<div class="layui-form-item" style="padding-left: 10px;">
						<div class="layui-input-block">
							<button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">立即提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
	
		
		<script src="<!--{$salepath}-->static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="<!--{$salepath}-->static/js/common.js" type="text/javascript" charset="utf-8"></script>
                <script src="<!--{$salepath}-->static/js/jquery-3.2.1.js" type="text/javascript" charset="utf-8"></script>

                 <script type="text/javascript">
          			layui.use(['form', 'layedit', 'laydate'], function() {
                    var form = layui.form(),
					layer = layui.layer;
                    form.on('submit(formDemo)', function(data) {   
                                $.ajax({
                                    type: 'POST',
                                    url:"sale.php?c=Purchase&a=save",
                                    async:true,
                                    data:data.field,
                                    dataType : "json",
                                    success:function(data){
                                          if(data.code=='1'){                                                           
                                                layer.msg(data.msg);
                                                setTimeout(function(){
                                                        parent.location.reload(true);
                                                        layer.closeAll();
                                                  //  document.frames("iframe7").location.reload(true); 
                                                  //  parent.location.reload(true);
                                                   // window.frames["iframe7"].location.reload();
                                                  //     layer.closeAll();
                                                }, 1500);
                                          }
                                          return false;
                                    },
                                    error:function(e){
                                           return false;
                                    }
                                });

                            return false;
                    });
                                     
			});
			
		</script>
        <script>
                //执行一个laydate实例
                laydate.render({
                elem: '#test1' //指定元素
                });
        </script>
	</body>
</html>
