<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="UTF-8">
|
<meta name="viewport"
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
<title>代理订单忽略管理</title>
|
<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
|
<style>
|
body {
|
padding: 10px;
|
}
|
|
input {
|
width: 200px !important;
|
}
|
</style>
|
</head>
|
|
<body>
|
|
<form class="layui-form" lay-filter="edit">
|
<div class="layui-form-item">
|
<label class="layui-form-label">起始单数</label>
|
<div class="layui-input-block">
|
<input type="text" name="beginCount" required lay-verify="required|num"
|
placeholder="起始单数" autocomplete="off" class="layui-input">
|
<div class="layui-form-mid layui-word-aux">当代理每日提交单数达到后才执行忽略</div>
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">忽略百分比</label>
|
<div class="layui-input-block">
|
<input type="text" name="percent" required lay-verify="required|num"
|
placeholder="忽略百分比" autocomplete="off" class="layui-input">
|
<div class="layui-form-mid layui-word-aux">如:20 就表示忽略掉20%的订单,0表示不忽略</div>
|
</div>
|
</div>
|
<div class="layui-input-block">
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="sure" id="sure">确定</button>
|
</div>
|
</form>
|
<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
|
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
<script src="js/http_api.js"></script>
|
<script>
|
layui.use(['form', 'layedit', 'laydate'], function() {
|
var form = layui.form,
|
layer = layui.layer;
|
|
|
//自定义验证规则
|
form.verify({
|
num: [/^(\d)+$/, "只能包含数字"]
|
});
|
|
let index = layer.load(1);
|
|
$.post("/admin/api/settings/getIgnoreAgentOrderSetting", {},
|
function(response) {
|
layer.close(index);
|
if (response.code == 0) {
|
form.val("edit", response.data);
|
} else {
|
layer.msg(response.msg);
|
}
|
}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
|
layer.msg("网络请求失败");
|
layer.close(index);
|
});
|
|
|
//监听提交
|
form.on('submit(sure)', function(data) {
|
var params = data.field;
|
console.log(params);
|
$.post("/admin/api/settings/setIgnoreAgentOrderSetting", params,
|
function(response) {
|
if (response.code == 0) {
|
layer.msg("修改成功");
|
} else {
|
layer.msg(response.msg);
|
}
|
}, 'json').fail(function(jqXHR, textStatus, errorThrown) {
|
layer.msg("网络请求失败");
|
});
|
return false;
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|