RuoYi/box-bps/src/main/resources/templates/bps/subscribe/add.html

101 lines
4.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增快递订阅')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-subscribe-add">
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码:</label>
<div class="col-sm-8">
<select name="company" class="form-control m-b" th:with="type=${@dict.getType('express_company')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="number" id="number" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收/寄件人电话:</label>
<div class="col-sm-8">
<input name="phone" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-3 control-label">盐:</label>
<div class="col-sm-8">
<input name="salt" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅时间:</label>
<div class="col-sm-8">
<input name="subscribeTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅结果:</label>
<div class="col-sm-8">
<input name="result" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回码:</label>
<div class="col-sm-8">
<input name="returnCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回消息:</label>
<div class="col-sm-8">
<input name="message" class="form-control" type="text">
</div>
</div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "bps/subscribe"
$("#form-subscribe-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
//$.operate.save(prefix + "/add", $('#form-subscribe-add').serialize());
sendForm();
$.modal.close();
}
}
function sendForm() {
var formObject={};
$("#form-subscribe-add").serializeArray().map(function(val,key){formObject[val.name]=val.value;})
$.ajax({
url:ctx+"bps/subscribe/subscribe",
type:"POST",
contentType: "application/json",
data: JSON.stringify(formObject),
dataType: "json",
async:false, //如果不加async:false参数ajax请求默认是异步的会出现工程启动后第一次订阅返回canceled不执行success任务的问题
success:function(data){
alert(JSON.stringify(data));
parent.$("#number").val($("#number").val());
parent.$.table.search();
},
error:function(e){
alert("错误!!");
}
});
};
</script>
</body>
</html>