Pārlūkot izejas kodu

费用入账empty,mapper,service,controller,list.jsp/js

yue 5 gadi atpakaļ
vecāks
revīzija
fe64034e0f

+ 17 - 0
src/main/java/com/jeeplus/modules/sg/financial/expense/mapper/ExpenseMapper.java

@@ -0,0 +1,17 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.expense.mapper;
+
+import com.jeeplus.core.persistence.BaseMapper;
+import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.expense.entity.Expense;
+
+import java.util.List;
+
+
+@MyBatisMapper
+public interface ExpenseMapper extends BaseMapper<Expense> {
+
+}

+ 104 - 0
src/main/java/com/jeeplus/modules/sg/financial/expense/mapper/xml/ExpenseMapper.xml

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.sg.financial.expense.mapper.ExpenseMapper">
+
+    <sql id="expenseColumns">
+		a.id,
+		a.projectName,
+		a.projectId,
+		a.projectBatch,
+		a.constructionCost,
+		a.designCost,
+		a.designTypeicalCost,
+		a.supervisionCost,
+		a.supervisionTypeicalCost,
+		a.documentDesignCost,
+		a.documentSupervisionCost
+	</sql>
+
+    <select id="get" resultType="Expense">
+        SELECT
+        <include refid="expenseColumns"/>
+        FROM js_expense_entry a
+        WHERE a.id = #{id}
+    </select>
+
+    <select id="findList" resultType="Expense">
+        SELECT
+        <include refid="expenseColumns"/>
+        FROM js_expense_entry a
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <select id="findAllList" resultType="Expense">
+        SELECT
+        <include refid="expenseColumns"/>
+        FROM js_expense_entry a
+        <where>
+            a.del_flag = #{DEL_FLAG_NORMAL}
+            ${dataScope}
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.update_date DESC
+            </otherwise>
+        </choose>
+    </select>
+
+    <insert id="insert">
+		INSERT INTO js_expense_entry(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			remarks,
+			projectName,
+			projectId,
+			projectBatch,
+			constructionCost,
+			designCost,
+			designTypeicalCost,
+			supervisionCost,
+			supervisionTypeicalCost,
+			documentDesignCost,
+			documentSupervisionCost
+		) VALUES (
+
+		)
+	</insert>
+
+    <update id="update">
+		UPDATE js_expense_entry SET
+
+
+		WHERE id = #{id}
+	</update>
+
+
+    <!--物理删除-->
+    <update id="delete">
+		DELETE FROM js_expense_entry
+		WHERE id = #{id}
+	</update>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic">
+		UPDATE js_expense_entry SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+</mapper>

+ 75 - 0
src/main/java/com/jeeplus/modules/sg/financial/expense/service/ExpenseService.java

@@ -0,0 +1,75 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.expense.service;
+
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.service.CrudService;
+import com.jeeplus.modules.sg.audit.information.entity.Information;
+import com.jeeplus.modules.sg.audit.information.service.InformationService;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditEquipment;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditMaterial;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpJudge;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditEquipmentMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMaterialMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ErpInfo;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportTemplate;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil;
+import com.jeeplus.modules.sg.financial.expense.entity.Expense;
+import com.jeeplus.modules.sg.financial.expense.mapper.ExpenseMapper;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import com.jeeplus.modules.sg.financial.settlement.mapper.DataMaintenanceMapper;
+import com.jeeplus.modules.sg.financial.settlement.service.DataMaintenanceService;
+import org.apache.poi.xssf.usermodel.XSSFFont;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Service
+@Transactional(readOnly = true)
+public class ExpenseService extends CrudService<ExpenseMapper, Expense> {
+    @Autowired
+    private ExpenseMapper expenseMapper;
+
+    @Override
+    public Expense get(String id) {
+        return super.get(id);
+    }
+
+    @Override
+    public List<Expense> findList(Expense entity) {
+        return super.findList(entity);
+    }
+
+    @Override
+    public List<Expense> findListBy(List<Expense> entity) {
+        return super.findListBy(entity);
+    }
+
+    @Override
+    public Page<Expense> findPage(Page<Expense> page, Expense entity) {
+        return super.findPage(page, entity);
+    }
+
+    @Override
+    public void save(Expense entity) {
+        super.save(entity);
+    }
+
+    @Override
+    public void delete(Expense entity) {
+        super.delete(entity);
+    }
+}

+ 226 - 0
src/main/java/com/jeeplus/modules/sg/financial/expense/web/ExpenseController.java

@@ -0,0 +1,226 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.expense.web;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.core.persistence.Page;
+import com.jeeplus.core.web.BaseController;
+import com.jeeplus.modules.sg.financial.expense.entity.Expense;
+import com.jeeplus.modules.sg.financial.expense.service.ExpenseService;
+import com.jeeplus.modules.test.onetomany.form.entity.TestDataMain2;
+import com.jeeplus.modules.test.onetomany.form.service.TestDataMain2Service;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 票务代理Controller
+ * @author liugf
+ * @version 2018-06-12
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/sg/financial/expense")
+public class ExpenseController extends BaseController {
+
+	@Autowired
+	private ExpenseService expenseService;
+	
+	@ModelAttribute
+	public Expense get(@RequestParam(required=false) String id) {
+		Expense entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = expenseService.get(id);
+		}
+		if (entity == null){
+			entity = new Expense();
+		}
+		return entity;
+	}
+	
+	/**
+	 * 票务代理列表页面
+	 */
+//	@RequiresPermissions("sg:financial:expense:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(Expense expense, Model model) {
+		model.addAttribute("expense", expense);
+		return "modules/sg/financial/expense/expenseList";
+	}
+	
+
+	 //票务代理列表数据
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(Expense expense, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<Expense> page = expenseService.findPage(new Page<Expense>(request, response), expense);
+		return getBootstrapData(page);
+	}
+
+	/*		*	*//**
+	 * 查看,增加,编辑票务代理表单页面
+	 *//*
+	@RequiresPermissions(value={"test:onetomany:form:testDataMain2:view","test:onetomany:form:testDataMain2:add","test:onetomany:form:testDataMain2:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form/{mode}")
+	public String form(@PathVariable String mode, TestDataMain2 testDataMain2, Model model) {
+		model.addAttribute("testDataMain2", testDataMain2);
+		model.addAttribute("mode", mode);
+		return "modules/test/onetomany/form/testDataMain2Form";
+	}
+
+	*//**
+	 * 保存票务代理
+	 *//*
+	@ResponseBody
+	@RequiresPermissions(value={"test:onetomany:form:testDataMain2:add","test:onetomany:form:testDataMain2:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(TestDataMain2 testDataMain2, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		*//**
+		 * 后台hibernate-validation插件校验
+		 *//*
+		String errMsg = beanValidator(testDataMain2);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		testDataMain2Service.save(testDataMain2);//保存
+		j.setSuccess(true);
+		j.setMsg("保存票务代理成功");
+		return j;
+	}
+	
+	*//**
+	 * 删除票务代理
+	 *//*
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(TestDataMain2 testDataMain2) {
+		AjaxJson j = new AjaxJson();
+		testDataMain2Service.delete(testDataMain2);
+		j.setMsg("删除票务代理成功");
+		return j;
+	}
+	
+	*//**
+	 * 批量删除票务代理
+	 *//*
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			testDataMain2Service.delete(testDataMain2Service.get(id));
+		}
+		j.setMsg("删除票务代理成功");
+		return j;
+	}
+	
+	*//**
+	 * 导出excel文件
+	 *//*
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:export")
+    @RequestMapping(value = "export")
+    public AjaxJson exportFile(TestDataMain2 testDataMain2, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "票务代理"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<TestDataMain2> page = testDataMain2Service.findPage(new Page<TestDataMain2>(request, response, -1), testDataMain2);
+    		new ExportExcel("票务代理", TestDataMain2.class).setDataList(page.getList()).write(response, fileName).dispose();
+    		j.setSuccess(true);
+    		j.setMsg("导出成功!");
+    		return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出票务代理记录失败!失败信息:"+e.getMessage());
+		}
+			return j;
+    }
+    
+    @ResponseBody
+    @RequestMapping(value = "detail")
+	public TestDataMain2 detail(String id) {
+		return testDataMain2Service.get(id);
+	}
+	
+
+	*//**
+	 * 导入Excel数据
+
+	 *//*
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:import")
+    @RequestMapping(value = "import")
+   	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
+		AjaxJson j = new AjaxJson();
+		try {
+			int successNum = 0;
+			int failureNum = 0;
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<TestDataMain2> list = ei.getDataList(TestDataMain2.class);
+			for (TestDataMain2 testDataMain2 : list){
+				try{
+					testDataMain2Service.save(testDataMain2);
+					successNum++;
+				}catch(ConstraintViolationException ex){
+					failureNum++;
+				}catch (Exception ex) {
+					failureNum++;
+				}
+			}
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 条票务代理记录。");
+			}
+			j.setMsg( "已成功导入 "+successNum+" 条票务代理记录"+failureMsg);
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入票务代理失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }
+	
+	*//**
+	 * 下载导入票务代理数据模板
+	 *//*
+	@ResponseBody
+	@RequiresPermissions("test:onetomany:form:testDataMain2:import")
+    @RequestMapping(value = "import/template")
+     public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+            String fileName = "票务代理数据导入模板.xlsx";
+    		List<TestDataMain2> list = Lists.newArrayList(); 
+    		new ExportExcel("票务代理数据", TestDataMain2.class, 1).setDataList(list).write(response, fileName).dispose();
+    		return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+    }*/
+	
+
+}

+ 154 - 0
src/main/webapp/webpage/modules/sg/financial/expense/expenseForm.jsp

@@ -0,0 +1,154 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>数据维护</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+			$('#startDate').datetimepicker({
+				format: "YYYY-MM-DD"
+			});
+			$('#endDate').datetimepicker({
+				format: "YYYY-MM-DD"
+			});
+		});
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/sg/settlement/save",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="maintainData" class="form-horizontal">
+		<form:hidden path="id"/>	
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目定义号:</label></td>
+					<td class="width-35">
+						<form:input path="projectId" htmlEscape="false"    class="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">设计单位:</label></td>
+					<td class="width-35">
+						<form:input path="designUnits" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">施工单位:</label></td>
+					<td class="width-35">
+						<form:input path="constructionUnits" htmlEscape="false"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">建筑地址:</label></td>
+					<td class="width-35">
+						<form:input path="address" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">建设性质:</label></td>
+					<td class="width-35">
+						<form:input path="property" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">发文总投资:</label></td>
+					<td class="width-35">
+						<form:input path="investment" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">开工时间:</label></td>
+					<td class="width-35">
+						<div class='input-group form_datetime' id='startDate'>
+							<input type='text'  name="startDate" class="form-control required"  value="<fmt:formatDate value="${maintainData.startDate}" pattern="yyyy-MM-dd"/>"/>
+							<span class="input-group-addon">
+			                        <span class="glyphicon glyphicon-calendar"></span>
+			                    </span>
+						</div>
+					</td>
+					<td class="width-15 active"><label class="pull-right">竣工时间:</label></td>
+					<td class="width-35">
+						<div class='input-group form_datetime' id='endDate'>
+						<input type='text'  name="endDate" class="form-control required"  value="<fmt:formatDate value="${maintainData.endDate}" pattern="yyyy-MM-dd"/>"/>
+						<span class="input-group-addon">
+			                        <span class="glyphicon glyphicon-calendar"></span>
+			                    </span>
+						</div>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">批准文号:</label></td>
+					<td class="width-35">
+						<form:input path="approvalNumber" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">建筑费:</label></td>
+					<td class="width-35">
+						<form:input path="buildingFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">安装费:</label></td>
+					<td class="width-35">
+						<form:input path="installFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">设备购置费:</label></td>
+					<td class="width-35">
+						<form:input path="equipmentFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">主材费:</label></td>
+					<td class="width-35">
+						<form:input path="materialFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">设计费:</label></td>
+					<td class="width-35">
+						<form:input path="designFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">监理费:</label></td>
+					<td class="width-35">
+						<form:input path="supervisionFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">前期工作费:</label></td>
+					<td class="width-35">
+						<form:input path="preliminaryWorkFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">线路施工赔偿费:</label></td>
+					<td class="width-35">
+						<form:input path="damages" htmlEscape="false"    class="form-control number"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">法人管理费:</label></td>
+					<td class="width-35">
+						<form:input path="managementFee" htmlEscape="false"    class="form-control number"/>
+					</td>
+				</tr>
+				<%--<tr>--%>
+					<%--<td class="width-15 active"><label class="pull-right">合计:</label></td>--%>
+					<%--<td class="width-35">--%>
+						<%--<form:input path="totalFee" htmlEscape="false"    class="form-control required"/>--%>
+					<%--</td>--%>
+				<%--</tr>--%>
+		 	</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 200 - 0
src/main/webapp/webpage/modules/sg/financial/expense/expenseList.js

@@ -0,0 +1,200 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#dataTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/sg/financial/expense/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		    }
+			,{
+		        field: 'projectName',
+                width:120,
+		        title: '项目名称'
+		    }
+		    ,{
+               field: 'projectId',
+               width:230,
+               title: '项目定义'
+
+           }
+		    ,{
+               field: 'constructionCost',
+               width:160,
+               title: '施工费合同折扣'
+
+           }
+		    ,{
+               field: 'designCost',
+               width:120,
+               title: '设计费合同折扣'
+           }
+           ,{
+               field: 'designTypeicalCost',
+               width:120,
+               title: '设计费典型设计折扣'
+           }
+           ,{
+               field: 'supervisionCost',
+               width:120,
+               title: '监理费合同折扣'
+           }
+           ,{
+               field: 'supervisionTypeicalCost',
+               width:120,
+               title: '监理费典型折扣'
+           }
+           ,{
+               field: 'documentDesignCost',
+               width:120,
+               title: '发文中设计费金额(不含税)'
+           }
+           ,{
+               field: 'documentSupervisionCost',
+               width:120,
+               title: '发文中监理费金额(不含税)'
+           }
+         ]
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#dataTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#dataTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#dataTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#dataTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+
+		
+
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#dataTable').bootstrapTable('refresh');
+		});
+
+
+
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#dataTable").bootstrapTable('getSelections'), function (row) {
+            return row.projectId
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该数据记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/sg/settlement/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#dataTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#dataTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增', "${ctx}/sg/settlement/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑', "${ctx}/sg/settlement/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看', "${ctx}/sg/settlement/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 81 - 0
src/main/webapp/webpage/modules/sg/financial/expense/expenseList.jsp

@@ -0,0 +1,81 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>费用入账管理</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="expenseList.js" %>
+	<script src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-resizable.js"></script>
+	<script src="${ctxStatic}/plugin/bootstrapTable/colResizable-1.6.js"></script>
+</head>
+<style>
+	.table {
+		table-layout:fixed;
+		word-break:break-all;
+		word-wrap:break-word;
+		text-align: center;
+	}
+	.table th, .table td {
+		text-align: center;
+		vertical-align: middle!important;
+	}
+</style>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">费用入账管理</h3>
+	</div>
+	<div class="panel-body">
+	
+	<!-- 搜索 -->
+	<div id="search-collapse" class="collapse">
+		<div class="accordion-inner">
+			<form:form id="searchForm" modelAttribute="expense" class="form form-horizontal well clearfix">
+			 <div class="col-xs-12 col-sm-6 col-md-4">
+				<label class="label-item single-overflow pull-left" title="项目定义号:">项目定义号:</label>
+				<form:input path="projectId" htmlEscape="false" maxlength="64"  class=" form-control"/>
+			</div>
+		 <div class="col-xs-12 col-sm-6 col-md-4">
+			<div style="margin-top:26px">
+			  <a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+			  <a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+			 </div>
+	    </div>	
+	</form:form>
+	</div>
+	</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+		<button id="add" class="btn btn-primary" onclick="add()">
+			<i class="glyphicon glyphicon-plus"></i> 新建
+		</button>
+		<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+			<i class="glyphicon glyphicon-remove"></i> 删除
+		</button>
+	</div>
+	<!-- 表格 -->
+	<table id="dataTable" style="table-layout:fixed"  data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<shiro:hasPermission name="sg:settlement:add">
+        <li data-item="view"><a>查看</a></li>
+        </shiro:hasPermission>
+    	<shiro:hasPermission name="sg:settlement:edit">
+        <li data-item="edit"><a>编辑</a></li>
+        </shiro:hasPermission>
+        <shiro:hasPermission name="sg:settlement:del">
+        <li data-item="delete"><a>删除</a></li>
+        </shiro:hasPermission>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>