<!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;
|
}
|
|
#sure {
|
visibility: hidden;
|
}
|
|
.layui-form-label {
|
width: 150px;
|
}
|
|
.layui-input-block {
|
margin-left: 180px;
|
max-width: 400px;
|
}
|
</style>
|
</head>
|
|
<body>
|
|
<form class="layui-form" lay-filter="edit">
|
<input type="hidden" name="id"/>
|
<div class="layui-form-item">
|
<label class="layui-form-label">口令内容:</label>
|
<div class="layui-input-block">
|
<textarea name="keywordContent" rows="5" required lay-verify="required" placeholder="口令内容"
|
autocomplete="off" class="layui-textarea"></textarea>
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">商品来源:</label>
|
<div class="layui-input-block">
|
<select name="productSource" required lay-verify="required">
|
<option value="">请选择商品来源</option>
|
<option value="1">抖音</option>
|
<option value="2">快手</option>
|
</select>
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">商品名称:</label>
|
<div class="layui-input-block">
|
<textarea name="productName" rows="3" required lay-verify="required" placeholder="商品名称" autocomplete="off"
|
class="layui-textarea"></textarea>
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">店铺名称:</label>
|
<div class="layui-input-block">
|
<input type="text" name="shopName" placeholder="店铺名称" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">所需下单数量:</label>
|
<div class="layui-input-block">
|
<input type="number" name="requiredOrderCount" required lay-verify="required|number" min="1"
|
placeholder="所需下单数量" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">收货周期(小时):</label>
|
<div class="layui-input-block">
|
<input type="number" name="receiveCycleHours" required lay-verify="required|number" min="1"
|
placeholder="收货周期(小时)" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">下单开始时间:</label>
|
<div class="layui-input-block">
|
<input type="text" name="orderStartTime" id="orderStartTime" required lay-verify="required"
|
placeholder="下单开始时间" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-form-item">
|
<label class="layui-form-label">下单结束时间:</label>
|
<div class="layui-input-block">
|
<input type="text" name="orderEndTime" id="orderEndTime" required lay-verify="required"
|
placeholder="下单结束时间" autocomplete="off" class="layui-input">
|
</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>
|
var listener;
|
|
function submit(callback) {
|
//暂存回调方法
|
listener = callback;
|
//表单提交按钮
|
$("#sure").click();
|
}
|
|
layui.use(['form', 'layedit', 'laydate'], function () {
|
var form = layui.form,
|
layer = layui.layer,
|
laydate = layui.laydate;
|
|
//自定义验证规则
|
form.verify({
|
num: [/^\d+$/, "必须为正整数"],
|
money: [/^\d+(\.\d{1,2})?$/, "金额最多保留2位小数"]
|
});
|
|
// 日期控件初始化
|
laydate.render({
|
elem: '#orderStartTime',
|
type: 'datetime',
|
theme: '#448aff'
|
});
|
|
laydate.render({
|
elem: '#orderEndTime',
|
type: 'datetime',
|
theme: '#448aff'
|
});
|
|
var id = http_util.getQueryString("id");
|
// 获取值
|
$.post("/admin/api/ordertask/js2/get", {
|
"id": id
|
}, function (response) {
|
if (response.code == 0) {
|
form.val("edit", response.data);
|
} else {
|
layer.msg(response.msg);
|
}
|
}, 'json').fail(function (jqXHR, textStatus, errorThrown) {
|
layer.msg("网络请求失败");
|
});
|
|
//监听提交
|
form.on('submit(sure)', function (data) {
|
listener(data.field);
|
return false;
|
});
|
});
|
</script>
|
</body>
|
|
</html>
|