企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ {extend name="base" /} {block name="body"} <div class="layui-body"> <!--tab标签--> <div class="layui-tab layui-tab-brief"> <ul class="layui-tab-title"> <li class="{eq name='$Request.param.is_out' value=''}layui-this{/eq}"><a href="{:url('index')}">库存明细</a></li> <li class="{eq name='$Request.param.is_out' value='0'}layui-this{/eq}"><a href="/admin/stock/index/is_out/0.html">入库列表</a></li> <li class="{eq name='$Request.param.is_out' value='1'}layui-this{/eq}"><a href="/admin/stock/index/is_out/1.html">出库列表</a></li> <li class="{eq name='$Request.param.is_out' value='5'}layui-this{/eq}"><a href="/admin/stock/instock/is_out/5.html">配件入库</a></li> <li class="{eq name='$Request.param.is_out' value='6'}layui-this{/eq}"><a href="/admin/stock/outstock/is_out/6.html">配件出库</a></li> </ul> <!-- <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"> <legend>配件号</legend> </fieldset>--> <div class="layui-tab-content"> <div class="layui-tab-item layui-show"> </div></div> <div class="layui-tab-content"> <div class="layui-tab-item layui-show"> <form class="layui-form layui-form-pane" action="" style="margin-top: 50px;"> <div class="layui-form-item"> <label class="layui-form-label">配件号</label> <div class="layui-input-block"> <input type="text" name="number" name="province" lay-verify="number" autocomplete="off" placeholder="请输入入库配件号" class="layui-input province"> </div> </div> </form> <form class="instcokform" action="" style="margin-top: 50px;"> <table class="layui-table"> <thead> <tr> <th style="width: 30px;">ID</th> <th>配件名称</th> <th>配件号</th> <th>数量</th> <th>进货价</th> <th>备注</th> <th>操作</th> </tr> </thead> <tbody class="city"> </tbody> </table> </form> <xblock class="inbutton"> </xblock> </div> </div> </div> </div> {/block} {block name="js"} {/block} {block name="script"} <script> //根据配件号查询配件信息 //软删除信息 $("tbody").on("click",".deltypes",function(event) { $(this).parents('tr').remove(); }); function city() //市 { var provinceid = $('.province').val(); //省id $.post("{:url('api/parts/index')}", {provinceid: provinceid}, function(data) { var html; var html1; if (data.status){ //alert('111'); for (var i = 0; i<data.list.length; i++) { html+='<tr>'; html+='<td>'+data.list[i]['id']+'<input type="hidden" name="parts_id[]" value="'+data.list[i]['id']+'"></td>'; html+='<td>'+data.list[i]['title']+'</td>'; html+='<td>'+data.list[i]['number']+'</td>'; html+='<td><div class="layui-input-inline" style="width: 80px;"><input type="text" name="number[]" placeholder="" required lay-verify="required" class="layui-input"></div></td>'; html+='<td><div class="layui-input-inline" style="width: 80px;"><input type="text" name="price[]" placeholder="¥" required lay-verify="required" autocomplete="off" class="layui-input"></div></td>'; html+='<td><div class="layui-input-inline"><input required lay-verify="required" type="tel" name="remarks[]" autocomplete="off" class="layui-input"></div></td>'; html+='<td><a class="layui-btn layui-btn-danger layui-btn-mini deltypes">移除</a></td>'; html+='</tr>'; } html1 ='<button class="layui-btn" id="stocksave"><i class="layui-icon">&#xe67c;</i>全部提交</button>'; }else { //alert('000'); html='<tr><td colspan="7" style="border: none;">请输入正确的配件号</td></td>'; } $('.city').html(html); $('.inbutton').html(html1); }); //alert(provinceid); } //city(); //配件号的值改变,触发city()函数 $('.province').change(function(event) { //选择省 city(); //alert('测试'); }); //出入库更新处理 $(function() { /*******start*******/ $("#stocksave").on("click",function(){ $.ajax({ url:"{:url('stock/save2')}", data:$('.instcokform').serialize(), dataType: "json", type:'post', async: false, success:function(res) { console.log(res); if(res.status == 1) { layer.msg(res.message); } else { layer.alert(res.message); } } }) return false; }) /*******end*******/ }) </script> {/block} ~~~