73 lines
2.5 KiB
HTML
73 lines
2.5 KiB
HTML
<form class="layui-form eject-layuiBox" data-action="/goods/addReceipt">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">商品</label>
|
|
<div class="layui-input-block">
|
|
<div id="goods"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">进货日期</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="bought_at" class="layui-input" id="bought_at" placeholder="yyyy-MM-dd">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">大包数量</label>
|
|
<div class="layui-input-block">
|
|
<input class="layui-input" type="number" name="num" maxlength="60" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">进货总价</label>
|
|
<div class="layui-input-block">
|
|
<input class="layui-input" type="number" name="total_price" maxlength="60" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">备注</label>
|
|
<div class="layui-input-block">
|
|
<input class="layui-input" type="text" name="remark" maxlength="200" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-input-block">
|
|
<button type="button" class="layui-btn layui-btn-sm" lay-submit lay-filter="submitAll">保存</button>
|
|
</div>
|
|
</form>
|
|
<script src="/js/xm-select.js"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
var laydate = layui.laydate;
|
|
|
|
laydate.render({
|
|
elem: '#bought_at'
|
|
});
|
|
|
|
var book = xmSelect.render({
|
|
el: '#goods',
|
|
filterable : true, //开启搜索
|
|
remoteSearch: true,
|
|
radio : true, //开启单选模式
|
|
clickClose : true, //是否点击选项后自动关闭下拉框
|
|
name: 'goods_id', //表单提交时的name
|
|
paging: true,
|
|
data : [],
|
|
remoteMethod: function(val, cb, show){
|
|
$.get('/goods/apiGetList', {'name':val, 'size': 50}, function(data){
|
|
var goodsList = [];
|
|
data.goodsList.data.forEach(element => {
|
|
goodsList.push({
|
|
name: element.name,
|
|
value: element.id
|
|
})
|
|
});
|
|
cb(goodsList);
|
|
})
|
|
}
|
|
});
|
|
});
|
|
</script> |