@GetMapping(value = "/salary/taxStandard/main")
public String mainPage(TaxStandardDomain filterMask, Model model, HttpServletRequest request,
HttpServletResponse response) {
ChannelUserInfo user = (ChannelUserInfo) request.getSession().getAttribute("user");
HashMap<String, Object> attrMap = new HashMap<>();
String channelType = request.getParameter(SysConstants.CHANNEL_TYPE);
if (channelType == null || channelType.isEmpty()) {
channelType = user.getChannelType();
}
// 得到三级机构下拉框信息
attrMap.put(SysConstants.GET_ORGAN_CODE_LIST, commonService.getOrgansByOrganLevel(user, 3));
// 得到税种下拉框
attrMap.put(SysConstants.GET_SALARY_TYPE_LIST, taxStandardService.getSalaryTypeList(channelType));
attrMap.put(SysConstants.FILTER_MASK, filterMask);
model.addAllAttributes(attrMap);
return "salary/TaxStandard/main";
}
main.jsp页面如下
<%@ page language="java" contentType="text/html;charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="com.foresealife.channel.salary.domain.TaxStandardDomain" %>
<!DOCTYPE html>
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/views/commons/head.jsp"%>
</head>
<script type="text/javascript">
$(function(){
$("#paginateForm").find("select").css("width" , "134px");
$("#paginateForm").find("input").css("width" , "134px");
});
<%--新增--%>
function addrow(){
$("#paginateForm").attr("action","${ctx}salary/taxStandard/newPage.do");
$("#paginateForm").submit();
}
<%--修改--%>
function editrow(obj){
var index=$(obj).parent().parent().parent().attr("datagrid-row-index");
var row = $('#TaxStandardTable').datagrid('getRows')[index];
for(var pro in row){
$("#editForm").append("<input type='hidden' name='"+pro+"' id='"+pro+"' value='"+row[pro]+"'/>");
}
url = "${ctx}salary/taxStandard/editPage.do";
$("#editForm").attr("action",url);
$("#editForm").submit();
}
<%--查询--%>
function queryAction(){
if(!$('#paginateForm').form('validate')){
return false;
}
var wd = $("#width").width();
var data = $("#paginateForm").serialize();
data = decodeURIComponent(data, true);
var send_url = "${ctx}salary/taxStandard/query.do?"+data;
var col_size = 17;
$('#TaxStandardTable').datagrid({
title:'查询信息',
fitColumns: true,
width:wd,
url:send_url,
columns:[[
{field:'organCode',title:'机构代码',align:'center',width:100},
{field:'organName',title:'机构名称',align:'center',width:100},
{field:'description',title:'税种',align:'center',width:100},
{field:'baseType',title:'交税方式',align:'center',width:50,hidden:true},
{field:'baseTypeName',title:'交税方式',align:'center',width:100},
{field:'territoryTypeDesc',title:'境内/境外代理人',align:'center',width:100},
{field:'taxRate',title:'税率',align:'center',width:80},
{field:'startStandard',title:'起征点',align:'center',width:80},
{field:'deductSum',title:'速算扣除数',align:'center',width:80},
{field:'startDate',title:'开始时间',align:'center',width:100,
formatter:function(value,row,index){
return row['startDate'].substring(0,10);
}},
{field:'endDate',title:'结束时间',align:'center',width:100,
formatter:function(value,row,index){
return row['endDate'].substring(0,19);
}},
{field:'ratifyStatus',title:'税率状态',align:'center',width:80,
formatter:function(value,row,index){
var ratifyStatusName = "";
if(row['ratifyStatus'] == '1'){
ratifyStatusName ='待复核';
}else if(row['ratifyStatus'] == '2'){
ratifyStatusName ='复核';
}else if(row['ratifyStatus'] == '3'){
ratifyStatusName ='复核通过';
}else if(row['ratifyStatus'] == '4'){
ratifyStatusName ='复核不通过';
}
return ratifyStatusName;
}
}
/* {field:'operate',title:'操作',align:'center',width:wd*(1/(col_size+1)-0.01),
formatter:function(value,row,index){
if(row['endDate'] == '' && row['ratifyStatus'] != '4'){
return '<a name="edit_data" href="#" onclick="javascript:editrow(this);">修改</a>';
}else{
return null;
}
}
} */
]],
pagination:true
});
var opts = $('#TaxStandardTable').datagrid('load');
}
</script>
<body style="background-color: #fff;" id="width">
<sfform:form modelAttribute="filterMask" id="paginateForm">
<div class="layout_div">
<div class="navigation_div">
<span class="font_heading1">税率设置>></span><a href="#">税率标准设置</a>
<sfform:input path="channelType" id="channelType" type="hidden"></sfform:input>
<sfform:input path="organLevel" id="organLevel" value="123"
type="hidden"></sfform:input>
</div>
<fieldset class="fieldsetdefault">
<legend>查询</legend>
<table class="layouttable" id="input_info">
<tr>
<td class="layouttable_td_label">所属机构:</td>
<td class="zTreeDemoBackground left"><%@ include
file="/WEB-INF/views/commons/organ.jsp"%>
</td>
<td class="layouttable_td_label">税种:</td>
<td class="layouttable_td_widget"><sfform:select
path="taxType" id="taxType" class="input_text">
<sfform:option value="">--请选择--</sfform:option>
<sfform:options items="${getSalaryTypeList}"
itemValue="salaryType" itemLabel="description"></sfform:options>
</sfform:select></td>
<td class="layouttable_td_label">状态:</td>
<td class="layouttable_td_widget"><sfform:select
path="ratifyStatus" id="ratifyStatus" class="input_text">
<sfform:option value="">--请选择--</sfform:option>
<sfform:option value="1">--待复核--</sfform:option>
<sfform:option value="3">--复核通过--</sfform:option>
</sfform:select></td>
</tr>
</table>
<table class="query_table">
<tr>
<td class="td_right"><a class="easyui-linkbutton"
onclick="javascript:queryAction()" iconCls="icon-search"
id="search">查询</a> <a class="easyui-linkbutton"
onclick="javascript:addrow()" iconCls="icon-add" id="search">新增</a>
</td>
</tr>
</table>
</fieldset>
<div class="layout_div_top_spance">
<table id="TaxStandardTable"></table>
</div>
</div>
</sfform:form>
<form id="editForm" method="post"></form>
</body>
</html>
@PostMapping(value = "/salary/taxStandard/newPage")
public String newPage(TaxStandardDomain filterMask, Model model, HttpServletRequest request,
HttpServletResponse response) {
ChannelUserInfo user = (ChannelUserInfo) request.getSession().getAttribute("user");
TaxStandardDomain tax = new TaxStandardDomain();
HashMap<String, Object> attrMap = new HashMap<>();
String channelType = filterMask.getChannelType();
if (channelType == null || channelType.isEmpty()) {
channelType = user.getChannelType();
}
// 得到三级机构下拉框信息
attrMap.put(SysConstants.GET_ORGAN_CODE_LIST, commonService.getOrgansByOrganLevel(user, 3));
// 得到税种下拉框
attrMap.put(SysConstants.GET_SALARY_TYPE_LIST, taxStandardService.getSalaryTypeList(channelType));
attrMap.put(SysConstants.FILTER_MASK, tax);
model.addAllAttributes(attrMap);
return "salary/TaxStandard/new";
}String channelType = request.getParameter(SysConstants.CHANNEL_TYPE)为空的情况下, channelType = user.getChannelType()的值会被绑定到前端channelType 吗,如果不为空呢
最新发布