提交 1ecb774e 编写于 作者: L lsh

新增客户等级界面。

上级 d54c3439
#(token)
<input type="hidden" name="id" value="#(customerPriceLevel.id??)">
<div class="row">
<div class="col-1"></div>
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text">价格等级名称<span class="text-danger">*</span></span>
<input type="text" maxlength="30" class="form-control" name="name" id="customerPriceLevel_name" placeholder="请输入价格等级名称" value="#(customerPriceLevel.name??)">
</div>
</div>
<div class="col-1"></div>
</div>
<div class="row">
<div class="col-1"></div>
<div class="col">
<div class="input-group mb-3">
<span class="input-group-text">备注</span>
<input type="text" maxlength="30" class="form-control" name="remark" placeholder="请输入备注" value="#(customerPriceLevel.remark??)">
</div>
</div>
<div class="col-1"></div>
</div>
<script type="application/javascript">
customerPriceLevel.formChecking = function() {
if($.trim($("#customerPriceLevel_name").val()) == '') {
beekit.tips('价格等级名称不能为空!', '#customerPriceLevel_name');
$("#customerPriceLevel_name").focus();
return false;
}
if($.trim($("#customerPriceLevel_name").val()).length > 30) {
beekit.tips('价格等级名称不能过长!', '#customerPriceLevel_name');
$("#customerPriceLevel_name").focus();
return false;
}
return true;
};
</script>
\ No newline at end of file
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered ">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">新增价格等级</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="customerPriceLevel-add-form" onsubmit="customerPriceLevel.create();return false;">
#include("_form.html")
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close">关闭</button>
<button type="button" class="btn btn-primary" onclick="customerPriceLevel.create();">保存</button>
</div>
</div>
</div>
<script type="application/javascript">
$(function() {
// 初始化bootstrap相关组件
common.initBootstrap();
formInput.listenkeyUp("#customerPriceLevel-add-form");
setTimeout(function() {
$("#customerPriceLevel_name").focus();
}, 200);
});
customerPriceLevel.create = function() {
var result = customerPriceLevel.formChecking();
if(!result) {
return;
}
beekit.ajaxPost("/sale/customer/priceLevel/create", $("#customerPriceLevel-add-form").serialize(), function(ret) {
beekit.msg(ret);
if (ret.state == "ok") {
beekit.modalClose();
customerPriceLevel.list(ret.targetId);
}
});
};
</script>
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered ">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title">编辑价格等级</h6>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="customerPriceLevel-edit-form" onsubmit="customerPriceLevel.update();return false;">
#include("_form.html")
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close">关闭</button>
<button type="button" class="btn btn-primary" onclick="customerPriceLevel.update();">保存</button>
</div>
</div>
</div>
<script type="application/javascript">
$(function() {
// 初始化bootstrap相关组件
common.initBootstrap();
formInput.listenkeyUp("#customerPriceLevel-edit-form");
});
customerPriceLevel.update = function() {
var result = customerPriceLevel.formChecking();
if(!result) {
return;
}
beekit.ajaxPost("/sale/customer/priceLevel/update", $("#customerPriceLevel-edit-form").serialize(), function(ret) {
beekit.msg(ret);
if (ret.state == "ok") {
beekit.modalClose();
customerPriceLevel.list(#(customerPriceLevel.id));
}
});
};
</script>
<div class="card mb-2">
<div class="card-body search-form">
<form id="customerPriceLevel-search-form">
<input type="hidden" id="customerPriceLevel_pageNumber" name="pageNumber">
<div class="row align-items-center">
<div class="col">
#if(session.hasOper(Permissions.sale_customer_priceLevel_create))
<button type="button" class="btn btn-sm btn-primary" onclick="customerPriceLevel.add();">
<i class="bi bi-plus-circle"></i>新增价格等级
</button>
#end
</div>
</div>
</form>
</div>
</div>
<div id="data-list-customerPriceLevel">
</div>
<script type="application/javascript">
var customerPriceLevel = {};
$(function() {
// 初始化bootstrap相关组件
common.initBootstrap();
// 加载列表
customerPriceLevel.list();
});
customerPriceLevel.list = function(targetId) {
beekit.ajaxFillPage("/sale/customer/priceLevel/list", "#customerPriceLevel-search-form", "#data-list-customerPriceLevel", "customerPriceLevel-data-"+targetId);
};
customerPriceLevel.add = function() {
beekit.modal("/sale/customer/priceLevel/add");
};
</script>
#if(page.totalPage > 1)
<div class="card card-table mb-1">
<div class="card-body page-body">
<div class="row align-items-center oper-list">
<div class="col">
<div class="float-end">#@paginate(page.pageNumber, page.totalPage, "")</div>
</div>
</div>
</div>
</div>
#end
<table class="table table-hover table-bordered bg-white">
<thead>
<tr class="table-header">
<th>价格等级名称</th>
<th>备注</th>
<th>状态</th>
<th style="width: 20%">操作</th>
</tr>
</thead>
<tbody class="table-row">
#for (x : page.getList())
<tr id="customerPriceLevel-data-#(x.id)">
<td class="fw-bold text-secondary">#(x.name)</td>
<td>#(x.remark??)</td>
<td>
#if(x.data_status == DataStatusEnum.enable.value)
<span class="text-success">启用中</span>
#elseif(x.data_status == DataStatusEnum.disable.value)
<span class="text-danger">已停用</span>
#end
</td>
<td>
#if(session.hasOper(Permissions.sale_customer_priceLevel_update))
<button type="button" class="btn btn-sm sm-more btn-outline-primary" onclick="customerPriceLevel.edit(#(x.id));">修改</button>
#end
#if(!x.default_flag)
#if(session.hasOper(Permissions.sale_customer_priceLevel_delete))
<button type="button" class="btn btn-sm sm-more btn-outline-danger" onclick="customerPriceLevel.delete(#(x.id));">删除</button>
#end
#if(session.hasOper(Permissions.sale_customer_priceLevel_disable))
#if(x.data_status == DataStatusEnum.enable.value)
<button type="button" class="btn btn-sm sm-more btn-outline-danger" onclick="customerPriceLevel.disable(#(x.id));">停用</button>
#elseif(x.data_status == DataStatusEnum.disable.value)
<button type="button" class="btn btn-sm sm-more btn-outline-success" onclick="customerPriceLevel.enable(#(x.id));">启用</button>
#end
#end
#end
</td>
</tr>
#end
</tbody>
</table>
<script type="application/javascript">
$(function() {
// 初始化bootstrap相关组件
common.initBootstrap();
// 滚动表头处理
common.tableFixedWidth();
common.tableFixed();
$(".main").scroll(function() {
common.tableFixed();
});
$("#customerPriceLevel_pageNumber").val(#(page.pageNumber));
});
customerPriceLevel.edit = function(id) {
beekit.modal("/sale/customer/priceLevel/edit?id="+id);
};
customerPriceLevel.delete = function(id) {
beekit.focusColor("customerPriceLevel-data-"+id);
beekit.confirmByUrl("/sale/customer/priceLevel/delete", {"id":id}, "确认要删除此价格等级吗?", function(ret) {
beekit.msg(ret);
customerPriceLevel.list();
});
};
customerPriceLevel.disable = function(id) {
beekit.confirmByUrl("/sale/customer/priceLevel/disable", {"id":id}, "确认要停用此价格等级吗?", function(ret) {
beekit.msg(ret);
customerPriceLevel.list(id);
});
};
customerPriceLevel.enable = function(id) {
beekit.confirmByUrl("/sale/customer/priceLevel/enable", {"id":id}, "确认要启用此价格等级吗?", function(ret) {
beekit.msg(ret);
customerPriceLevel.list(id);
});
};
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册