3 Star 0 Fork 0

小盆友/scsx_html

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
store-add.html 5.71 KB
一键复制 编辑 原始数据 按行查看 历史
小盆友 提交于 2022-06-16 20:56 . enter
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>
<body>
<div class="x-body">
<form class="layui-form">
<div class="layui-form-item">
<label for="L_goods_id" class="layui-form-label">
<span class="x-red">*</span>商品编号
</label>
<div class="layui-input-inline">
<input type="text" id="L_goods_id" name="goodsId" required="" lay-verify="goods_id"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_goods_name" class="layui-form-label">
<span class="x-red">*</span>商品名称
</label>
<div class="layui-input-inline">
<input type="text" id="L_goods_name" name="goodsName" required="" lay-verify="goods_name"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_store" class="layui-form-label">
<span class="x-red">*</span>仓库ID
</label>
<div class="layui-input-inline">
<input type="text" id="L_buy" name="storeId" required="" lay-verify="storeId"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_store" class="layui-form-label">
<span class="x-red">*</span>仓库名称
</label>
<div class="layui-input-inline">
<input type="text" id="L_store" name="storeName" required="" lay-verify="store"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_goods_num" class="layui-form-label">
<span class="x-red">*</span>商品数量
</label>
<div class="layui-input-inline">
<input type="text" id="L_goods_num" name="goodsNum" required="" lay-verify="goods_num"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="L_add" class="layui-form-label">
</label>
<button class="layui-btn" lay-filter="add" lay-submit="" type="button">
增加
</button>
</div>
</form>
</div>
<script src="./lib/layui/layui.js" charset="utf-8">
</script>
<script src="./js/x-layui.js" charset="utf-8">
</script>
<script>
layui.use(['form','layer'], function(){
$ = layui.jquery;
var form = layui.form()
,layer = layui.layer;
//监听提交
form.on('submit(add)', function(data){
console.log(data.field);
console.log("打印数据");
//发异步,把数据提交给php
// $.ajax({
// url:"http://124.221.251.6:9000/order/add",
// type:"post",
// data:'{"orderId":"2001"}',
// dataType:"application/json",
// success:function(res){
// if(res.code==600){
// layer.alert("增加成功", {icon: 6},function () {
// x_admin_close();
// });
// }else{
// layer.alert(res.msg);
// }
// }
// });
// return false;
// });
fetch("http://124.221.251.6:9000/goodsAndStore/add", {
method: 'post',
body: JSON.stringify(data.field),
headers: {
'Content-Type': 'application/json'
}
}).then(function(msg) {
msg.json().then(function(res){
if(res.code==600){
layer.alert("增加成功", {icon: 6},function () {
parent.window.location.reload();
x_admin_close();
});
}else{
console.log(res)
layer.alert(res.msg);
}
})
});
});
});
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wudibinge/scsx_html.git
[email protected]:wudibinge/scsx_html.git
wudibinge
scsx_html
scsx_html
master

搜索帮助