You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< div class = "layuimini-main" >
< div class = "layui-form layuimini-form" lay-filter = "addBedForm" >
< div class = "layui-form-item" >
< label class = "layui-form-label required" > 床号< / label >
< div class = "layui-input-block" >
< input type = "text" id = "dormitoryId" name = "dormitoryId" >
< input type = "text" name = "bno" lay-verify = "required" lay-reqtext = "床号不能为空" placeholder = "请输入床号" value = "" class = "layui-input" >
< / div >
< / div >
< div class = "layui-form-item" >
< div class = "layui-input-block" >
< button class = "layui-btn layui-btn-normal" lay-submit lay-filter = "saveBtn" > 确认保存< / button >
< / div >
< / div >
< / div >
< / div >
< script >
layui . use ( [ 'form' , 'table' , 'axios' ] , function ( ) {
let form = layui . form ,
layer = layui . layer ,
axios = layui . axios ,
$ = layui . $ ;
/**
* 初始化表单,要加上,不然刷新部分组件可能会不加载
*/
form . render ( ) ;
// 当前弹出层, 防止ID被覆盖
let parentIndex = layer . index ;
//监听提交
form . on ( 'submit(saveBtn)' , function ( data ) {
axios . post ( 'bed/create' , data . field ) . then ( function ( response ) {
if ( response . code == 200 ) {
layer . msg ( response . msg ) ;
}
layer . close ( parentIndex ) ;
} ) . catch ( function ( error ) {
layer . msg ( error ) ;
} ) ;
return false ;
} ) ;
} ) ;
< / script >